diff options
author | jkim <jkim@FreeBSD.org> | 2010-03-22 18:43:36 +0000 |
---|---|---|
committer | jkim <jkim@FreeBSD.org> | 2010-03-22 18:43:36 +0000 |
commit | a40c3ddf5af024b9de0a6be58ebdc15e29974cd0 (patch) | |
tree | 558193715d583f9016b847cd82e32f4d74cb951a | |
parent | e8d4382fb5e2cb1abb27fae51d38554c608050af (diff) | |
download | FreeBSD-src-a40c3ddf5af024b9de0a6be58ebdc15e29974cd0.zip FreeBSD-src-a40c3ddf5af024b9de0a6be58ebdc15e29974cd0.tar.gz |
Support memory wraparound instead of high memory as VM86 mode does.
Suggested by: delphij
-rw-r--r-- | sys/compat/x86bios/x86bios.c | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/sys/compat/x86bios/x86bios.c b/sys/compat/x86bios/x86bios.c index 088f073..af352af 100644 --- a/sys/compat/x86bios/x86bios.c +++ b/sys/compat/x86bios/x86bios.c @@ -56,8 +56,7 @@ __FBSDID("$FreeBSD$"); #define X86BIOS_IVT_SIZE 0x00000500 /* 1K + 256 (BDA) */ #define X86BIOS_SEG_SIZE 0x00010000 /* 64K */ -#define X86BIOS_MEM_SIZE (0x00100000 + X86BIOS_SEG_SIZE) - /* 1M + 64K (high memory) */ +#define X86BIOS_MEM_SIZE 0x00100000 /* 1M */ #define X86BIOS_IVT_BASE 0x00000000 #define X86BIOS_RAM_BASE 0x00001000 @@ -115,9 +114,11 @@ x86bios_get_pages(uint32_t offset, size_t size) { int i; - if (offset + size > X86BIOS_MEM_SIZE) + if (offset + size > X86BIOS_MEM_SIZE + X86BIOS_IVT_SIZE) return (NULL); + if (offset >= X86BIOS_MEM_SIZE) + offset -= X86BIOS_MEM_SIZE; i = offset / X86BIOS_PAGE_SIZE; if (x86bios_map[i] != 0) return ((void *)(x86bios_map[i] + offset - @@ -526,13 +527,6 @@ x86bios_map_mem(void) return (1); } #endif - /* Change attribute for high memory. */ - if (pmap_change_attr((vm_offset_t)x86bios_rom + X86BIOS_ROM_SIZE - - X86BIOS_SEG_SIZE, X86BIOS_SEG_SIZE, PAT_WRITE_BACK) != 0) { - pmap_unmapdev((vm_offset_t)x86bios_ivt, X86BIOS_IVT_SIZE); - pmap_unmapdev((vm_offset_t)x86bios_rom, X86BIOS_ROM_SIZE); - return (1); - } x86bios_seg = contigmalloc(X86BIOS_SEG_SIZE, M_DEVBUF, M_WAITOK, X86BIOS_RAM_BASE, x86bios_rom_phys, X86BIOS_PAGE_SIZE, 0); @@ -556,10 +550,6 @@ x86bios_map_mem(void) X86BIOS_ROM_BASE, X86BIOS_MEM_SIZE - X86BIOS_SEG_SIZE - 1, (void *)((vm_offset_t)x86bios_rom + X86BIOS_ROM_BASE - (vm_offset_t)x86bios_rom_phys)); - printf("x86bios: HIMEM 0x%06x-0x%06x at %p\n", - X86BIOS_MEM_SIZE - X86BIOS_SEG_SIZE, X86BIOS_MEM_SIZE - 1, - (void *)((vm_offset_t)x86bios_rom + X86BIOS_ROM_SIZE - - X86BIOS_SEG_SIZE)); } return (0); |