comparison nuc-fw/sysglue/irqfiq.S @ 132:2c5160a9d652

nuc-fw: switched from nucdemo to Riviera, got some serial output
author Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
date Sat, 02 Nov 2013 01:48:11 +0000
parents 17b0511b243c
children
comparison
equal deleted inserted replaced
131:035672b72f9b 132:2c5160a9d652
13 .section iram.text,"ax",%progbits 13 .section iram.text,"ax",%progbits
14 .code 32 14 .code 32
15 15
16 .globl _INT_IRQ 16 .globl _INT_IRQ
17 _INT_IRQ: 17 _INT_IRQ:
18 STMDB sp!,{a1-a4} @ Save a1-a4 on temporary IRQ stack 18 STMDB sp!,{r0-r4} @ used to be a1-a4
19 19
20 /* 20 /*
21 * Thanks to TI for discovering and documenting this apparent ARM7TDMI bug: 21 * Thanks to TI for discovering and documenting this apparent ARM7TDMI bug:
22 22
23 BUG correction 1st part ------------------- 23 BUG correction 1st part -------------------
44 MRS a1,spsr @ check for the IRQ bug: 44 MRS a1,spsr @ check for the IRQ bug:
45 TST a1,#0x80 @ if the I - flag is set, 45 TST a1,#0x80 @ if the I - flag is set,
46 BNE IRQBUG @ then postpone execution of this IRQ 46 BNE IRQBUG @ then postpone execution of this IRQ
47 /* Bug correction 1st part end --------------- */ 47 /* Bug correction 1st part end --------------- */
48 48
49 SUB a4,lr,#4 @ Save IRQ's lr (return address) 49 SUB r4,lr,#4 @ Save IRQ's lr (return address)
50 BL TCT_Interrupt_Context_Save @ Call context save routine 50 BL TCT_Interrupt_Context_Save @ Call context save routine
51 51
52 BL IQ_IRQ_isr @ Call int. service routine 52 BL IQ_IRQ_isr @ Call int. service routine
53 53
54 /* IRQ interrupt processing is complete. Restore context- Never 54 /* IRQ interrupt processing is complete. Restore context- Never
55 returns! */ 55 returns! */
56 B TCT_Interrupt_Context_Restore 56 B TCT_Interrupt_Context_Restore
57 57
58 /* BUG correction 2nd part ------------------ */ 58 /* BUG correction 2nd part ------------------ */
59 IRQBUG: LDMFD sp!,{a1-a4} @ return from interrupt 59 IRQBUG: LDMFD sp!,{r0-r4} @ return from interrupt
60 SUBS pc,r14,#4 60 SUBS pc,r14,#4
61 /* BUG correction 2nd part end -------------- */ 61 /* BUG correction 2nd part end -------------- */
62 62
63 .globl _INT_FIQ 63 .globl _INT_FIQ
64 _INT_FIQ: 64 _INT_FIQ:
65 STMDB sp!,{a1-a4} @ Save a1-a4 on temporary FIQ stack 65 STMDB sp!,{r0-r4} @ used to be a1-a4
66 SUB a4,lr,#4 @ Save FIQ's lr (return address) 66 SUB r4,lr,#4 @ Save FIQ's lr (return address)
67 BL TCT_Interrupt_Context_Save @ Call context save routine 67 BL TCT_Interrupt_Context_Save @ Call context save routine
68 68
69 BL IQ_FIQ_isr @ Call the FIQ ISR 69 BL IQ_FIQ_isr @ Call the FIQ ISR
70 70
71 /* FIQ interrupt processing is complete. Restore context- Never 71 /* FIQ interrupt processing is complete. Restore context- Never