diff options
author | Thomas Doerfler <Thomas.Doerfler@embedded-brains.de> | 2010-04-09 20:24:57 +0000 |
---|---|---|
committer | Thomas Doerfler <Thomas.Doerfler@embedded-brains.de> | 2010-04-09 20:24:57 +0000 |
commit | c193baadaf4ba825374104b150eceaed203800b0 (patch) | |
tree | 6933fe6b62789da022c05b5400f36cd2d7b80a57 /c/src/lib/libbsp/arm/gba | |
parent | removed over-paranoid warning switches (diff) | |
download | rtems-c193baadaf4ba825374104b150eceaed203800b0.tar.bz2 |
unify irq data types and code, merge s3c2400/s3c2410 support
Diffstat (limited to 'c/src/lib/libbsp/arm/gba')
-rw-r--r-- | c/src/lib/libbsp/arm/gba/ChangeLog | 5 | ||||
-rw-r--r-- | c/src/lib/libbsp/arm/gba/clock/clockdrv.c | 6 | ||||
-rw-r--r-- | c/src/lib/libbsp/arm/gba/console/console.c | 2 | ||||
-rw-r--r-- | c/src/lib/libbsp/arm/gba/irq/irq.h | 109 | ||||
-rw-r--r-- | c/src/lib/libbsp/arm/gba/irq/irq_init.c | 2 |
5 files changed, 12 insertions, 112 deletions
diff --git a/c/src/lib/libbsp/arm/gba/ChangeLog b/c/src/lib/libbsp/arm/gba/ChangeLog index 769f222cfc..2f81f044ef 100644 --- a/c/src/lib/libbsp/arm/gba/ChangeLog +++ b/c/src/lib/libbsp/arm/gba/ChangeLog @@ -1,3 +1,8 @@ +2010-04-09 Thomas Doerfler <Thomas.Doerfler@embedded-brains.de> + + * clock/clockdrv.c, console/console.c, irq/irq.c, irq/irq.h, + irq/irq_init.c: make irq data types consistent + 2010-04-07 Joel Sherrill <joel.sherrill@oarcorp.com> * start/start.S: Verify boot_card() is passed a NULL. diff --git a/c/src/lib/libbsp/arm/gba/clock/clockdrv.c b/c/src/lib/libbsp/arm/gba/clock/clockdrv.c index 3e1a5bd4c8..82678f3480 100644 --- a/c/src/lib/libbsp/arm/gba/clock/clockdrv.c +++ b/c/src/lib/libbsp/arm/gba/clock/clockdrv.c @@ -31,11 +31,10 @@ static int clock_isr_is_on(const rtems_irq_connect_data *irq); rtems_irq_connect_data clock_isr_data = {BSP_IRQ_TIMER3, (rtems_irq_hdl)Clock_isr, + NULL, clock_isr_on, clock_isr_off, - clock_isr_is_on, - 0, - 0 }; + clock_isr_is_on}; #define CLOCK_VECTOR 0 @@ -44,6 +43,7 @@ rtems_irq_connect_data clock_isr_data = {BSP_IRQ_TIMER3, #define Clock_driver_support_install_isr( _new, _old ) \ do { \ BSP_install_rtems_irq_handler(&clock_isr_data); \ + _old = NULL; \ } while(0) #define Clock_driver_support_shutdown_hardware() \ diff --git a/c/src/lib/libbsp/arm/gba/console/console.c b/c/src/lib/libbsp/arm/gba/console/console.c index 3059c9b94f..43554c508a 100644 --- a/c/src/lib/libbsp/arm/gba/console/console.c +++ b/c/src/lib/libbsp/arm/gba/console/console.c @@ -49,7 +49,7 @@ static int gba_pollRead(int minor) * @return character code * */ -static int gba_write(int minor, const char *buf, int len) +static ssize_t gba_write(int minor, const char *buf, size_t len) { int i; diff --git a/c/src/lib/libbsp/arm/gba/irq/irq.h b/c/src/lib/libbsp/arm/gba/irq/irq.h index 3ba5f4ebac..7bb00e456a 100644 --- a/c/src/lib/libbsp/arm/gba/irq/irq.h +++ b/c/src/lib/libbsp/arm/gba/irq/irq.h @@ -31,9 +31,10 @@ extern "C" { #define VECTOR_TABLE (&irq_vector_table[0]) #include <stdint.h> +#include <rtems/irq.h> #include <rtems.h> -extern void default_int_handler(); +extern void default_int_handler(rtems_irq_hdl_param unused); /*---------------------------------------------------------------------------* * MACROS * @@ -67,67 +68,10 @@ typedef enum { BSP_MAX_INT = 16 /**< BSP_MAX_INT <= _irq_max_vector in linkcmds */ } rtems_irq_symbolic_name; -/* - * Type definition for RTEMS managed interrupts - */ -typedef unsigned char rtems_irq_level; -typedef unsigned char rtems_irq_trigger; extern void _irq_max_vector; /**< defined in lincmds */ extern uint32_t irq_vector_table[BSP_MAX_INT]; /**< allocated in linkcmds */ - -struct __rtems_irq_connect_data__; /* forward declaratiuon */ - -typedef void (*rtems_irq_hdl) (void); -typedef void (*rtems_irq_enable) (const struct __rtems_irq_connect_data__*); -typedef void (*rtems_irq_disable) (const struct __rtems_irq_connect_data__*); -typedef int (*rtems_irq_is_enabled) (const struct __rtems_irq_connect_data__*); - -/** irq connection data structure */ -typedef struct __rtems_irq_connect_data__ { - /** - * IRQ line - */ - rtems_irq_symbolic_name name; - /** - * handler. See comment on handler properties below in function prototype. - */ - rtems_irq_hdl hdl; - /** - * function for enabling interrupts at device level (ONLY!). - * The BSP code will automatically enable it at PIC level. - * RATIONALE : anyway such code has to exist in current driver code. - * It is usually called immediately AFTER connecting the interrupt handler. - * RTEMS may well need such a function when restoring normal interrupt - * processing after a debug session. - * - */ - rtems_irq_enable on; - /** - * function for disabling interrupts at device level (ONLY!). - * The code will disable it at PIC level. RATIONALE : anyway - * such code has to exist for clean shutdown. It is usually called - * BEFORE disconnecting the interrupt. RTEMS may well need such - * a function when disabling normal interrupt processing for - * a debug session. May well be a NOP function. - */ - rtems_irq_disable off; - /** - * function enabling to know what interrupt may currently occur - * if someone manipulates the PIC interrupt mask without care... - */ - rtems_irq_is_enabled isOn; - /** - * irq priority level - */ - rtems_irq_level irqLevel; - /** - * Trigger way : Rising or falling edge or High or low level - */ - rtems_irq_trigger irqTrigger; -} rtems_irq_connect_data; - /*-------------------------------------------------------------------------+ | Function Prototypes. +--------------------------------------------------------------------------*/ @@ -140,55 +84,6 @@ typedef struct __rtems_irq_connect_data__ { */ void BSP_rtems_irq_mngt_init(); - -/** - * @brief function to connect a particular irq handler. - * This hanlder will NOT be called directly as the result of the corresponding interrupt. - * Instead, a RTEMS irq prologue will be called that will : - * 1) save the C scratch registers, - * 2) switch to a interrupt stack if the interrupt is not nested, - * 3) store the current i8259s' interrupt masks - * 4) modify them to disable the current interrupt at 8259 level (and may - * be others depending on software priorities) - * 5) aknowledge the i8259s', - * 6) demask the processor, - * 7) call the application handler - * - * As a result the hdl function provided - * a) can perfectly be written is C, - * b) may also well directly call the part of the RTEMS API that can be used - * from interrupt level, - * c) It only responsible for handling the jobs that need to be done at - * the device level including (aknowledging/re-enabling the interrupt at device, - * level, getting the data,...) - * - * When returning from the function, the following will be performed by - * the RTEMS irq epilogue : - * - * 1) masks the interrupts again, - * 2) restore the original i8259s' interrupt masks - * 3) switch back on the orinal stack if needed, - * 4) perform rescheduling when necessary, - * 5) restore the C scratch registers... - * 6) restore initial execution flow - * - */ -int BSP_install_rtems_irq_handler (const rtems_irq_connect_data*); - -/** - * function to get the current RTEMS irq handler for ptr->name. It enables to - * define hanlder chain... - */ -int BSP_get_current_rtems_irq_handler (rtems_irq_connect_data* ptr); - -/** - * @brief function to get disconnect the RTEMS irq handler for ptr->name. - * This function checks that the value given is the current one for safety reason. - * The user can use the previous function to get it. - */ -int BSP_remove_rtems_irq_handler (const rtems_irq_connect_data*); - - #ifdef __cplusplus } #endif diff --git a/c/src/lib/libbsp/arm/gba/irq/irq_init.c b/c/src/lib/libbsp/arm/gba/irq/irq_init.c index 136188804a..dfa6ec2744 100644 --- a/c/src/lib/libbsp/arm/gba/irq/irq_init.c +++ b/c/src/lib/libbsp/arm/gba/irq/irq_init.c @@ -35,7 +35,7 @@ extern void _irq_max_vector; * @param None * @return None */ -void default_int_handler(void) +void default_int_handler(rtems_irq_hdl_param unused) { printk("raw_idt_notify has been called \n"); } |