summaryrefslogtreecommitdiffstats
path: root/sys/contrib/dev/acpica/psopcode.c
diff options
context:
space:
mode:
authormsmith <msmith@FreeBSD.org>2000-12-01 09:36:25 +0000
committermsmith <msmith@FreeBSD.org>2000-12-01 09:36:25 +0000
commit4d595f4926afa2a1f9c1a96d657dba5d33297a85 (patch)
tree7c849b394b62ba086bc123f7a780a33169a79fe8 /sys/contrib/dev/acpica/psopcode.c
parent748be155016b7e29202235815e27acc5ff5e9e87 (diff)
downloadFreeBSD-src-4d595f4926afa2a1f9c1a96d657dba5d33297a85.zip
FreeBSD-src-4d595f4926afa2a1f9c1a96d657dba5d33297a85.tar.gz
Update to the 20001115 Intel ACPI CA snapshot.
Diffstat (limited to 'sys/contrib/dev/acpica/psopcode.c')
-rw-r--r--sys/contrib/dev/acpica/psopcode.c242
1 files changed, 121 insertions, 121 deletions
diff --git a/sys/contrib/dev/acpica/psopcode.c b/sys/contrib/dev/acpica/psopcode.c
index 8035f6a..4b9832d 100644
--- a/sys/contrib/dev/acpica/psopcode.c
+++ b/sys/contrib/dev/acpica/psopcode.c
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Module Name: psopcode - Parser opcode information table
- * $Revision: 20 $
+ * $Revision: 24 $
*
*****************************************************************************/
@@ -124,9 +124,6 @@
MODULE_NAME ("psopcode")
-UINT8 AcpiGbl_AmlShortOpInfoIndex[];
-UINT8 AcpiGbl_AmlLongOpInfoIndex[];
-
#define _UNK 0x6B
/*
* Reserved ASCII characters. Do not use any of these for
@@ -146,119 +143,6 @@ UINT8 AcpiGbl_AmlLongOpInfoIndex[];
/*******************************************************************************
*
- * FUNCTION: AcpiPsGetOpcodeInfo
- *
- * PARAMETERS: Opcode - The AML opcode
- *
- * RETURN: A pointer to the info about the opcode. NULL if the opcode was
- * not found in the table.
- *
- * DESCRIPTION: Find AML opcode description based on the opcode.
- * NOTE: This procedure must ALWAYS return a valid pointer!
- *
- ******************************************************************************/
-
-ACPI_OPCODE_INFO *
-AcpiPsGetOpcodeInfo (
- UINT16 Opcode)
-{
- ACPI_OPCODE_INFO *OpInfo;
- UINT8 UpperOpcode;
- UINT8 LowerOpcode;
-
-
- /* Split the 16-bit opcode into separate bytes */
-
- UpperOpcode = (UINT8) (Opcode >> 8);
- LowerOpcode = (UINT8) Opcode;
-
- /* Default is "unknown opcode" */
-
- OpInfo = &AcpiGbl_AmlOpInfo [_UNK];
-
-
- /*
- * Detect normal 8-bit opcode or extended 16-bit opcode
- */
-
- switch (UpperOpcode)
- {
- case 0:
-
- /* Simple (8-bit) opcode: 0-255, can't index beyond table */
-
- OpInfo = &AcpiGbl_AmlOpInfo [AcpiGbl_AmlShortOpInfoIndex [LowerOpcode]];
- break;
-
-
- case AML_EXTOP:
-
- /* Extended (16-bit, prefix+opcode) opcode */
-
- if (LowerOpcode <= MAX_EXTENDED_OPCODE)
- {
- OpInfo = &AcpiGbl_AmlOpInfo [AcpiGbl_AmlLongOpInfoIndex [LowerOpcode]];
- }
- break;
-
-
- case AML_LNOT_OP:
-
- /* This case is for the bogus opcodes LNOTEQUAL, LLESSEQUAL, LGREATEREQUAL */
- /* TBD: [Investigate] remove this case? */
-
- DEBUG_PRINT (ACPI_ERROR, ("PsGetOpcodeInfo: Bad multi-byte opcode=%X\n",
- Opcode));
-
- break;
-
-
- default:
-
- DEBUG_PRINT (ACPI_ERROR, ("PsGetOpcodeInfo: Unknown extended opcode=%X\n",
- Opcode));
-
- break;
- }
-
-
- /* Get the Op info pointer for this opcode */
-
- return (OpInfo);
-}
-
-
-/*******************************************************************************
- *
- * FUNCTION: AcpiPsGetOpcodeName
- *
- * PARAMETERS: Opcode - The AML opcode
- *
- * RETURN: A pointer to the name of the opcode (ASCII String)
- * Note: Never returns NULL.
- *
- * DESCRIPTION: Translate an opcode into a human-readable string
- *
- ******************************************************************************/
-
-NATIVE_CHAR *
-AcpiPsGetOpcodeName (
- UINT16 Opcode)
-{
- ACPI_OPCODE_INFO *Op;
-
-
- Op = AcpiPsGetOpcodeInfo (Opcode);
-
- /* Always guaranteed to return a valid pointer */
-
- DEBUG_ONLY_MEMBERS (return Op->Name);
- return ("AE_NOT_CONFIGURED");
-}
-
-
-/*******************************************************************************
- *
* NAME: AcpiGbl_AmlOpInfo
*
* DESCRIPTION: Opcode table. Each entry contains <opcode, type, name, operands>
@@ -485,7 +369,7 @@ AcpiPsGetOpcodeName (
#define ARGI_REVISION_OP ARG_NONE
#define ARGI_DEBUG_OP ARG_NONE
#define ARGI_FATAL_OP ARGI_LIST3 (ARGI_NUMBER, ARGI_NUMBER, ARGI_NUMBER)
-#define ARGI_REGION_OP ARGI_INVALID_OPCODE
+#define ARGI_REGION_OP ARGI_LIST2 (ARGI_NUMBER, ARGI_NUMBER)
#define ARGI_DEF_FIELD_OP ARGI_INVALID_OPCODE
#define ARGI_DEVICE_OP ARGI_INVALID_OPCODE
#define ARGI_PROCESSOR_OP ARGI_INVALID_OPCODE
@@ -510,7 +394,7 @@ AcpiPsGetOpcodeName (
*/
-ACPI_OPCODE_INFO AcpiGbl_AmlOpInfo[] =
+static ACPI_OPCODE_INFO AmlOpInfo[] =
{
/* Index Opcode Type Class Has Arguments? Name Parser Args Interpreter Args */
@@ -637,7 +521,7 @@ ACPI_OPCODE_INFO AcpiGbl_AmlOpInfo[] =
* index into the table above
*/
-UINT8 AcpiGbl_AmlShortOpInfoIndex[256] =
+static UINT8 AmlShortOpInfoIndex[256] =
{
/* 0 1 2 3 4 5 6 7 */
/* 0x00 */ 0x00, 0x01, _UNK, _UNK, _UNK, _UNK, 0x02, _UNK,
@@ -675,7 +559,7 @@ UINT8 AcpiGbl_AmlShortOpInfoIndex[256] =
};
-UINT8 AcpiGbl_AmlLongOpInfoIndex[NUM_EXTENDED_OPCODE] =
+static UINT8 AmlLongOpInfoIndex[NUM_EXTENDED_OPCODE] =
{
/* 0 1 2 3 4 5 6 7 */
/* 0x00 */ _UNK, 0x46, 0x47, _UNK, _UNK, _UNK, _UNK, _UNK,
@@ -702,3 +586,119 @@ UINT8 AcpiGbl_AmlLongOpInfoIndex[NUM_EXTENDED_OPCODE] =
/* 0x00 */
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiPsGetOpcodeInfo
+ *
+ * PARAMETERS: Opcode - The AML opcode
+ *
+ * RETURN: A pointer to the info about the opcode. NULL if the opcode was
+ * not found in the table.
+ *
+ * DESCRIPTION: Find AML opcode description based on the opcode.
+ * NOTE: This procedure must ALWAYS return a valid pointer!
+ *
+ ******************************************************************************/
+
+ACPI_OPCODE_INFO *
+AcpiPsGetOpcodeInfo (
+ UINT16 Opcode)
+{
+ ACPI_OPCODE_INFO *OpInfo;
+ UINT8 UpperOpcode;
+ UINT8 LowerOpcode;
+
+
+ /* Split the 16-bit opcode into separate bytes */
+
+ UpperOpcode = (UINT8) (Opcode >> 8);
+ LowerOpcode = (UINT8) Opcode;
+
+ /* Default is "unknown opcode" */
+
+ OpInfo = &AmlOpInfo [_UNK];
+
+
+ /*
+ * Detect normal 8-bit opcode or extended 16-bit opcode
+ */
+
+ switch (UpperOpcode)
+ {
+ case 0:
+
+ /* Simple (8-bit) opcode: 0-255, can't index beyond table */
+
+ OpInfo = &AmlOpInfo [AmlShortOpInfoIndex [LowerOpcode]];
+ break;
+
+
+ case AML_EXTOP:
+
+ /* Extended (16-bit, prefix+opcode) opcode */
+
+ if (LowerOpcode <= MAX_EXTENDED_OPCODE)
+ {
+ OpInfo = &AmlOpInfo [AmlLongOpInfoIndex [LowerOpcode]];
+ }
+ break;
+
+
+ case AML_LNOT_OP:
+
+ /* This case is for the bogus opcodes LNOTEQUAL, LLESSEQUAL, LGREATEREQUAL */
+ /* TBD: [Investigate] remove this case? */
+
+ DEBUG_PRINT (ACPI_ERROR, ("PsGetOpcodeInfo: Bad multi-byte opcode=%X\n",
+ Opcode));
+
+ break;
+
+
+ default:
+
+ DEBUG_PRINT (ACPI_ERROR, ("PsGetOpcodeInfo: Unknown extended opcode=%X\n",
+ Opcode));
+
+ break;
+ }
+
+
+ /* Get the Op info pointer for this opcode */
+
+ return (OpInfo);
+}
+
+
+/*******************************************************************************
+ *
+ * FUNCTION: AcpiPsGetOpcodeName
+ *
+ * PARAMETERS: Opcode - The AML opcode
+ *
+ * RETURN: A pointer to the name of the opcode (ASCII String)
+ * Note: Never returns NULL.
+ *
+ * DESCRIPTION: Translate an opcode into a human-readable string
+ *
+ ******************************************************************************/
+
+NATIVE_CHAR *
+AcpiPsGetOpcodeName (
+ UINT16 Opcode)
+{
+ ACPI_OPCODE_INFO *Op;
+
+
+ Op = AcpiPsGetOpcodeInfo (Opcode);
+
+ /* Always guaranteed to return a valid pointer */
+
+#ifdef ACPI_DEBUG
+ return (Op->Name);
+#else
+ return ("AE_NOT_CONFIGURED");
+#endif
+}
+
+
OpenPOWER on IntegriCloud