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

Object. More...

Collaboration diagram for Object:

Detailed Description

Object.

Data Structures

struct  aml_buffer_t
 Data for a buffer object. More...
 
struct  aml_buffer_field_t
 Data for a buffer field object. More...
 
struct  aml_device_t
 Data for a device object. More...
 
struct  aml_event_t
 Data placeholder for an event object. More...
 
struct  aml_field_unit_t
 Data for a field unit object. More...
 
struct  aml_integer_t
 Data for an integer object. More...
 
struct  aml_integer_constant_t
 Data for an integer constant object. More...
 
struct  aml_method_t
 Data for a method object. More...
 
struct  aml_mutex_t
 Data for a mutex object. More...
 
struct  aml_object_reference_t
 Data for an object reference object. More...
 
struct  aml_opregion_t
 Data for an operation region object. More...
 
struct  aml_package_t
 Data for a package object. More...
 
struct  aml_power_resource_t
 
struct  aml_processor_t
 Data for a processor object. More...
 
struct  aml_string_t
 Data for a string object. More...
 
struct  aml_alias_t
 Data for an alias object. More...
 
struct  aml_unresolved_t
 Data for an unresolved object. More...
 
struct  aml_arg_t
 Data for an argument object. More...
 
struct  aml_local_t
 Data for a local variable object. More...
 
struct  aml_object_t
 ACPI object. More...
 

Macros

#define AML_SMALL_BUFFER_SIZE   32
 Size of buffers used for small objects optimization.
 
#define AML_SMALL_STRING_SIZE   AML_SMALL_BUFFER_SIZE
 Size of string buffers used for small objects optimization, not including the null terminator.
 
#define AML_SMALL_PACKAGE_SIZE   4
 Size of package element arrays used for small objects optimization.
 
#define AML_OBJECT_CACHE_SIZE   64
 Amount of objects to store in the cache before freeing them instead.
 
#define AML_OBJECT_ID_NONE   0
 Value for an invalid object id.
 
#define AML_OBJECT_COMMON_HEADER
 Common header for all AML objects.
 

Typedefs

typedef uint64_t aml_object_id_t
 Object id type.
 
typedef aml_object_t *(* aml_method_implementation_t) (aml_method_t *method, aml_object_t **args, uint64_t argCount)
 Method Implementation function type.
 

Enumerations

enum  aml_type_t {
  AML_UNINITIALIZED = 0 , AML_BUFFER = 1 << 0 , AML_BUFFER_FIELD = 1 << 1 , AML_DEBUG_OBJECT = 1 << 2 ,
  AML_DEVICE = 1 << 3 , AML_EVENT = 1 << 4 , AML_FIELD_UNIT = 1 << 5 , AML_INTEGER = 1 << 6 ,
  AML_METHOD = 1 << 8 , AML_MUTEX = 1 << 9 , AML_OBJECT_REFERENCE = 1 << 10 , AML_OPERATION_REGION = 1 << 11 ,
  AML_PACKAGE = 1 << 12 , AML_POWER_RESOURCE = 1 << 13 , AML_PROCESSOR = 1 << 14 , AML_RAW_DATA_BUFFER = 1 << 15 ,
  AML_STRING = 1 << 16 , AML_THERMAL_ZONE = 1 << 17 , AML_ALIAS = 1 << 18 , AML_UNRESOLVED = 1 << 19 ,
  AML_PREDEFINED_SCOPE = 1 << 20 , AML_ARG = 1 << 21 , AML_LOCAL = 1 << 22 , AML_COMPUTATIONAL_DATA_OBJECTS = AML_INTEGER | AML_STRING | AML_BUFFER ,
  AML_DATA_OBJECTS = AML_COMPUTATIONAL_DATA_OBJECTS | AML_PACKAGE , AML_DATA_REF_OBJECTS = AML_DATA_OBJECTS | AML_OBJECT_REFERENCE , AML_NAMESPACES , AML_ALL_TYPES ,
  AML_TYPE_AMOUNT = 20
}
 ACPI data types. More...
 
