From 943fd378a1324ca60da72b271769fea4a86e36cb Mon Sep 17 00:00:00 2001 From: rsc Date: Mon, 1 Oct 2007 20:43:15 +0000 Subject: Incorporate new understanding of/with Intel SMP spec. Dropped cmpxchg in favor of xchg, to match lecture notes. Use xchg to release lock, for future protection and to keep gcc from acting clever. --- main.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'main.c') diff --git a/main.c b/main.c index 2108d95..6ec6d19 100644 --- a/main.c +++ b/main.c @@ -50,8 +50,9 @@ mpmain(void) if(cpu() != mp_bcpu()) lapic_init(cpu()); setupsegs(0); - cpus[cpu()].booted = 1; + xchg(&cpus[cpu()].booted, 1); + cprintf("cpu%d: scheduling\n"); scheduler(); } -- cgit v1.2.3