Integrate uACPI
This commit is contained in:
32
kernel/hal/x86_64/acpi.c
Normal file
32
kernel/hal/x86_64/acpi.c
Normal file
@ -0,0 +1,32 @@
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
#include "uacpi/uacpi.h"
|
||||
#include "uacpi/utilities.h"
|
||||
#include "hal/hal.h"
|
||||
#include "kprintf.h"
|
||||
#include "dlmalloc/malloc.h"
|
||||
|
||||
#define PREINIT_BUFFER_SIZE 0x1000
|
||||
|
||||
void acpi_init(void) {
|
||||
uacpi_status ret;
|
||||
|
||||
void *preinit_buffer = dlmalloc(PREINIT_BUFFER_SIZE);
|
||||
ret = uacpi_setup_early_table_access(preinit_buffer, PREINIT_BUFFER_SIZE);
|
||||
if (uacpi_unlikely_error(ret)) {
|
||||
ERR("acpi", "init err %s\n", uacpi_status_to_string(ret));
|
||||
hal_hang();
|
||||
}
|
||||
|
||||
/* if (uacpi_unlikely_error(ret)) { */
|
||||
/* ERR("acpi", "init err %s\n", uacpi_status_to_string(ret)); */
|
||||
/* hal_hang(); */
|
||||
/* } */
|
||||
|
||||
/* if (uacpi_unlikely_error(ret)) { */
|
||||
/* ERR("acpi", "init err %s\n", uacpi_status_to_string(ret)); */
|
||||
/* hal_hang(); */
|
||||
/* } */
|
||||
|
||||
LOG("hal", "acpi init\n");
|
||||
}
|
Reference in New Issue
Block a user