From a274a78a5b3b3c38ef509c0fec1c11e23c23c4b3 Mon Sep 17 00:00:00 2001 From: Ali Mashtizadeh Date: Fri, 20 Nov 2015 12:23:20 -0800 Subject: [PATCH] Enable interrupts in debug mode so keyboard works. Fixed crosscall off by one due to previous change. --- sys/amd64/debug.c | 2 ++ sys/amd64/mp.c | 5 +++-- 2 files changed, 5 insertions(+), 2 deletions(-) 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