Orange Pi5 kernel

Deprecated Linux kernel 5.10.110 for OrangePi 5/5B/5+ boards

3 Commits   0 Branches   0 Tags
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  1) // SPDX-License-Identifier: BSD-3-Clause OR GPL-2.0
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  2) /******************************************************************************
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  3)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  4)  * Module Name: utuuid -- UUID support functions
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  5)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  6)  * Copyright (C) 2000 - 2020, Intel Corp.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  7)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  8)  *****************************************************************************/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300  9) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 10) #include <acpi/acpi.h>
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 11) #include "accommon.h"
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 12) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 13) #define _COMPONENT          ACPI_COMPILER
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 14) ACPI_MODULE_NAME("utuuid")
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 15) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 16) #if (defined ACPI_ASL_COMPILER || defined ACPI_EXEC_APP || defined ACPI_HELP_APP)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 17) /*
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 18)  * UUID support functions.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 19)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 20)  * This table is used to convert an input UUID ascii string to a 16 byte
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 21)  * buffer and the reverse. The table maps a UUID buffer index 0-15 to
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 22)  * the index within the 36-byte UUID string where the associated 2-byte
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 23)  * hex value can be found.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 24)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 25)  * 36-byte UUID strings are of the form:
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 26)  *     aabbccdd-eeff-gghh-iijj-kkllmmnnoopp
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 27)  * Where aa-pp are one byte hex numbers, made up of two hex digits
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 28)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 29)  * Note: This table is basically the inverse of the string-to-offset table
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 30)  * found in the ACPI spec in the description of the to_UUID macro.
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 31)  */
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 32) const u8 acpi_gbl_map_to_uuid_offset[UUID_BUFFER_LENGTH] = {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 33) 	6, 4, 2, 0, 11, 9, 16, 14, 19, 21, 24, 26, 28, 30, 32, 34
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 34) };
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 35) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 36) /*******************************************************************************
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 37)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 38)  * FUNCTION:    acpi_ut_convert_string_to_uuid
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 39)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 40)  * PARAMETERS:  in_string           - 36-byte formatted UUID string
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 41)  *              uuid_buffer         - Where the 16-byte UUID buffer is returned
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 42)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 43)  * RETURN:      None. Output data is returned in the uuid_buffer
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 44)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 45)  * DESCRIPTION: Convert a 36-byte formatted UUID string to 16-byte UUID buffer
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 46)  *
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 47)  ******************************************************************************/
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 48) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 49) void acpi_ut_convert_string_to_uuid(char *in_string, u8 *uuid_buffer)
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 50) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 51) 	u32 i;
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 52) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 53) 	for (i = 0; i < UUID_BUFFER_LENGTH; i++) {
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 54) 		uuid_buffer[i] =
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 55) 		    (acpi_ut_ascii_char_to_hex
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 56) 		     (in_string[acpi_gbl_map_to_uuid_offset[i]]) << 4);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 57) 
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 58) 		uuid_buffer[i] |=
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 59) 		    acpi_ut_ascii_char_to_hex(in_string
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 60) 					      [acpi_gbl_map_to_uuid_offset[i] +
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 61) 					       1]);
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 62) 	}
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 63) }
^8f3ce5b39 (kx 2023-10-28 12:00:06 +0300 64) #endif