diff options
Diffstat (limited to 'executer')
-rw-r--r-- | executer/exconfig.c | 2 | ||||
-rw-r--r-- | executer/excreate.c | 28 | ||||
-rw-r--r-- | executer/exdump.c | 6 | ||||
-rw-r--r-- | executer/exfield.c | 26 | ||||
-rw-r--r-- | executer/exfldio.c | 28 | ||||
-rw-r--r-- | executer/exprep.c | 27 | ||||
-rw-r--r-- | executer/exutils.c | 30 |
7 files changed, 124 insertions, 23 deletions
diff --git a/executer/exconfig.c b/executer/exconfig.c index d7677e99ce67..72f45bece61a 100644 --- a/executer/exconfig.c +++ b/executer/exconfig.c @@ -334,7 +334,7 @@ AcpiExRegionRead ( for (i = 0; i < Length; i++) { - Status = AcpiEvAddressSpaceDispatch (ObjDesc, ACPI_READ, + Status = AcpiEvAddressSpaceDispatch (ObjDesc, NULL, ACPI_READ, RegionOffset, 8, &Value); if (ACPI_FAILURE (Status)) { diff --git a/executer/excreate.c b/executer/excreate.c index fe93e0e9409a..7d52e0172c31 100644 --- a/executer/excreate.c +++ b/executer/excreate.c @@ -284,7 +284,7 @@ Cleanup: * * PARAMETERS: AmlStart - Pointer to the region declaration AML * AmlLength - Max length of the declaration AML - * RegionSpace - SpaceID for the region + * SpaceId - Address space ID for the region * WalkState - Current state * * RETURN: Status @@ -297,7 +297,7 @@ ACPI_STATUS AcpiExCreateRegion ( UINT8 *AmlStart, UINT32 AmlLength, - UINT8 RegionSpace, + UINT8 SpaceId, ACPI_WALK_STATE *WalkState) { ACPI_STATUS Status; @@ -326,16 +326,18 @@ AcpiExCreateRegion ( * Space ID must be one of the predefined IDs, or in the user-defined * range */ - if ((RegionSpace >= ACPI_NUM_PREDEFINED_REGIONS) && - (RegionSpace < ACPI_USER_REGION_BEGIN) && - (RegionSpace != ACPI_ADR_SPACE_DATA_TABLE)) + if (!AcpiIsValidSpaceId (SpaceId)) { - ACPI_ERROR ((AE_INFO, "Invalid AddressSpace type 0x%X", RegionSpace)); - return_ACPI_STATUS (AE_AML_INVALID_SPACE_ID); + /* + * Print an error message, but continue. We don't want to abort + * a table load for this exception. Instead, if the region is + * actually used at runtime, abort the executing method. + */ + ACPI_ERROR ((AE_INFO, "Invalid/unknown Address Space ID: 0x%2.2X", SpaceId)); } ACPI_DEBUG_PRINT ((ACPI_DB_LOAD, "Region Type - %s (0x%X)\n", - AcpiUtGetRegionName (RegionSpace), RegionSpace)); + AcpiUtGetRegionName (SpaceId), SpaceId)); /* Create the region descriptor */ @@ -353,10 +355,18 @@ AcpiExCreateRegion ( RegionObj2 = ObjDesc->Common.NextObject; RegionObj2->Extra.AmlStart = AmlStart; RegionObj2->Extra.AmlLength = AmlLength; + if (WalkState->ScopeInfo) + { + RegionObj2->Extra.ScopeNode = WalkState->ScopeInfo->Scope.Node; + } + else + { + RegionObj2->Extra.ScopeNode = Node; + } /* Init the region from the operands */ - ObjDesc->Region.SpaceId = RegionSpace; + ObjDesc->Region.SpaceId = SpaceId; ObjDesc->Region.Address = 0; ObjDesc->Region.Length = 0; ObjDesc->Region.Node = Node; diff --git a/executer/exdump.c b/executer/exdump.c index 60003e61544e..e6f71006fcca 100644 --- a/executer/exdump.c +++ b/executer/exdump.c @@ -209,11 +209,13 @@ static ACPI_EXDUMP_INFO AcpiExDumpBufferField[3] = {ACPI_EXD_POINTER, ACPI_EXD_OFFSET (BufferField.BufferObj), "Buffer Object"} }; -static ACPI_EXDUMP_INFO AcpiExDumpRegionField[3] = +static ACPI_EXDUMP_INFO AcpiExDumpRegionField[5] = { {ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE (AcpiExDumpRegionField), NULL}, {ACPI_EXD_FIELD, 0, NULL}, - {ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Field.RegionObj), "Region Object"} + {ACPI_EXD_UINT8, ACPI_EXD_OFFSET (Field.AccessLength), "AccessLength"}, + {ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Field.RegionObj), "Region Object"}, + {ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Field.ResourceBuffer), "ResourceBuffer"} }; static ACPI_EXDUMP_INFO AcpiExDumpBankField[5] = diff --git a/executer/exfield.c b/executer/exfield.c index 098a18650e65..62dcc092d4c0 100644 --- a/executer/exfield.c +++ b/executer/exfield.c @@ -113,19 +113,25 @@ AcpiExReadDataFromField ( } else if ((ObjDesc->Common.Type == ACPI_TYPE_LOCAL_REGION_FIELD) && (ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_SMBUS || + ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_GSBUS || ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_IPMI)) { /* - * This is an SMBus or IPMI read. We must create a buffer to hold + * This is an SMBus, GSBus or IPMI read. We must create a buffer to hold * the data and then directly access the region handler. * - * Note: Smbus protocol value is passed in upper 16-bits of Function + * Note: SMBus and GSBus protocol value is passed in upper 16-bits of Function */ if (ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_SMBUS) { Length = ACPI_SMBUS_BUFFER_SIZE; Function = ACPI_READ | (ObjDesc->Field.Attribute << 16); } + else if (ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_GSBUS) + { + Length = ACPI_GSBUS_BUFFER_SIZE; + Function = ACPI_READ | (ObjDesc->Field.Attribute << 16); + } else /* IPMI */ { Length = ACPI_IPMI_BUFFER_SIZE; @@ -274,23 +280,24 @@ AcpiExWriteDataToField ( } else if ((ObjDesc->Common.Type == ACPI_TYPE_LOCAL_REGION_FIELD) && (ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_SMBUS || + ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_GSBUS || ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_IPMI)) { /* - * This is an SMBus or IPMI write. We will bypass the entire field + * This is an SMBus, GSBus or IPMI write. We will bypass the entire field * mechanism and handoff the buffer directly to the handler. For * these address spaces, the buffer is bi-directional; on a write, * return data is returned in the same buffer. * * Source must be a buffer of sufficient size: - * ACPI_SMBUS_BUFFER_SIZE or ACPI_IPMI_BUFFER_SIZE. + * ACPI_SMBUS_BUFFER_SIZE, ACPI_GSBUS_BUFFER_SIZE, or ACPI_IPMI_BUFFER_SIZE. * - * Note: SMBus protocol type is passed in upper 16-bits of Function + * Note: SMBus and GSBus protocol type is passed in upper 16-bits of Function */ if (SourceDesc->Common.Type != ACPI_TYPE_BUFFER) { ACPI_ERROR ((AE_INFO, - "SMBus or IPMI write requires Buffer, found type %s", + "SMBus/IPMI/GenericSerialBus write requires Buffer, found type %s", AcpiUtGetObjectTypeName (SourceDesc))); return_ACPI_STATUS (AE_AML_OPERAND_TYPE); @@ -301,6 +308,11 @@ AcpiExWriteDataToField ( Length = ACPI_SMBUS_BUFFER_SIZE; Function = ACPI_WRITE | (ObjDesc->Field.Attribute << 16); } + else if (ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_GSBUS) + { + Length = ACPI_GSBUS_BUFFER_SIZE; + Function = ACPI_WRITE | (ObjDesc->Field.Attribute << 16); + } else /* IPMI */ { Length = ACPI_IPMI_BUFFER_SIZE; @@ -310,7 +322,7 @@ AcpiExWriteDataToField ( if (SourceDesc->Buffer.Length < Length) { ACPI_ERROR ((AE_INFO, - "SMBus or IPMI write requires Buffer of length %u, found length %u", + "SMBus/IPMI/GenericSerialBus write requires Buffer of length %u, found length %u", Length, SourceDesc->Buffer.Length)); return_ACPI_STATUS (AE_AML_BUFFER_LIMIT); diff --git a/executer/exfldio.c b/executer/exfldio.c index bf663a2f5ecc..a4a884645506 100644 --- a/executer/exfldio.c +++ b/executer/exfldio.c @@ -98,6 +98,7 @@ AcpiExSetupRegion ( { ACPI_STATUS Status = AE_OK; ACPI_OPERAND_OBJECT *RgnDesc; + UINT8 SpaceId; ACPI_FUNCTION_TRACE_U32 (ExSetupRegion, FieldDatumByteOffset); @@ -116,6 +117,16 @@ AcpiExSetupRegion ( return_ACPI_STATUS (AE_AML_OPERAND_TYPE); } + SpaceId = RgnDesc->Region.SpaceId; + + /* Validate the Space ID */ + + if (!AcpiIsValidSpaceId (SpaceId)) + { + ACPI_ERROR ((AE_INFO, "Invalid/unknown Address Space ID: 0x%2.2X", SpaceId)); + return_ACPI_STATUS (AE_AML_INVALID_SPACE_ID); + } + /* * If the Region Address and Length have not been previously evaluated, * evaluate them now and save the results. @@ -130,11 +141,12 @@ AcpiExSetupRegion ( } /* - * Exit now for SMBus or IPMI address space, it has a non-linear + * Exit now for SMBus, GSBus or IPMI address space, it has a non-linear * address space and the request cannot be directly validated */ - if (RgnDesc->Region.SpaceId == ACPI_ADR_SPACE_SMBUS || - RgnDesc->Region.SpaceId == ACPI_ADR_SPACE_IPMI) + if (SpaceId == ACPI_ADR_SPACE_SMBUS || + SpaceId == ACPI_ADR_SPACE_GSBUS || + SpaceId == ACPI_ADR_SPACE_IPMI) { /* SMBus or IPMI has a non-linear address space */ @@ -290,7 +302,8 @@ AcpiExAccessRegion ( /* Invoke the appropriate AddressSpace/OpRegion handler */ - Status = AcpiEvAddressSpaceDispatch (RgnDesc, Function, RegionOffset, + Status = AcpiEvAddressSpaceDispatch (RgnDesc, ObjDesc, + Function, RegionOffset, ACPI_MUL_8 (ObjDesc->CommonField.AccessByteWidth), Value); if (ACPI_FAILURE (Status)) @@ -337,6 +350,8 @@ AcpiExRegisterOverflow ( ACPI_OPERAND_OBJECT *ObjDesc, UINT64 Value) { + ACPI_FUNCTION_NAME (ExRegisterOverflow); + if (ObjDesc->CommonField.BitLength >= ACPI_INTEGER_BIT_SIZE) { @@ -353,6 +368,11 @@ AcpiExRegisterOverflow ( * The Value is larger than the maximum value that can fit into * the register. */ + ACPI_ERROR ((AE_INFO, + "Index value 0x%8.8X%8.8X overflows field width 0x%X", + ACPI_FORMAT_UINT64 (Value), + ObjDesc->CommonField.BitLength)); + return (TRUE); } diff --git a/executer/exprep.c b/executer/exprep.c index ee96a6a09023..d7347d5e6f71 100644 --- a/executer/exprep.c +++ b/executer/exprep.c @@ -49,6 +49,7 @@ #include "acinterp.h" #include "amlcode.h" #include "acnamesp.h" +#include "acdispat.h" #define _COMPONENT ACPI_EXECUTER @@ -484,6 +485,32 @@ AcpiExPrepFieldValue ( ObjDesc->Field.RegionObj = AcpiNsGetAttachedObject (Info->RegionNode); + /* Fields specific to GenericSerialBus fields */ + + ObjDesc->Field.AccessLength = Info->AccessLength; + + if (Info->ConnectionNode) + { + SecondDesc = Info->ConnectionNode->Object; + if (!(SecondDesc->Common.Flags & AOPOBJ_DATA_VALID)) + { + Status = AcpiDsGetBufferArguments (SecondDesc); + if (ACPI_FAILURE (Status)) + { + AcpiUtDeleteObjectDesc (ObjDesc); + return_ACPI_STATUS (Status); + } + } + + ObjDesc->Field.ResourceBuffer = SecondDesc->Buffer.Pointer; + ObjDesc->Field.ResourceLength = (UINT16) SecondDesc->Buffer.Length; + } + else if (Info->ResourceBuffer) + { + ObjDesc->Field.ResourceBuffer = Info->ResourceBuffer; + ObjDesc->Field.ResourceLength = Info->ResourceLength; + } + /* Allow full data read from EC address space */ if ((ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_EC) && diff --git a/executer/exutils.c b/executer/exutils.c index 4daa44f52792..bbc9e0ddfa07 100644 --- a/executer/exutils.c +++ b/executer/exutils.c @@ -499,4 +499,34 @@ AcpiExIntegerToString ( } } + +/******************************************************************************* + * + * FUNCTION: AcpiIsValidSpaceId + * + * PARAMETERS: SpaceId - ID to be validated + * + * RETURN: TRUE if valid/supported ID. + * + * DESCRIPTION: Validate an operation region SpaceID. + * + ******************************************************************************/ + +BOOLEAN +AcpiIsValidSpaceId ( + UINT8 SpaceId) +{ + + if ((SpaceId >= ACPI_NUM_PREDEFINED_REGIONS) && + (SpaceId < ACPI_USER_REGION_BEGIN) && + (SpaceId != ACPI_ADR_SPACE_DATA_TABLE) && + (SpaceId != ACPI_ADR_SPACE_FIXED_HARDWARE)) + { + return (FALSE); + } + + return (TRUE); +} + + #endif |