// SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0 /******************************************************************************* * * Module Name: dbconvert - debugger miscellaneous conversion routines * ******************************************************************************/ #include <acpi/acpi.h> #include "accommon.h" #include "acdebug.h" #define _COMPONENT … ACPI_MODULE_NAME("dbconvert") #define DB_DEFAULT_PKG_ELEMENTS … /******************************************************************************* * * FUNCTION: acpi_db_hex_char_to_value * * PARAMETERS: hex_char - Ascii Hex digit, 0-9|a-f|A-F * return_value - Where the converted value is returned * * RETURN: Status * * DESCRIPTION: Convert a single hex character to a 4-bit number (0-16). * ******************************************************************************/ acpi_status acpi_db_hex_char_to_value(int hex_char, u8 *return_value) { … } /******************************************************************************* * * FUNCTION: acpi_db_hex_byte_to_binary * * PARAMETERS: hex_byte - Double hex digit (0x00 - 0xFF) in format: * hi_byte then lo_byte. * return_value - Where the converted value is returned * * RETURN: Status * * DESCRIPTION: Convert two hex characters to an 8 bit number (0 - 255). * ******************************************************************************/ static acpi_status acpi_db_hex_byte_to_binary(char *hex_byte, u8 *return_value) { … } /******************************************************************************* * * FUNCTION: acpi_db_convert_to_buffer * * PARAMETERS: string - Input string to be converted * object - Where the buffer object is returned * * RETURN: Status * * DESCRIPTION: Convert a string to a buffer object. String is treated a list * of buffer elements, each separated by a space or comma. * ******************************************************************************/ static acpi_status acpi_db_convert_to_buffer(char *string, union acpi_object *object) { … } /******************************************************************************* * * FUNCTION: acpi_db_convert_to_package * * PARAMETERS: string - Input string to be converted * object - Where the package object is returned * * RETURN: Status * * DESCRIPTION: Convert a string to a package object. Handles nested packages * via recursion with acpi_db_convert_to_object. * ******************************************************************************/ acpi_status acpi_db_convert_to_package(char *string, union acpi_object *object) { … } /******************************************************************************* * * FUNCTION: acpi_db_convert_to_object * * PARAMETERS: type - Object type as determined by parser * string - Input string to be converted * object - Where the new object is returned * * RETURN: Status * * DESCRIPTION: Convert a typed and tokenized string to a union acpi_object. Typing: * 1) String objects were surrounded by quotes. * 2) Buffer objects were surrounded by parentheses. * 3) Package objects were surrounded by brackets "[]". * 4) All standalone tokens are treated as integers. * ******************************************************************************/ acpi_status acpi_db_convert_to_object(acpi_object_type type, char *string, union acpi_object *object) { … } /******************************************************************************* * * FUNCTION: acpi_db_encode_pld_buffer * * PARAMETERS: pld_info - _PLD buffer struct (Using local struct) * * RETURN: Encode _PLD buffer suitable for return value from _PLD * * DESCRIPTION: Bit-packs a _PLD buffer struct. Used to test the _PLD macros * ******************************************************************************/ u8 *acpi_db_encode_pld_buffer(struct acpi_pld_info *pld_info) { … } /******************************************************************************* * * FUNCTION: acpi_db_dump_pld_buffer * * PARAMETERS: obj_desc - Object returned from _PLD method * * RETURN: None. * * DESCRIPTION: Dumps formatted contents of a _PLD return buffer. * ******************************************************************************/ #define ACPI_PLD_OUTPUT … void acpi_db_dump_pld_buffer(union acpi_object *obj_desc) { … }