]> Git Repo - J-u-boot.git/blame - examples/api/crt0.S
net/phy: Fix phy_connect() for phy addr 0
[J-u-boot.git] / examples / api / crt0.S
CommitLineData
83d290c5 1/* SPDX-License-Identifier: GPL-2.0+ */
500856eb
RJ
2/*
3 * (C) Copyright 2007 Semihalf
4 *
5 * Written by: Rafal Jaworowski <[email protected]>
500856eb
RJ
6 */
7
8#if defined(CONFIG_PPC)
9
10 .text
500856eb
RJ
11 .globl _start
12_start:
b84d7d8f
RJ
13 lis %r11, search_hint@ha
14 addi %r11, %r11, search_hint@l
15 stw %r1, 0(%r11)
500856eb
RJ
16 b main
17
18
19 .globl syscall
20syscall:
21 lis %r11, syscall_ptr@ha
22 addi %r11, %r11, syscall_ptr@l
23 lwz %r11, 0(%r11)
24 mtctr %r11
25 bctr
7fb6c4f9
RJ
26
27#elif defined(CONFIG_ARM)
28
29 .text
30 .globl _start
31_start:
32 ldr ip, =search_hint
33 str sp, [ip]
34 b main
35
36
37 .globl syscall
38syscall:
39 ldr ip, =syscall_ptr
40 ldr pc, [ip]
41
7c604231 42#elif defined(CONFIG_MIPS)
78757d52 43#include <asm/asm.h>
7c604231
SG
44 .text
45 .globl __start
46 .ent __start
47__start:
78757d52 48 PTR_S $sp, search_hint
7c604231
SG
49 b main
50 .end __start
51
52 .globl syscall
53 .ent syscall
54syscall:
78757d52
SG
55 PTR_S $ra, return_addr
56 PTR_L $t9, syscall_ptr
7c604231
SG
57 jalr $t9
58 nop
78757d52 59 PTR_L $ra, return_addr
7c604231
SG
60 jr $ra
61 nop
62 .end syscall
63
64return_addr:
78757d52 65 .align 8
7c604231 66 .long 0
b84d7d8f
RJ
67#else
68#error No support for this arch!
69#endif
500856eb
RJ
70
71 .globl syscall_ptr
72syscall_ptr:
78757d52 73 .align 8
500856eb 74 .long 0
b84d7d8f
RJ
75
76 .globl search_hint
77search_hint:
78 .long 0
This page took 0.56358 seconds and 4 git commands to generate.