PatchworkOS  a7b3d61
A non-POSIX operating system.
Loading...
Searching...
No Matches
Package Length

Package Length Encoding. More...

Collaboration diagram for Package Length:

Detailed Description

Package Length Encoding.

See also
Section 20.2.4 of the ACPI specification.

Data Structures

struct  aml_pkg_lead_byte_t
 PkgLeadByte structure. More...
 

Typedefs

typedef uint32_t aml_pkg_length_t
 PkgLength structure.
 

Functions

uint64_t aml_pkg_lead_byte_read (aml_term_list_ctx_t *ctx, aml_pkg_lead_byte_t *out)
 Reads a PkgLeadByte structure from the AML byte stream.
 
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.
 

Typedef Documentation

◆ aml_pkg_length_t

PkgLength structure.

Definition at line 21 of file package_length.h.

Function Documentation

◆ aml_pkg_lead_byte_read()

uint64_t aml_pkg_lead_byte_read ( aml_term_list_ctx_t ctx,
aml_pkg_lead_byte_t out 
)

Reads a PkgLeadByte structure from the AML byte stream.

The PkgLeadByte structure is defined as:

  • bit 7-6: bytedata count that follows (0-3)
  • bit 5-4: only used if pkglength <= 63
  • bit 3-0: least significant package length nybble
Parameters
ctxThe context of the TermList that this structure is part of.
outThe output buffer to store the lead byte.
Returns
On success, 0. On failure, ERR and errno is set.

Definition at line 10 of file package_length.c.

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

◆ aml_pkg_length_read()

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.

The PkgLength structure is defined as PkgLength := PkgLeadByte | <pkgleadbyte bytedata> | <pkgleadbyte bytedata bytedata> | <pkgleadbyte bytedata bytedata bytedata>.

A PkgLength structure specifies the length from its own start to the end of the data for the operation/structure it is part of, as such the PkgLength includes the length of the PkgLength structure itself.

See also
Section 5.4.1 of the ACPI specification for more details.
Parameters
ctxThe context of the TermList that this structure is part of.
outThe output buffer to store the package length.
Returns
On success, 0. On failure, ERR and errno is set.

Definition at line 34 of file package_length.c.

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