]> git.kernelconcepts.de Git - karo-tx-uboot.git/blob - examples/api/crt0.S
fw_env: calculate default number of env sectors
[karo-tx-uboot.git] / examples / api / crt0.S
1 /*
2  * (C) Copyright 2007 Semihalf
3  *
4  * Written by: Rafal Jaworowski <raj@semihalf.com>
5  *
6  * SPDX-License-Identifier:     GPL-2.0+
7  */
8
9 #if defined(CONFIG_PPC)
10
11         .text
12         .globl _start
13 _start:
14         lis     %r11, search_hint@ha
15         addi    %r11, %r11, search_hint@l
16         stw     %r1, 0(%r11)
17         b       main
18
19
20         .globl syscall
21 syscall:
22         lis     %r11, syscall_ptr@ha
23         addi    %r11, %r11, syscall_ptr@l
24         lwz     %r11, 0(%r11)
25         mtctr   %r11
26         bctr
27
28 #elif defined(CONFIG_ARM)
29
30         .text
31         .globl _start
32 _start:
33         ldr     ip, =search_hint
34         str     sp, [ip]
35         b       main
36
37
38         .globl syscall
39 syscall:
40         ldr     ip, =syscall_ptr
41         ldr     pc, [ip]
42
43 #else
44 #error No support for this arch!
45 #endif
46
47         .globl syscall_ptr
48 syscall_ptr:
49         .align  4
50         .long   0
51
52         .globl search_hint
53 search_hint:
54         .long   0