diff options
Diffstat (limited to 'c/src/lib/libcpu/arm/lpc22xx/irq')
-rw-r--r-- | c/src/lib/libcpu/arm/lpc22xx/irq/bsp_irq_asm.S | 6 | ||||
-rw-r--r-- | c/src/lib/libcpu/arm/lpc22xx/irq/bsp_irq_init.c | 12 | ||||
-rw-r--r-- | c/src/lib/libcpu/arm/lpc22xx/irq/irq.c | 20 | ||||
-rw-r--r-- | c/src/lib/libcpu/arm/lpc22xx/irq/irq.h | 14 |
4 files changed, 26 insertions, 26 deletions
diff --git a/c/src/lib/libcpu/arm/lpc22xx/irq/bsp_irq_asm.S b/c/src/lib/libcpu/arm/lpc22xx/irq/bsp_irq_asm.S index d8181055c3..cec8a00b79 100644 --- a/c/src/lib/libcpu/arm/lpc22xx/irq/bsp_irq_asm.S +++ b/c/src/lib/libcpu/arm/lpc22xx/irq/bsp_irq_asm.S @@ -12,8 +12,8 @@ * $Id$ */ #define __asm__ - -/* + +/* * BSP specific interrupt handler for INT or FIQ. In here * you do determine which interrupt happened and call its * handler. @@ -30,7 +30,7 @@ bsp_interrupt_dispatch : * From source, determine offset into expanded vector table * and load handler address into r0. */ - + ldr r0, =0xFFFFF030 /* Read the vector number */ ldr r0, [r0] #ifdef __thumb__ diff --git a/c/src/lib/libcpu/arm/lpc22xx/irq/bsp_irq_init.c b/c/src/lib/libcpu/arm/lpc22xx/irq/bsp_irq_init.c index db16373eac..4c5b7850ad 100644 --- a/c/src/lib/libcpu/arm/lpc22xx/irq/bsp_irq_init.c +++ b/c/src/lib/libcpu/arm/lpc22xx/irq/bsp_irq_init.c @@ -1,6 +1,6 @@ /* * NXP/Philips LPC22XX/LPC21xx Interrupt handler - * Ray 2007 <rayx.cn@gmail.com> to support LPC ARM + * Ray 2007 <rayx.cn@gmail.com> to support LPC ARM * The license and distribution terms for this file may be * found in the file LICENSE in this distribution or at * @@ -16,8 +16,8 @@ extern void default_int_handler(void); -/* - * Interrupt system initialization. Disable interrupts, clear +/* + * Interrupt system initialization. Disable interrupts, clear * any that are pending. */ void BSP_rtems_irq_mngt_init(void) @@ -33,7 +33,7 @@ void BSP_rtems_irq_mngt_init(void) for (i=0; i<BSP_MAX_INT; i++) { *(vectorTable + i) = (long)(default_int_handler); } - + /* * Set IRQHandler */ @@ -56,10 +56,10 @@ void BSP_rtems_irq_mngt_init(void) * In case we must find an ABORT error, * enable the next lines and set a breakpoint * in ABORTHandler. - */ + */ #if 1 DATA_ABORT_VECTOR_ADDR = 0xE59FF018; -#endif +#endif /* * Init the Vectored Interrupt Controller (VIC) diff --git a/c/src/lib/libcpu/arm/lpc22xx/irq/irq.c b/c/src/lib/libcpu/arm/lpc22xx/irq/irq.c index cf2287d070..dfc97f9135 100644 --- a/c/src/lib/libcpu/arm/lpc22xx/irq/irq.c +++ b/c/src/lib/libcpu/arm/lpc22xx/irq/irq.c @@ -1,7 +1,7 @@ /* * Philps LPC22XX Interrupt handler - * - * Copyright (c) 2006 by Ray<rayx.cn@gmail.com> to support LPC ARM + * + * Copyright (c) 2006 by Ray<rayx.cn@gmail.com> to support LPC ARM * The license and distribution terms for this file may be * found in the file LICENSE in this distribution or at * @@ -37,11 +37,11 @@ int BSP_install_rtems_irq_handler (const rtems_irq_connect_data* irq) rtems_interrupt_level level; rtems_irq_hdl *bsp_tbl; int *vic_cntl; - + bsp_tbl = (rtems_irq_hdl *)VICVectAddrBase; vic_cntl=(int *)VICVectCntlBase; - + if (!isValidInterrupt(irq->name)) { return 0; } @@ -66,8 +66,8 @@ int BSP_install_rtems_irq_handler (const rtems_irq_connect_data* irq) */ vic_cntl[irq->name] = 0x20 | irq->name; - VICIntEnable |= 1 << irq->name; - + VICIntEnable |= 1 << irq->name; + if(irq->on) { irq->on(irq); @@ -75,11 +75,11 @@ int BSP_install_rtems_irq_handler (const rtems_irq_connect_data* irq) rtems_interrupt_enable(level); - + return 1; } -/* +/* * Remove and interrupt handler * * You should only have to add the code to mask the interrupt. @@ -91,7 +91,7 @@ int BSP_remove_rtems_irq_handler (const rtems_irq_connect_data* irq) rtems_irq_hdl *bsp_tbl; bsp_tbl = (rtems_irq_hdl *)&VICVectAddr0; - + if (!isValidInterrupt(irq->name)) { return 0; } @@ -116,7 +116,7 @@ int BSP_remove_rtems_irq_handler (const rtems_irq_connect_data* irq) * restore the default irq value */ bsp_tbl[irq->name] = default_int_handler; - + rtems_interrupt_enable(level); return 1; diff --git a/c/src/lib/libcpu/arm/lpc22xx/irq/irq.h b/c/src/lib/libcpu/arm/lpc22xx/irq/irq.h index 428530958a..11f8de1bba 100644 --- a/c/src/lib/libcpu/arm/lpc22xx/irq/irq.h +++ b/c/src/lib/libcpu/arm/lpc22xx/irq/irq.h @@ -1,8 +1,8 @@ /* * Interrupt handler Header file * - * Copyright (c) 2006 by Ray <rayx.cn@gmail.com> to support LPC ARM - * + * Copyright (c) 2006 by Ray <rayx.cn@gmail.com> to support LPC ARM + * * The license and distribution terms for this file may be * found in the file LICENSE in this distribution or at * @@ -25,7 +25,7 @@ extern "C" { /* * Include some preprocessor value also used by assember code */ - + #include <rtems.h> #include <lpc22xx.h> @@ -66,7 +66,7 @@ extern void default_int_handler(); #define LPC22xx_INTERRUPT_CAN4RX 27 /* CAN2 Rx interrupt */ #define BSP_MAX_INT 28 -#define UNDEFINED_INSTRUCTION_VECTOR_ADDR (*(u_long *)0x00000004L) +#define UNDEFINED_INSTRUCTION_VECTOR_ADDR (*(u_long *)0x00000004L) #define SOFTWARE_INTERRUPT_VECTOR_ADDR (*(u_long *)0x00000008L) #define PREFETCH_ABORT_VECTOR_ADDR (*(u_long *)0x0000000CL) #define DATA_ABORT_VECTOR_ADDR (*(u_long *)0x00000010L) @@ -77,7 +77,7 @@ extern void default_int_handler(); #define IRQ_ISR_ADDR (*(u_long *)0x00000038L) #define FIQ_ISR_ADDR (*(u_long *)0x0000003CL) - + typedef unsigned char rtems_irq_level; typedef unsigned char rtems_irq_trigger; @@ -91,7 +91,7 @@ typedef int (*rtems_irq_is_enabled)(const struct __rtems_irq_connect_data__*); //extern rtems_irq_hdl bsp_vector_table[BSP_MAX_INT]; #define VECTOR_TABLE VICVectAddrBase - + typedef struct __rtems_irq_connect_data__ { /* IRQ line */ rtems_irq_number name; @@ -127,7 +127,7 @@ void BSP_rtems_irq_mngt_init(); int BSP_install_rtems_irq_handler (const rtems_irq_connect_data*); /* - * function to get the current RTEMS irq handler for ptr->name. + * function to get the current RTEMS irq handler for ptr->name. */ int BSP_get_current_rtems_irq_handler (rtems_irq_connect_data* ptr); |