diff --git a/sys/amd64/debug.c b/sys/amd64/debug.c index f98b795..47f347a 100644 --- a/sys/amd64/debug.c +++ b/sys/amd64/debug.c @@ -53,6 +53,8 @@ Debug_HaltIPI() MP_SetState(CPUSTATE_HALTED); __sync_fetch_and_add(&debugHalted, 1); + enable_interrupts(); + while (debugCmd == 0) { pause(); } diff --git a/sys/amd64/mp.c b/sys/amd64/mp.c index ebd0197..a60cdae 100644 --- a/sys/amd64/mp.c +++ b/sys/amd64/mp.c @@ -167,12 +167,13 @@ MP_CrossCallTrap() int MP_CrossCall(CrossCallCB cb, void *arg) { - CrossCallFrame frame; + volatile CrossCallFrame frame; // Setup frame memset(&frame, 0, sizeof(frame)); frame.cb = cb; frame.arg = arg; + frame.count = 1; Critical_Enter(); @@ -187,7 +188,7 @@ MP_CrossCall(CrossCallCB cb, void *arg) frame.done[CPU()] = 1; // Wait for all to respond - while (frame.count != lastCPU) { + while (frame.count < lastCPU) { // Check for timeout // XXX: Should dump the crosscall frame