vma: Implement VMA.
+ acpi: Start implementation of table lookup + cpu: Remove useless argument to "cpu_invalidate_page" + cpu (x86_64): Removed "read_cr3" + arch/x86_64: Replace debug with trace for GDT & IDT initialization.
This commit is contained in:
parent
16246cc167
commit
dcea7360d2
18 changed files with 205 additions and 34 deletions
43
kernel/src/acpi/acpi.c
Normal file
43
kernel/src/acpi/acpi.c
Normal file
|
@ -0,0 +1,43 @@
|
|||
/*
|
||||
* The Soaplin Kernel
|
||||
* Copyright (C) 2025 The SILD Project
|
||||
*
|
||||
* acpi.c - ACPI table lookup
|
||||
*/
|
||||
|
||||
#include <stdbool.h>
|
||||
|
||||
#include <acpi/acpi.h>
|
||||
#include <arch/cpu.h>
|
||||
#include <boot/limine.h>
|
||||
#include <lib/log.h>
|
||||
#include <mm/memop.h>
|
||||
|
||||
static bool __acpi_use_xsdt;
|
||||
static uint64_t __acpi_rsdt_addr;
|
||||
|
||||
void acpi_init() {
|
||||
acpi_rsdp_t *rsdp = (acpi_rsdp_t*)limine_get_rsdp();
|
||||
if (memcmp(rsdp->sign, "RSD PTR ", 8))
|
||||
{
|
||||
fatal("acpi: ACPI RSDP is corrupt\n");
|
||||
hcf();
|
||||
}
|
||||
|
||||
if (rsdp->rev >= 2)
|
||||
{
|
||||
trace("acpi: ACPI v2.0 or later detected: Using XSDT.\n");
|
||||
|
||||
acpi_xsdp_t *xsdp = (acpi_xsdp_t *)rsdp;
|
||||
__acpi_use_xsdt = 1;
|
||||
__acpi_rsdt_addr = xsdp->xsdt_addr;
|
||||
|
||||
goto initialized;
|
||||
}
|
||||
|
||||
__acpi_use_xsdt = 0;
|
||||
__acpi_rsdt_addr = rsdp->rsdt_addr; // Do not use a pointer, to shut up the compiler.
|
||||
|
||||
initialized:
|
||||
trace("acpi: Initialized!\n");
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue