diff options
author | Freya Murphy <freya@freyacat.org> | 2024-02-04 14:19:54 -0500 |
---|---|---|
committer | Freya Murphy <freya@freyacat.org> | 2024-02-04 14:19:54 -0500 |
commit | 1b09896afcf562d199d4df8d671601bba2b1f081 (patch) | |
tree | b4ee4ae8e6e1ff5c5b27fe97509752b17fae330b /src/arch/x86_common/acpi.c | |
parent | fix acpi on uefi, kprint fixes (diff) | |
download | corn-1b09896afcf562d199d4df8d671601bba2b1f081.tar.gz corn-1b09896afcf562d199d4df8d671601bba2b1f081.tar.bz2 corn-1b09896afcf562d199d4df8d671601bba2b1f081.zip |
Diffstat (limited to '')
-rw-r--r-- | src/arch/x86_common/acpi.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/arch/x86_common/acpi.c b/src/arch/x86_common/acpi.c new file mode 100644 index 0000000..2392185 --- /dev/null +++ b/src/arch/x86_common/acpi.c @@ -0,0 +1,13 @@ +#include <bindings.h> + +#define ACPI_INTERNAL +#include <sys/acpi.h> + +void acpi_sys_enable(struct acpi_state *state) { + outb(state->fadt->smi_command_port, state->fadt->acpi_enable); +} + +int acpi_sys_shutdown(struct acpi_state *state) { + outw((unsigned int) state->fadt->pm1_a_control_block, state->SLP_TYPb | state->SLP_EN); + return -1; +} |