17 lines
344 B
C
17 lines
344 B
C
#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");
|
|
}
|