diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2015-09-30 15:30:09 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2015-09-30 15:30:09 +0200 |
commit | f91fbbf4b8e6fbe70b792ee52521076f28e1da14 (patch) | |
tree | 6138934cf08e2f8f39bbb8bfff92461b8a72ae0d /c/src | |
parent | SMP: Fix and optimize thread dispatching (diff) | |
download | rtems-f91fbbf4b8e6fbe70b792ee52521076f28e1da14.tar.bz2 |
bsps/i386: Interrupt server support
Diffstat (limited to 'c/src')
-rw-r--r-- | c/src/lib/libbsp/i386/pc386/startup/ldsegs.S | 8 | ||||
-rw-r--r-- | c/src/lib/libbsp/i386/shared/irq/irq.c | 3 | ||||
-rw-r--r-- | c/src/lib/libbsp/i386/shared/irq/irq.h | 14 | ||||
-rw-r--r-- | c/src/lib/libbsp/i386/shared/irq/irq_asm.S | 2 |
4 files changed, 22 insertions, 5 deletions
diff --git a/c/src/lib/libbsp/i386/pc386/startup/ldsegs.S b/c/src/lib/libbsp/i386/pc386/startup/ldsegs.S index f527ff9ebd..82ff982331 100644 --- a/c/src/lib/libbsp/i386/pc386/startup/ldsegs.S +++ b/c/src/lib/libbsp/i386/pc386/startup/ldsegs.S @@ -147,16 +147,16 @@ next_step: outb al, $0xA1 call SYM(pc386_delay) + /* + * The IMR values must correspond to the initial value of i8259s_cache. + */ movb $0xFF, al /* mask off all interrupts for now */ outb al, $0xA1 call SYM(pc386_delay) movb $0xFB, al /* mask all irq's but irq2 which */ outb al, $0x21 /* is cascaded */ call SYM(pc386_delay) - - movw $0xFFFB, SYM(i8259s_cache) /* set up same values in cache */ - - #endif +#endif jmp SYM (_establish_stack) # return to the bsp entry code /*-------------------------------------------------------------------------+ 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 |