This commit is contained in:
Eggert Jung
2025-06-17 01:15:19 +02:00
parent 24a0888760
commit a0e2a59f96
3 changed files with 8 additions and 4 deletions

View File

@@ -31,4 +31,5 @@ context_launch:
; with values from the non-volatile registers saved within the thread context (r15, r14, ...)
align 16
fake_systemv_abi:
mov rdi, r15
ret

View File

@@ -8,8 +8,9 @@ void panic(){
void prepareContext(void* tos, Context& context, void (*kickoff)(void*),
void* param1) {
((uint64_t*)tos)[-1] = (uint64_t)panic;
((uint64_t*)tos)[0] = (uint64_t)kickoff;
((uint64_t*)tos)[-2] = (uint64_t)panic;
((uint64_t*)tos)[-1] = (uint64_t)kickoff;
((uint64_t*)tos)[0] = (uint64_t)fake_systemv_abi;
context.rsp = tos;
context.rbx = 0;
context.rbp = 0;