Kernel: Hold the global logging lock in dbgputch

This was not an active issue as sys$dbgputch (the only user of this
function) is not actually used anywhere.
This commit is contained in:
Idan Horowitz 2021-08-06 14:36:55 +03:00 committed by Andreas Kling
parent c7ad4c6c32
commit 72331168be
Notes: sideshowbarker 2024-07-18 07:23:50 +09:00

View file

@ -143,20 +143,26 @@ int snprintf(char* buffer, size_t size, const char* fmt, ...)
return ret;
}
extern "C" void dbgputch(char ch)
static inline void internal_dbgputch(char ch)
{
if (serial_debug)
serial_putch(ch);
IO::out8(IO::BOCHS_DEBUG_PORT, ch);
}
extern "C" void dbgputch(char ch)
{
ScopedSpinLock lock(s_log_lock);
internal_dbgputch(ch);
}
extern "C" void dbgputstr(const char* characters, size_t length)
{
if (!characters)
return;
ScopedSpinLock lock(s_log_lock);
for (size_t i = 0; i < length; ++i)
dbgputch(characters[i]);
internal_dbgputch(characters[i]);
}
extern "C" void kernelputstr(const char* characters, size_t length)