dmnames.c revision 1.1.1.2.4.2 1 1.1.1.2.4.2 rmind /*******************************************************************************
2 1.1.1.2.4.2 rmind *
3 1.1.1.2.4.2 rmind * Module Name: dmnames - AML disassembler, names, namestrings, pathnames
4 1.1.1.2.4.2 rmind *
5 1.1.1.2.4.2 rmind ******************************************************************************/
6 1.1.1.2.4.2 rmind
7 1.1.1.2.4.2 rmind /*
8 1.1.1.2.4.2 rmind * Copyright (C) 2000 - 2011, Intel Corp.
9 1.1.1.2.4.2 rmind * All rights reserved.
10 1.1.1.2.4.2 rmind *
11 1.1.1.2.4.2 rmind * Redistribution and use in source and binary forms, with or without
12 1.1.1.2.4.2 rmind * modification, are permitted provided that the following conditions
13 1.1.1.2.4.2 rmind * are met:
14 1.1.1.2.4.2 rmind * 1. Redistributions of source code must retain the above copyright
15 1.1.1.2.4.2 rmind * notice, this list of conditions, and the following disclaimer,
16 1.1.1.2.4.2 rmind * without modification.
17 1.1.1.2.4.2 rmind * 2. Redistributions in binary form must reproduce at minimum a disclaimer
18 1.1.1.2.4.2 rmind * substantially similar to the "NO WARRANTY" disclaimer below
19 1.1.1.2.4.2 rmind * ("Disclaimer") and any redistribution must be conditioned upon
20 1.1.1.2.4.2 rmind * including a substantially similar Disclaimer requirement for further
21 1.1.1.2.4.2 rmind * binary redistribution.
22 1.1.1.2.4.2 rmind * 3. Neither the names of the above-listed copyright holders nor the names
23 1.1.1.2.4.2 rmind * of any contributors may be used to endorse or promote products derived
24 1.1.1.2.4.2 rmind * from this software without specific prior written permission.
25 1.1.1.2.4.2 rmind *
26 1.1.1.2.4.2 rmind * Alternatively, this software may be distributed under the terms of the
27 1.1.1.2.4.2 rmind * GNU General Public License ("GPL") version 2 as published by the Free
28 1.1.1.2.4.2 rmind * Software Foundation.
29 1.1.1.2.4.2 rmind *
30 1.1.1.2.4.2 rmind * NO WARRANTY
31 1.1.1.2.4.2 rmind * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
32 1.1.1.2.4.2 rmind * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
33 1.1.1.2.4.2 rmind * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
34 1.1.1.2.4.2 rmind * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
35 1.1.1.2.4.2 rmind * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
36 1.1.1.2.4.2 rmind * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
37 1.1.1.2.4.2 rmind * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
38 1.1.1.2.4.2 rmind * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
39 1.1.1.2.4.2 rmind * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
40 1.1.1.2.4.2 rmind * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
41 1.1.1.2.4.2 rmind * POSSIBILITY OF SUCH DAMAGES.
42 1.1.1.2.4.2 rmind */
43 1.1.1.2.4.2 rmind
44 1.1.1.2.4.2 rmind
45 1.1.1.2.4.2 rmind #include "acpi.h"
46 1.1.1.2.4.2 rmind #include "accommon.h"
47 1.1.1.2.4.2 rmind #include "acparser.h"
48 1.1.1.2.4.2 rmind #include "amlcode.h"
49 1.1.1.2.4.2 rmind #include "acnamesp.h"
50 1.1.1.2.4.2 rmind #include "acdisasm.h"
51 1.1.1.2.4.2 rmind
52 1.1.1.2.4.2 rmind
53 1.1.1.2.4.2 rmind #ifdef ACPI_DISASSEMBLER
54 1.1.1.2.4.2 rmind
55 1.1.1.2.4.2 rmind #define _COMPONENT ACPI_CA_DEBUGGER
56 1.1.1.2.4.2 rmind ACPI_MODULE_NAME ("dmnames")
57 1.1.1.2.4.2 rmind
58 1.1.1.2.4.2 rmind /* Local prototypes */
59 1.1.1.2.4.2 rmind
60 1.1.1.2.4.2 rmind #ifdef ACPI_OBSOLETE_FUNCTIONS
61 1.1.1.2.4.2 rmind void
62 1.1.1.2.4.2 rmind AcpiDmDisplayPath (
63 1.1.1.2.4.2 rmind ACPI_PARSE_OBJECT *Op);
64 1.1.1.2.4.2 rmind #endif
65 1.1.1.2.4.2 rmind
66 1.1.1.2.4.2 rmind
67 1.1.1.2.4.2 rmind /*******************************************************************************
68 1.1.1.2.4.2 rmind *
69 1.1.1.2.4.2 rmind * FUNCTION: AcpiDmDumpName
70 1.1.1.2.4.2 rmind *
71 1.1.1.2.4.2 rmind * PARAMETERS: Name - 4 character ACPI name
72 1.1.1.2.4.2 rmind *
73 1.1.1.2.4.2 rmind * RETURN: Final length of name
74 1.1.1.2.4.2 rmind *
75 1.1.1.2.4.2 rmind * DESCRIPTION: Dump an ACPI name, minus any trailing underscores.
76 1.1.1.2.4.2 rmind *
77 1.1.1.2.4.2 rmind ******************************************************************************/
78 1.1.1.2.4.2 rmind
79 1.1.1.2.4.2 rmind UINT32
80 1.1.1.2.4.2 rmind AcpiDmDumpName (
81 1.1.1.2.4.2 rmind UINT32 Name)
82 1.1.1.2.4.2 rmind {
83 1.1.1.2.4.2 rmind UINT32 i;
84 1.1.1.2.4.2 rmind UINT32 Length;
85 1.1.1.2.4.2 rmind char NewName[4];
86 1.1.1.2.4.2 rmind
87 1.1.1.2.4.2 rmind
88 1.1.1.2.4.2 rmind /* Copy name locally in case the original name is not writeable */
89 1.1.1.2.4.2 rmind
90 1.1.1.2.4.2 rmind *ACPI_CAST_PTR (UINT32, &NewName[0]) = Name;
91 1.1.1.2.4.2 rmind
92 1.1.1.2.4.2 rmind /* Ensure that the name is printable, even if we have to fix it */
93 1.1.1.2.4.2 rmind
94 1.1.1.2.4.2 rmind AcpiUtRepairName (NewName);
95 1.1.1.2.4.2 rmind
96 1.1.1.2.4.2 rmind /* Remove all trailing underscores from the name */
97 1.1.1.2.4.2 rmind
98 1.1.1.2.4.2 rmind Length = ACPI_NAME_SIZE;
99 1.1.1.2.4.2 rmind for (i = (ACPI_NAME_SIZE - 1); i != 0; i--)
100 1.1.1.2.4.2 rmind {
101 1.1.1.2.4.2 rmind if (NewName[i] == '_')
102 1.1.1.2.4.2 rmind {
103 1.1.1.2.4.2 rmind Length--;
104 1.1.1.2.4.2 rmind }
105 1.1.1.2.4.2 rmind else
106 1.1.1.2.4.2 rmind {
107 1.1.1.2.4.2 rmind break;
108 1.1.1.2.4.2 rmind }
109 1.1.1.2.4.2 rmind }
110 1.1.1.2.4.2 rmind
111 1.1.1.2.4.2 rmind /* Dump the name, up to the start of the trailing underscores */
112 1.1.1.2.4.2 rmind
113 1.1.1.2.4.2 rmind for (i = 0; i < Length; i++)
114 1.1.1.2.4.2 rmind {
115 1.1.1.2.4.2 rmind AcpiOsPrintf ("%c", NewName[i]);
116 1.1.1.2.4.2 rmind }
117 1.1.1.2.4.2 rmind
118 1.1.1.2.4.2 rmind return (Length);
119 1.1.1.2.4.2 rmind }
120 1.1.1.2.4.2 rmind
121 1.1.1.2.4.2 rmind
122 1.1.1.2.4.2 rmind /*******************************************************************************
123 1.1.1.2.4.2 rmind *
124 1.1.1.2.4.2 rmind * FUNCTION: AcpiPsDisplayObjectPathname
125 1.1.1.2.4.2 rmind *
126 1.1.1.2.4.2 rmind * PARAMETERS: WalkState - Current walk state
127 1.1.1.2.4.2 rmind * Op - Object whose pathname is to be obtained
128 1.1.1.2.4.2 rmind *
129 1.1.1.2.4.2 rmind * RETURN: Status
130 1.1.1.2.4.2 rmind *
131 1.1.1.2.4.2 rmind * DESCRIPTION: Diplay the pathname associated with a named object. Two
132 1.1.1.2.4.2 rmind * versions. One searches the parse tree (for parser-only
133 1.1.1.2.4.2 rmind * applications suchas AcpiDump), and the other searches the
134 1.1.1.2.4.2 rmind * ACPI namespace (the parse tree is probably deleted)
135 1.1.1.2.4.2 rmind *
136 1.1.1.2.4.2 rmind ******************************************************************************/
137 1.1.1.2.4.2 rmind
138 1.1.1.2.4.2 rmind ACPI_STATUS
139 1.1.1.2.4.2 rmind AcpiPsDisplayObjectPathname (
140 1.1.1.2.4.2 rmind ACPI_WALK_STATE *WalkState,
141 1.1.1.2.4.2 rmind ACPI_PARSE_OBJECT *Op)
142 1.1.1.2.4.2 rmind {
143 1.1.1.2.4.2 rmind ACPI_STATUS Status;
144 1.1.1.2.4.2 rmind ACPI_NAMESPACE_NODE *Node;
145 1.1.1.2.4.2 rmind ACPI_BUFFER Buffer;
146 1.1.1.2.4.2 rmind UINT32 DebugLevel;
147 1.1.1.2.4.2 rmind
148 1.1.1.2.4.2 rmind
149 1.1.1.2.4.2 rmind /* Save current debug level so we don't get extraneous debug output */
150 1.1.1.2.4.2 rmind
151 1.1.1.2.4.2 rmind DebugLevel = AcpiDbgLevel;
152 1.1.1.2.4.2 rmind AcpiDbgLevel = 0;
153 1.1.1.2.4.2 rmind
154 1.1.1.2.4.2 rmind /* Just get the Node out of the Op object */
155 1.1.1.2.4.2 rmind
156 1.1.1.2.4.2 rmind Node = Op->Common.Node;
157 1.1.1.2.4.2 rmind if (!Node)
158 1.1.1.2.4.2 rmind {
159 1.1.1.2.4.2 rmind /* Node not defined in this scope, look it up */
160 1.1.1.2.4.2 rmind
161 1.1.1.2.4.2 rmind Status = AcpiNsLookup (WalkState->ScopeInfo, Op->Common.Value.String,
162 1.1.1.2.4.2 rmind ACPI_TYPE_ANY, ACPI_IMODE_EXECUTE, ACPI_NS_SEARCH_PARENT,
163 1.1.1.2.4.2 rmind WalkState, &(Node));
164 1.1.1.2.4.2 rmind
165 1.1.1.2.4.2 rmind if (ACPI_FAILURE (Status))
166 1.1.1.2.4.2 rmind {
167 1.1.1.2.4.2 rmind /*
168 1.1.1.2.4.2 rmind * We can't get the pathname since the object
169 1.1.1.2.4.2 rmind * is not in the namespace. This can happen during single
170 1.1.1.2.4.2 rmind * stepping where a dynamic named object is *about* to be created.
171 1.1.1.2.4.2 rmind */
172 1.1.1.2.4.2 rmind AcpiOsPrintf (" [Path not found]");
173 1.1.1.2.4.2 rmind goto Exit;
174 1.1.1.2.4.2 rmind }
175 1.1.1.2.4.2 rmind
176 1.1.1.2.4.2 rmind /* Save it for next time. */
177 1.1.1.2.4.2 rmind
178 1.1.1.2.4.2 rmind Op->Common.Node = Node;
179 1.1.1.2.4.2 rmind }
180 1.1.1.2.4.2 rmind
181 1.1.1.2.4.2 rmind /* Convert NamedDesc/handle to a full pathname */
182 1.1.1.2.4.2 rmind
183 1.1.1.2.4.2 rmind Buffer.Length = ACPI_ALLOCATE_LOCAL_BUFFER;
184 1.1.1.2.4.2 rmind Status = AcpiNsHandleToPathname (Node, &Buffer);
185 1.1.1.2.4.2 rmind if (ACPI_FAILURE (Status))
186 1.1.1.2.4.2 rmind {
187 1.1.1.2.4.2 rmind AcpiOsPrintf ("****Could not get pathname****)");
188 1.1.1.2.4.2 rmind goto Exit;
189 1.1.1.2.4.2 rmind }
190 1.1.1.2.4.2 rmind
191 1.1.1.2.4.2 rmind AcpiOsPrintf (" (Path %s)", (char *) Buffer.Pointer);
192 1.1.1.2.4.2 rmind ACPI_FREE (Buffer.Pointer);
193 1.1.1.2.4.2 rmind
194 1.1.1.2.4.2 rmind
195 1.1.1.2.4.2 rmind Exit:
196 1.1.1.2.4.2 rmind /* Restore the debug level */
197 1.1.1.2.4.2 rmind
198 1.1.1.2.4.2 rmind AcpiDbgLevel = DebugLevel;
199 1.1.1.2.4.2 rmind return (Status);
200 1.1.1.2.4.2 rmind }
201 1.1.1.2.4.2 rmind
202 1.1.1.2.4.2 rmind
203 1.1.1.2.4.2 rmind /*******************************************************************************
204 1.1.1.2.4.2 rmind *
205 1.1.1.2.4.2 rmind * FUNCTION: AcpiDmNamestring
206 1.1.1.2.4.2 rmind *
207 1.1.1.2.4.2 rmind * PARAMETERS: Name - ACPI Name string to store
208 1.1.1.2.4.2 rmind *
209 1.1.1.2.4.2 rmind * RETURN: None
210 1.1.1.2.4.2 rmind *
211 1.1.1.2.4.2 rmind * DESCRIPTION: Decode and dump an ACPI namestring. Handles prefix characters
212 1.1.1.2.4.2 rmind *
213 1.1.1.2.4.2 rmind ******************************************************************************/
214 1.1.1.2.4.2 rmind
215 1.1.1.2.4.2 rmind void
216 1.1.1.2.4.2 rmind AcpiDmNamestring (
217 1.1.1.2.4.2 rmind char *Name)
218 1.1.1.2.4.2 rmind {
219 1.1.1.2.4.2 rmind UINT32 SegCount;
220 1.1.1.2.4.2 rmind
221 1.1.1.2.4.2 rmind
222 1.1.1.2.4.2 rmind if (!Name)
223 1.1.1.2.4.2 rmind {
224 1.1.1.2.4.2 rmind return;
225 1.1.1.2.4.2 rmind }
226 1.1.1.2.4.2 rmind
227 1.1.1.2.4.2 rmind /* Handle all Scope Prefix operators */
228 1.1.1.2.4.2 rmind
229 1.1.1.2.4.2 rmind while (AcpiPsIsPrefixChar (ACPI_GET8 (Name)))
230 1.1.1.2.4.2 rmind {
231 1.1.1.2.4.2 rmind /* Append prefix character */
232 1.1.1.2.4.2 rmind
233 1.1.1.2.4.2 rmind AcpiOsPrintf ("%1c", ACPI_GET8 (Name));
234 1.1.1.2.4.2 rmind Name++;
235 1.1.1.2.4.2 rmind }
236 1.1.1.2.4.2 rmind
237 1.1.1.2.4.2 rmind switch (ACPI_GET8 (Name))
238 1.1.1.2.4.2 rmind {
239 1.1.1.2.4.2 rmind case 0:
240 1.1.1.2.4.2 rmind SegCount = 0;
241 1.1.1.2.4.2 rmind break;
242 1.1.1.2.4.2 rmind
243 1.1.1.2.4.2 rmind case AML_DUAL_NAME_PREFIX:
244 1.1.1.2.4.2 rmind SegCount = 2;
245 1.1.1.2.4.2 rmind Name++;
246 1.1.1.2.4.2 rmind break;
247 1.1.1.2.4.2 rmind
248 1.1.1.2.4.2 rmind case AML_MULTI_NAME_PREFIX_OP:
249 1.1.1.2.4.2 rmind SegCount = (UINT32) ACPI_GET8 (Name + 1);
250 1.1.1.2.4.2 rmind Name += 2;
251 1.1.1.2.4.2 rmind break;
252 1.1.1.2.4.2 rmind
253 1.1.1.2.4.2 rmind default:
254 1.1.1.2.4.2 rmind SegCount = 1;
255 1.1.1.2.4.2 rmind break;
256 1.1.1.2.4.2 rmind }
257 1.1.1.2.4.2 rmind
258 1.1.1.2.4.2 rmind while (SegCount)
259 1.1.1.2.4.2 rmind {
260 1.1.1.2.4.2 rmind /* Append Name segment */
261 1.1.1.2.4.2 rmind
262 1.1.1.2.4.2 rmind AcpiDmDumpName (*ACPI_CAST_PTR (UINT32, Name));
263 1.1.1.2.4.2 rmind
264 1.1.1.2.4.2 rmind SegCount--;
265 1.1.1.2.4.2 rmind if (SegCount)
266 1.1.1.2.4.2 rmind {
267 1.1.1.2.4.2 rmind /* Not last name, append dot separator */
268 1.1.1.2.4.2 rmind
269 1.1.1.2.4.2 rmind AcpiOsPrintf (".");
270 1.1.1.2.4.2 rmind }
271 1.1.1.2.4.2 rmind Name += ACPI_NAME_SIZE;
272 1.1.1.2.4.2 rmind }
273 1.1.1.2.4.2 rmind }
274 1.1.1.2.4.2 rmind
275 1.1.1.2.4.2 rmind
276 1.1.1.2.4.2 rmind #ifdef ACPI_OBSOLETE_FUNCTIONS
277 1.1.1.2.4.2 rmind /*******************************************************************************
278 1.1.1.2.4.2 rmind *
279 1.1.1.2.4.2 rmind * FUNCTION: AcpiDmDisplayPath
280 1.1.1.2.4.2 rmind *
281 1.1.1.2.4.2 rmind * PARAMETERS: Op - Named Op whose path is to be constructed
282 1.1.1.2.4.2 rmind *
283 1.1.1.2.4.2 rmind * RETURN: None
284 1.1.1.2.4.2 rmind *
285 1.1.1.2.4.2 rmind * DESCRIPTION: Walk backwards from current scope and display the name
286 1.1.1.2.4.2 rmind * of each previous level of scope up to the root scope
287 1.1.1.2.4.2 rmind * (like "pwd" does with file systems)
288 1.1.1.2.4.2 rmind *
289 1.1.1.2.4.2 rmind ******************************************************************************/
290 1.1.1.2.4.2 rmind
291 1.1.1.2.4.2 rmind void
292 1.1.1.2.4.2 rmind AcpiDmDisplayPath (
293 1.1.1.2.4.2 rmind ACPI_PARSE_OBJECT *Op)
294 1.1.1.2.4.2 rmind {
295 1.1.1.2.4.2 rmind ACPI_PARSE_OBJECT *Prev;
296 1.1.1.2.4.2 rmind ACPI_PARSE_OBJECT *Search;
297 1.1.1.2.4.2 rmind UINT32 Name;
298 1.1.1.2.4.2 rmind BOOLEAN DoDot = FALSE;
299 1.1.1.2.4.2 rmind ACPI_PARSE_OBJECT *NamePath;
300 1.1.1.2.4.2 rmind const ACPI_OPCODE_INFO *OpInfo;
301 1.1.1.2.4.2 rmind
302 1.1.1.2.4.2 rmind
303 1.1.1.2.4.2 rmind /* We are only interested in named objects */
304 1.1.1.2.4.2 rmind
305 1.1.1.2.4.2 rmind OpInfo = AcpiPsGetOpcodeInfo (Op->Common.AmlOpcode);
306 1.1.1.2.4.2 rmind if (!(OpInfo->Flags & AML_NSNODE))
307 1.1.1.2.4.2 rmind {
308 1.1.1.2.4.2 rmind return;
309 1.1.1.2.4.2 rmind }
310 1.1.1.2.4.2 rmind
311 1.1.1.2.4.2 rmind if (OpInfo->Flags & AML_CREATE)
312 1.1.1.2.4.2 rmind {
313 1.1.1.2.4.2 rmind /* Field creation - check for a fully qualified namepath */
314 1.1.1.2.4.2 rmind
315 1.1.1.2.4.2 rmind if (Op->Common.AmlOpcode == AML_CREATE_FIELD_OP)
316 1.1.1.2.4.2 rmind {
317 1.1.1.2.4.2 rmind NamePath = AcpiPsGetArg (Op, 3);
318 1.1.1.2.4.2 rmind }
319 1.1.1.2.4.2 rmind else
320 1.1.1.2.4.2 rmind {
321 1.1.1.2.4.2 rmind NamePath = AcpiPsGetArg (Op, 2);
322 1.1.1.2.4.2 rmind }
323 1.1.1.2.4.2 rmind
324 1.1.1.2.4.2 rmind if ((NamePath) &&
325 1.1.1.2.4.2 rmind (NamePath->Common.Value.String) &&
326 1.1.1.2.4.2 rmind (NamePath->Common.Value.String[0] == '\\'))
327 1.1.1.2.4.2 rmind {
328 1.1.1.2.4.2 rmind AcpiDmNamestring (NamePath->Common.Value.String);
329 1.1.1.2.4.2 rmind return;
330 1.1.1.2.4.2 rmind }
331 1.1.1.2.4.2 rmind }
332 1.1.1.2.4.2 rmind
333 1.1.1.2.4.2 rmind Prev = NULL; /* Start with Root Node */
334 1.1.1.2.4.2 rmind
335 1.1.1.2.4.2 rmind while (Prev != Op)
336 1.1.1.2.4.2 rmind {
337 1.1.1.2.4.2 rmind /* Search upwards in the tree to find scope with "prev" as its parent */
338 1.1.1.2.4.2 rmind
339 1.1.1.2.4.2 rmind Search = Op;
340 1.1.1.2.4.2 rmind for (; ;)
341 1.1.1.2.4.2 rmind {
342 1.1.1.2.4.2 rmind if (Search->Common.Parent == Prev)
343 1.1.1.2.4.2 rmind {
344 1.1.1.2.4.2 rmind break;
345 1.1.1.2.4.2 rmind }
346 1.1.1.2.4.2 rmind
347 1.1.1.2.4.2 rmind /* Go up one level */
348 1.1.1.2.4.2 rmind
349 1.1.1.2.4.2 rmind Search = Search->Common.Parent;
350 1.1.1.2.4.2 rmind }
351 1.1.1.2.4.2 rmind
352 1.1.1.2.4.2 rmind if (Prev)
353 1.1.1.2.4.2 rmind {
354 1.1.1.2.4.2 rmind OpInfo = AcpiPsGetOpcodeInfo (Search->Common.AmlOpcode);
355 1.1.1.2.4.2 rmind if (!(OpInfo->Flags & AML_FIELD))
356 1.1.1.2.4.2 rmind {
357 1.1.1.2.4.2 rmind /* Below root scope, append scope name */
358 1.1.1.2.4.2 rmind
359 1.1.1.2.4.2 rmind if (DoDot)
360 1.1.1.2.4.2 rmind {
361 1.1.1.2.4.2 rmind /* Append dot */
362 1.1.1.2.4.2 rmind
363 1.1.1.2.4.2 rmind AcpiOsPrintf (".");
364 1.1.1.2.4.2 rmind }
365 1.1.1.2.4.2 rmind
366 1.1.1.2.4.2 rmind if (OpInfo->Flags & AML_CREATE)
367 1.1.1.2.4.2 rmind {
368 1.1.1.2.4.2 rmind if (Op->Common.AmlOpcode == AML_CREATE_FIELD_OP)
369 1.1.1.2.4.2 rmind {
370 1.1.1.2.4.2 rmind NamePath = AcpiPsGetArg (Op, 3);
371 1.1.1.2.4.2 rmind }
372 1.1.1.2.4.2 rmind else
373 1.1.1.2.4.2 rmind {
374 1.1.1.2.4.2 rmind NamePath = AcpiPsGetArg (Op, 2);
375 1.1.1.2.4.2 rmind }
376 1.1.1.2.4.2 rmind
377 1.1.1.2.4.2 rmind if ((NamePath) &&
378 1.1.1.2.4.2 rmind (NamePath->Common.Value.String))
379 1.1.1.2.4.2 rmind {
380 1.1.1.2.4.2 rmind AcpiDmDumpName (NamePath->Common.Value.String);
381 1.1.1.2.4.2 rmind }
382 1.1.1.2.4.2 rmind }
383 1.1.1.2.4.2 rmind else
384 1.1.1.2.4.2 rmind {
385 1.1.1.2.4.2 rmind Name = AcpiPsGetName (Search);
386 1.1.1.2.4.2 rmind AcpiDmDumpName ((char *) &Name);
387 1.1.1.2.4.2 rmind }
388 1.1.1.2.4.2 rmind
389 1.1.1.2.4.2 rmind DoDot = TRUE;
390 1.1.1.2.4.2 rmind }
391 1.1.1.2.4.2 rmind }
392 1.1.1.2.4.2 rmind Prev = Search;
393 1.1.1.2.4.2 rmind }
394 1.1.1.2.4.2 rmind }
395 1.1.1.2.4.2 rmind
396 1.1.1.2.4.2 rmind
397 1.1.1.2.4.2 rmind /*******************************************************************************
398 1.1.1.2.4.2 rmind *
399 1.1.1.2.4.2 rmind * FUNCTION: AcpiDmValidateName
400 1.1.1.2.4.2 rmind *
401 1.1.1.2.4.2 rmind * PARAMETERS: Name - 4 character ACPI name
402 1.1.1.2.4.2 rmind *
403 1.1.1.2.4.2 rmind * RETURN: None
404 1.1.1.2.4.2 rmind *
405 1.1.1.2.4.2 rmind * DESCRIPTION: Lookup the name
406 1.1.1.2.4.2 rmind *
407 1.1.1.2.4.2 rmind ******************************************************************************/
408 1.1.1.2.4.2 rmind
409 1.1.1.2.4.2 rmind void
410 1.1.1.2.4.2 rmind AcpiDmValidateName (
411 1.1.1.2.4.2 rmind char *Name,
412 1.1.1.2.4.2 rmind ACPI_PARSE_OBJECT *Op)
413 1.1.1.2.4.2 rmind {
414 1.1.1.2.4.2 rmind
415 1.1.1.2.4.2 rmind if ((!Name) ||
416 1.1.1.2.4.2 rmind (!Op->Common.Parent))
417 1.1.1.2.4.2 rmind {
418 1.1.1.2.4.2 rmind return;
419 1.1.1.2.4.2 rmind }
420 1.1.1.2.4.2 rmind
421 1.1.1.2.4.2 rmind if (!Op->Common.Node)
422 1.1.1.2.4.2 rmind {
423 1.1.1.2.4.2 rmind AcpiOsPrintf (
424 1.1.1.2.4.2 rmind " /**** Name not found or not accessible from this scope ****/ ");
425 1.1.1.2.4.2 rmind }
426 1.1.1.2.4.2 rmind
427 1.1.1.2.4.2 rmind ACPI_PARSE_OBJECT *TargetOp;
428 1.1.1.2.4.2 rmind
429 1.1.1.2.4.2 rmind
430 1.1.1.2.4.2 rmind if ((!Name) ||
431 1.1.1.2.4.2 rmind (!Op->Common.Parent))
432 1.1.1.2.4.2 rmind {
433 1.1.1.2.4.2 rmind return;
434 1.1.1.2.4.2 rmind }
435 1.1.1.2.4.2 rmind
436 1.1.1.2.4.2 rmind TargetOp = AcpiPsFind (Op, Name, 0, 0);
437 1.1.1.2.4.2 rmind if (!TargetOp)
438 1.1.1.2.4.2 rmind {
439 1.1.1.2.4.2 rmind /*
440 1.1.1.2.4.2 rmind * Didn't find the name in the parse tree. This may be
441 1.1.1.2.4.2 rmind * a problem, or it may simply be one of the predefined names
442 1.1.1.2.4.2 rmind * (such as _OS_). Rather than worry about looking up all
443 1.1.1.2.4.2 rmind * the predefined names, just display the name as given
444 1.1.1.2.4.2 rmind */
445 1.1.1.2.4.2 rmind AcpiOsPrintf (
446 1.1.1.2.4.2 rmind " /**** Name not found or not accessible from this scope ****/ ");
447 1.1.1.2.4.2 rmind }
448 1.1.1.2.4.2 rmind }
449 1.1.1.2.4.2 rmind #endif
450 1.1.1.2.4.2 rmind
451 1.1.1.2.4.2 rmind #endif
452 1.1.1.2.4.2 rmind
453 1.1.1.2.4.2 rmind
454