*** netbsd/kernel.cc.orig Sat Nov 15 03:00:02 1997 --- netbsd/kernel.cc Fri Mar 13 17:26:48 1998 *************** *** 22,25 **** --- 22,26 ---- #include /* For err(), warn(), etc. BCG */ + #include #include /* For CPUSTATES, which tells us how many cpu states there are. */ *************** *** 34,38 **** --- 35,53 ---- #include /* NetMeter helper functions. */ #endif + + #include + + #if defined(UVM) + #include + #include + #include + #include + #else + #include + #include #include /* For struct vmmeter. */ + #endif + + #include #include "kernel.h" /* To grab CVSID stuff. */ *************** *** 52,56 **** --- 67,75 ---- { "_ifnet" }, #define IFNET_SYM_INDEX 1 + #if defined(UVM) + { "_disklist" }, //Just to make kvm_nlist happy + #else { "_cnt" }, + #endif #define VMMETER_SYM_INDEX 2 #ifndef XOSVIEW_FREEBSD /* FreeBSD doesn't have a diskmeter yet. */ *************** *** 148,151 **** --- 167,185 ---- NetBSDPageInit() { OpenKDIfNeeded(); } + #if defined(UVM) + void + NetBSDGetPageStats(struct uvmexp* uvm) { + size_t size; + int mib[2]; + if (!uvm) errx(-1, "NetBSDGetPageStats(): passed pointer was null!\n"); + size = sizeof(uvmexp); + mib[0] = CTL_VM; + mib[1] = VM_UVMEXP; + if (sysctl(mib, 2, uvm, &size, NULL, 0) < 0) { + printf("can't get uvmexp: %s\n", strerror(errno)); + memset(&uvm, 0, sizeof(uvmexp)); + } + } + #else void NetBSDGetPageStats(struct vmmeter* vmp) { *************** *** 153,157 **** safe_kvm_read_symbol(VMMETER_SYM_INDEX, vmp, sizeof(struct vmmeter)); } ! // ------------------------ CPUMeter functions ------------------ --- 187,191 ---- safe_kvm_read_symbol(VMMETER_SYM_INDEX, vmp, sizeof(struct vmmeter)); } ! #endif // ------------------------ CPUMeter functions ------------------