Spinlock save cpu flags
This commit is contained in:
@@ -33,6 +33,8 @@ static void debug_serial_write (char x) {
|
||||
* Formatted printing to serial. serial_lock ensures that all prints are atomic.
|
||||
*/
|
||||
void debugprintf (const char* fmt, ...) {
|
||||
uint64_t f1;
|
||||
|
||||
if (!debug_is_init)
|
||||
return;
|
||||
|
||||
@@ -48,14 +50,14 @@ void debugprintf (const char* fmt, ...) {
|
||||
|
||||
const char* p = buffer;
|
||||
|
||||
spin_lock (&serial_lock);
|
||||
spin_lock (&serial_lock, &f1);
|
||||
|
||||
while (*p) {
|
||||
debug_serial_write (*p);
|
||||
p++;
|
||||
}
|
||||
|
||||
spin_unlock (&serial_lock);
|
||||
spin_unlock (&serial_lock, f1);
|
||||
}
|
||||
|
||||
/* Initialize serial */
|
||||
|
||||
Reference in New Issue
Block a user