summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libbsp/i386/shared/irq
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2015-09-30 15:30:09 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2015-09-30 15:30:09 +0200
commitf91fbbf4b8e6fbe70b792ee52521076f28e1da14 (patch)
tree6138934cf08e2f8f39bbb8bfff92461b8a72ae0d /c/src/lib/libbsp/i386/shared/irq
parentSMP: Fix and optimize thread dispatching (diff)
downloadrtems-f91fbbf4b8e6fbe70b792ee52521076f28e1da14.tar.bz2
bsps/i386: Interrupt server support
Diffstat (limited to 'c/src/lib/libbsp/i386/shared/irq')
-rw-r--r--c/src/lib/libbsp/i386/shared/irq/irq.c3
-rw-r--r--c/src/lib/libbsp/i386/shared/irq/irq.h14
-rw-r--r--c/src/lib/libbsp/i386/shared/irq/irq_asm.S2
3 files changed, 18 insertions, 1 deletions
diff --git a/c/src/lib/libbsp/i386/shared/irq/irq.c b/c/src/lib/libbsp/i386/shared/irq/irq.c
index 415d0d08d9..95ab6ac6d7 100644
--- a/c/src/lib/libbsp/i386/shared/irq/irq.c
+++ b/c/src/lib/libbsp/i386/shared/irq/irq.c
@@ -55,6 +55,7 @@ int i;
* This cache is initialized in ldseg.s
*/
rtems_i8259_masks i8259s_cache = 0xFFFB;
+rtems_i8259_masks i8259s_super_imr = 0xFFFB;
/*-------------------------------------------------------------------------+
| Function: BSP_irq_disable_at_i8259s
@@ -77,6 +78,7 @@ int BSP_irq_disable_at_i8259s (const rtems_irq_number irqLine)
mask = 1 << irqLine;
i8259s_cache |= mask;
+ i8259s_super_imr |= mask;
if (irqLine < 8)
{
@@ -112,6 +114,7 @@ int BSP_irq_enable_at_i8259s (const rtems_irq_number irqLine)
mask = ~(1 << irqLine);
i8259s_cache &= mask;
+ i8259s_super_imr &= mask;
if (irqLine < 8)
{
diff --git a/c/src/lib/libbsp/i386/shared/irq/irq.h b/c/src/lib/libbsp/i386/shared/irq/irq.h
index 90cf71c6ee..095af423cf 100644
--- a/c/src/lib/libbsp/i386/shared/irq/irq.h
+++ b/c/src/lib/libbsp/i386/shared/irq/irq.h
@@ -80,7 +80,19 @@ extern "C" {
*/
typedef unsigned short rtems_i8259_masks;
-extern rtems_i8259_masks i8259s_cache;
+/**
+ * @brief Contains the current IMR of both i8259s.
+ */
+extern rtems_i8259_masks i8259s_cache;
+
+/**
+ * @brief Contains the super IMR of both i8259s to overrule i8259s_cache during
+ * interrupt exit.
+ *
+ * This enables a bsp_interrupt_vector_disable() in interrupt handlers. This
+ * is required for the interrupt server support used by the new network stack.
+ */
+extern rtems_i8259_masks i8259s_super_imr;
/*-------------------------------------------------------------------------+
| Function Prototypes.
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 5ea84e5ea3..d0ed9b626c 100644
--- a/c/src/lib/libbsp/i386/shared/irq/irq_asm.S
+++ b/c/src/lib/libbsp/i386/shared/irq/irq_asm.S
@@ -214,7 +214,9 @@ nested:
cmp ecx, 16 /* is this a PIC IRQ? */
jge .dont_restore_i8259
+ movw SYM (i8259s_super_imr), dx
movl MSK_OFF(esp), eax
+ orw dx, ax
movw ax, SYM (i8259s_cache)
outb $PIC_MASTER_IMR_IO_PORT
movb ah, al