fixed undefined value in X86 pci bios emulation

This commit is contained in:
Markus Fröschle
2014-01-04 12:58:28 +00:00
parent 2857b525ba
commit 37d3befb44
2 changed files with 15 additions and 9 deletions

View File

@@ -9,7 +9,7 @@
# can be either "Y" or "N" (without quotes). "Y" for using the m68k-elf-, "N" for using the m68k-atari-mint
# toolchain
COMPILE_ELF=N
COMPILE_ELF=Y
ifeq (Y,$(COMPILE_ELF))
TCPREFIX=m68k-elf-

View File

@@ -11,7 +11,8 @@ int x86_pcibios_emulator()
int ret = 0;
unsigned long dev;
switch (X86_AX) {
switch (X86_AX)
{
case PCI_BIOS_PRESENT:
dbg("%s: PCI_BIOS_PRESENT\r\n", __FUNCTION__);
X86_AH = 0x00; /* no config space/special cycle support */
@@ -24,8 +25,6 @@ int x86_pcibios_emulator()
break;
case FIND_PCI_DEVICE:
/* FixME: support SI != 0 */
// vendor, device
dbg("%s: FIND_PCI_DEVICE vendor = %04x, device = %04x\r\n", __FUNCTION__, X86_DX, X86_CX);
dev = pci_find_device((unsigned long) X86_DX, ((unsigned long) X86_CX), 0);
@@ -71,6 +70,7 @@ int x86_pcibios_emulator()
case READ_CONFIG_BYTE:
// bus, devfn
dbg("%s: READ_CONFIG_BYTE bus = %x, devfn = %x, reg = %x\r\n", __FUNCTION__, X86_BH, X86_BL, X86_DI);
dev = PCI_HANDLE(X86_BH, X86_BL >> 3, X86_BL & 3);
X86_CL = pci_read_config_byte(dev, X86_DI);
dbg("%s: value = %x\r\n", __FUNCTION__, X86_CL);
X86_AH = SUCCESSFUL;
@@ -81,6 +81,7 @@ int x86_pcibios_emulator()
case READ_CONFIG_WORD:
// bus, devfn
dbg("%s: READ_CONFIG_WORD bus = %x, devfn = %x, reg = %x\r\n", __FUNCTION__, X86_BH, X86_BL, X86_DI);
dev = PCI_HANDLE(X86_BH, X86_BL >> 3, X86_BL & 3);
if(X86_DI == PCIBAR1)
X86_CX = offset_port + 1;
else
@@ -94,6 +95,7 @@ int x86_pcibios_emulator()
case READ_CONFIG_DWORD:
// bus, devfn
dbg("%s: READ_CONFIG_DWORD bus = %x, devfn = %x, reg = %x\r\n", __FUNCTION__, X86_BH, X86_BL, X86_DI);
dev = PCI_HANDLE(X86_BH, X86_BL >> 3, X86_BL & 3);
if (X86_DI == PCIBAR1)
X86_CX = (unsigned long) offset_port + 1;
else
@@ -106,7 +108,9 @@ int x86_pcibios_emulator()
case WRITE_CONFIG_BYTE:
// bus, devfn
dbg("%s: READ_CONFIG_BYTE bus = %x, devfn = %x, reg = %x\r\n", __FUNCTION__, X86_BH, X86_BL, X86_CL);
dbg("%s: READ_CONFIG_BYTE bus = %x, devfn = %x, reg = %x, value = %x\r\n", __FUNCTION__,
X86_BH, X86_BL, X86_DI, X86_CL);
dev = PCI_HANDLE(X86_BH, X86_BL >> 3, X86_BL & 3);
pci_write_config_byte(dev, X86_DI, X86_CL);
X86_AH = SUCCESSFUL;
X86_EFLAGS &= ~FB_CF; /* clear carry flag */
@@ -115,6 +119,7 @@ int x86_pcibios_emulator()
case WRITE_CONFIG_WORD:
// bus, devfn
dev = PCI_HANDLE(X86_BH, X86_BL >> 3, X86_BL & 3);
dbg("%s: WRITE_CONFIG_WORD bus = %x, devfn = %x, reg = %x, value = %x\r\n", X86_BH, X86_BL, X86_DI, X86_CX);
if (X86_DI == PCIBAR1)
{
@@ -132,6 +137,7 @@ int x86_pcibios_emulator()
case WRITE_CONFIG_DWORD:
// bus, devfn
dev = PCI_HANDLE(X86_BH, X86_BL >> 3, X86_BL & 3);
dbg("%s: WRITE_CONFIG_DWORD bus = %x, devfn = %x, value = %x\r\n", __FUNCTION__,
X86_BH, X86_BL, X86_DI, X86_ECX);
if (X86_DI == PCIBAR1)