diff options
author | peter <peter@FreeBSD.org> | 1999-07-01 18:33:22 +0000 |
---|---|---|
committer | peter <peter@FreeBSD.org> | 1999-07-01 18:33:22 +0000 |
commit | 67438f228670d7cd3d26b48bb596df8f3db382a2 (patch) | |
tree | 4fb331f743d35b999b3970087cca4673d0257138 | |
parent | 65a02b75eaf2e2268c0d1c8fdf642bfada3f1154 (diff) | |
download | FreeBSD-src-67438f228670d7cd3d26b48bb596df8f3db382a2.zip FreeBSD-src-67438f228670d7cd3d26b48bb596df8f3db382a2.tar.gz |
Look up the kernel environment for MAXMEM as a final override for the
memory size. If somebody wants to change the name, fine - I used this
since it's consistant with the config variable it replaces.
This is intended to replace the npx0 msize hack (which no longer works).
-rw-r--r-- | sys/amd64/amd64/machdep.c | 12 | ||||
-rw-r--r-- | sys/i386/i386/machdep.c | 12 |
2 files changed, 18 insertions, 6 deletions
diff --git a/sys/amd64/amd64/machdep.c b/sys/amd64/amd64/machdep.c index 0ff0796..8dfa360 100644 --- a/sys/amd64/amd64/machdep.c +++ b/sys/amd64/amd64/machdep.c @@ -35,7 +35,7 @@ * SUCH DAMAGE. * * from: @(#)machdep.c 7.4 (Berkeley) 6/3/91 - * $Id: machdep.c,v 1.345 1999/06/28 15:34:54 luoqi Exp $ + * $Id: machdep.c,v 1.346 1999/07/01 18:27:15 peter Exp $ */ #include "apm.h" @@ -1141,9 +1141,7 @@ getmemsize(int first) u_int64_t length; u_int32_t type; } *smap; -#if NNPX > 0 int msize; -#endif bzero(&vmf, sizeof(struct vm86frame)); bzero(physmap, sizeof(physmap)); @@ -1354,6 +1352,14 @@ physmap_done: } #endif + /* Allow final override from the kernel environment */ + if (getenv_int("MAXMEM", &msize)) { + if (msize != 0) { + Maxmem = msize / 4; + speculative_mprobe = FALSE; + } + } + #ifdef SMP /* look for the MP hardware - needed for apic addresses */ mp_probe(); diff --git a/sys/i386/i386/machdep.c b/sys/i386/i386/machdep.c index 0ff0796..8dfa360 100644 --- a/sys/i386/i386/machdep.c +++ b/sys/i386/i386/machdep.c @@ -35,7 +35,7 @@ * SUCH DAMAGE. * * from: @(#)machdep.c 7.4 (Berkeley) 6/3/91 - * $Id: machdep.c,v 1.345 1999/06/28 15:34:54 luoqi Exp $ + * $Id: machdep.c,v 1.346 1999/07/01 18:27:15 peter Exp $ */ #include "apm.h" @@ -1141,9 +1141,7 @@ getmemsize(int first) u_int64_t length; u_int32_t type; } *smap; -#if NNPX > 0 int msize; -#endif bzero(&vmf, sizeof(struct vm86frame)); bzero(physmap, sizeof(physmap)); @@ -1354,6 +1352,14 @@ physmap_done: } #endif + /* Allow final override from the kernel environment */ + if (getenv_int("MAXMEM", &msize)) { + if (msize != 0) { + Maxmem = msize / 4; + speculative_mprobe = FALSE; + } + } + #ifdef SMP /* look for the MP hardware - needed for apic addresses */ mp_probe(); |