enum  aml_object_flags_t {
  AML_OBJECT_NONE = 0 , AML_OBJECT_ROOT = 1 << 0 , AML_OBJECT_NAMED = 1 << 1 , AML_OBJECT_EXCEPTION_ON_USE = 1 << 2 ,
  AML_OBJECT_EXPOSED_IN_SYSFS = 1 << 3
}
 Flags for ACPI objects. More...
 
enum  aml_field_unit_type_t { AML_FIELD_UNIT_NONE , AML_FIELD_UNIT_FIELD , AML_FIELD_UNIT_INDEX_FIELD , AML_FIELD_UNIT_BANK_FIELD }
 Field Unit types. More...
 

Functions

uint64_t aml_object_get_total_count (void)
 Get the total amount of allocated ACPI objects.
 
aml_object_taml_object_new (void)
 Allocate a new ACPI object.
 
void aml_object_clear (aml_object_t *object)
 Clear the data of a object, setting its type to AML_UNINITIALIZED.
 
uint64_t aml_object_count_children (aml_object_t *parent)
 Recursively count how many children an object has.
 
uint64_t aml_object_set_bits_at (aml_object_t *object, aml_bit_size_t bitOffset, aml_bit_size_t bitSize, uint8_t *in)
 Store bits into a object at the specified bit offset and size.
 
uint64_t aml_object_get_bits_at (aml_object_t *object, aml_bit_size_t bitOffset, aml_bit_size_t bitSize, uint8_t *out)
 Retrieve bits from a object at the specified bit offset and size.
 
uint64_t aml_buffer_resize (aml_buffer_t *buffer, uint64_t newLength)
 Resize a buffer object to the new length.
 
uint64_t aml_buffer_set_empty (aml_object_t *object, uint64_t length)
 Set a object as an empty buffer with the given length.
 
uint64_t aml_buffer_set (aml_object_t *object, const uint8_t *buffer, uint64_t bytesToCopy, uint64_t length)
 Set a object as a buffer with the given content.
 
uint64_t aml_buffer_field_set (aml_object_t *object, aml_object_t *target, aml_bit_size_t bitOffset, aml_bit_size_t bitSize)
 Set a object as a buffer field with the given buffer, bit offset and bit size.
 
uint64_t aml_debug_object_set (aml_object_t *object)
 Set a object as a debug object.
 
uint64_t aml_device_set (aml_object_t *object)
 Set a object as a device or bus.
 
uint64_t aml_event_set (aml_object_t *object)
 Set a object as an event.
 
uint64_t aml_field_unit_field_set (aml_object_t *object, aml_opregion_t *opregion, aml_field_flags_t flags, aml_bit_size_t bitOffset, aml_bit_size_t bitSize)
 Set a object as a field unit of type Field.
 
uint64_t aml_field_unit_index_field_set (aml_object_t *object, aml_field_unit_t *index, aml_field_unit_t *data, aml_field_flags_t flags, aml_bit_size_t bitOffset, aml_bit_size_t bitSize)
 Set a object as a field unit of type IndexField.
 
uint64_t aml_field_unit_bank_field_set (aml_object_t *object, aml_opregion_t *opregion, aml_field_unit_t *bank, uint64_t bankValue, aml_field_flags_t flags, aml_bit_size_t bitOffset, aml_bit_size_t bitSize)
 Set a object as a field unit of type BankField.
 
uint64_t aml_integer_set (aml_object_t *object, aml_uint_t value)
 Set a object as an integer with the given value and bit width.
 
uint64_t aml_method_set (aml_object_t *object, aml_method_flags_t flags, const uint8_t *start, const uint8_t *end, aml_method_implementation_t implementation)
 Set a object as a method with the given flags and address range.
 
aml_method_taml_method_find (const uint8_t *addr)
 Find the method which contains the provided address in its AML bytecode range.
 
