From f91fbbf4b8e6fbe70b792ee52521076f28e1da14 Mon Sep 17 00:00:00 2001 From: Sebastian Huber Date: Wed, 30 Sep 2015 15:30:09 +0200 Subject: bsps/i386: Interrupt server support --- c/src/lib/libbsp/i386/shared/irq/irq.c | 3 +++ c/src/lib/libbsp/i386/shared/irq/irq.h | 14 +++++++++++++- c/src/lib/libbsp/i386/shared/irq/irq_asm.S | 2 ++ 3 files changed, 18 insertions(+), 1 deletion(-) (limited to 'c/src/lib/libbsp/i386/shared') 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 -- cgit v1.2.3