1 /***************************************************************************
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
8 * $Id: crt0.S 11850 2006-12-29 02:49:12Z markun $
10 * Copyright (C) 2002 by Linus Nielsen Feltzing
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
17 * This software is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY
18 * KIND, either express or implied.
20 ****************************************************************************/
21 #define ASM /* do not include structure definitions from pnx0101.h */
26 .section .init.text,"ax",%progbits
31 /* Arm bootloader and startup code based on startup.s from the iPodLinux loader
33 * Copyright (c) 2003, Daniel Palffy (dpalffy (at) rainstorm.org)
34 * Copyright (c) 2005, Bernard Leach <leachbj@bouncycastle.org>
38 msr cpsr_c, #0xd3 /* enter supervisor mode, disable IRQ */
70 /* Copy exception handler code to address 0 */
71 ldr r2, =_vectorsstart
107 #endif /* !BOOTLOADER */
109 /* Initialise bss section to zero */
118 /* Set up some stack and munge it with 0xdeadbeef */
128 /* Set up stack for IRQ mode */
131 /* Set up stack for FIQ mode */
135 /* Let abort and undefined modes use IRQ stack */
140 /* Switch to supervisor mode */
144 /* main() should never return */
146 /* Exception handlers. Will be copied to address 0 after memory remapping */
147 .section .vectors,"aw"
157 /* Exception vectors */
161 .word undef_instr_handler
162 .word software_int_handler
163 .word prefetch_abort_handler
164 .word data_abort_handler
165 .word reserved_handler
171 /* All illegal exceptions call into UIE with exception address as first
172 parameter. This is calculated differently depending on which exception
173 we're in. Second parameter is exception number, used for a string lookup
181 /* We run supervisor mode most of the time, and should never see a software
182 exception being thrown. Perhaps make it illegal and call UIE?
184 software_int_handler:
188 prefetch_abort_handler:
194 @ Branch straight to FIQ handler in pcm_playback.c. This also handles the
195 @ the correct return sequence.
196 stmfd sp!, {r0-r7, r12, lr}
198 ldmfd sp!, {r0-r7, r12, lr}
208 stmfd sp!, {r0-r11, r12, lr}
210 ldmfd sp!, {r0-r11, r12, lr}
219 /* 256 words of IRQ stack */
223 /* 256 words of FIQ stack */