Andre Przywara | 8ad3a5d | 2023-02-07 15:21:04 +0000 | [diff] [blame] | 1 | /* SPDX-License-Identifier: GPL-2.0+ */ |
| 2 | /* |
| 3 | * (C) 2022 Arm Ltd. |
| 4 | */ |
| 5 | |
| 6 | #include <config.h> |
| 7 | #include <asm/macro.h> |
| 8 | #include <linux/linkage.h> |
| 9 | |
| 10 | .pushsection .text.smh_trap, "ax" |
| 11 | /* long smh_trap(unsigned int sysnum, void *addr); */ |
| 12 | ENTRY(smh_trap) |
| 13 | |
| 14 | #if defined(CONFIG_ARM64) |
| 15 | hlt #0xf000 |
| 16 | #elif defined(CONFIG_CPU_V7M) |
| 17 | bkpt #0xab |
| 18 | #elif defined(CONFIG_SYS_THUMB_BUILD) |
| 19 | svc #0xab |
| 20 | #else |
| 21 | svc #0x123456 |
| 22 | #endif |
| 23 | |
| 24 | #if defined(CONFIG_ARM64) |
| 25 | ret |
| 26 | #else |
| 27 | bx lr |
| 28 | #endif |
| 29 | |
| 30 | ENDPROC(smh_trap) |
| 31 | .popsection |