summaryrefslogtreecommitdiffstats
path: root/sys/boot/pc98/libpc98/biosmem.c
diff options
context:
space:
mode:
authornyan <nyan@FreeBSD.org>2005-05-08 14:17:28 +0000
committernyan <nyan@FreeBSD.org>2005-05-08 14:17:28 +0000
commit27c543668baefe5a124d7e62e2250fe8e836e773 (patch)
treee22736b5de266941b5b960296376f7f3f9f5c1c8 /sys/boot/pc98/libpc98/biosmem.c
parent7ccdf6dff30bd501b457faa9e066fba043a5916f (diff)
downloadFreeBSD-src-27c543668baefe5a124d7e62e2250fe8e836e773.zip
FreeBSD-src-27c543668baefe5a124d7e62e2250fe8e836e773.tar.gz
Remove ifdef PC98.
Diffstat (limited to 'sys/boot/pc98/libpc98/biosmem.c')
-rw-r--r--sys/boot/pc98/libpc98/biosmem.c63
1 files changed, 0 insertions, 63 deletions
diff --git a/sys/boot/pc98/libpc98/biosmem.c b/sys/boot/pc98/libpc98/biosmem.c
index e2e792c..4f22086 100644
--- a/sys/boot/pc98/libpc98/biosmem.c
+++ b/sys/boot/pc98/libpc98/biosmem.c
@@ -37,76 +37,13 @@ __FBSDID("$FreeBSD$");
vm_offset_t memtop;
u_int32_t bios_basemem, bios_extmem;
-#ifndef PC98
-#define SMAPSIG 0x534D4150
-
-struct smap {
- u_int64_t base;
- u_int64_t length;
- u_int32_t type;
-} __packed;
-
-static struct smap smap;
-#endif
-
void
bios_getmem(void)
{
-#ifdef PC98
bios_basemem = ((*(u_char *)PTOV(0xA1501) & 0x07) + 1) * 128 * 1024;
bios_extmem = *(u_char *)PTOV(0xA1401) * 128 * 1024 +
*(u_int16_t *)PTOV(0xA1594) * 1024 * 1024;
-#else
- /* Parse system memory map */
- v86.ebx = 0;
- do {
- v86.ctl = V86_FLAGS;
- v86.addr = 0x15; /* int 0x15 function 0xe820*/
- v86.eax = 0xe820;
- v86.ecx = sizeof(struct smap);
- v86.edx = SMAPSIG;
- v86.es = VTOPSEG(&smap);
- v86.edi = VTOPOFF(&smap);
- v86int();
- if ((v86.efl & 1) || (v86.eax != SMAPSIG))
- break;
- /* look for a low-memory segment that's large enough */
- if ((smap.type == 1) && (smap.base == 0) && (smap.length >= (512 * 1024)))
- bios_basemem = smap.length;
- /* look for the first segment in 'extended' memory */
- if ((smap.type == 1) && (smap.base == 0x100000)) {
- bios_extmem = smap.length;
- }
- } while (v86.ebx != 0);
-
- /* Fall back to the old compatibility function for base memory */
- if (bios_basemem == 0) {
- v86.ctl = 0;
- v86.addr = 0x12; /* int 0x12 */
- v86int();
-
- bios_basemem = (v86.eax & 0xffff) * 1024;
- }
-
- /* Fall back through several compatibility functions for extended memory */
- if (bios_extmem == 0) {
- v86.ctl = V86_FLAGS;
- v86.addr = 0x15; /* int 0x15 function 0xe801*/
- v86.eax = 0xe801;
- v86int();
- if (!(v86.efl & 1)) {
- bios_extmem = ((v86.ecx & 0xffff) + ((v86.edx & 0xffff) * 64)) * 1024;
- }
- }
- if (bios_extmem == 0) {
- v86.ctl = 0;
- v86.addr = 0x15; /* int 0x15 function 0x88*/
- v86.eax = 0x8800;
- v86int();
- bios_extmem = (v86.eax & 0xffff) * 1024;
- }
-#endif
/* Set memtop to actual top of memory */
memtop = 0x100000 + bios_extmem;
OpenPOWER on IntegriCloud