mirror of
https://github.com/SerenityOS/serenity.git
synced 2025-01-22 09:21:57 -05:00
Kernel/aarch64: Use generic kprintf.cpp
This commit is contained in:
parent
50b3eddc6f
commit
d56cedf3cd
5 changed files with 3 additions and 82 deletions
|
@ -37,9 +37,3 @@ void initialize()
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
// kprintf.cpp
|
||||
void set_serial_debug_enabled(bool)
|
||||
{
|
||||
dbgln("FIXME: Add support for changing state of serial debugging");
|
||||
}
|
||||
|
|
|
@ -1,74 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2022, Timon Kruiper <timonkruiper@gmail.com>
|
||||
*
|
||||
* SPDX-License-Identifier: BSD-2-Clause
|
||||
*/
|
||||
|
||||
#include <AK/Types.h>
|
||||
#include <Kernel/Arch/aarch64/RPi/UART.h>
|
||||
#include <Kernel/Devices/GPU/Console/BootFramebufferConsole.h>
|
||||
#include <Kernel/kstdio.h>
|
||||
|
||||
// FIXME: Merge the code in this file with Kernel/kprintf.cpp once the proper abstractions are in place.
|
||||
|
||||
namespace Kernel {
|
||||
extern Atomic<Graphics::Console*> g_boot_console;
|
||||
}
|
||||
|
||||
static void console_out(char ch)
|
||||
{
|
||||
if (auto* boot_console = g_boot_console.load()) {
|
||||
boot_console->write(ch, true);
|
||||
}
|
||||
}
|
||||
|
||||
static void critical_console_out(char ch)
|
||||
{
|
||||
if (auto* boot_console = g_boot_console.load()) {
|
||||
boot_console->write(ch, true);
|
||||
}
|
||||
}
|
||||
|
||||
void kernelputstr(char const* characters, size_t length)
|
||||
{
|
||||
if (!characters)
|
||||
return;
|
||||
|
||||
auto& uart = Kernel::RPi::UART::the();
|
||||
uart.print_str(characters, length);
|
||||
|
||||
for (size_t i = 0; i < length; ++i)
|
||||
console_out(characters[i]);
|
||||
}
|
||||
|
||||
void kernelcriticalputstr(char const* characters, size_t length)
|
||||
{
|
||||
if (!characters)
|
||||
return;
|
||||
|
||||
auto& uart = Kernel::RPi::UART::the();
|
||||
uart.print_str(characters, length);
|
||||
|
||||
for (size_t i = 0; i < length; ++i)
|
||||
critical_console_out(characters[i]);
|
||||
}
|
||||
|
||||
void kernelearlyputstr(char const* characters, size_t length)
|
||||
{
|
||||
kernelputstr(characters, length);
|
||||
}
|
||||
|
||||
void dbgputstr(char const* characters, size_t length)
|
||||
{
|
||||
kernelputstr(characters, length);
|
||||
}
|
||||
|
||||
void dbgputstr(StringView view)
|
||||
{
|
||||
dbgputstr(view.characters_without_null_termination(), view.length());
|
||||
}
|
||||
|
||||
void dbgputchar(char ch)
|
||||
{
|
||||
kernelputstr(&ch, 1);
|
||||
}
|
|
@ -493,6 +493,8 @@ elseif("${SERENITY_ARCH}" STREQUAL "aarch64")
|
|||
${RPI_SOURCES}
|
||||
${SOURCES_RUNNING_WITHOUT_MMU}
|
||||
|
||||
kprintf.cpp
|
||||
|
||||
Arch/aarch64/Firmware/ACPI/StaticParsing.cpp
|
||||
|
||||
Arch/aarch64/archctl.cpp
|
||||
|
@ -503,7 +505,6 @@ elseif("${SERENITY_ARCH}" STREQUAL "aarch64")
|
|||
Arch/aarch64/FPUState.S
|
||||
Arch/aarch64/InterruptManagement.cpp
|
||||
Arch/aarch64/Interrupts.cpp
|
||||
Arch/aarch64/kprintf.cpp
|
||||
Arch/aarch64/MainIdRegister.cpp
|
||||
Arch/aarch64/PageDirectory.cpp
|
||||
Arch/aarch64/Processor.cpp
|
||||
|
|
|
@ -382,7 +382,6 @@ source_set("arch_sources") {
|
|||
"Arch/aarch64/SmapDisabler.cpp",
|
||||
"Arch/aarch64/TrapFrame.cpp",
|
||||
"Arch/aarch64/boot.S",
|
||||
"Arch/aarch64/kprintf.cpp",
|
||||
"Arch/aarch64/vector_table.S",
|
||||
]
|
||||
}
|
||||
|
|
|
@ -723,6 +723,7 @@ def set_up_machine_devices(config: Configuration):
|
|||
config.ram_size = "1G" # The raspi3b machine only accepts 1G as a valid RAM size.
|
||||
config.vga_type = None
|
||||
config.display_device = None
|
||||
config.kernel_cmdline.append("serial_debug")
|
||||
if config.machine_type != MachineType.CI:
|
||||
# FIXME: Windows QEMU crashes when we set the same display as usual here.
|
||||
config.display_backend = None
|
||||
|
|
Loading…
Reference in a new issue