diff options
Diffstat (limited to 'firmware/test/i2c/crt0.S')
-rw-r--r-- | firmware/test/i2c/crt0.S | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/firmware/test/i2c/crt0.S b/firmware/test/i2c/crt0.S new file mode 100644 index 0000000000..5f0ef2d64e --- /dev/null +++ b/firmware/test/i2c/crt0.S | |||
@@ -0,0 +1,49 @@ | |||
1 | .section .text | ||
2 | .global start | ||
3 | start: | ||
4 | mov.l stack_k,r15 | ||
5 | |||
6 | ! zero out bss | ||
7 | mov.l edata_k,r0 | ||
8 | mov.l end_k,r1 | ||
9 | mov #0,r2 | ||
10 | start_l: | ||
11 | mov.l r2,@r0 | ||
12 | add #4,r0 | ||
13 | cmp/ge r0,r1 | ||
14 | bt start_l | ||
15 | nop | ||
16 | |||
17 | #if defined (__SH3E__) || defined(__SH4_SINGLE__) || defined(__SH4__) || defined(__SH4_SINGLE_ONLY) | ||
18 | mov.l set_fpscr_k, r1 | ||
19 | jsr @r1 | ||
20 | mov #0,r4 | ||
21 | lds r3,fpscr | ||
22 | #endif /* defined (__SH3E__) || defined(__SH4_SINGLE__) || defined(__SH4__) || defined(__SH4_SINGLE_ONLY__) */ | ||
23 | |||
24 | ! call the mainline | ||
25 | mov.l main_k,r0 | ||
26 | jsr @r0 | ||
27 | nop | ||
28 | .hoo: | ||
29 | bra .hoo | ||
30 | |||
31 | .align 2 | ||
32 | #if defined (__SH3E__) || defined(__SH4_SINGLE__) || defined(__SH4__) || defined(__SH4_SINGLE_ONLY__) | ||
33 | set_fpscr_k: | ||
34 | .long ___set_fpscr | ||
35 | #endif /* defined (__SH3E__) || defined(__SH4_SINGLE__) || defined(__SH4__) || defined(SH4_SINGLE_ONLY) */ | ||
36 | stack_k: | ||
37 | .long _stack | ||
38 | edata_k: | ||
39 | .long _edata | ||
40 | end_k: | ||
41 | .long _end | ||
42 | main_k: | ||
43 | .long _main | ||
44 | |||
45 | #ifdef __ELF__ | ||
46 | .section .stack,"aw" | ||
47 | #else | ||
48 | .section .stack | ||
49 | #endif | ||