84 lines
3.3 KiB
Plaintext
84 lines
3.3 KiB
Plaintext
$OpenBSD: patch-bsd_kernel_cc,v 1.3 2004/02/19 22:19:41 naddy Exp $
|
|
--- bsd/kernel.cc.orig 2001-10-09 04:40:51.000000000 +0200
|
|
+++ bsd/kernel.cc 2004-02-19 23:10:45.000000000 +0100
|
|
@@ -76,7 +76,7 @@ int DevStat_Get();
|
|
|
|
#ifdef HAVE_SWAPCTL
|
|
#include <unistd.h> /* For swapctl proto. */
|
|
-#if defined(XOSVIEW_NETBSD) && defined(__NetBSD_Version__) && __NetBSD_Version__ >= 104000000
|
|
+#if defined(XOSVIEW_OPENBSD) || (defined(XOSVIEW_NETBSD) && defined(__NetBSD_Version__) && __NetBSD_Version__ >= 104000000)
|
|
#include <sys/swap.h> /* For swapent, SWAP_*. */
|
|
#else
|
|
#include <vm/vm_swap.h> /* swapent, SWAP_*. */
|
|
@@ -166,9 +166,9 @@ static struct nlist nlst[] =
|
|
{ "_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" },
|
|
@@ -776,7 +776,7 @@ BSDGetDiskXFerBytes (unsigned long long
|
|
while (kvmdiskptr != NULL) {
|
|
safe_kvm_read ((u_long)kvmdiskptr, &kvmcurrdisk, sizeof(kvmcurrdisk));
|
|
/* Add up the contribution from this disk. */
|
|
- *bytesXferred += kvmcurrdisk.dk_bytes;
|
|
+ *bytesXferred += kvmcurrdisk.dk_rbytes + kvmcurrdisk.dk_wbytes;
|
|
#ifdef DEBUG
|
|
printf ("Got %#x (lower 32bits)\n", (int) (*bytesXferred & 0xffffffff));
|
|
#endif
|
|
@@ -786,7 +786,7 @@ BSDGetDiskXFerBytes (unsigned long long
|
|
}
|
|
|
|
/* ---------------------- 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
|
|
|
|
@@ -806,9 +806,9 @@ int
|
|
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 */
|
|
@@ -821,7 +821,7 @@ BSDIntrInit() {
|
|
#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;
|
|
@@ -882,8 +882,8 @@ BSDGetIntrStats (unsigned long intrCount
|
|
// 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];
|
|
|
|
@@ -916,7 +916,7 @@ BSDGetIntrStats (unsigned long intrCount
|
|
intrCount[i] = 0;
|
|
}
|
|
# endif /* pc532 */
|
|
-#else /* XOSVIEW_OPENBSD && (pc532 || i386) */
|
|
+#else /* XOSVIEW_OPENBSD && (__pc532__ || __i386__) */
|
|
int nintr = BSDNumInts();
|
|
safe_kvm_read(nlst[INTRCNT_SYM_INDEX].n_value, kvm_intrcnt,
|
|
sizeof(long)*nintr);
|