Deleted Added
full compact
dmextern.c (241973) dmextern.c (243347)
1/******************************************************************************
2 *
3 * Module Name: dmextern - Support for External() ASL statements
4 *
5 *****************************************************************************/
6
7/*
8 * Copyright (C) 2000 - 2012, Intel Corp.

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

148AcpiDmNormalizeParentPrefix (
149 ACPI_PARSE_OBJECT *Op,
150 char *Path)
151{
152 ACPI_NAMESPACE_NODE *Node;
153 char *Fullpath;
154 char *ParentPath;
155 ACPI_SIZE Length;
1/******************************************************************************
2 *
3 * Module Name: dmextern - Support for External() ASL statements
4 *
5 *****************************************************************************/
6
7/*
8 * Copyright (C) 2000 - 2012, Intel Corp.

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

148AcpiDmNormalizeParentPrefix (
149 ACPI_PARSE_OBJECT *Op,
150 char *Path)
151{
152 ACPI_NAMESPACE_NODE *Node;
153 char *Fullpath;
154 char *ParentPath;
155 ACPI_SIZE Length;
156 UINT32 Index = 0;
156
157
157
158
158 /* Search upwards in the parse tree until we reach a namespace node */
159 if (!Op)
160 {
161 return (NULL);
162 }
159
163
164 /* Search upwards in the parse tree until we reach the next namespace node */
165
166 Op = Op->Common.Parent;
160 while (Op)
161 {
162 if (Op->Common.Node)
163 {
164 break;
165 }
166
167 Op = Op->Common.Parent;

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

200 Length = (ACPI_STRLEN (ParentPath) + ACPI_STRLEN (Path) + 1);
201 if (ParentPath[1])
202 {
203 /*
204 * If ParentPath is not just a simple '\', increment the length
205 * for the required dot separator (ParentPath.Path)
206 */
207 Length++;
167 while (Op)
168 {
169 if (Op->Common.Node)
170 {
171 break;
172 }
173
174 Op = Op->Common.Parent;

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

207 Length = (ACPI_STRLEN (ParentPath) + ACPI_STRLEN (Path) + 1);
208 if (ParentPath[1])
209 {
210 /*
211 * If ParentPath is not just a simple '\', increment the length
212 * for the required dot separator (ParentPath.Path)
213 */
214 Length++;
215
216 /* For External() statements, we do not want a leading '\' */
217
218 if (*ParentPath == AML_ROOT_PREFIX)
219 {
220 Index = 1;
221 }
208 }
209
210 Fullpath = ACPI_ALLOCATE_ZEROED (Length);
211 if (!Fullpath)
212 {
213 goto Cleanup;
214 }
215
216 /*
217 * Concatenate parent fullpath and path. For example,
218 * parent fullpath "\_SB_", Path "^INIT", Fullpath "\_SB_.INIT"
219 *
220 * Copy the parent path
221 */
222 }
223
224 Fullpath = ACPI_ALLOCATE_ZEROED (Length);
225 if (!Fullpath)
226 {
227 goto Cleanup;
228 }
229
230 /*
231 * Concatenate parent fullpath and path. For example,
232 * parent fullpath "\_SB_", Path "^INIT", Fullpath "\_SB_.INIT"
233 *
234 * Copy the parent path
235 */
222 ACPI_STRCAT (Fullpath, ParentPath);
236 ACPI_STRCPY (Fullpath, &ParentPath[Index]);
223
224 /*
225 * Add dot separator
226 * (don't need dot if parent fullpath is a single backslash)
227 */
228 if (ParentPath[1])
229 {
230 ACPI_STRCAT (Fullpath, ".");

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

361 ACPI_STATUS Status;
362
363
364 if (!Path)
365 {
366 return;
367 }
368
237
238 /*
239 * Add dot separator
240 * (don't need dot if parent fullpath is a single backslash)
241 */
242 if (ParentPath[1])
243 {
244 ACPI_STRCAT (Fullpath, ".");

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

375 ACPI_STATUS Status;
376
377
378 if (!Path)
379 {
380 return;
381 }
382
369 /* Externalize the ACPI path */
383 /*
384 * We don't want External() statements to contain a leading '\'.
385 * This prevents duplicate external statements of the form:
386 *
387 * External (\ABCD)
388 * External (ABCD)
389 *
390 * This would cause a compile time error when the disassembled
391 * output file is recompiled.
392 */
393 if ((*Path == AML_ROOT_PREFIX) && (Path[1]))
394 {
395 Path++;
396 }
370
397
398 /* Externalize the ACPI pathname */
399
371 Status = AcpiNsExternalizeName (ACPI_UINT32_MAX, Path,
372 NULL, &ExternalPath);
373 if (ACPI_FAILURE (Status))
374 {
375 return;
376 }
377
400 Status = AcpiNsExternalizeName (ACPI_UINT32_MAX, Path,
401 NULL, &ExternalPath);
402 if (ACPI_FAILURE (Status))
403 {
404 return;
405 }
406
378 /* Get the full pathname from root if "Path" has a parent prefix */
379
407 /*
408 * Get the full pathname from the root if "Path" has one or more
409 * parent prefixes (^). Note: path will not contain a leading '\'.
410 */
380 if (*Path == (UINT8) AML_PARENT_PREFIX)
381 {
382 Fullpath = AcpiDmNormalizeParentPrefix (Op, ExternalPath);
383 if (Fullpath)
384 {
385 /* Set new external path */
386
387 ACPI_FREE (ExternalPath);

--- 302 unchanged lines hidden ---
411 if (*Path == (UINT8) AML_PARENT_PREFIX)
412 {
413 Fullpath = AcpiDmNormalizeParentPrefix (Op, ExternalPath);
414 if (Fullpath)
415 {
416 /* Set new external path */
417
418 ACPI_FREE (ExternalPath);

--- 302 unchanged lines hidden ---