]> xenbits.xensource.com Git - seabios.git/commitdiff
Separate out 16bit PCI-BIOS entry point from regular int 0x1a entry point.
authorKevin O'Connor <kevin@koconnor.net>
Sat, 2 Mar 2013 09:02:11 +0000 (04:02 -0500)
committerKevin O'Connor <kevin@koconnor.net>
Sun, 3 Mar 2013 20:45:01 +0000 (15:45 -0500)
The PCI-BIOS entry point can be called in 16bit protected mode, so
separate its entry code from the legacy 0x1a code.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
src/clock.c
src/config.h
src/pcibios.c
src/post.c
src/romlayout.S

index 79b18f91a383e3fa426fea26e026485f07215fec..2ab6adb3425a1229819cf52ca50ecc7c1467948e 100644 (file)
@@ -552,7 +552,6 @@ handle_1a(struct bregs *regs)
     case 0x05: handle_1a05(regs); break;
     case 0x06: handle_1a06(regs); break;
     case 0x07: handle_1a07(regs); break;
-    case 0xb1: handle_1ab1(regs); break;
     default:   handle_1aXX(regs); break;
     }
 }
index 0b9b1aba4b9acc5ce122346e02560a9a4f14b501..8b888b93ff31f34595819008c7719fd357ab7c05 100644 (file)
@@ -94,7 +94,7 @@
 #define DEBUG_ISR_hwpic2 5
 #define DEBUG_HDL_pnp 1
 #define DEBUG_HDL_pmm 1
-#define DEBUG_HDL_pcibios32 9
+#define DEBUG_HDL_pcibios 9
 #define DEBUG_HDL_apm 9
 
 #define DEBUG_unimplemented 2
index 0f3ec5bc6623de2abb2b7a3845a4787bdba63c9c..3c5f519fe1c6dc84be8838b06cafe7d899ccba27 100644 (file)
@@ -201,19 +201,19 @@ handle_1ab1(struct bregs *regs)
     }
 }
 
+// Entry point for pci bios functions.
+void VISIBLE16 VISIBLE32SEG
+handle_pcibios(struct bregs *regs)
+{
+    debug_enter(regs, DEBUG_HDL_pcibios);
+    handle_1ab1(regs);
+}
+
 
 /****************************************************************
  * 32bit interface
  ****************************************************************/
 
-// Entry point for 32bit pci bios functions.
-void VISIBLE32SEG
-handle_pcibios32(struct bregs *regs)
-{
-    debug_enter(regs, DEBUG_HDL_pcibios32);
-    handle_1ab1(regs);
-}
-
 struct bios32_s {
     u32 signature;
     u32 entry;
index 4d3262fc71561fd2c4e853306e242a73194571c7..ff201fad76ddb8764a1e0cee0d3053c2e46d5f95 100644 (file)
@@ -64,7 +64,7 @@ ivt_init(void)
     SET_IVT(0x17, FUNC16(entry_17));
     SET_IVT(0x18, FUNC16(entry_18));
     SET_IVT(0x19, FUNC16(entry_19_official));
-    SET_IVT(0x1a, FUNC16(entry_1a));
+    SET_IVT(0x1a, FUNC16(entry_1a_official));
     SET_IVT(0x40, FUNC16(entry_40));
 
     // INT 60h-66h reserved for user interrupt
index b1628eff710bf92e6dcbbd6a224ef81a819a10af..b152b3e429367f0f52505dca340a1d2050f38095 100644 (file)
@@ -334,19 +334,26 @@ entry_apm32:
         popfl
         lretl
 
-// PCI-BIOS 32bit entry point
+// PCI-BIOS entry points
         DECLFUNC entry_pcibios32
 entry_pcibios32:
         pushfl
         pushl %gs               // Backup %gs and set %gs=%ds
         pushl %ds
         popl %gs
-        ENTRY_ARG_ESP _cfunc32seg_handle_pcibios32
+        ENTRY_ARG_ESP _cfunc32seg_handle_pcibios
         popl %gs
         popfl
         lretl
 
+        .code16gcc
+        DECLFUNC entry_pcibios16
+entry_pcibios16:
+        ENTRY_ARG handle_pcibios
+        iretw
+
 // BIOS32 support
+        .code32
         DECLFUNC entry_bios32
 entry_bios32:
         pushfl
@@ -600,6 +607,10 @@ entry_10_0x0f:
         // 0xfa6e - vgafont8 in font.c
 
         ORG 0xfe6e
+        .global entry_1a_official
+entry_1a_official:
+        cmpb $0xb1, %ah
+        je entry_pcibios16      // PCIBIOS calls can be in protected mode
         IRQ_ENTRY_ARG 1a
 
         ORG 0xfea5