Skip to content

Commit

Permalink
Merge branch 'acpica'
Browse files Browse the repository at this point in the history
* acpica:
  ACPICA: Update version to 20140724.
  ACPICA: ACPI 5.1: Update for PCCT table changes.
  ACPICA/ARM: ACPI 5.1: Update for GTDT table changes.
  ACPICA/ARM: ACPI 5.1: Update for MADT changes.
  ACPICA/ARM: ACPI 5.1: Update for FADT changes.
  ACPICA: ACPI 5.1: Support for the _CCA predifined name.
  ACPICA: ACPI 5.1: New notify value for System Affinity Update.
  ACPICA: ACPI 5.1: Support for the _DSD predefined name.
  ACPICA: Debug object: Add current value of Timer() to debug line prefix.
  ACPICA: acpihelp: Add UUID support, restructure some existing files.
  ACPICA: Utilities: Fix local printf issue.
  ACPICA: Tables: Update for DMAR table changes.
  ACPICA: Remove some extraneous printf arguments.
  ACPICA: Update for comments/formatting. No functional changes.
  ACPICA: Disassembler: Add support for the ToUUID opererator (macro).
  ACPICA: Remove a redundant cast to acpi_size for ACPI_OFFSET() macro.
  ACPICA: Work around an ancient GCC bug.
  • Loading branch information
Rafael J. Wysocki committed Aug 5, 2014
2 parents 49c68fd + 796ca77 commit 8b80c0f
Show file tree
Hide file tree
Showing 21 changed files with 468 additions and 104 deletions.
8 changes: 7 additions & 1 deletion drivers/acpi/acpica/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,7 @@ acpi-y += \
uterror.o \
uteval.o \
utglobal.o \
uthex.o \
utids.o \
utinit.o \
utlock.o \
Expand All @@ -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

18 changes: 12 additions & 6 deletions drivers/acpi/acpica/aclocal.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -1154,4 +1155,9 @@ struct ah_device_id {
char *description;
};

struct ah_uuid {
char *description;
char *string;
};

#endif /* __ACLOCAL_H__ */
16 changes: 15 additions & 1 deletion drivers/acpi/acpica/acpredef.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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 */
Expand Down Expand Up @@ -364,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)}},

Expand Down Expand Up @@ -436,6 +445,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),
Expand Down
9 changes: 9 additions & 0 deletions drivers/acpi/acpica/acutils.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);

/*
Expand Down Expand Up @@ -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
*/
Expand All @@ -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 */
11 changes: 10 additions & 1 deletion drivers/acpi/acpica/exdebug.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -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 */
Expand Down
6 changes: 3 additions & 3 deletions drivers/acpi/acpica/exdump.c
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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:
Expand Down
22 changes: 10 additions & 12 deletions drivers/acpi/acpica/exfield.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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);
Expand Down
32 changes: 3 additions & 29 deletions drivers/acpi/acpica/utdecode.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -475,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] = {
Expand All @@ -502,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]);
Expand Down
3 changes: 1 addition & 2 deletions drivers/acpi/acpica/utfileio.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
100 changes: 100 additions & 0 deletions drivers/acpi/acpica/uthex.c
Original file line number Diff line number Diff line change
@@ -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 <acpi/acpi.h>
#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));
}
Loading

0 comments on commit 8b80c0f

Please sign in to comment.