1 /***************************************************************************
3 * Open \______ \ ____ ____ | | _\_ |__ _______ ___
4 * Source | _// _ \_/ ___\| |/ /| __ \ / _ \ \/ /
5 * Jukebox | | ( <_> ) \___| < | \_\ ( <_> > < <
6 * Firmware |____|_ /\____/ \___ >__|_ \|___ /\____/__/\_ \
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 ****************************************************************************/
24 .section .init.text,"ax",@progbits
31 /* If we have built our code to be loaded via the standalone GDB
32 * stub, we will have out VBR at some other location than 0x9000000.
33 * We must copy the trap vectors for the GDB stub to our vector table. */
36 /* Move the invalid instruction vector (4) */
42 /* Move the invalid slot vector (6) */
48 /* Move the bus error vector (9) */
54 /* Move the DMA bus error vector (10) */
60 /* Move the NMI vector as well (11) */
66 /* Move the UserBreak vector as well (12) */
72 /* Move the breakpoint trap vector (32) */
78 /* Move the IO trap vector (33) */
84 /* Move the serial Rx interrupt vector (105) */
90 /* Move the single step trap vector (127) */
101 /* .iram copy is done first since it is reclaimed for other
102 * uninitialized sections */
104 /* copy the .iram section */
108 /* Note: We cannot put a PC relative load into the delay slot of a 'bra'
109 instruction (the offset would be wrong), but there is nothing else to
110 do before the loop, so the delay slot would be 'nop'. The cmp / bf
111 sequence is the same length, but more efficient. */
127 .iedataloop: /* backwards is faster and shorter */
138 .edataloop: /* backwards is faster and shorter */
144 /* copy the .data section, for rombased execution */
148 bt .nodatacopy /* Don't copy if src and dest are equal */
160 /* Munge the main thread stack */
161 mov.l .stackbegin_k,r0
165 .mungeloop: /* backwards is faster and shorter */
170 /* call the mainline */
214 .section .resetvectors