105 panic(
NULL,
"could not initialize AML state for ACPI device initialization\n");
112 LOG_ERR(
"could not find \\_SB_ in namespace\n");
131 panic(
NULL,
"could not evaluate \\_SB_._INI\n");
138 panic(
NULL,
"could not initialize ACPI devices\n");
static uint64_t acpi_devices_init_children(aml_state_t *state, aml_object_t *parent)
static uint64_t acpi_sta_get_flags(aml_state_t *state, aml_object_t *device, acpi_sta_flags_t *out)
uint64_t aml_integer_t
AML Integer type.
uint64_t aml_method_evaluate_integer(aml_state_t *parentState, aml_object_t *object, aml_integer_t *out)
Wrapper around aml_method_evaluate for zero argument methods that return an integer or nothing and fo...
#define AML_NAME_TO_STRING(name)
Macro to convert an aml_name_t to a stack allocated string.
aml_object_t * aml_namespace_find(aml_namespace_overlay_t *overlay, aml_object_t *start, uint64_t nameCount,...)
Find an object in the namespace heirarchy by name segments.
aml_object_t * aml_namespace_find_child(aml_namespace_overlay_t *overlay, aml_object_t *parent, aml_name_t name)
Find a child object directly under a parent object in the namespace heirarchy.
#define AML_NAME(a, b, c, d)
Macro to create an aml_name_t from 4 characters.
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.
const char * aml_type_to_string(aml_type_t type)
Convert an aml data type to a string.
mutex_t * aml_big_mutex_get(void)
Get the mutex for the entire AML subsystem.
void acpi_devices_init(void)
Enumerate and configure ACPI devices.
acpi_sta_flags_t
Flags for the _STA method.
#define ACPI_STA_FLAGS_DEFAULT
Default _STA flags if the _STA method does not exist.
@ ACPI_STA_BATTERY_PRESENT
Set if a battery is present.
@ ACPI_STA_SHOW_IN_UI
Set if the device should be shown in the UI.
@ ACPI_STA_PRESENT
Set if the device is present.
@ ACPI_STA_FUNCTIONAL
Set if the device is functioning properly (cleared if device failed its diagnostics)
@ ACPI_STA_ENABLED
Set if the device is enabled and decoding its resources.
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 MUTEX_SCOPE(mutex)
Acquires a mutex for the reminder of the current scope.
#define DEREF_DEFER(ptr)
RAII-style cleanup for scoped references.
#define errno
Error number variable.
#define EILSEQ
Illegal byte sequence.
#define LIST_FOR_EACH(elem, list, member)
Iterates over a list.
#define NULL
Pointer error value.
#define ERR
Integer error value.
aml_namespace_overlay_t overlay
Holds any named objects created during parsing.