From bf20ce47a9d5dcad841e4549a68f4ec3db3c57de Mon Sep 17 00:00:00 2001 From: Aleksa Vuckovic Date: Wed, 1 Feb 2023 04:00:48 +0100 Subject: AP -> long mode; testing mutex --- kernel/src/scheduler/ap_startup.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) (limited to 'kernel/src/scheduler/ap_startup.c') diff --git a/kernel/src/scheduler/ap_startup.c b/kernel/src/scheduler/ap_startup.c index 43b1a51..3bb4ab2 100644 --- a/kernel/src/scheduler/ap_startup.c +++ b/kernel/src/scheduler/ap_startup.c @@ -1,5 +1,11 @@ -// this C code can be anywhere you want it, no relocation needed -void ap_startup(int apicid) { - // do what you want to do on the AP - while(1); +#include + +void ap_startup(void) { + lock(cnt_lock); + cnt++; + unlock(cnt_lock); + + for(;;) { + __asm__ volatile ("hlt;"); + } } -- cgit v1.2.3