1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 14:37:45 +00:00

Kernel: Simplify reboot & poweroff code flow a bit

Instead of using ifdefs to use the correct platform-specific methods, we
can just use the same pattern we use for the microseconds_delay function
which has specific implementations for each Arch CPU subdirectory.

When linking a kernel image, the actual correct and platform-specific
power-state changing methods will be called in Firmware/PowerState.cpp
file.
This commit is contained in:
Liav A 2023-06-09 22:13:04 +03:00 committed by Jelle Raaijmakers
parent 5c8405c455
commit 9b8b8c0e04
8 changed files with 138 additions and 53 deletions

View file

@ -209,6 +209,7 @@ set(KERNEL_SOURCES
Firmware/ACPI/Initialize.cpp
Firmware/ACPI/Parser.cpp
Firmware/ACPI/StaticParsing.cpp
Firmware/PowerState.cpp
Interrupts/GenericInterruptHandler.cpp
Interrupts/IRQHandler.cpp
Interrupts/PCIIRQHandler.cpp
@ -402,6 +403,7 @@ if ("${SERENITY_ARCH}" STREQUAL "x86_64")
Arch/x86_64/VGA/IOArbiter.cpp
Arch/x86_64/PowerState.cpp
Arch/x86_64/RTC.cpp
Arch/x86_64/Shutdown.cpp
Arch/x86_64/SmapDisabler.cpp
@ -477,6 +479,7 @@ elseif("${SERENITY_ARCH}" STREQUAL "aarch64")
Arch/aarch64/PageDirectory.cpp
Arch/aarch64/Panic.cpp
Arch/aarch64/Processor.cpp
Arch/aarch64/PowerState.cpp
Arch/aarch64/SafeMem.cpp
Arch/aarch64/SmapDisabler.cpp
Arch/aarch64/TrapFrame.cpp