Ignore:
Timestamp:
May 6, 2016, 7:55:29 AM (4 years ago)
Author:
Chris Johns <chrisj@…>
Branches:
master
Children:
02ef5d9
Parents:
292dbff
git-author:
Chris Johns <chrisj@…> (05/06/16 07:55:29)
git-committer:
Chris Johns <chrisj@…> (05/11/16 01:45:01)
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/i386/shared/irq/irq.h

    r292dbff r93fb8797  
    5151+--------------------------------------------------------------------------*/
    5252
    53     /** @brief Base vector for our IRQ handlers. */
     53/** @brief Base vector for our IRQ handlers. */
    5454#define BSP_IRQ_VECTOR_BASE             BSP_ASM_IRQ_VECTOR_BASE
    55 #define BSP_IRQ_LINES_NUMBER            17
    56 #define BSP_LOWEST_OFFSET               0
    57 #define BSP_MAX_ON_i8259S               (BSP_IRQ_LINES_NUMBER - 2)
    58 #define BSP_MAX_OFFSET                  (BSP_IRQ_LINES_NUMBER - 1)
    59     /** @brief
    60      * Interrupt offset in comparison to BSP_ASM_IRQ_VECTOR_BASE
    61      * NB : 1) Interrupt vector number in IDT = offset + BSP_ASM_IRQ_VECTOR_BASE
    62      *      2) The same name should be defined on all architecture
    63      *         so that handler connection can be unchanged.
    64      */
    65 #define BSP_PERIODIC_TIMER      0
    66 #define BSP_KEYBOARD            1
    67 #define BSP_UART_COM2_IRQ       3
    68 #define BSP_UART_COM1_IRQ       4
     55#define BSP_IRQ_LINES_NUMBER            16
     56#define BSP_IRQ_MAX_ON_i8259A           (BSP_IRQ_LINES_NUMBER - 1)
     57
     58/*
     59 * Define the number of valid vectors. This is different to the number of IRQ
     60 * signals supported. Use this value to allocation vector data or range check.
     61 */
     62#define BSP_IRQ_VECTOR_NUMBER        17
     63#define BSP_IRQ_VECTOR_LOWEST_OFFSET 0
     64#define BSP_IRQ_VECTOR_MAX_OFFSET    (BSP_IRQ_VECTOR_NUMBER - 1)
     65
     66/** @brief
     67 * Interrupt offset in comparison to BSP_ASM_IRQ_VECTOR_BASE
     68 * NB : 1) Interrupt vector number in IDT = offset + BSP_ASM_IRQ_VECTOR_BASE
     69 *          2) The same name should be defined on all architecture
     70 *             so that handler connection can be unchanged.
     71 */
     72#define BSP_PERIODIC_TIMER      0 /* fixed on all builds of PC */
     73#define BSP_KEYBOARD            1 /* fixed on all builds of PC */
     74#define BSP_UART_COM2_IRQ       3 /* fixed for ISA bus */
     75#define BSP_UART_COM1_IRQ       4 /* fixed for ISA bus */
    6976#define BSP_UART_COM3_IRQ       5
    7077#define BSP_UART_COM4_IRQ       6
    7178#define BSP_RT_TIMER1           8
    7279#define BSP_RT_TIMER3           10
    73 #define BSP_SMP_IPI             16
     80#define BSP_SMP_IPI             16 /* not part of the ATPIC */
    7481
    75 #define BSP_INTERRUPT_VECTOR_MIN BSP_LOWEST_OFFSET
    76 #define BSP_INTERRUPT_VECTOR_MAX BSP_MAX_OFFSET
     82#define BSP_INTERRUPT_VECTOR_MIN BSP_IRQ_VECTOR_LOWEST_OFFSET
     83#define BSP_INTERRUPT_VECTOR_MAX BSP_IRQ_VECTOR_MAX_OFFSET
    7784
    7885/** @brief
     
    8491 * @brief Contains the current IMR of both i8259s.
    8592 */
    86 extern rtems_i8259_masks i8259s_cache;
     93//extern rtems_i8259_masks i8259s_cache;
    8794
    8895/**
     
    93100 * is required for the interrupt server support used by the new network stack.
    94101 */
    95 extern rtems_i8259_masks i8259s_super_imr;
     102//extern rtems_i8259_masks i8259s_super_imr;
    96103
    97104/*-------------------------------------------------------------------------+
     
    107114 * not be propagated further to the processor
    108115 */
    109 int BSP_irq_disable_at_i8259s        (const rtems_irq_number irqLine);
     116//int BSP_irq_disable_at_i8259s        (const rtems_irq_number irqLine);
    110117/** @brief
    111118 * function to enable a particular irq at 8259 level. After calling
     
    113120 * be propagated further to the processor
    114121 */
    115 int BSP_irq_enable_at_i8259s            (const rtems_irq_number irqLine);
     122//int BSP_irq_enable_at_i8259s          (const rtems_irq_number irqLine);
    116123/** @brief
    117124 * function to acknoledge a particular irq at 8259 level. After calling
     
    121128 * handlers.
    122129 */
    123 int BSP_irq_ack_at_i8259s               (const rtems_irq_number irqLine);
     130//int BSP_irq_ack_at_i8259s             (const rtems_irq_number irqLine);
    124131/** @brief
    125132 * function to check if a particular irq is enabled at 8259 level. After calling
    126133 */
    127 int BSP_irq_enabled_at_i8259s           (const rtems_irq_number irqLine);
     134//int BSP_irq_enabled_at_i8259s         (const rtems_irq_number irqLine);
    128135
    129136/** @} */
Note: See TracChangeset for help on using the changeset viewer.