better way to do irqs

This commit is contained in:
Mariano Alvira 2009-04-24 15:42:15 -04:00
parent f421cde7f8
commit 2288c9e2ff
4 changed files with 14 additions and 20 deletions

View File

@ -88,7 +88,7 @@ src/isr.o: src/isr.c
%.dis: %.obj %.dis: %.obj
$(OBJDUMP) -SD $< > $@ $(OBJDUMP) -SD $< > $@
%.obj: $(LDSCRIPT) %.o #src/interrupt-utils.o %.obj: $(LDSCRIPT) %.o src/isr.o
$(LD) $(LDFLAGS) $(AOBJS) \ $(LD) $(LDFLAGS) $(AOBJS) \
--start-group $(PLATFORM_LIBS) --end-group \ --start-group $(PLATFORM_LIBS) --end-group \
-Map $*.map $^ -o $@ -Map $*.map $^ -o $@

View File

@ -28,13 +28,13 @@ ENTRY(_start)
SECTIONS SECTIONS
{ {
. = 0x00400000; . = 0x00400000;
. = ALIGN(4); . = ALIGN(4);
.text : .text :
{ {
src/start.o (.text) src/start.o (.text)
src/isr.o (.text) *(.irq)
*(.text) *(.text)
} }
. = ALIGN(4); . = ALIGN(4);

View File

@ -4,8 +4,9 @@
#define reg32(x) (*(volatile uint32_t *)(x)) #define reg32(x) (*(volatile uint32_t *)(x))
//__attribute__ ((interrupt("IRQ"))) __attribute__ ((section (".irq")))
void isr(void) __attribute__ ((interrupt("IRQ")))
void irq(void)
{ {
// ISR_ENTRY(); // ISR_ENTRY();
/* check for TMR0 interrupt */ /* check for TMR0 interrupt */

View File

@ -212,19 +212,12 @@ not_used:
.align 5 .align 5
irq: //irq:
push {lr} // push {lr}
movs lr,pc // movs lr,pc
b isr // b isr
pop {lr} // pop {lr}
subs pc,r14,#4 // suggested irq return cmd // 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
fiq: fiq:
.align 5 .align 5