uint64_t aml_mutex_set (aml_object_t *object, aml_sync_level_t syncLevel)
 Set a object as a mutex with the given synchronization level.
 
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_operation_region_set (aml_object_t *object, aml_region_space_t space, uintptr_t offset, uint32_t length)
 Set a object as an operation region with the given space, offset, and length.
 
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_power_resource_set (aml_object_t *object, aml_system_level_t systemLevel, aml_resource_order_t resourceOrder)
 Set a object as a power resource with the given system level and resource order.
 
uint64_t aml_processor_set (aml_object_t *object, aml_proc_id_t procId, aml_pblk_addr_t pblkAddr, aml_pblk_len_t pblkLen)
 Set a object as a processor with the given ProcID, PblkAddr, and PblkLen.
 
uint64_t aml_string_set_empty (aml_object_t *object, uint64_t length)
 Set a object as an empty string with the given length.
 
uint64_t aml_string_set (aml_object_t *object, const char *str)
 Set a object as a string with the given value.
 
uint64_t aml_string_resize (aml_string_t *string, uint64_t newLength)
 Resize a string object to the new length.
 
uint64_t aml_thermal_zone_set (aml_object_t *object)
 Set a object as a thermal zone.
 
uint64_t aml_alias_set (aml_object_t *object, aml_object_t *target)
 Set a object as an alias to the given target object.
 
aml_object_taml_alias_traverse (aml_alias_t *alias)
 Traverse an alias object to get the target object.
 
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.
 
uint64_t aml_predefined_scope_set (aml_object_t *object)
 Set a object as a predefined scope with the given name.
 
uint64_t aml_arg_set (aml_object_t *object, aml_object_t *value)
 Set a object as an argument with the given target object.
 
uint64_t aml_local_set (aml_object_t *object)
 Set a object as a empty local variable.
 

Macro Definition Documentation

◆ AML_SMALL_BUFFER_SIZE

#define AML_SMALL_BUFFER_SIZE   32

Size of buffers used for small objects optimization.

Definition at line 32 of file object.h.

◆ AML_SMALL_STRING_SIZE

#define AML_SMALL_STRING_SIZE   AML_SMALL_BUFFER_SIZE

Size of string buffers used for small objects optimization, not including the null terminator.

Definition at line 37 of file object.h.

◆ AML_SMALL_PACKAGE_SIZE

#define AML_SMALL_PACKAGE_SIZE   4

Size of package element arrays used for small objects optimization.

Definition at line 42 of file object.h.

◆ AML_OBJECT_CACHE_SIZE

#define AML_OBJECT_CACHE_SIZE   64

Amount of objects to store in the cache before freeing them instead.

Definition at line 47 of file object.h.

◆ AML_OBJECT_ID_NONE

#define AML_OBJECT_ID_NONE   0

Value for an invalid object id.

Definition at line 153 of file object.h.

◆ AML_OBJECT_COMMON_HEADER

#define AML_OBJECT_COMMON_HEADER
Value:
ref_t ref; \
aml_name_t name; \
map_entry_t mapEntry; \
list_entry_t listEntry; \
aml_overlay_t* overlay; \
list_t children; \
list_entry_t siblingsEntry; \
aml_object_t* parent; \
aml_type_t type; \
dentry_t* dir
static char * id
Definition dwm.c:20
uint32_t aml_name_t
Name type.
Definition namespace.h:101
aml_type_t
ACPI data types.
Definition object.h:59
aml_object_flags_t
Flags for ACPI objects.
Definition object.h:125
uint64_t aml_object_id_t
Object id type.
Definition object.h:148
static const path_flag_t flags[]
Definition path.c:42
ACPI object.
Definition object.h:447
Namespace overlay.
Definition namespace.h:87
Directory entry structure.
Definition dentry.h:80
A entry in a doubly linked list.
Definition list.h:34
A doubly linked list.
Definition list.h:47
Map entry structure.
Definition map.h:68
Reference counting structure.
Definition ref.h:30

Common header for all AML objects.

