vbl
parent
7c1f380184
commit
a38b6cbdb2
@ -1,9 +1,20 @@
|
|||||||
#include "context.h"
|
#include "context.h"
|
||||||
|
#include "../debug/output.h"
|
||||||
|
|
||||||
|
void panic(){
|
||||||
|
DBG << "panic!\n" << flush;
|
||||||
|
while(1);
|
||||||
|
}
|
||||||
|
|
||||||
void prepareContext(void* tos, Context& context, void (*kickoff)(void*),
|
void prepareContext(void* tos, Context& context, void (*kickoff)(void*),
|
||||||
void* param1) {
|
void* param1) {
|
||||||
(void)tos;
|
((uint64_t*)tos)[0] = (uint64_t)panic;
|
||||||
(void)context;
|
((uint64_t*)tos)[-1] = (uint64_t)kickoff;
|
||||||
(void)kickoff;
|
context.rsp = tos;
|
||||||
(void)param1;
|
context.rbx = 0;
|
||||||
|
context.rbp = 0;
|
||||||
|
context.r12 = 0;
|
||||||
|
context.r13 = 0;
|
||||||
|
context.r14 = 0;
|
||||||
|
context.r15 = (uint64_t)param1;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue