]> git.ipfire.org Git - people/ms/u-boot.git/blame - examples/api/crt0.S
usbtty: fix typos
[people/ms/u-boot.git] / examples / api / crt0.S
CommitLineData
500856eb
RJ
1/*
2 * (C) Copyright 2007 Semihalf
3 *
4 * Written by: Rafal Jaworowski <raj@semihalf.com>
5 *
1a459660 6 * SPDX-License-Identifier: GPL-2.0+
500856eb
RJ
7 */
8
9#if defined(CONFIG_PPC)
10
11 .text
500856eb
RJ
12 .globl _start
13_start:
b84d7d8f
RJ
14 lis %r11, search_hint@ha
15 addi %r11, %r11, search_hint@l
16 stw %r1, 0(%r11)
500856eb
RJ
17 b main
18
19
20 .globl syscall
21syscall:
22 lis %r11, syscall_ptr@ha
23 addi %r11, %r11, syscall_ptr@l
24 lwz %r11, 0(%r11)
25 mtctr %r11
26 bctr
7fb6c4f9
RJ
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
39syscall:
40 ldr ip, =syscall_ptr
41 ldr pc, [ip]
42
7c604231 43#elif defined(CONFIG_MIPS)
78757d52 44#include <asm/asm.h>
7c604231
SG
45 .text
46 .globl __start
47 .ent __start
48__start:
78757d52 49 PTR_S $sp, search_hint
7c604231
SG
50 b main
51 .end __start
52
53 .globl syscall
54 .ent syscall
55syscall:
78757d52
SG
56 PTR_S $ra, return_addr
57 PTR_L $t9, syscall_ptr
7c604231
SG
58 jalr $t9
59 nop
78757d52 60 PTR_L $ra, return_addr
7c604231
SG
61 jr $ra
62 nop
63 .end syscall
64
65return_addr:
78757d52 66 .align 8
7c604231 67 .long 0
b84d7d8f
RJ
68#else
69#error No support for this arch!
70#endif
500856eb
RJ
71
72 .globl syscall_ptr
73syscall_ptr:
78757d52 74 .align 8
500856eb 75 .long 0
b84d7d8f
RJ
76
77 .globl search_hint
78search_hint:
79 .long 0