diff options
author | Tom <tomut@yahoo.com> | 2020-07-02 08:34:14 -0600 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-07-03 19:32:34 +0200 |
commit | a308b176cef0dd109a1a0e7b8e0e2f546dc8321e (patch) | |
tree | dd60f8cf44af6cc51ee6d42a46473b95cf5bccf9 /Kernel/kprintf.cpp | |
parent | 3cc0e86cd826766123d0f67d0991c4928c5df3e9 (diff) | |
download | serenity-a308b176cef0dd109a1a0e7b8e0e2f546dc8321e.zip |
Kernel: Allow recursion when writing to the debug log
This allows printing in the case e.g. a page fault happens
during a log statement
Diffstat (limited to 'Kernel/kprintf.cpp')
-rw-r--r-- | Kernel/kprintf.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/Kernel/kprintf.cpp b/Kernel/kprintf.cpp index ea386054f2..743232e939 100644 --- a/Kernel/kprintf.cpp +++ b/Kernel/kprintf.cpp @@ -35,7 +35,9 @@ #include <LibC/stdarg.h> static bool serial_debug; -static SpinLock s_log_lock; +// A recursive spinlock allows us to keep writing in the case where a +// page fault happens in the middle of a dbg(), klog(), etc +static RecursiveSpinLock s_log_lock; void set_serial_debug(bool on_or_off) { |