mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-03-21 12:56:53 +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.
32 lines
509 B
C++
32 lines
509 B
C++
/*
|
|
* Copyright (c) 2021, James Mintram <me@jamesrm.com>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#include <Kernel/Arch/aarch64/Prekernel/Prekernel.h>
|
|
|
|
#include <Kernel/Arch/aarch64/ASM_wrapper.h>
|
|
#include <Kernel/Arch/aarch64/RPi/UART.h>
|
|
|
|
namespace Prekernel {
|
|
|
|
[[noreturn]] void panic(char const* msg)
|
|
{
|
|
auto& uart = Prekernel::UART::the();
|
|
|
|
while (*msg)
|
|
uart.send(*msg++);
|
|
|
|
Prekernel::halt();
|
|
}
|
|
|
|
[[noreturn]] void halt()
|
|
{
|
|
for (;;) {
|
|
asm volatile("wfi");
|
|
}
|
|
}
|
|
|
|
}
|