summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornyan <nyan@FreeBSD.org>2005-03-06 12:59:59 +0000
committernyan <nyan@FreeBSD.org>2005-03-06 12:59:59 +0000
commitb2fcfd1c1da6a782a9f35782b9d8aa56845a785e (patch)
treee000bfda88877f5f27bbf98d40a48a68aacad52c
parent8c539c0cd2929d724193ccef12aacc0a63e5b779 (diff)
downloadFreeBSD-src-b2fcfd1c1da6a782a9f35782b9d8aa56845a785e.zip
FreeBSD-src-b2fcfd1c1da6a782a9f35782b9d8aa56845a785e.tar.gz
MFi386: revisions 1.609 and 1.610.
-rw-r--r--sys/pc98/i386/machdep.c50
-rw-r--r--sys/pc98/pc98/machdep.c50
2 files changed, 18 insertions, 82 deletions
diff --git a/sys/pc98/i386/machdep.c b/sys/pc98/i386/machdep.c
index 415f8bd..99ec504 100644
--- a/sys/pc98/i386/machdep.c
+++ b/sys/pc98/i386/machdep.c
@@ -1586,18 +1586,18 @@ getmemsize(int first)
{
#ifdef PC98
int i, physmap_idx, pa_indx, pg_n;
+ u_long physmem_tunable;
u_int extmem, under16;
vm_offset_t pa, physmap[PHYSMAP_SIZE];
pt_entry_t *pte;
- char *cp;
#else
int i, physmap_idx, pa_indx;
+ u_long physmem_tunable;
u_int extmem;
struct vm86frame vmf;
struct vm86context vmc;
vm_paddr_t pa, physmap[PHYSMAP_SIZE];
pt_entry_t *pte;
- char *cp;
struct bios_smap *smap;
#endif
quad_t dcons_addr, dcons_size;
@@ -1694,15 +1694,15 @@ getmemsize(int first)
smap->type, smap->base, smap->length);
if (smap->type != 0x01)
- goto next_run;
+ continue;
if (smap->length == 0)
- goto next_run;
+ continue;
if (smap->base >= 0xffffffff) {
printf("%uK of memory above 4GB ignored\n",
(u_int)(smap->length / 1024));
- goto next_run;
+ continue;
}
for (i = 0; i <= physmap_idx; i += 2) {
@@ -1710,13 +1710,13 @@ getmemsize(int first)
if (boothowto & RB_VERBOSE)
printf(
"Overlapping or non-montonic memory region, ignoring second region\n");
- goto next_run;
+ continue;
}
}
if (smap->base == physmap[physmap_idx + 1]) {
physmap[physmap_idx + 1] += smap->length;
- goto next_run;
+ continue;
}
physmap_idx += 2;
@@ -1727,7 +1727,6 @@ getmemsize(int first)
}
physmap[physmap_idx] = smap->base;
physmap[physmap_idx + 1] = smap->base + smap->length;
-next_run: ;
} while (vmf.vmf_ebx != 0);
/*
@@ -1850,39 +1849,8 @@ physmap_done:
Maxmem = MAXMEM / 4;
#endif
- /*
- * hw.physmem is a size in bytes; we also allow k, m, and g suffixes
- * for the appropriate modifiers. This overrides MAXMEM.
- */
- if ((cp = getenv("hw.physmem")) != NULL) {
- u_int64_t AllowMem, sanity;
- char *ep;
-
- sanity = AllowMem = strtouq(cp, &ep, 0);
- if ((ep != cp) && (*ep != 0)) {
- switch(*ep) {
- case 'g':
- case 'G':
- AllowMem <<= 10;
- case 'm':
- case 'M':
- AllowMem <<= 10;
- case 'k':
- case 'K':
- AllowMem <<= 10;
- break;
- default:
- AllowMem = sanity = 0;
- }
- if (AllowMem < sanity)
- AllowMem = 0;
- }
- if (AllowMem == 0)
- printf("Ignoring invalid memory size of '%s'\n", cp);
- else
- Maxmem = atop(AllowMem);
- freeenv(cp);
- }
+ if (TUNABLE_ULONG_FETCH("hw.physmem", &physmem_tunable))
+ Maxmem = atop(physmem_tunable);
if (atop(physmap[physmap_idx + 1]) != Maxmem &&
(boothowto & RB_VERBOSE))
diff --git a/sys/pc98/pc98/machdep.c b/sys/pc98/pc98/machdep.c
index 415f8bd..99ec504 100644
--- a/sys/pc98/pc98/machdep.c
+++ b/sys/pc98/pc98/machdep.c
@@ -1586,18 +1586,18 @@ getmemsize(int first)
{
#ifdef PC98
int i, physmap_idx, pa_indx, pg_n;
+ u_long physmem_tunable;
u_int extmem, under16;
vm_offset_t pa, physmap[PHYSMAP_SIZE];
pt_entry_t *pte;
- char *cp;
#else
int i, physmap_idx, pa_indx;
+ u_long physmem_tunable;
u_int extmem;
struct vm86frame vmf;
struct vm86context vmc;
vm_paddr_t pa, physmap[PHYSMAP_SIZE];
pt_entry_t *pte;
- char *cp;
struct bios_smap *smap;
#endif
quad_t dcons_addr, dcons_size;
@@ -1694,15 +1694,15 @@ getmemsize(int first)
smap->type, smap->base, smap->length);
if (smap->type != 0x01)
- goto next_run;
+ continue;
if (smap->length == 0)
- goto next_run;
+ continue;
if (smap->base >= 0xffffffff) {
printf("%uK of memory above 4GB ignored\n",
(u_int)(smap->length / 1024));
- goto next_run;
+ continue;
}
for (i = 0; i <= physmap_idx; i += 2) {
@@ -1710,13 +1710,13 @@ getmemsize(int first)
if (boothowto & RB_VERBOSE)
printf(
"Overlapping or non-montonic memory region, ignoring second region\n");
- goto next_run;
+ continue;
}
}
if (smap->base == physmap[physmap_idx + 1]) {
physmap[physmap_idx + 1] += smap->length;
- goto next_run;
+ continue;
}
physmap_idx += 2;
@@ -1727,7 +1727,6 @@ getmemsize(int first)
}
physmap[physmap_idx] = smap->base;
physmap[physmap_idx + 1] = smap->base + smap->length;
-next_run: ;
} while (vmf.vmf_ebx != 0);
/*
@@ -1850,39 +1849,8 @@ physmap_done:
Maxmem = MAXMEM / 4;
#endif
- /*
- * hw.physmem is a size in bytes; we also allow k, m, and g suffixes
- * for the appropriate modifiers. This overrides MAXMEM.
- */
- if ((cp = getenv("hw.physmem")) != NULL) {
- u_int64_t AllowMem, sanity;
- char *ep;
-
- sanity = AllowMem = strtouq(cp, &ep, 0);
- if ((ep != cp) && (*ep != 0)) {
- switch(*ep) {
- case 'g':
- case 'G':
- AllowMem <<= 10;
- case 'm':
- case 'M':
- AllowMem <<= 10;
- case 'k':
- case 'K':
- AllowMem <<= 10;
- break;
- default:
- AllowMem = sanity = 0;
- }
- if (AllowMem < sanity)
- AllowMem = 0;
- }
- if (AllowMem == 0)
- printf("Ignoring invalid memory size of '%s'\n", cp);
- else
- Maxmem = atop(AllowMem);
- freeenv(cp);
- }
+ if (TUNABLE_ULONG_FETCH("hw.physmem", &physmem_tunable))
+ Maxmem = atop(physmem_tunable);
if (atop(physmap[physmap_idx + 1]) != Maxmem &&
(boothowto & RB_VERBOSE))
OpenPOWER on IntegriCloud