Draft: lab 3 irq wtf
This commit is contained in:
16
kernel/lib/exec.c
Normal file
16
kernel/lib/exec.c
Normal 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");
|
||||
}
|
||||
Reference in New Issue
Block a user