summaryrefslogtreecommitdiff
path: root/Kernel/ACPI
diff options
context:
space:
mode:
authorLiav A <liavalb@gmail.com>2020-12-17 21:37:37 +0200
committerAndreas Kling <kling@serenityos.org>2020-12-18 10:02:14 +0100
commit5a146187cf51f03eae6f5556d4ec5fe5a59e1341 (patch)
treee3df75b00844b0b9fef635d55b9ad8089381d589 /Kernel/ACPI
parent176fe1795d4690db6bab87e167dd166aab15be84 (diff)
downloadserenity-5a146187cf51f03eae6f5556d4ec5fe5a59e1341.zip
Kernel: Workaround QEMU bug and initialize i8042 controller
ACPI 2 declared the third revision of FADT, that should have IAPC_BOOT_ARCH flags in it, also to indicate if i8042 is present. Q35 machine reports that it has FADT with revision 3, but the code in QEMU simply ignores these flags and put zero on them no matter the revision of FADT.
Diffstat (limited to 'Kernel/ACPI')
-rw-r--r--Kernel/ACPI/Parser.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/Kernel/ACPI/Parser.cpp b/Kernel/ACPI/Parser.cpp
index d4fee6a896..18d4e52266 100644
--- a/Kernel/ACPI/Parser.cpp
+++ b/Kernel/ACPI/Parser.cpp
@@ -104,7 +104,11 @@ void Parser::init_fadt()
klog() << "ACPI: Fixed ACPI data, Revision " << sdt->h.revision << ", Length " << sdt->h.length << " bytes";
klog() << "ACPI: DSDT " << PhysicalAddress(sdt->dsdt_ptr);
m_x86_specific_flags.cmos_rtc_not_present = (sdt->ia_pc_boot_arch_flags & (u8)FADTFlags::IA_PC_Flags::CMOS_RTC_Not_Present);
- m_x86_specific_flags.keyboard_8042 = (sdt->h.revision <= 1) || (sdt->ia_pc_boot_arch_flags & (u8)FADTFlags::IA_PC_Flags::PS2_8042);
+
+ // FIXME: QEMU doesn't report that we have an i8042 controller in these flags, even if it should (when FADT revision is 3),
+ // Later on, we need to make sure that we enumerate the ACPI namespace (AML encoded), instead of just using this value.
+ m_x86_specific_flags.keyboard_8042 = (sdt->h.revision <= 3) || (sdt->ia_pc_boot_arch_flags & (u8)FADTFlags::IA_PC_Flags::PS2_8042);
+
m_x86_specific_flags.legacy_devices = (sdt->ia_pc_boot_arch_flags & (u8)FADTFlags::IA_PC_Flags::Legacy_Devices);
m_x86_specific_flags.msi_not_supported = (sdt->ia_pc_boot_arch_flags & (u8)FADTFlags::IA_PC_Flags::MSI_Not_Supported);
m_x86_specific_flags.vga_not_present = (sdt->ia_pc_boot_arch_flags & (u8)FADTFlags::IA_PC_Flags::VGA_Not_Present);