Draft: lab 3 irq wtf

This commit is contained in:
2025-03-24 10:48:35 +08:00
parent 6156975775
commit c5fc7e3102
19 changed files with 386 additions and 142 deletions

16
kernel/lib/exec.c Normal file
View File

@@ -0,0 +1,16 @@
#include <exec.h>
#include <utils.h>
void user_exec(void *text, void *sp)
{
// enable core timer
uint64_t cntkctl_el1 = 0x0;
R_SYSREG(cntkctl_el1, cntkctl_el1);
W_SYSREG(cntkctl_el1, cntkctl_el1 | 1);
W_SYSREG(cntp_ctl_el0, 1);
W_SYSREG(spsr_el1, 0);
W_SYSREG(elr_el1, text);
W_SYSREG(sp_el0, sp);
asm volatile("eret");
}