mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-11-01 23:18:21 +00:00
acpi: bump to latest uACPI master
This commit is contained in:
@@ -2,11 +2,14 @@
|
|||||||
#include <kernel/pmm.h>
|
#include <kernel/pmm.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
|
#include <uacpi/kernel_api.h>
|
||||||
|
|
||||||
static volatile struct limine_rsdp_request rsdpreq = {
|
static volatile struct limine_rsdp_request rsdpreq = {
|
||||||
.id = LIMINE_RSDP_REQUEST,
|
.id = LIMINE_RSDP_REQUEST,
|
||||||
.revision = 0
|
.revision = 0
|
||||||
};
|
};
|
||||||
|
|
||||||
uintptr_t arch_get_rsdp(void) {
|
uacpi_status uacpi_kernel_get_rsdp(uacpi_phys_addr *outrsdp) {
|
||||||
return (uintptr_t)FROM_HHDM(rsdpreq.response->address);
|
*outrsdp = (uintptr_t)FROM_HHDM(rsdpreq.response->address);
|
||||||
|
return UACPI_STATUS_OK;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -138,5 +138,6 @@ time_t arch_hpet_init() {
|
|||||||
|
|
||||||
write64(HPET_REG_CONFIG, 1 + ((type == TYPE_LEGACY) ? 2 : 0));
|
write64(HPET_REG_CONFIG, 1 + ((type == TYPE_LEGACY) ? 2 : 0));
|
||||||
|
|
||||||
|
uacpi_table_unref(&tbl);
|
||||||
return ticksperus;
|
return ticksperus;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +0,0 @@
|
|||||||
#ifndef _ARCH_ACPI_H
|
|
||||||
#define _ARCH_ACPI_H
|
|
||||||
|
|
||||||
#include <stdint.h>
|
|
||||||
|
|
||||||
uintptr_t arch_get_rsdp(void);
|
|
||||||
|
|
||||||
#endif
|
|
||||||
@@ -102,6 +102,7 @@ static void pci_archinit() {
|
|||||||
__assert(virt);
|
__assert(virt);
|
||||||
mcfgentries[i].address = (uintptr_t)virt + pageoffset;
|
mcfgentries[i].address = (uintptr_t)virt + pageoffset;
|
||||||
}
|
}
|
||||||
|
uacpi_table_unref(&tbl);
|
||||||
} else {
|
} else {
|
||||||
printf("pci: MCFG table not found. Falling back to legacy access mechanism\n");
|
printf("pci: MCFG table not found. Falling back to legacy access mechanism\n");
|
||||||
pci_archread32 = legacy_read32;
|
pci_archread32 = legacy_read32;
|
||||||
|
|||||||
@@ -7,17 +7,10 @@
|
|||||||
#include <uacpi/event.h>
|
#include <uacpi/event.h>
|
||||||
#include <kernel/acpi.h>
|
#include <kernel/acpi.h>
|
||||||
#include <kernel/interrupt.h>
|
#include <kernel/interrupt.h>
|
||||||
#include <arch/acpi.h>
|
|
||||||
#include <logging.h>
|
#include <logging.h>
|
||||||
|
|
||||||
void acpi_early_init(void) {
|
void acpi_early_init(void) {
|
||||||
struct uacpi_init_params params = {
|
__assert(uacpi_initialize(0) == UACPI_STATUS_OK);
|
||||||
.rsdp = arch_get_rsdp(),
|
|
||||||
.log_level = UACPI_LOG_INFO,
|
|
||||||
};
|
|
||||||
|
|
||||||
uacpi_status ret = uacpi_initialize(¶ms);
|
|
||||||
__assert(ret == UACPI_STATUS_OK);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void acpi_dopoweroff(uacpi_handle ctx) {
|
void acpi_dopoweroff(uacpi_handle ctx) {
|
||||||
|
|||||||
@@ -518,10 +518,10 @@ void uacpi_kernel_free_spinlock(uacpi_handle lock) {
|
|||||||
uacpi_kernel_free(lock);
|
uacpi_kernel_free(lock);
|
||||||
}
|
}
|
||||||
|
|
||||||
uacpi_cpu_flags uacpi_kernel_spinlock_lock(uacpi_handle lock) {
|
uacpi_cpu_flags uacpi_kernel_lock_spinlock(uacpi_handle lock) {
|
||||||
return spinlock_acquireirqclear(lock);
|
return spinlock_acquireirqclear(lock);
|
||||||
}
|
}
|
||||||
|
|
||||||
void uacpi_kernel_spinlock_unlock(uacpi_handle lock, uacpi_cpu_flags intstate) {
|
void uacpi_kernel_unlock_spinlock(uacpi_handle lock, uacpi_cpu_flags intstate) {
|
||||||
spinlock_releaseirqrestore(lock, intstate);
|
spinlock_releaseirqrestore(lock, intstate);
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
Submodule kernel-src/io/acpi/uacpi updated: c137b78de8...9036f48cc2
Reference in New Issue
Block a user