Members:

  • ref Reference count for the object.
  • id The unique id of the object.
  • name The name of the object.
  • mapEntry Entry for the namespace map member.
  • listEntry Entry for the namespace objects member or the object cache list.
  • overlay The overlay this object is part of, NULL if part of the global namespace or unanamed.
  • children List of children, children hold references to the parent, parent does not hold references to children.
  • siblingsEntry Entry for the parent's children member.
  • parent Pointer to the parent object, NULL if root or unnamed.
  • flags Flags for the object, see aml_object_flags_t for more details.
  • type The type of the object, see aml_type_t for more details.
  • dir Sysfs directory for the object, only valid if flags has AML_OBJECT_EXPOSED_IN_SYSFS set.

Definition at line 194 of file object.h.

Typedef Documentation

◆ aml_object_id_t

Object id type.

Used in a namespace in combination with a childs name to generate a hash to locate the child in the namespace.

Definition at line 148 of file object.h.

◆ aml_method_implementation_t

aml_method_implementation_t

Method Implementation function type.

Definition at line 175 of file object.h.

Enumeration Type Documentation

◆ aml_type_t

enum aml_type_t

ACPI data types.

Note that objects can obviously only have one type but we use bitflags here to make it easier to define groups of types.

See also
Section 19.3.5 table 19.5 of the ACPI specification for more details.
Enumerator
AML_UNINITIALIZED 
AML_BUFFER 
AML_BUFFER_FIELD 
AML_DEBUG_OBJECT 
AML_DEVICE 
AML_EVENT 
AML_FIELD_UNIT 
AML_INTEGER 
AML_METHOD 

The spec does defined a separate Integer Constant type, but the spec seems very inconsistent about how to actually use it or even what it is. In 19.3.5 its "Created by the ASL terms 'Zero', 'One', 'Ones', and 'Revision'.". But in 19.6.102 the package creation example referes to a normal number "0x3400" as an Integer Constant. And there are also unanswered questions about what happens if a named object is created as an Integer Constant. The ACPICA tests seem to just treat even the result of 'Zero/One/Ones' as a normal Integer. I could go on. So unless ive missed something obvious, we just pretend it doesn't exist and treat it as a normal Integer.

AML_MUTEX 
AML_OBJECT_REFERENCE 
AML_OPERATION_REGION 
AML_PACKAGE 
AML_POWER_RESOURCE 
AML_PROCESSOR 
AML_RAW_DATA_BUFFER 
AML_STRING 
AML_THERMAL_ZONE 
AML_ALIAS 

Not in the spec, used internally to represent Aliases.

AML_UNRESOLVED 

Not in the spec, used internally to represent unresolved references.

AML_PREDEFINED_SCOPE 

Not in the spec, used internally to represent _SB, _GPE, etc.

AML_ARG 

Not in the spec, used internally to represent method arguments.

AML_LOCAL 

Not in the spec, used internally to represent method local variables.

AML_COMPUTATIONAL_DATA_OBJECTS 

All data types that can be retrieved from a ComputationalData object (section 20.2.3).

AML_DATA_OBJECTS 

All data types that can be retrieved from a DataObject (section 20.2.3).

You could also define it as static data, as in not stored in some firmware register or similar.

AML_DATA_REF_OBJECTS 

All data types that can be retrived from a DataRefObject (section 20.2.3).

AML_NAMESPACES 

All data types that can contain named objects, packages contain unnamed objects only and are excluded.

AML_ALL_TYPES 

All data types.

AML_TYPE_AMOUNT 

Not a type, just the amount of types.

Definition at line 58 of file object.h.

◆ aml_object_flags_t

Flags for ACPI objects.

Enumerator
AML_OBJECT_NONE 

No flags.

AML_OBJECT_ROOT 

Is the root object.

AML_OBJECT_NAMED 

Appears in the namespace tree. Will be set in aml_object_add().

AML_OBJECT_EXCEPTION_ON_USE 

The first time this object is used an exception will be raised. This is used such that when a method fails to implicitly or explicitly return a value the "synthetic" return value will raise an exception when used.

