Spinlock save cpu flags

This commit is contained in:
2026-03-12 22:48:34 +01:00
parent 19793e9126
commit 4760818118
50 changed files with 704 additions and 461 deletions

View File

@@ -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 */