mirror of
https://github.com/Mathewnd/Astral.git
synced 2026-10-27 12:48:22 +00:00
Merge pull request #12 from d-tatianin/uacpi-update
Update uACPI to latest master
This commit is contained in:
@@ -2,11 +2,14 @@
|
||||
#include <kernel/pmm.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include <uacpi/kernel_api.h>
|
||||
|
||||
static volatile struct limine_rsdp_request rsdpreq = {
|
||||
.id = LIMINE_RSDP_REQUEST,
|
||||
.revision = 0
|
||||
};
|
||||
|
||||
uintptr_t arch_get_rsdp(void) {
|
||||
return (uintptr_t)FROM_HHDM(rsdpreq.response->address);
|
||||
uacpi_status uacpi_kernel_get_rsdp(uacpi_phys_addr *outrsdp) {
|
||||
*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));
|
||||
|
||||
uacpi_table_unref(&tbl);
|
||||
return ticksperus;
|
||||
}
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
size_t strlen(const char *str);
|
||||
char *strcpy(char *dest, const char *src);
|
||||
char *strcat(char *dest, const char *str);
|
||||
void *memcpy(void *dest, void *src, size_t size);
|
||||
void *memcpy(void *dest, const void *src, size_t size);
|
||||
void *memset(void *dest, unsigned long what, size_t size);
|
||||
int strcmp(const char *a, const char *b);
|
||||
int strncmp(const char *a, const char *b, size_t c);
|
||||
|
||||
@@ -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);
|
||||
mcfgentries[i].address = (uintptr_t)virt + pageoffset;
|
||||
}
|
||||
uacpi_table_unref(&tbl);
|
||||
} else {
|
||||
printf("pci: MCFG table not found. Falling back to legacy access mechanism\n");
|
||||
pci_archread32 = legacy_read32;
|
||||
|
||||
@@ -7,17 +7,10 @@
|
||||
#include <uacpi/event.h>
|
||||
#include <kernel/acpi.h>
|
||||
#include <kernel/interrupt.h>
|
||||
#include <arch/acpi.h>
|
||||
#include <logging.h>
|
||||
|
||||
void acpi_early_init(void) {
|
||||
struct uacpi_init_params params = {
|
||||
.rsdp = arch_get_rsdp(),
|
||||
.log_level = UACPI_LOG_INFO,
|
||||
};
|
||||
|
||||
uacpi_status ret = uacpi_initialize(¶ms);
|
||||
__assert(ret == UACPI_STATUS_OK);
|
||||
__assert(uacpi_initialize(0) == UACPI_STATUS_OK);
|
||||
}
|
||||
|
||||
void acpi_dopoweroff(uacpi_handle ctx) {
|
||||
|
||||
@@ -518,10 +518,10 @@ void uacpi_kernel_free_spinlock(uacpi_handle 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);
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
+1
-1
Submodule kernel-src/io/acpi/uacpi updated: c137b78de8...9036f48cc2
@@ -3,7 +3,7 @@
|
||||
#include <stdint.h>
|
||||
#include <errno.h>
|
||||
|
||||
void *memcpy(void *d, void *s, size_t c) {
|
||||
void *memcpy(void *d, const void *s, size_t c) {
|
||||
#ifdef __x86_64__
|
||||
asm volatile ("rep movsb" : : "S"(s), "D"(d), "c"(c) : "memory");
|
||||
#else
|
||||
|
||||
Reference in New Issue
Block a user