Index: alpha/alpha/machdep.c =================================================================== RCS file: /home/ncvs/src/sys/alpha/alpha/machdep.c,v retrieving revision 1.181 diff -u -r1.181 machdep.c --- alpha/alpha/machdep.c 2002/08/29 06:17:46 1.181 +++ alpha/alpha/machdep.c 2002/08/30 02:02:24 @@ -189,13 +189,13 @@ struct msgbuf *msgbufp=0; -int Maxmem = 0; +long Maxmem = 0; -int totalphysmem; /* total amount of physical memory in system */ -int physmem; /* physical memory used by NetBSD + some rsvd */ -int resvmem; /* amount of memory reserved for PROM */ -int unusedmem; /* amount of memory for OS that we don't use */ -int unknownmem; /* amount of memory with an unknown use */ +long totalphysmem; /* total amount of physical memory in system */ +long physmem; /* physical memory used by NetBSD + some rsvd */ +long resvmem; /* amount of memory reserved for PROM */ +long unusedmem; /* amount of memory for OS that we don't use */ +long unknownmem; /* amount of memory with an unknown use */ int ncpus; /* number of cpus */ vm_offset_t phys_avail[10]; @@ -203,23 +203,30 @@ static int sysctl_hw_physmem(SYSCTL_HANDLER_ARGS) { - int error = sysctl_handle_int(oidp, 0, alpha_ptob(physmem), req); + int error; + unsigned long val; + + val = alpha_ptob(physmem); + error = sysctl_handle_long(oidp, &val, 0, req); return (error); } -SYSCTL_PROC(_hw, HW_PHYSMEM, physmem, CTLTYPE_INT|CTLFLAG_RD, - 0, 0, sysctl_hw_physmem, "I", ""); +SYSCTL_PROC(_hw, HW_PHYSMEM, physmem, CTLTYPE_ULONG|CTLFLAG_RD, + 0, 0, sysctl_hw_physmem, "LU", ""); static int sysctl_hw_usermem(SYSCTL_HANDLER_ARGS) { - int error = sysctl_handle_int(oidp, 0, - alpha_ptob(physmem - cnt.v_wire_count), req); + int error; + unsigned long val; + + val = alpha_ptob(physmem - cnt.v_wire_count); + error = sysctl_handle_long(oidp, &val, 0, req); return (error); } -SYSCTL_PROC(_hw, HW_USERMEM, usermem, CTLTYPE_INT|CTLFLAG_RD, - 0, 0, sysctl_hw_usermem, "I", ""); +SYSCTL_PROC(_hw, HW_USERMEM, usermem, CTLTYPE_ULONG|CTLFLAG_RD, + 0, 0, sysctl_hw_usermem, "LU", ""); SYSCTL_INT(_hw, OID_AUTO, availpages, CTLFLAG_RD, &physmem, 0, ""); Index: alpha/include/md_var.h =================================================================== RCS file: /home/ncvs/src/sys/alpha/include/md_var.h,v retrieving revision 1.19 diff -u -r1.19 md_var.h --- alpha/include/md_var.h 2002/03/20 18:58:45 1.19 +++ alpha/include/md_var.h 2002/08/30 02:02:24 @@ -36,7 +36,7 @@ extern char sigcode[]; extern char esigcode[]; extern int szsigcode; -extern int Maxmem; +extern long Maxmem; extern int busdma_swi_pending; struct fpreg; Index: alpha/osf1/osf1_misc.c =================================================================== RCS file: /home/ncvs/src/sys/alpha/osf1/osf1_misc.c,v retrieving revision 1.32 diff -u -r1.32 osf1_misc.c --- alpha/osf1/osf1_misc.c 2002/08/16 12:51:51 1.32 +++ alpha/osf1/osf1_misc.c 2002/08/30 02:02:24 @@ -256,7 +256,7 @@ return open(td, &a); } -extern int totalphysmem; +extern long totalphysmem; int osf1_getsysinfo(td, uap) Index: i386/i386/machdep.c =================================================================== RCS file: /home/ncvs/src/sys/i386/i386/machdep.c,v retrieving revision 1.526 diff -u -r1.526 machdep.c --- i386/i386/machdep.c 2002/08/29 06:17:46 1.526 +++ i386/i386/machdep.c 2002/08/30 02:02:24 @@ -148,7 +148,7 @@ CTLFLAG_RD, &tlb_flush_count, 0, ""); #endif -int physmem = 0; +long physmem = 0; int cold = 1; #ifdef COMPAT_43 @@ -158,23 +158,30 @@ static int sysctl_hw_physmem(SYSCTL_HANDLER_ARGS) { - int error = sysctl_handle_int(oidp, 0, ctob(physmem), req); + int error; + unsigned long val; + + val = ctob(physmem); + error = sysctl_handle_int(oidp, &val, 0, req); return (error); } -SYSCTL_PROC(_hw, HW_PHYSMEM, physmem, CTLTYPE_INT|CTLFLAG_RD, - 0, 0, sysctl_hw_physmem, "IU", ""); +SYSCTL_PROC(_hw, HW_PHYSMEM, physmem, CTLTYPE_ULONG|CTLFLAG_RD, + 0, 0, sysctl_hw_physmem, "LU", ""); static int sysctl_hw_usermem(SYSCTL_HANDLER_ARGS) { - int error = sysctl_handle_int(oidp, 0, - ctob(physmem - cnt.v_wire_count), req); + int error; + unsigned long val; + + val = ctob(physmem - cnt.v_wire_count); + error = sysctl_handle_int(oidp, &val, 0, req); return (error); } -SYSCTL_PROC(_hw, HW_USERMEM, usermem, CTLTYPE_INT|CTLFLAG_RD, - 0, 0, sysctl_hw_usermem, "IU", ""); +SYSCTL_PROC(_hw, HW_USERMEM, usermem, CTLTYPE_ULONG|CTLFLAG_RD, + 0, 0, sysctl_hw_usermem, "LU", ""); static int sysctl_hw_availpages(SYSCTL_HANDLER_ARGS) @@ -187,7 +194,7 @@ SYSCTL_PROC(_hw, OID_AUTO, availpages, CTLTYPE_INT|CTLFLAG_RD, 0, 0, sysctl_hw_availpages, "I", ""); -int Maxmem = 0; +long Maxmem = 0; vm_offset_t phys_avail[10]; Index: i386/include/md_var.h =================================================================== RCS file: /home/ncvs/src/sys/i386/include/md_var.h,v retrieving revision 1.52 diff -u -r1.52 md_var.h --- i386/include/md_var.h 2002/08/02 18:45:39 1.52 +++ i386/include/md_var.h 2002/08/30 02:02:24 @@ -36,7 +36,7 @@ * Miscellaneous machine-dependent declarations. */ -extern int Maxmem; +extern long Maxmem; extern u_int atdevbase; /* offset in virtual memory of ISA io mem */ extern void (*bcopy_vector)(const void *from, void *to, size_t len); extern int busdma_swi_pending; Index: ia64/ia64/machdep.c =================================================================== RCS file: /home/ncvs/src/sys/ia64/ia64/machdep.c,v retrieving revision 1.107 diff -u -r1.107 machdep.c --- ia64/ia64/machdep.c 2002/08/29 06:17:47 1.107 +++ ia64/ia64/machdep.c 2002/08/30 02:02:25 @@ -146,33 +146,40 @@ struct msgbuf *msgbufp=0; -int Maxmem = 0; -int physmem; /* Physical conventional memory. */ +long Maxmem = 0; +long physmem; /* Physical conventional memory. */ vm_offset_t phys_avail[100]; static int sysctl_hw_physmem(SYSCTL_HANDLER_ARGS) { - int error = sysctl_handle_int(oidp, 0, ia64_ptob(physmem), req); + int error; + unsigned long val; + + val = ia64_ptob(physmem); + error = sysctl_handle_long(oidp, &val, 0, req); return (error); } -SYSCTL_PROC(_hw, HW_PHYSMEM, physmem, CTLTYPE_INT|CTLFLAG_RD, - 0, 0, sysctl_hw_physmem, "I", ""); +SYSCTL_PROC(_hw, HW_PHYSMEM, physmem, CTLTYPE_ULONG|CTLFLAG_RD, + 0, 0, sysctl_hw_physmem, "LU", ""); static int sysctl_hw_usermem(SYSCTL_HANDLER_ARGS) { - int error = sysctl_handle_int(oidp, 0, - ia64_ptob(physmem - cnt.v_wire_count), req); + int error; + unsigned long val; + + val = ia64_ptob(physmem - cnt.v_wire_count); + error = sysctl_handle_long(oidp, &val, 0, req); return (error); } -SYSCTL_PROC(_hw, HW_USERMEM, usermem, CTLTYPE_INT|CTLFLAG_RD, - 0, 0, sysctl_hw_usermem, "I", ""); +SYSCTL_PROC(_hw, HW_USERMEM, usermem, CTLTYPE_ULONG|CTLFLAG_RD, + 0, 0, sysctl_hw_usermem, "LU", ""); -SYSCTL_INT(_hw, OID_AUTO, availpages, CTLFLAG_RD, &physmem, 0, ""); +SYSCTL_LONG(_hw, OID_AUTO, availpages, CTLFLAG_RD, &physmem, 0, ""); /* must be 2 less so 0 0 can signal end of chunks */ #define PHYS_AVAIL_ARRAY_END ((sizeof(phys_avail) / sizeof(vm_offset_t)) - 2) Index: ia64/include/md_var.h =================================================================== RCS file: /home/ncvs/src/sys/ia64/include/md_var.h,v retrieving revision 1.9 diff -u -r1.9 md_var.h --- ia64/include/md_var.h 2002/05/05 08:14:32 1.9 +++ ia64/include/md_var.h 2002/08/30 02:02:25 @@ -36,7 +36,7 @@ extern char sigcode[]; extern char esigcode[]; extern int szsigcode; -extern int Maxmem; +extern long Maxmem; struct fpreg; struct thread; Index: kern/subr_param.c =================================================================== RCS file: /home/ncvs/src/sys/kern/subr_param.c,v retrieving revision 1.54 diff -u -r1.54 subr_param.c --- kern/subr_param.c 2002/04/15 12:23:11 1.54 +++ kern/subr_param.c 2002/08/30 02:02:25 @@ -127,7 +127,7 @@ * Boot time overrides that are scaled against main memory */ void -init_param2(int physpages) +init_param2(long physpages) { /* Base parameters */ Index: kern/vfs_bio.c =================================================================== RCS file: /home/ncvs/src/sys/kern/vfs_bio.c,v retrieving revision 1.328 diff -u -r1.328 vfs_bio.c --- kern/vfs_bio.c 2002/08/25 13:17:21 1.328 +++ kern/vfs_bio.c 2002/08/30 02:02:25 @@ -410,7 +410,7 @@ * being reserved at this time. */ caddr_t -kern_vfs_bio_buffer_alloc(caddr_t v, int physmem_est) +kern_vfs_bio_buffer_alloc(caddr_t v, long physmem_est) { /* * physmem_est is in pages. Convert it to kilobytes (assumes Index: pc98/i386/machdep.c =================================================================== RCS file: /home/ncvs/src/sys/pc98/i386/machdep.c,v retrieving revision 1.287 diff -u -r1.287 machdep.c --- pc98/i386/machdep.c 2002/08/29 06:17:47 1.287 +++ pc98/i386/machdep.c 2002/08/30 02:02:26 @@ -165,7 +165,7 @@ #endif SYSCTL_INT(_machdep, OID_AUTO, ispc98, CTLFLAG_RD, &ispc98, 0, ""); -int physmem = 0; +long physmem = 0; int cold = 1; #ifdef COMPAT_43 @@ -175,36 +175,46 @@ static int sysctl_hw_physmem(SYSCTL_HANDLER_ARGS) { - int error = sysctl_handle_int(oidp, 0, ctob(physmem), req); + int error; + unsigned long val; + + val = ctob(physmem); + int error = sysctl_handle_int(oidp, &val, req); return (error); } -SYSCTL_PROC(_hw, HW_PHYSMEM, physmem, CTLTYPE_INT|CTLFLAG_RD, - 0, 0, sysctl_hw_physmem, "IU", ""); +SYSCTL_PROC(_hw, HW_PHYSMEM, physmem, CTLTYPE_ULONG|CTLFLAG_RD, + 0, 0, sysctl_hw_physmem, "LU", ""); static int sysctl_hw_usermem(SYSCTL_HANDLER_ARGS) { - int error = sysctl_handle_int(oidp, 0, - ctob(physmem - cnt.v_wire_count), req); + int error; + unsigned long val; + + val = ctob(physmem - cnt.v_wire_count); + int error = sysctl_handle_int(oidp, &val, 0, req); return (error); } -SYSCTL_PROC(_hw, HW_USERMEM, usermem, CTLTYPE_INT|CTLFLAG_RD, - 0, 0, sysctl_hw_usermem, "IU", ""); +SYSCTL_PROC(_hw, HW_USERMEM, usermem, CTLTYPE_ULONG|CTLFLAG_RD, + 0, 0, sysctl_hw_usermem, "LU", ""); static int sysctl_hw_availpages(SYSCTL_HANDLER_ARGS) { - int error = sysctl_handle_int(oidp, 0, - i386_btop(avail_end - avail_start), req); + int error; + long val; + + val = i386_btop(avail_end - avail_start); + error = sysctl_handle_int(oidp, &val, 0, req); return (error); } -SYSCTL_PROC(_hw, OID_AUTO, availpages, CTLTYPE_INT|CTLFLAG_RD, - 0, 0, sysctl_hw_availpages, "I", ""); +SYSCTL_PROC(_hw, OID_AUTO, availpages, CTLTYPE_LONG|CTLFLAG_RD, + 0, 0, sysctl_hw_availpages, "L", ""); -int Maxmem = 0; +long Maxmem = 0; #ifdef PC98 int Maxmem_under16M = 0; #endif Index: powerpc/include/md_var.h =================================================================== RCS file: /home/ncvs/src/sys/powerpc/include/md_var.h,v retrieving revision 1.21 diff -u -r1.21 md_var.h --- powerpc/include/md_var.h 2002/03/20 23:17:49 1.21 +++ powerpc/include/md_var.h 2002/08/30 02:02:26 @@ -36,7 +36,7 @@ extern char sigcode[]; extern char esigcode[]; extern int szsigcode; -extern int Maxmem; +extern long Maxmem; extern int busdma_swi_pending; extern vm_offset_t kstack0; Index: powerpc/powerpc/machdep.c =================================================================== RCS file: /home/ncvs/src/sys/powerpc/powerpc/machdep.c,v retrieving revision 1.35 diff -u -r1.35 machdep.c --- powerpc/powerpc/machdep.c 2002/08/29 06:17:48 1.35 +++ powerpc/powerpc/machdep.c 2002/08/30 02:02:26 @@ -113,7 +113,7 @@ #include #include -int physmem = 0; +long physmem = 0; int cold = 1; char pcpu0[PAGE_SIZE]; @@ -153,14 +153,18 @@ static int sysctl_hw_physmem(SYSCTL_HANDLER_ARGS) { - int error = sysctl_handle_int(oidp, 0, ctob(physmem), req); + int error; + unsigned long val; + + val = ctob(physmem); + error = sysctl_handle_int(oidp, &val, 0, req); return (error); } -SYSCTL_PROC(_hw, HW_PHYSMEM, physmem, CTLTYPE_INT|CTLFLAG_RD, - 0, 0, sysctl_hw_physmem, "IU", ""); +SYSCTL_PROC(_hw, HW_PHYSMEM, physmem, CTLTYPE_ULONG|CTLFLAG_RD, + 0, 0, sysctl_hw_physmem, "LU", ""); -int Maxmem = 0; +long Maxmem = 0; static int chosen; Index: sparc64/include/md_var.h =================================================================== RCS file: /home/ncvs/src/sys/sparc64/include/md_var.h,v retrieving revision 1.11 diff -u -r1.11 md_var.h --- sparc64/include/md_var.h 2002/08/29 01:59:54 1.11 +++ sparc64/include/md_var.h 2002/08/30 02:02:26 @@ -36,7 +36,7 @@ extern char tl0_base[]; extern char _end[]; -extern int Maxmem; +extern long Maxmem; extern vm_offset_t kstack0; extern vm_offset_t kstack0_phys; Index: sparc64/sparc64/machdep.c =================================================================== RCS file: /home/ncvs/src/sys/sparc64/sparc64/machdep.c,v retrieving revision 1.59 diff -u -r1.59 machdep.c --- sparc64/sparc64/machdep.c 2002/08/29 06:17:48 1.59 +++ sparc64/sparc64/machdep.c 2002/08/30 02:02:26 @@ -111,9 +111,9 @@ struct tlb_entry *kernel_tlbs; int kernel_tlb_slots; -int physmem; +long physmem; int cold = 1; -int Maxmem; +long Maxmem; char pcpu0[PCPU_PAGES * PAGE_SIZE]; char uarea0[UAREA_PAGES * PAGE_SIZE]; Index: sys/buf.h =================================================================== RCS file: /home/ncvs/src/sys/sys/buf.h,v retrieving revision 1.137 diff -u -r1.137 buf.h --- sys/buf.h 2002/07/19 07:29:38 1.137 +++ sys/buf.h 2002/08/30 02:02:26 @@ -465,7 +465,7 @@ struct uio; -caddr_t kern_vfs_bio_buffer_alloc(caddr_t v, int physmem_est); +caddr_t kern_vfs_bio_buffer_alloc(caddr_t v, long physmem_est); void bufinit(void); void bwillwrite(void); int buf_dirty_count_severe(void); Index: sys/systm.h =================================================================== RCS file: /home/ncvs/src/sys/sys/systm.h,v retrieving revision 1.181 diff -u -r1.181 systm.h --- sys/systm.h 2002/08/21 16:20:01 1.181 +++ sys/systm.h 2002/08/30 02:02:26 @@ -61,7 +61,7 @@ extern struct mtx sellock; /* select lock variable */ extern struct cv selwait; /* select conditional variable */ -extern int physmem; /* physical memory */ +extern long physmem; /* physical memory */ extern dev_t rootdev; /* root device */ extern dev_t rootdevs[2]; /* possible root devices */ @@ -140,7 +140,7 @@ void critical_enter(void); void critical_exit(void); void init_param1(void); -void init_param2(int physpages); +void init_param2(long physpages); void tablefull(const char *); int kvprintf(char const *, void (*)(int, void*), void *, int, __va_list) __printflike(1, 0); Index: vm/vm_init.c =================================================================== RCS file: /home/ncvs/src/sys/vm/vm_init.c,v retrieving revision 1.33 diff -u -r1.33 vm_init.c --- vm/vm_init.c 2002/03/20 04:02:59 1.33 +++ vm/vm_init.c 2002/08/30 02:02:26 @@ -126,7 +126,7 @@ vm_offset_t firstaddr; caddr_t v; vm_size_t size = 0; - int physmem_est; + long physmem_est; vm_offset_t minaddr; vm_offset_t maxaddr; @@ -159,7 +159,7 @@ printf("Warning: no free entries in kernel_map.\n"); physmem_est = physmem; } else { - physmem_est = min(physmem, btoc(kernel_map->max_offset - + physmem_est = lmin(physmem, btoc(kernel_map->max_offset - kernel_map->min_offset)); }