diff options
author | Robert Moore <Robert.Moore@intel.com> | 2011-11-11 15:29:57 -0800 |
---|---|---|
committer | Lin Ming <ming.m.lin@intel.com> | 2011-11-16 10:15:28 +0800 |
commit | 653c82dea006e243f792bf721dc376c32bed4c9e (patch) | |
tree | ae1b84c88a331c3c4b17eb1edf8cc5dc69167c90 /source | |
parent | 551dae6c43c316399c26228fcd2f38c97470d5f9 (diff) |
ACPI 5.0: Changes for Connection() object.
Add length field to the struct passed to handlers.
Diffstat (limited to 'source')
-rw-r--r-- | source/components/dispatcher/dsfield.c | 1 | ||||
-rw-r--r-- | source/components/events/evregion.c | 8 | ||||
-rw-r--r-- | source/components/executer/exprep.c | 5 | ||||
-rw-r--r-- | source/components/resources/rscalc.c | 6 | ||||
-rw-r--r-- | source/components/utilities/utresrc.c | 13 | ||||
-rw-r--r-- | source/include/aclocal.h | 1 | ||||
-rw-r--r-- | source/include/acobject.h | 1 | ||||
-rw-r--r-- | source/include/actypes.h | 11 |
8 files changed, 32 insertions, 14 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); } diff --git a/source/include/aclocal.h b/source/include/aclocal.h index 6b93e57f2..b3eb44aea 100644 --- a/source/include/aclocal.h +++ b/source/include/aclocal.h @@ -362,6 +362,7 @@ typedef struct acpi_create_field_info UINT32 BankValue; UINT32 FieldBitPosition; UINT32 FieldBitLength; + UINT16 ResourceLength; UINT8 FieldFlags; UINT8 Attribute; UINT8 FieldType; diff --git a/source/include/acobject.h b/source/include/acobject.h index 0e5d68025..289e7aaa2 100644 --- a/source/include/acobject.h +++ b/source/include/acobject.h @@ -408,6 +408,7 @@ typedef struct acpi_object_region_field { ACPI_OBJECT_COMMON_HEADER ACPI_COMMON_FIELD_INFO + UINT16 ResourceLength; union acpi_operand_object *RegionObj; /* Containing OpRegion object */ UINT8 *ResourceBuffer; /* ResourceTemplate for serial regions/fields */ diff --git a/source/include/actypes.h b/source/include/actypes.h index 6e3e8bb0a..0b0716b9a 100644 --- a/source/include/actypes.h +++ b/source/include/actypes.h @@ -1104,14 +1104,15 @@ ACPI_STATUS (*ACPI_ADR_SPACE_HANDLER) ( #define ACPI_DEFAULT_HANDLER NULL -/* Special Context field for GenericSerialBus/GeneralPurposeIo (ACPI 5.0) */ +/* Special Context data for GenericSerialBus/GeneralPurposeIo (ACPI 5.0) */ -typedef struct acpi_gsbus_context +typedef struct acpi_connection_info { - void *Connection; - UINT8 AccessLength; + UINT8 *Connection; + UINT16 Length; + UINT8 AccessLength; -} ACPI_GSBUS_CONTEXT; +} ACPI_CONNECTION_INFO; typedef |