Date: Mon, 22 Mar 2010 18:43:36 +0000 (UTC) From: Jung-uk Kim <jkim@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r205455 - head/sys/compat/x86bios Message-ID: <201003221843.o2MIhaUY007387@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: jkim Date: Mon Mar 22 18:43:36 2010 New Revision: 205455 URL: http://svn.freebsd.org/changeset/base/205455 Log: Support memory wraparound instead of high memory as VM86 mode does. Suggested by: delphij Modified: head/sys/compat/x86bios/x86bios.c Modified: head/sys/compat/x86bios/x86bios.c ============================================================================== --- head/sys/compat/x86bios/x86bios.c Mon Mar 22 18:24:42 2010 (r205454) +++ head/sys/compat/x86bios/x86bios.c Mon Mar 22 18:43:36 2010 (r205455) @@ -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_ { 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);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201003221843.o2MIhaUY007387>