summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Shalayeff <mickey@cvs.openbsd.org>2001-01-21 20:23:23 +0000
committerMichael Shalayeff <mickey@cvs.openbsd.org>2001-01-21 20:23:23 +0000
commita2719c9f15fff1422374255d205d80282629b363 (patch)
tree956d59ae4484869dc8298a79ce861c3cc66565c8
parent20d4f3f5511955443bb70d975d9770ee5fd69864 (diff)
map the bios rom at both it's real address and
zero offset corresponding to the base of the rom. this solves a problem for roms referring to their internal tables by real addresses. brad@ testing, 10x
-rw-r--r--sys/arch/i386/i386/bios.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/sys/arch/i386/i386/bios.c b/sys/arch/i386/i386/bios.c
index a75f17f00b4..102271112ef 100644
--- a/sys/arch/i386/i386/bios.c
+++ b/sys/arch/i386/i386/bios.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: bios.c,v 1.38 2000/10/25 19:13:11 mickey Exp $ */
+/* $OpenBSD: bios.c,v 1.39 2001/01/21 20:23:22 mickey Exp $ */
/*
* Copyright (c) 1997-2000 Michael Shalayeff
@@ -322,7 +322,7 @@ bios32_service(service, e, ei)
extern int gdt_get_slot __P((void));
u_long pa, endpa;
- vm_offset_t va;
+ vaddr_t va, sva;
u_int32_t base, count, off, ent;
int slot;
@@ -346,9 +346,9 @@ bios32_service(service, e, ei)
endpa = i386_round_page(BIOS32_END);
#if defined(UVM)
- va = uvm_km_valloc(kernel_map, endpa);
+ sva = va = uvm_km_valloc(kernel_map, endpa);
#else
- va = kmem_alloc_pageable(kernel_map, endpa);
+ sva = va = kmem_alloc_pageable(kernel_map, endpa);
#endif
if (va == 0)
return (0);
@@ -359,11 +359,20 @@ bios32_service(service, e, ei)
for (pa = i386_trunc_page(BIOS32_START),
va += i386_trunc_page(BIOS32_START);
- pa < endpa; pa += NBPG, va += NBPG)
+ pa < endpa; pa += NBPG, va += NBPG) {
pmap_enter(pmap_kernel(), va, pa,
VM_PROT_READ | VM_PROT_WRITE, TRUE,
VM_PROT_READ | VM_PROT_WRITE);
+ /* for all you, broken hearted */
+ if (pa >= i386_trunc_page(base)) {
+ pmap_enter(pmap_kernel(), sva, pa,
+ VM_PROT_READ | VM_PROT_WRITE, TRUE,
+ VM_PROT_READ | VM_PROT_WRITE);
+ sva += NBPG;
+ }
+ }
+
e->segment = GSEL(slot, SEL_KPL);
e->offset = (vaddr_t)ent;