[3c7ed6b] | 1 | /** |
---|
| 2 | * @file irq.h |
---|
| 3 | * |
---|
| 4 | * This include file describe the data structure and the functions implemented |
---|
| 5 | * by rtems to write interrupt handlers. |
---|
| 6 | */ |
---|
| 7 | /* |
---|
| 8 | * RTEMS GBA BSP |
---|
| 9 | * |
---|
| 10 | * Copyright (c) 2004 Markku Puro <markku.puro@kopteri.net> |
---|
| 11 | * |
---|
| 12 | * The license and distribution terms for this file may be |
---|
| 13 | * found in found in the file LICENSE in this distribution or at |
---|
| 14 | * http://www.rtems.com/license/LICENSE. |
---|
| 15 | * |
---|
| 16 | * $Id$ |
---|
| 17 | */ |
---|
| 18 | |
---|
| 19 | #ifndef _IRQ_H_ |
---|
| 20 | #define _IRQ_H_ |
---|
| 21 | |
---|
| 22 | |
---|
| 23 | #ifdef __cplusplus |
---|
| 24 | extern "C" { |
---|
| 25 | #endif |
---|
| 26 | |
---|
| 27 | /* |
---|
| 28 | * Include some preprocessor value also used by assember code |
---|
| 29 | */ |
---|
| 30 | |
---|
| 31 | #define VECTOR_TABLE (&irq_vector_table[0]) |
---|
| 32 | |
---|
| 33 | #include <stdint.h> |
---|
[c193baad] | 34 | #include <rtems/irq.h> |
---|
[3c7ed6b] | 35 | #include <rtems.h> |
---|
| 36 | |
---|
[c193baad] | 37 | extern void default_int_handler(rtems_irq_hdl_param unused); |
---|
[3c7ed6b] | 38 | |
---|
| 39 | /*---------------------------------------------------------------------------* |
---|
| 40 | * MACROS * |
---|
| 41 | *---------------------------------------------------------------------------*/ |
---|
| 42 | |
---|
| 43 | #define ENABLE_IRQ() GBA_REG_IME = 1; |
---|
| 44 | #define DISABLE_IRQ() GBA_REG_IME = 0; |
---|
| 45 | |
---|
| 46 | |
---|
| 47 | /*-------------------------------------------------------------------------+ |
---|
| 48 | | Constants |
---|
| 49 | +--------------------------------------------------------------------------*/ |
---|
| 50 | |
---|
| 51 | typedef enum { |
---|
| 52 | BSP_IRQ_VBLANK = 0, |
---|
| 53 | BSP_IRQ_HBLANK = 1, |
---|
| 54 | BSP_IRQ_VCOUNTER = 2, |
---|
| 55 | BSP_IRQ_TIMER0 = 3, |
---|
| 56 | BSP_IRQ_TIMER1 = 4, |
---|
| 57 | BSP_IRQ_TIMER2 = 5, |
---|
| 58 | BSP_IRQ_TIMER3 = 6, |
---|
| 59 | BSP_IRQ_SERIAL = 7, |
---|
| 60 | BSP_IRQ_DMA0 = 8, |
---|
| 61 | BSP_IRQ_DMA1 = 9, |
---|
| 62 | BSP_IRQ_DMA2 = 10, |
---|
| 63 | BSP_IRQ_DMA3 = 11, |
---|
| 64 | BSP_IRQ_KEY = 12, |
---|
| 65 | BSP_IRQ_CART = 13, |
---|
| 66 | BSP_IRQ_NA14 = 14, |
---|
| 67 | BSP_IRQ_NA15 = 15, |
---|
| 68 | BSP_MAX_INT = 16 /**< BSP_MAX_INT <= _irq_max_vector in linkcmds */ |
---|
| 69 | } rtems_irq_symbolic_name; |
---|
| 70 | |
---|
| 71 | |
---|
| 72 | extern void _irq_max_vector; /**< defined in lincmds */ |
---|
| 73 | extern uint32_t irq_vector_table[BSP_MAX_INT]; /**< allocated in linkcmds */ |
---|
| 74 | |
---|
| 75 | /*-------------------------------------------------------------------------+ |
---|
| 76 | | Function Prototypes. |
---|
| 77 | +--------------------------------------------------------------------------*/ |
---|
| 78 | /* |
---|
| 79 | * ------------------------ RTEMS Single Irq Handler Mngt Routines ---------------- |
---|
| 80 | */ |
---|
| 81 | |
---|
| 82 | /** |
---|
| 83 | * @brief function to initialize the interrupt for a specific BSP |
---|
| 84 | */ |
---|
| 85 | void BSP_rtems_irq_mngt_init(); |
---|
| 86 | |
---|
| 87 | #ifdef __cplusplus |
---|
| 88 | } |
---|
| 89 | #endif |
---|
| 90 | |
---|
| 91 | #endif /* _IRQ_H_ */ |
---|