27 for (
uint64_t i = 0; i < length; i++)
43 panic(
NULL,
"failed to initialize ACPI sysfs group");
58 if (desc->Type == EfiACPIReclaimMemory)
61 LOG_INFO(
"reclaim memory [0x%016lx-0x%016lx]\n", desc->PhysicalStart,
76 LOG_ERR(
"no RSDP provided by bootloader\n");
82 LOG_ERR(
"failed to initialize ACPI tables\n");
88 LOG_ERR(
"failed to initialize AML subsystem\n");
94 LOG_ERR(
"failed to initialize ACPI devices\n");
102 LOG_ERR(
"failed to expose ACPI tables via sysfs\n");
108 LOG_ERR(
"failed to expose ACPI devices via sysfs\n");
121 "ACPI subsystem providing ACPI table handling, AML parsing and device management", OS_VERSION,
"MIT",
"BOOT_RSDP");
uint64_t _module_procedure(const module_event_t *event)
static bool mountInitialzed
#define BOOT_MEMORY_MAP_GET_DESCRIPTOR(map, index)
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 PML_LOWER_TO_HIGHER(addr)
Converts an address from the lower half to the higher half.
void pmm_free_region(void *address, uint64_t count)
Frees a contiguous region of physical pages.
#define MODULE_INFO(_name, _author, _description, _version, _licence, _deviceTypes)
Macro to define module information.
@ MODULE_EVENT_DEVICE_ATTACH
#define REF(ptr)
Increment reference count.
@ MOUNT_PROPAGATE_PARENT
Propagate the mount to parent namespaces.
@ MOUNT_PROPAGATE_CHILDREN
Propagate the mount to child namespaces.
#define PAGE_SIZE
The size of a memory page in bytes.
#define NULL
Pointer error value.
#define ERR
Integer error value.
uint64_t aml_namespace_expose(void)
Expose the entire namespace heirarchy to sysfs.
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 sysfs.
dentry_t * acpi_get_sysfs_root(void)
Retrieve the sysfs root directory for ACPI.
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.
__UINTPTR_TYPE__ uintptr_t
Directory entry structure.
dentry_t * source
The dentry to appear at target once mounted, usually the root dentry of the mounted filesystem.
mount_t * sysfs_mount_new(const path_t *parent, const char *name, namespace_t *ns, mount_flags_t flags, mode_t mode, const superblock_ops_t *superblockOps)
Mount a new instance of SysFS.