diff options
author | agc <agc@pkgsrc.org> | 1998-03-18 13:42:15 +0000 |
---|---|---|
committer | agc <agc@pkgsrc.org> | 1998-03-18 13:42:15 +0000 |
commit | 868c6db9c6c2a5fa0d8f834c9a4383c4ed97b75b (patch) | |
tree | f10f9083df24385678a9cc93eeebdb8df53ebbe2 /sysutils/xosview | |
parent | b0f37c43985e03db5218926e78a6d6dffe71779b (diff) | |
download | pkgsrc-868c6db9c6c2a5fa0d8f834c9a4383c4ed97b75b.tar.gz |
Patches from Mario Kemper to make xosview work with UVM.
Munged around by me to:
+ make it work with old VM as well as UVM.
+ cut down the context in two of the patches to miss out Id strings.
Diffstat (limited to 'sysutils/xosview')
-rw-r--r-- | sysutils/xosview/Makefile | 3 | ||||
-rw-r--r-- | sysutils/xosview/patches/patch-aa | 50 | ||||
-rw-r--r-- | sysutils/xosview/patches/patch-ab | 38 | ||||
-rw-r--r-- | sysutils/xosview/patches/patch-ac | 79 | ||||
-rw-r--r-- | sysutils/xosview/patches/patch-ad | 16 | ||||
-rw-r--r-- | sysutils/xosview/patches/patch-ae | 27 |
6 files changed, 192 insertions, 21 deletions
diff --git a/sysutils/xosview/Makefile b/sysutils/xosview/Makefile index 2624205bfbf..546dff3b7c0 100644 --- a/sysutils/xosview/Makefile +++ b/sysutils/xosview/Makefile @@ -3,7 +3,7 @@ # Date created: Fri Oct 24 10:03:55 BST 1997 # Whom: Alistair Crooks (agc@netbsd.org) # -# $NetBSD: Makefile,v 1.7 1998/02/11 08:10:16 tron Exp $ +# $NetBSD: Makefile,v 1.8 1998/03/18 13:42:15 agc Exp $ # DISTNAME= xosview-1.5.1 @@ -16,6 +16,7 @@ GNU_CONFIGURE= yes USE_X11= yes MAN1= xosview.1 +MAKE_ENV+= UVM=${UVM} MAKE_FLAGS= ARCH=${ARCH} -f .include <bsd.port.mk> diff --git a/sysutils/xosview/patches/patch-aa b/sysutils/xosview/patches/patch-aa index 078f1fb7f5b..829392989aa 100644 --- a/sysutils/xosview/patches/patch-aa +++ b/sysutils/xosview/patches/patch-aa @@ -1,20 +1,30 @@ ---- config/Makefile.netbsd.in.orig Sat Nov 29 21:58:24 1997 -+++ config/Makefile.netbsd.in Wed Feb 11 00:31:43 1998 -@@ -9,6 +9,17 @@ - - CXXFLAGS += -I@top_srcdir@ - -+.include <bsd.port.subdir.mk> -+.if (${ARCH} == "hp300") -+CXXFLAGS += -D_HP300_CPU_H_ -+.endif -+.if (${ARCH} == "mac68k") -+CXXFLAGS += -D_CPU_MACHINE_ -+.endif -+.if (${ARCH} == "x68k") -+CXXFLAGS += -D_X68K_CPU_H_ -+.endif -+ - OBJS = \ - MeterMaker.o \ - cpumeter.o \ +*** netbsd/pagemeter.h.orig Fri Jul 18 04:37:33 1997 +--- netbsd/pagemeter.h Fri Mar 13 17:36:28 1998 +*************** +*** 21,25 **** +--- 21,33 ---- + + #include "fieldmeterdecay.h" ++ #if defined(UVM) ++ #include <sys/param.h> ++ #include <sys/malloc.h> ++ #include <sys/sysctl.h> ++ #include <sys/device.h> ++ #include <uvm/uvm_extern.h> ++ #else + #include <sys/vmmeter.h> ++ #endif + + class PageMeter : public FieldMeterDecay { +*************** +*** 36,40 **** +--- 44,52 ---- + void getpageinfo( void ); + private: ++ #if defined(UVM) ++ struct uvmexp prev_; ++ #else + struct vmmeter prev_; ++ #endif + }; + diff --git a/sysutils/xosview/patches/patch-ab b/sysutils/xosview/patches/patch-ab new file mode 100644 index 00000000000..2d8cf299c85 --- /dev/null +++ b/sysutils/xosview/patches/patch-ab @@ -0,0 +1,38 @@ +--- netbsd/pagemeter.cc.orig Tue Mar 3 18:25:08 1998 ++++ netbsd/pagemeter.cc Sun Mar 1 17:24:30 1998 +@@ -56,9 +56,15 @@ + + void PageMeter::getpageinfo (void) { + // Begin NetBSD-specific code... ++#if defined(UVM) ++ struct uvmexp uvm; ++ NetBSDGetPageStats(&uvm); ++#else + struct vmmeter vm; +- + NetBSDGetPageStats(&vm); ++#endif ++ ++ + #ifdef XOSVIEW_FREEBSD + #warning "FreeBSD hack" + /* I'm not completely sure these are the right statistics, but +@@ -66,10 +72,17 @@ + fields_[0] = vm.v_vnodein - prev_.v_vnodein; + fields_[1] = vm.v_vnodeout - prev_.v_vnodeout; + #else ++#if defined(UVM) ++ fields_[0] = uvm.pgswapin - prev_.pgswapin; ++ fields_[1] = uvm.pgswapout - prev_.pgswapout; ++ prev_ = uvm; ++#else + fields_[0] = vm.v_pgpgin - prev_.v_pgpgin; + fields_[1] = vm.v_pgpgout - prev_.v_pgpgout; +-#endif + prev_ = vm; ++#endif ++#endif ++ + // End NetBSD-specific code... + if (total_ < fields_[0] + fields_[1]) + total_ = fields_[0] + fields_[1]; diff --git a/sysutils/xosview/patches/patch-ac b/sysutils/xosview/patches/patch-ac new file mode 100644 index 00000000000..54ce45dfbe8 --- /dev/null +++ b/sysutils/xosview/patches/patch-ac @@ -0,0 +1,79 @@ +*** 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 <err.h> /* For err(), warn(), etc. BCG */ ++ #include <errno.h> + #include <sys/dkstat.h> /* For CPUSTATES, which tells us how + many cpu states there are. */ +*************** +*** 34,38 **** +--- 35,53 ---- + #include <net/if.h> /* NetMeter helper functions. */ + #endif ++ ++ #include <sys/param.h> ++ ++ #if defined(UVM) ++ #include <string.h> ++ #include <sys/malloc.h> ++ #include <sys/sysctl.h> ++ #include <sys/device.h> ++ #else ++ #include <unistd.h> ++ #include <vm/vm_swap.h> + #include <sys/vmmeter.h> /* For struct vmmeter. */ ++ #endif ++ ++ #include <vm/vm.h> + #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 ------------------ + diff --git a/sysutils/xosview/patches/patch-ad b/sysutils/xosview/patches/patch-ad new file mode 100644 index 00000000000..64a3cee7a51 --- /dev/null +++ b/sysutils/xosview/patches/patch-ad @@ -0,0 +1,16 @@ +--- netbsd/kernel.h.orig Tue Mar 3 18:24:35 1998 ++++ netbsd/kernel.h Sun Mar 1 17:04:45 1998 +@@ -37,8 +37,13 @@ + void + NetBSDPageInit(); + ++#if defined(UVM) ++void ++NetBSDGetPageStats(struct uvmexp* vmp); ++#else + void + NetBSDGetPageStats(struct vmmeter* vmp); ++#endif + + void + NetBSDCPUInit(); diff --git a/sysutils/xosview/patches/patch-ae b/sysutils/xosview/patches/patch-ae new file mode 100644 index 00000000000..37d18c9d774 --- /dev/null +++ b/sysutils/xosview/patches/patch-ae @@ -0,0 +1,27 @@ +--- config/Makefile.netbsd.in.orig Tue Mar 3 18:49:24 1998 ++++ config/Makefile.netbsd.in Tue Mar 3 18:48:33 1998 +@@ -9,6 +9,24 @@ + + CXXFLAGS += -I@top_srcdir@ + ++.include <bsd.port.subdir.mk> ++.if (${ARCH} == "hp300") ++CXXFLAGS += -D_HP300_CPU_H_ ++.endif ++.if (${ARCH} == "mac68k") ++CXXFLAGS += -D_CPU_MACHINE_ ++.endif ++.if (${ARCH} == "x68k") ++CXXFLAGS += -D_X68K_CPU_H_ ++.endif ++ ++.ifndef UVM ++UVM= ++.endif ++.if ${UVM} != "" ++CXXFLAGS+= -DUVM ++.endif ++ + OBJS = \ + MeterMaker.o \ + cpumeter.o \ |