summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libbsp/i386/shared/irq/irq_asm.S
diff options
context:
space:
mode:
authorTill Straumann <strauman@slac.stanford.edu>2011-08-05 00:15:50 +0000
committerTill Straumann <strauman@slac.stanford.edu>2011-08-05 00:15:50 +0000
commite94aa61b6820e34732840139dbe3f2016c6f1e24 (patch)
treee017844b23691597d0fc989e7f58c744a8bf1177 /c/src/lib/libbsp/i386/shared/irq/irq_asm.S
parent2011-08-04 Joel Sherrill <joel.sherrill@oarcorp.com> (diff)
downloadrtems-e94aa61b6820e34732840139dbe3f2016c6f1e24.tar.bz2
2011-08-04 Till Straumann <strauman@slac.stanford.edu>
* shared/irq/irq_asm.S: BUGFIX (introduced by SMP changes which moved code around, apparently): *must* store i8259 mask to frame *before* switching to IRQ stack. The code retrieves the mask after switching back to original stack. Also, the IRQ stack has no reserved space for the mask; storing it there could overwrite memory!
Diffstat (limited to 'c/src/lib/libbsp/i386/shared/irq/irq_asm.S')
-rw-r--r--c/src/lib/libbsp/i386/shared/irq/irq_asm.S5
1 files changed, 3 insertions, 2 deletions
diff --git a/c/src/lib/libbsp/i386/shared/irq/irq_asm.S b/c/src/lib/libbsp/i386/shared/irq/irq_asm.S
index e644e7587c..a0a00e944c 100644
--- a/c/src/lib/libbsp/i386/shared/irq/irq_asm.S
+++ b/c/src/lib/libbsp/i386/shared/irq/irq_asm.S
@@ -76,6 +76,8 @@ SYM (_ISR_Handler):
movl ebx, EBX_OFF(esp)
movl eax, ESP_OFF(esp)
movl ebp, EBP_OFF(esp)
+ movw SYM (i8259s_cache), ax /* save current i8259 interrupt mask */
+ movl eax, MSK_OFF(esp) /* save in stack frame */
#ifdef __SSE__
/* NOTE: SSE only is supported if the BSP enables fxsave/fxrstor
@@ -142,8 +144,7 @@ nested:
/*
* acknowledge the interrupt
*/
- movw SYM (i8259s_cache), ax /* save current i8259 interrupt mask */
- movl eax, MSK_OFF(esp) /* save in stack frame */
+ movw SYM (i8259s_cache), ax /* fetch current i8259 interrupt mask */
/*
* compute the new PIC mask: