Update crt0 inline assembly to invoke syscall 5 for memop, and
shift registers for RISCV.
@@ -124,21 +124,21 @@ void _start(void* app_start __attribute__((unused)),
// memop(0, app_brk);
"movs r0, #0\n"
"movs r1, r5\n"
- "svc 4\n" // memop
+ "svc 5\n" // memop
//
// Debug support, tell the kernel the stack location
//
// memop(10, stacktop);
"movs r0, #10\n"
"movs r1, r4\n"
- "svc 4\n" // memop
+ "svc 5\n" // memop
//
// Debug support, tell the kernel the heap location
//
// memop(11, app_brk);
"movs r0, #11\n"
"movs r1, r5\n"
- "svc 4\n" // memop
+ "svc 5\n" // memop
//
// Setup initial stack pointer for normal execution. If we did this before
// then this is redundant and just a no-op. If not then no harm in
@@ -210,25 +210,25 @@ void _start(void* app_start __attribute__((unused)),
// Call `brk` to set to requested memory
// memop(0, stacktop + appdata_size);
- "li a0, 4\n" // a0 = 4 // memop syscall
- "li a1, 0\n" // a1 = 0
- "mv a2, t1\n" // a2 = app_brk
+ "li a4, 5\n" // a0 = 4 // memop syscall
+ "li a0, 0\n" // a1 = 0
+ "mv a1, t1\n" // a2 = app_brk
"ecall\n" // memop
//
// Debug support, tell the kernel the stack location
//
// memop(10, stacktop);
- "li a0, 4\n" // a0 = 4 // memop syscall
- "li a1, 10\n" // a1 = 10
- "mv a2, s1\n" // a2 = stacktop
+ "li a4, 5\n" // a0 = 4 // memop syscall
+ "li a0, 10\n" // a1 = 10
+ "mv a1, s1\n" // a2 = stacktop
"ecall\n" // memop
//
// Debug support, tell the kernel the heap location
//
// memop(11, app_brk);
- "li a0, 4\n" // a0 = 4 // memop syscall
- "li a1, 11\n" // a1 = 11
- "mv a2, t1\n" // a2 = app_brk
+ "li a4, 4\n" // a0 = 4 // memop syscall
+ "li a0, 11\n" // a1 = 11
+ "mv a1, t1\n" // a2 = app_brk
"ecall\n" // memop
//
// Setup initial stack pointer for normal execution
