diff options
author | Chris Johns <chrisj@rtems.org> | 2016-05-06 17:55:29 +1000 |
---|---|---|
committer | Chris Johns <chrisj@rtems.org> | 2016-05-11 11:45:01 +1000 |
commit | 93fb8797961f602ea70ac5b846a066b05db44b18 (patch) | |
tree | 5f0fa3a6427b178a0763ec8c6255895133e75214 /c/src/lib/libbsp/i386/shared/irq/irq.h | |
parent | i386/pc386: Fix printk with the console changes. (diff) | |
download | rtems-93fb8797961f602ea70ac5b846a066b05db44b18.tar.bz2 |
i386/pc386: Fix interrupt support.
Fix the interrupt and stop the spurious interrupt from happening.
The fix moves the EOI to C code and cleans that functionality out
of the asm part of the ISR handler.
The code checks the ISR and IRR registers on the enable.
Only ack the master for a slave IRQ if the slave has no other pending
requests.
Diffstat (limited to 'c/src/lib/libbsp/i386/shared/irq/irq.h')
-rw-r--r-- | c/src/lib/libbsp/i386/shared/irq/irq.h | 55 |
1 files changed, 31 insertions, 24 deletions
diff --git a/c/src/lib/libbsp/i386/shared/irq/irq.h b/c/src/lib/libbsp/i386/shared/irq/irq.h index 095af423cf..953774e0ab 100644 --- a/c/src/lib/libbsp/i386/shared/irq/irq.h +++ b/c/src/lib/libbsp/i386/shared/irq/irq.h @@ -50,30 +50,37 @@ extern "C" { | Constants +--------------------------------------------------------------------------*/ - /** @brief Base vector for our IRQ handlers. */ +/** @brief Base vector for our IRQ handlers. */ #define BSP_IRQ_VECTOR_BASE BSP_ASM_IRQ_VECTOR_BASE -#define BSP_IRQ_LINES_NUMBER 17 -#define BSP_LOWEST_OFFSET 0 -#define BSP_MAX_ON_i8259S (BSP_IRQ_LINES_NUMBER - 2) -#define BSP_MAX_OFFSET (BSP_IRQ_LINES_NUMBER - 1) - /** @brief - * Interrupt offset in comparison to BSP_ASM_IRQ_VECTOR_BASE - * NB : 1) Interrupt vector number in IDT = offset + BSP_ASM_IRQ_VECTOR_BASE - * 2) The same name should be defined on all architecture - * so that handler connection can be unchanged. - */ -#define BSP_PERIODIC_TIMER 0 -#define BSP_KEYBOARD 1 -#define BSP_UART_COM2_IRQ 3 -#define BSP_UART_COM1_IRQ 4 +#define BSP_IRQ_LINES_NUMBER 16 +#define BSP_IRQ_MAX_ON_i8259A (BSP_IRQ_LINES_NUMBER - 1) + +/* + * Define the number of valid vectors. This is different to the number of IRQ + * signals supported. Use this value to allocation vector data or range check. + */ +#define BSP_IRQ_VECTOR_NUMBER 17 +#define BSP_IRQ_VECTOR_LOWEST_OFFSET 0 +#define BSP_IRQ_VECTOR_MAX_OFFSET (BSP_IRQ_VECTOR_NUMBER - 1) + +/** @brief + * Interrupt offset in comparison to BSP_ASM_IRQ_VECTOR_BASE + * NB : 1) Interrupt vector number in IDT = offset + BSP_ASM_IRQ_VECTOR_BASE + * 2) The same name should be defined on all architecture + * so that handler connection can be unchanged. + */ +#define BSP_PERIODIC_TIMER 0 /* fixed on all builds of PC */ +#define BSP_KEYBOARD 1 /* fixed on all builds of PC */ +#define BSP_UART_COM2_IRQ 3 /* fixed for ISA bus */ +#define BSP_UART_COM1_IRQ 4 /* fixed for ISA bus */ #define BSP_UART_COM3_IRQ 5 #define BSP_UART_COM4_IRQ 6 #define BSP_RT_TIMER1 8 #define BSP_RT_TIMER3 10 -#define BSP_SMP_IPI 16 +#define BSP_SMP_IPI 16 /* not part of the ATPIC */ -#define BSP_INTERRUPT_VECTOR_MIN BSP_LOWEST_OFFSET -#define BSP_INTERRUPT_VECTOR_MAX BSP_MAX_OFFSET +#define BSP_INTERRUPT_VECTOR_MIN BSP_IRQ_VECTOR_LOWEST_OFFSET +#define BSP_INTERRUPT_VECTOR_MAX BSP_IRQ_VECTOR_MAX_OFFSET /** @brief * Type definition for RTEMS managed interrupts @@ -83,7 +90,7 @@ typedef unsigned short rtems_i8259_masks; /** * @brief Contains the current IMR of both i8259s. */ -extern rtems_i8259_masks i8259s_cache; +//extern rtems_i8259_masks i8259s_cache; /** * @brief Contains the super IMR of both i8259s to overrule i8259s_cache during @@ -92,7 +99,7 @@ extern rtems_i8259_masks i8259s_cache; * 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; +//extern rtems_i8259_masks i8259s_super_imr; /*-------------------------------------------------------------------------+ | Function Prototypes. @@ -106,13 +113,13 @@ extern rtems_i8259_masks i8259s_super_imr; * this function, even if the device asserts the interrupt line it will * not be propagated further to the processor */ -int BSP_irq_disable_at_i8259s (const rtems_irq_number irqLine); +//int BSP_irq_disable_at_i8259s (const rtems_irq_number irqLine); /** @brief * function to enable a particular irq at 8259 level. After calling * this function, if the device asserts the interrupt line it will * be propagated further to the processor */ -int BSP_irq_enable_at_i8259s (const rtems_irq_number irqLine); +//int BSP_irq_enable_at_i8259s (const rtems_irq_number irqLine); /** @brief * function to acknoledge a particular irq at 8259 level. After calling * this function, if a device asserts an enabled interrupt line it will @@ -120,11 +127,11 @@ int BSP_irq_enable_at_i8259s (const rtems_irq_number irqLine); * writting raw handlers as this is automagically done for rtems managed * handlers. */ -int BSP_irq_ack_at_i8259s (const rtems_irq_number irqLine); +//int BSP_irq_ack_at_i8259s (const rtems_irq_number irqLine); /** @brief * function to check if a particular irq is enabled at 8259 level. After calling */ -int BSP_irq_enabled_at_i8259s (const rtems_irq_number irqLine); +//int BSP_irq_enabled_at_i8259s (const rtems_irq_number irqLine); /** @} */ |