1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#define ASM
#include "config.h"
#include "cpu.h"

    .global start
    .global _newstart
#ifdef BOOTLOADER
    .section .blreloc,"ax","%progbits"
start:
    msr     cpsr_c, #0xd3 /* enter supervisor mode, disable IRQ/FIQ */
    ldr     r2, =_relocstart
    ldr     r3, =_relocend
    ldr     r4, =_reloccopy
1:
    cmp     r3, r2
    ldrhi   r1, [r4], #4
    strhi   r1, [r2], #4
    bhi     1b
    .ltorg
#endif
    .section .intvect,"ax",%progbits
    /* Exception vectors */
#ifndef BOOTLOADER
start:
#endif
    b _newstart
    ldr pc, =undef_instr_handler
    ldr pc, =software_int_handler
    ldr pc, =prefetch_abort_handler
    ldr pc, =data_abort_handler
    ldr pc, =reserved_handler
    ldr pc, =irq_handler
    ldr pc, =fiq_handler
    .ltorg

_newstart:
    ldr pc, =newstart2

    .section .init.text,"ax",%progbits
newstart2: