diff options
Diffstat (limited to 'c/src/lib/libcpu/arm/at91rm9200/irq/bsp_irq_asm.S')
-rw-r--r-- | c/src/lib/libcpu/arm/at91rm9200/irq/bsp_irq_asm.S | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/c/src/lib/libcpu/arm/at91rm9200/irq/bsp_irq_asm.S b/c/src/lib/libcpu/arm/at91rm9200/irq/bsp_irq_asm.S new file mode 100644 index 0000000000..36a34b1ede --- /dev/null +++ b/c/src/lib/libcpu/arm/at91rm9200/irq/bsp_irq_asm.S @@ -0,0 +1,38 @@ +/* + * Atmel AT91RM9200 Interrupt handler + * + * Copyright (c) 2004 by Jay Monkman <jtm@lopgindog.com> + * + * The license and distribution terms for this file may be + * found in the file LICENSE in this distribution or at + * + * http://www.OARcorp.com/rtems/license.html. + * + * + * $Id$ + */ +#define __asm__ + + .globl ExecuteITHandler +ExecuteITHandler : +/* + * Look at interrupt status register to determine source. + * From source, determine offset into expanded vector table + * and load handler address into r0. + */ + ldr r0, =0xFFFFF100 /* AIC_CTL_BASE + AIC_IVR */ + ldr r1, [r0] + str r1, [r0] /* write back in case we are using protect */ + + stmdb sp!,{lr} + ldr lr, =IRQ_return /* prepare the return from handler */ + + mov pc, r1 /* execute handler */ + +IRQ_return: + ldr r2, =0xFFFFF130 /* AIC_CTL_BASE + AIC_EIOCR */ + str r1, [r2] + + ldmia sp!,{lr} + + mov pc, lr |