* 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
}
ObjDesc->BufferField.BufferObj = BufferDesc;
+ ObjDesc->BufferField.IsCreateField = AmlOpcode == AML_CREATE_FIELD_OP;
/* Reference count for BufferDesc inherits ObjDesc count */
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)))
* 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.
*
******************************************************************************/
* 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 */
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) }
{
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;
/* Current ACPICA subsystem version in YYYYMMDD format */
-#define ACPI_CA_VERSION 0x20191018
+#define ACPI_CA_VERSION 0x20191213
#include "acconfig.h"
#include "actypes.h"
#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 */
/******************************************************************************