summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2009-05-18 16:29:30 -0700
committerH. Peter Anvin <hpa@zytor.com>2009-05-18 16:29:30 -0700
commit3bbcbd5e834ed51fc40a2a2f2b1476b1e655df76 (patch)
treec505705811719caf105166c2c3e24a8d21c02413
parent3f00d3393230752919ba1f850d0e79901a67e64c (diff)
downloadsyslinux-3bbcbd5e834ed51fc40a2a2f2b1476b1e655df76.tar.gz
Don't run to comboot API with interrupts offsyslinux-3.81-pre6
We have historically run the comboot API with interrupts off due to concerns about stack overflow. However, this is a really bad idea: we can easily spend a fair bit of time servicing one of these routines, especially when doing things like waiting for I/O. In particular, do_idle should *never* be run with interrupts disabled. Switch to running with interrupts enabled everywhere unless we have specific reasons not to do so. Signed-off-by: H. Peter Anvin <hpa@zytor.com>
-rw-r--r--core/comboot.inc15
1 files changed, 7 insertions, 8 deletions
diff --git a/core/comboot.inc b/core/comboot.inc
index bbb0ad71..cdba16d5 100644
--- a/core/comboot.inc
+++ b/core/comboot.inc
@@ -143,7 +143,7 @@ is_comboot_image:
; Note: this gets invoked both via INT 21h and directly via INT 20h.
; We don't need to cld explicitly here, because comboot_exit does that
; when invoking RESET_STACK_AND_SEGS.
-comboot_return: cli ; Don't trust anyone
+comboot_return: cli ; May not have a safe stack
push enter_command ; Normal return to command prompt
jmp comboot_exit
@@ -222,7 +222,7 @@ comboot_vectors:
section .text
; INT 21h: generic DOS system call
-comboot_int21: cli
+comboot_int21: sti
push ds
push es
push fs
@@ -265,8 +265,7 @@ comboot_bad_int21:
; Attempted to execute invalid DOS system call
; The interrupt number is on the stack.
-comboot_bogus: cli ; Don't trust anyone
- pop dx ; Interrupt number
+comboot_bogus: pop dx ; Interrupt number
pop edi ; CS:IP
mov cx,err_notdos
push comboot_bogus_tail
@@ -294,7 +293,7 @@ comboot_exit:
xor cx,cx
comboot_exit_msg:
pop bx ; Return address
- RESET_STACK_AND_SEGS SI ; Contains cld
+ RESET_STACK_AND_SEGS SI ; Contains sti, cld
call adjust_screen ; The COMBOOT program might have changed the screen
pusha
mov si,DOSSaveVectors
@@ -386,7 +385,7 @@ comboot_getchar:
; INT 28h - DOS idle
;
comboot_int28:
- cli
+ sti
cld
call do_idle
iret
@@ -395,7 +394,7 @@ comboot_int28:
; INT 29h - DOS fast write character
;
comboot_int29:
- cli
+ sti
cld
call writechr ; Preserves registers!
iret
@@ -405,7 +404,7 @@ comboot_int29:
; System call number in ax
;
comboot_int22:
- cli
+ sti
push ds
push es
push fs