mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 23:50:19 +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
Notes:
sideshowbarker
2024-07-18 07:23:50 +09:00
Author: https://github.com/IdanHo Commit: https://github.com/SerenityOS/serenity/commit/72331168bea Pull-request: https://github.com/SerenityOS/serenity/pull/9236 Reviewed-by: https://github.com/tomuta ✅
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;
|
||||
}
|
||||
|
||||
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)
|
||||
|
|
Loading…
Reference in a new issue