Print this page
acpica-unix2-20130823
PANKOVs restructure

*** 1,14 **** - /****************************************************************************** * * Module Name: exprep - ACPI AML (p-code) execution - field prep utilities * *****************************************************************************/ /* ! * Copyright (C) 2000 - 2011, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met: --- 1,13 ---- /****************************************************************************** * * Module Name: exprep - ACPI AML (p-code) execution - field prep utilities * *****************************************************************************/ /* ! * Copyright (C) 2000 - 2013, Intel Corp. * All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions * are met:
*** 47,56 **** --- 46,56 ---- #include "acpi.h" #include "accommon.h" #include "acinterp.h" #include "amlcode.h" #include "acnamesp.h" + #include "acdispat.h" #define _COMPONENT ACPI_EXECUTER ACPI_MODULE_NAME ("exprep")
*** 265,294 **** --- 265,299 ---- BitLength = 8; break; case AML_FIELD_ACCESS_BYTE: case AML_FIELD_ACCESS_BUFFER: /* ACPI 2.0 (SMBus Buffer) */ + ByteAlignment = 1; BitLength = 8; break; case AML_FIELD_ACCESS_WORD: + ByteAlignment = 2; BitLength = 16; break; case AML_FIELD_ACCESS_DWORD: + ByteAlignment = 4; BitLength = 32; break; case AML_FIELD_ACCESS_QWORD: /* ACPI 2.0 */ + ByteAlignment = 8; BitLength = 64; break; default: + /* Invalid field access type */ ACPI_ERROR ((AE_INFO, "Unknown field access type 0x%X", Access));
*** 415,426 **** * * PARAMETERS: Info - Contains all field creation info * * RETURN: Status * ! * DESCRIPTION: Construct an ACPI_OPERAND_OBJECT of type DefField and ! * connect it to the parent Node. * ******************************************************************************/ ACPI_STATUS AcpiExPrepFieldValue ( --- 420,431 ---- * * PARAMETERS: Info - Contains all field creation info * * RETURN: Status * ! * DESCRIPTION: Construct an object of type ACPI_OPERAND_OBJECT with a ! * subtype of DefField and connect it to the parent Node. * ******************************************************************************/ ACPI_STATUS AcpiExPrepFieldValue (
*** 482,491 **** --- 487,522 ---- { case ACPI_TYPE_LOCAL_REGION_FIELD: 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) && (ObjDesc->CommonField.BitLength > 8)) {
*** 508,518 **** "RegionField: BitOff %X, Off %X, Gran %X, Region %p\n", ObjDesc->Field.StartFieldBitOffset, ObjDesc->Field.BaseByteOffset, ObjDesc->Field.AccessByteWidth, ObjDesc->Field.RegionObj)); break; - case ACPI_TYPE_LOCAL_BANK_FIELD: ObjDesc->BankField.Value = Info->BankValue; ObjDesc->BankField.RegionObj = AcpiNsGetAttachedObject (Info->RegionNode); --- 539,548 ----
*** 543,553 **** SecondDesc->Extra.AmlLength = ACPI_CAST_PTR (ACPI_PARSE_OBJECT, Info->DataRegisterNode)->Named.Length; break; - case ACPI_TYPE_LOCAL_INDEX_FIELD: /* Get the Index and Data registers */ ObjDesc->IndexField.IndexObj = --- 573,582 ----
*** 597,607 **** --- 626,638 ---- ObjDesc->IndexField.IndexObj, ObjDesc->IndexField.DataObj)); break; default: + /* No other types should get here */ + break; } /* * Store the constructed descriptor (ObjDesc) into the parent Node,
*** 616,621 **** /* Remove local reference to the object */ AcpiUtRemoveReference (ObjDesc); return_ACPI_STATUS (Status); } - --- 647,651 ----