Print this page
update to acpica-unix2-20140114
acpica-unix2-20130823
PANKOVs restructure

@@ -1,14 +1,13 @@
-
 /******************************************************************************
  *
  * Module Name: exprep - ACPI AML (p-code) execution - field prep utilities
  *
  *****************************************************************************/
 
 /*
- * Copyright (C) 2000 - 2011, Intel Corp.
+ * Copyright (C) 2000 - 2014, 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,10 +46,11 @@
 #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,30 +265,35 @@
         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,12 +420,12 @@
  *
  * 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.
+ * 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,10 +487,36 @@
     {
     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,11 +539,10 @@
             "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);

@@ -543,11 +573,10 @@
         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 =

@@ -597,11 +626,13 @@
             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,6 +647,5 @@
     /* Remove local reference to the object */
 
     AcpiUtRemoveReference (ObjDesc);
     return_ACPI_STATUS (Status);
 }
-