From 8c6fc0c15415b32080a848bbde640e104098cf13 Mon Sep 17 00:00:00 2001 From: Carlos Maiolino Date: Thu, 10 Jul 2025 22:18:39 +0200 Subject: Initial drop Add some riscv code Signed-off-by: Carlos Maiolino --- riscv/riscv-probe/env/semihost/crt.s | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 riscv/riscv-probe/env/semihost/crt.s (limited to 'riscv/riscv-probe/env/semihost/crt.s') diff --git a/riscv/riscv-probe/env/semihost/crt.s b/riscv/riscv-probe/env/semihost/crt.s new file mode 100644 index 0000000..b75cba8 --- /dev/null +++ b/riscv/riscv-probe/env/semihost/crt.s @@ -0,0 +1,28 @@ +# See LICENSE for license details. + +.include "macros.s" +.include "constants.s" + +# +# start of trap handler +# + +.section .text.init,"ax",@progbits +.globl _start + +_start: + + # set up stack pointer based on hartid (in a0) + mv t0, a0 + slli t0, t0, STACK_SHIFT + la sp, stacks + STACK_SIZE + add sp, sp, t0 + + # jump to libfemto_start_main + j libfemto_start_main + + .bss + .align 4 + .global stacks +stacks: + .skip STACK_SIZE * MAX_HARTS -- cgit v1.2.3