]> git.ozlabs.org Git - yaboot.git/blob - second/crt0.S
Commit yaboot 1.3.4-pre1
[yaboot.git] / second / crt0.S
1 #include "asm/ppc_asm.tmpl"
2 #include "asm/processor.h"
3
4 /*
5  * Main entry point. should add code to clear BSS and more ...
6  */
7 _GLOBAL(_start)
8         lis     r10,edata@h
9         ori     r10,r10,edata@l
10         lis     r11,end@h
11         ori     r11,r11,end@l
12         subi    r10,r10,4
13         subi    r11,r11,4
14         li      r0, 0
15 1:      stwu    r0,4(r10)
16         cmp     0,r10,r11
17         bne     1b
18         b       yaboot_start
19
20 /*
21  * Returns (address we're running at) - (address we were linked at)
22  * for use before the text and data are mapped to KERNELBASE.
23  */
24 _GLOBAL(reloc_offset)
25         mflr    r0
26         bl      1f
27 1:      mflr    r3
28         lis     r4,1b@ha
29         addi    r4,r4,1b@l
30         subf    r3,r4,r3
31         mtlr    r0
32         blr