diff options
Diffstat (limited to 'firmware/decompressor/startup.S')
-rwxr-xr-x | firmware/decompressor/startup.S | 57 |
1 files changed, 57 insertions, 0 deletions
diff --git a/firmware/decompressor/startup.S b/firmware/decompressor/startup.S new file mode 100755 index 0000000000..62efef9cc3 --- /dev/null +++ b/firmware/decompressor/startup.S | |||
@@ -0,0 +1,57 @@ | |||
1 | /*************************************************************************** | ||
2 | * __________ __ ___. | ||
3 | * Open \______ \ ____ ____ | | _\_ |__ _______ ___ | ||
4 | * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ / | ||
5 | * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < < | ||
6 | * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \ | ||
7 | * \/ \/ \/ \/ \/ | ||
8 | * $Id$ | ||
9 | * | ||
10 | * Copyright (C) 2005 by Jens Arnold | ||
11 | * based on crt0.S by Linus Nielsen Feltzing | ||
12 | * | ||
13 | * All files in this archive are subject to the GNU General Public License. | ||
14 | * See the file COPYING in the source tree root for full license agreement. | ||
15 | * | ||
16 | * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY | ||
17 | * KIND, either express or implied. | ||
18 | * | ||
19 | ****************************************************************************/ | ||
20 | .section .start,"ax",@progbits | ||
21 | .global _start | ||
22 | _start: | ||
23 | /* copy the .iram section */ | ||
24 | mov.l .iramcopy_k,r0 | ||
25 | mov.l .iram_k,r1 | ||
26 | mov.l .iramend_k,r2 | ||
27 | /* Note: We cannot put a PC relative load into the delay slot of a 'bra' | ||
28 | instruction (the offset would be wrong), but there is nothing else to | ||
29 | do before the loop, so the delay slot would be 'nop'. The cmp / bf | ||
30 | sequence is the same length, but more efficient. */ | ||
31 | cmp/hi r1,r2 | ||
32 | bf .noiramcopy | ||
33 | .iramloop: | ||
34 | mov.l @r0+,r3 | ||
35 | mov.l r3,@r1 | ||
36 | add #4,r1 | ||
37 | cmp/hi r1,r2 | ||
38 | bt .iramloop | ||
39 | .noiramcopy: | ||
40 | |||
41 | /* call the mainline */ | ||
42 | mov.l .main_k,r0 | ||
43 | mov.l .stackend_k,r15 | ||
44 | jmp @r0 | ||
45 | nop | ||
46 | |||
47 | .align 2 | ||
48 | .iramcopy_k: | ||
49 | .long _iramcopy | ||
50 | .iram_k: | ||
51 | .long _iramstart | ||
52 | .iramend_k: | ||
53 | .long _iramend | ||
54 | .stackend_k: | ||
55 | .long _stackend | ||
56 | .main_k: | ||
57 | .long _main | ||