lock_init (&console_lock);
}
-/* Prints console statistics. */
-void
-console_print_stats (void)
-{
- printf ("Console: %lld characters output\n", write_cnt);
-}
-
/* Acquires the console lock. */
static void
acquire_console (void)
return intr_context () || lock_held_by_current_thread (&console_lock);
}
+/* Prints console statistics. */
+void
+console_print_stats (void)
+{
+ acquire_console ();
+ printf ("Console: %lld characters output\n", write_cnt);
+ release_console ();
+}
+
/* The standard vprintf() function,
which is like printf() but uses a va_list.
Writes its output to both vga display and serial port. */