167 if (c < 0x01 || c > 0x7F)
329 LOG_ERR(
"failed to convert to data object in aml_package_element_handle_name()\n");
338 LOG_ERR(
"failed to init ObjectReference in aml_package_element_handle_name()\n");
390 while (ctx->
current < end && i < package->length)
static uint64_t aml_package_element_handle_name(aml_state_t *state, aml_object_t *in, aml_object_t *out)
uint64_t aml_convert_source(aml_state_t *state, aml_object_t *src, aml_object_t **dest, aml_type_t allowedTypes)
Performs a "Implicit Source Operand Conversion" acording to the rules in section 19....
#define AML_DEBUG_ERROR(ctx, format,...)
Macro to simplify calling aml_debug_error() with the current function name.
uint64_t aml_package_element_read(aml_term_list_ctx_t *ctx, aml_object_t *out)
Read a PackageElement structure from the AML stream.
uint64_t aml_def_package_read(aml_term_list_ctx_t *ctx, aml_object_t *out)
Reads a DefPackage structure from the AML byte stream.
uint64_t aml_byte_data_read(aml_term_list_ctx_t *ctx, uint8_t *out)
Read a ByteData structure from the AML stream.
uint64_t aml_data_ref_object_read(aml_term_list_ctx_t *ctx, aml_object_t *out)
Read a DataRefObject structure from the AML stream.
uint64_t aml_qword_data_read(aml_term_list_ctx_t *ctx, uint64_t *out)
Read a QWordData structure from the AML stream.
uint64_t aml_dword_data_read(aml_term_list_ctx_t *ctx, uint32_t *out)
Read a DWordData structure from the AML stream.
uint64_t aml_word_data_read(aml_term_list_ctx_t *ctx, uint16_t *out)
Read a WordData structure from the AML stream.
uint64_t aml_def_var_package_read(aml_term_list_ctx_t *ctx, aml_object_t *out)
Reads a DefVarPackage structure from the AML byte stream.
uint64_t aml_dword_const_read(aml_term_list_ctx_t *ctx, uint32_t *out)
Read a DWordConst structure from the AML stream.
uint64_t aml_byte_const_read(aml_term_list_ctx_t *ctx, uint8_t *out)
Read a ByteConst structure from the AML stream.
uint64_t aml_data_object_read(aml_term_list_ctx_t *ctx, aml_object_t *out)
Read a DataObject structure from the AML stream.
uint64_t aml_word_const_read(aml_term_list_ctx_t *ctx, uint16_t *out)
Read a WordConst structure from the AML stream.
uint64_t aml_num_elements_read(aml_term_list_ctx_t *ctx, uint8_t *out)
Read a NumElements structure from the AML stream.
uint64_t aml_def_var_num_elements_read(aml_term_list_ctx_t *ctx, aml_integer_t *out)
Read a VarNumElements structure from the AML stream.
uint64_t aml_package_element_list_read(aml_term_list_ctx_t *ctx, aml_package_obj_t *package, const uint8_t *end)
Read a PackageElementList structure from the AML stream.
uint64_t aml_const_obj_read(aml_term_list_ctx_t *ctx, aml_object_t *out)
Read a ConstObj structure from the AML stream.
uint64_t aml_string_read(aml_term_list_ctx_t *ctx, aml_object_t *out)
Read a String structure from the AML stream.
uint64_t aml_qword_const_read(aml_term_list_ctx_t *ctx, uint64_t *out)
Read a QWordConst structure from the AML stream.
uint64_t aml_revision_op_read(aml_term_list_ctx_t *ctx, aml_object_t *out)
Read a RevisionOp structure from the AML stream.
uint64_t aml_computational_data_read(aml_term_list_ctx_t *ctx, aml_object_t *out)
Read a ComputationalData structure from the AML stream.
uint64_t aml_def_buffer_read(aml_term_list_ctx_t *ctx, aml_object_t *out)
Reads a DefBuffer structure from the AML byte stream.
uint64_t aml_name_string_read(aml_term_list_ctx_t *ctx, aml_name_string_t *out)
Reads the next data as a NameString structure from the AML bytecode stream.
uint32_t aml_pkg_length_t
PkgLength structure.
uint64_t aml_pkg_length_read(aml_term_list_ctx_t *ctx, aml_pkg_length_t *out)
Reads a PkgLength structure from the AML byte stream.
uint64_t aml_term_arg_read_integer(aml_term_list_ctx_t *ctx, aml_integer_t *out)
Wrapper around aml_term_arg_read() that converts the result to an integer.
uint64_t aml_integer_t
AML Integer type.
aml_integer_t aml_integer_ones(void) PURE_FUNC
Get a mask with all bits set for the current AML integer size.
aml_object_t * aml_namespace_find_by_name_string(aml_namespace_overlay_t *overlay, aml_object_t *start, const aml_name_string_t *nameString)
Find an object in the namespace heirarchy by a name string.
uint64_t aml_object_reference_set(aml_object_t *object, aml_object_t *target)
Set a object as an ObjectReference to the given target object.
uint64_t aml_package_set(aml_object_t *object, uint64_t length)
Set a object as a package with the given number of elements.
uint64_t aml_integer_set(aml_object_t *object, aml_integer_t value)
Set a object as an integer with the given value and bit width.
uint64_t aml_string_set(aml_object_t *object, const char *str)
Set a object as a string with the given value.
void aml_object_clear(aml_object_t *object)
Clear the data of a object, setting its type to AML_UNINITIALIZED.
uint64_t aml_unresolved_set(aml_object_t *object, const aml_name_string_t *nameString, aml_object_t *from, aml_patch_up_resolve_callback_t callback)
Set a object as an unresolved reference with the given namestring and starting point.
static uint64_t aml_token_expect(aml_term_list_ctx_t *ctx, aml_token_num_t expected)
Reads a token from the AML stream and verifies it matches the expected token.
static void aml_token_read(aml_term_list_ctx_t *ctx, aml_token_t *out)
Attempt to read a token from the AML stream.
static void aml_token_peek(aml_term_list_ctx_t *ctx, aml_token_t *out)
Attempt to read a token from the AML stream, without advancing the instruction pointer.
@ AML_TOKEN_TYPE_NAME
Is a Name Object (section 20.2.2).
#define AML_CURRENT_REVISION
The current revision of the AML subsystem.
#define LOG_ERR(format,...)
#define ENODATA
No data available.
#define errno
Error number variable.
#define EILSEQ
Illegal byte sequence.
#define NULL
Pointer error value.
#define ERR
Integer error value.
aml_package_obj_t package
Data for a package object.
aml_namespace_overlay_t overlay
Holds any named objects created during parsing.
Context for reading a TermList.
const aml_token_props_t * props