PatchworkOS  a7b3d61
A non-POSIX operating system.
Loading...
Searching...
No Matches
Term Objects

Term Objects Encoding. More...

Collaboration diagram for Term Objects:

Detailed Description

Term Objects Encoding.

See also
Section 20.2.5 of the ACPI specification for more details.

Data Structures

struct  aml_term_list_ctx_t
 Context for reading a TermList. More...
 

Enumerations

enum  aml_stop_reason_t { AML_STOP_REASON_NONE , AML_STOP_REASON_RETURN , AML_STOP_REASON_BREAK , AML_STOP_REASON_CONTINUE }
 Stop reason. More...
 

Functions

aml_object_taml_term_arg_read (aml_term_list_ctx_t *ctx, aml_type_t allowedTypes)
 Reads an TermArg structure from the AML byte stream.
 
uint64_t aml_term_arg_read_integer (aml_term_list_ctx_t *ctx, aml_uint_t *out)
 Wrapper around aml_term_arg_read() that converts the result to an integer.
 
aml_string_taml_term_arg_read_string (aml_term_list_ctx_t *ctx)
 Wrapper around aml_term_arg_read() that converts the result to a string.
 
aml_buffer_taml_term_arg_read_buffer (aml_term_list_ctx_t *ctx)
 Wrapper around aml_term_arg_read() that converts the result to a buffer.
 
aml_package_taml_term_arg_read_package (aml_term_list_ctx_t *ctx)
 Wrapper around aml_term_arg_read() that converts the result to a package.
 
uint64_t aml_object_read (aml_term_list_ctx_t *ctx)
 Reads an Object structure from the AML byte stream.
 
uint64_t aml_term_obj_read (aml_term_list_ctx_t *ctx)
 Reads a TermObj structure from the AML byte stream.
 
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.
 

Enumeration Type Documentation

◆ aml_stop_reason_t

Stop reason.

Enumerator
AML_STOP_REASON_NONE 

No stop reason, continue execution or has reached the end of the TermList.

AML_STOP_REASON_RETURN 

A Return statement was hit.

AML_STOP_REASON_BREAK 

A Break statement was hit.

AML_STOP_REASON_CONTINUE 

A Continue statement was hit.

Definition at line 23 of file term.h.

Function Documentation

◆ aml_term_arg_read()

aml_object_t * aml_term_arg_read ( aml_term_list_ctx_t ctx,
aml_type_t  allowedTypes 
)

Reads an TermArg structure from the AML byte stream.

A TermArg is defined as TermArg := ExpressionOpcode | DataObject | ArgObj | LocalObj.

Parameters
ctxThe context of the TermList that this structure is part of.
allowedTypesBitmask of allowed types for the TermArg, the will be evaluated to one of these types.
Returns
On success, the TermArg object. On failure, NULL and errno is set.

Definition at line 19 of file term.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ aml_term_arg_read_integer()

uint64_t aml_term_arg_read_integer ( aml_term_list_ctx_t ctx,
aml_uint_t out 
)

Wrapper around aml_term_arg_read() that converts the result to an integer.

Parameters
ctxThe context of the TermList that this structure is part of.
outThe output buffer to store the integer value of the TermArg.
Returns
On success, 0. On failure, ERR and errno is set.

Definition at line 70 of file term.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ aml_term_arg_read_string()

aml_string_t * aml_term_arg_read_string ( aml_term_list_ctx_t ctx)

Wrapper around aml_term_arg_read() that converts the result to a string.

Parameters
ctxThe context of the TermList that this structure is part of.
Returns
On success, the string. On failure, NULL and errno is set.

Definition at line 86 of file term.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ aml_term_arg_read_buffer()

aml_buffer_t * aml_term_arg_read_buffer ( aml_term_list_ctx_t ctx)

Wrapper around aml_term_arg_read() that converts the result to a buffer.

Parameters
ctxThe context of the TermList that this structure is part of.
Returns
On success, the buffer. On failure, NULL and errno is set.

Definition at line 100 of file term.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ aml_term_arg_read_package()

aml_package_t * aml_term_arg_read_package ( aml_term_list_ctx_t ctx)

Wrapper around aml_term_arg_read() that converts the result to a package.

Parameters
ctxThe context of the TermList that this structure is part of.
Returns
On success, the package. On failure, NULL and errno is set.

Definition at line 114 of file term.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ aml_object_read()

uint64_t aml_object_read ( aml_term_list_ctx_t ctx)

Reads an Object structure from the AML byte stream.

An Object is defined as Object := NameSpaceModifierObj | NamedObj.

Parameters
ctxThe context of the TermList that this structure is part of.
Returns
On success, 0. On failure, ERR and errno is set.

Definition at line 128 of file term.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ aml_term_obj_read()

uint64_t aml_term_obj_read ( aml_term_list_ctx_t ctx)

Reads a TermObj structure from the AML byte stream.

A TermObj is defined as TermObj := Object | StatementOpcode | ExpressionOpcode.

Parameters
ctxThe context of the TermList that this structure is part of.
Returns
On success, 0. On failure, ERR and errno is set.

Definition at line 146 of file term.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ aml_term_list_read()

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.

A TermList structure is defined as TermList := Nothing | <termobj termlist>.

This is the biggest "structure" in AML, and the entry point for AML execution.

Will not advance the parent TermLists current pointer.

Parameters
statePointer to the current AML state.
scopeThe location in the namespace from which names will be resolved.
startPointer to the start of the TermList in the AML byte stream.
endPointer to the end of the TermList in the AML byte stream.
parentCtxThe previous TermList context, or NULL if this is the top-level TermList, used to propagate stop reasons.
Returns
On success, 0. On failure, ERR and errno is set.

Definition at line 189 of file term.c.

Here is the call graph for this function:
Here is the caller graph for this function: