diff options
author | Stefan Reinauer <reinauer@chromium.org> | 2015-10-21 13:00:41 -0700 |
---|---|---|
committer | Stefan Reinauer <stefan.reinauer@coreboot.org> | 2016-02-18 01:47:04 +0100 |
commit | 05082737a9507a8bbb238d9d439f74a72a7606e8 (patch) | |
tree | dd5ec603f620e9e4a7a054533d5098b2a19c97b2 /util/vgabios/int1a.c | |
parent | eb960f1af93b55cbfb0d5f86343970ded151d3c7 (diff) | |
download | coreboot-05082737a9507a8bbb238d9d439f74a72a7606e8.tar.xz |
Redo testbios utility to use all of YABEL
Drop buggy duplicate implementation of intXX handlers
and provide enough glue to use all of YABEL.
Change-Id: I2db77a56a2a991cb84876456dcbb3a843a0d9754
Signed-off-by: Stefan Reinauer <stefan.reinauer@coreboot.org>
Reviewed-on: https://review.coreboot.org/12117
Reviewed-by: Ronald G. Minnich <rminnich@gmail.com>
Tested-by: build bot (Jenkins)
Diffstat (limited to 'util/vgabios/int1a.c')
-rw-r--r-- | util/vgabios/int1a.c | 171 |
1 files changed, 0 insertions, 171 deletions
diff --git a/util/vgabios/int1a.c b/util/vgabios/int1a.c deleted file mode 100644 index 9fcff8af43..0000000000 --- a/util/vgabios/int1a.c +++ /dev/null @@ -1,171 +0,0 @@ -#include <stdio.h> -#include <stdtypes.h> -#include "testbios.h" -#include "pci-userspace.h" - -#define DEBUG_INT1A - -#define SUCCESSFUL 0x00 -#define DEVICE_NOT_FOUND 0x86 -#define BAD_REGISTER_NUMBER 0x87 - -extern int verbose; - -int int1A_handler(void) -{ - PCITAG tag = NULL; - pciVideoPtr pvp = NULL; - - if (verbose) { - printf("\nint1a encountered.\n"); - //x86emu_dump_xregs(); - } - - switch (X86_AX) { - case 0xb101: - X86_EAX = 0x00; /* no config space/special cycle support */ - X86_AL = 0x01; /* config mechanism 1 */ - X86_EDX = 0x20494350; /* " ICP" */ - X86_EBX = 0x0210; /* Version 2.10 */ - X86_ECX &= 0xFF00; - X86_ECX |= (pciNumBuses & 0xFF); /* Max bus number in system */ - X86_EFLAGS &= ~((unsigned long) 0x01); /* clear carry flag */ -#ifdef DEBUG_INT1A - if (verbose) - printf("PCI bios present.\n"); -#endif - return 1; - case 0xb102: - if (X86_DX == pvp->vendor_id && X86_CX == pvp->device_id && X86_ESI == 0) { - X86_EAX = X86_AL | (SUCCESSFUL << 8); - X86_EFLAGS &= ~((unsigned long) 0x01); /* clear carry flag */ - X86_EBX = pciSlotBX(tag); // XXX used to be pvp, but both are NULL - } -#ifdef SHOW_ALL_DEVICES - else if ((pvp = xf86FindPciDeviceVendor(X86_EDX, X86_ECX, X86_ESI, pvp))) { - X86_EAX = X86_AL | (SUCCESSFUL << 8); - X86_EFLAGS &= ~((unsigned long) 0x01); /* clear carry flag */ - X86_EBX = pciSlotBX(pvp); - } -#endif - else { - X86_EAX = X86_AL | (DEVICE_NOT_FOUND << 8); - X86_EFLAGS |= ((unsigned long) 0x01); /* set carry flag */ - } -#ifdef DEBUG_INT1A - printf("eax=0x%x ebx=0x%x eflags=0x%x\n", X86_EAX, X86_EBX, X86_EFLAGS); -#endif - return 1; - case 0xb103: -#if 0 - if (X86_CL == pvp->interface && - X86_CH == pvp->subclass && - ((X86_ECX & 0xFFFF0000) >> 16) == pvp->class) { - X86_EAX = X86_AL | (SUCCESSFUL << 8); - X86_EBX = pciSlotBX(pvp); - X86_EFLAGS &= ~((unsigned long) 0x01); /* clear carry flag */ - } -#else - /* FIXME: dirty hack */ - if (0); -#endif -#ifdef SHOW_ALL_DEVICES - else if ((pvp = FindPciClass(X86_CL, X86_CH, - (X86_ECX & 0xffff0000) >> 16, - X86_ESI, pvp))) { - X86_EAX = X86_AL | (SUCCESSFUL << 8); - X86_EFLAGS &= ~((unsigned long) 0x01); /* clear carry flag */ - X86_EBX = pciSlotBX(pvp); - } -#endif - else { - X86_EAX = X86_AL | (DEVICE_NOT_FOUND << 8); - X86_EFLAGS |= ((unsigned long) 0x01); /* set carry flag */ - } -#ifdef DEBUG_INT1A - printf("eax=0x%x eflags=0x%x\n", X86_EAX, X86_EFLAGS); -#endif - return 1; - case 0xb108: - if ((tag = findPci(X86_EBX))) { - X86_CL = pciReadByte(tag, X86_EDI); - X86_EAX = X86_AL | (SUCCESSFUL << 8); - X86_EFLAGS &= ~((unsigned long) 0x01); /* clear carry flag */ - } else { - X86_EAX = X86_AL | (BAD_REGISTER_NUMBER << 8); - X86_EFLAGS |= ((unsigned long) 0x01); /* set carry flag */ - } -#ifdef DEBUG_INT1A - printf("eax=0x%x ecx=0x%x eflags=0x%x\n", X86_EAX, X86_ECX, X86_EFLAGS); -#endif - return 1; - case 0xb109: - if ((tag = findPci(X86_EBX))) { - X86_CX = pciReadWord(tag, X86_EDI); - X86_EAX = X86_AL | (SUCCESSFUL << 8); - X86_EFLAGS &= ~((unsigned long) 0x01); /* clear carry flag */ - } else { - X86_EAX = X86_AL | (BAD_REGISTER_NUMBER << 8); - X86_EFLAGS |= ((unsigned long) 0x01); /* set carry flag */ - } -#ifdef DEBUG_INT1A - printf("eax=0x%x ecx=0x%x eflags=0x%x\n", X86_EAX, X86_ECX, X86_EFLAGS); -#endif - return 1; - case 0xb10a: - if ((tag = findPci(X86_EBX))) { - X86_ECX = pciReadLong(tag, X86_EDI); - X86_EAX = X86_AL | (SUCCESSFUL << 8); - X86_EFLAGS &= ~((unsigned long) 0x01); /* clear carry flag */ - } else { - X86_EAX = X86_AL | (BAD_REGISTER_NUMBER << 8); - X86_EFLAGS |= ((unsigned long) 0x01); /* set carry flag */ - } -#ifdef DEBUG_INT1A - printf("eax=0x%x ecx=0x%x eflags=0x%x\n", X86_EAX, X86_ECX, X86_EFLAGS); -#endif - return 1; - case 0xb10b: - if ((tag = findPci(X86_EBX))) { - pciWriteByte(tag, X86_EDI, X86_CL); - X86_EAX = X86_AL | (SUCCESSFUL << 8); - X86_EFLAGS &= ~((unsigned long) 0x01); /* clear carry flag */ - } else { - X86_EAX = X86_AL | (BAD_REGISTER_NUMBER << 8); - X86_EFLAGS |= ((unsigned long) 0x01); /* set carry flag */ - } -#ifdef DEBUG_INT1A - printf("eax=0x%x eflags=0x%x\n", X86_EAX, X86_EFLAGS); -#endif - return 1; - case 0xb10c: - if ((tag = findPci(X86_EBX))) { - pciWriteWord(tag, X86_EDI, X86_CX); - X86_EAX = X86_AL | (SUCCESSFUL << 8); - X86_EFLAGS &= ~((unsigned long) 0x01); /* clear carry flag */ - } else { - X86_EAX = X86_AL | (BAD_REGISTER_NUMBER << 8); - X86_EFLAGS |= ((unsigned long) 0x01); /* set carry flag */ - } -#ifdef DEBUG_INT1A - printf("eax=0x%x eflags=0x%x\n", X86_EAX, X86_EFLAGS); -#endif - return 1; - case 0xb10d: - if ((tag = findPci(X86_EBX))) { - pciWriteLong(tag, X86_EDI, X86_ECX); - X86_EAX = X86_AL | (SUCCESSFUL << 8); - X86_EFLAGS &= ~((unsigned long) 0x01); /* clear carry flag */ - } else { - X86_EAX = X86_AL | (BAD_REGISTER_NUMBER << 8); - X86_EFLAGS |= ((unsigned long) 0x01); /* set carry flag */ - } -#ifdef DEBUG_INT1A - printf("eax=0x%x eflags=0x%x\n", X86_EAX, X86_EFLAGS); -#endif - return 1; - default: - printf("int1a: subfunction not implemented.\n"); - return 0; - } -} |