PatchworkOS  2ca1c69
A non-POSIX operating system.
Loading...
Searching...
No Matches
Data Objects

Data Objects Encoding. More...

Collaboration diagram for Data Objects:

Detailed Description

Data Objects Encoding.

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

Typedefs

typedef uint64_t aml_bit_size_t
 Represents a size in bits within an opregion.
 

Functions

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_word_data_read (aml_term_list_ctx_t *ctx, uint16_t *out)
 Read a WordData 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_qword_data_read (aml_term_list_ctx_t *ctx, uint64_t *out)
 Read a QWordData 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_word_const_read (aml_term_list_ctx_t *ctx, uint16_t *out)
 Read a WordConst structure from the AML 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_qword_const_read (aml_term_list_ctx_t *ctx, uint64_t *out)
 Read a QWordConst 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_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_num_elements_read (aml_term_list_ctx_t *ctx, uint8_t *out)
 Read a NumElements structure from the AML stream.
 
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_package_element_list_read (aml_term_list_ctx_t *ctx, aml_package_t *package, const uint8_t *end)
 Read a PackageElementList 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_def_var_num_elements_read (aml_term_list_ctx_t *ctx, aml_uint_t *out)
 Read a VarNumElements 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_data_object_read (aml_term_list_ctx_t *ctx, aml_object_t *out)
 Read a DataObject 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.
 

Typedef Documentation

◆ aml_bit_size_t

Represents a size in bits within an opregion.

Definition at line 14 of file data_integers.h.

Function Documentation

◆ aml_byte_data_read()

uint64_t aml_byte_data_read ( aml_term_list_ctx_t ctx,
uint8_t out 
)

Read a ByteData structure from the AML stream.

A ByteData structure is defined as ByteData := 0x00 - 0xFF.

Parameters
ctxThe context of the TermList that this structure is part of.
outOutput pointer where the byte value will be stored.
Returns
On success, 0. On failure, ERR and errno is set.

Definition at line 16 of file data.c.

Here is the caller graph for this function:

◆ aml_word_data_read()

uint64_t aml_word_data_read ( aml_term_list_ctx_t ctx,
uint16_t out 
)

Read a WordData structure from the AML stream.

A WordData structure is defined as WordData := ByteData[0:7] ByteData[8:15].

Parameters
ctxThe context of the TermList that this structure is part of.
outOutput pointer where the word value will be stored.
Returns
On success, 0. On failure, ERR and errno is set.

Definition at line 30 of file data.c.

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

◆ aml_dword_data_read()

uint64_t aml_dword_data_read ( aml_term_list_ctx_t ctx,
uint32_t out 
)

Read a DWordData structure from the AML stream.

A DWordData structure is defined as DWordData := WordData[0:15] WordData[16:31].

Parameters
ctxThe context of the TermList that this structure is part of.
outOutput pointer where the dword value will be stored.
Returns
On success, 0. On failure, ERR and errno is set.

Definition at line 42 of file data.c.

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

◆ aml_qword_data_read()

uint64_t aml_qword_data_read ( aml_term_list_ctx_t ctx,
uint64_t out 
)

Read a QWordData structure from the AML stream.

A QWordData structure is defined as QWordData := DWordData[0:31] DWordData[32:63].

Parameters
ctxThe context of the TermList that this structure is part of.
outOutput pointer to the qword value will be stored.
Returns
On success, 0. On failure, ERR and errno is set.

Definition at line 54 of file data.c.

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

◆ aml_byte_const_read()

uint64_t aml_byte_const_read ( aml_term_list_ctx_t ctx,
uint8_t out 
)

Read a ByteConst structure from the AML stream.

A ByteConst structure is defined as ByteConst := BytePrefix ByteData.

Parameters
ctxThe context of the TermList that this structure is part of.
outOutput pointer to the byte value will be stored.
Returns
On success, 0. On failure, ERR and errno is set.

Definition at line 66 of file data.c.

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

◆ aml_word_const_read()

uint64_t aml_word_const_read ( aml_term_list_ctx_t ctx,
uint16_t out 
)

Read a WordConst structure from the AML stream.

A WordConst structure is defined as WordConst := WordPrefix WordData.

Parameters
ctxThe context of the TermList that this structure is part of.
outOutput pointer to the word value will be stored.
Returns
On success, 0. On failure, ERR and errno is set.

Definition at line 77 of file data.c.

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

◆ aml_dword_const_read()

uint64_t aml_dword_const_read ( aml_term_list_ctx_t ctx,
uint32_t out 
)

Read a DWordConst structure from the AML stream.

A DWordConst structure is defined as DwordConst := DWordPrefix DWordData.

Parameters
ctxThe context of the TermList that this structure is part of.
outOutput pointer to the dword value will be stored.
Returns
On success, 0. On failure, ERR and errno is set.

Definition at line 88 of file data.c.

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

◆ aml_qword_const_read()

uint64_t aml_qword_const_read ( aml_term_list_ctx_t ctx,
uint64_t out 
)

Read a QWordConst structure from the AML stream.

A QWordConst structure is defined as QWordConst := QWordPrefix QWordData.

Parameters
ctxThe context of the TermList that this structure is part of.
outOutput pointer to the qword value will be stored.
Returns
On success, 0. On failure, ERR and errno is set.

Definition at line 99 of file data.c.

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

◆ aml_const_obj_read()

uint64_t aml_const_obj_read ( aml_term_list_ctx_t ctx,
aml_object_t out 
)

Read a ConstObj structure from the AML stream.

A ConstObj structure is defined as ConstObj := ZeroOp | OneOp | OnesOp.

See also
Sections 19.6.98, 19.6.99 and 19.6.156 for more details.
Parameters
ctxThe context of the TermList that this structure is part of.
outOutput pointer to the object to store the result.
Returns
On success, 0. On failure, ERR and errno is set.

