vbl
parent
7c1f380184
commit
a38b6cbdb2
@ -1,9 +1,20 @@
|
||||
#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* param1) {
|
||||
(void)tos;
|
||||
(void)context;
|
||||
(void)kickoff;
|
||||
(void)param1;
|
||||
((uint64_t*)tos)[0] = (uint64_t)panic;
|
||||
((uint64_t*)tos)[-1] = (uint64_t)kickoff;
|
||||
context.rsp = tos;
|
||||
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