mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-11-02 07:28:21 +00:00
kernel: rework init
This commit is contained in:
@@ -7,12 +7,15 @@
|
||||
#include <uacpi/event.h>
|
||||
#include <kernel/acpi.h>
|
||||
#include <kernel/interrupt.h>
|
||||
#include <kernel/init.h>
|
||||
#include <logging.h>
|
||||
|
||||
void acpi_early_init(void) {
|
||||
__assert(uacpi_initialize(0) == UACPI_STATUS_OK);
|
||||
}
|
||||
|
||||
INIT_ROUTINE_DEFINE(acpi_early, INIT_ROUTINE_FLAGS_NONE, acpi_early_init, alloc);
|
||||
|
||||
void acpi_dopoweroff(uacpi_handle ctx) {
|
||||
(void)ctx;
|
||||
acpi_signaldevice('p');
|
||||
@@ -37,6 +40,8 @@ void acpi_init(void) {
|
||||
uacpi_install_fixed_event_handler(UACPI_FIXED_EVENT_POWER_BUTTON, handle_pwrbtn, UACPI_NULL);
|
||||
}
|
||||
|
||||
INIT_ROUTINE_DEFINE(acpi, INIT_ROUTINE_FLAGS_NONE, acpi_init, pci, devfs, scheduler);
|
||||
|
||||
int acpi_poweroff(void) {
|
||||
uacpi_status ret = uacpi_prepare_for_sleep_state(UACPI_SLEEP_STATE_S5);
|
||||
if (uacpi_unlikely_error(ret)) {
|
||||
|
||||
Reference in New Issue
Block a user