Deleted Added
sdiff udiff text old ( 151937 ) new ( 167802 )
full compact
1/******************************************************************************
2 *
3 * Module Name: nsparse - namespace interface to AML parser
4 * $Revision: 1.10 $
5 *
6 *****************************************************************************/
7
8/******************************************************************************
9 *
10 * 1. Copyright Notice
11 *
12 * Some or all of this work - Copyright (c) 1999 - 2005, Intel Corp.
13 * All rights reserved.
14 *
15 * 2. License
16 *
17 * 2.1. This is your license from Intel Corp. under its intellectual property
18 * rights. You may have additional license terms from the party that provided
19 * you this software, covering your right to use that party's intellectual
20 * property rights.

--- 94 unchanged lines hidden (view full) ---

115 *****************************************************************************/
116
117#define __NSPARSE_C__
118
119#include <contrib/dev/acpica/acpi.h>
120#include <contrib/dev/acpica/acnamesp.h>
121#include <contrib/dev/acpica/acparser.h>
122#include <contrib/dev/acpica/acdispat.h>
123
124
125#define _COMPONENT ACPI_NAMESPACE
126 ACPI_MODULE_NAME ("nsparse")
127
128
129/*******************************************************************************
130 *

--- 5 unchanged lines hidden (view full) ---

136 * RETURN: Status
137 *
138 * DESCRIPTION: Perform one complete parse of an ACPI/AML table.
139 *
140 ******************************************************************************/
141
142ACPI_STATUS
143AcpiNsOneCompleteParse (
144 UINT8 PassNumber,
145 ACPI_TABLE_DESC *TableDesc)
146{
147 ACPI_PARSE_OBJECT *ParseRoot;
148 ACPI_STATUS Status;
149 ACPI_WALK_STATE *WalkState;
150
151
152 ACPI_FUNCTION_TRACE ("NsOneCompleteParse");
153
154
155 /* Create and init a Root Node */
156
157 ParseRoot = AcpiPsCreateScopeOp ();
158 if (!ParseRoot)
159 {
160 return_ACPI_STATUS (AE_NO_MEMORY);
161 }
162
163 /* Create and initialize a new walk state */
164
165 WalkState = AcpiDsCreateWalkState (TableDesc->OwnerId,
166 NULL, NULL, NULL);
167 if (!WalkState)
168 {
169 AcpiPsFreeOp (ParseRoot);
170 return_ACPI_STATUS (AE_NO_MEMORY);
171 }
172
173 Status = AcpiDsInitAmlWalk (WalkState, ParseRoot, NULL,
174 TableDesc->AmlStart, TableDesc->AmlLength,
175 NULL, PassNumber);
176 if (ACPI_FAILURE (Status))
177 {
178 AcpiDsDeleteWalkState (WalkState);
179 return_ACPI_STATUS (Status);
180 }
181
182 /* Parse the AML */
183
184 ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, "*PARSE* pass %d parse\n", PassNumber));
185 Status = AcpiPsParseAml (WalkState);
186
187 AcpiPsDeleteParseTree (ParseRoot);
188 return_ACPI_STATUS (Status);
189}

--- 9 unchanged lines hidden (view full) ---

199 * RETURN: Status
200 *
201 * DESCRIPTION: Parse AML within an ACPI table and return a tree of ops
202 *
203 ******************************************************************************/
204
205ACPI_STATUS
206AcpiNsParseTable (
207 ACPI_TABLE_DESC *TableDesc,
208 ACPI_NAMESPACE_NODE *StartNode)
209{
210 ACPI_STATUS Status;
211
212
213 ACPI_FUNCTION_TRACE ("NsParseTable");
214
215
216 /*
217 * AML Parse, pass 1
218 *
219 * In this pass, we load most of the namespace. Control methods
220 * are not parsed until later. A parse tree is not created. Instead,
221 * each Parser Op subtree is deleted when it is finished. This saves
222 * a great deal of memory, and allows a small cache of parse objects
223 * to service the entire parse. The second pass of the parse then
224 * performs another complete parse of the AML..
225 */
226 ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, "**** Start pass 1\n"));
227 Status = AcpiNsOneCompleteParse (1, TableDesc);
228 if (ACPI_FAILURE (Status))
229 {
230 return_ACPI_STATUS (Status);
231 }
232
233 /*
234 * AML Parse, pass 2
235 *
236 * In this pass, we resolve forward references and other things
237 * that could not be completed during the first pass.
238 * Another complete parse of the AML is performed, but the
239 * overhead of this is compensated for by the fact that the
240 * parse objects are all cached.
241 */
242 ACPI_DEBUG_PRINT ((ACPI_DB_PARSE, "**** Start pass 2\n"));
243 Status = AcpiNsOneCompleteParse (2, TableDesc);
244 if (ACPI_FAILURE (Status))
245 {
246 return_ACPI_STATUS (Status);
247 }
248
249 return_ACPI_STATUS (Status);
250}
251
252