//
// We want to allow debug output as early as possible and from anywhere,
// including the spinlock code. This requires a custom lock to make sure
-// output is complete and consistent. Our custom lock cannot possibly be
-// acquired from an interrupt context so it doesn't disable interrupts.
+// output is complete and consistent.
#include "types.h"
#include "defs.h"
static void
lock(void)
{
+ pushcli();
while(xchg(&locked, 1) != 0)
;
}
unlock(void)
{
xchg(&locked, 0);
+ popcli();
}
static int