summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRonald G. Minnich <rminnich@gmail.com>2009-06-09 11:14:26 +0000
committerRonald G. Minnich <rminnich@gmail.com>2009-06-09 11:14:26 +0000
commitce314b3f027f1aaee6d1aba9488268c35095bbc4 (patch)
treee195b6bc14bea8664e7919359025a1bfadbacb63
parent1a5f05b02cd4eaf52ab434e0906ead966c78c0ef (diff)
downloadcoreboot-ce314b3f027f1aaee6d1aba9488268c35095bbc4.tar.gz
coreboot-ce314b3f027f1aaee6d1aba9488268c35095bbc4.tar.bz2
coreboot-ce314b3f027f1aaee6d1aba9488268c35095bbc4.zip
There are some problems with the way these interrrupts were
managed. First, the CLI erases any knowledge of whether interrupts were enabled or disabled. Second, the STI works badly on qemu; we get an immediate INT #0 as soon as the STI happens. This spurious interrupt doesn't happen on real hardware (YET!)but, that said, I don't think this code should be doing cli and sti. I can't see a reason to enable interrupts at this point in coreboot. This change fixes the observed qemu failures. Signed-off-by: Ronald G. Minnich <rminnich@gmail.com> Acked-by: Stefan Reinauer <stepan@coresystems.de> git-svn-id: svn://coreboot.org/repository/coreboot-v3@1172 f3766cd6-281f-0410-b1cd-43a5c92072e9
-rw-r--r--util/x86emu/x86_asm.S50
1 files changed, 1 insertions, 49 deletions
diff --git a/util/x86emu/x86_asm.S b/util/x86emu/x86_asm.S
index cd64dd5c7156..10f5f2f62829 100644
--- a/util/x86emu/x86_asm.S
+++ b/util/x86emu/x86_asm.S
@@ -71,11 +71,6 @@ __run_optionrom = RELOCATED(.)
// FIXME: Should this function be called with regparm=0?
movl 8(%ebp), %ecx
- /* Clear interrupts before making a
- * transition to Real Mode
- */
- cli
-
/* Activate the right segment descriptor real mode. */
ljmp $0x28, $RELOCATED(1f)
1:
@@ -111,14 +106,11 @@ __run_optionrom = RELOCATED(.)
movl $0x1000, %eax
movl %eax, %esp
- /* Load our 16 it idt */
+ /* Load our 16 bit idt */
xor %ax, %ax
mov %ax, %ds
lidt __realmode_idt
- /* All critical work is done, allow interrupts again */
- sti
-
/* Set all segments to 0x0000, ds to 0x0040 */
mov %ax, %es
mov %ax, %fs
@@ -133,11 +125,6 @@ __run_optionrom = RELOCATED(.)
lcall $0xc000, $0x0003
/* ************************************ */
- /* Clear interrupts before making a
- * transition to Protected Mode
- */
- cli
-
/* If we got here, just about done.
* Need to get back to protected mode
*/
@@ -161,9 +148,6 @@ __run_optionrom = RELOCATED(.)
/* restore proper idt */
lidt idtarg
- /* All critical work is done, allow interrupts again */
- sti
-
/* and exit */
mov __stack, %esp
popal
@@ -179,11 +163,6 @@ __run_interrupt = RELOCATED(.)
mov %esp, __stack
- /* Clear interrupts before making a
- * transition to Real Mode
- */
- cli
-
/* This configures CS properly for real mode. */
ljmp $0x28, $RELOCATED(1f)
1:
@@ -228,9 +207,6 @@ __run_interrupt = RELOCATED(.)
mov %ax, %ds
lidt __realmode_idt
- /* All critical work is done, allow interrupts again */
- sti
-
/* Set all segments to 0x0000 */
mov %ax, %ds
mov %ax, %es
@@ -250,11 +226,6 @@ __run_interrupt = RELOCATED(.)
movw $0, %di
int $0x10
- /* Clear interrupts before making a
- * transition to Protected Mode
- */
- cli
-
/* Ok, the job is done, now go back to protected mode coreboot */
movl %cr0, %eax
orl $PE, %eax
@@ -274,9 +245,6 @@ __run_interrupt = RELOCATED(.)
/* restore coreboot's 32-bit IDT */
lidt idtarg
- /* All critical work is done, allow interrupts again */
- sti
-
/* Exit */
mov __stack, %esp
popal
@@ -299,11 +267,6 @@ __interrupt_handler_16bit = RELOCATED(.)
andl $0xff, %eax
pushl %eax /* ... and make it the first parameter */
- /* Clear interrupts before making a
- * transition to Protected Mode
- */
- cli
-
/* Switch to protected mode */
movl %cr0, %eax
orl $PE, %eax
@@ -322,9 +285,6 @@ __interrupt_handler_16bit = RELOCATED(.)
lidt idtarg
- /* All critical work is done, allow interrupts again */
- sti
-
/* Call the C interrupt handler */
movl $interrupt_handler, %eax
call *%eax
@@ -344,11 +304,6 @@ __interrupt_handler_16bit = RELOCATED(.)
mov %ax, %gs
mov %ax, %ss
- /* Clear interrupts before making a
- * transition to Real Mode
- */
- cli
-
/* Disable Protected Mode */
movl %cr0, %eax
andl $~PE, %eax
@@ -366,9 +321,6 @@ __interrupt_handler_16bit = RELOCATED(.)
mov %ax, %ds
lidt __realmode_idt
- /* All critical work is done, allow interrupts again */
- sti
-
/* Set up our segment registers to segment 0x0000 */
mov %ax, %es
mov %ax, %fs