Any copy of an object with this flag will also have this flag set.

AML_OBJECT_EXPOSED_IN_SYSFS 

The object is exposed in sysfs. Will be set in aml_namespace_expose().

Definition at line 124 of file object.h.

◆ aml_field_unit_type_t

Field Unit types.

Since the ACPI spec does not differentiate between "objects" of type Field, IndexField and BankField, instead just calling them all FieldUnits, we use this enum to differentiate between different FieldUnit types, even if it might be cleaner to use aml_type_t for this.

Enumerator
AML_FIELD_UNIT_NONE 
AML_FIELD_UNIT_FIELD 
AML_FIELD_UNIT_INDEX_FIELD 
AML_FIELD_UNIT_BANK_FIELD 

Definition at line 163 of file object.h.

Function Documentation

◆ aml_object_get_total_count()

uint64_t aml_object_get_total_count ( void  )

Get the total amount of allocated ACPI objects.

Returns
The total amount of allocated ACPI objects.

Definition at line 23 of file object.c.

◆ aml_object_new()

aml_object_t * aml_object_new ( void  )

Allocate a new ACPI object.

There is no aml_object_free() instead always use DEREF() to free an object, since objects are reference counted.

You could also use DEREF_DEFER() to dereference the object when the current scope ends.

Returns
On success, a pointer to the new object. On failure, NULL and errno is set.

Definition at line 62 of file object.c.

Here is the call graph for this function:

◆ aml_object_clear()

void aml_object_clear ( aml_object_t object)

Clear the data of a object, setting its type to AML_UNINITIALIZED.

Parameters
objectPointer to the object to clear.

Definition at line 96 of file object.c.

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

◆ aml_object_count_children()

uint64_t aml_object_count_children ( aml_object_t parent)

Recursively count how many children an object has.

This will also count package elements, any cached byteFields, etc. All objects that are owned by the parent object will be counted.

Parameters
parentPointer to the parent object.
Returns
The total amount of children the object has.

Definition at line 277 of file object.c.

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

◆ aml_object_set_bits_at()

uint64_t aml_object_set_bits_at ( aml_object_t object,
aml_bit_size_t  bitOffset,
aml_bit_size_t  bitSize,
uint8_t in 
)

Store bits into a object at the specified bit offset and size.

Only supports Integers, Strings and Buffers.

If a out of bounds access is attempted, the bits that are out of bounds will be ignored.

All objects, Intergers, Strings and Buffers are writen to as if they were little-endian Integers.

Parameters
objectPointer to the object to store bits into.
bitOffsetThe bit offset within the object's data to start storing to.
bitSizeThe number of bits to store, in must be large enough to hold this many bits.
inPointer to a buffer containing the bits to store.
Returns
On success, 0. On failure, ERR and errno is set.

Definition at line 351 of file object.c.

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

◆ aml_object_get_bits_at()

uint64_t aml_object_get_bits_at ( aml_object_t object,
aml_bit_size_t  bitOffset,
aml_bit_size_t  bitSize,
uint8_t out 
)

Retrieve bits from a object at the specified bit offset and size.

Only supports Integers, Strings and Buffers.

If a out of bounds access is attempted, the bits that are out of bounds will be read as zero.

All objects, Intergers, Strings and Buffers are read from as if they were little-endian Integers.

Parameters
objectPointer to the object to extract bits from.
bitOffsetThe bit offset within the object's data to start extracting from.
bitSizeThe number of bits to store, out must be large enough to hold this many bits.
outPointer to a buffer where the extracted bits will be stored.
Returns
On success, 0. On failure, ERR and errno is set.

Definition at line 412 of file object.c.

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

◆ aml_buffer_resize()

uint64_t aml_buffer_resize ( aml_buffer_t buffer,
uint64_t  newLength 
)

Resize a buffer object to the new length.

If the new length is greater than the current length, the new bytes will be zeroed.

Parameters
bufferPointer to the buffer object to resize.
newLengthThe new length of the buffer.
Returns
On success, 0. On failure, ERR and errno is set.

