From 5affc73ee66f78c4c60f6a259ac22932f7ba030f Mon Sep 17 00:00:00 2001 From: Bananymous Date: Fri, 12 Apr 2024 16:47:17 +0300 Subject: [PATCH] Kernel: Parse ACPI namespace only after TTY is initialized This allows better debugging when there is no serial port available. --- kernel/kernel/ACPI/ACPI.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/kernel/kernel/ACPI/ACPI.cpp b/kernel/kernel/ACPI/ACPI.cpp index ab8e9303c4..2ba5088561 100644 --- a/kernel/kernel/ACPI/ACPI.cpp +++ b/kernel/kernel/ACPI/ACPI.cpp @@ -132,8 +132,6 @@ acpi_release_global_lock: } } - s_instance->m_namespace = AML::initialize_namespace(); - return {}; } @@ -424,11 +422,10 @@ acpi_release_global_lock: BAN::ErrorOr ACPI::enter_acpi_mode(uint8_t mode) { + ASSERT(!m_namespace); + m_namespace = AML::initialize_namespace(); if (!m_namespace) - { - dwarnln("ACPI namespace not initialized"); return BAN::Error::from_errno(EFAULT); - } // https://uefi.org/htmlspecs/ACPI_Spec_6_4_html/16_Waking_and_Sleeping/initialization.html#placing-the-system-in-acpi-mode auto* fadt = static_cast(get_header("FACP", 0));