PatchworkOS  a7b3d61
A non-POSIX operating system.
Loading...
Searching...
No Matches
Field Access

Opregion and Field Access. More...

Collaboration diagram for Field Access:

Detailed Description

Opregion and Field Access.

This module provides functionality for accessing Opregions and Fields.

Good luck understanding all the bit shifting and masking, im pretty sure I got it all right but who knows.

Functions

uint64_t aml_field_unit_load (aml_state_t *state, aml_field_unit_t *fieldUnit, aml_object_t *out)
 Read the value stored in a FieldUnit. FieldUnits include Fields, IndexFields and BankFields.
 
uint64_t aml_field_unit_store (aml_state_t *state, aml_field_unit_t *fieldUnit, aml_object_t *in)
 Write a value to a FieldUnit. FieldUnits include Fields, IndexFields and BankFields.
 

Function Documentation

◆ aml_field_unit_load()

uint64_t aml_field_unit_load ( aml_state_t state,
aml_field_unit_t fieldUnit,
aml_object_t out 
)

Read the value stored in a FieldUnit. FieldUnits include Fields, IndexFields and BankFields.

A IndexField works by having two fields, an index field and a data field. The index field is written to with the "selector" or "index" of the data to read, and then the data field is read to get the actual data.

A BankField works similarly to a field, but it has an additional "bank" object which it writes its "BankValue" to (which is like the BankFields id), before performing any access. Think of this like reconfiguring the opregion to a different structure before accessing it.

Will acquire the global mutex if the FieldUnits LockRule is set to AML_LOCK_RULE_LOCK.

See also
Runtime Evaluation
Section 19.6.48, 19.6.64 and 19.6.7 of the ACPI specification for more details.
Parameters
statePointer to the current AML state.
fieldThe field to read from.
outPointer to the buffer where the result will be stored, will be an integer or a buffer.
Returns
On success, 0. On failure, ERR and errno is set.

Definition at line 612 of file field_unit.c.

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

◆ aml_field_unit_store()

uint64_t aml_field_unit_store ( aml_state_t state,
aml_field_unit_t fieldUnit,
aml_object_t in 
)

Write a value to a FieldUnit. FieldUnits include Fields, IndexFields and BankFields.

Will acquire the global mutex if the FieldUnits LockRule is set to AML_LOCK_RULE_LOCK.

See also
Runtime Evaluation
Section 19.6.48, 19.6.64 and 19.6.7 of the ACPI specification for more details.
Parameters
statePointer to the current AML state.
fieldThe field to write to.
inPointer to the object containing the value to write, must be an integer or a buffer.
Returns
On success, 0. On failure, ERR and errno is set.

Definition at line 639 of file field_unit.c.

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