|
PatchworkOS
|
Name Objects Encoding. More...
Data Structures | |
| struct | aml_prefix_path_t |
| A PrefixPath structure. More... | |
| struct | aml_root_char_t |
| A RootChar structure. More... | |
| struct | aml_name_path_t |
| Represents the NamePath, DualNamePath, MultiNamePath and NullPath structures. More... | |
| struct | aml_name_string_t |
| A NameString structure. More... | |
| struct | aml_field_flags_t |
| FieldFlags structure. More... | |
| struct | aml_field_list_ctx_t |
Context passed to lower functions by aml_field_list_read(). More... | |
| struct | aml_method_flags_t |
| MethodFlags structure. More... | |
| struct | aml_name_seg_t |
| A NameSeg strcture. More... | |
Macros | |
| #define | AML_IS_LEAD_NAME_CHAR(token) (((token)->num >= AML_NAME_CHAR_A && (token)->num <= AML_NAME_CHAR_Z) || (token)->num == AML_NAME_CHAR) |
| Check if a token is a LeadNameChar structure. | |
| #define | AML_IS_DIGIT_CHAR(token) (((token)->num >= AML_DIGIT_CHAR_0 && (token)->num <= AML_DIGIT_CHAR_9)) |
| Check if a token is a DigitChar structure. | |
| #define | AML_IS_NAME_CHAR(token) (AML_IS_DIGIT_CHAR(token) || AML_IS_LEAD_NAME_CHAR(token)) |
| Check if a token is a NameChar structure. | |
Typedefs | |
| typedef uint32_t | aml_name_seg_t |
| typedef uint8_t | aml_sync_level_t |
| typedef uint8_t | aml_proc_id_t |
| ProcID structure, deprecated in version 6.4 of the ACPI specification. | |
| typedef uint32_t | aml_pblk_addr_t |
| PblkAddr structure, deprecated in version 6.4 of the ACPI specification. | |
| typedef uint8_t | aml_pblk_len_t |
| PblkLen structure, deprecated in version 6.4 of the ACPI specification. | |
| typedef uint8_t | aml_system_level_t |
| SystemLevel structure. | |
| typedef uint16_t | aml_resource_order_t |
| ResourceOrder structure. | |
Functions | |
| uint64_t | aml_seg_count_read (aml_term_list_ctx_t *ctx, uint8_t *out) |
| Reads the next data as a SegCount structure from the AML bytecode stream. | |
| uint64_t | aml_name_seg_read (aml_term_list_ctx_t *ctx, aml_name_seg_t **out) |
| Reads the next data as a NameSeg from the AML bytecode stream. | |
| uint64_t | aml_dual_name_path_read (aml_term_list_ctx_t *ctx, aml_name_seg_t **out) |
| Reads the next data as a DualNamePath structure from the AML bytecode stream. | |
| uint64_t | aml_multi_name_path_read (aml_term_list_ctx_t *ctx, aml_name_seg_t **outSegments, uint64_t *outSegCount) |
| Reads the next data as a MultiNamePath structure from the AML bytecode stream. | |
| uint64_t | aml_null_name_read (aml_term_list_ctx_t *ctx) |
| uint64_t | aml_name_path_read (aml_term_list_ctx_t *ctx, aml_name_path_t *out) |
| Reads the next data as a NamePath structure from the AML bytecode stream. | |
| uint64_t | aml_prefix_path_read (aml_term_list_ctx_t *ctx, aml_prefix_path_t *out) |
| Reads the next data as a PrefixPath structure from the AML bytecode stream. | |
| uint64_t | aml_root_char_read (aml_term_list_ctx_t *ctx, aml_root_char_t *out) |
| Reads the next data as a RootChar from the AML bytecode stream. | |
| uint64_t | aml_name_string_read (aml_term_list_ctx_t *ctx, aml_name_string_t *out) |
| Reads the next data as a NameString structure from the AML bytecode stream. | |
| aml_object_t * | aml_name_string_read_and_resolve (aml_term_list_ctx_t *ctx) |
| Reads the next data as a NameString structure from the AML bytecode stream and resolves it to a object. | |
| aml_object_t * | aml_simple_name_read_and_resolve (aml_term_list_ctx_t *ctx) |
| Reads a SimpleName structure from the AML byte stream and resolves it to a object. | |
| aml_object_t * | aml_super_name_read_and_resolve (aml_term_list_ctx_t *ctx) |
| Reads a SuperName structure from the AML byte stream and resolves it to a object. | |
| uint64_t | aml_target_read_and_resolve (aml_term_list_ctx_t *ctx, aml_object_t **out) |
| Reads a Target structure from the AML byte stream and resolves it to a object. | |
| uint64_t | aml_bank_value_read (aml_term_list_ctx_t *ctx, aml_integer_t *out) |
| Reads a BankValue structure from the AML byte stream. | |
| uint64_t | aml_region_space_read (aml_term_list_ctx_t *ctx, aml_region_space_t *out) |
| Reads a RegionSpace structure from the AML byte stream. | |
| uint64_t | aml_region_offset_read (aml_term_list_ctx_t *ctx, aml_integer_t *out) |
| Reads a RegionOffset structure from the AML byte stream. | |
| uint64_t | aml_region_len_read (aml_term_list_ctx_t *ctx, aml_integer_t *out) |
| Reads a RegionLen structure from the AML byte stream. | |
| uint64_t | aml_def_opregion_read (aml_term_list_ctx_t *ctx) |
| Reads a DefOpRegion structure from the AML byte stream. | |
| uint64_t | aml_field_flags_read (aml_term_list_ctx_t *ctx, aml_field_flags_t *out) |
| Reads a FieldFlags structure from the AML byte stream. | |
| uint64_t | aml_name_field_read (aml_term_list_ctx_t *ctx, aml_field_list_ctx_t *fieldCtx) |
| Reads a NamedField structure from the AML byte stream. | |
| uint64_t | aml_reserved_field_read (aml_term_list_ctx_t *ctx, aml_field_list_ctx_t *fieldCtx) |
| Reads a ReservedField structure from the AML byte stream. | |
| uint64_t | aml_field_element_read (aml_term_list_ctx_t *ctx, aml_field_list_ctx_t *fieldCtx) |
| Reads a FieldElement structure from the AML byte stream. | |
| uint64_t | aml_field_list_read (aml_term_list_ctx_t *ctx, aml_field_list_ctx_t *fieldCtx, const uint8_t *end) |
| Reads a FieldList structure from the AML byte stream. | |
| uint64_t | aml_def_field_read (aml_term_list_ctx_t *ctx) |
| Reads a DefField structure from the AML byte stream. | |
| uint64_t | aml_def_index_field_read (aml_term_list_ctx_t *ctx) |
| Reads a DefIndexField structure from the AML byte stream. | |
| uint64_t | aml_def_bank_field_read (aml_term_list_ctx_t *ctx) |
| Reads a DefBankField structure from the AML byte stream. | |
| uint64_t | aml_method_flags_read (aml_term_list_ctx_t *ctx, aml_method_flags_t *out) |
| Reads a MethodFlags structure from the AML byte stream. | |
| uint64_t | aml_def_method_read (aml_term_list_ctx_t *ctx) |
| Reads a DefMethod structure from the AML byte stream. | |
| uint64_t | aml_def_device_read (aml_term_list_ctx_t *ctx) |
| Reads a DefDevice structure from the AML byte stream. | |
| uint64_t | aml_sync_flags_read (aml_term_list_ctx_t *ctx, aml_sync_level_t *out) |
| Reads a SyncFlags structure from the AML byte stream. | |
| uint64_t | aml_def_mutex_read (aml_term_list_ctx_t *ctx) |
| Reads a DefMutex structure from the AML byte stream. | |
| uint64_t | aml_proc_id_read (aml_term_list_ctx_t *ctx, aml_proc_id_t *out) |
| Reads a ProcID structure from the AML byte stream. Deprecated in ACPI 6.4 but still supported. | |
| uint64_t | aml_pblk_addr_read (aml_term_list_ctx_t *ctx, aml_pblk_addr_t *out) |
| Reads a PblkAddr structure from the AML byte stream. Deprecated in ACPI 6.4 but still supported. | |
| uint64_t | aml_pblk_len_read (aml_term_list_ctx_t *ctx, aml_pblk_len_t *out) |
| Reads a PblkLen structure from the AML byte stream. Deprecated in ACPI 6.4 but still supported. | |
| uint64_t | aml_def_processor_read (aml_term_list_ctx_t *ctx) |
| Reads a DefProcessor structure from the AML byte stream. Deprecated in ACPI 6.4 but still supported. | |
| aml_object_t * | aml_source_buff_read (aml_term_list_ctx_t *ctx) |
| Reads a SourceBuff structure from the AML byte stream. | |
| uint64_t | aml_bit_index_read (aml_term_list_ctx_t *ctx, aml_integer_t *out) |
| Reads a BitIndex structure from the AML byte stream. | |
| uint64_t | aml_byte_index_read (aml_term_list_ctx_t *ctx, aml_integer_t *out) |
| Reads a ByteIndex structure from the AML byte stream. | |
| uint64_t | aml_def_create_bit_field_read (aml_term_list_ctx_t *ctx) |
| Reads a DefCreateBitField structure from the AML byte stream. | |
| uint64_t | aml_def_create_byte_field_read (aml_term_list_ctx_t *ctx) |
| Reads a DefCreateByteField structure from the AML byte stream. | |
| uint64_t | aml_def_create_word_field_read (aml_term_list_ctx_t *ctx) |
| Reads a DefCreateWordField structure from the AML byte stream. | |
| uint64_t | aml_def_create_dword_field_read (aml_term_list_ctx_t *ctx) |
| Reads a DefCreateDWordField structure from the AML byte stream. | |
| uint64_t | aml_def_create_qword_field_read (aml_term_list_ctx_t *ctx) |
| Reads a DefCreateQWordField structure from the AML byte stream. | |
| uint64_t | aml_def_event_read (aml_term_list_ctx_t *ctx) |
| Reads a DefEvent structure from the AML byte stream. | |
| uint64_t | aml_def_thermal_zone_read (aml_term_list_ctx_t *ctx) |
| Reads a DefThermalZone structure from the AML byte stream. | |
| uint64_t | aml_system_level_read (aml_term_list_ctx_t *ctx, aml_system_level_t *out) |
| Reads a SystemLevel structure from the AML byte stream. | |
| uint64_t | aml_resource_order_read (aml_term_list_ctx_t *ctx, aml_resource_order_t *out) |
| Reads a ResourceOrder structure from the AML byte stream. | |
| uint64_t | aml_def_power_res_read (aml_term_list_ctx_t *ctx) |
| Reads a DefPowerRes structure from the AML byte stream. | |
| uint64_t | aml_num_bits_read (aml_term_list_ctx_t *ctx, aml_integer_t *out) |
| Reads a NumBits structure from the AML byte stream. | |
| uint64_t | aml_def_create_field_read (aml_term_list_ctx_t *ctx) |
| Reads a DefCreateField structure from the AML byte stream. | |
| uint64_t | aml_def_data_region_read (aml_term_list_ctx_t *ctx) |
| Reads a DefDataRegion structure from the AML byte stream. | |
| uint64_t | aml_named_obj_read (aml_term_list_ctx_t *ctx) |
| Reads a NamedObj structure from the AML byte stream. | |
Name Objects Encoding.
Named Objects Encoding.
Not to be confused with "ACPI AML Named Objects Encoding".
Not to be confused with "ACPI AML Name Objects Encoding".
| #define AML_IS_DIGIT_CHAR | ( | token | ) | (((token)->num >= AML_DIGIT_CHAR_0 && (token)->num <= AML_DIGIT_CHAR_9)) |
| #define AML_IS_LEAD_NAME_CHAR | ( | token | ) | (((token)->num >= AML_NAME_CHAR_A && (token)->num <= AML_NAME_CHAR_Z) || (token)->num == AML_NAME_CHAR) |
| #define AML_IS_NAME_CHAR | ( | token | ) | (AML_IS_DIGIT_CHAR(token) || AML_IS_LEAD_NAME_CHAR(token)) |
| typedef uint32_t aml_name_seg_t |
| typedef uint32_t aml_pblk_addr_t |
| typedef uint8_t aml_pblk_len_t |
| typedef uint8_t aml_proc_id_t |
| typedef uint16_t aml_resource_order_t |
| typedef uint8_t aml_sync_level_t |
| typedef uint8_t aml_system_level_t |
| enum aml_access_type_t |
| enum aml_lock_rule_t |
| enum aml_region_space_t |
Region Space Encoding.
| enum aml_update_rule_t |
| uint64_t aml_bank_value_read | ( | aml_term_list_ctx_t * | ctx, |
| aml_integer_t * | out | ||
| ) |
Reads a BankValue structure from the AML byte stream.
A BankValue structure is defined as BankValue := TermArg => Integer.
| ctx | The context of the TermList that this structure is part of. |
| out | The output buffer to store the bank value. |
0. On failure, ERR and errno is set. Definition at line 15 of file named.c.
References AML_DEBUG_ERROR, aml_term_arg_read_integer(), and ERR.
Referenced by aml_def_bank_field_read().
| uint64_t aml_bit_index_read | ( | aml_term_list_ctx_t * | ctx, |
| aml_integer_t * | out | ||
| ) |
Reads a BitIndex structure from the AML byte stream.
A BitIndex structure is defined as BitIndex := TermArg => Integer.
| ctx | The context of the TermList that this structure is part of. |
| out | The destination buffer to store the BitIndex. |
0. On failure, ERR and errno is set. Definition at line 815 of file named.c.
References AML_DEBUG_ERROR, aml_term_arg_read_integer(), and ERR.
Referenced by aml_def_create_bit_field_read(), and aml_def_create_field_read().
| uint64_t aml_byte_index_read | ( | aml_term_list_ctx_t * | ctx, |
| aml_integer_t * | out | ||
| ) |
Reads a ByteIndex structure from the AML byte stream.
A ByteIndex structure is defined as ByteIndex := TermArg => Integer.
| ctx | The context of the TermList that this structure is part of. |
| out | The destination buffer to store the ByteIndex. |
0. On failure, ERR and errno is set. Definition at line 826 of file named.c.
References AML_DEBUG_ERROR, aml_term_arg_read_integer(), and ERR.
Referenced by aml_def_create_field_read_helper().
| uint64_t aml_def_bank_field_read | ( | aml_term_list_ctx_t * | ctx | ) |
Reads a DefBankField structure from the AML byte stream.
The DefBankField structure is defined as DefBankField := BankFieldOp PkgLength NameString NameString BankValue FieldFlags FieldList.
BankFields can be even more confusing then IndexFields. A BankField allows for the same opregion to be accessed using different field configurations, by switching between different banks. Each BankField as an ID, the BankValue, and you have some object, pointed to by the second NameString, such that when you read from a BankField, the BankValue is first written to the object to select the bank structure associated with that BankField.
Basically you can change the structure of an opregion by selecting different banks.
| ctx | The context of the TermList that this structure is part of. |
0. On failure, ERR and errno is set. Definition at line 451 of file named.c.
References AML_BANK_FIELD_OP, aml_bank_value_read(), AML_DEBUG_ERROR, aml_field_flags_read(), aml_field_list_read(), AML_FIELD_LIST_TYPE_BANK_FIELD, aml_name_string_read_and_resolve(), aml_pkg_length_read(), aml_token_expect(), aml_field_unit_obj_t::bank, aml_field_unit_obj_t::bankValue, aml_term_list_ctx_t::current, DEREF_DEFER, ERR, aml_object_t::fieldUnit, NULL, aml_object_t::opregion, start(), and aml_field_list_ctx_t::type.
Referenced by aml_named_obj_read().
| uint64_t aml_def_create_bit_field_read | ( | aml_term_list_ctx_t * | ctx | ) |
Reads a DefCreateBitField structure from the AML byte stream.
The DefCreateBitField structure is defined as DefCreateBitField := CreateBitFieldOp SourceBuff BitIndex NameString.
A CreateBitField operation creates a field, with the name stored in the NameString, that accesses the single bit with the index BitIndex within the SourceBuff.
So if BitIndex is 6 and SourceBuff is a buffer with the value 0b10101010, then reading the created bit field will return 1, and writing 0 to it will change SourceBuff to 0b10101000.
The other CreateXField operations work similarly, but for different sizes of fields and use byte indices instead of bit indices.
| ctx | The context of the TermList that this structure is part of. |
0. On failure, ERR and errno is set. Definition at line 837 of file named.c.
References aml_bit_index_read(), AML_BUFFER, aml_buffer_field_set(), AML_CREATE_BIT_FIELD_OP, AML_DEBUG_ERROR, aml_name_string_read(), aml_name_string_to_string(), aml_namespace_add_by_name_string(), aml_object_new(), aml_source_buff_read(), aml_token_expect(), assert, DEREF_DEFER, ERR, NULL, aml_state_t::overlay, aml_term_list_ctx_t::scope, and aml_term_list_ctx_t::state.
Referenced by aml_named_obj_read().
| uint64_t aml_def_create_byte_field_read | ( | aml_term_list_ctx_t * | ctx | ) |
Reads a DefCreateByteField structure from the AML byte stream.
The DefCreateByteField structure is defined as DefCreateByteField := CreateByteFieldOp SourceBuff ByteIndex NameString.
A CreateByteField operation creates a field, with the name stored in the NameString, that accesses the byte (8 bits) starting at the index ByteIndex within the SourceBuff.
| ctx | The context of the TermList that this structure is part of. |
0. On failure, ERR and errno is set. Definition at line 936 of file named.c.
References AML_CREATE_BYTE_FIELD_OP, and aml_def_create_field_read_helper().
Referenced by aml_named_obj_read().
| uint64_t aml_def_create_dword_field_read | ( | aml_term_list_ctx_t * | ctx | ) |
Reads a DefCreateDWordField structure from the AML byte stream.
The DefCreateDWordField structure is defined as DefCreateDWordField := CreateDWordFieldOp SourceBuff ByteIndex NameString.
A CreateDWordField operation creates a field, with the name stored in the NameString, that accesses the double word (32 bits) starting at the index ByteIndex within the SourceBuff.
| ctx | The context of the TermList that this structure is part of. |
0. On failure, ERR and errno is set. Definition at line 946 of file named.c.
References AML_CREATE_DWORD_FIELD_OP, and aml_def_create_field_read_helper().
Referenced by aml_named_obj_read().
| uint64_t aml_def_create_field_read | ( | aml_term_list_ctx_t * | ctx | ) |
Reads a DefCreateField structure from the AML byte stream.
The DefCreateField structure is defined as DefDataRegion := CreateFieldOp SourceBuff BitIndex NumBits NameString.
| ctx | The context of the TermList that this structure is part of. |
0. On failure, ERR and errno is set.The DefCreateField structure is defined as DefCreateField := CreateFieldOp SourceBuff BitIndex FieldFlags NameString.
A CreateField operation creates a field, with the name stored in the NameString, that accesses a field of arbitrary size and alignment within the SourceBuff, starting at the bit index BitIndex, and with the access properties defined by FieldFlags.
| ctx | The context of the TermList that this structure is part of. |
0. On failure, ERR and errno is set. Definition at line 1133 of file named.c.
References aml_bit_index_read(), AML_BUFFER, aml_buffer_field_set(), AML_CREATE_FIELD_OP, AML_DEBUG_ERROR, aml_name_string_read(), aml_name_string_to_string(), aml_namespace_add_by_name_string(), aml_num_bits_read(), aml_object_new(), aml_source_buff_read(), aml_token_expect(), assert, DEREF_DEFER, ERR, NULL, aml_state_t::overlay, aml_term_list_ctx_t::scope, and aml_term_list_ctx_t::state.
Referenced by aml_named_obj_read().
| uint64_t aml_def_create_qword_field_read | ( | aml_term_list_ctx_t * | ctx | ) |
Reads a DefCreateQWordField structure from the AML byte stream.
The DefCreateQWordField structure is defined as DefCreateQWordField := CreateQWordFieldOp SourceBuff ByteIndex NameString.
A CreateQWordField operation creates a field, with the name stored in the NameString, that accesses the quad word (64 bits) starting at the index ByteIndex within the SourceBuff.
| ctx | The context of the TermList that this structure is part of. |
0. On failure, ERR and errno is set. Definition at line 951 of file named.c.
References AML_CREATE_QWORD_FIELD_OP, and aml_def_create_field_read_helper().
Referenced by aml_named_obj_read().
| uint64_t aml_def_create_word_field_read | ( | aml_term_list_ctx_t * | ctx | ) |
Reads a DefCreateWordField structure from the AML byte stream.
The DefCreateWordField structure is defined as DefCreateWordField := CreateWordFieldOp SourceBuff ByteIndex NameString.
A CreateWordField operation creates a field, with the name stored in the NameString, that accesses the word (16 bits) starting at the index ByteIndex within the SourceBuff.
| ctx | The context of the TermList that this structure is part of. |
0. On failure, ERR and errno is set. Definition at line 941 of file named.c.
References AML_CREATE_WORD_FIELD_OP, and aml_def_create_field_read_helper().
Referenced by aml_named_obj_read().
| uint64_t aml_def_data_region_read | ( | aml_term_list_ctx_t * | ctx | ) |
Reads a DefDataRegion structure from the AML byte stream.
The DefDataRegion structure is defined as DefDataRegion := DataRegionOp NameString TermArg TermArg TermArg.
Despite the name the DefDataRegion structure is used to implement the DataTableRegion ASL operation.
All it does is that it allows a System Descriptor Table to be accessed as an opregion.
| ctx | The context of the TermList that this structure is part of. |
0. On failure, ERR and errno is set. Definition at line 1189 of file named.c.
References acpi_tables_lookup(), AML_DATA_REGION_OP, AML_DEBUG_ERROR, aml_name_string_read(), aml_name_string_to_string(), aml_namespace_add_by_name_string(), aml_object_new(), aml_operation_region_set(), AML_REGION_SYSTEM_MEMORY, aml_term_arg_read_string(), aml_token_expect(), aml_string_obj_t::content, DEREF_DEFER, EILSEQ, ENOENT, ERR, errno, sdt_header_t::length, aml_string_obj_t::length, NULL, sdt_header_t::oemId, sdt_header_t::oemTableId, aml_state_t::overlay, aml_term_list_ctx_t::scope, SDT_OEM_ID_LENGTH, SDT_OEM_TABLE_ID_LENGTH, SDT_SIGNATURE_LENGTH, aml_term_list_ctx_t::state, and strncmp().
Referenced by aml_named_obj_read().
| uint64_t aml_def_device_read | ( | aml_term_list_ctx_t * | ctx | ) |
Reads a DefDevice structure from the AML byte stream.
The DefDevice structure is defined as DefDevice := DeviceOp PkgLength NameString TermList.
| ctx | The context of the TermList that this structure is part of. |
0. On failure, ERR and errno is set. Definition at line 593 of file named.c.
References AML_DEBUG_ERROR, AML_DEVICE_OP, aml_device_set(), aml_name_string_read(), aml_name_string_to_string(), aml_namespace_add_by_name_string(), aml_object_new(), aml_pkg_length_read(), aml_term_list_read(), aml_token_expect(), aml_term_list_ctx_t::current, DEREF_DEFER, ERR, NULL, aml_state_t::overlay, aml_term_list_ctx_t::scope, start(), and aml_term_list_ctx_t::state.
Referenced by aml_named_obj_read().
| uint64_t aml_def_event_read | ( | aml_term_list_ctx_t * | ctx | ) |
Reads a DefEvent structure from the AML byte stream.
The DefEvent structure is defined as DefEvent := EventOp NameString.
| ctx | The context of the TermList that this structure is part of. |
0. On failure, ERR and errno is set. Definition at line 956 of file named.c.
References AML_DEBUG_ERROR, AML_EVENT_OP, aml_event_set(), aml_name_string_read(), aml_name_string_to_string(), aml_namespace_add_by_name_string(), aml_object_new(), aml_token_expect(), DEREF_DEFER, ERR, NULL, aml_state_t::overlay, aml_term_list_ctx_t::scope, and aml_term_list_ctx_t::state.
Referenced by aml_named_obj_read().
| uint64_t aml_def_field_read | ( | aml_term_list_ctx_t * | ctx | ) |
Reads a DefField structure from the AML byte stream.
The DefField structure is defined as DefField := FieldOp PkgLength NameString FieldFlags FieldList.
| ctx | The context of the TermList that this structure is part of. |
0. On failure, ERR and errno is set. Definition at line 323 of file named.c.
References AML_DEBUG_ERROR, aml_field_flags_read(), aml_field_list_read(), AML_FIELD_LIST_TYPE_FIELD, AML_FIELD_OP, aml_name_string_read_and_resolve(), AML_OPERATION_REGION, aml_pkg_length_read(), aml_token_expect(), aml_term_list_ctx_t::current, DEREF_DEFER, EILSEQ, ERR, errno, NULL, aml_object_t::opregion, start(), and aml_field_list_ctx_t::type.
Referenced by aml_named_obj_read().
| uint64_t aml_def_index_field_read | ( | aml_term_list_ctx_t * | ctx | ) |
Reads a DefIndexField structure from the AML byte stream.
The DefIndexField structure is defined as DefIndexField := IndexFieldOp PkgLength NameString NameString FieldFlags FieldList.
IndexFields can be a bit confusing, but the basic idea is that you have two fields, one for the index and one for the data. The index field in this case can be thought of as a "selector", and the data field is where we find the actual data we "selected". For example, to perform a read, we first write an index to the index field, and then read the data from the data field. The index is typically an offset into an array or table, and the data is the value at that offset.
| ctx | The context of the TermList that this structure is part of. |
0. On failure, ERR and errno is set. Definition at line 380 of file named.c.
References AML_DEBUG_ERROR, aml_field_flags_read(), aml_field_list_read(), AML_FIELD_LIST_TYPE_INDEX_FIELD, AML_FIELD_UNIT, AML_INDEX_FIELD_OP, aml_name_string_read_and_resolve(), aml_pkg_length_read(), aml_token_expect(), aml_term_list_ctx_t::current, aml_field_unit_obj_t::data, data, DEREF_DEFER, EILSEQ, ERR, errno, aml_object_t::fieldUnit, aml_field_unit_obj_t::index, NULL, start(), and aml_field_list_ctx_t::type.
Referenced by aml_named_obj_read().
| uint64_t aml_def_method_read | ( | aml_term_list_ctx_t * | ctx | ) |
Reads a DefMethod structure from the AML byte stream.
The DefField structure is defined as DefMethod := MethodOp PkgLength NameString MethodFlags TermList.
| ctx | The context of the TermList that this structure is part of. |
0. On failure, ERR and errno is set. Definition at line 540 of file named.c.
References AML_DEBUG_ERROR, aml_method_flags_read(), AML_METHOD_OP, aml_method_set(), aml_name_string_read(), aml_name_string_to_string(), aml_namespace_add_by_name_string(), aml_object_new(), aml_pkg_length_read(), aml_token_expect(), aml_term_list_ctx_t::current, DEREF_DEFER, ERR, NULL, aml_state_t::overlay, aml_term_list_ctx_t::scope, start(), and aml_term_list_ctx_t::state.
Referenced by aml_named_obj_read().
| uint64_t aml_def_mutex_read | ( | aml_term_list_ctx_t * | ctx | ) |
Reads a DefMutex structure from the AML byte stream.
The DefMutex structure is defined as DefMutex := MutexOp NameString SyncFlags.
| ctx | The context of the TermList that this structure is part of. |
0. On failure, ERR and errno is set. Definition at line 663 of file named.c.
References AML_DEBUG_ERROR, AML_MUTEX_OP, aml_mutex_set(), aml_name_string_read(), aml_name_string_to_string(), aml_namespace_add_by_name_string(), aml_object_new(), aml_sync_flags_read(), aml_token_expect(), DEREF_DEFER, ERR, NULL, aml_state_t::overlay, aml_term_list_ctx_t::scope, and aml_term_list_ctx_t::state.
Referenced by aml_named_obj_read().
| uint64_t aml_def_opregion_read | ( | aml_term_list_ctx_t * | ctx | ) |
Reads a DefOpRegion structure from the AML byte stream.
A DefOpRegion structure is defined as DefOpRegion := OpRegionOp NameString RegionSpace RegionOffset RegionLen.
| ctx | The context of the TermList that this structure is part of. |
0. On failure, ERR and errno is set. Definition at line 68 of file named.c.
References AML_DEBUG_ERROR, aml_name_string_read(), aml_name_string_to_string(), aml_namespace_add_by_name_string(), aml_object_new(), aml_operation_region_set(), AML_OPREGION_OP, aml_region_len_read(), aml_region_offset_read(), aml_region_space_read(), aml_token_expect(), DEREF_DEFER, ERR, NULL, aml_state_t::overlay, aml_term_list_ctx_t::scope, and aml_term_list_ctx_t::state.
Referenced by aml_named_obj_read().
| uint64_t aml_def_power_res_read | ( | aml_term_list_ctx_t * | ctx | ) |
Reads a DefPowerRes structure from the AML byte stream.
The DefPowerRes structure is defined as DefPowerRes := PowerResOp PkgLength NameString SystemLevel ResourceOrder TermList.
| ctx | The context of the TermList that this structure is part of. |
0. On failure, ERR and errno is set. Definition at line 1058 of file named.c.
References AML_DEBUG_ERROR, aml_name_string_read(), aml_name_string_to_string(), aml_namespace_add_by_name_string(), aml_object_new(), aml_pkg_length_read(), AML_POWER_RES_OP, aml_power_resource_set(), aml_resource_order_read(), aml_system_level_read(), aml_term_list_read(), aml_token_expect(), aml_term_list_ctx_t::current, DEREF_DEFER, ERR, NULL, aml_state_t::overlay, aml_term_list_ctx_t::scope, start(), and aml_term_list_ctx_t::state.
Referenced by aml_named_obj_read().
| uint64_t aml_def_processor_read | ( | aml_term_list_ctx_t * | ctx | ) |
Reads a DefProcessor structure from the AML byte stream. Deprecated in ACPI 6.4 but still supported.
The DefProcessor structure is defined as DefProcessor := ProcessorOp PkgLength NameString ProcID PblkAddr PblkLen TermList.
| ctx | The context of the TermList that this structure is part of. |
0. On failure, ERR and errno is set. Definition at line 732 of file named.c.
References AML_DEBUG_ERROR, AML_DEPRECATED_PROCESSOR_OP, aml_name_string_read(), aml_name_string_to_string(), aml_namespace_add_by_name_string(), aml_object_new(), aml_pblk_addr_read(), aml_pblk_len_read(), aml_pkg_length_read(), aml_proc_id_read(), aml_processor_set(), aml_term_list_read(), aml_token_expect(), aml_term_list_ctx_t::current, DEREF_DEFER, ERR, NULL, aml_state_t::overlay, aml_term_list_ctx_t::scope, start(), and aml_term_list_ctx_t::state.
Referenced by aml_named_obj_read().
| uint64_t aml_def_thermal_zone_read | ( | aml_term_list_ctx_t * | ctx | ) |
Reads a DefThermalZone structure from the AML byte stream.
The DefThermalZone structure is defined as DefThermalZone := ThermalZoneOp PkgLength NameString TermList.
| ctx | The context of the TermList that this structure is part of. |
0. On failure, ERR and errno is set. Definition at line 988 of file named.c.
References AML_DEBUG_ERROR, aml_name_string_read(), aml_name_string_to_string(), aml_namespace_add_by_name_string(), aml_object_new(), aml_pkg_length_read(), aml_term_list_read(), AML_THERMAL_ZONE_OP, aml_thermal_zone_set(), aml_token_expect(), aml_term_list_ctx_t::current, DEREF_DEFER, ERR, NULL, aml_state_t::overlay, aml_term_list_ctx_t::scope, start(), and aml_term_list_ctx_t::state.
Referenced by aml_named_obj_read().
| uint64_t aml_dual_name_path_read | ( | aml_term_list_ctx_t * | ctx, |
| aml_name_seg_t ** | out | ||
| ) |
Reads the next data as a DualNamePath structure from the AML bytecode stream.
A DualNamePath structure is defined as DualNamePath := DualNamePrefix NameSeg NameSeg.
| ctx | The context of the TermList that this structure is part of. |
| out | Pointer to destination where the pointer to the array of two NameSeg will be stored. Will be located within the AML bytecode stream. |
0. On failure, ERR and errno is set. Definition at line 58 of file name.c.
References AML_DEBUG_ERROR, AML_DUAL_NAME_PREFIX, aml_name_seg_read(), aml_token_expect(), aml_term_list_ctx_t::current, ERR, and start().
Referenced by aml_name_path_read().
| uint64_t aml_field_element_read | ( | aml_term_list_ctx_t * | ctx, |
| aml_field_list_ctx_t * | fieldCtx | ||
| ) |
Reads a FieldElement structure from the AML byte stream.
The FieldElement structure is defined as FieldElement := NamedField | ReservedField | AccessField | ExtendedAccessField | ConnectField.
| ctx | The context of the TermList that this structure is part of. |
| fieldCtx | The AML field list context. |
0. On failure, ERR and errno is set. Definition at line 277 of file named.c.
References AML_DEBUG_ERROR, AML_IS_LEAD_NAME_CHAR, aml_name_field_read(), aml_reserved_field_read(), aml_token_peek(), ENOSYS, ERR, errno, and aml_token_t::num.
Referenced by aml_field_list_read().
| uint64_t aml_field_flags_read | ( | aml_term_list_ctx_t * | ctx, |
| aml_field_flags_t * | out | ||
| ) |
Reads a FieldFlags structure from the AML byte stream.
Clean up definition.
A FieldFlags structure is defined as FieldFlags := ByteData, where
| ctx | The context of the TermList that this structure is part of. |
| out | The buffer to store the FieldFlags structure. |
0. On failure, ERR and errno is set. Definition at line 122 of file named.c.
References aml_field_flags_t::accessType, AML_ACCESS_TYPE_BUFFER, aml_byte_data_read(), AML_DEBUG_ERROR, EILSEQ, ERR, and errno.
Referenced by aml_def_bank_field_read(), aml_def_field_read(), and aml_def_index_field_read().
| uint64_t aml_field_list_read | ( | aml_term_list_ctx_t * | ctx, |
| aml_field_list_ctx_t * | fieldCtx, | ||
| const uint8_t * | end | ||
| ) |
Reads a FieldList structure from the AML byte stream.
The FieldList structure is defined as FieldList := Nothing | <fieldelement fieldlist>.
| ctx | The context of the TermList that this structure is part of. |
| fieldCtx | The AML field list context. |
| end | The index at which the FieldList ends. |
0. On failure, ERR and errno is set. Definition at line 308 of file named.c.
References AML_DEBUG_ERROR, aml_field_element_read(), aml_term_list_ctx_t::current, and ERR.
Referenced by aml_def_bank_field_read(), aml_def_field_read(), and aml_def_index_field_read().
| uint64_t aml_method_flags_read | ( | aml_term_list_ctx_t * | ctx, |
| aml_method_flags_t * | out | ||
| ) |
Reads a MethodFlags structure from the AML byte stream.
A MethodFlags structure is defined as MethodFlags := ByteData, where
| ctx | The context of the TermList that this structure is part of. |
| out | The output buffer to store the MethodFlags structure. |
0. On failure, ERR and errno is set. Definition at line 518 of file named.c.
References aml_byte_data_read(), AML_DEBUG_ERROR, aml_method_flags_t::argCount, and ERR.
Referenced by aml_def_method_read().
| uint64_t aml_multi_name_path_read | ( | aml_term_list_ctx_t * | ctx, |
| aml_name_seg_t ** | outSegments, | ||
| uint64_t * | outSegCount | ||
| ) |
Reads the next data as a MultiNamePath structure from the AML bytecode stream.
A MultiNamePath structure is defined as MultiNamePath := MultiNamePrefix SegCount NameSeg(SegCount).
| ctx | The context of the TermList that this structure is part of. |
| outSegments | Pointer to destination where the pointer to the array of NameSeg will be stored. Will be located within the AML bytecode stream. |
| outSegCount | Pointer to destination where the number of segments will be stored. |
0. On failure, ERR and errno is set. Definition at line 80 of file name.c.
References AML_DEBUG_ERROR, AML_MULTI_NAME_PREFIX, aml_name_seg_read(), aml_seg_count_read(), aml_token_expect(), aml_term_list_ctx_t::current, ERR, and start().
Referenced by aml_name_path_read().
| uint64_t aml_name_field_read | ( | aml_term_list_ctx_t * | ctx, |
| aml_field_list_ctx_t * | fieldCtx | ||
| ) |
Reads a NamedField structure from the AML byte stream.
A NamedField structure is defined as NamedField := NameSeg PkgLength
| ctx | The context of the TermList that this structure is part of. |
| fieldCtx | The AML field list context. |
0. On failure, ERR and errno is set. Definition at line 155 of file named.c.
References AML_DEBUG_ERROR, AML_FIELD_LIST_TYPE_BANK_FIELD, AML_FIELD_LIST_TYPE_FIELD, AML_FIELD_LIST_TYPE_INDEX_FIELD, aml_field_unit_bank_field_set(), aml_field_unit_field_set(), aml_field_unit_index_field_set(), aml_name_seg_read(), AML_NAME_TO_STRING, aml_namespace_add_child(), aml_object_new(), aml_pkg_length_read(), aml_field_list_ctx_t::bank, aml_field_unit_obj_t::bank, aml_field_unit_obj_t::bankValue, aml_field_list_ctx_t::currentOffset, aml_field_unit_obj_t::data, DEREF_DEFER, EILSEQ, ERR, errno, aml_field_list_ctx_t::field, aml_field_list_ctx_t::flags, aml_field_list_ctx_t::index, aml_field_unit_obj_t::index, NULL, aml_field_list_ctx_t::opregion, aml_field_unit_obj_t::opregion, aml_state_t::overlay, aml_term_list_ctx_t::scope, aml_term_list_ctx_t::state, and aml_field_list_ctx_t::type.
Referenced by aml_field_element_read().
| uint64_t aml_name_path_read | ( | aml_term_list_ctx_t * | ctx, |
| aml_name_path_t * | out | ||
| ) |
Reads the next data as a NamePath structure from the AML bytecode stream.
A NamePath structure is defined as NamePath := NameSeg | DualNamePath | MultiNamePath | NullName.
| ctx | The context of the TermList that this structure is part of. |
| out | Pointer to destination where the NamePath will be stored. |
0. On failure, ERR and errno is set. Definition at line 124 of file name.c.
References AML_DEBUG_ERROR, aml_dual_name_path_read(), AML_DUAL_NAME_PREFIX, AML_IS_LEAD_NAME_CHAR, aml_multi_name_path_read(), AML_MULTI_NAME_PREFIX, aml_name_seg_read(), AML_NULL_NAME, aml_null_name_read(), aml_token_peek(), EILSEQ, ERR, errno, NULL, aml_token_t::num, aml_name_path_t::segmentCount, and aml_name_path_t::segments.
Referenced by aml_name_string_read().
| uint64_t aml_name_seg_read | ( | aml_term_list_ctx_t * | ctx, |
| aml_name_seg_t ** | out | ||
| ) |
Reads the next data as a NameSeg from the AML bytecode stream.
A NameSeg structure is defined as NameSeg := <leadnamechar namechar namechar namechar>.
| ctx | The context of the TermList that this structure is part of. |
| out | Pointer to the destination where the pointer to the NameSeg will be stored. Will be located within the AML bytecode stream. |
0. On failure, ERR and errno is set. Definition at line 27 of file name.c.
References AML_DEBUG_ERROR, AML_IS_LEAD_NAME_CHAR, AML_IS_NAME_CHAR, aml_token_read(), aml_term_list_ctx_t::current, EILSEQ, ERR, errno, aml_token_t::num, and start().
Referenced by aml_dual_name_path_read(), aml_multi_name_path_read(), aml_name_field_read(), and aml_name_path_read().
| uint64_t aml_name_string_read | ( | aml_term_list_ctx_t * | ctx, |
| aml_name_string_t * | out | ||
| ) |
Reads the next data as a NameString structure from the AML bytecode stream.
A NameString structure is defined as NameString := <rootchar namepath> | <prefixpath namepath>.
| ctx | The context of the TermList that this structure is part of. |
| out | Pointer to destination where the NameString will be stored. |
0. On failure, ERR and errno is set. Definition at line 189 of file name.c.
References AML_DEBUG_ERROR, aml_name_path_read(), AML_PARENT_PREFIX_CHAR, aml_prefix_path_read(), AML_ROOT_CHAR, aml_root_char_read(), aml_token_peek(), ERR, aml_name_string_t::namePath, aml_token_t::num, aml_name_string_t::prefixPath, and aml_name_string_t::rootChar.
Referenced by aml_def_alias_read(), aml_def_create_bit_field_read(), aml_def_create_field_read(), aml_def_create_field_read_helper(), aml_def_data_region_read(), aml_def_device_read(), aml_def_event_read(), aml_def_method_read(), aml_def_mutex_read(), aml_def_name_read(), aml_def_opregion_read(), aml_def_power_res_read(), aml_def_processor_read(), aml_def_thermal_zone_read(), aml_name_string_read_and_resolve(), and aml_package_element_read().
| aml_object_t * aml_name_string_read_and_resolve | ( | aml_term_list_ctx_t * | ctx | ) |
Reads the next data as a NameString structure from the AML bytecode stream and resolves it to a object.
Note that errno will only be set to ENOENT if the NameString is read correctly but fails to resolve, other values for errno might be set in other cases.
| ctx | The context of the TermList that this structure is part of. |
NULL and errno is set. Definition at line 227 of file name.c.
References AML_DEBUG_ERROR, aml_name_string_read(), aml_namespace_find_by_name_string(), AML_UNINITIALIZED, DEREF, ENOENT, ERR, errno, NULL, aml_state_t::overlay, aml_term_list_ctx_t::scope, and aml_term_list_ctx_t::state.
Referenced by aml_def_alias_read(), aml_def_bank_field_read(), aml_def_field_read(), aml_def_index_field_read(), aml_def_scope_read(), aml_method_invocation_read(), and aml_simple_name_read_and_resolve().
| uint64_t aml_named_obj_read | ( | aml_term_list_ctx_t * | ctx | ) |
Reads a NamedObj structure from the AML byte stream.
Version 6.6 of the ACPI specification has a few mistakes in the definition of the NamedObj structure, its supposed to contain several stuctures that it does not. If you check version 4.0 of the specification section 19.2.5.2 you can confirm that that these structures are supposed to be there but have, somehow, been forgotten.
The forgotten structures are:
DefFieldDefMethodDefMutexDefIndexFieldDefDeviceDefEventMaybe even more?We add all missing structures to our definition of NamedObj. I have no idea how there are this many mistakes in the latest version of the ACPI specification.
The DefProcessor structure was deprecated in version 6.4 of the ACPI specification, but we still support it.
The NamedObj structure is defined as NamedObj := DefBankField | DefCreateBitField | DefCreateByteField | DefCreateDWordField | DefCreateField | DefCreateQWordField | DefCreateWordField | DefDataRegion | DefExternal | DefOpRegion | DefPowerRes | DefThermalZone | DefField | DefMethod | DefDevice | DefMutex | DefProcessor | DefIndexField | DefEvent.
Currently unimplemented Opcodes are:
DefExternal| ctx | The context of the TermList that this structure is part of. |
0. On failure, ERR and errno is set. Definition at line 1296 of file named.c.
References AML_BANK_FIELD_OP, AML_CREATE_BIT_FIELD_OP, AML_CREATE_BYTE_FIELD_OP, AML_CREATE_DWORD_FIELD_OP, AML_CREATE_FIELD_OP, AML_CREATE_QWORD_FIELD_OP, AML_CREATE_WORD_FIELD_OP, AML_DATA_REGION_OP, AML_DEBUG_ERROR, aml_def_bank_field_read(), aml_def_create_bit_field_read(), aml_def_create_byte_field_read(), aml_def_create_dword_field_read(), aml_def_create_field_read(), aml_def_create_qword_field_read(), aml_def_create_word_field_read(), aml_def_data_region_read(), aml_def_device_read(), aml_def_event_read(), aml_def_field_read(), aml_def_index_field_read(), aml_def_method_read(), aml_def_mutex_read(), aml_def_opregion_read(), aml_def_power_res_read(), aml_def_processor_read(), aml_def_thermal_zone_read(), AML_DEPRECATED_PROCESSOR_OP, AML_DEVICE_OP, AML_EVENT_OP, AML_FIELD_OP, AML_INDEX_FIELD_OP, AML_METHOD_OP, AML_MUTEX_OP, AML_OPREGION_OP, AML_POWER_RES_OP, AML_THERMAL_ZONE_OP, aml_token_peek(), ENOSYS, ERR, errno, aml_token_props_t::name, aml_token_t::num, and aml_token_t::props.
Referenced by aml_object_read().
| uint64_t aml_null_name_read | ( | aml_term_list_ctx_t * | ctx | ) |
Reads the next data as a NullName structure from the AML bytecode stream.
A NullName structure is defined as NullName := 0x00.
| ctx | The context of the TermList that this structure is part of. |
0. On failure, ERR and errno is set. Definition at line 113 of file name.c.
References AML_DEBUG_ERROR, AML_NULL_NAME, aml_token_expect(), and ERR.
Referenced by aml_name_path_read(), and aml_target_read_and_resolve().
| uint64_t aml_num_bits_read | ( | aml_term_list_ctx_t * | ctx, |
| aml_integer_t * | out | ||
| ) |
Reads a NumBits structure from the AML byte stream.
A NumBits structure is defined as NumBits := TermArg => Integer.
| ctx | The context of the TermList that this structure is part of. |
| out | The output buffer to store the number of bits. |
0. On failure, ERR and errno is set. Definition at line 1122 of file named.c.
References AML_DEBUG_ERROR, aml_term_arg_read_integer(), and ERR.
Referenced by aml_def_create_field_read().
| uint64_t aml_pblk_addr_read | ( | aml_term_list_ctx_t * | ctx, |
| aml_pblk_addr_t * | out | ||
| ) |
Reads a PblkAddr structure from the AML byte stream. Deprecated in ACPI 6.4 but still supported.
A PblkAddr structure is defined as PblkAddr := DWordData.
| ctx | The context of the TermList that this structure is part of. |
| out | The output buffer to store the Pblk address. |
0. On failure, ERR and errno is set. Definition at line 712 of file named.c.
References AML_DEBUG_ERROR, aml_dword_data_read(), and ERR.
Referenced by aml_def_processor_read().
| uint64_t aml_pblk_len_read | ( | aml_term_list_ctx_t * | ctx, |
| aml_pblk_len_t * | out | ||
| ) |
Reads a PblkLen structure from the AML byte stream. Deprecated in ACPI 6.4 but still supported.
A PblkLen structure is defined as PblkLen := ByteData.
| ctx | The context of the TermList that this structure is part of. |
| out | The output buffer to store the Pblk length. |
0. On failure, ERR and errno is set. Definition at line 722 of file named.c.
References aml_byte_data_read(), AML_DEBUG_ERROR, and ERR.
Referenced by aml_def_processor_read().
| uint64_t aml_prefix_path_read | ( | aml_term_list_ctx_t * | ctx, |
| aml_prefix_path_t * | out | ||
| ) |
Reads the next data as a PrefixPath structure from the AML bytecode stream.
A PrefixPath structure is defined as ‘PrefixPath := Nothing | <’^' prefixpath>`.
Note that ^ is just a AML_PARENT_PREFIX_CHAR.
| ctx | The context of the TermList that this structure is part of. |
| out | Pointer to destination where the PrefixPath will be stored. |
0. On failure, ERR and errno is set. Definition at line 159 of file name.c.
References AML_PARENT_PREFIX_CHAR, aml_token_peek(), aml_term_list_ctx_t::current, aml_prefix_path_t::depth, aml_token_t::length, and aml_token_t::num.
Referenced by aml_name_string_read().
| uint64_t aml_proc_id_read | ( | aml_term_list_ctx_t * | ctx, |
| aml_proc_id_t * | out | ||
| ) |
Reads a ProcID structure from the AML byte stream. Deprecated in ACPI 6.4 but still supported.
A ProcID structure is defined as ProcID := ByteData.
| ctx | The context of the TermList that this structure is part of. |
| out | The output buffer to store the processor ID. |
0. On failure, ERR and errno is set. Definition at line 702 of file named.c.
References aml_byte_data_read(), AML_DEBUG_ERROR, and ERR.
Referenced by aml_def_processor_read().
| uint64_t aml_region_len_read | ( | aml_term_list_ctx_t * | ctx, |
| aml_integer_t * | out | ||
| ) |
Reads a RegionLen structure from the AML byte stream.
A RegionLen structure is defined as RegionLen := TermArg => Integer.
| ctx | The context of the TermList that this structure is part of. |
| out | The output buffer to store the region length. |
0. On failure, ERR and errno is set. Definition at line 57 of file named.c.
References AML_DEBUG_ERROR, aml_term_arg_read_integer(), and ERR.
Referenced by aml_def_opregion_read().
| uint64_t aml_region_offset_read | ( | aml_term_list_ctx_t * | ctx, |
| aml_integer_t * | out | ||
| ) |
Reads a RegionOffset structure from the AML byte stream.
A RegionOffset structure is defined as RegionOffset := TermArg => Integer.
| ctx | The context of the TermList that this structure is part of. |
| out | The output buffer to store the RegionOffset. |
0. On failure, ERR and errno is set. Definition at line 46 of file named.c.
References AML_DEBUG_ERROR, aml_term_arg_read_integer(), and ERR.
Referenced by aml_def_opregion_read().
| uint64_t aml_region_space_read | ( | aml_term_list_ctx_t * | ctx, |
| aml_region_space_t * | out | ||
| ) |
Reads a RegionSpace structure from the AML byte stream.
A RegionSpace structure is defined as RegionSpace := ByteData.
| ctx | The context of the TermList that this structure is part of. |
| out | The output buffer to store the region space. |
0. On failure, ERR and errno is set. Definition at line 26 of file named.c.
References aml_byte_data_read(), AML_DEBUG_ERROR, AML_REGION_OEM_MIN, AML_REGION_PCC, EILSEQ, ERR, and errno.
Referenced by aml_def_opregion_read().
| uint64_t aml_reserved_field_read | ( | aml_term_list_ctx_t * | ctx, |
| aml_field_list_ctx_t * | fieldCtx | ||
| ) |
Reads a ReservedField structure from the AML byte stream.
A ReservedField structure is defined as ReservedField := 0x00 PkgLength.
| ctx | The context of the TermList that this structure is part of. |
| fieldCtx | The AML field list context. |
0. On failure, ERR and errno is set. Definition at line 258 of file named.c.
References AML_DEBUG_ERROR, aml_pkg_length_read(), aml_token_expect(), aml_field_list_ctx_t::currentOffset, and ERR.
Referenced by aml_field_element_read().
| uint64_t aml_resource_order_read | ( | aml_term_list_ctx_t * | ctx, |
| aml_resource_order_t * | out | ||
| ) |
Reads a ResourceOrder structure from the AML byte stream.
A ResourceOrder structure is defined as ResourceOrder := WordData.
| ctx | The context of the TermList that this structure is part of. |
| out | The output buffer to store the resource order. |
0. On failure, ERR and errno is set. Definition at line 1048 of file named.c.
References AML_DEBUG_ERROR, aml_word_data_read(), and ERR.
Referenced by aml_def_power_res_read().
| uint64_t aml_root_char_read | ( | aml_term_list_ctx_t * | ctx, |
| aml_root_char_t * | out | ||
| ) |
Reads the next data as a RootChar from the AML bytecode stream.
A RootChar is defined as RootChar := 0x5C.
| ctx | The context of the TermList that this structure is part of. |
| out | Pointer to destination where the RootChar will be stored. |
0. On failure, ERR and errno is set. Definition at line 177 of file name.c.
References AML_DEBUG_ERROR, AML_ROOT_CHAR, aml_token_expect(), ERR, and aml_root_char_t::present.
Referenced by aml_name_string_read().
| uint64_t aml_seg_count_read | ( | aml_term_list_ctx_t * | ctx, |
| uint8_t * | out | ||
| ) |
Reads the next data as a SegCount structure from the AML bytecode stream.
A SegCount structure is defined as SegCount := ByteData.
| ctx | The context of the TermList that this structure is part of. |
| out | Pointer to destination where the SegCount will be stored. |
0. On failure, ERR and errno is set. Definition at line 17 of file name.c.
References aml_byte_data_read(), AML_DEBUG_ERROR, and ERR.
Referenced by aml_multi_name_path_read().
| aml_object_t * aml_simple_name_read_and_resolve | ( | aml_term_list_ctx_t * | ctx | ) |
Reads a SimpleName structure from the AML byte stream and resolves it to a object.
A SimpleName structure is defined as SimpleName := NameString | ArgObj | LocalObj.
Note that errno will only be set to ENOENT if it is a NameString that fails to resolve, other values for errno might be set in other cases.
| ctx | The context of the TermList that this structure is part of. |
NULL and errno is set. Definition at line 253 of file name.c.
References aml_arg_obj_read(), AML_DEBUG_ERROR, aml_local_obj_read(), aml_name_string_read_and_resolve(), aml_token_peek(), AML_TOKEN_TYPE_ARG, AML_TOKEN_TYPE_LOCAL, AML_TOKEN_TYPE_NAME, aml_token_type_to_string(), EILSEQ, errno, aml_token_props_t::name, NULL, aml_token_t::props, and aml_token_props_t::type.
Referenced by aml_def_object_type_read(), aml_op_termarg_simplename_read(), and aml_super_name_read_and_resolve().
| aml_object_t * aml_source_buff_read | ( | aml_term_list_ctx_t * | ctx | ) |
Reads a SourceBuff structure from the AML byte stream.
A SourceBuff structure is defined as SourceBuff := TermArg => Buffer.
SourceBuff must evaluate to a ObjectReference that refers to a Buffer object.
| ctx | The context of the TermList that this structure is part of. |
NULL and errno is set. Definition at line 803 of file named.c.
References AML_BUFFER, AML_DEBUG_ERROR, aml_term_arg_read(), and NULL.
Referenced by aml_def_create_bit_field_read(), aml_def_create_field_read(), and aml_def_create_field_read_helper().
| aml_object_t * aml_super_name_read_and_resolve | ( | aml_term_list_ctx_t * | ctx | ) |
Reads a SuperName structure from the AML byte stream and resolves it to a object.
A SuperName structure is defined as SuperName := SimpleName | DebugObj | ReferenceTypeOpcode.
| ctx | The context of the TermList that this structure is part of. |
NULL and errno is set. Definition at line 285 of file name.c.
References AML_DEBUG_ERROR, aml_debug_obj_read(), aml_reference_type_opcode_read(), aml_simple_name_read_and_resolve(), aml_token_peek(), AML_TOKEN_TYPE_ARG, AML_TOKEN_TYPE_DEBUG, AML_TOKEN_TYPE_EXPRESSION, AML_TOKEN_TYPE_LOCAL, AML_TOKEN_TYPE_NAME, aml_token_type_to_string(), EILSEQ, errno, aml_token_props_t::name, NULL, aml_token_t::props, and aml_token_props_t::type.
Referenced by aml_def_cond_ref_of_read(), aml_mutex_object_read(), aml_op_supername_read(), aml_op_termarg_supername_read(), and aml_target_read_and_resolve().
| uint64_t aml_sync_flags_read | ( | aml_term_list_ctx_t * | ctx, |
| aml_sync_level_t * | out | ||
| ) |
Reads a SyncFlags structure from the AML byte stream.
A SyncFlags structure is defined as SyncFlags := ByteData, where
| ctx | The context of the TermList that this structure is part of. |
| out | The output buffer to store the SyncFlags structure. |
0. On failure, ERR and errno is set. Definition at line 643 of file named.c.
References aml_byte_data_read(), AML_DEBUG_ERROR, EILSEQ, ERR, and errno.
Referenced by aml_def_mutex_read().
| uint64_t aml_system_level_read | ( | aml_term_list_ctx_t * | ctx, |
| aml_system_level_t * | out | ||
| ) |
Reads a SystemLevel structure from the AML byte stream.
A SystemLevel structure is defined as SystemLevel := ByteData.
| ctx | The context of the TermList that this structure is part of. |
| out | The output buffer to store the system level. |
0. On failure, ERR and errno is set. Definition at line 1038 of file named.c.
References aml_byte_data_read(), AML_DEBUG_ERROR, and ERR.
Referenced by aml_def_power_res_read().
| uint64_t aml_target_read_and_resolve | ( | aml_term_list_ctx_t * | ctx, |
| aml_object_t ** | out | ||
| ) |
Reads a Target structure from the AML byte stream and resolves it to a object.
A Target structure is defined as Target := SuperName | NullName.
If the Target is a NullName, then out will be set to point to NULL but its not considered an error.
| ctx | The context of the TermList that this structure is part of. |
| out | Pointer to where the pointer to the resolved object will be stored, might be set to point to NULL. |
0. On failure, ERR and errno is set. Definition at line 319 of file name.c.
References AML_DEBUG_ERROR, AML_NULL_NAME, aml_null_name_read(), aml_super_name_read_and_resolve(), aml_token_peek(), ERR, NULL, and aml_token_t::num.
Referenced by aml_def_cond_ref_of_read(), aml_def_index_read(), aml_def_mod_read(), aml_def_to_string_read(), aml_op_data_data_target_read(), aml_op_operand_operand_target_read(), aml_op_operand_shiftcount_target_read(), aml_op_operand_target_read(), aml_quotient_read(), and aml_remainder_read().