mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-04 23:57:25 +00:00
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.
38 lines
845 B
C++
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);
|
|
}
|