x86_64: smp: set AP idle thread ID to CPU ID

This commit is contained in:
2023-05-03 20:19:56 +01:00
parent 3a315901ba
commit 4bcd00fc3c

View File

@@ -30,6 +30,7 @@ extern "C" void ap_trampoline_exit(void)
this_cpu->c_data = self; this_cpu->c_data = self;
struct thread *this_thread = create_idle_thread(); struct thread *this_thread = create_idle_thread();
this_thread->tr_id = __this_ap_id;
this_thread->tr_kstack = (struct vm_page *)__ap_stack_page; this_thread->tr_kstack = (struct vm_page *)__ap_stack_page;
self->c_rq.rq_idle = self->c_rq.rq_cur = this_thread; self->c_rq.rq_idle = self->c_rq.rq_cur = this_thread;