From: Ben Pfaff Date: Fri, 27 Aug 2004 07:17:37 +0000 (+0000) Subject: printk() disables interrupts. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4ba2bcacdde59e70754df916dcee39e45d564441;p=pintos-anon printk() disables interrupts. --- diff --git a/src/lib/lib.c b/src/lib/lib.c index 7112ba2..be4397e 100644 --- a/src/lib/lib.c +++ b/src/lib/lib.c @@ -3,6 +3,7 @@ #include #include #include "debug.h" +#include "interrupt.h" #include "lib.h" #include "serial.h" #include "vga.h" @@ -128,7 +129,9 @@ output_console (char ch, void *aux __attribute__ ((unused))) void vprintk (const char *format, va_list args) { + enum if_level old_level = intr_disable (); vprintf_core (format, args, output_console, NULL); + intr_set_level (old_level); } void