openbsd-ports/sysutils/xosview/patches/patch-aa
1999-07-09 15:39:54 +00:00

100 lines
2.9 KiB
Plaintext

# $OpenBSD: patch-aa,v 1.7 1999/07/09 15:39:54 form Exp $
--- bsd/kernel.cc.orig Fri Jul 9 22:17:49 1999
+++ bsd/kernel.cc Fri Jul 9 22:21:52 1999
@@ -67,7 +67,11 @@
#ifdef HAVE_SWAPCTL
#include <unistd.h> /* For swapctl proto. */
+#ifdef XOSVIEW_OPENBSD
+#include <sys/swap.h>
+#else
#include <vm/vm_swap.h> /* For swapent, SWAP_*. */
+#endif
#include <stdlib.h> /* For malloc(), free(). */
#endif
@@ -153,9 +157,9 @@
{ "_eintrcnt" },
#define EINTRCNT_SYM_INDEX 8
-#if defined(XOSVIEW_OPENBSD) && (defined(pc532) || defined(i386))
+#if defined(XOSVIEW_OPENBSD) && (defined(__pc532__) || defined(__i386__))
-# ifdef i386
+# ifdef __i386__
{ "_intrhand" },
#define INTRHAND_SYM_INDEX 9
{ "_intrstray" },
@@ -750,7 +754,7 @@
}
/* ---------------------- Interrupt Meter stuff ----------------- */
-#if (!defined(XOSVIEW_OPENBSD) || !(defined(pc532) && defined(i386))) && !defined(XOSVIEW_BSDI)
+#if (!defined(XOSVIEW_OPENBSD) || !(defined(__pc532__) && defined(__i386__))) && !defined(XOSVIEW_BSDI)
static unsigned long kvm_intrcnt[128];// guess at space needed
#endif
@@ -770,9 +774,9 @@
BSDIntrInit() {
OpenKDIfNeeded();
-#if defined(XOSVIEW_OPENBSD) && defined(i386)
+#if defined(XOSVIEW_OPENBSD) && defined(__i386__)
return ValidSymbol(INTRHAND_SYM_INDEX) && ValidSymbol(INTRSTRAY_SYM_INDEX);
-#elif defined (XOSVIEW_OPENBSD) && defined(pc532)
+#elif defined (XOSVIEW_OPENBSD) && defined(__pc532__)
return ValidSymbol(IVP_SYM_INDEX);
#elif defined (XOSVIEW_BSDI)
#if _BSDI_VERSION >= 199802 /* BSD/OS 4.x */
@@ -785,7 +789,7 @@
#endif
}
-#if (!defined(XOSVIEW_OPENBSD) || !(defined(pc532) || defined(i386))) && !defined (XOSVIEW_BSDI)
+#if (!defined(XOSVIEW_OPENBSD) || !(defined(__pc532__) || defined(__i386__))) && !defined (XOSVIEW_BSDI)
int
BSDNumInts() {
int nintr;
@@ -846,8 +850,8 @@
// counts. We'll just use the intrcnt array here. If anyone
// has problems, please mail me. bgrayson
{
-#if defined(XOSVIEW_OPENBSD) && (defined(pc532) || defined(i386))
-# ifdef i386
+#if defined(XOSVIEW_OPENBSD) && (defined(__pc532__) || defined(__i386__))
+# ifdef __i386__
struct intrhand *intrhand[16], *ihp, ih;
int intrstray[16];
@@ -868,8 +872,8 @@
ihp = ih.ih_next;
}
}
-# endif /* i386 */
-# ifdef pc532
+# endif /* __i386__ */
+# ifdef __pc532__
struct iv ivt[32], *ivp = ivt;
safe_kvm_read(nlst[IVP_SYM_INDEX].n_value, ivp, sizeof(ivt));
@@ -879,15 +883,15 @@
else
intrCount[i] = 0;
}
-# endif /* pc532 */
-#else /* XOSVIEW_OPENBSD && (pc532 || i386) */
+# endif /* __pc532__ */
+#else /* XOSVIEW_OPENBSD && (__pc532__ || __i386__) */
int nintr = BSDNumInts();
safe_kvm_read(nlst[INTRCNT_SYM_INDEX].n_value, kvm_intrcnt,
sizeof(long)*nintr);
for (int i=0;i<nintr;i++) {
intrCount[i] = kvm_intrcnt[i];
}
-#endif /* XOSVIEW_OPENBSD && (pc532 || i386) */
+#endif /* XOSVIEW_OPENBSD && (__pc532__ || __i386__) */
}
return;
#endif