Ignore:
Timestamp:
Apr 9, 2010, 8:24:57 PM (10 years ago)
Author:
Thomas Doerfler <Thomas.Doerfler@…>
Branches:
4.10, 4.11, master
Children:
3ed964f9
Parents:
a0bdb9b
Message:

unify irq data types and code, merge s3c2400/s3c2410 support

File:
1 edited

Legend:

Unmodified
Added
Removed
  • c/src/lib/libbsp/arm/gba/irq/irq.h

    ra0bdb9b rc193baad  
    3232
    3333#include <stdint.h>
     34#include <rtems/irq.h>
    3435#include <rtems.h>
    3536
    36 extern void default_int_handler();
     37extern void default_int_handler(rtems_irq_hdl_param unused);
    3738
    3839/*---------------------------------------------------------------------------*
     
    6869} rtems_irq_symbolic_name;
    6970
    70 /*
    71  * Type definition for RTEMS managed interrupts
    72  */
    73 typedef unsigned char  rtems_irq_level;
    74 typedef unsigned char  rtems_irq_trigger;
    7571
    7672extern void        _irq_max_vector;               /**< defined in lincmds    */
    7773extern uint32_t    irq_vector_table[BSP_MAX_INT]; /**< allocated in linkcmds */
    78 
    79 
    80 struct  __rtems_irq_connect_data__;     /* forward declaratiuon */
    81 
    82 typedef void (*rtems_irq_hdl)           (void);
    83 typedef void (*rtems_irq_enable)        (const struct __rtems_irq_connect_data__*);
    84 typedef void (*rtems_irq_disable)       (const struct __rtems_irq_connect_data__*);
    85 typedef int  (*rtems_irq_is_enabled)    (const struct __rtems_irq_connect_data__*);
    86 
    87 /** irq connection data structure */
    88 typedef struct __rtems_irq_connect_data__ {
    89   /**
    90    * IRQ line
    91    */
    92   rtems_irq_symbolic_name       name;
    93   /**
    94    * handler. See comment on handler properties below in function prototype.
    95    */
    96   rtems_irq_hdl                 hdl;
    97   /**
    98    * function for enabling interrupts at device level (ONLY!).
    99    * The BSP code will automatically enable it at PIC level.
    100    * RATIONALE : anyway such code has to exist in current driver code.
    101    * It is usually called immediately AFTER connecting the interrupt handler.
    102    * RTEMS may well need such a function when restoring normal interrupt
    103    * processing after a debug session.
    104    *
    105    */
    106     rtems_irq_enable            on;
    107   /**
    108    * function for disabling interrupts at device level (ONLY!).
    109    * The code will disable it at PIC level. RATIONALE : anyway
    110    * such code has to exist for clean shutdown. It is usually called
    111    * BEFORE disconnecting the interrupt. RTEMS may well need such
    112    * a function when disabling normal interrupt processing for
    113    * a debug session. May well be a NOP function.
    114    */
    115   rtems_irq_disable             off;
    116   /**
    117    * function enabling to know what interrupt may currently occur
    118    * if someone manipulates the PIC interrupt mask without care...
    119    */
    120     rtems_irq_is_enabled        isOn;
    121   /**
    122    * irq priority level
    123    */
    124   rtems_irq_level               irqLevel;
    125   /**
    126    * Trigger way : Rising or falling edge or High or low level
    127    */
    128   rtems_irq_trigger             irqTrigger;
    129 } rtems_irq_connect_data;
    13074
    13175/*-------------------------------------------------------------------------+
     
    14185void BSP_rtems_irq_mngt_init();
    14286
    143 
    144 /**
    145  * @brief function to connect a particular irq handler.
    146  * This hanlder will NOT be called directly as the result of the corresponding interrupt.
    147  * Instead, a RTEMS irq prologue will be called that will :
    148  *      1) save the C scratch registers,
    149  *      2) switch to a interrupt stack if the interrupt is not nested,
    150  *      3) store the current i8259s' interrupt masks
    151  *      4) modify them to disable the current interrupt at 8259 level (and may
    152  *      be others depending on software priorities)
    153  *      5) aknowledge the i8259s',
    154  *      6) demask the processor,
    155  *      7) call the application handler
    156  *
    157  * As a result the hdl function provided
    158  *      a) can perfectly be written is C,
    159  *      b) may also well directly call the part of the RTEMS API that can be used
    160  *      from interrupt level,
    161  *      c) It only responsible for handling the jobs that need to be done at
    162  *      the device level including (aknowledging/re-enabling the interrupt at device,
    163  *      level, getting the data,...)
    164  *
    165  *      When returning from the function, the following will be performed by
    166  *      the RTEMS irq epilogue :
    167  *
    168  *      1) masks the interrupts again,
    169  *      2) restore the original i8259s' interrupt masks
    170  *      3) switch back on the orinal stack if needed,
    171  *      4) perform rescheduling when necessary,
    172  *      5) restore the C scratch registers...
    173  *      6) restore initial execution flow
    174  *
    175  */
    176 int BSP_install_rtems_irq_handler       (const rtems_irq_connect_data*);
    177 
    178 /**
    179  * function to get the current RTEMS irq handler for ptr->name. It enables to
    180  * define hanlder chain...
    181  */
    182 int BSP_get_current_rtems_irq_handler   (rtems_irq_connect_data* ptr);
    183 
    184 /**
    185  * @brief function to get disconnect the RTEMS irq handler for ptr->name.
    186  * This function checks that the value given is the current one for safety reason.
    187  * The user can use the previous function to get it.
    188  */
    189 int BSP_remove_rtems_irq_handler        (const rtems_irq_connect_data*);
    190 
    191 
    19287#ifdef __cplusplus
    19388}
Note: See TracChangeset for help on using the changeset viewer.