From 8884de6a47dda88f8fdf4efa9960149fb5a8a46f Mon Sep 17 00:00:00 2001 From: Bob Moore Date: Wed, 30 Jul 2014 12:20:26 +0800 Subject: ACPICA: Work around an ancient GCC bug. warning: cast from function call of type 'char *' to non-matching type 'long unsigned int' Since acpi_ut_format_number() hasn't been enabled for the Linux kernel, this patch doesn't affect the Linux kernel. Signed-off-by: Bob Moore Signed-off-by: Lv Zheng Signed-off-by: Rafael J. Wysocki --- drivers/acpi/acpica/utprint.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'drivers/acpi') diff --git a/drivers/acpi/acpica/utprint.c b/drivers/acpi/acpica/utprint.c index 10311648f701..080e22aaba15 100644 --- a/drivers/acpi/acpica/utprint.c +++ b/drivers/acpi/acpica/utprint.c @@ -242,6 +242,7 @@ static char *acpi_ut_format_number(char *string, u64 number, u8 base, s32 width, s32 precision, u8 type) { + char *pos; char sign; char zero; u8 need_prefix; @@ -289,9 +290,8 @@ static char *acpi_ut_format_number(char *string, /* Generate full string in reverse order */ - i = ACPI_PTR_DIFF(acpi_ut_put_number - (reversed_string, number, base, upper), - reversed_string); + pos = acpi_ut_put_number(reversed_string, number, base, upper); + i = ACPI_PTR_DIFF(pos, reversed_string); /* Printing 100 using %2d gives "100", not "00" */ -- cgit v1.2.1 From 90da690bc488bdc6333fe7565e6ab8daa5540327 Mon Sep 17 00:00:00 2001 From: Bob Moore Date: Wed, 30 Jul 2014 12:20:39 +0800 Subject: ACPICA: Disassembler: Add support for the ToUUID opererator (macro). This change adds support to disassemble a UUID back to the original ToUUID operator. It will detect a UUID within a standard AML Buffer. Also, a description of the UUID is emitted for "known" UUIDs, defined as UUIDs that are defined in the ACPI specification. Since this is a change for disassembler which is not shipped in the Linux kernel, the Linux kernel is not affected. Signed-off-by: Bob Moore Signed-off-by: Lv Zheng Signed-off-by: Rafael J. Wysocki --- drivers/acpi/acpica/aclocal.h | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'drivers/acpi') diff --git a/drivers/acpi/acpica/aclocal.h b/drivers/acpi/acpica/aclocal.h index 91f801a2e689..4c9fd7ceeb24 100644 --- a/drivers/acpi/acpica/aclocal.h +++ b/drivers/acpi/acpica/aclocal.h @@ -730,12 +730,13 @@ union acpi_parse_value { #define ACPI_DASM_STRING 0x02 /* Buffer is a ASCII string */ #define ACPI_DASM_UNICODE 0x03 /* Buffer is a Unicode string */ #define ACPI_DASM_PLD_METHOD 0x04 /* Buffer is a _PLD method bit-packed buffer */ -#define ACPI_DASM_EISAID 0x05 /* Integer is an EISAID */ -#define ACPI_DASM_MATCHOP 0x06 /* Parent opcode is a Match() operator */ -#define ACPI_DASM_LNOT_PREFIX 0x07 /* Start of a Lnot_equal (etc.) pair of opcodes */ -#define ACPI_DASM_LNOT_SUFFIX 0x08 /* End of a Lnot_equal (etc.) pair of opcodes */ -#define ACPI_DASM_HID_STRING 0x09 /* String is a _HID or _CID */ -#define ACPI_DASM_IGNORE 0x0A /* Not used at this time */ +#define ACPI_DASM_UUID 0x05 /* Buffer is a UUID/GUID */ +#define ACPI_DASM_EISAID 0x06 /* Integer is an EISAID */ +#define ACPI_DASM_MATCHOP 0x07 /* Parent opcode is a Match() operator */ +#define ACPI_DASM_LNOT_PREFIX 0x08 /* Start of a Lnot_equal (etc.) pair of opcodes */ +#define ACPI_DASM_LNOT_SUFFIX 0x09 /* End of a Lnot_equal (etc.) pair of opcodes */ +#define ACPI_DASM_HID_STRING 0x0A /* String is a _HID or _CID */ +#define ACPI_DASM_IGNORE 0x0B /* Not used at this time */ /* * Generic operation (for example: If, While, Store) -- cgit v1.2.1 From d38bb0020452bb28579e3ade8537e9e32b41d607 Mon Sep 17 00:00:00 2001 From: Bob Moore Date: Wed, 30 Jul 2014 12:20:46 +0800 Subject: ACPICA: Update for comments/formatting. No functional changes. Fix some issues detected by acpisrc utility. Signed-off-by: Bob Moore Signed-off-by: Lv Zheng Signed-off-by: Rafael J. Wysocki --- drivers/acpi/acpica/exfield.c | 22 ++++++++++------------ 1 file changed, 10 insertions(+), 12 deletions(-) (limited to 'drivers/acpi') diff --git a/drivers/acpi/acpica/exfield.c b/drivers/acpi/acpica/exfield.c index 1ff42c07b42b..6907ce0c704c 100644 --- a/drivers/acpi/acpica/exfield.c +++ b/drivers/acpi/acpica/exfield.c @@ -186,12 +186,11 @@ acpi_ex_read_data_from_field(struct acpi_walk_state * walk_state, access_length); /* - * Add additional 2 bytes for modeled generic_serial_bus data buffer: - * typedef struct { - * BYTEStatus; // Byte 0 of the data buffer - * BYTELength; // Byte 1 of the data buffer - * BYTE[x-1]Data; // Bytes 2-x of the arbitrary length data buffer, - * } + * Add additional 2 bytes for the generic_serial_bus data buffer: + * + * Status; (Byte 0 of the data buffer) + * Length; (Byte 1 of the data buffer) + * Data[x-1]; (Bytes 2-x of the arbitrary length data buffer) */ length += 2; function = ACPI_READ | (accessor_type << 16); @@ -368,12 +367,11 @@ acpi_ex_write_data_to_field(union acpi_operand_object *source_desc, access_length); /* - * Add additional 2 bytes for modeled generic_serial_bus data buffer: - * typedef struct { - * BYTEStatus; // Byte 0 of the data buffer - * BYTELength; // Byte 1 of the data buffer - * BYTE[x-1]Data; // Bytes 2-x of the arbitrary length data buffer, - * } + * Add additional 2 bytes for the generic_serial_bus data buffer: + * + * Status; (Byte 0 of the data buffer) + * Length; (Byte 1 of the data buffer) + * Data[x-1]; (Bytes 2-x of the arbitrary length data buffer) */ length += 2; function = ACPI_WRITE | (accessor_type << 16); -- cgit v1.2.1 From b95dd1753123071fcfe34457ed4f9429c75d5ec9 Mon Sep 17 00:00:00 2001 From: Sascha Wildner Date: Wed, 30 Jul 2014 12:20:53 +0800 Subject: ACPICA: Remove some extraneous printf arguments. Arguments that have no associated % format specifier. Apparently these are not caught by any current compilers. ACPICA BZ 1090. Sascha Wildner. Currently, this patch only affects applications under the toos/power/acpi folder. Link: https://bugs.acpica.org/show_bug.cgi?id=1090 Signed-off-by: Sascha Wildner Signed-off-by: Bob Moore Signed-off-by: Lv Zheng Signed-off-by: Rafael J. Wysocki --- drivers/acpi/acpica/exdump.c | 6 +++--- drivers/acpi/acpica/utfileio.c | 3 +-- 2 files changed, 4 insertions(+), 5 deletions(-) (limited to 'drivers/acpi') diff --git a/drivers/acpi/acpica/exdump.c b/drivers/acpi/acpica/exdump.c index 925202acc3e4..0f23c3f2678e 100644 --- a/drivers/acpi/acpica/exdump.c +++ b/drivers/acpi/acpica/exdump.c @@ -494,7 +494,7 @@ acpi_ex_dump_object(union acpi_operand_object *obj_desc, } } - acpi_os_printf("\n", next); + acpi_os_printf("\n"); break; case ACPI_EXD_HDLR_LIST: @@ -528,7 +528,7 @@ acpi_ex_dump_object(union acpi_operand_object *obj_desc, } } - acpi_os_printf("\n", next); + acpi_os_printf("\n"); break; case ACPI_EXD_RGN_LIST: @@ -562,7 +562,7 @@ acpi_ex_dump_object(union acpi_operand_object *obj_desc, } } - acpi_os_printf("\n", next); + acpi_os_printf("\n"); break; case ACPI_EXD_NODE: diff --git a/drivers/acpi/acpica/utfileio.c b/drivers/acpi/acpica/utfileio.c index bdf9914733cb..4e263a8cc6f0 100644 --- a/drivers/acpi/acpica/utfileio.c +++ b/drivers/acpi/acpica/utfileio.c @@ -201,8 +201,7 @@ acpi_ut_read_table(FILE * fp, status = fl_check_for_ascii(fp, NULL, FALSE); if (ACPI_SUCCESS(status)) { acpi_os_printf - ("File appears to be ASCII only, must be binary\n", - table_header.length, file_size); + ("File appears to be ASCII only, must be binary\n"); } #endif return (AE_BAD_HEADER); -- cgit v1.2.1 From 3589b8b8af6bdc3aafe520d76a73b77d965006b6 Mon Sep 17 00:00:00 2001 From: Lv Zheng Date: Wed, 30 Jul 2014 12:21:07 +0800 Subject: ACPICA: Utilities: Fix local printf issue. The bug can be reproduced by using a format that do not have the width.prec specified after a format that have the width.prec specified. The second formatted output will be wrong. The root cause is acpi_ut_vsnprintf() doesn't reset the specifiers to the default values. This patch fixes this issue. BZ 1094. Reported by Yizhe Wang, fixed by Lv Zheng. Since acpi_ut_vprintf() is only enabled for specific OSPM now, this patch doesn't affect Linux kernel. Link: https://bugs.acpica.org/show_bug.cgi?id=1094 Reported-and-tested-by: Yizhe Wang Signed-off-by: Lv Zheng Signed-off-by: Bob Moore Signed-off-by: Rafael J. Wysocki --- drivers/acpi/acpica/utprint.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'drivers/acpi') diff --git a/drivers/acpi/acpica/utprint.c b/drivers/acpi/acpica/utprint.c index 080e22aaba15..0ce3f5a0dd67 100644 --- a/drivers/acpi/acpica/utprint.c +++ b/drivers/acpi/acpica/utprint.c @@ -401,6 +401,7 @@ acpi_ut_vsnprintf(char *string, /* Process width */ + width = -1; if (ACPI_IS_DIGIT(*format)) { format = acpi_ut_scan_number(format, &number); width = (s32) number; @@ -415,6 +416,7 @@ acpi_ut_vsnprintf(char *string, /* Process precision */ + precision = -1; if (*format == '.') { ++format; if (ACPI_IS_DIGIT(*format)) { @@ -431,6 +433,7 @@ acpi_ut_vsnprintf(char *string, /* Process qualifier */ + qualifier = -1; if (*format == 'h' || *format == 'l' || *format == 'L') { qualifier = *format; ++format; -- cgit v1.2.1 From 73bbca04867d2f75443cc7dadcf115258f06b25e Mon Sep 17 00:00:00 2001 From: Bob Moore Date: Wed, 30 Jul 2014 12:21:13 +0800 Subject: ACPICA: acpihelp: Add UUID support, restructure some existing files. This adds a -u option to acpi_help to display all known ACPI UUIDs. Some existing files in the core code have been restructured. Three new files. [zetalog: changing drivers/acpi/acpica/Makefile accordingly] Signed-off-by: Bob Moore Signed-off-by: Lv Zheng Signed-off-by: Rafael J. Wysocki --- drivers/acpi/acpica/Makefile | 8 +++- drivers/acpi/acpica/aclocal.h | 5 +++ drivers/acpi/acpica/acutils.h | 9 ++++ drivers/acpi/acpica/utdecode.c | 27 ----------- drivers/acpi/acpica/uthex.c | 100 +++++++++++++++++++++++++++++++++++++++++ drivers/acpi/acpica/utuuid.c | 96 +++++++++++++++++++++++++++++++++++++++ 6 files changed, 217 insertions(+), 28 deletions(-) create mode 100644 drivers/acpi/acpica/uthex.c create mode 100644 drivers/acpi/acpica/utuuid.c (limited to 'drivers/acpi') diff --git a/drivers/acpi/acpica/Makefile b/drivers/acpi/acpica/Makefile index 6b9ec239d578..f2bb97812dd6 100644 --- a/drivers/acpi/acpica/Makefile +++ b/drivers/acpi/acpica/Makefile @@ -157,6 +157,7 @@ acpi-y += \ uterror.o \ uteval.o \ utglobal.o \ + uthex.o \ utids.o \ utinit.o \ utlock.o \ @@ -175,5 +176,10 @@ acpi-y += \ utxferror.o \ utxfmutex.o -acpi-$(ACPI_FUTURE_USAGE) += utfileio.o utprint.o uttrack.o utcache.o +acpi-$(ACPI_FUTURE_USAGE) += \ + utcache.o \ + utfileio.o \ + utprint.o \ + uttrack.o \ + utuuid.o diff --git a/drivers/acpi/acpica/aclocal.h b/drivers/acpi/acpica/aclocal.h index 4c9fd7ceeb24..1f9aba5fb81f 100644 --- a/drivers/acpi/acpica/aclocal.h +++ b/drivers/acpi/acpica/aclocal.h @@ -1155,4 +1155,9 @@ struct ah_device_id { char *description; }; +struct ah_uuid { + char *description; + char *string; +}; + #endif /* __ACLOCAL_H__ */ diff --git a/drivers/acpi/acpica/acutils.h b/drivers/acpi/acpica/acutils.h index ed614f4b2182..486d342e74b6 100644 --- a/drivers/acpi/acpica/acutils.h +++ b/drivers/acpi/acpica/acutils.h @@ -194,6 +194,8 @@ char *acpi_ut_get_event_name(u32 event_id); char acpi_ut_hex_to_ascii_char(u64 integer, u32 position); +u8 acpi_ut_ascii_char_to_hex(int hex_char); + u8 acpi_ut_valid_object_type(acpi_object_type type); /* @@ -759,6 +761,8 @@ const struct ah_predefined_name *acpi_ah_match_predefined_name(char *nameseg); const struct ah_device_id *acpi_ah_match_hardware_id(char *hid); +const char *acpi_ah_match_uuid(u8 *data); + /* * utprint - printf/vprintf output functions */ @@ -778,4 +782,9 @@ int acpi_ut_file_vprintf(ACPI_FILE file, const char *format, va_list args); int acpi_ut_file_printf(ACPI_FILE file, const char *format, ...); #endif +/* + * utuuid -- UUID support functions + */ +void acpi_ut_convert_string_to_uuid(char *in_string, u8 *uuid_buffer); + #endif /* _ACUTILS_H */ diff --git a/drivers/acpi/acpica/utdecode.c b/drivers/acpi/acpica/utdecode.c index 90ec37c473c6..98f541873810 100644 --- a/drivers/acpi/acpica/utdecode.c +++ b/drivers/acpi/acpica/utdecode.c @@ -86,33 +86,6 @@ const u8 acpi_gbl_ns_properties[ACPI_NUM_NS_TYPES] = { ACPI_NS_NORMAL /* 30 Invalid */ }; -/******************************************************************************* - * - * FUNCTION: acpi_ut_hex_to_ascii_char - * - * PARAMETERS: integer - Contains the hex digit - * position - bit position of the digit within the - * integer (multiple of 4) - * - * RETURN: The converted Ascii character - * - * DESCRIPTION: Convert a hex digit to an Ascii character - * - ******************************************************************************/ - -/* Hex to ASCII conversion table */ - -static const char acpi_gbl_hex_to_ascii[] = { - '0', '1', '2', '3', '4', '5', '6', '7', - '8', '9', 'A', 'B', 'C', 'D', 'E', 'F' -}; - -char acpi_ut_hex_to_ascii_char(u64 integer, u32 position) -{ - - return (acpi_gbl_hex_to_ascii[(integer >> position) & 0xF]); -} - /******************************************************************************* * * FUNCTION: acpi_ut_get_region_name diff --git a/drivers/acpi/acpica/uthex.c b/drivers/acpi/acpica/uthex.c new file mode 100644 index 000000000000..9afa9441b183 --- /dev/null +++ b/drivers/acpi/acpica/uthex.c @@ -0,0 +1,100 @@ +/****************************************************************************** + * + * Module Name: uthex -- Hex/ASCII support functions + * + *****************************************************************************/ + +/* + * Copyright (C) 2000 - 2014, Intel Corp. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions, and the following disclaimer, + * without modification. + * 2. Redistributions in binary form must reproduce at minimum a disclaimer + * substantially similar to the "NO WARRANTY" disclaimer below + * ("Disclaimer") and any redistribution must be conditioned upon + * including a substantially similar Disclaimer requirement for further + * binary redistribution. + * 3. Neither the names of the above-listed copyright holders nor the names + * of any contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * Alternatively, this software may be distributed under the terms of the + * GNU General Public License ("GPL") version 2 as published by the Free + * Software Foundation. + * + * NO WARRANTY + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGES. + */ + +#include +#include "accommon.h" + +#define _COMPONENT ACPI_COMPILER +ACPI_MODULE_NAME("uthex") + +/* Hex to ASCII conversion table */ +static char acpi_gbl_hex_to_ascii[] = { + '0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', + 'E', 'F' +}; + +/******************************************************************************* + * + * FUNCTION: acpi_ut_hex_to_ascii_char + * + * PARAMETERS: integer - Contains the hex digit + * position - bit position of the digit within the + * integer (multiple of 4) + * + * RETURN: The converted Ascii character + * + * DESCRIPTION: Convert a hex digit to an Ascii character + * + ******************************************************************************/ + +char acpi_ut_hex_to_ascii_char(u64 integer, u32 position) +{ + + return (acpi_gbl_hex_to_ascii[(integer >> position) & 0xF]); +} + +/******************************************************************************* + * + * FUNCTION: acpi_ut_hex_char_to_value + * + * PARAMETERS: ascii_char - Hex character in Ascii + * + * RETURN: The binary value of the ascii/hex character + * + * DESCRIPTION: Perform ascii-to-hex translation + * + ******************************************************************************/ + +u8 acpi_ut_ascii_char_to_hex(int hex_char) +{ + + if (hex_char <= 0x39) { + return ((u8)(hex_char - 0x30)); + } + + if (hex_char <= 0x46) { + return ((u8)(hex_char - 0x37)); + } + + return ((u8)(hex_char - 0x57)); +} diff --git a/drivers/acpi/acpica/utuuid.c b/drivers/acpi/acpica/utuuid.c new file mode 100644 index 000000000000..4dc33130f134 --- /dev/null +++ b/drivers/acpi/acpica/utuuid.c @@ -0,0 +1,96 @@ +/****************************************************************************** + * + * Module Name: utuuid -- UUID support functions + * + *****************************************************************************/ + +/* + * Copyright (C) 2000 - 2014, Intel Corp. + * All rights reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions, and the following disclaimer, + * without modification. + * 2. Redistributions in binary form must reproduce at minimum a disclaimer + * substantially similar to the "NO WARRANTY" disclaimer below + * ("Disclaimer") and any redistribution must be conditioned upon + * including a substantially similar Disclaimer requirement for further + * binary redistribution. + * 3. Neither the names of the above-listed copyright holders nor the names + * of any contributors may be used to endorse or promote products derived + * from this software without specific prior written permission. + * + * Alternatively, this software may be distributed under the terms of the + * GNU General Public License ("GPL") version 2 as published by the Free + * Software Foundation. + * + * NO WARRANTY + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL + * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS + * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING + * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE + * POSSIBILITY OF SUCH DAMAGES. + */ + +#include +#include "accommon.h" + +#define _COMPONENT ACPI_COMPILER +ACPI_MODULE_NAME("utuuid") + +/* + * UUID support functions. + * + * This table is used to convert an input UUID ascii string to a 16 byte + * buffer and the reverse. The table maps a UUID buffer index 0-15 to + * the index within the 36-byte UUID string where the associated 2-byte + * hex value can be found. + * + * 36-byte UUID strings are of the form: + * aabbccdd-eeff-gghh-iijj-kkllmmnnoopp + * Where aa-pp are one byte hex numbers, made up of two hex digits + * + * Note: This table is basically the inverse of the string-to-offset table + * found in the ACPI spec in the description of the to_UUID macro. + */ +const u8 acpi_gbl_map_to_uuid_offset[UUID_BUFFER_LENGTH] = { + 6, 4, 2, 0, 11, 9, 16, 14, 19, 21, 24, 26, 28, 30, 32, 34 +}; + +/******************************************************************************* + * + * FUNCTION: acpi_ut_convert_string_to_uuid + * + * PARAMETERS: in_string - 36-byte formatted UUID string + * uuid_buffer - Where the 16-byte UUID buffer is returned + * + * RETURN: None. Output data is returned in the uuid_buffer + * + * DESCRIPTION: Convert a 36-byte formatted UUID string to 16-byte UUID buffer + * + ******************************************************************************/ + +void acpi_ut_convert_string_to_uuid(char *in_string, u8 *uuid_buffer) +{ + u32 i; + + for (i = 0; i < UUID_BUFFER_LENGTH; i++) { + uuid_buffer[i] = + (acpi_ut_ascii_char_to_hex + (in_string[acpi_gbl_map_to_uuid_offset[i]]) << 4); + + uuid_buffer[i] |= + acpi_ut_ascii_char_to_hex(in_string + [acpi_gbl_map_to_uuid_offset[i] + + 1]); + } +} -- cgit v1.2.1 From 1aae3b97cee2f4904771d61040c19693e7b1a530 Mon Sep 17 00:00:00 2001 From: Bob Moore Date: Wed, 30 Jul 2014 12:21:19 +0800 Subject: ACPICA: Debug object: Add current value of Timer() to debug line prefix. Simplifies timing of things like control method execution. [zetalog: fixing 64-bit division link error] Signed-off-by: Bob Moore Signed-off-by: Lv Zheng Signed-off-by: Rafael J. Wysocki --- drivers/acpi/acpica/exdebug.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'drivers/acpi') diff --git a/drivers/acpi/acpica/exdebug.c b/drivers/acpi/acpica/exdebug.c index 4cfc3d3b5c97..6fbfad47518c 100644 --- a/drivers/acpi/acpica/exdebug.c +++ b/drivers/acpi/acpica/exdebug.c @@ -75,6 +75,7 @@ acpi_ex_do_debug_object(union acpi_operand_object *source_desc, u32 level, u32 index) { u32 i; + u32 timer; ACPI_FUNCTION_TRACE_PTR(ex_do_debug_object, source_desc); @@ -85,12 +86,20 @@ acpi_ex_do_debug_object(union acpi_operand_object *source_desc, return_VOID; } + /* + * We will emit the current timer value (in microseconds) with each + * debug output. Only need the lower 26 bits. This allows for 67 + * million microseconds or 67 seconds before rollover. + */ + timer = ((u32)acpi_os_get_timer() / 10); /* (100 nanoseconds to microseconds) */ + timer &= 0x03FFFFFF; + /* * Print line header as long as we are not in the middle of an * object display */ if (!((level > 0) && index == 0)) { - acpi_os_printf("[ACPI Debug] %*s", level, " "); + acpi_os_printf("[ACPI Debug %.8u] %*s", timer, level, " "); } /* Display the index for package output only */ -- cgit v1.2.1 From a9f65e01aa52692756ac5e6357502921a55f8a0e Mon Sep 17 00:00:00 2001 From: "David E. Box" Date: Wed, 30 Jul 2014 12:21:26 +0800 Subject: ACPICA: ACPI 5.1: Support for the _DSD predefined name. Adds full support for _DSD. David Box. Signed-off-by: David E. Box Signed-off-by: Bob Moore Signed-off-by: Lv Zheng Signed-off-by: Rafael J. Wysocki --- drivers/acpi/acpica/acpredef.h | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'drivers/acpi') diff --git a/drivers/acpi/acpica/acpredef.h b/drivers/acpi/acpica/acpredef.h index bd08817cafd8..c5bfadf5294a 100644 --- a/drivers/acpi/acpica/acpredef.h +++ b/drivers/acpi/acpica/acpredef.h @@ -105,6 +105,11 @@ * count = 0 (optional) * (Used for _DLM) * + * ACPI_PTYPE2_UUID_PAIR: Each subpackage is preceded by a UUID Buffer. The UUID + * defines the format of the package. Zero-length parent package is + * allowed. + * (Used for _DSD) + * *****************************************************************************/ enum acpi_return_package_types { @@ -117,7 +122,8 @@ enum acpi_return_package_types { ACPI_PTYPE2_FIXED = 7, ACPI_PTYPE2_MIN = 8, ACPI_PTYPE2_REV_FIXED = 9, - ACPI_PTYPE2_FIX_VAR = 10 + ACPI_PTYPE2_FIX_VAR = 10, + ACPI_PTYPE2_UUID_PAIR = 11 }; /* Support macros for users of the predefined info table */ @@ -436,6 +442,11 @@ const union acpi_predefined_info acpi_gbl_predefined_methods[] = { {{"_DOS", METHOD_1ARGS(ACPI_TYPE_INTEGER), METHOD_NO_RETURN_VALUE}}, + {{"_DSD", METHOD_0ARGS, + METHOD_RETURNS(ACPI_RTYPE_PACKAGE)}}, /* Variable-length (Pkgs) each: 1 Buf, 1 Pkg */ + PACKAGE_INFO(ACPI_PTYPE2_UUID_PAIR, ACPI_RTYPE_BUFFER, 1, + ACPI_RTYPE_PACKAGE, 1, 0), + {{"_DSM", METHOD_4ARGS(ACPI_TYPE_BUFFER, ACPI_TYPE_INTEGER, ACPI_TYPE_INTEGER, ACPI_TYPE_PACKAGE), -- cgit v1.2.1 From b3cc1356a6bd5c1b1269f2201e7ae65a458b662d Mon Sep 17 00:00:00 2001 From: Bob Moore Date: Wed, 30 Jul 2014 12:21:31 +0800 Subject: ACPICA: ACPI 5.1: New notify value for System Affinity Update. New value for the Notify() operator. Signed-off-by: Bob Moore Signed-off-by: Lv Zheng Signed-off-by: Rafael J. Wysocki --- drivers/acpi/acpica/utdecode.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'drivers/acpi') diff --git a/drivers/acpi/acpica/utdecode.c b/drivers/acpi/acpica/utdecode.c index 98f541873810..40e923e675fc 100644 --- a/drivers/acpi/acpica/utdecode.c +++ b/drivers/acpi/acpica/utdecode.c @@ -448,7 +448,8 @@ static const char *acpi_gbl_generic_notify[ACPI_NOTIFY_MAX + 1] = { /* 09 */ "Device PLD Check", /* 0A */ "Reserved", /* 0B */ "System Locality Update", - /* 0C */ "Shutdown Request" + /* 0C */ "Shutdown Request", + /* 0D */ "System Resource Affinity Update" }; static const char *acpi_gbl_device_notify[4] = { @@ -475,7 +476,7 @@ static const char *acpi_gbl_thermal_notify[4] = { const char *acpi_ut_get_notify_name(u32 notify_value, acpi_object_type type) { - /* 00 - 0C are common to all object types */ + /* 00 - 0D are common to all object types */ if (notify_value <= ACPI_NOTIFY_MAX) { return (acpi_gbl_generic_notify[notify_value]); -- cgit v1.2.1 From bdc9b755778dd3c75d6d777b094e6906b28999c3 Mon Sep 17 00:00:00 2001 From: Bob Moore Date: Wed, 30 Jul 2014 12:21:38 +0800 Subject: ACPICA: ACPI 5.1: Support for the _CCA predifined name. Full support for _CCA. Signed-off-by: Bob Moore Signed-off-by: Lv Zheng Signed-off-by: Rafael J. Wysocki --- drivers/acpi/acpica/acpredef.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'drivers/acpi') diff --git a/drivers/acpi/acpica/acpredef.h b/drivers/acpi/acpica/acpredef.h index c5bfadf5294a..bd3908d26c4f 100644 --- a/drivers/acpi/acpica/acpredef.h +++ b/drivers/acpi/acpica/acpredef.h @@ -370,6 +370,9 @@ const union acpi_predefined_info acpi_gbl_predefined_methods[] = { {{"_CBA", METHOD_0ARGS, METHOD_RETURNS(ACPI_RTYPE_INTEGER)}}, /* See PCI firmware spec 3.0 */ + {{"_CCA", METHOD_0ARGS, + METHOD_RETURNS(ACPI_RTYPE_INTEGER)}}, /* ACPI 5.1 */ + {{"_CDM", METHOD_0ARGS, METHOD_RETURNS(ACPI_RTYPE_INTEGER)}}, -- cgit v1.2.1