From 2288c9e2ff93cc7e04856a01013ce231105c9133 Mon Sep 17 00:00:00 2001 From: Mariano Alvira Date: Fri, 24 Apr 2009 15:42:15 -0400 Subject: [PATCH] better way to do irqs --- Makefile | 2 +- boot.lds | 8 ++++---- src/isr.c | 5 +++-- src/start.S | 19 ++++++------------- 4 files changed, 14 insertions(+), 20 deletions(-) diff --git a/Makefile b/Makefile index 4803b5e1b..6ddfe5c22 100644 --- a/Makefile +++ b/Makefile @@ -88,7 +88,7 @@ src/isr.o: src/isr.c %.dis: %.obj $(OBJDUMP) -SD $< > $@ -%.obj: $(LDSCRIPT) %.o #src/interrupt-utils.o +%.obj: $(LDSCRIPT) %.o src/isr.o $(LD) $(LDFLAGS) $(AOBJS) \ --start-group $(PLATFORM_LIBS) --end-group \ -Map $*.map $^ -o $@ diff --git a/boot.lds b/boot.lds index 0d4bb767b..c71b37ede 100644 --- a/boot.lds +++ b/boot.lds @@ -28,13 +28,13 @@ ENTRY(_start) SECTIONS { . = 0x00400000; - + . = ALIGN(4); .text : { - src/start.o (.text) - src/isr.o (.text) - *(.text) + src/start.o (.text) + *(.irq) + *(.text) } . = ALIGN(4); diff --git a/src/isr.c b/src/isr.c index 913374208..00d7c3207 100644 --- a/src/isr.c +++ b/src/isr.c @@ -4,8 +4,9 @@ #define reg32(x) (*(volatile uint32_t *)(x)) -//__attribute__ ((interrupt("IRQ"))) -void isr(void) +__attribute__ ((section (".irq"))) +__attribute__ ((interrupt("IRQ"))) +void irq(void) { // ISR_ENTRY(); /* check for TMR0 interrupt */ diff --git a/src/start.S b/src/start.S index bc991ad7d..ff6f06fcd 100644 --- a/src/start.S +++ b/src/start.S @@ -212,19 +212,12 @@ not_used: .align 5 -irq: - push {lr} - movs lr,pc - b isr - pop {lr} - subs pc,r14,#4 // suggested irq return cmd -// STMFD sp!, {r0-r12,lr} -// MOVNE lr,pc -// ldr r0, =isr -// BX r0 -// LDMFD r13!, {r0-r12,r14} -// MOVS PC, R14 -// subs pc, r14, #4 +//irq: +// push {lr} +// movs lr,pc +// b isr +// pop {lr} +// subs pc,r14,#4 // suggested irq return cmd fiq: .align 5