Move the pmap_kenter(KERNBASE, 0) a bit earlier so that it works for
the hasbrokenint12 tunable case too. (with some related and unrelated style fixes) Submitted by: bde
This commit is contained in:
parent
64024d1cc8
commit
4dab350282
@ -1504,9 +1504,16 @@ getmemsize(int first)
|
|||||||
char *cp;
|
char *cp;
|
||||||
struct bios_smap *smap;
|
struct bios_smap *smap;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Change the mapping of the page at address zero from r/o to r/w
|
||||||
|
* so that vm86 can scribble on this page. Note that this page is
|
||||||
|
* not in the general free page pool.
|
||||||
|
*/
|
||||||
|
pmap_kenter(KERNBASE, 0);
|
||||||
|
|
||||||
hasbrokenint12 = 0;
|
hasbrokenint12 = 0;
|
||||||
TUNABLE_INT_FETCH("hw.hasbrokenint12", &hasbrokenint12);
|
TUNABLE_INT_FETCH("hw.hasbrokenint12", &hasbrokenint12);
|
||||||
bzero(&vmf, sizeof(struct vm86frame));
|
bzero(&vmf, sizeof(vmf));
|
||||||
bzero(physmap, sizeof(physmap));
|
bzero(physmap, sizeof(physmap));
|
||||||
basemem = 0;
|
basemem = 0;
|
||||||
|
|
||||||
@ -1555,14 +1562,10 @@ getmemsize(int first)
|
|||||||
pmap_kenter(KERNBASE + pa, pa);
|
pmap_kenter(KERNBASE + pa, pa);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Map the page at address zero for the bios code to use.
|
* Map pages between basemem and ISA_HOLE_START, if any, r/w into
|
||||||
* Note that page zero is not in the general page pool.
|
* the vm86 page table so that vm86 can scribble on them using
|
||||||
*/
|
* the vm86 map too. XXX: why 2 ways for this and only 1 way for
|
||||||
pmap_kenter(KERNBASE, 0);
|
* page 0, at least as initialized here?
|
||||||
|
|
||||||
/*
|
|
||||||
* if basemem != 640, map pages r/w into vm86 page table so
|
|
||||||
* that the bios can scribble on it.
|
|
||||||
*/
|
*/
|
||||||
pte = (pt_entry_t *)vm86paddr;
|
pte = (pt_entry_t *)vm86paddr;
|
||||||
for (i = basemem / 4; i < 160; i++)
|
for (i = basemem / 4; i < 160; i++)
|
||||||
@ -1645,20 +1648,26 @@ next_run: ;
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (basemem == 0) {
|
/*
|
||||||
|
* XXX this function is horribly organized and has to the same
|
||||||
|
* things that it does above here.
|
||||||
|
*/
|
||||||
|
if (basemem == 0)
|
||||||
basemem = 640;
|
basemem = 640;
|
||||||
}
|
|
||||||
|
|
||||||
if (basemem > 640) {
|
if (basemem > 640) {
|
||||||
printf("Preposterous BIOS basemem of %uK, truncating to 640K\n",
|
printf(
|
||||||
basemem);
|
"Preposterous BIOS basemem of %uK, truncating to 640K\n",
|
||||||
|
basemem);
|
||||||
basemem = 640;
|
basemem = 640;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Let vm86 scribble on pages between basemem and
|
||||||
|
* ISA_HOLE_START, as above.
|
||||||
|
*/
|
||||||
for (pa = trunc_page(basemem * 1024);
|
for (pa = trunc_page(basemem * 1024);
|
||||||
pa < ISA_HOLE_START; pa += PAGE_SIZE)
|
pa < ISA_HOLE_START; pa += PAGE_SIZE)
|
||||||
pmap_kenter(KERNBASE + pa, pa);
|
pmap_kenter(KERNBASE + pa, pa);
|
||||||
|
|
||||||
pte = (pt_entry_t *)vm86paddr;
|
pte = (pt_entry_t *)vm86paddr;
|
||||||
for (i = basemem / 4; i < 160; i++)
|
for (i = basemem / 4; i < 160; i++)
|
||||||
pte[i] = (i << PAGE_SHIFT) | PG_V | PG_RW | PG_U;
|
pte[i] = (i << PAGE_SHIFT) | PG_V | PG_RW | PG_U;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user