Changeset 2eb9e399 in rtems


Ignore:
Timestamp:
Nov 30, 2007, 9:40:12 PM (12 years ago)
Author:
Till Straumann <strauman@…>
Branches:
4.10, 4.11, 4.9, master
Children:
76e9cda9
Parents:
d928968
Message:

2007-11-30 Till Straumann <strauman@…>

  • shared/irq/irq.h, shared/irq/irq.c, shared/irq/irq_init.c, shared/irq/irq_supp.h (added): Removed 'is_processor_irq()' from irq.c; the BSP routines BSP_enable_irq_at_pic()/BSP_disable_irq_at_pic() are required to ignore processor irqs anyways. Removed all BSP-defined constants from irq.c. This makes irq.c (almost) binary-compatible among BSPs (ultimate goal is making 'shared' a library). Added a header (irq_supp.h) defining the interface between the generic interrupt manager (irq.c) and the routines it requires to be supplied by the BSP (eventually, these should go into rtems/irq.h).
Location:
c/src/lib/libbsp/powerpc
Files:
1 added
5 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/powerpc/ChangeLog

    rd928968 r2eb9e399  
     12007-11-30      Till Straumann <strauman@slac.stanford.edu>
     2
     3        * shared/irq/irq.h, shared/irq/irq.c, shared/irq/irq_init.c,
     4        shared/irq/irq_supp.h (added):
     5        Removed 'is_processor_irq()' from irq.c; the BSP routines
     6        BSP_enable_irq_at_pic()/BSP_disable_irq_at_pic() are required
     7        to ignore processor irqs anyways. Removed
     8        all BSP-defined constants from irq.c. This makes irq.c (almost)
     9        binary-compatible among BSPs (ultimate goal is making 'shared'
     10        a library).
     11        Added a header (irq_supp.h) defining the interface between
     12        the generic interrupt manager (irq.c) and the routines it
     13        requires to be supplied by the BSP (eventually, these
     14        should go into rtems/irq.h).
     15
    1162007-11-30      Till Straumann <strauman@slac.stanford.edu>
    217
  • c/src/lib/libbsp/powerpc/shared/irq/irq.c

    rd928968 r2eb9e399  
    1414#include <stdlib.h>
    1515
    16 #include <bsp.h>
    17 #include <bsp/irq.h>
     16#include <rtems/irq.h>
     17#include <bsp/irq_supp.h>
    1818#include <rtems/score/apiext.h>  /* for post ISR signal processing */
    1919#include <libcpu/raw_exception.h>
     
    4141
    4242/*
    43  * Check if IRQ is a Processor IRQ
    44  */
    45 static inline int is_processor_irq(const rtems_irq_number irqLine)
    46 {
    47   return (((int) irqLine <= BSP_PROCESSOR_IRQ_MAX_OFFSET) &
    48           ((int) irqLine >= BSP_PROCESSOR_IRQ_LOWEST_OFFSET)
    49          );
    50 }
    51 
    52 
    53 /*
    5443 * ------------------------ RTEMS Irq helper functions ----------------
    5544 */
     
    6251static int isValidInterrupt(int irq)
    6352{
    64   if ( (irq < BSP_LOWEST_OFFSET) || (irq > BSP_MAX_OFFSET))
     53  if ( (irq < internal_config->irqBase) || (irq >= internal_config->irqBase + internal_config->irqNb))
    6554    return 0;
    6655  return 1;
     
    10190    rtems_hdl_tbl[irq->name].next_handler = (void *)vchain;
    10291
    103     if (is_processor_irq(irq->name)) {
    104       /*
    105        * Enable exception at processor level
    106        */
    107     } else {
    108                 BSP_enable_irq_at_pic(irq->name);
    109         }
     92        /*
     93         * enable_irq_at_pic is supposed to ignore
     94         * requests to disable interrupts outside
     95         * of the range handled by the PIC
     96         */
     97        BSP_enable_irq_at_pic(irq->name);
     98
    11099    /*
    111100     * Enable interrupt on device
     
    151140    rtems_hdl_tbl[irq->name].next_handler = (void *)-1;
    152141
    153     if (is_processor_irq(irq->name)) {
    154       /*
    155        * Enable exception at processor level
    156        */
    157     } else {
    158           BSP_enable_irq_at_pic(irq->name);
    159         }
     142        /*
     143         * enable_irq_at_pic is supposed to ignore
     144         * requests to disable interrupts outside
     145         * of the range handled by the PIC
     146         */
     147        BSP_enable_irq_at_pic(irq->name);
     148
    160149    /*
    161150     * Enable interrupt on device
     
    232221    }
    233222
    234     if (is_processor_irq(irq->name)) {
    235       /*
    236        * disable exception at processor level
    237        */
    238     } else {
    239           BSP_disable_irq_at_pic(irq->name);
    240         }
     223        /*
     224         * disable_irq_at_pic is supposed to ignore
     225         * requests to disable interrupts outside
     226         * of the range handled by the PIC
     227         */
     228        BSP_disable_irq_at_pic(irq->name);
    241229
    242230    /*
     
    302290        }
    303291
    304         for ( i = BSP_LOWEST_OFFSET; i <= BSP_MAX_OFFSET; i++ ) {
     292        for ( i = config->irqBase; i < config->irqBase + config->irqNb; i++ ) {
    305293                for( vchain = &rtems_hdl_tbl[i];
    306294                     ((int)vchain != -1 && vchain->hdl != default_rtems_entry.hdl);
  • c/src/lib/libbsp/powerpc/shared/irq/irq.h

    rd928968 r2eb9e399  
    182182extern void BSP_i8259s_init(void);
    183183
    184 /*
    185  * PIC-independent function to enable/disable interrupt lines at
    186  * the pic.
    187  */
    188 extern void BSP_enable_irq_at_pic               (const rtems_irq_number irqLine);
    189 extern void BSP_disable_irq_at_pic              (const rtems_irq_number irqLine);
     184/* Stuff in irq_supp.h should eventually go into <rtems/irq.h> */
     185#include <bsp/irq_supp.h>
    190186
    191 extern int BSP_setup_the_pic                    (rtems_irq_global_settings* config);
    192187#ifdef __cplusplus
    193188};
  • c/src/lib/libbsp/powerpc/shared/irq/irq_init.c

    rd928968 r2eb9e399  
    2525#include <bsp/openpic.h>
    2626#include <bsp/irq.h>
     27#include <bsp/irq_supp.h>
    2728#include <bsp.h>
    2829#include <libcpu/raw_exception.h>
  • c/src/lib/libbsp/powerpc/shared/irq/openpic_i8259_irq.c

    rd928968 r2eb9e399  
    1616#include <bsp.h>
    1717#include <bsp/irq.h>
     18#include <bsp/irq_supp.h>
    1819#include <bsp/VMEConfig.h>
    1920#include <bsp/openpic.h>
Note: See TracChangeset for help on using the changeset viewer.