67 LOG_ERR(
"failed to retrieve DSDT\n");
76 LOG_ERR(
"failed to parse DSDT\n");
95 LOG_ERR(
"failed to parse SSDT%llu\n", index);
102 LOG_INFO(
"parsed 1 DSDT and %llu SSDTs\n", index);
117 panic(
NULL,
"failed to create root AML object\n");
124 panic(
NULL,
"failed to set predefined scope for root object\n");
129 panic(
NULL,
"failed to initialize AML namespace\n");
134 panic(
NULL,
"failed to initialize AML integer handling\n");
139 panic(
NULL,
"failed to initialize AML predefined names\n");
144 panic(
NULL,
"failed to initialize AML patch up\n");
148 if (aml_tests_post_init() ==
ERR)
150 panic(
NULL,
"failed to run tests post init\n");
156 panic(
NULL,
"failed to parse all AML code\n");
162 panic(
NULL,
"failed to resolve all unresolved objects\n");
172 panic(
NULL,
"failed to expose AML namespace in sysfs\n");
176 if (aml_tests_post_parse_all() ==
ERR)
178 panic(
NULL,
"failed to run tests post parse all\n");
static uint64_t aml_parse(const uint8_t *start, const uint8_t *end)
static uint64_t aml_init_parse_all(void)
uint64_t aml_term_list_read(aml_state_t *state, aml_object_t *scope, const uint8_t *start, const uint8_t *end, aml_term_list_ctx_t *parentCtx)
Reads a TermList structure from the AML byte stream.
uint64_t aml_integer_handling_init(void)
Initialize integer handling.
uint64_t aml_namespace_commit(aml_namespace_overlay_t *overlay)
Commit all names in a namespace overlay to the global namespace heirarchy.
uint64_t aml_namespace_init(aml_object_t *root)
Initialize the namespace heirarchy.
uint64_t aml_namespace_expose(void)
Expose the entire namespace heirarchy to sysfs.
aml_object_t * aml_namespace_get_root(void)
Get the root object of the namespace heirarchy.
aml_object_t * aml_object_new(void)
Allocate a new ACPI object.
uint64_t aml_predefined_scope_set(aml_object_t *object)
Set a object as a predefined scope with the given name.
uint64_t aml_patch_up_init(void)
Initialize the patch-up system.
uint64_t aml_patch_up_unresolved_count(void)
Get the number of unresolved references in the global list.
uint64_t aml_patch_up_resolve_all(void)
Attempts to resolve all unresolved references.
uint64_t aml_predefined_init(void)
Initialize predefined AML names and objects.
uint64_t aml_state_init(aml_state_t *state, aml_object_t **args)
Initialize an AML state.
void aml_state_deinit(aml_state_t *state)
Deinitialize an AML state.
void aml_init(void)
Initialize the AML subsystem.
mutex_t * aml_big_mutex_get(void)
Get the mutex for the entire AML subsystem.
#define AML_CURRENT_REVISION
The current revision of the AML subsystem.
sdt_header_t * acpi_tables_lookup(const char *signature, uint64_t n)
Lookup the n'th table matching the signature.
#define DSDT_SIGNATURE
DSDT table signature.
#define SSDT_SIGNATURE
SSDT table signature.
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,...)
void mutex_init(mutex_t *mtx)
Initializes a mutex.
#define MUTEX_SCOPE(mutex)
Acquires a mutex for the reminder of the current scope.
#define DEREF_DEFER(ptr)
RAII-style cleanup for scoped references.
#define EINVAL
Invalid argument.
#define errno
Error number variable.
#define NULL
Pointer error value.
#define ERR
Integer error value.
aml_namespace_overlay_t overlay
Holds any named objects created during parsing.
Differentiated System Description Table.
uint8_t definitionBlock[]
Secondary System Description Table.
uint8_t definitionBlock[]