Definition at line 110 of file data.c.

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

◆ aml_string_read()

uint64_t aml_string_read ( aml_term_list_ctx_t ctx,
aml_object_t out 
)

Read a String structure from the AML stream.

A String structure is defined as String := StringPrefix AsciiCharList NullChar.

AsciiCharList is defined as a sequence of ASCII characters in the range 0x01 to 0x7F, and NullChar is defined as 0x00.

Parameters
ctxThe context of the TermList that this structure is part of.
outOutput pointer to the object to store the result.
Returns
On success, 0. On failure, ERR and errno is set.

Definition at line 144 of file data.c.

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

◆ aml_revision_op_read()

uint64_t aml_revision_op_read ( aml_term_list_ctx_t ctx,
aml_object_t out 
)

Read a RevisionOp structure from the AML stream.

A RevisionOp structure is defined as RevisionOp := RevisionOp.

See also
Section 19.6.121 of the ACPI specification for more details.
Parameters
ctxThe context of the TermList that this structure is part of.
outOutput pointer to the object to store the result.
Returns
On success, 0. On failure, ERR and errno is set.

Definition at line 183 of file data.c.

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

◆ aml_computational_data_read()

uint64_t aml_computational_data_read ( aml_term_list_ctx_t ctx,
aml_object_t out 
)

Read a ComputationalData structure from the AML stream.

A ComputationalData structure is defined as ComputationalData := ByteConst | WordConst | DWordConst | QWordConst | String | ConstObj | RevisionOp | DefBuffer.

Parameters
ctxThe context of the TermList that this structure is part of.
outOutput pointer to the object to store the result.
Returns
On success, 0. On failure, ERR and errno is set.

Definition at line 199 of file data.c.

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

◆ aml_num_elements_read()

uint64_t aml_num_elements_read ( aml_term_list_ctx_t ctx,
uint8_t out 
)

Read a NumElements structure from the AML stream.

A NumElements structure is defined as NumElements := ByteData.

Parameters
ctxThe context of the TermList that this structure is part of.
outOutput pointer to the integer to be filled with the number of elements.
Returns
On success, 0. On failure, ERR and errno is set.

Definition at line 304 of file data.c.

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

◆ aml_package_element_read()

uint64_t aml_package_element_read ( aml_term_list_ctx_t ctx,
aml_object_t out 
)

Read a PackageElement structure from the AML stream.

A PackageElement structure is defined as PackageElement := DataRefObject | NameString.

See also
Section 19.6.102 of the ACPI specification for more details.
Parameters
ctxThe context of the TermList that this structure is part of.
outPointer to the object to initialize with the read element.
Returns
On success, 0. On failure, ERR and errno is set.

Definition at line 345 of file data.c.

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

◆ aml_package_element_list_read()

uint64_t aml_package_element_list_read ( aml_term_list_ctx_t ctx,
aml_package_t package,
const uint8_t end 
)

Read a PackageElementList structure from the AML stream.

A PackageElementList structure is defined as PackageElementList := Nothing | <packageelement packageelementlist>`.

Parameters
ctxThe context of the TermList that this structure is part of.
packagePointer to the package to fill with the read elements.
endPointer to the end of the PackageElementList.
Returns
On success, 0. On failure, ERR and errno is set.

Definition at line 387 of file data.c.

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

◆ aml_def_package_read()

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.

A DefPackage structure is defined as DefPackage := PackageOp PkgLength NumElements PackageElementList.

See also
Section 19.6.102 of the ACPI specification for more details.
Parameters
ctxThe context of the TermList that this structure is part of.
outOutput pointer to the object to store the result.
Returns
On success, 0. On failure, ERR and errno is set.

Definition at line 407 of file data.c.

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

◆ aml_def_var_num_elements_read()

uint64_t aml_def_var_num_elements_read ( aml_term_list_ctx_t ctx,
aml_uint_t out 
)

Read a VarNumElements structure from the AML stream.

A VarNumElements structure is defined as VarNumElements := TermArg => Integer.

Parameters
ctxThe context of the TermList that this structure is part of.
outOutput pointer to the integer to be filled with the number of elements.
Returns
On success, 0. On failure, ERR and errno is set.

Definition at line 449 of file data.c.

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

◆ aml_def_var_package_read()

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.

A DefVarPackage structure is defined as DefVarPackage := VarPackageOp PkgLength VarNumElements PackageElementList.

See also
Section 19.6.103 of the ACPI specification for more details.
Parameters
ctxThe context of the TermList that this structure is part of.
outOutput pointer to the object to store the result.
Returns
On success, 0. On failure, ERR and errno is set.

Definition at line 460 of file data.c.

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

◆ aml_data_object_read()

uint64_t aml_data_object_read ( aml_term_list_ctx_t ctx,
aml_object_t out 
)

Read a DataObject structure from the AML stream.

A DataObject structure is defined as DataObject := ComputationalData | DefPackage | DefVarPackage.

Parameters
ctxThe context of the TermList that this structure is part of.
outOutput pointer to the object to store the result.
Returns
On success, 0. On failure, ERR and errno is set.

Definition at line 501 of file data.c.

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

◆ aml_data_ref_object_read()

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.

A DataRefObject structure is defined as DataRefObject := DataObject | ObjectReference.

Todo:
Implement ObjectReference handling... somehow. I honestly have no clue what the spec wants you to do here. But everything seems to work fine by only reading DataObjects for now.
Parameters
ctxThe context of the TermList that this structure is part of.
outOutput pointer to the object to store the result.
Returns
On success, 0. On failure, ERR and errno is set.

Definition at line 529 of file data.c.

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