diff options
| author | Bradley Morgan <brads@mainlining.org> | 2026-10-03 18:57:38 +0000 |
|---|---|---|
| committer | Bradley Morgan <brads@mainlining.org> | 2026-10-03 18:57:38 +0000 |
| commit | 00fc82f17cff9295387d516384ecdc443acb1b22 (patch) | |
| tree | 798bef0185878286028fe0eaf7594616a66903e4 /arch/arm64/lib/semihosting.S | |
| parent | 7e8514efb64774b6a635b87ae945e519a7c38551 (diff) | |
tashaboot: arm64 bringup, semihosting payload loader
consoles on the pl011 the dtb points at, walks the memory node and
chosen, loads an arm64 kernel Image over semihosting and jumps to it
with the documented register state. string functions, printf and
libfdt are vendored from lk (lk2nd) and u-boot so the libc surface is
the one those projects already proved. built and booted on qemu virt,
payload exits clean through semihosting.
Diffstat (limited to 'arch/arm64/lib/semihosting.S')
| -rw-r--r-- | arch/arm64/lib/semihosting.S | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/arch/arm64/lib/semihosting.S b/arch/arm64/lib/semihosting.S new file mode 100644 index 0000000..6e3fc31 --- /dev/null +++ b/arch/arm64/lib/semihosting.S @@ -0,0 +1,18 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* + * semihosting.S - the trap instruction itself. qemu answers this when + * it is started with -semihosting, and nothing happens without it, so + * every caller has to cope with the no-debugger case. + * + * Copyright (C) 2026 Bradley Morgan <brads@mainlining.org> + */ + +#include <asm/linkage.h> + +.pushsection .text.smh_trap, "ax" +/* long smh_trap(unsigned int sysnum, void *addr); */ +ENTRY(smh_trap) + hlt #0xf000 + ret +ENDPROC(smh_trap) +.popsection |
