mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 01:07:36 +00:00
Kernel: Add kernelearlyputstr and use it in dbgln in very-early boot
This variant of dbgputstr does not lock the global log lock, as it is called before the current or any other processor was initialized, meaning that: A) The $gs base was not setup yet, so we cannot enter into critical sections, and as a result we cannot use SpinLocks B) No other processors may try to print at the same time anyway
This commit is contained in:
parent
18d2a74e62
commit
6348b63476
3 changed files with 20 additions and 0 deletions
|
@ -817,6 +817,14 @@ void vdbgln(StringView fmtstr, TypeErasedFormatParams& params)
|
|||
|
||||
const auto string = builder.string_view();
|
||||
|
||||
#ifdef __serenity__
|
||||
# ifdef KERNEL
|
||||
if (!Kernel::Processor::is_initialized()) {
|
||||
kernelearlyputstr(string.characters_without_null_termination(), string.length());
|
||||
return;
|
||||
}
|
||||
# endif
|
||||
#endif
|
||||
dbgputstr(string.characters_without_null_termination(), string.length());
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue