summaryrefslogtreecommitdiff
path: root/source/components
diff options
context:
space:
mode:
authorRobert Moore <Robert.Moore@intel.com>2011-11-11 15:29:57 -0800
committerLin Ming <ming.m.lin@intel.com>2011-11-16 10:15:28 +0800
commit653c82dea006e243f792bf721dc376c32bed4c9e (patch)
treeae1b84c88a331c3c4b17eb1edf8cc5dc69167c90 /source/components
parent551dae6c43c316399c26228fcd2f38c97470d5f9 (diff)
ACPI 5.0: Changes for Connection() object.
Add length field to the struct passed to handlers.
Diffstat (limited to 'source/components')
-rw-r--r--source/components/dispatcher/dsfield.c1
-rw-r--r--source/components/events/evregion.c8
-rw-r--r--source/components/executer/exprep.c5
-rw-r--r--source/components/resources/rscalc.c6
-rw-r--r--source/components/utilities/utresrc.c13
5 files changed, 24 insertions, 9 deletions
diff --git a/source/components/dispatcher/dsfield.c b/source/components/dispatcher/dsfield.c
index 45fdeae57..8f63a0e65 100644
--- a/source/components/dispatcher/dsfield.c
+++ b/source/components/dispatcher/dsfield.c
@@ -397,6 +397,7 @@ AcpiDsGetFieldNames (
if (Child->Common.AmlOpcode == AML_INT_BYTELIST_OP)
{
Info->ResourceBuffer = Child->Named.Data;
+ Info->ResourceLength = (UINT16) Child->Named.Value.Integer;
}
else
{
diff --git a/source/components/events/evregion.c b/source/components/events/evregion.c
index 8518bc4d9..4fc74d6da 100644
--- a/source/components/events/evregion.c
+++ b/source/components/events/evregion.c
@@ -473,7 +473,7 @@ AcpiEvAddressSpaceDispatch (
ACPI_OPERAND_OBJECT *HandlerDesc;
ACPI_OPERAND_OBJECT *RegionObj2;
void *RegionContext = NULL;
- ACPI_GSBUS_CONTEXT *Context;
+ ACPI_CONNECTION_INFO *Context;
ACPI_FUNCTION_TRACE (EvAddressSpaceDispatch);
@@ -579,10 +579,11 @@ AcpiEvAddressSpaceDispatch (
/*
* Special handling for GenericSerialBus and GeneralPurposeIo:
- * There are two extra parameters that must be passed to the
+ * There are three extra parameters that must be passed to the
* handler via the context:
* 1) Connection buffer, a resource template from Connection() op.
- * 2) Actual access length from the AccessAs() op.
+ * 2) Length of the above buffer.
+ * 3) Actual access length from the AccessAs() op.
*/
if (((RegionObj->Region.SpaceId == ACPI_ADR_SPACE_GSBUS) ||
(RegionObj->Region.SpaceId == ACPI_ADR_SPACE_GPIO)) &&
@@ -592,6 +593,7 @@ AcpiEvAddressSpaceDispatch (
/* Get the Connection (ResourceTemplate) buffer */
Context->Connection = FieldObj->Field.ResourceBuffer;
+ Context->Length = FieldObj->Field.ResourceLength;
Context->AccessLength = FieldObj->Field.AccessLength;
}
diff --git a/source/components/executer/exprep.c b/source/components/executer/exprep.c
index f3159d7cf..9da656e1a 100644
--- a/source/components/executer/exprep.c
+++ b/source/components/executer/exprep.c
@@ -575,11 +575,12 @@ AcpiExPrepFieldValue (
}
ObjDesc->Field.ResourceBuffer = SecondDesc->Buffer.Pointer;
+ ObjDesc->Field.ResourceLength = (UINT16) SecondDesc->Buffer.Length;
}
else if (Info->ResourceBuffer)
{
- ObjDesc->Field.ResourceBuffer =
- Info->ResourceBuffer;
+ ObjDesc->Field.ResourceBuffer = Info->ResourceBuffer;
+ ObjDesc->Field.ResourceLength = Info->ResourceLength;
}
/* Allow full data read from EC address space */
diff --git a/source/components/resources/rscalc.c b/source/components/resources/rscalc.c
index 6438c7175..7b7e33946 100644
--- a/source/components/resources/rscalc.c
+++ b/source/components/resources/rscalc.c
@@ -493,7 +493,7 @@ AcpiRsGetListLength (
ACPI_FUNCTION_TRACE (RsGetListLength);
- *SizeNeeded = 0;
+ *SizeNeeded = ACPI_RS_SIZE_MIN; /* Minimum size is one EndTag */
EndAml = AmlBuffer + AmlBufferLength;
/* Walk the list of AML resource descriptors */
@@ -559,10 +559,8 @@ AcpiRsGetListLength (
case ACPI_RESOURCE_NAME_END_TAG:
/*
- * End Tag:
- * This is the normal exit, add size of EndTag
+ * End Tag: This is the normal exit
*/
- *SizeNeeded += ACPI_RS_SIZE_MIN;
return_ACPI_STATUS (AE_OK);
diff --git a/source/components/utilities/utresrc.c b/source/components/utilities/utresrc.c
index b7ee61adc..0ec5f8b81 100644
--- a/source/components/utilities/utresrc.c
+++ b/source/components/utilities/utresrc.c
@@ -542,6 +542,7 @@ AcpiUtWalkAmlResources (
UINT8 ResourceIndex;
UINT32 Length;
UINT32 Offset = 0;
+ UINT8 EndTag[2] = {0x79, 0x00};
ACPI_FUNCTION_TRACE (UtWalkAmlResources);
@@ -620,6 +621,18 @@ AcpiUtWalkAmlResources (
/* Did not find an EndTag descriptor */
+ if (UserFunction)
+ {
+ /* Insert an EndTag anyway. AcpiRsGetListLength always leaves room */
+
+ (void) AcpiUtValidateResource (EndTag, &ResourceIndex);
+ Status = UserFunction (EndTag, 2, Offset, ResourceIndex, Context);
+ if (ACPI_FAILURE (Status))
+ {
+ return_ACPI_STATUS (Status);
+ }
+ }
+
return_ACPI_STATUS (AE_AML_NO_RESOURCE_END_TAG);
}