13 if (method ==
NULL || parentState ==
NULL)
47 LOG_ERR(
"could not acquire method mutex\n");
59 LOG_ERR(
"could not release method mutex\n");
69 LOG_ERR(
"could not initialize AML state\n");
82 if (highestThatContainsMethod ==
NULL)
113 LOG_ERR(
"could not release method mutex\n");
#define AML_MAX_ARGS
Maximum number of arguments that can be passed to a method.
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_t
AML Integer type.
aml_object_t * aml_method_evaluate(aml_state_t *parentState, aml_method_obj_t *method, aml_object_t **args)
Evaluate a method with the given arguments.
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...
uint64_t aml_mutex_release(aml_mutex_id_t *mutex)
Release a mutex.
uint64_t aml_mutex_acquire(aml_mutex_id_t *mutex, aml_sync_level_t syncLevel, clock_t timeout)
Acquire a mutex, blocking until it is available or the timeout is reached.
#define AML_NAME_TO_STRING(name)
Macro to convert an aml_name_t to a stack allocated string.
void aml_namespace_overlay_set_parent(aml_namespace_overlay_t *overlay, aml_namespace_overlay_t *parent)
Set the parent of a namespace overlay.
aml_namespace_overlay_t * aml_namespace_overlay_get_highest_that_contains(aml_namespace_overlay_t *overlay, aml_object_t *object)
Search a overlay and its parents for the first overlay that contains the given object.
aml_type_t
ACPI data types.
uint64_t aml_state_init(aml_state_t *state, aml_object_t **args)
Initialize an AML state.
aml_object_t * aml_state_result_get(aml_state_t *state)
Get the result object of the 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.
#define LOG_ERR(format,...)
#define DEREF_DEFER(ptr)
RAII-style cleanup for scoped references.
#define EINVAL
Invalid argument.
#define errno
Error number variable.
#define E2BIG
Argument list too long.
#define NULL
Pointer error value.
#define ERR
Integer error value.
#define CONTAINER_OF(ptr, type, member)
Container of macro.
bool isSerialized
true if method is serialized, false if not
uint8_t argCount
Amount of arguments (0-7)
aml_sync_level_t syncLevel
Synchronization level (0-15)
Data for a method object.
aml_method_implementation_t implementation
aml_method_flags_t methodFlags
aml_integer_obj_t integer
aml_namespace_overlay_t overlay
Holds any named objects created during parsing.