Definition at line 490 of file object.c.

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

◆ aml_buffer_set_empty()

uint64_t aml_buffer_set_empty ( aml_object_t object,
uint64_t  length 
)

Set a object as an empty buffer with the given length.

Parameters
objectPointer to the object to initialize.
lengthLength of the buffer will also be the capacity.
Returns
On success, 0. On failure, ERR and errno is set.

Definition at line 533 of file object.c.

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

◆ aml_buffer_set()

uint64_t aml_buffer_set ( aml_object_t object,
const uint8_t buffer,
uint64_t  bytesToCopy,
uint64_t  length 
)

Set a object as a buffer with the given content.

Parameters
objectPointer to the object to initialize.
bufferPointer to the buffer.
bytesToCopyNumber of bytes to copy from buffer to the object, the rest will be zeroed.
lengthThe total length of the buffer.
Returns
On success, 0. On failure, ERR and errno is set.

Definition at line 576 of file object.c.

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

◆ aml_buffer_field_set()

uint64_t aml_buffer_field_set ( aml_object_t object,
aml_object_t target,
aml_bit_size_t  bitOffset,
aml_bit_size_t  bitSize 
)

Set a object as a buffer field with the given buffer, bit offset and bit size.

Parameters
objectPointer to the object to initialize.
targetPointer to the object to create the buffer field from, must be AML_BUFFER or AML_STRING.
bitOffsetBit offset within the buffer.
bitSizeSize of the field in bits.
Returns
On success, 0. On failure, ERR and errno is set.

Definition at line 594 of file object.c.

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

◆ aml_debug_object_set()

uint64_t aml_debug_object_set ( aml_object_t object)

Set a object as a debug object.

Parameters
objectPointer to the object to initialize.
Returns
On success, 0. On failure, ERR and errno is set.

Definition at line 628 of file object.c.

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

◆ aml_device_set()

uint64_t aml_device_set ( aml_object_t object)

Set a object as a device or bus.

Parameters
objectPointer to the object to initialize.
Returns
On success, 0. On failure, ERR and errno is set.

Definition at line 645 of file object.c.

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

◆ aml_event_set()

uint64_t aml_event_set ( aml_object_t object)

Set a object as an event.

Parameters
objectPointer to the object to initialize.
Returns
On success, 0. On failure, ERR and errno is set.

Definition at line 663 of file object.c.

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

◆ aml_field_unit_field_set()

uint64_t aml_field_unit_field_set ( aml_object_t object,
aml_opregion_t opregion,
aml_field_flags_t  flags,
aml_bit_size_t  bitOffset,
aml_bit_size_t  bitSize 
)

Set a object as a field unit of type Field.

Parameters
objectPointer to the object to initialize.
opregionPointer to the operation region.
flagsFlags for the field unit.
bitOffsetBit offset within the operation region.
bitSizeSize of the field in bits.
Returns
On success, 0. On failure, ERR and errno is set.

Definition at line 680 of file object.c.

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

◆ aml_field_unit_index_field_set()

uint64_t aml_field_unit_index_field_set ( aml_object_t object,
aml_field_unit_t index,
aml_field_unit_t data,
aml_field_flags_t  flags,
aml_bit_size_t  bitOffset,
aml_bit_size_t  bitSize 
)

Set a object as a field unit of type IndexField.

Parameters
objectPointer to the object to initialize.
indexPointer to the index field.
dataPointer to the data field.
flagsFlags for the field unit.
bitOffsetBit offset within the operation region.
bitSizeSize of the field in bits.
Returns
On success, 0. On failure, ERR and errno is set.

Definition at line 707 of file object.c.

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

◆ aml_field_unit_bank_field_set()

uint64_t aml_field_unit_bank_field_set ( aml_object_t object,
aml_opregion_t opregion,
aml_field_unit_t bank,
uint64_t  bankValue,
aml_field_flags_t  flags,
aml_bit_size_t  bitOffset,
aml_bit_size_t  bitSize 
)

