diff options
Diffstat (limited to 'sys/contrib/dev/acpica/components/utilities/utdecode.c')
-rw-r--r-- | sys/contrib/dev/acpica/components/utilities/utdecode.c | 84 |
1 files changed, 50 insertions, 34 deletions
diff --git a/sys/contrib/dev/acpica/components/utilities/utdecode.c b/sys/contrib/dev/acpica/components/utilities/utdecode.c index c1887ee..8f8f06e 100644 --- a/sys/contrib/dev/acpica/components/utilities/utdecode.c +++ b/sys/contrib/dev/acpica/components/utilities/utdecode.c @@ -5,7 +5,7 @@ *****************************************************************************/ /* - * Copyright (C) 2000 - 2015, Intel Corp. + * Copyright (C) 2000 - 2016, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without @@ -119,7 +119,7 @@ const char *AcpiGbl_RegionTypes[ACPI_NUM_PREDEFINED_REGIONS] = }; -char * +const char * AcpiUtGetRegionName ( UINT8 SpaceId) { @@ -141,7 +141,7 @@ AcpiUtGetRegionName ( return ("InvalidSpaceId"); } - return (ACPI_CAST_PTR (char, AcpiGbl_RegionTypes[SpaceId])); + return (AcpiGbl_RegionTypes[SpaceId]); } @@ -169,7 +169,7 @@ static const char *AcpiGbl_EventTypes[ACPI_NUM_FIXED_EVENTS] = }; -char * +const char * AcpiUtGetEventName ( UINT32 EventId) { @@ -179,7 +179,7 @@ AcpiUtGetEventName ( return ("InvalidEventID"); } - return (ACPI_CAST_PTR (char, AcpiGbl_EventTypes[EventId])); + return (AcpiGbl_EventTypes[EventId]); } @@ -201,7 +201,8 @@ AcpiUtGetEventName ( * * The type ACPI_TYPE_ANY (Untyped) is used as a "don't care" when searching; * when stored in a table it really means that we have thus far seen no - * evidence to indicate what type is actually going to be stored for this entry. + * evidence to indicate what type is actually going to be stored for this + & entry. */ static const char AcpiGbl_BadType[] = "UNDEFINED"; @@ -243,31 +244,47 @@ static const char *AcpiGbl_NsTypeNames[] = }; -char * +const char * AcpiUtGetTypeName ( ACPI_OBJECT_TYPE Type) { if (Type > ACPI_TYPE_INVALID) { - return (ACPI_CAST_PTR (char, AcpiGbl_BadType)); + return (AcpiGbl_BadType); } - return (ACPI_CAST_PTR (char, AcpiGbl_NsTypeNames[Type])); + return (AcpiGbl_NsTypeNames[Type]); } -char * +const char * AcpiUtGetObjectTypeName ( ACPI_OPERAND_OBJECT *ObjDesc) { + ACPI_FUNCTION_TRACE (UtGetObjectTypeName); + if (!ObjDesc) { - return ("[NULL Object Descriptor]"); + ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Null Object Descriptor\n")); + return_PTR ("[NULL Object Descriptor]"); + } + + /* These descriptor types share a common area */ + + if ((ACPI_GET_DESCRIPTOR_TYPE (ObjDesc) != ACPI_DESC_TYPE_OPERAND) && + (ACPI_GET_DESCRIPTOR_TYPE (ObjDesc) != ACPI_DESC_TYPE_NAMED)) + { + ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, + "Invalid object descriptor type: 0x%2.2X [%s] (%p)\n", + ACPI_GET_DESCRIPTOR_TYPE (ObjDesc), + AcpiUtGetDescriptorName (ObjDesc), ObjDesc)); + + return_PTR ("Invalid object"); } - return (AcpiUtGetTypeName (ObjDesc->Common.Type)); + return_STR (AcpiUtGetTypeName (ObjDesc->Common.Type)); } @@ -283,7 +300,7 @@ AcpiUtGetObjectTypeName ( * ******************************************************************************/ -char * +const char * AcpiUtGetNodeName ( void *Object) { @@ -359,7 +376,7 @@ static const char *AcpiGbl_DescTypeNames[] = }; -char * +const char * AcpiUtGetDescriptorName ( void *Object) { @@ -374,9 +391,7 @@ AcpiUtGetDescriptorName ( return ("Not a Descriptor"); } - return (ACPI_CAST_PTR (char, - AcpiGbl_DescTypeNames[ACPI_GET_DESCRIPTOR_TYPE (Object)])); - + return (AcpiGbl_DescTypeNames[ACPI_GET_DESCRIPTOR_TYPE (Object)]); } @@ -453,7 +468,7 @@ AcpiUtGetReferenceName ( /* Names for internal mutex objects, used for debug output */ -static char *AcpiGbl_MutexNames[ACPI_NUM_MUTEX] = +static const char *AcpiGbl_MutexNames[ACPI_NUM_MUTEX] = { "ACPI_MTX_Interpreter", "ACPI_MTX_Namespace", @@ -461,11 +476,9 @@ static char *AcpiGbl_MutexNames[ACPI_NUM_MUTEX] = "ACPI_MTX_Events", "ACPI_MTX_Caches", "ACPI_MTX_Memory", - "ACPI_MTX_CommandComplete", - "ACPI_MTX_CommandReady" }; -char * +const char * AcpiUtGetMutexName ( UINT32 MutexId) { @@ -493,7 +506,7 @@ AcpiUtGetMutexName ( /* Names for Notify() values, used for debug output */ -static const char *AcpiGbl_GenericNotify[ACPI_NOTIFY_MAX + 1] = +static const char *AcpiGbl_GenericNotify[ACPI_GENERIC_NOTIFY_MAX + 1] = { /* 00 */ "Bus Check", /* 01 */ "Device Check", @@ -507,32 +520,35 @@ static const char *AcpiGbl_GenericNotify[ACPI_NOTIFY_MAX + 1] = /* 09 */ "Device PLD Check", /* 0A */ "Reserved", /* 0B */ "System Locality Update", - /* 0C */ "Shutdown Request", + /* 0C */ "Shutdown Request", /* Reserved in ACPI 6.0 */ /* 0D */ "System Resource Affinity Update" }; -static const char *AcpiGbl_DeviceNotify[4] = +static const char *AcpiGbl_DeviceNotify[5] = { /* 80 */ "Status Change", /* 81 */ "Information Change", /* 82 */ "Device-Specific Change", - /* 83 */ "Device-Specific Change" + /* 83 */ "Device-Specific Change", + /* 84 */ "Reserved" }; -static const char *AcpiGbl_ProcessorNotify[4] = +static const char *AcpiGbl_ProcessorNotify[5] = { /* 80 */ "Performance Capability Change", /* 81 */ "C-State Change", /* 82 */ "Throttling Capability Change", - /* 83 */ "Device-Specific Change" + /* 83 */ "Guaranteed Change", + /* 84 */ "Minimum Excursion" }; -static const char *AcpiGbl_ThermalNotify[4] = +static const char *AcpiGbl_ThermalNotify[5] = { /* 80 */ "Thermal Status Change", /* 81 */ "Thermal Trip Point Change", /* 82 */ "Thermal Device List Change", - /* 83 */ "Thermal Relationship Change" + /* 83 */ "Thermal Relationship Change", + /* 84 */ "Reserved" }; @@ -542,23 +558,23 @@ AcpiUtGetNotifyName ( ACPI_OBJECT_TYPE Type) { - /* 00 - 0D are common to all object types */ + /* 00 - 0D are "common to all object types" (from ACPI Spec) */ - if (NotifyValue <= ACPI_NOTIFY_MAX) + if (NotifyValue <= ACPI_GENERIC_NOTIFY_MAX) { return (AcpiGbl_GenericNotify[NotifyValue]); } - /* 0D - 7F are reserved */ + /* 0E - 7F are reserved */ if (NotifyValue <= ACPI_MAX_SYS_NOTIFY) { return ("Reserved"); } - /* 80 - 83 are per-object-type */ + /* 80 - 84 are per-object-type */ - if (NotifyValue <= 0x83) + if (NotifyValue <= ACPI_SPECIFIC_NOTIFY_MAX) { switch (Type) { |