Kernel: Introduce a StringView overload of dbgputstr(..)

This commit is contained in:
Brian Gianforcaro 2021-08-12 21:25:05 -07:00 committed by Andreas Kling
parent 060503ef25
commit 1ee1ef5103
Notes: sideshowbarker 2024-07-18 07:02:38 +09:00
2 changed files with 9 additions and 0 deletions

View file

@ -5,6 +5,7 @@
*/
#include <AK/PrintfImplementation.h>
#include <AK/StringView.h>
#include <AK/Types.h>
#include <Kernel/ConsoleDevice.h>
#include <Kernel/Devices/PCISerialDevice.h>
@ -165,6 +166,11 @@ extern "C" void dbgputstr(const char* characters, size_t length)
internal_dbgputch(characters[i]);
}
void dbgputstr(StringView view)
{
::dbgputstr(view.characters_without_null_termination(), view.length());
}
extern "C" void kernelputstr(const char* characters, size_t length)
{
if (!characters)

View file

@ -6,6 +6,7 @@
#pragma once
#include <AK/StringView.h>
#include <AK/Types.h>
extern "C" {
@ -17,3 +18,5 @@ int snprintf(char* buf, size_t, const char* fmt, ...) __attribute__((format(prin
void set_serial_debug(bool on_or_off);
int get_serial_debug();
}
void dbgputstr(StringView view);