mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 03:37:43 +00:00
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:
parent
c7ad4c6c32
commit
72331168be
1 changed files with 8 additions and 2 deletions
|
@ -143,20 +143,26 @@ int snprintf(char* buffer, size_t size, const char* fmt, ...)
|
||||||
return ret;
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
extern "C" void dbgputch(char ch)
|
static inline void internal_dbgputch(char ch)
|
||||||
{
|
{
|
||||||
if (serial_debug)
|
if (serial_debug)
|
||||||
serial_putch(ch);
|
serial_putch(ch);
|
||||||
IO::out8(IO::BOCHS_DEBUG_PORT, 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)
|
extern "C" void dbgputstr(const char* characters, size_t length)
|
||||||
{
|
{
|
||||||
if (!characters)
|
if (!characters)
|
||||||
return;
|
return;
|
||||||
ScopedSpinLock lock(s_log_lock);
|
ScopedSpinLock lock(s_log_lock);
|
||||||
for (size_t i = 0; i < length; ++i)
|
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)
|
extern "C" void kernelputstr(const char* characters, size_t length)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue