smp: thread_Start accepts NULL argument struct

This commit is contained in:
Edgaru089 2021-11-14 19:48:38 +08:00
parent f510da321e
commit 3c94af8b04

View File

@ -74,14 +74,16 @@ smp_thread_ID smp_thread_Start(void *entry, const smp_thread_Arguments *args, un
t->state.cs = GDT_EXEC_SELECTOR; t->state.cs = GDT_EXEC_SELECTOR;
t->state.ss = GDT_DATA_SELECTOR; t->state.ss = GDT_DATA_SELECTOR;
t->state.rip = (uint64_t)__smp_thread_EntryPoint; t->state.rip = (uint64_t)__smp_thread_EntryPoint;
t->state.rax = (uint64_t)entry; t->state.rax = (uint64_t)entry;
t->state.rdi = args->a;
t->state.rsi = args->b; if (args) {
t->state.rdx = args->c; t->state.rdi = args->a;
t->state.rcx = args->d; t->state.rsi = args->b;
t->state.r8 = args->e; t->state.rdx = args->c;
t->state.r9 = args->f; t->state.rcx = args->d;
t->state.r8 = args->e;
t->state.r9 = args->f;
}
tree_Node *spare = tree_FirstNode(__smp_StackPool); tree_Node *spare = tree_FirstNode(__smp_StackPool);
if (spare) { if (spare) {