From adde12d193c29b689071379330dda0d64ecec84a Mon Sep 17 00:00:00 2001
From: aystarik <aystarik>
Date: Wed, 29 Jun 2005 19:46:50 +0000
Subject: [PATCH] Multithread support, namespace locking, debugger support

date	2000.03.21.22.22.00;	author rmoore1;	state Exp;
---
 source/include/acmacros.h |   6 -
 source/include/acnamesp.h |   8 +
 source/include/acoutput.h | 102 +++---
 source/include/acparser.h | 649 +++++++++++++++++++++++++++-----------
 4 files changed, 522 insertions(+), 243 deletions(-)

diff --git a/source/include/acmacros.h b/source/include/acmacros.h
index 9bf48e94d..797c9a98e 100644
--- a/source/include/acmacros.h
+++ b/source/include/acmacros.h
@@ -195,12 +195,6 @@
 #undef DEBUG_ASSERT
 #endif
 
-#ifdef _RPARSER
-#define RPARSER_ONLY(s)                 s;
-#else
-#define RPARSER_ONLY(s)
-#endif
-
 
 /* Register read/write Macros */
 
diff --git a/source/include/acnamesp.h b/source/include/acnamesp.h
index 87502f2c2..306efd758 100644
--- a/source/include/acnamesp.h
+++ b/source/include/acnamesp.h
@@ -421,6 +421,14 @@ NsScopeStackClear (
  * Utility functions - nsutils
  */
 
+BOOLEAN
+NsValidRootPrefix (
+    char                    Prefix);
+
+BOOLEAN
+NsValidPathSeparator (
+    char                    Sep);
+
 ACPI_OBJECT_TYPE
 NsGetType (
     ACPI_HANDLE             ObjHandle);
diff --git a/source/include/acoutput.h b/source/include/acoutput.h
index 4ef2d5bda..e0df71ede 100644
--- a/source/include/acoutput.h
+++ b/source/include/acoutput.h
@@ -1,7 +1,7 @@
+
 /******************************************************************************
- *
- * Name: acoutput.h -- debug output
- *       $Revision: 1.67 $
+ * 
+ * Name: output.h -- debug output
  *
  *****************************************************************************/
 
@@ -9,8 +9,8 @@
  *
  * 1. Copyright Notice
  *
- * Some or all of this work - Copyright (c) 1999, 2000, Intel Corp.
- * All rights reserved.
+ * Some or all of this work - Copyright (c) 1999, Intel Corp.  All rights
+ * reserved.
  *
  * 2. License
  *
@@ -38,9 +38,9 @@
  * The above copyright and patent license is granted only if the following
  * conditions are met:
  *
- * 3. Conditions
+ * 3. Conditions 
  *
- * 3.1. Redistribution of Source with Rights to Further Distribute Source.
+ * 3.1. Redistribution of Source with Rights to Further Distribute Source.  
  * Redistribution of source code of any substantial portion of the Covered
  * Code or modification with rights to further distribute source must include
  * the above Copyright Notice, the above License, this list of Conditions,
@@ -48,11 +48,11 @@
  * Licensee must cause all Covered Code to which Licensee contributes to
  * contain a file documenting the changes Licensee made to create that Covered
  * Code and the date of any change.  Licensee must include in that file the
- * documentation of any changes made by any predecessor Licensee.  Licensee
+ * documentation of any changes made by any predecessor Licensee.  Licensee 
  * must include a prominent statement that the modification is derived,
  * directly or indirectly, from Original Intel Code.
  *
- * 3.2. Redistribution of Source with no Rights to Further Distribute Source.
+ * 3.2. Redistribution of Source with no Rights to Further Distribute Source.  
  * Redistribution of source code of any substantial portion of the Covered
  * Code or modification without rights to further distribute source must
  * include the following Disclaimer and Export Compliance provision in the
@@ -86,7 +86,7 @@
  * INSTALLATION, TRAINING OR OTHER SERVICES.  INTEL WILL NOT PROVIDE ANY
  * UPDATES, ENHANCEMENTS OR EXTENSIONS.  INTEL SPECIFICALLY DISCLAIMS ANY
  * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
- * PARTICULAR PURPOSE.
+ * PARTICULAR PURPOSE. 
  *
  * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
  * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
@@ -114,8 +114,8 @@
  *
  *****************************************************************************/
 
-#ifndef __ACOUTPUT_H__
-#define __ACOUTPUT_H__
+#ifndef _OUTPUT_H
+#define _OUTPUT_H
 
 /*
  * Debug levels and component IDs.  These are used to control the
@@ -128,31 +128,28 @@
 #define GLOBAL                      0x00000001
 #define COMMON                      0x00000002
 #define PARSER                      0x00000004
-#define DISPATCHER                  0x00000008
-#define INTERPRETER                 0x00000010
-#define NAMESPACE                   0x00000020
-#define RESOURCE_MANAGER            0x00000040
-#define TABLE_MANAGER               0x00000080
-#define EVENT_HANDLING              0x00000100
-#define HARDWARE                    0x00000200
-#define MISCELLANEOUS               0x00000400
-#define OS_DEPENDENT                0x00000800
+#define INTERPRETER                 0x00000008
+#define NAMESPACE                   0x00000010
+#define RESOURCE_MANAGER            0x00000020
+#define TABLE_MANAGER               0x00000040
+#define EVENT_HANDLING              0x00000080
+#define HARDWARE                    0x00000100
+#define MISCELLANEOUS               0x00000200
+#define OS_DEPENDENT                0x00000400
 
-#define BUS_MANAGER                 0x00001000
+#define BUS_MANAGER                 0x00000800
 
-#define PROCESSOR_CONTROL           0x00002000
-#define SYSTEM_CONTROL              0x00004000
-#define THERMAL_CONTROL             0x00008000
-#define POWER_CONTROL               0x00010000
+#define PROCESSOR_CONTROL           0x00001000
+#define SYSTEM_CONTROL              0x00002000
+#define THERMAL_CONTROL             0x00004000
+#define POWER_CONTROL               0x00008000
 
-#define EMBEDDED_CONTROLLER         0x00020000
-#define BATTERY                     0x00040000
+#define EMBEDDED_CONTROLLER         0x00010000
+#define BATTERY                     0x00020000
 
 #define DEBUGGER                    0x00100000
 #define ALL_COMPONENTS              0x001FFFFF
 
-#define COMPONENT_DEFAULT           (ALL_COMPONENTS)
-
 
 /* Exception level -- used in the global "DebugLevel" */
 
@@ -168,24 +165,25 @@
 /* Trace level -- also used in the global "DebugLevel" */
 
 #define TRACE_PARSE                 0x00000100
-#define TRACE_DISPATCH              0x00000200
-#define TRACE_LOAD                  0x00000400
-#define TRACE_EXEC                  0x00000800
-#define TRACE_NAMES                 0x00001000
-#define TRACE_OPREGION              0x00002000
-#define TRACE_BFIELD                0x00004000
-#define TRACE_TRASH                 0x00008000
-#define TRACE_TABLES                0x00010000
-#define TRACE_FUNCTIONS             0x00020000
-#define TRACE_VALUES                0x00040000
-#define TRACE_OBJECTS               0x00080000
-#define TRACE_ALLOCATIONS           0x00100000
-#define TRACE_RESOURCES             0x00200000
-#define TRACE_IO                    0x00400000
-#define TRACE_INTERRUPTS            0x00800000
-#define TRACE_USER_REQUESTS         0x01000000
-#define TRACE_PACKAGE               0x02000000
-#define TRACE_MUTEX                 0x04000000
+#define TRACE_LOAD                  0x00000200
+#define TRACE_OPCODE                0x00000400
+#define TRACE_STACK                 0x00000800
+#define TRACE_EXEC                  0x00001000
+#define TRACE_NAMES                 0x00002000
+#define TRACE_OPREGION              0x00004000
+#define TRACE_BFIELD                0x00008000
+#define TRACE_TRASH                 0x00010000
+#define TRACE_TABLES                0x00020000
+#define TRACE_FUNCTIONS             0x00040000
+#define TRACE_VALUES                0x00080000
+#define TRACE_OBJECTS               0x00100000
+#define TRACE_ALLOCATIONS           0x00200000
+#define TRACE_RESOURCES             0x00400000
+#define TRACE_IO                    0x00800000
+#define TRACE_INTERRUPTS            0x01000000
+#define TRACE_USER_REQUESTS         0x02000000
+#define TRACE_PACKAGE               0x04000000
+#define TRACE_MUTEX                 0x08000000
 
 #define TRACE_ALL                   0x0FFFFF00
 
@@ -197,14 +195,14 @@
 #define VERBOSE_TABLES              0x40000000
 #define VERBOSE_EVENTS              0x80000000
 
-#define VERBOSE_ALL                 0xF0000000
+#define VERBOSE_ALL                 0x70000000
 
 
 /* Defaults for DebugLevel, debug and normal */
 
-#define DEBUG_DEFAULT               (ACPI_OK | ACPI_WARN | ACPI_ERROR | ACPI_DEBUG_OBJECT)
+#define DEBUG_DEFAULT               (ACPI_OK | ACPI_WARN | ACPI_ERROR | ACPI_DEBUG_OBJECT | TRACE_TABLES | TRACE_IO)
 #define NORMAL_DEFAULT              (ACPI_OK | ACPI_WARN | ACPI_ERROR | ACPI_DEBUG_OBJECT)
-#define DEBUG_ALL                   (VERBOSE_AML_DISASSEMBLE | TRACE_ALL | ACPI_ALL)
+
 
 /* Misc defines */
 
@@ -214,4 +212,4 @@
 #define CHARS_PER_LINE              16          /* used in DumpBuf function */
 
 
-#endif /* __ACOUTPUT_H__ */
+#endif /* _OUTPUT_H */
diff --git a/source/include/acparser.h b/source/include/acparser.h
index 0f88b7ebf..5a4a89a3e 100644
--- a/source/include/acparser.h
+++ b/source/include/acparser.h
@@ -1,7 +1,6 @@
 /******************************************************************************
- *
- * Module Name: acparser.h - AML Parser subcomponent prototypes and defines
- *       $Revision: 1.48 $
+ * 
+ * Module Name: parser.h - AML Parser subcomponent prototypes and defines
  *
  *****************************************************************************/
 
@@ -9,8 +8,8 @@
  *
  * 1. Copyright Notice
  *
- * Some or all of this work - Copyright (c) 1999, 2000, Intel Corp.
- * All rights reserved.
+ * Some or all of this work - Copyright (c) 1999, Intel Corp.  All rights
+ * reserved.
  *
  * 2. License
  *
@@ -38,9 +37,9 @@
  * The above copyright and patent license is granted only if the following
  * conditions are met:
  *
- * 3. Conditions
+ * 3. Conditions 
  *
- * 3.1. Redistribution of Source with Rights to Further Distribute Source.
+ * 3.1. Redistribution of Source with Rights to Further Distribute Source.  
  * Redistribution of source code of any substantial portion of the Covered
  * Code or modification with rights to further distribute source must include
  * the above Copyright Notice, the above License, this list of Conditions,
@@ -48,11 +47,11 @@
  * Licensee must cause all Covered Code to which Licensee contributes to
  * contain a file documenting the changes Licensee made to create that Covered
  * Code and the date of any change.  Licensee must include in that file the
- * documentation of any changes made by any predecessor Licensee.  Licensee
+ * documentation of any changes made by any predecessor Licensee.  Licensee 
  * must include a prominent statement that the modification is derived,
  * directly or indirectly, from Original Intel Code.
  *
- * 3.2. Redistribution of Source with no Rights to Further Distribute Source.
+ * 3.2. Redistribution of Source with no Rights to Further Distribute Source.  
  * Redistribution of source code of any substantial portion of the Covered
  * Code or modification without rights to further distribute source must
  * include the following Disclaimer and Export Compliance provision in the
@@ -86,7 +85,7 @@
  * INSTALLATION, TRAINING OR OTHER SERVICES.  INTEL WILL NOT PROVIDE ANY
  * UPDATES, ENHANCEMENTS OR EXTENSIONS.  INTEL SPECIFICALLY DISCLAIMS ANY
  * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
- * PARTICULAR PURPOSE.
+ * PARTICULAR PURPOSE. 
  *
  * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
  * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
@@ -115,8 +114,10 @@
  *****************************************************************************/
 
 
-#ifndef __ACPARSER_H__
-#define __ACPARSER_H__
+#ifndef _PARSER_H_
+#define _PARSER_H_
+
+
 
 
 #define OP_HAS_RETURN_VALUE         1
@@ -129,309 +130,587 @@
 
 #define ACPI_MAX_AML                ((UINT8 *)(~0UL))
 
+/* For PsxMthStackSetValue */
+
+#define MTH_TYPE_LOCAL              0
+#define MTH_TYPE_ARG                1
+
 
-#define ACPI_PARSE_DELETE_TREE          0x0001
-#define ACPI_PARSE_NO_TREE_DELETE       0x0000
-#define ACPI_PARSE_TREE_MASK            0x0001
 
-#define ACPI_PARSE_LOAD_PASS1           0x0010
-#define ACPI_PARSE_LOAD_PASS2           0x0020
-#define ACPI_PARSE_EXECUTE              0x0030
-#define ACPI_PARSE_MODE_MASK            0x0030
 
 /* psapi - Parser external interfaces */
 
 ACPI_STATUS
-AcpiPsxLoadTable (
-    UINT8                   *PcodeAddr,
-    UINT32                  PcodeLength);
+PsxLoadTable (
+    UINT8                   *PcodeAddr, 
+    INT32                   PcodeLength);
 
 ACPI_STATUS
-AcpiPsxExecute (
-    ACPI_NAMESPACE_NODE     *MethodNode,
-    ACPI_OPERAND_OBJECT     **Params,
-    ACPI_OPERAND_OBJECT     **ReturnObjDesc);
+PsxExecute (
+    NAME_TABLE_ENTRY        *MethodEntry,
+    ACPI_OBJECT_INTERNAL    **Params,
+    ACPI_OBJECT_INTERNAL    **ReturnObjDesc);
+
+ACPI_STATUS
+PsxGetRegionData (
+    ACPI_OBJECT_INTERNAL    *RgnDesc);
 
 
-BOOLEAN
-AcpiPsIsNamespaceObjectOp (
-    UINT16                  Opcode);
-BOOLEAN
-AcpiPsIsNamespaceOp (
-    UINT16                  Opcode);
+/* Common interfaces */
+
+ACPI_STATUS
+PsxObjStackPush (
+    void                    *Object,
+    ACPI_WALK_STATE         *WalkState);
+
+ACPI_STATUS
+PsxObjStackPop (
+    UINT32                  PopCount,
+    ACPI_WALK_STATE         *WalkState);
+
+void *
+PsxObjStackGetValue (
+    UINT32                  Index,
+    ACPI_WALK_STATE         *WalkState);
+
 
 
 /******************************************************************************
+ * 
+ * Parser to Interpreter interface layer
  *
+ *****************************************************************************/
+
+
+/* psxctrl - Parser/Interpreter interface, control stack routines */
+
+ACPI_CTRL_STATE *
+PsCreateControlState (void);
+
+void
+PsPushControlState (
+    ACPI_CTRL_STATE         *ControlState,
+    ACPI_WALK_STATE         *WalkState);
+
+ACPI_CTRL_STATE *
+PsPopControlState (
+    ACPI_WALK_STATE         *WalkState);
+
+ACPI_STATUS 
+PsxExecBeginControlOp (
+    ACPI_WALK_STATE         *WalkState,
+    ACPI_GENERIC_OP         *Op);
+
+ACPI_STATUS 
+PsxExecEndControlOp (
+    ACPI_WALK_STATE         *WalkState,
+    ACPI_GENERIC_OP         *Op);
+
+
+/* psxexec - Parser/Interpreter interface, method execution callbacks */
+
+ACPI_STATUS
+PsxExecBeginOp (
+    ACPI_WALK_STATE         *State,
+    ACPI_GENERIC_OP         *Op);
+
+ACPI_STATUS
+PsxExecEndOp (
+    ACPI_WALK_STATE         *State,
+    ACPI_GENERIC_OP         *Op);
+
+
+/* psxfield - Parser/Interpreter interface for AML fields */
+
+
+ACPI_STATUS
+PsxCreateField (
+    ACPI_GENERIC_OP         *Op,
+    ACPI_HANDLE             Region);
+
+ACPI_STATUS
+PsxCreateBankField (
+    ACPI_GENERIC_OP         *Op,
+    ACPI_HANDLE             Region);
+
+ACPI_STATUS
+PsxCreateIndexField (
+    ACPI_GENERIC_OP         *Op,
+    ACPI_HANDLE             Region);
+
+
+/* psxload - Parser/Interpreter interface, namespace load callbacks */
+
+ACPI_STATUS
+PsxLoadBeginMethodOp (
+    ACPI_WALK_STATE         *State,
+    ACPI_GENERIC_OP         *Op);
+
+ACPI_STATUS
+PsxLoadBeginOp (
+    ACPI_WALK_STATE         *State,
+    ACPI_GENERIC_OP         *Op);
+
+ACPI_STATUS
+PsxLoadEndOp (
+    ACPI_WALK_STATE         *State,
+    ACPI_GENERIC_OP         *Op);
+
+
+/* psxmargs - method stack utilities */
+
+
+ACPI_STATUS
+PsxMthStackDeleteArgs (
+    ACPI_WALK_STATE         *WalkState);
+
+BOOLEAN
+PsxIsMethodValue (
+    ACPI_OBJECT_INTERNAL    *ObjDesc);
+
+INT32
+PsxMthStackLevel (
+    void);
+
+ACPI_OBJECT_TYPE
+PsxMthStackGetType (
+    UINT32                  Type,
+    UINT32                  Index);
+
+ACPI_STATUS
+PsxMthStackGetValue (
+    UINT32                  Type,
+    UINT32                  Index, 
+    ACPI_OBJECT_INTERNAL    **ObjDesc);
+
+ACPI_STATUS
+PsxMthStackSetValue (
+    UINT32                  Type,
+    UINT32                  Index, 
+    ACPI_OBJECT_INTERNAL    *ObjDesc); 
+
+ACPI_STATUS
+PsxMthStackPop (
+    void);
+
+ACPI_STATUS
+PsxMthStackPush (
+    ACPI_OBJECT_INTERNAL    **Params);
+
+ACPI_STATUS
+PsxMthStackDeleteValue (
+    UINT32                  Type,
+    UINT32                  Index);
+
+ACPI_STATUS
+PsxMthStackInitArgs (
+    ACPI_OBJECT_INTERNAL    **Params,
+    UINT32                  ParamCount);
+
+NAME_TABLE_ENTRY *
+PsxMthStackGetNte (
+    UINT32                  Type,
+    UINT32                  Index);
+
+ACPI_STATUS
+PsxMthStackInit (
+    ACPI_WALK_STATE         *WalkState);
+
+
+/* psxmethod - Parser/Interpreter interface - control method parsing */
+
+ACPI_STATUS
+PsxParseMethod (
+    ACPI_HANDLE             ObjHandle);
+
+ACPI_STATUS
+PsxCallControlMethod (
+    ACPI_WALK_LIST          *WalkList,
+    ACPI_WALK_STATE         *WalkState,
+    ACPI_GENERIC_OP         *Op);
+
+ACPI_STATUS
+PsxRestartControlMethod (
+    ACPI_WALK_STATE         *WalkState,
+    ACPI_OBJECT_INTERNAL    *ReturnDesc);
+
+
+/* psxobj - Parser/Interpreter interface - object initialization and conversion */
+
+ACPI_STATUS
+PsxInitOneObject (
+    ACPI_HANDLE             ObjHandle, 
+    UINT32                  Level, 
+    void                    *Context,
+    void                    **ReturnValue);
+
+ACPI_STATUS
+PsxInitializeObjects (
+    void);
+
+ACPI_STATUS
+PsxBuildInternalPackageObj (
+    ACPI_WALK_STATE         *WalkState,
+    ACPI_GENERIC_OP         *op,
+    ACPI_OBJECT_INTERNAL    **ObjDesc);
+
+ACPI_STATUS
+PsxBuildInternalObject (
+    ACPI_WALK_STATE         *WalkState,
+    ACPI_GENERIC_OP         *op,
+    ACPI_OBJECT_INTERNAL    **ObjDescPtr);
+
+ACPI_STATUS
+PsxInitObjectFromOp (
+    ACPI_WALK_STATE         *WalkState,
+    ACPI_GENERIC_OP         *Op,
+    UINT16                  Opcode,
+    ACPI_OBJECT_INTERNAL    *ObjDesc);
+
+ACPI_STATUS
+PsxCreateNamedObject (
+    ACPI_WALK_STATE         *WalkState,
+    NAME_TABLE_ENTRY        *Entry,
+    ACPI_GENERIC_OP         *Op);
+
+
+/* psxregn - Parser/Interpreter interface - Op Region parsing */
+
+ACPI_STATUS
+PsxEvalRegionOperands (
+    ACPI_WALK_STATE         *WalkState,
+    ACPI_GENERIC_OP         *Op);
+
+ACPI_STATUS
+PsxInitializeRegion (
+    ACPI_HANDLE             ObjHandle);
+
+    
+/* psxutils - Parser/Interpreter interface utility routines */
+
+void
+PsxDeleteResultIfNotUsed (
+    ACPI_GENERIC_OP         *Op,
+    ACPI_OBJECT_INTERNAL    *ResultObj,
+    ACPI_WALK_STATE         *WalkState);
+
+ACPI_STATUS
+PsxCreateOperand (
+    ACPI_WALK_STATE         *WalkState,
+    ACPI_GENERIC_OP         *Arg);
+
+ACPI_STATUS
+PsxCreateOperands (
+    ACPI_WALK_STATE         *WalkState,
+    ACPI_GENERIC_OP         *FirstArg);
+
+ACPI_STATUS
+PsxResolveOperands (
+    ACPI_WALK_STATE         *WalkState);
+
+ACPI_OBJECT_TYPE
+PsxMapOpcodeToDataType (
+    UINT16                  Opcode,
+    UINT32                  *OutFlags);
+
+ACPI_OBJECT_TYPE 
+PsxMapNamedOpcodeToDataType (
+    UINT16                  Opcode);
+
+
+
+
+/******************************************************************************
+ * 
  * Parser interfaces
  *
  *****************************************************************************/
 
 
+
 /* psargs - Parse AML opcode arguments */
 
 UINT8 *
-AcpiPsGetNextPackageEnd (
+PsGetNextPackageEnd (
     ACPI_PARSE_STATE        *ParserState);
 
-UINT32
-AcpiPsGetNextPackageLength (
-    ACPI_PARSE_STATE        *ParserState);
-
-NATIVE_CHAR *
-AcpiPsGetNextNamestring (
+char *
+PsGetNextNamestring (
     ACPI_PARSE_STATE        *ParserState);
 
 void
-AcpiPsGetNextSimpleArg (
+PsGetNextSimpleArg (
     ACPI_PARSE_STATE        *ParserState,
-    UINT32                  ArgType,        /* type of argument */
-    ACPI_PARSE_OBJECT       *Arg);           /* (OUT) argument data */
+    INT32                   ArgType,        /* type of argument */
+    ACPI_GENERIC_OP         *Arg);           /* (OUT) argument data */
 
 void
-AcpiPsGetNextNamepath (
+PsGetNextNamepath (
     ACPI_PARSE_STATE        *ParserState,
-    ACPI_PARSE_OBJECT       *Arg,
+    ACPI_GENERIC_OP         *Arg,
     UINT32                  *ArgCount,
     BOOLEAN                 MethodCall);
 
-ACPI_PARSE_OBJECT *
-AcpiPsGetNextField (
+ACPI_GENERIC_OP *
+PsGetNextField (
     ACPI_PARSE_STATE        *ParserState);
 
-ACPI_PARSE_OBJECT *
-AcpiPsGetNextArg (
-    ACPI_PARSE_STATE        *ParserState,
-    UINT32                  ArgType,
+ACPI_GENERIC_OP *
+PsGetNextArg (
+    ACPI_PARSE_STATE        *ParserState, 
+    INT32                   ArgType, 
     UINT32                  *ArgCount);
 
 
 /* psopcode - AML Opcode information */
 
-ACPI_OPCODE_INFO *
-AcpiPsGetOpcodeInfo (
+ACPI_OP_INFO *
+PsGetOpcodeInfo (
     UINT16                  Opcode);
 
-NATIVE_CHAR *
-AcpiPsGetOpcodeName (
+char *
+PsGetOpcodeName (
     UINT16                  Opcode);
 
 
 /* psparse - top level parsing routines */
 
-ACPI_STATUS
-AcpiPsFindObject (
-    UINT16                  Opcode,
-    ACPI_PARSE_OBJECT       *Op,
-    ACPI_WALK_STATE         *WalkState,
-    ACPI_PARSE_OBJECT       **OutOp);
-
 void
-AcpiPsDeleteParseTree (
-    ACPI_PARSE_OBJECT       *root);
+PsDeleteParseTree (
+    ACPI_GENERIC_OP         *root);
 
 ACPI_STATUS
-AcpiPsParseLoop (
-    ACPI_WALK_STATE         *WalkState);
+PsParseLoop (
+    ACPI_PARSE_STATE        *ParserState);
+
 
 ACPI_STATUS
-AcpiPsParseAml (
-    ACPI_PARSE_OBJECT       *StartScope,
-    UINT8                   *Aml,
-    UINT32                  AmlSize,
-    UINT32                  ParseFlags,
-    ACPI_NAMESPACE_NODE     *MethodNode,
-    ACPI_OPERAND_OBJECT     **Params,
-    ACPI_OPERAND_OBJECT     **CallerReturnDesc,
-    ACPI_PARSE_DOWNWARDS    DescendingCallback,
-    ACPI_PARSE_UPWARDS      AscendingCallback);
+PsParseAml (
+    ACPI_GENERIC_OP         *StartScope,
+    UINT8                   *Aml, 
+    INT32                   AmlSize);
 
 ACPI_STATUS
-AcpiPsParseTable (
-    UINT8                   *aml,
-    UINT32                  amlSize,
-    ACPI_PARSE_DOWNWARDS    DescendingCallback,
-    ACPI_PARSE_UPWARDS      AscendingCallback,
-    ACPI_PARSE_OBJECT       **RootObject);
+PsParseTable (
+    UINT8                   *aml, 
+    INT32                   amlSize,
+    INTERPRETER_CALLBACK    DescendingCallback,
+    INTERPRETER_CALLBACK    AscendingCallback,
+    ACPI_GENERIC_OP         **RootObject);
 
 UINT16
-AcpiPsPeekOpcode (
+PsPeekOpcode (
     ACPI_PARSE_STATE        *state);
 
 
+
 /* psscope - Scope stack management routines */
 
 
 ACPI_STATUS
-AcpiPsInitScope (
+PsInitScope (
     ACPI_PARSE_STATE        *ParserState,
-    ACPI_PARSE_OBJECT       *Root);
+    ACPI_GENERIC_OP         *Root);
 
-ACPI_PARSE_OBJECT *
-AcpiPsGetParentScope (
+ACPI_GENERIC_OP *
+PsGetParentScope (
     ACPI_PARSE_STATE        *state);
 
 BOOLEAN
-AcpiPsHasCompletedScope (
+PsHasCompletedScope (
     ACPI_PARSE_STATE        *ParserState);
 
-void
-AcpiPsPopScope (
-    ACPI_PARSE_STATE        *ParserState,
-    ACPI_PARSE_OBJECT       **Op,
-    UINT32                  *ArgList,
-    UINT32                  *ArgCount);
-
 ACPI_STATUS
-AcpiPsPushScope (
+PsPushScope (
     ACPI_PARSE_STATE        *ParserState,
-    ACPI_PARSE_OBJECT       *Op,
-    UINT32                  RemainingArgs,
+    ACPI_GENERIC_OP         *Op, 
+    char                    *NextArg,
     UINT32                  ArgCount);
 
 void
-AcpiPsCleanupScope (
+PsPopScope (
+    ACPI_PARSE_STATE        *ParserState,
+    ACPI_GENERIC_OP         **Op,
+    char                    **NextArg);
+
+void
+PsCleanupScope (
     ACPI_PARSE_STATE        *state);
 
 
 /* pstree - parse tree manipulation routines */
 
-void
-AcpiPsAppendArg(
-    ACPI_PARSE_OBJECT       *op,
-    ACPI_PARSE_OBJECT       *arg);
+void 
+PsAppendArg(
+    ACPI_GENERIC_OP         *op, 
+    ACPI_GENERIC_OP         *arg);
 
-ACPI_PARSE_OBJECT*
-AcpiPsFind (
-    ACPI_PARSE_OBJECT       *Scope,
-    NATIVE_CHAR             *Path,
+ACPI_GENERIC_OP*
+PsFind (
+    ACPI_GENERIC_OP         *Scope, 
+    char                    *Path,
     UINT16                  Opcode,
     UINT32                  Create);
 
-ACPI_PARSE_OBJECT *
-AcpiPsGetArg(
-    ACPI_PARSE_OBJECT       *op,
+ACPI_GENERIC_OP *
+PsGetArg(
+    ACPI_GENERIC_OP         *op, 
     UINT32                   argn);
 
-ACPI_PARSE_OBJECT *
-AcpiPsGetChild (
-    ACPI_PARSE_OBJECT       *op);
+ACPI_GENERIC_OP *
+PsGetChild (
+    ACPI_GENERIC_OP         *op);
+
+ACPI_GENERIC_OP *
+PsGetDepthNext (
+    ACPI_GENERIC_OP         *Origin, 
+    ACPI_GENERIC_OP         *Op);
 
-ACPI_PARSE_OBJECT *
-AcpiPsGetDepthNext (
-    ACPI_PARSE_OBJECT       *Origin,
-    ACPI_PARSE_OBJECT       *Op);
 
 
 /* pswalk - parse tree walk routines */
 
 ACPI_STATUS
-AcpiPsWalkParsedAml (
-    ACPI_PARSE_OBJECT       *StartOp,
-    ACPI_PARSE_OBJECT       *EndOp,
-    ACPI_OPERAND_OBJECT     *MthDesc,
-    ACPI_NAMESPACE_NODE     *StartNode,
-    ACPI_OPERAND_OBJECT     **Params,
-    ACPI_OPERAND_OBJECT     **CallerReturnDesc,
-    ACPI_OWNER_ID           OwnerId,
-    ACPI_PARSE_DOWNWARDS    DescendingCallback,
-    ACPI_PARSE_UPWARDS      AscendingCallback);
+PsWalkParsedAml (
+    ACPI_GENERIC_OP         *StartOp,
+    ACPI_GENERIC_OP         *EndOp,
+    ACPI_OBJECT_INTERNAL    *MthDesc,
+    ACPI_OBJECT_INTERNAL    **Params,
+    ACPI_OBJECT_INTERNAL    **CallerReturnDesc,
+    INTERPRETER_CALLBACK    DescendingCallback,
+    INTERPRETER_CALLBACK    AscendingCallback);
 
 ACPI_STATUS
-AcpiPsGetNextWalkOp (
+PsGetNextWalkOp (
     ACPI_WALK_STATE         *WalkState,
-    ACPI_PARSE_OBJECT       *Op,
-    ACPI_PARSE_UPWARDS      AscendingCallback);
+    ACPI_GENERIC_OP         *Op,
+    INTERPRETER_CALLBACK    AscendingCallback);
+
+ACPI_WALK_STATE *
+PsGetCurrentWalkState (
+    ACPI_WALK_LIST          *WalkList);
+
+
+/* pswstate - parser WALK_STATE management routines */
+
+ACPI_WALK_STATE *
+PsCreateWalkState (
+    ACPI_GENERIC_OP         *Origin,
+    ACPI_OBJECT_INTERNAL    *MthDesc,
+    ACPI_WALK_LIST          *WalkList);
+
+ACPI_STATUS
+PsxObjStackDeleteAll (
+    ACPI_WALK_STATE         *WalkState);
+
+ACPI_STATUS
+PsxObjStackPopAndDelete (
+    UINT32                  PopCount,
+    ACPI_WALK_STATE         *WalkState);
+
+void
+PsDeleteWalkState (
+    ACPI_WALK_STATE         *WalkState);
+
+ACPI_WALK_STATE *
+PsPopWalkState (
+    ACPI_WALK_LIST          *WalkList);
+
+ACPI_STATUS
+PsxResultStackPop (
+    ACPI_OBJECT_INTERNAL    **Object,
+    ACPI_WALK_STATE         *WalkState);
+
+ACPI_STATUS
+PsxResultStackPush (
+    void                    *Object,
+    ACPI_WALK_STATE         *WalkState);
+
+ACPI_STATUS
+PsxResultStackClear (
+    ACPI_WALK_STATE         *WalkState);
 
 
 /* psutils - parser utilities */
 
-
-ACPI_PARSE_STATE *
-AcpiPsCreateState (
-    UINT8                   *Aml,
-    UINT32                  AmlSize);
-
 void
-AcpiPsInitOp (
-    ACPI_PARSE_OBJECT       *op,
+PsInitOp (
+    ACPI_GENERIC_OP         *op,
     UINT16                  opcode);
 
-ACPI_PARSE_OBJECT *
-AcpiPsAllocOp (
-    UINT16                  opcode);
-
-void
-AcpiPsFreeOp (
-    ACPI_PARSE_OBJECT       *Op);
-
-void
-AcpiPsDeleteParseCache (
-    void);
-
-BOOLEAN
-AcpiPsIsLeadingChar (
-    UINT32                  c);
-
-BOOLEAN
-AcpiPsIsPrefixChar (
-    UINT32                  c);
-
-BOOLEAN
-AcpiPsIsNamedOp (
+ACPI_GENERIC_OP * 
+PsAllocOp (
     UINT16                  opcode);
 
 BOOLEAN
-AcpiPsIsNodeOp (
+PsIsLeadingChar (
+    INT32                   c);
+
+BOOLEAN
+PsIsPrefixChar (
+    INT32                   c);
+
+BOOLEAN
+PsIsNamedOp (
     UINT16                  opcode);
 
 BOOLEAN
-AcpiPsIsDeferredOp (
+PsIsNamedObjectOp (
     UINT16                  opcode);
 
 BOOLEAN
-AcpiPsIsBytelistOp(
+PsIsDeferredOp (
     UINT16                  opcode);
 
 BOOLEAN
-AcpiPsIsFieldOp(
+PsIsBytelistOp(
     UINT16                  opcode);
 
 BOOLEAN
-AcpiPsIsCreateFieldOp (
-    UINT16                  Opcode);
+PsIsFieldOp(
+    UINT16                  opcode);
 
-ACPI_PARSE2_OBJECT*
-AcpiPsToExtendedOp(
-    ACPI_PARSE_OBJECT       *op);
+ACPI_NAMED_OP*
+PsToNamedOp(
+    ACPI_GENERIC_OP         *op);
+
+ACPI_DEFERRED_OP *
+PsToDeferredOp (
+    ACPI_GENERIC_OP         *Op);
+
+ACPI_BYTELIST_OP*
+PsToBytelistOp(
+    ACPI_GENERIC_OP         *op);
 
 UINT32
-AcpiPsGetName(
-    ACPI_PARSE_OBJECT       *op);
+PsGetName(
+    ACPI_GENERIC_OP         *op);
 
 void
-AcpiPsSetName(
-    ACPI_PARSE_OBJECT       *op,
+PsSetName(
+    ACPI_GENERIC_OP         *op, 
     UINT32                  name);
 
 
 /* psdump - display parser tree */
 
-UINT32
-AcpiPsSprintPath (
-    NATIVE_CHAR             *BufferStart,
+INT32
+PsSprintPath (
+    char                    *BufferStart,
     UINT32                  BufferSize,
-    ACPI_PARSE_OBJECT       *Op);
+    ACPI_GENERIC_OP         *Op);
 
-UINT32
-AcpiPsSprintOp (
-    NATIVE_CHAR             *BufferStart,
-    UINT32                  BufferSize,
-    ACPI_PARSE_OBJECT       *Op);
+INT32
+PsSprintOp (
+    char                    *BufferStart, 
+    UINT32                  BufferSize, 
+    ACPI_GENERIC_OP         *Op);
 
-void
-AcpiPsShow (
-    ACPI_PARSE_OBJECT       *op);
+void 
+PsShow (
+    ACPI_GENERIC_OP         *op);
 
 
-#endif /* __ACPARSER_H__ */
+
+
+#endif /* _PARSER_H_ */