Set a object as a field unit of type BankField.

Parameters
objectPointer to the object to initialize.
opregionPointer to the operation region.
bankPointer to the bank field.
bankValueValue to write to the bank object to select the bank structure.
flagsFlags for the field unit.
bitOffsetBit offset within the operation region.
bitSizeSize of the field in bits.
Returns
On success, 0. On failure, ERR and errno is set.

Definition at line 734 of file object.c.

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

◆ aml_integer_set()

uint64_t aml_integer_set ( aml_object_t object,
aml_uint_t  value 
)

Set a object as an integer with the given value and bit width.

Parameters
objectPointer to the object to initialize.
valueThe integer value to set.
Returns
On success, 0. On failure, ERR and errno is set.

Definition at line 772 of file object.c.

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

◆ aml_method_set()

uint64_t aml_method_set ( aml_object_t object,
aml_method_flags_t  flags,
const uint8_t start,
const uint8_t end,
aml_method_implementation_t  implementation 
)

Set a object as a method with the given flags and address range.

Parameters
objectPointer to the object to initialize.
flagsFlags for the method.
startPointer to the start of the method's AML bytecode.
endPointer to the end of the method's AML bytecode.
implementationPointer to a C function that will execute the method, or NULL if the method is a normal AML method.
Returns
On success, 0. On failure, ERR and errno is set.

Definition at line 796 of file object.c.

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

◆ aml_method_find()

aml_method_t * aml_method_find ( const uint8_t addr)

Find the method which contains the provided address in its AML bytecode range.

Parameters
addrThe address to search for.
Returns
On success, a reference to the found method object. On failure, NULL and errno is set.

Definition at line 858 of file object.c.

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

◆ aml_mutex_set()

uint64_t aml_mutex_set ( aml_object_t object,
aml_sync_level_t  syncLevel 
)

Set a object as a mutex with the given synchronization level.

Parameters
objectPointer to the object to initialize.
syncLevelThe synchronization level of the mutex (0-15).
Returns
On success, 0. On failure, ERR and errno is set.

Definition at line 876 of file object.c.

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

◆ aml_object_reference_set()

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.

Parameters
objectPointer to the object to initialize.
targetPointer to the target object the ObjectReference will point to.
Returns
On success, 0. On failure, ERR and errno is set.

Definition at line 895 of file object.c.

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

◆ aml_operation_region_set()

uint64_t aml_operation_region_set ( aml_object_t object,
aml_region_space_t  space,
uintptr_t  offset,
uint32_t  length 
)

Set a object as an operation region with the given space, offset, and length.

Parameters
objectPointer to the object to initialize.
spaceThe address space of the operation region.
offsetThe offset within the address space.
lengthThe length of the operation region.
Returns
On success, 0. On failure, ERR and errno is set.

Definition at line 920 of file object.c.

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

◆ aml_package_set()

uint64_t aml_package_set ( aml_object_t object,
uint64_t  length 
)

Set a object as a package with the given number of elements.

Parameters
objectPointer to the object to initialize.
lengthNumber of elements the package will be able to hold.
Returns
On success, 0. On failure, ERR and errno is set.

Definition at line 940 of file object.c.

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

◆ aml_power_resource_set()

uint64_t aml_power_resource_set ( aml_object_t object,
aml_system_level_t  systemLevel,
aml_resource_order_t  resourceOrder 
)

Set a object as a power resource with the given system level and resource order.

Parameters
objectPointer to the object to initialize.
systemLevelThe system level of the power resource.
resourceOrderThe resource order of the power resource.
Returns
On success, 0. On failure, ERR and errno is set.

Definition at line 986 of file object.c.

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

◆ aml_processor_set()

uint64_t aml_processor_set ( aml_object_t object,
aml_proc_id_t  procId,
aml_pblk_addr_t  pblkAddr,
aml_pblk_len_t  pblkLen 
)

Set a object as a processor with the given ProcID, PblkAddr, and PblkLen.

