summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTill Straumann <strauman@slac.stanford.edu>2011-08-05 00:15:50 (UTC)
committerTill Straumann <strauman@slac.stanford.edu>2011-08-05 00:15:50 (UTC)
commite94aa61b6820e34732840139dbe3f2016c6f1e24 (patch)
treee017844b23691597d0fc989e7f58c744a8bf1177
parent0f660eb74496296296e0b995e6d93d5645d55dda (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!
-rw-r--r--c/src/lib/libbsp/i386/ChangeLog9
-rw-r--r--c/src/lib/libbsp/i386/shared/irq/irq_asm.S5
2 files changed, 12 insertions, 2 deletions
diff --git a/c/src/lib/libbsp/i386/ChangeLog b/c/src/lib/libbsp/i386/ChangeLog
index c093bca..8d41b7b 100644
--- a/c/src/lib/libbsp/i386/ChangeLog
+++ b/c/src/lib/libbsp/i386/ChangeLog
@@ -1,3 +1,12 @@
+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!
+
2011-08-01 Jennifer Averett <Jennifer.Averett@OARcorp.com>
PR 1802
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 e644e75..a0a00e9 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: