https://git.reactos.org/?p=reactos.git;a=commitdiff;h=be617cf987f94d3e0b083433dc80f9c975f609cc

commit be617cf987f94d3e0b083433dc80f9c975f609cc
Author:     Thomas Faber <[email protected]>
AuthorDate: Sat Dec 14 09:04:07 2019 +0100
Commit:     Thomas Faber <[email protected]>
CommitDate: Sat Dec 14 09:48:11 2019 +0100

    [ACPICA] Update to version 20191213. CORE-16559
---
 drivers/bus/acpi/acpica/dispatcher/dsfield.c     |  2 +-
 drivers/bus/acpi/acpica/dispatcher/dsopcode.c    |  1 +
 drivers/bus/acpi/acpica/dispatcher/dswload.c     | 22 ++++++++++++++++++++++
 drivers/bus/acpi/acpica/executer/exfield.c       | 10 ++++++++--
 drivers/bus/acpi/acpica/hardware/hwxfsleep.c     |  2 +-
 drivers/bus/acpi/acpica/include/acobject.h       |  1 +
 drivers/bus/acpi/acpica/include/acpixf.h         |  2 +-
 drivers/bus/acpi/acpica/include/platform/acenv.h | 15 +++++++++++++++
 8 files changed, 50 insertions(+), 5 deletions(-)

diff --git a/drivers/bus/acpi/acpica/dispatcher/dsfield.c 
b/drivers/bus/acpi/acpica/dispatcher/dsfield.c
index 4c3c7ff22f3..4d7280a1de9 100644
--- a/drivers/bus/acpi/acpica/dispatcher/dsfield.c
+++ b/drivers/bus/acpi/acpica/dispatcher/dsfield.c
@@ -305,7 +305,7 @@ Cleanup:
  * FUNCTION:    AcpiDsGetFieldNames
  *
  * PARAMETERS:  Info            - CreateField info structure
