mirror of
https://git.FreeBSD.org/src.git
synced 2025-01-20 15:43:16 +00:00
Change hw.physmem and hw.usermem to unsigned long like they used to be
in the original hardwired sysctl implementation. The buf size calculator still overflows an integer on machines with large KVA (eg: ia64) where the number of pages does not fit into an int. Use 'long' there. Change Maxmem and physmem and related variables to 'long', mostly for completeness. Machines are not likely to overflow 'int' pages in the near term, but then again, 640K ought to be enough for anybody. This comes for free on 32 bit machines, so why not?
This commit is contained in:
parent
d3ecac6617
commit
447b3772dc
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=102600
@ -189,13 +189,13 @@ SYSINIT(cpu, SI_SUB_CPU, SI_ORDER_FIRST, cpu_startup, NULL)
|
||||
|
||||
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 @@ vm_offset_t phys_avail[10];
|
||||
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, "");
|
||||
|
||||
|
@ -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;
|
||||
|
@ -256,7 +256,7 @@ osf1_open(td, uap)
|
||||
return open(td, &a);
|
||||
}
|
||||
|
||||
extern int totalphysmem;
|
||||
extern long totalphysmem;
|
||||
|
||||
int
|
||||
osf1_getsysinfo(td, uap)
|
||||
|
@ -148,7 +148,7 @@ SYSCTL_INT(_debug, OID_AUTO, tlb_flush_count,
|
||||
CTLFLAG_RD, &tlb_flush_count, 0, "");
|
||||
#endif
|
||||
|
||||
int physmem = 0;
|
||||
long physmem = 0;
|
||||
int cold = 1;
|
||||
|
||||
#ifdef COMPAT_43
|
||||
@ -158,23 +158,30 @@ static void osendsig(sig_t catcher, int sig, sigset_t *mask, u_long code);
|
||||
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_hw_availpages(SYSCTL_HANDLER_ARGS)
|
||||
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];
|
||||
|
||||
|
@ -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;
|
||||
|
@ -148,7 +148,7 @@ SYSCTL_INT(_debug, OID_AUTO, tlb_flush_count,
|
||||
CTLFLAG_RD, &tlb_flush_count, 0, "");
|
||||
#endif
|
||||
|
||||
int physmem = 0;
|
||||
long physmem = 0;
|
||||
int cold = 1;
|
||||
|
||||
#ifdef COMPAT_43
|
||||
@ -158,23 +158,30 @@ static void osendsig(sig_t catcher, int sig, sigset_t *mask, u_long code);
|
||||
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_hw_availpages(SYSCTL_HANDLER_ARGS)
|
||||
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];
|
||||
|
||||
|
@ -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;
|
||||
|
@ -146,33 +146,40 @@ SYSINIT(cpu, SI_SUB_CPU, SI_ORDER_FIRST, cpu_startup, NULL)
|
||||
|
||||
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)
|
||||
|
@ -36,7 +36,7 @@
|
||||
extern char sigcode[];
|
||||
extern char esigcode[];
|
||||
extern int szsigcode;
|
||||
extern int Maxmem;
|
||||
extern long Maxmem;
|
||||
|
||||
struct fpreg;
|
||||
struct thread;
|
||||
|
@ -127,7 +127,7 @@ init_param1(void)
|
||||
* Boot time overrides that are scaled against main memory
|
||||
*/
|
||||
void
|
||||
init_param2(int physpages)
|
||||
init_param2(long physpages)
|
||||
{
|
||||
|
||||
/* Base parameters */
|
||||
|
@ -410,7 +410,7 @@ bd_speedup(void)
|
||||
* 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
|
||||
|
@ -165,7 +165,7 @@ static int ispc98 = 0;
|
||||
#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 void osendsig(sig_t catcher, int sig, sigset_t *mask, u_long code);
|
||||
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
|
||||
|
@ -165,7 +165,7 @@ static int ispc98 = 0;
|
||||
#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 void osendsig(sig_t catcher, int sig, sigset_t *mask, u_long code);
|
||||
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
|
||||
|
@ -113,7 +113,7 @@ static const char rcsid[] =
|
||||
#include <sys/vnode.h>
|
||||
#include <machine/sigframe.h>
|
||||
|
||||
int physmem = 0;
|
||||
long physmem = 0;
|
||||
int cold = 1;
|
||||
|
||||
char pcpu0[PAGE_SIZE];
|
||||
@ -153,14 +153,18 @@ void osendsig(sig_t, int, sigset_t *, u_long);
|
||||
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;
|
||||
|
||||
|
@ -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;
|
||||
|
@ -113,7 +113,7 @@ static const char rcsid[] =
|
||||
#include <sys/vnode.h>
|
||||
#include <machine/sigframe.h>
|
||||
|
||||
int physmem = 0;
|
||||
long physmem = 0;
|
||||
int cold = 1;
|
||||
|
||||
char pcpu0[PAGE_SIZE];
|
||||
@ -153,14 +153,18 @@ void osendsig(sig_t, int, sigset_t *, u_long);
|
||||
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;
|
||||
|
||||
|
@ -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;
|
||||
|
@ -111,9 +111,9 @@ typedef int ofw_vec_t(void *);
|
||||
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];
|
||||
|
@ -465,7 +465,7 @@ extern int nswbuf; /* Number of swap I/O buffer headers. */
|
||||
|
||||
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);
|
||||
|
@ -61,7 +61,7 @@ extern u_int nselcoll; /* select collisions since boot */
|
||||
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 @@ uint32_t crc32(const void *buf, size_t size);
|
||||
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);
|
||||
|
@ -126,7 +126,7 @@ vm_ksubmap_init(struct kva_md_info *kmi)
|
||||
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 @@ vm_ksubmap_init(struct kva_md_info *kmi)
|
||||
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));
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user