From 1ee1ef51033229282dfbf40bdbfaa6bbf72948f6 Mon Sep 17 00:00:00 2001 From: Brian Gianforcaro Date: Thu, 12 Aug 2021 21:25:05 -0700 Subject: [PATCH] Kernel: Introduce a StringView overload of dbgputstr(..) --- Kernel/kprintf.cpp | 6 ++++++ Kernel/kstdio.h | 3 +++ 2 files changed, 9 insertions(+) diff --git a/Kernel/kprintf.cpp b/Kernel/kprintf.cpp index 53fceb176a..47ef933650 100644 --- a/Kernel/kprintf.cpp +++ b/Kernel/kprintf.cpp @@ -5,6 +5,7 @@ */ #include +#include #include #include #include @@ -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) diff --git a/Kernel/kstdio.h b/Kernel/kstdio.h index ffeab28074..eb882fb8f4 100644 --- a/Kernel/kstdio.h +++ b/Kernel/kstdio.h @@ -6,6 +6,7 @@ #pragma once +#include #include 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);