filename | test/lib-arm/crt0.s |
changeset | 821:4398dafeb77d |
prev | 812:8cc61d5ea1f8 |
author | nkeynes |
date | Wed Aug 20 11:25:46 2008 +0000 (15 years ago) |
permissions | -rw-r--r-- |
last change | Setup the interrupt/exception vectors properly in the arm crt0 Use fully guarded memcpy_to_aica for program transfer |
file | annotate | diff | log | raw |
1.1 --- a/test/lib-arm/crt0.s Wed Aug 13 10:32:00 2008 +00001.2 +++ b/test/lib-arm/crt0.s Wed Aug 20 11:25:46 2008 +00001.3 @@ -5,8 +5,17 @@1.4 .global ___exit1.5 .global _atexit1.6 start:1.7 + b real_entry1.8 + b exception_entry1.9 + b exception_entry /* SWI - not used so jump to general exception */1.10 + b exception_entry1.11 + b exception_entry1.12 + b exception_entry /* Not a vector, but if we ever get here... */1.13 + b irq_entry1.14 + b fiq_entry1.16 /* Start by setting up a stack */1.17 +real_entry:1.18 /* Set up the stack pointer to a fixed value */1.19 ldr r3, .LC01.20 mov sp, r31.21 @@ -18,7 +27,20 @@1.22 However, it ensures that this simple crt0 world will not1.23 immediately cause an overflow event: */1.24 sub sl, sp, #64 << 10 /* Still assumes 256bytes below sl */1.25 + b .LB01.27 +.syscall:1.28 + .word -1 /* Syscall # */1.29 + .word 0 /* Arguments */1.30 + .word 01.31 + .word 01.32 +1.33 +irq_counter:1.34 + .word 01.35 +fiq_counter:1.36 + .word 01.37 +1.38 +.LB0:1.39 /* Zero-out the BSS segment */1.40 mov a2, #0 /* Second arg: fill value */1.41 mov fp, a2 /* Null frame pointer */1.42 @@ -28,17 +50,8 @@1.43 ldr a3, .LC21.44 sub a3, a3, a1 /* Third arg: length of block */1.45 bl memset1.46 - b .LB01.47 - .word 0 /* padding */1.48 -1.49 -.syscall:1.50 - .word -1 /* Syscall # */1.51 - .word 0 /* Arguments */1.52 - .word 01.53 - .word 01.55 /* Enter main with no arguments for now */1.56 -.LB0:1.57 mov r0, #0 /* no arguments */1.58 mov r1, #0 /* no argv either */1.59 bl main1.60 @@ -47,7 +60,26 @@1.62 /* For Thumb, constants must be after the code since only1.63 positive offsets are supported for PC relative addresses. */1.64 +1.65 +exception_entry:1.66 + mov r13, #-21.67 + str r13, .syscall1.68 +.die:1.69 + b .die1.71 +irq_entry:1.72 + /* Increment IRQ counter and return */1.73 + ldr r13, irq_counter1.74 + add r13, r13, #11.75 + str r13, irq_counter1.76 + subs r15, r14, #41.77 +fiq_entry:1.78 + /* Increment FIQ counter and return */1.79 + ldr r13, fiq_counter1.80 + add r13, r13, #11.81 + str r13, fiq_counter1.82 + subs r15, r14, #41.83 +1.84 .align 01.85 .LC0:1.86 .word _stack
.