From: tedu Date: Thu, 8 Oct 2015 14:46:05 +0000 (+0000) Subject: 16 years after E801 memprobe was disabled, probably safe to delete it. X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=bbe59afafc39f23134e0bc172ee546173cc51d02;p=openbsd 16 years after E801 memprobe was disabled, probably safe to delete it. ok deraadt jung kettenis ratchov --- diff --git a/sys/arch/amd64/stand/libsa/memprobe.c b/sys/arch/amd64/stand/libsa/memprobe.c index fd49511d7d0..aa65e2acb8c 100644 --- a/sys/arch/amd64/stand/libsa/memprobe.c +++ b/sys/arch/amd64/stand/libsa/memprobe.c @@ -1,4 +1,4 @@ -/* $OpenBSD: memprobe.c,v 1.15 2015/09/18 13:30:56 miod Exp $ */ +/* $OpenBSD: memprobe.c,v 1.16 2015/10/08 14:46:05 tedu Exp $ */ /* * Copyright (c) 1997-1999 Michael Shalayeff @@ -97,65 +97,6 @@ bios_E820(bios_memmap_t *mp) return mp; } -#if 0 -/* - * BIOS int 15, AX=E801 - * - * Only used if int 15, AX=E820 does not work. - * This should work for more than 64MB on most - * modern machines. However, there is always - * an exception, the older IBM machine do not - * like this call. - */ -static __inline bios_memmap_t * -bios_E801(bios_memmap_t *mp) -{ - int rc, m1, m2, m3, m4; - u_int8_t *info; - - /* Test for possibility of 0xE801 */ - info = getSYSCONFaddr(); - if (!info) - return NULL; - /* XXX - Should test model/submodel/rev here */ - printf("model(%d,%d,%d)", info[2], info[3], info[4]); - - /* Check for 94 or later bios */ - info = (void *)0xFFFFB; - if (info[0] == '9' && info[1] <= '3') - return NULL; - - /* We might have this call */ - __asm volatile(DOINT(0x15) "; mov %%ax, %%si; setc %b0" - : "=a" (rc), "=S" (m1), "=b" (m2), "=c" (m3), "=d" (m4) - : "0" (0xE801)); - - /* Test for failure */ - if (rc & 0xff) - return NULL; - - /* Fixup for screwed up machines */ - if (m1 == 0) { - m1 = m3; - m2 = m4; - } -#ifdef DEBUG - printf("0x15[E801] "); -#endif - /* Fill out BIOS map */ - mp->addr = (1024 * 1024); /* 1MB */ - mp->size = (m1 & 0xffff) * 1024; - mp->type = BIOS_MAP_FREE; - - mp++; - mp->addr = (1024 * 1024) * 16; /* 16MB */ - mp->size = (m2 & 0xffff) * 64L * 1024; - mp->type = BIOS_MAP_FREE; - - return ++mp; -} -#endif - /* * BIOS int 15, AX=8800 * @@ -309,11 +250,7 @@ memprobe(void) if ((pm = bios_E820(bios_memmap)) == NULL) { im = bios_int12(bios_memmap); -#if 0 - pm = bios_E801(im); - if (pm == NULL) -#endif - pm = bios_8800(im); + pm = bios_8800(im); if (pm == NULL) pm = badprobe(im); if (pm == NULL) { diff --git a/sys/arch/i386/stand/libsa/memprobe.c b/sys/arch/i386/stand/libsa/memprobe.c index 23c69ac9807..c06e7961204 100644 --- a/sys/arch/i386/stand/libsa/memprobe.c +++ b/sys/arch/i386/stand/libsa/memprobe.c @@ -1,4 +1,4 @@ -/* $OpenBSD: memprobe.c,v 1.55 2015/09/18 13:30:56 miod Exp $ */ +/* $OpenBSD: memprobe.c,v 1.56 2015/10/08 14:46:05 tedu Exp $ */ /* * Copyright (c) 1997-1999 Michael Shalayeff @@ -97,65 +97,6 @@ bios_E820(bios_memmap_t *mp) return mp; } -#if 0 -/* - * BIOS int 15, AX=E801 - * - * Only used if int 15, AX=E820 does not work. - * This should work for more than 64MB on most - * modern machines. However, there is always - * an exception, the older IBM machine do not - * like this call. - */ -static __inline bios_memmap_t * -bios_E801(bios_memmap_t *mp) -{ - int rc, m1, m2, m3, m4; - u_int8_t *info; - - /* Test for possibility of 0xE801 */ - info = getSYSCONFaddr(); - if (!info) - return NULL; - /* XXX - Should test model/submodel/rev here */ - printf("model(%d,%d,%d)", info[2], info[3], info[4]); - - /* Check for 94 or later bios */ - info = (void *)0xFFFFB; - if (info[0] == '9' && info[1] <= '3') - return NULL; - - /* We might have this call */ - __asm volatile(DOINT(0x15) "; mov %%ax, %%si; setc %b0" - : "=a" (rc), "=S" (m1), "=b" (m2), "=c" (m3), "=d" (m4) - : "0" (0xE801)); - - /* Test for failure */ - if (rc & 0xff) - return NULL; - - /* Fixup for screwed up machines */ - if (m1 == 0) { - m1 = m3; - m2 = m4; - } -#ifdef DEBUG - printf("0x15[E801] "); -#endif - /* Fill out BIOS map */ - mp->addr = (1024 * 1024); /* 1MB */ - mp->size = (m1 & 0xffff) * 1024; - mp->type = BIOS_MAP_FREE; - - mp++; - mp->addr = (1024 * 1024) * 16; /* 16MB */ - mp->size = (m2 & 0xffff) * 64L * 1024; - mp->type = BIOS_MAP_FREE; - - return ++mp; -} -#endif - /* * BIOS int 15, AX=8800 * @@ -311,11 +252,7 @@ memprobe(void) if ((pm = bios_E820(bios_memmap)) == NULL) { im = bios_int12(bios_memmap); -#if 0 - pm = bios_E801(im); - if (pm == NULL) -#endif - pm = bios_8800(im); + pm = bios_8800(im); if (pm == NULL) pm = badprobe(im); if (pm == NULL) {