Changeset 8ac962e in rtems


Ignore:
Timestamp:
Sep 17, 2013, 5:44:08 PM (6 years ago)
Author:
Vipul Nayyar <nayyar_vipul@…>
Branches:
4.11, master
Children:
0c0f128
Parents:
d999817
git-author:
Vipul Nayyar <nayyar_vipul@…> (09/17/13 17:44:08)
git-committer:
Joel Sherrill <joel.sherrill@…> (09/17/13 17:44:08)
Message:

bsp_howto/support.t: Add PIC Interrupt Model API Information

File:
1 edited

Legend:

Unmodified
Added
Removed
  • doc/bsp_howto/support.t

    rd999817 r8ac962e  
    284284set of support routines.
    285285
     286@section Programmable Interrupt Controller API
     287
     288A BSP can use the PIC API to install Interrupt Service Routines through
     289a set of generic methods. In order to do so, the header files
     290libbsp/shared/include/irq-generic.h and libbsp/shared/include/irq-info.h
     291must be included by the bsp specific irq.h file present in the include/
     292directory. The irq.h acts as a BSP interrupt support configuration file which
     293is used to define some important MACROS. It contains the declarations for
     294any required global functions like bsp_interrupt_dispatch(). Thus later on,
     295every call to the PIC interface requires including <bsp/irq.h>
     296
     297The generic interrupt handler table is intitalized by invoking the
     298@code{bsp_interrupt_initialize()} method from bsp_start() in the bspstart.c
     299file which sets up this table to store the ISR addresses, whose size is based
     300on the definition of macros, BSP_INTERRUPT_VECTOR_MIN & BSP_INTERRUPT_VECTOR_MAX
     301in include/bsp.h
     302
     303For the generic handler table to properly function, some bsp specific code is
     304required, that should be present in irq/irq.c . The bsp-specific functions required
     305to be writen by the BSP developer are :
     306
     307@itemize @bullet
     308
     309@findex bsp_interrupt_facility_initialize()
     310@item @code{bsp_interrupt_facility_initialize()} contains bsp specific interrupt
     311initialization code(Clear Pending interrupts by modifying registers, etc.).
     312This method is called from bsp_interrupt_initialize() internally while setting up
     313the table.
     314
     315@findex bsp_interrupt_handler_default()
     316@item @code{bsp_interrupt_handler_default()} acts as a fallback handler when
     317no ISR address has been provided corresponding to a vector in the table.
     318
     319@findex bsp_interrupt_dispatch()
     320@item @code{bsp_interrupt_dispatch()} service the ISR by handling
     321any bsp specific code & calling the generic method bsp_interrupt_handler_dispatch()
     322which in turn services the interrupt by running the ISR after looking it up in
     323the table. It acts as an entry to the interrupt switchboard, since the bsp
     324branches to this function at the time of occurrence of an interrupt.
     325
     326@findex bsp_interrupt_vector_enable()
     327@item @code{bsp_interrupt_vector_enable()} enables interrupts and is called in
     328irq-generic.c while setting up the table.
     329
     330@findex bsp_interrupt_vector_disable()
     331@item @code{bsp_interrupt_vector_disable()} disables interrupts and is called in
     332irq-generic.c while setting up the table & during other important parts.
     333
     334@end itemize
     335
     336An interrupt handler is installed or removed with the help of the following functions :
     337
     338@example
     339@group
     340rtems_status_code rtems_interrupt_handler_install(   /* returns status code */
     341  rtems_vector_number vector,                        /* interrupt vector */
     342  const char *info,                           /* custom identification text */
     343  rtems_option options,                              /* Type of Interrupt */
     344  rtems_interrupt_handler handler,                   /* interrupt handler */
     345  void *arg  /* parameter to be passed to handler at the time of invocation */
     346)
     347
     348rtems_status_code rtems_interrupt_handler_remove(   /* returns status code */
     349  rtems_vector_number vector,                       /* interrupt vector */
     350  rtems_interrupt_handler handler,                  /* interrupt handler */
     351  void *arg                          /* parameter to be passed to handler */
     352)
     353
     354@end group
     355@end example
Note: See TracChangeset for help on using the changeset viewer.