Files
fail-targets/arch/riscv/bootcode/cheri32.c
Christian Dietrich a3fa6ea4ab towards multi-arch
2021-08-16 10:59:38 +02:00

31 lines
800 B
C

#include <cheri_init_globals.h>
#include "boot.h"
asm (
".text" "\n"
".option push" "\n"
".option nocapmode" "\n"
".global _start" "\n"
"_start:" "\n"
" lla sp, __sp" "\n"
" lla t0, __stack_size" "\n"
" cfromptr csp, ddc, sp" "\n"
" csetbounds csp, csp, t0" "\n"
" cincoffset csp, csp, t0" "\n"
" lla t0, _start_purecap" "\n"
" cfromptr ct0, ddc, t0" "\n"
" li t1, 1" "\n"
" csetflags ct0, ct0, t1" "\n"
" cjr ct0" "\n"
".option pop" "\n"
);
extern void os_main();
void _start_purecap(void) {
cheri_init_globals_3(__builtin_cheri_global_data_get(),
__builtin_cheri_program_counter_get(),
__builtin_cheri_global_data_get());
os_main();
}