summaryrefslogtreecommitdiffstats
path: root/sys/contrib/dev/acpica/compiler
diff options
context:
space:
mode:
Diffstat (limited to 'sys/contrib/dev/acpica/compiler')
-rw-r--r--sys/contrib/dev/acpica/compiler/aslcompiler.y15
-rw-r--r--sys/contrib/dev/acpica/compiler/dtcompiler.h4
-rw-r--r--sys/contrib/dev/acpica/compiler/dtio.c68
-rw-r--r--sys/contrib/dev/acpica/compiler/dttable.c69
-rw-r--r--sys/contrib/dev/acpica/compiler/dttemplate.h51
-rw-r--r--sys/contrib/dev/acpica/compiler/dtutils.c6
6 files changed, 212 insertions, 1 deletions
diff --git a/sys/contrib/dev/acpica/compiler/aslcompiler.y b/sys/contrib/dev/acpica/compiler/aslcompiler.y
index 6a8d4a4..cc57aaa 100644
--- a/sys/contrib/dev/acpica/compiler/aslcompiler.y
+++ b/sys/contrib/dev/acpica/compiler/aslcompiler.y
@@ -728,6 +728,21 @@ ASLCode
| error {YYABORT; $$ = NULL;}
;
+/*
+ * Note concerning support for "module-level code".
+ *
+ * ACPI 1.0 allowed Type1 and Type2 executable opcodes outside of control
+ * methods (the so-called module-level code.) This support was explicitly
+ * removed in ACPI 2.0, but this type of code continues to be created by
+ * BIOS vendors. In order to support the disassembly and recompilation of
+ * such code (and the porting of ASL code to iASL), iASL supports this
+ * code in violation of the current ACPI specification.
+ *
+ * The grammar change to support module-level code is to revert the
+ * {ObjectList} portion of the DefinitionBlockTerm in ACPI 2.0 to the
+ * original use of {TermList} instead (see below.) This allows the use
+ * of Type1 and Type2 opcodes at module level.
+ */
DefinitionBlockTerm
: PARSEOP_DEFINITIONBLOCK '(' {$<n>$ = TrCreateLeafNode (PARSEOP_DEFINITIONBLOCK);}
String ','
diff --git a/sys/contrib/dev/acpica/compiler/dtcompiler.h b/sys/contrib/dev/acpica/compiler/dtcompiler.h
index bce9a1a..db3be4c 100644
--- a/sys/contrib/dev/acpica/compiler/dtcompiler.h
+++ b/sys/contrib/dev/acpica/compiler/dtcompiler.h
@@ -394,6 +394,10 @@ DtCompileRsdt (
void **PFieldList);
ACPI_STATUS
+DtCompileSlic (
+ void **PFieldList);
+
+ACPI_STATUS
DtCompileSlit (
void **PFieldList);
diff --git a/sys/contrib/dev/acpica/compiler/dtio.c b/sys/contrib/dev/acpica/compiler/dtio.c
index 9ba9acc..c339277 100644
--- a/sys/contrib/dev/acpica/compiler/dtio.c
+++ b/sys/contrib/dev/acpica/compiler/dtio.c
@@ -60,6 +60,10 @@ static void
DtLinkField (
DT_FIELD *Field);
+static void
+DtMergeField (
+ char *Value);
+
static ACPI_STATUS
DtParseLine (
char *LineBuffer,
@@ -222,6 +226,56 @@ DtLinkField (
/******************************************************************************
*
+ * FUNCTION: DtMergeField
+ *
+ * PARAMETERS: Value - Merge this line into previous one
+ *
+ * RETURN: None
+ *
+ * DESCRIPTION: Merge a field value to the previous one,
+ * probably for a multi-line buffer definition.
+ *
+ *****************************************************************************/
+
+static void
+DtMergeField (
+ char *Value)
+{
+ DT_FIELD *Prev;
+ DT_FIELD *Next;
+ char *NewValue;
+ UINT32 PrevLength;
+ UINT32 ThisLength;
+
+
+ Prev = Next = Gbl_FieldList;
+
+ while (Next)
+ {
+ Prev = Next;
+ Next = Next->Next;
+ }
+
+ if (Prev)
+ {
+ PrevLength = ACPI_STRLEN (Prev->Value);
+ ThisLength = ACPI_STRLEN (Value);
+
+ /* Add two for: separator + NULL terminator */
+
+ NewValue = UtLocalCalloc (PrevLength + ThisLength + 2);
+ ACPI_STRNCPY (NewValue, Prev->Value, PrevLength);
+ NewValue[PrevLength] = ' ';
+
+ ACPI_STRNCPY ((NewValue + PrevLength + 1), Value, ThisLength);
+ ACPI_FREE (Prev->Value);
+ Prev->Value = NewValue;
+ }
+}
+
+
+/******************************************************************************
+ *
* FUNCTION: DtParseLine
*
* PARAMETERS: LineBuffer - Current source code line
@@ -354,11 +408,12 @@ DtParseLine (
Length = ACPI_PTR_DIFF (End, Start);
TmpValue = UtLocalCalloc (Length + 1);
+
ACPI_STRNCPY (TmpValue, Start, Length);
Value = DtTrim (TmpValue);
ACPI_FREE (TmpValue);
- if (Name && Value)
+ if (ACPI_STRLEN (Name) && Value)
{
Field = UtLocalCalloc (sizeof (DT_FIELD));
Field->Name = Name;
@@ -370,6 +425,17 @@ DtParseLine (
DtLinkField (Field);
}
+ else if (!ACPI_STRLEN (Name))
+ {
+ /* Handle multi-line buffers (length > 16) */
+
+ DtMergeField (Value);
+ }
+ else
+ {
+ ACPI_FREE (Name);
+ ACPI_FREE (Value);
+ }
return (AE_OK);
}
diff --git a/sys/contrib/dev/acpica/compiler/dttable.c b/sys/contrib/dev/acpica/compiler/dttable.c
index 8938e2d..8b5d205 100644
--- a/sys/contrib/dev/acpica/compiler/dttable.c
+++ b/sys/contrib/dev/acpica/compiler/dttable.c
@@ -1134,6 +1134,75 @@ DtCompileRsdt (
/******************************************************************************
*
+ * FUNCTION: DtCompileSlic
+ *
+ * PARAMETERS: List - Current field list pointer
+ *
+ * RETURN: Status
+ *
+ * DESCRIPTION: Compile SLIC.
+ *
+ *****************************************************************************/
+
+ACPI_STATUS
+DtCompileSlic (
+ void **List)
+{
+ ACPI_STATUS Status;
+ DT_SUBTABLE *Subtable;
+ DT_SUBTABLE *ParentTable;
+ DT_FIELD **PFieldList = (DT_FIELD **) List;
+ DT_FIELD *SubtableStart;
+ ACPI_SLIC_HEADER *SlicHeader;
+ ACPI_DMTABLE_INFO *InfoTable;
+
+
+ while (*PFieldList)
+ {
+ SubtableStart = *PFieldList;
+ Status = DtCompileTable (PFieldList, AcpiDmTableInfoSlicHdr,
+ &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ ParentTable = DtPeekSubtable ();
+ DtInsertSubtable (ParentTable, Subtable);
+ DtPushSubtable (Subtable);
+
+ SlicHeader = ACPI_CAST_PTR (ACPI_SLIC_HEADER, Subtable->Buffer);
+
+ switch (SlicHeader->Type)
+ {
+ case ACPI_SLIC_TYPE_PUBLIC_KEY:
+ InfoTable = AcpiDmTableInfoSlic0;
+ break;
+ case ACPI_SLIC_TYPE_WINDOWS_MARKER:
+ InfoTable = AcpiDmTableInfoSlic1;
+ break;
+ default:
+ DtFatal (ASL_MSG_UNKNOWN_SUBTABLE, SubtableStart, "SLIC");
+ return (AE_ERROR);
+ }
+
+ Status = DtCompileTable (PFieldList, InfoTable, &Subtable, TRUE);
+ if (ACPI_FAILURE (Status))
+ {
+ return (Status);
+ }
+
+ ParentTable = DtPeekSubtable ();
+ DtInsertSubtable (ParentTable, Subtable);
+ DtPopSubtable ();
+ }
+
+ return (AE_OK);
+}
+
+
+/******************************************************************************
+ *
* FUNCTION: DtCompileSlit
*
* PARAMETERS: List - Current field list pointer
diff --git a/sys/contrib/dev/acpica/compiler/dttemplate.h b/sys/contrib/dev/acpica/compiler/dttemplate.h
index 0e37e80..79b3a61 100644
--- a/sys/contrib/dev/acpica/compiler/dttemplate.h
+++ b/sys/contrib/dev/acpica/compiler/dttemplate.h
@@ -534,6 +534,57 @@ const unsigned char TemplateSbst[] =
0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00 /* 00000028 "........" */
};
+const unsigned char TemplateSlic[] =
+{
+ 0x53,0x4C,0x49,0x43,0x76,0x01,0x00,0x00, /* 00000000 "SLICv..." */
+ 0x01,0x07,0x49,0x4E,0x54,0x45,0x4C,0x20, /* 00000008 "..INTEL " */
+ 0x54,0x45,0x4D,0x50,0x4C,0x41,0x54,0x45, /* 00000010 "TEMPLATE" */
+ 0x01,0x00,0x00,0x00,0x49,0x4E,0x54,0x4C, /* 00000018 "....INTL" */
+ 0x11,0x02,0x11,0x20,0x00,0x00,0x00,0x00, /* 00000020 "... ...." */
+ 0x9C,0x00,0x00,0x00,0x06,0x02,0x00,0x00, /* 00000028 "........" */
+ 0x00,0x24,0x00,0x00,0x52,0x53,0x41,0x31, /* 00000030 ".$..RSA1" */
+ 0x00,0x04,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000038 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000040 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000048 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000050 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000058 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000060 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000068 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000070 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000078 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000080 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000088 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000090 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000098 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000A0 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000A8 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000B0 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000B8 "........" */
+ 0x01,0x00,0x00,0x00,0xB6,0x00,0x00,0x00, /* 000000C0 "........" */
+ 0x00,0x00,0x02,0x00,0x49,0x4E,0x54,0x45, /* 000000C8 "....INTE" */
+ 0x4C,0x20,0x54,0x45,0x4D,0x50,0x4C,0x41, /* 000000D0 "L TEMPLA" */
+ 0x54,0x45,0x57,0x49,0x4E,0x44,0x4F,0x57, /* 000000D8 "TEWINDOW" */
+ 0x53,0x20,0x01,0x00,0x02,0x00,0x00,0x00, /* 000000E0 "S ......" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000E8 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000F0 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 000000F8 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000100 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000108 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000110 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000118 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000120 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000128 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000130 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000138 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000140 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000148 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000150 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000158 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000160 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00, /* 00000168 "........" */
+ 0x00,0x00,0x00,0x00,0x00,0x00 /* 00000170 "......" */
+};
+
const unsigned char TemplateSlit[] =
{
0x53,0x4C,0x49,0x54,0x3C,0x00,0x00,0x00, /* 00000000 "SLIT<..." */
diff --git a/sys/contrib/dev/acpica/compiler/dtutils.c b/sys/contrib/dev/acpica/compiler/dtutils.c
index e5495b9..bfe4138 100644
--- a/sys/contrib/dev/acpica/compiler/dtutils.c
+++ b/sys/contrib/dev/acpica/compiler/dtutils.c
@@ -401,6 +401,7 @@ DtGetFieldType (
case ACPI_DMT_BUFFER:
case ACPI_DMT_BUF7:
case ACPI_DMT_BUF16:
+ case ACPI_DMT_BUF128:
case ACPI_DMT_PCI_PATH:
Type = DT_FIELD_TYPE_BUFFER;
break;
@@ -546,6 +547,7 @@ DtGetFieldLength (
case ACPI_DMT_UINT32:
case ACPI_DMT_NAME4:
+ case ACPI_DMT_SLIC:
case ACPI_DMT_SIG:
ByteLength = 4;
break;
@@ -605,6 +607,10 @@ DtGetFieldLength (
ByteLength = 16;
break;
+ case ACPI_DMT_BUF128:
+ ByteLength = 128;
+ break;
+
case ACPI_DMT_UNICODE:
Value = DtGetFieldValue (Field, Info->Name);
OpenPOWER on IntegriCloud