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