Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
Rafal Jaworowski | a19be78 | 2008-01-09 19:39:36 +0100 | [diff] [blame] | 2 | /* |
| 3 | * (C) Copyright 2007 Semihalf |
| 4 | * |
| 5 | * Written by: Rafal Jaworowski <raj@semihalf.com> |
Rafal Jaworowski | a19be78 | 2008-01-09 19:39:36 +0100 | [diff] [blame] | 6 | */ |
| 7 | |
| 8 | #if defined(CONFIG_PPC) |
| 9 | |
| 10 | .text |
Rafal Jaworowski | a19be78 | 2008-01-09 19:39:36 +0100 | [diff] [blame] | 11 | .globl _start |
| 12 | _start: |
Rafal Jaworowski | 3d25ba5 | 2009-01-23 13:27:15 +0100 | [diff] [blame] | 13 | lis %r11, search_hint@ha |
| 14 | addi %r11, %r11, search_hint@l |
| 15 | stw %r1, 0(%r11) |
Rafal Jaworowski | a19be78 | 2008-01-09 19:39:36 +0100 | [diff] [blame] | 16 | b main |
| 17 | |
| 18 | |
| 19 | .globl syscall |
| 20 | syscall: |
| 21 | lis %r11, syscall_ptr@ha |
| 22 | addi %r11, %r11, syscall_ptr@l |
| 23 | lwz %r11, 0(%r11) |
| 24 | mtctr %r11 |
| 25 | bctr |
Rafal Jaworowski | 9d9689f | 2009-01-23 13:27:16 +0100 | [diff] [blame] | 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 | |
Brunham, Kalen | ba4dc55 | 2024-05-17 19:13:48 +0000 | [diff] [blame] | 36 | #elif defined(CONFIG_ARM64) |
| 37 | |
| 38 | .text |
| 39 | .globl _start |
| 40 | _start: |
| 41 | ldr ip0, =search_hint |
| 42 | str sp_el2, [ip0] |
| 43 | b main |
| 44 | |
| 45 | |
| 46 | .globl syscall |
| 47 | syscall: |
| 48 | ldr ip0, =syscall_ptr |
| 49 | ldr pc_el2, [ip0] |
| 50 | |
Rafal Jaworowski | 9d9689f | 2009-01-23 13:27:16 +0100 | [diff] [blame] | 51 | |
| 52 | .globl syscall |
| 53 | syscall: |
| 54 | ldr ip, =syscall_ptr |
| 55 | ldr pc, [ip] |
| 56 | |
Stanislav Galabov | 35d35e8 | 2016-02-04 12:13:44 +0200 | [diff] [blame] | 57 | #elif defined(CONFIG_MIPS) |
Stanislav Galabov | 10c7a57 | 2016-02-17 15:23:31 +0200 | [diff] [blame] | 58 | #include <asm/asm.h> |
Stanislav Galabov | 35d35e8 | 2016-02-04 12:13:44 +0200 | [diff] [blame] | 59 | .text |
| 60 | .globl __start |
| 61 | .ent __start |
| 62 | __start: |
Stanislav Galabov | 10c7a57 | 2016-02-17 15:23:31 +0200 | [diff] [blame] | 63 | PTR_S $sp, search_hint |
Stanislav Galabov | 35d35e8 | 2016-02-04 12:13:44 +0200 | [diff] [blame] | 64 | b main |
| 65 | .end __start |
| 66 | |
| 67 | .globl syscall |
| 68 | .ent syscall |
| 69 | syscall: |
Stanislav Galabov | 10c7a57 | 2016-02-17 15:23:31 +0200 | [diff] [blame] | 70 | PTR_S $ra, return_addr |
| 71 | PTR_L $t9, syscall_ptr |
Stanislav Galabov | 35d35e8 | 2016-02-04 12:13:44 +0200 | [diff] [blame] | 72 | jalr $t9 |
| 73 | nop |
Stanislav Galabov | 10c7a57 | 2016-02-17 15:23:31 +0200 | [diff] [blame] | 74 | PTR_L $ra, return_addr |
Stanislav Galabov | 35d35e8 | 2016-02-04 12:13:44 +0200 | [diff] [blame] | 75 | jr $ra |
| 76 | nop |
| 77 | .end syscall |
| 78 | |
| 79 | return_addr: |
Stanislav Galabov | 10c7a57 | 2016-02-17 15:23:31 +0200 | [diff] [blame] | 80 | .align 8 |
Stanislav Galabov | 35d35e8 | 2016-02-04 12:13:44 +0200 | [diff] [blame] | 81 | .long 0 |
Rafal Jaworowski | 3d25ba5 | 2009-01-23 13:27:15 +0100 | [diff] [blame] | 82 | #else |
| 83 | #error No support for this arch! |
| 84 | #endif |
Rafal Jaworowski | a19be78 | 2008-01-09 19:39:36 +0100 | [diff] [blame] | 85 | |
| 86 | .globl syscall_ptr |
| 87 | syscall_ptr: |
Stanislav Galabov | 10c7a57 | 2016-02-17 15:23:31 +0200 | [diff] [blame] | 88 | .align 8 |
Rafal Jaworowski | a19be78 | 2008-01-09 19:39:36 +0100 | [diff] [blame] | 89 | .long 0 |
Rafal Jaworowski | 3d25ba5 | 2009-01-23 13:27:15 +0100 | [diff] [blame] | 90 | |
| 91 | .globl search_hint |
| 92 | search_hint: |
| 93 | .long 0 |