From 0e84a0ec6e7893dad13dff9a958c5bc987b79c82 Mon Sep 17 00:00:00 2001 From: rtm Date: Tue, 8 Aug 2006 19:58:06 +0000 Subject: fix race in holding() check in acquire() give cpu1 a TSS and gdt for when it enters scheduler() and a pseudo proc[] entry for each cpu cpu0 waits for each other cpu to start up read() for files --- mp.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'mp.c') diff --git a/mp.c b/mp.c index ece46a4..341b545 100644 --- a/mp.c +++ b/mp.c @@ -219,9 +219,11 @@ mp_startthem(void) for(c = 0; c < ncpu; c++){ if (c == cpu()) continue; - cprintf ("starting processor %d\n", c); + cprintf ("cpu%d: starting processor %d\n", cpu(), c); *(uint *)(APBOOTCODE-4) = (uint) (cpus[c].mpstack) + MPSTACK; // tell it what to use for %esp *(uint *)(APBOOTCODE-8) = (uint)mpmain; // tell it where to jump to lapic_startap(cpus[c].apicid, (uint) APBOOTCODE); + while(cpus[c].booted == 0) + ; } } -- cgit v1.2.3