examples: implement _start and syscall for RISC-V
To build the API examples on RISC-V we need to implement _start and syscall for RISC-V. Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
This commit is contained in:
@@ -80,6 +80,38 @@ syscall:
|
|||||||
return_addr:
|
return_addr:
|
||||||
.align 8
|
.align 8
|
||||||
.long 0
|
.long 0
|
||||||
|
#elif defined(CONFIG_ARCH_RV32I)
|
||||||
|
|
||||||
|
.text
|
||||||
|
.globl _start
|
||||||
|
_start:
|
||||||
|
la t0, search_hint
|
||||||
|
sw sp, 0(t0)
|
||||||
|
la t0, main
|
||||||
|
jalr x0, t0
|
||||||
|
|
||||||
|
.globl syscall
|
||||||
|
syscall:
|
||||||
|
la t0, syscall_ptr
|
||||||
|
lw t0, 0(t0)
|
||||||
|
jalr x0, t0
|
||||||
|
|
||||||
|
#elif defined(CONFIG_ARCH_RV64I)
|
||||||
|
|
||||||
|
.text
|
||||||
|
.globl _start
|
||||||
|
_start:
|
||||||
|
la t0, search_hint
|
||||||
|
sd sp, 0(t0)
|
||||||
|
la t0, main
|
||||||
|
jalr x0, t0
|
||||||
|
|
||||||
|
.globl syscall
|
||||||
|
syscall:
|
||||||
|
la t0, syscall_ptr
|
||||||
|
ld t0, 0(t0)
|
||||||
|
jalr x0, t0
|
||||||
|
|
||||||
#else
|
#else
|
||||||
#error No support for this arch!
|
#error No support for this arch!
|
||||||
#endif
|
#endif
|
||||||
|
Reference in New Issue
Block a user