Add a stack canary, setup on boot

This commit is contained in:
Toby Jaffey 2025-12-10 01:00:36 +00:00
parent 9596838a4b
commit 9baedb42e8
21 changed files with 61 additions and 16 deletions

View file

@ -1,5 +1,6 @@
// System provided UVM32_SYSCALLs, start at 0x10000000
#define UVM32_SYSCALL_HALT 0x1000000
#define UVM32_SYSCALL_YIELD 0x1000001
#define UVM32_SYSCALL_HALT 0x1000000
#define UVM32_SYSCALL_YIELD 0x1000001
#define UVM32_SYSCALL_STACKPROTECT 0x1000002
#include "uvm32_common_custom.h"

View file

@ -59,5 +59,11 @@ static uint32_t syscall(uint32_t id, uint32_t param1, uint32_t param2) {
#define yield() syscall_cast(UVM32_SYSCALL_YIELD, 0, 0)
#define printbuf(x, y) syscall_cast(UVM32_SYSCALL_PRINTBUF, x, y)
extern char _estack;
static void stackprotect(void) {
syscall_cast(UVM32_SYSCALL_STACKPROTECT, &_estack, 0);
}
#include "uvm32_common_custom.h"