Files
ladybird/Kernel/Arch/aarch64/kprintf.cpp
Timon Kruiper 47a58c51c6 Kernel: Modify UART::print_str() to also take into account the length
Previously in the aarch64 Kernel, this would cause dbgln() to actually
print more characters of the next string in memory, because strings in
the Kernel are not zero terminated by default. Prevent this by using the
passed in length of the string.
2022-05-03 00:59:35 +02:00

38 lines
845 B
C++

/*
* Copyright (c) 2022, Timon Kruiper <timonkruiper@gmail.com>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#include <Kernel/Arch/aarch64/RPi/UART.h>
#include <Kernel/kstdio.h>
// FIXME: Merge the code in this file with Kernel/kprintf.cpp once the proper abstractions are in place.
void kernelputstr(char const* characters, size_t length)
{
if (!characters)
return;
auto& uart = Prekernel::UART::the();
uart.print_str(characters, length);
}
void kernelcriticalputstr(char const* characters, size_t length)
{
if (!characters)
return;
auto& uart = Prekernel::UART::the();
uart.print_str(characters, length);
}
void kernelearlyputstr(char const* characters, size_t length)
{
if (!characters)
return;
auto& uart = Prekernel::UART::the();
uart.print_str(characters, length);
}