aboutsummaryrefslogtreecommitdiff
path: root/source/components/utilities/utresrc.c
diff options
context:
space:
mode:
Diffstat (limited to 'source/components/utilities/utresrc.c')
-rw-r--r--source/components/utilities/utresrc.c70
1 files changed, 37 insertions, 33 deletions
diff --git a/source/components/utilities/utresrc.c b/source/components/utilities/utresrc.c
index a1a6c5bfbcc3..0caec2033d75 100644
--- a/source/components/utilities/utresrc.c
+++ b/source/components/utilities/utresrc.c
@@ -148,7 +148,9 @@ const char *AcpiGbl_RwDecode[] =
const char *AcpiGbl_ShrDecode[] =
{
"Exclusive",
- "Shared"
+ "Shared",
+ "ExclusiveAndWake", /* ACPI 5.0 */
+ "SharedAndWake" /* ACPI 5.0 */
};
const char *AcpiGbl_SizDecode[] =
@@ -429,27 +431,17 @@ static const UINT8 AcpiGbl_ResourceTypes[] =
ACPI_VARIABLE_LENGTH /* 0E *SerialBus */
};
-/*
- * For the iASL compiler/disassembler, we don't want any error messages
- * because the disassembler uses the resource validation code to determine
- * if Buffer objects are actually Resource Templates.
- */
-#ifdef ACPI_ASL_COMPILER
-#define ACPI_RESOURCE_ERROR(plist)
-#else
-#define ACPI_RESOURCE_ERROR(plist) ACPI_ERROR(plist)
-#endif
-
/*******************************************************************************
*
* FUNCTION: AcpiUtWalkAmlResources
*
- * PARAMETERS: Aml - Pointer to the raw AML resource template
- * AmlLength - Length of the entire template
- * UserFunction - Called once for each descriptor found. If
- * NULL, a pointer to the EndTag is returned
- * Context - Passed to UserFunction
+ * PARAMETERS: WalkState - Current walk info
+ * PARAMETERS: Aml - Pointer to the raw AML resource template
+ * AmlLength - Length of the entire template
+ * UserFunction - Called once for each descriptor found. If
+ * NULL, a pointer to the EndTag is returned
+ * Context - Passed to UserFunction
*
* RETURN: Status
*
@@ -460,6 +452,7 @@ static const UINT8 AcpiGbl_ResourceTypes[] =
ACPI_STATUS
AcpiUtWalkAmlResources (
+ ACPI_WALK_STATE *WalkState,
UINT8 *Aml,
ACPI_SIZE AmlLength,
ACPI_WALK_AML_CALLBACK UserFunction,
@@ -493,7 +486,7 @@ AcpiUtWalkAmlResources (
{
/* Validate the Resource Type and Resource Length */
- Status = AcpiUtValidateResource (Aml, &ResourceIndex);
+ Status = AcpiUtValidateResource (WalkState, Aml, &ResourceIndex);
if (ACPI_FAILURE (Status))
{
/*
@@ -553,7 +546,7 @@ AcpiUtWalkAmlResources (
{
/* Insert an EndTag anyway. AcpiRsGetListLength always leaves room */
- (void) AcpiUtValidateResource (EndTag, &ResourceIndex);
+ (void) AcpiUtValidateResource (WalkState, EndTag, &ResourceIndex);
Status = UserFunction (EndTag, 2, Offset, ResourceIndex, Context);
if (ACPI_FAILURE (Status))
{
@@ -569,9 +562,10 @@ AcpiUtWalkAmlResources (
*
* FUNCTION: AcpiUtValidateResource
*
- * PARAMETERS: Aml - Pointer to the raw AML resource descriptor
- * ReturnIndex - Where the resource index is returned. NULL
- * if the index is not required.
+ * PARAMETERS: WalkState - Current walk info
+ * Aml - Pointer to the raw AML resource descriptor
+ * ReturnIndex - Where the resource index is returned. NULL
+ * if the index is not required.
*
* RETURN: Status, and optionally the Index into the global resource tables
*
@@ -583,6 +577,7 @@ AcpiUtWalkAmlResources (
ACPI_STATUS
AcpiUtValidateResource (
+ ACPI_WALK_STATE *WalkState,
void *Aml,
UINT8 *ReturnIndex)
{
@@ -696,9 +691,12 @@ AcpiUtValidateResource (
if ((AmlResource->CommonSerialBus.Type == 0) ||
(AmlResource->CommonSerialBus.Type > AML_RESOURCE_MAX_SERIALBUSTYPE))
{
- ACPI_RESOURCE_ERROR ((AE_INFO,
- "Invalid/unsupported SerialBus resource descriptor: BusType 0x%2.2X",
- AmlResource->CommonSerialBus.Type));
+ if (WalkState)
+ {
+ ACPI_ERROR ((AE_INFO,
+ "Invalid/unsupported SerialBus resource descriptor: BusType 0x%2.2X",
+ AmlResource->CommonSerialBus.Type));
+ }
return (AE_AML_INVALID_RESOURCE_TYPE);
}
}
@@ -715,17 +713,23 @@ AcpiUtValidateResource (
InvalidResource:
- ACPI_RESOURCE_ERROR ((AE_INFO,
- "Invalid/unsupported resource descriptor: Type 0x%2.2X",
- ResourceType));
+ if (WalkState)
+ {
+ ACPI_ERROR ((AE_INFO,
+ "Invalid/unsupported resource descriptor: Type 0x%2.2X",
+ ResourceType));
+ }
return (AE_AML_INVALID_RESOURCE_TYPE);
BadResourceLength:
- ACPI_RESOURCE_ERROR ((AE_INFO,
- "Invalid resource descriptor length: Type "
- "0x%2.2X, Length 0x%4.4X, MinLength 0x%4.4X",
- ResourceType, ResourceLength, MinimumResourceLength));
+ if (WalkState)
+ {
+ ACPI_ERROR ((AE_INFO,
+ "Invalid resource descriptor length: Type "
+ "0x%2.2X, Length 0x%4.4X, MinLength 0x%4.4X",
+ ResourceType, ResourceLength, MinimumResourceLength));
+ }
return (AE_AML_BAD_RESOURCE_LENGTH);
}
@@ -914,7 +918,7 @@ AcpiUtGetResourceEndTag (
/* Validate the template and get a pointer to the EndTag */
- Status = AcpiUtWalkAmlResources (ObjDesc->Buffer.Pointer,
+ Status = AcpiUtWalkAmlResources (NULL, ObjDesc->Buffer.Pointer,
ObjDesc->Buffer.Length, NULL, EndTag);
return_ACPI_STATUS (Status);