- *  `           WalkState       - Current method state
+ *              WalkState       - Current method state
  *              Arg             - First parser arg for the field name list
  *
  * RETURN:      Status
diff --git a/drivers/bus/acpi/acpica/dispatcher/dsopcode.c 
b/drivers/bus/acpi/acpica/dispatcher/dsopcode.c
index 1d35c5be77c..b680bb78e44 100644
--- a/drivers/bus/acpi/acpica/dispatcher/dsopcode.c
+++ b/drivers/bus/acpi/acpica/dispatcher/dsopcode.c
@@ -266,6 +266,7 @@ AcpiDsInitBufferField (
     }
 
     ObjDesc->BufferField.BufferObj = BufferDesc;
+    ObjDesc->BufferField.IsCreateField = AmlOpcode == AML_CREATE_FIELD_OP;
 
     /* Reference count for BufferDesc inherits ObjDesc count */
 
diff --git a/drivers/bus/acpi/acpica/dispatcher/dswload.c 
b/drivers/bus/acpi/acpica/dispatcher/dswload.c
index bc99b2b166c..8badd9f897e 100644
--- a/drivers/bus/acpi/acpica/dispatcher/dswload.c
+++ b/drivers/bus/acpi/acpica/dispatcher/dswload.c
@@ -459,6 +459,28 @@ AcpiDsLoad1EndOp (
     Op = WalkState->Op;
     ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Op=%p State=%p\n", Op, WalkState));
 
+    /*
+     * Disassembler: handle create field operators here.
+     *
+     * CreateBufferField is a deferred op that is typically processed in load
+     * pass 2. However, disassembly of control method contents walk the parse
+     * tree with ACPI_PARSE_LOAD_PASS1 and AML_CREATE operators are processed
+     * in a later walk. This is a problem when there is a control method that
+     * has the same name as the AML_CREATE object. In this case, any use of the
+     * name segment will be detected as a method call rather than a reference
+     * to a buffer field.
+     *
+     * This earlier creation during disassembly solves this issue by inserting
+     * the named object in the ACPI namespace so that references to this name
+     * would be a name string rather than a method call.
+     */
+    if ((WalkState->ParseFlags & ACPI_PARSE_DISASSEMBLE) &&
+        (WalkState->OpInfo->Flags & AML_CREATE))
+    {
+        Status = AcpiDsCreateBufferField (Op, WalkState);
+        return_ACPI_STATUS (Status);
+    }
+
     /* We are only interested in opcodes that have an associated name */
 
     if (!(WalkState->OpInfo->Flags & (AML_NAMED | AML_FIELD)))
diff --git a/drivers/bus/acpi/acpica/executer/exfield.c 
b/drivers/bus/acpi/acpica/executer/exfield.c
index f4c4139b97c..70e73babde4 100644
--- a/drivers/bus/acpi/acpica/executer/exfield.c
+++ b/drivers/bus/acpi/acpica/executer/exfield.c
@@ -138,7 +138,8 @@ AcpiExGetProtocolBufferLength (
  * RETURN:      Status
  *
  * DESCRIPTION: Read from a named field. Returns either an Integer or a
- *              Buffer, depending on the size of the field.
+ *              Buffer, depending on the size of the field and whether if a
+ *              field is created by the CreateField() operator.
  *
  
******************************************************************************/
 
@@ -202,12 +203,17 @@ AcpiExReadDataFromField (
      * the use of arithmetic operators on the returned value if the
      * field size is equal or smaller than an Integer.
      *
+     * However, all buffer fields created by CreateField operator needs to
+     * remain as a buffer to match other AML interpreter implementations.
+     *
      * Note: Field.length is in bits.
      */
     BufferLength = (ACPI_SIZE) ACPI_ROUND_BITS_UP_TO_BYTES (
         ObjDesc->Field.BitLength);
 
-    if (BufferLength > AcpiGbl_IntegerByteWidth)
+    if (BufferLength > AcpiGbl_IntegerByteWidth ||
+        (ObjDesc->Common.Type == ACPI_TYPE_BUFFER_FIELD &&
+        ObjDesc->BufferField.IsCreateField))
     {
         /* Field is too large for an Integer, create a Buffer instead */
 
diff --git a/drivers/bus/acpi/acpica/hardware/hwxfsleep.c 
b/drivers/bus/acpi/acpica/hardware/hwxfsleep.c
index d1c35c5a11d..401ed18589c 100644
--- a/drivers/bus/acpi/acpica/hardware/hwxfsleep.c
+++ b/drivers/bus/acpi/acpica/hardware/hwxfsleep.c
@@ -84,7 +84,7 @@ static ACPI_SLEEP_FUNCTIONS         AcpiSleepDispatch[] =
                        ACPI_HW_OPTIONAL_FUNCTION (AcpiHwLegacyWakePrep)),
      ACPI_STRUCT_INIT (ExtendedFunction,
                        AcpiHwExtendedWakePrep) },
-    {ACPI_STRUCT_INIT (Legacy_function,
+    {ACPI_STRUCT_INIT (LegacyFunction,
                        ACPI_HW_OPTIONAL_FUNCTION (AcpiHwLegacyWake)),
      ACPI_STRUCT_INIT (ExtendedFunction,
                        AcpiHwExtendedWake) }
diff --git a/drivers/bus/acpi/acpica/include/acobject.h 
b/drivers/bus/acpi/acpica/include/acobject.h
index 45f09839b6d..8fe08977777 100644
--- a/drivers/bus/acpi/acpica/include/acobject.h
+++ b/drivers/bus/acpi/acpica/include/acobject.h
@@ -381,6 +381,7 @@ typedef struct acpi_object_buffer_field
 {
     ACPI_OBJECT_COMMON_HEADER
     ACPI_COMMON_FIELD_INFO
+    BOOLEAN                         IsCreateField;      /* Special case for 
objects created by CreateField() */
     union acpi_operand_object       *BufferObj;         /* Containing Buffer 
object */
 
 } ACPI_OBJECT_BUFFER_FIELD;
diff --git a/drivers/bus/acpi/acpica/include/acpixf.h 
b/drivers/bus/acpi/acpica/include/acpixf.h
index bf88d566950..c1d46e6bac2 100644
--- a/drivers/bus/acpi/acpica/include/acpixf.h
+++ b/drivers/bus/acpi/acpica/include/acpixf.h
@@ -46,7 +46,7 @@
 
 /* Current ACPICA subsystem version in YYYYMMDD format */
 
-#define ACPI_CA_VERSION                 0x20191018
+#define ACPI_CA_VERSION                 0x20191213
 
 #include "acconfig.h"
 #include "actypes.h"
diff --git a/drivers/bus/acpi/acpica/include/platform/acenv.h 
b/drivers/bus/acpi/acpica/include/platform/acenv.h
index a6b5ab18fd7..d81b91c2296 100644
--- a/drivers/bus/acpi/acpica/include/platform/acenv.h
+++ b/drivers/bus/acpi/acpica/include/platform/acenv.h
@@ -162,6 +162,21 @@
 #define ACPI_DISASSEMBLER 1
 #endif
 
+/*
+ * acpisrc CR\LF support
+ * Unix file line endings do not include the carriage return.
+ * If the acpisrc utility is being built using a microsoft compiler, it means
+ * that it will be running on a windows machine which means that the output is
+ * expected to have CR/LF newlines. If the acpisrc utility is built with
+ * anything else, it will likely run on a system with LF newlines. This flag
+ * tells the acpisrc utility that newlines will be in the LF format.
+ */
+#if defined(ACPI_SRC_APP) && !defined(_MSC_VER)
+#define ACPI_SRC_OS_LF_ONLY 1
+#else
+#define ACPI_SRC_OS_LF_ONLY 0
+#endif
+
 /*! [Begin] no source code translation */
 
 /******************************************************************************

Reply via email to