|
PatchworkOS
|
#include <kernel/acpi/aml/runtime/convert.h>#include <kernel/acpi/aml/object.h>#include <kernel/acpi/aml/runtime/buffer_field.h>#include <kernel/acpi/aml/runtime/copy.h>#include <kernel/acpi/aml/runtime/field_unit.h>#include <kernel/acpi/aml/runtime/store.h>#include <kernel/acpi/aml/to_string.h>#include <kernel/log/log.h>#include <errno.h>#include <stdio.h>#include <stdlib.h>Go to the source code of this file.
Data Structures | |
| struct | aml_convert_entry_t |
Macros | |
| #define | AML_HEX_DIGITS "0123456789ABCDEF" |
| #define | AML_CONVERT_TRY_NEXT_CONVERTER 1 |
Typedefs | |
| typedef uint64_t(* | aml_convert_func_t) (aml_state_t *state, aml_object_t *src, aml_object_t *dest) |
Functions | |
| static uint64_t | aml_string_prepare (aml_object_t *obj, uint64_t length) |
| static void | aml_byte_to_hex (uint8_t byte, char *dest) |
| static uint8_t | aml_hex_to_byte (char chr) |
| static uint64_t | aml_buffer_to_buffer_field (aml_state_t *state, aml_object_t *buffer, aml_object_t *dest) |
| static uint64_t | aml_buffer_to_integer (aml_state_t *state, aml_object_t *buffer, aml_object_t *dest) |
| static uint64_t | aml_buffer_to_string (aml_state_t *state, aml_object_t *buffer, aml_object_t *dest) |
| static uint64_t | aml_buffer_to_debug_object (aml_state_t *state, aml_object_t *buffer, aml_object_t *dest) |
| static uint64_t | aml_integer_to_buffer (aml_state_t *state, aml_object_t *integer, aml_object_t *dest) |
| static uint64_t | aml_integer_to_field_unit (aml_state_t *state, aml_object_t *integer, aml_object_t *dest) |
| static uint64_t | aml_integer_to_buffer_field (aml_state_t *state, aml_object_t *integer, aml_object_t *dest) |
| static uint64_t | aml_integer_to_string (aml_state_t *state, aml_object_t *integer, aml_object_t *dest) |
| static uint64_t | aml_integer_to_debug_object (aml_state_t *state, aml_object_t *integer, aml_object_t *dest) |
| static uint64_t | aml_package_to_debug_object (aml_state_t *state, aml_object_t *package, aml_object_t *dest) |
| static uint64_t | aml_string_to_integer (aml_state_t *state, aml_object_t *string, aml_object_t *dest) |
| static uint64_t | aml_string_to_buffer (aml_state_t *state, aml_object_t *string, aml_object_t *dest) |
| static uint64_t | aml_string_to_debug_object (aml_state_t *state, aml_object_t *string, aml_object_t *dest) |
| static aml_convert_entry_t * | aml_converters_get (aml_type_t srcType) |
| uint64_t | aml_convert (aml_state_t *state, aml_object_t *src, aml_object_t *dest, aml_type_t allowedTypes) |
| Converts the data in the source object to a allowed type and stores it in the destination object. | |
| uint64_t | aml_convert_result (aml_state_t *state, aml_object_t *result, aml_object_t *target) |
| Performs a "Implicit Result Object Conversion" acording to the rules in section 19.3.5.5 of the ACPI specification. | |
| uint64_t | aml_convert_source (aml_state_t *state, aml_object_t *src, aml_object_t **dest, aml_type_t allowedTypes) |
| Performs a "Implicit Source Operand Conversion" acording to the rules in section 19.3.5.4 of the ACPI specification. | |
| uint64_t | aml_convert_to_buffer (aml_state_t *state, aml_object_t *src, aml_object_t **dest) |
| Converts a Integer, String or Buffer source object to a Buffer destination object. | |
| uint64_t | aml_convert_to_decimal_string (aml_state_t *state, aml_object_t *src, aml_object_t **dest) |
| Converts a Integer, String or Buffer source object to a String destination object in decimal format. | |
| uint64_t | aml_convert_to_hex_string (aml_state_t *state, aml_object_t *src, aml_object_t **dest) |
| Converts a Integer, String or Buffer source object to a String destination object in hexadecimal format. | |
| uint64_t | aml_convert_to_integer (aml_state_t *state, aml_object_t *src, aml_object_t **dest) |
| Converts a Integer, String or Buffer source object to an Integer destination object. | |
| uint64_t | aml_convert_integer_to_bcd (aml_integer_t value, aml_integer_t *out) |
| Converts an integer to its Binary-Coded Decimal (BCD) representation. | |
Variables | |
| static aml_convert_entry_t | bufferConverters [AML_TYPE_AMOUNT] |
| static aml_convert_entry_t | integerConverters [AML_TYPE_AMOUNT] |
| static aml_convert_entry_t | packageConverters [AML_TYPE_AMOUNT] |
| static aml_convert_entry_t | stringConverters [AML_TYPE_AMOUNT] |
| typedef uint64_t(* aml_convert_func_t) (aml_state_t *state, aml_object_t *src, aml_object_t *dest) |
|
static |
Definition at line 75 of file convert.c.
References AML_BUFFER_FIELD, aml_buffer_field_store(), AML_CONVERT_TRY_NEXT_CONVERTER, buffer, and aml_object_t::bufferField.
|
static |
|
static |
Definition at line 85 of file convert.c.
References AML_INTEGER, aml_integer_byte_size(), aml_integer_set(), buffer, aml_buffer_obj_t::content, aml_object_t::integer, aml_buffer_obj_t::length, MIN, and aml_integer_obj_t::value.
Referenced by aml_convert_to_integer().
|
static |
Definition at line 105 of file convert.c.
References aml_byte_to_hex(), aml_string_prepare(), buffer, aml_buffer_obj_t::content, aml_string_obj_t::content, ERR, aml_buffer_obj_t::length, and aml_object_t::string.
|
inlinestatic |
Definition at line 55 of file convert.c.
References AML_HEX_DIGITS.
Referenced by aml_buffer_to_string(), aml_convert_to_hex_string(), and aml_integer_to_string().
|
static |
Definition at line 348 of file convert.c.
References AML_BUFFER, AML_DEBUG_OBJECT, AML_INTEGER, AML_PACKAGE, AML_STRING, bufferConverters, EINVAL, ENOSYS, errno, integerConverters, NULL, packageConverters, and stringConverters.
Referenced by aml_convert().
|
inlinestatic |
Definition at line 61 of file convert.c.
Referenced by aml_convert_to_integer(), and aml_string_to_integer().
|
static |
Definition at line 162 of file convert.c.
References AML_BUFFER, aml_buffer_set(), aml_integer_byte_size(), aml_object_t::buffer, aml_buffer_obj_t::content, aml_object_t::integer, aml_buffer_obj_t::length, MIN, and aml_integer_obj_t::value.
Referenced by aml_convert_to_buffer().
|
static |
Definition at line 195 of file convert.c.
References AML_BUFFER_FIELD, aml_buffer_field_store(), AML_CONVERT_TRY_NEXT_CONVERTER, and aml_object_t::bufferField.
|
static |
Definition at line 227 of file convert.c.
References aml_object_t::integer, LOG_INFO, and aml_integer_obj_t::value.
|
static |
Definition at line 186 of file convert.c.
References AML_CONVERT_TRY_NEXT_CONVERTER, AML_FIELD_UNIT, aml_field_unit_store(), and aml_object_t::fieldUnit.
|
static |
Definition at line 205 of file convert.c.
References aml_byte_to_hex(), aml_integer_byte_size(), aml_string_prepare(), aml_string_obj_t::content, ERR, aml_object_t::integer, aml_object_t::string, and aml_integer_obj_t::value.
|
static |
Definition at line 243 of file convert.c.
References aml_object_to_string(), aml_package_obj_t::elements, aml_package_obj_t::length, LOG_INFO, and aml_object_t::package.
|
inlinestatic |
Definition at line 34 of file convert.c.
References AML_STRING, aml_string_resize(), aml_string_set_empty(), ERR, and aml_object_t::string.
Referenced by aml_buffer_to_string(), aml_convert_to_decimal_string(), and aml_integer_to_string().
|
static |
Definition at line 290 of file convert.c.
References AML_BUFFER, aml_buffer_set_empty(), aml_object_t::buffer, aml_buffer_obj_t::content, aml_string_obj_t::content, ERR, aml_buffer_obj_t::length, aml_string_obj_t::length, memcpy(), and MIN.
Referenced by aml_convert_to_buffer().
|
static |
Definition at line 328 of file convert.c.
References aml_string_obj_t::content, aml_string_obj_t::length, LOG_INFO, and aml_object_t::string.
|
static |
Definition at line 264 of file convert.c.
References aml_hex_to_byte(), AML_INTEGER, aml_integer_byte_size(), aml_integer_set(), aml_string_obj_t::content, aml_object_t::integer, aml_string_obj_t::length, MIN, and aml_integer_obj_t::value.
|
static |
Definition at line 155 of file convert.c.
Referenced by aml_converters_get().
|
static |
Definition at line 235 of file convert.c.
Referenced by aml_converters_get().
|
static |
Definition at line 260 of file convert.c.
Referenced by aml_converters_get().
|
static |
Definition at line 342 of file convert.c.
Referenced by aml_converters_get().