1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 16:07:47 +00:00

Kernel: Allow to reboot in ACPI via PCI or MMIO access

Also, we determine if ACPI reboot is supported by checking the FADT
flags' field.
This commit is contained in:
Liav A 2020-03-08 16:50:46 +02:00 committed by Andreas Kling
parent 8639ee2640
commit 0f45a1b5e7
9 changed files with 183 additions and 25 deletions

View file

@ -34,6 +34,51 @@
namespace Kernel {
namespace ACPI {
enum class FADTFeatureFlags : u32 {
WBINVD = 1 << 0,
WBINVD_FLUSH = 1 << 1,
PROC_C1 = 1 << 2,
P_LVL2_UP = 1 << 3,
PWR_BUTTON = 1 << 4,
SLP_BUTTON = 1 << 5,
FIX_RTC = 1 << 6,
RTC_s4 = 1 << 7,
TMR_VAL_EXT = 1 << 8,
DCK_CAP = 1 << 9,
RESET_REG_SUPPORTED = 1 << 10,
SEALED_CASE = 1 << 11,
HEADLESS = 1 << 12,
CPU_SW_SLP = 1 << 13,
PCI_EXP_WAK = 1 << 14,
USE_PLATFORM_CLOCK = 1 << 15,
S4_RTC_STS_VALID = 1 << 16,
REMOTE_POWER_ON_CAPABLE = 1 << 17,
FORCE_APIC_CLUSTER_MODEL = 1 << 18,
FORCE_APIC_PHYSICAL_DESTINATION_MODE = 1 << 19,
HW_REDUCED_ACPI = 1 << 20,
LOW_POWER_S0_IDLE_CAPABLE = 1 << 21
};
namespace GenericAddressStructure {
enum class AddressSpace {
SystemMemory = 0,
SystemIO = 1,
PCIConfigurationSpace = 2,
EmbeddedController = 3,
SMBus = 4,
PCC = 0xA,
FunctionalFixedHardware = 0x7F
};
enum class AccessSize {
Undefined = 0,
Byte = 1,
Word = 2,
DWord = 3,
QWord = 4
};
}
namespace Structures {
struct [[gnu::packed]] RSDPDescriptor
{
@ -246,7 +291,6 @@ namespace ACPI {
u64 reserved;
PCI_MMIO_Descriptor descriptors[];
};
}
class StaticParser;