cleanup .s files

This commit is contained in:
Olaf Rempel 2008-02-03 22:36:12 +01:00
parent 1047706197
commit 2b2dba7316

View File

@ -60,12 +60,11 @@ fiqvec: ldr pc, [pc, #24] /* 0x1c FIQ */
.global InitReset
.func InitReset
InitReset:
.extern at91_init1
InitReset:
/* Call Low level init function */
ldr sp,=__stack_top__
ldr r0,=at91_init1
ldr sp, =__stack_top__
ldr r0, =at91_init1
mov lr, pc
bx r0
mov r0, sp
@ -110,8 +109,8 @@ LoopZI: cmp r1, r2
BLO LoopZI
/* Start main() */
ldr lr,=exit
ldr r0,=main
ldr lr, =exit
ldr r0, =main
bx r0
.endfunc
@ -152,7 +151,7 @@ ABT_Handler_Entry:
mov r1, sp
/* execute C Handler (cpsr, registers) */
ldr r5,=at91_abt_handler
ldr r5, =at91_abt_handler
mov lr, pc
bx r5
b .
@ -162,83 +161,81 @@ ABT_Handler_Entry:
.func FIQ_Handler_Entry
FIQ_Handler_Entry:
/* Save r0 to ARM_MODE_FIQ:r9 */
mov r9,r0
mov r9, r0
/* get FIQ Vector from AIC and thus clear FIQ */
ldr r0 , [r8, #AIC_FVR]
ldr r0, [r8, #AIC_FVR]
/* Switch to ARM_MODE_SVC and save registers there */
msr CPSR_c,#ARM_MODE_SVC | I_BIT | F_BIT
stmfd sp!, { r1-r3, r12, lr}
msr CPSR_c, #ARM_MODE_SVC | I_BIT | F_BIT
stmfd sp!, { r1-r3, r12, lr }
/* execute FIQ in SVC_MODE */
mov r14, pc
bx r0
/* restore registers and switch back to ARM_MODE_FIQ */
ldmia sp!, { r1-r3, r12, lr}
ldmia sp!, { r1-r3, r12, lr }
msr CPSR_c, #ARM_MODE_FIQ | I_BIT | F_BIT
/* restore the ARM_MODE_SVC:r0 */
mov r0,r9
mov r0, r9
/* restore PC using the LR_fiq directly */
subs pc,lr,#4
subs pc, lr, #4
.endfunc
.global IRQ_Handler_Entry
.func IRQ_Handler_Entry
IRQ_Handler_Entry:
/*- Manage Exception Entry */
/*- Adjust and save LR_irq in IRQ stack */
/* Manage Exception Entry */
/* Adjust and save LR_irq in IRQ stack */
sub lr, lr, #4
stmfd sp!, {lr}
stmfd sp!, { lr }
/*- Save SPSR need to be saved for nested interrupt */
/* Save SPSR need to be saved for nested interrupt */
mrs r14, SPSR
stmfd sp!, {r14}
stmfd sp!, { r14 }
/*- Save and r0 in IRQ stack */
stmfd sp!, {r0}
/* Save and r0 in IRQ stack */
stmfd sp!, { r0 }
/*- Write in the IVR to support Protect Mode */
/*- No effect in Normal Mode */
/*- De-assert the NIRQ and clear the source in Protect Mode */
/* Write in the IVR to support Protect Mode */
/* No effect in Normal Mode */
/* De-assert the NIRQ and clear the source in Protect Mode */
ldr r14, =AT91C_BASE_AIC
ldr r0 , [r14, #AIC_IVR]
ldr r0, [r14, #AIC_IVR]
str r14, [r14, #AIC_IVR]
/*- Enable Interrupt and Switch in Supervisor Mode */
/* Enable Interrupt and Switch in Supervisor Mode */
msr CPSR_c, #ARM_MODE_SVC
/*- Save scratch/used registers and LR in User Stack */
stmfd sp!, { r1-r3, r12, r14}
/* Save scratch/used registers and LR in User Stack */
stmfd sp!, { r1-r3, r12, r14 }
/*- Branch to the routine pointed by the AIC_IVR */
/* Branch to the routine pointed by the AIC_IVR */
mov r14, pc
bx r0
/*- Restore scratch/used registers and LR from User Stack*/
ldmia sp!, { r1-r3, r12, r14}
/*- Disable Interrupt and switch back in IRQ mode */
/* Restore scratch/used registers and LR from User Stack */
ldmia sp!, { r1-r3, r12, r14 }
/* Disable Interrupt and switch back in IRQ mode */
msr CPSR_c, #ARM_MODE_IRQ | I_BIT
/*- Mark the End of Interrupt on the AIC */
/* Mark the End of Interrupt on the AIC */
ldr r14, =AT91C_BASE_AIC
str r14, [r14, #AIC_EOICR]
/*- Restore SPSR_irq and r0 from IRQ stack */
ldmia sp!, {r0}
/* Restore SPSR_irq and r0 from IRQ stack */
ldmia sp!, { r0 }
/*- Restore SPSR_irq and r0 from IRQ stack */
ldmia sp!, {r14}
/* Restore SPSR_irq and r0 from IRQ stack */
ldmia sp!, { r14 }
msr SPSR_cxsf, r14
/*- Restore adjusted LR_irq from IRQ stack directly in the PC */
ldmia sp!, {pc}^
/* Restore adjusted LR_irq from IRQ stack directly in the PC */
ldmia sp!, { pc }^
.endfunc
.end