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; |
157 158 |
159 if (!Op) 160 { 161 return (NULL); 162 } |
163 |
164 /* Search upwards in the parse tree until we reach the next namespace node */ 165 166 Op = Op->Common.Parent; |
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 } |
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 */ |
236 ACPI_STRCPY (Fullpath, &ParentPath[Index]); |
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 |
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 } |
397 |
398 /* Externalize the ACPI pathname */ 399 |
400 Status = AcpiNsExternalizeName (ACPI_UINT32_MAX, Path, 401 NULL, &ExternalPath); 402 if (ACPI_FAILURE (Status)) 403 { 404 return; 405 } 406 |
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 */ |
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 --- |