33 for (
uint64_t i = 0; i < length; i++)
48 panic(
NULL,
"failed to get kernel process namespace for ACPI sysfs group");
55 panic(
NULL,
"failed to initialize ACPI sysfs group");
70 if (desc->Type == EfiACPIReclaimMemory)
73 LOG_INFO(
"reclaim memory [%p-%p]\n", desc->PhysicalStart,
88 LOG_ERR(
"no RSDP provided by bootloader\n");
94 LOG_ERR(
"failed to initialize ACPI tables\n");
100 LOG_ERR(
"failed to initialize AML subsystem\n");
112 LOG_ERR(
"failed to initialize ACPI devices\n");
120 LOG_ERR(
"failed to expose ACPI tables via sysfs\n");
126 LOG_ERR(
"failed to expose ACPI devices via sysfs\n");
139 "ACPI subsystem providing ACPI table handling, AML parsing and device management", OS_VERSION,
"MIT",
"BOOT_RSDP");
static bool dirInitialized
uint64_t _module_procedure(const module_event_t *event)
#define BOOT_MEMORY_MAP_GET_DESCRIPTOR(map, index)
uint64_t aml_namespace_expose(void)
Expose the entire namespace heirarchy to devfs.
uint64_t aml_init(void)
Initialize the AML subsystem.
uint64_t acpi_devices_init(void)
Enumerate, configure and load modules for ACPI devices.
uint64_t acpi_tables_init(rsdp_t *rsdp)
Initialize ACPI tables and call their init handlers.
uint64_t acpi_tables_expose(void)
Expose ACPI tables to devfs.
bool acpi_is_checksum_valid(void *table, uint64_t length)
Check if the sum of all bytes in a table is 0.
void acpi_reclaim_memory(const boot_memory_map_t *map)
Reclaim ACPI memory regions.
dentry_t * acpi_get_dir(void)
Retrieve the devfs root directory for ACPI.
dentry_t * sysfs_dir_new(dentry_t *parent, const char *name, const vnode_ops_t *vnodeOps, void *data)
Create a new directory inside a mounted sysfs instance.
boot_info_t * boot_info_get(void)
Gets the boot info structure.
NORETURN void panic(const interrupt_frame_t *frame, const char *format,...)
Panic the kernel, printing a message and halting.
#define LOG_ERR(format,...)
#define LOG_INFO(format,...)
#define PHYS_TO_PFN(_addr)
Convert a physical address to its PFN.
void pmm_free_region(pfn_t pfn, size_t count)
Free a contiguous region of physical memory.
#define MODULE_INFO(_name, _author, _description, _version, _licence, _deviceTypes)
Macro to define module information.
@ MODULE_EVENT_DEVICE_ATTACH
process_t * process_get_kernel(void)
Gets the kernel process.
namespace_t * process_get_ns(process_t *process)
Gets the namespace of a process.
#define UNREF_DEFER(ptr)
RAII-style cleanup for scoped references.
#define REF(ptr)
Increment reference count.
#define TEST_ALL()
Run all registered tests in the ._tests section.
#define NULL
Pointer error value.
#define ERR
Integer error value.
#define PAGE_SIZE
The size of a memory page in bytes.
__UINTPTR_TYPE__ uintptr_t
Directory entry structure.