Parameters
objectPointer to the object to initialize.
procIdThe processor ID.
pblkAddrThe pblk address.
pblkLenThe length of the pblk.
Returns
On success, 0. On failure, ERR and errno is set.

Definition at line 1006 of file object.c.

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

◆ aml_string_set_empty()

uint64_t aml_string_set_empty ( aml_object_t object,
uint64_t  length 
)

Set a object as an empty string with the given length.

The string will be initalized with zero chars and be null terminated.

Parameters
objectPointer to the object to initialize.
lengthLength of the string, not including the null terminator.
Returns
On success, 0. On failure, ERR and errno is set.

Definition at line 1026 of file object.c.

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

◆ aml_string_set()

uint64_t aml_string_set ( aml_object_t object,
const char *  str 
)

Set a object as a string with the given value.

Parameters
objectPointer to the object to initialize.
strPointer to the string.
Returns
On success, 0. On failure, ERR and errno is set.

Definition at line 1068 of file object.c.

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

◆ aml_string_resize()

uint64_t aml_string_resize ( aml_string_t string,
uint64_t  newLength 
)

Resize a string object to the new length.

If the new length is greater than the current length, the new bytes will be initialized to zero.

Parameters
stringPointer to the string object to resize.
newLengthThe new length of the string, not including the null terminator.
Returns
On success, the new length of the string. On failure, ERR and errno is set.

Definition at line 1085 of file object.c.

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

◆ aml_thermal_zone_set()

uint64_t aml_thermal_zone_set ( aml_object_t object)

Set a object as a thermal zone.

Parameters
objectPointer to the object to initialize.
Returns
On success, 0. On failure, ERR and errno is set.

Definition at line 1136 of file object.c.

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

◆ aml_alias_set()

uint64_t aml_alias_set ( aml_object_t object,
aml_object_t target 
)

Set a object as an alias to the given target object.

This is used to implement the DefAlias structure.

Parameters
objectPointer to the object to initialize.
targetPointer to the target object the alias will point to.
Returns
On success, 0. On failure, ERR and errno is set.

Definition at line 1153 of file object.c.

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

◆ aml_alias_traverse()

aml_object_t * aml_alias_traverse ( aml_alias_t alias)

Traverse an alias object to get the target object.

If the target is also an alias, it will be traversed recursively until a non-alias object is found.

Parameters
aliasPointer to the alias object to traverse.
Returns
On success, a reference to the target object. On failure, NULL and errno is set.

Definition at line 1171 of file object.c.

Here is the caller graph for this function:

◆ aml_unresolved_set()

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.

The object will be resolved later by calling aml_patch_up_resolve_all().

Parameters
objectPointer to the object to initialize.
nameStringPointer to the namestring representing the path to the target object.
fromPointer to the object to start the search from, can be NULL to start from the root.
callbackPointer to a callback function that will be called when a matching object is found
Returns
On success, 0. On failure, ERR and errno is set.

Definition at line 1192 of file object.c.

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

◆ aml_predefined_scope_set()

uint64_t aml_predefined_scope_set ( aml_object_t object)

Set a object as a predefined scope with the given name.

This is used to implement predefined scopes like _SB, _GPE, etc.

Parameters
objectPointer to the object to initialize.
Returns
On success, 0. On failure, ERR and errno is set.

Definition at line 1219 of file object.c.

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

◆ aml_arg_set()

uint64_t aml_arg_set ( aml_object_t object,
aml_object_t value 
)

Set a object as an argument with the given target object.

Parameters
objectPointer to the object to initialize.
valuePointer to the object the argument will point to, can be NULL.
Returns
On success, 0. On failure, ERR and errno is set.

Definition at line 1236 of file object.c.

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

◆ aml_local_set()

uint64_t aml_local_set ( aml_object_t object)

Set a object as a empty local variable.

Parameters
objectPointer to the object to initialize.
Returns
On success, 0. On failure, ERR and errno is set.

Definition at line 1261 of file object.c.

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