nsinit.c (80062) | nsinit.c (82367) |
---|---|
1/****************************************************************************** 2 * 3 * Module Name: nsinit - namespace initialization | 1/****************************************************************************** 2 * 3 * Module Name: nsinit - namespace initialization |
4 * $Revision: 28 $ | 4 * $Revision: 29 $ |
5 * 6 *****************************************************************************/ 7 8/****************************************************************************** 9 * 10 * 1. Copyright Notice 11 * 12 * Some or all of this work - Copyright (c) 1999, 2000, 2001, Intel Corp. --- 132 unchanged lines hidden (view full) --- 145{ 146 ACPI_STATUS Status; 147 ACPI_INIT_WALK_INFO Info; 148 149 150 FUNCTION_TRACE ("NsInitializeObjects"); 151 152 | 5 * 6 *****************************************************************************/ 7 8/****************************************************************************** 9 * 10 * 1. Copyright Notice 11 * 12 * Some or all of this work - Copyright (c) 1999, 2000, 2001, Intel Corp. --- 132 unchanged lines hidden (view full) --- 145{ 146 ACPI_STATUS Status; 147 ACPI_INIT_WALK_INFO Info; 148 149 150 FUNCTION_TRACE ("NsInitializeObjects"); 151 152 |
153 DEBUG_PRINTP (TRACE_DISPATCH, 154 ("**** Starting initialization of namespace objects ****\n")); 155 DEBUG_PRINT_RAW (ACPI_OK, ("Completing Region and Field initialization:")); | 153 ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, 154 "**** Starting initialization of namespace objects ****\n")); 155 ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OK, "Completing Region and Field initialization:")); |
156 157 158 Info.FieldCount = 0; 159 Info.FieldInit = 0; 160 Info.OpRegionCount = 0; 161 Info.OpRegionInit = 0; 162 Info.ObjectCount = 0; 163 164 165 /* Walk entire namespace from the supplied root */ 166 167 Status = AcpiWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT, 168 ACPI_UINT32_MAX, AcpiNsInitOneObject, 169 &Info, NULL); 170 if (ACPI_FAILURE (Status)) 171 { | 156 157 158 Info.FieldCount = 0; 159 Info.FieldInit = 0; 160 Info.OpRegionCount = 0; 161 Info.OpRegionInit = 0; 162 Info.ObjectCount = 0; 163 164 165 /* Walk entire namespace from the supplied root */ 166 167 Status = AcpiWalkNamespace (ACPI_TYPE_ANY, ACPI_ROOT_OBJECT, 168 ACPI_UINT32_MAX, AcpiNsInitOneObject, 169 &Info, NULL); 170 if (ACPI_FAILURE (Status)) 171 { |
172 DEBUG_PRINTP (ACPI_ERROR, ("WalkNamespace failed! %x\n", Status)); | 172 ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "WalkNamespace failed! %x\n", Status)); |
173 } 174 | 173 } 174 |
175 DEBUG_PRINT_RAW (ACPI_OK, 176 ("\n%d/%d Regions, %d/%d Fields initialized (%d nodes total)\n", | 175 ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OK, 176 "\n%d/%d Regions, %d/%d Fields initialized (%d nodes total)\n", |
177 Info.OpRegionInit, Info.OpRegionCount, Info.FieldInit, 178 Info.FieldCount, Info.ObjectCount)); | 177 Info.OpRegionInit, Info.OpRegionCount, Info.FieldInit, 178 Info.FieldCount, Info.ObjectCount)); |
179 DEBUG_PRINTP (TRACE_DISPATCH, 180 ("%d Control Methods found\n", Info.MethodCount)); 181 DEBUG_PRINTP (TRACE_DISPATCH, 182 ("%d Op Regions found\n", Info.OpRegionCount)); | 179 ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, 180 "%d Control Methods found\n", Info.MethodCount)); 181 ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, 182 "%d Op Regions found\n", Info.OpRegionCount)); |
183 184 return_ACPI_STATUS (AE_OK); 185} 186 187 188/******************************************************************************* 189 * 190 * FUNCTION: AcpiNsInitializeDevices --- 21 unchanged lines hidden (view full) --- 212 FUNCTION_TRACE ("NsInitializeDevices"); 213 214 215 Info.DeviceCount = 0; 216 Info.Num_STA = 0; 217 Info.Num_INI = 0; 218 219 | 183 184 return_ACPI_STATUS (AE_OK); 185} 186 187 188/******************************************************************************* 189 * 190 * FUNCTION: AcpiNsInitializeDevices --- 21 unchanged lines hidden (view full) --- 212 FUNCTION_TRACE ("NsInitializeDevices"); 213 214 215 Info.DeviceCount = 0; 216 Info.Num_STA = 0; 217 Info.Num_INI = 0; 218 219 |
220 DEBUG_PRINT_RAW (ACPI_OK, ("Executing device _INI methods:")); | 220 ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OK, "Executing device _INI methods:")); |
221 222 Status = AcpiNsWalkNamespace (ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT, 223 ACPI_UINT32_MAX, FALSE, AcpiNsInitOneDevice, &Info, NULL); 224 225 if (ACPI_FAILURE (Status)) 226 { | 221 222 Status = AcpiNsWalkNamespace (ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT, 223 ACPI_UINT32_MAX, FALSE, AcpiNsInitOneDevice, &Info, NULL); 224 225 if (ACPI_FAILURE (Status)) 226 { |
227 DEBUG_PRINTP (ACPI_ERROR, ("WalkNamespace failed! %x\n", Status)); | 227 ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, "WalkNamespace failed! %x\n", Status)); |
228 } 229 230 | 228 } 229 230 |
231 DEBUG_PRINT_RAW (ACPI_OK, 232 ("\n%d Devices found: %d _STA, %d _INI\n", | 231 ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OK, 232 "\n%d Devices found: %d _STA, %d _INI\n", |
233 Info.DeviceCount, Info.Num_STA, Info.Num_INI)); 234 235 return_ACPI_STATUS (Status); 236} 237 238 239/******************************************************************************* 240 * --- 24 unchanged lines hidden (view full) --- 265{ 266 ACPI_OBJECT_TYPE8 Type; 267 ACPI_STATUS Status; 268 ACPI_INIT_WALK_INFO *Info = (ACPI_INIT_WALK_INFO *) Context; 269 ACPI_NAMESPACE_NODE *Node = (ACPI_NAMESPACE_NODE *) ObjHandle; 270 ACPI_OPERAND_OBJECT *ObjDesc; 271 272 | 233 Info.DeviceCount, Info.Num_STA, Info.Num_INI)); 234 235 return_ACPI_STATUS (Status); 236} 237 238 239/******************************************************************************* 240 * --- 24 unchanged lines hidden (view full) --- 265{ 266 ACPI_OBJECT_TYPE8 Type; 267 ACPI_STATUS Status; 268 ACPI_INIT_WALK_INFO *Info = (ACPI_INIT_WALK_INFO *) Context; 269 ACPI_NAMESPACE_NODE *Node = (ACPI_NAMESPACE_NODE *) ObjHandle; 270 ACPI_OPERAND_OBJECT *ObjDesc; 271 272 |
273 PROC_NAME ("AcpiNsInitOneObject"); 274 275 |
|
273 Info->ObjectCount++; 274 275 276 /* And even then, we are only interested in a few object types */ 277 278 Type = AcpiNsGetType (ObjHandle); 279 ObjDesc = Node->Object; 280 if (!ObjDesc) --- 27 unchanged lines hidden (view full) --- 308 { 309 break; 310 } 311 312 Info->OpRegionInit++; 313 Status = AcpiDsGetRegionArguments (ObjDesc); 314 if (ACPI_FAILURE (Status)) 315 { | 276 Info->ObjectCount++; 277 278 279 /* And even then, we are only interested in a few object types */ 280 281 Type = AcpiNsGetType (ObjHandle); 282 ObjDesc = Node->Object; 283 if (!ObjDesc) --- 27 unchanged lines hidden (view full) --- 311 { 312 break; 313 } 314 315 Info->OpRegionInit++; 316 Status = AcpiDsGetRegionArguments (ObjDesc); 317 if (ACPI_FAILURE (Status)) 318 { |
316 DEBUG_PRINT_RAW (ACPI_ERROR, ("\n")); 317 DEBUG_PRINT (ACPI_ERROR, 318 ("%s while getting region arguments [%4.4s]\n", | 319 ACPI_DEBUG_PRINT_RAW ((ACPI_DB_ERROR, "\n")); 320 ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, 321 "%s while getting region arguments [%4.4s]\n", |
319 AcpiFormatException (Status), &Node->Name)); 320 } 321 | 322 AcpiFormatException (Status), &Node->Name)); 323 } 324 |
322 if (!(AcpiDbgLevel & TRACE_INIT)) | 325 if (!(AcpiDbgLevel & ACPI_LV_INIT)) |
323 { | 326 { |
324 DEBUG_PRINT_RAW (ACPI_OK, (".")); | 327 ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OK, ".")); |
325 } 326 327 break; 328 329 330 case ACPI_TYPE_BUFFER_FIELD: 331 332 Info->FieldCount++; 333 if (ObjDesc->Common.Flags & AOPOBJ_DATA_VALID) 334 { 335 break; 336 } 337 338 Info->FieldInit++; 339 Status = AcpiDsGetBufferFieldArguments (ObjDesc); 340 if (ACPI_FAILURE (Status)) 341 { | 328 } 329 330 break; 331 332 333 case ACPI_TYPE_BUFFER_FIELD: 334 335 Info->FieldCount++; 336 if (ObjDesc->Common.Flags & AOPOBJ_DATA_VALID) 337 { 338 break; 339 } 340 341 Info->FieldInit++; 342 Status = AcpiDsGetBufferFieldArguments (ObjDesc); 343 if (ACPI_FAILURE (Status)) 344 { |
342 DEBUG_PRINT_RAW (ACPI_ERROR, ("\n")); 343 DEBUG_PRINT (ACPI_ERROR, 344 ("%s while getting buffer field arguments [%4.4s]\n", | 345 ACPI_DEBUG_PRINT_RAW ((ACPI_DB_ERROR, "\n")); 346 ACPI_DEBUG_PRINT ((ACPI_DB_ERROR, 347 "%s while getting buffer field arguments [%4.4s]\n", |
345 AcpiFormatException (Status), &Node->Name)); 346 } | 348 AcpiFormatException (Status), &Node->Name)); 349 } |
347 if (!(AcpiDbgLevel & TRACE_INIT)) | 350 if (!(AcpiDbgLevel & ACPI_LV_INIT)) |
348 { | 351 { |
349 DEBUG_PRINT_RAW (ACPI_OK, (".")); | 352 ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OK, ".")); |
350 } 351 352 353 break; 354 355 default: 356 break; 357 } --- 33 unchanged lines hidden (view full) --- 391 ACPI_NAMESPACE_NODE *Node; 392 UINT32 Flags; 393 ACPI_DEVICE_WALK_INFO *Info = (ACPI_DEVICE_WALK_INFO *) Context; 394 395 396 FUNCTION_TRACE ("AcpiNsInitOneDevice"); 397 398 | 353 } 354 355 356 break; 357 358 default: 359 break; 360 } --- 33 unchanged lines hidden (view full) --- 394 ACPI_NAMESPACE_NODE *Node; 395 UINT32 Flags; 396 ACPI_DEVICE_WALK_INFO *Info = (ACPI_DEVICE_WALK_INFO *) Context; 397 398 399 FUNCTION_TRACE ("AcpiNsInitOneDevice"); 400 401 |
399 if (!(AcpiDbgLevel & TRACE_INIT)) | 402 if (!(AcpiDbgLevel & ACPI_LV_INIT)) |
400 { | 403 { |
401 DEBUG_PRINT_RAW (ACPI_OK, (".")); | 404 ACPI_DEBUG_PRINT_RAW ((ACPI_DB_OK, ".")); |
402 } 403 404 Info->DeviceCount++; 405 406 AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE); 407 408 Node = AcpiNsConvertHandleToEntry (ObjHandle); 409 if (!Node) --- 41 unchanged lines hidden (view full) --- 451 452 else if (ACPI_FAILURE (Status)) 453 { 454 /* Ignore error and move on to next device */ 455 456#ifdef ACPI_DEBUG 457 NATIVE_CHAR *ScopeName = AcpiNsGetTablePathname (ObjHandle); 458 | 405 } 406 407 Info->DeviceCount++; 408 409 AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE); 410 411 Node = AcpiNsConvertHandleToEntry (ObjHandle); 412 if (!Node) --- 41 unchanged lines hidden (view full) --- 454 455 else if (ACPI_FAILURE (Status)) 456 { 457 /* Ignore error and move on to next device */ 458 459#ifdef ACPI_DEBUG 460 NATIVE_CHAR *ScopeName = AcpiNsGetTablePathname (ObjHandle); 461 |
459 DEBUG_PRINTP (ACPI_WARN, ("%s._INI failed: %s\n", | 462 ACPI_DEBUG_PRINT ((ACPI_DB_WARN, "%s._INI failed: %s\n", |
460 ScopeName, AcpiFormatException (Status))); 461 462 ACPI_MEM_FREE (ScopeName); 463#endif 464 } 465 466 else 467 { 468 /* Count of successful INIs */ 469 470 Info->Num_INI++; 471 } 472 473 return_ACPI_STATUS (AE_OK); 474} | 463 ScopeName, AcpiFormatException (Status))); 464 465 ACPI_MEM_FREE (ScopeName); 466#endif 467 } 468 469 else 470 { 471 /* Count of successful INIs */ 472 473 Info->Num_INI++; 474 } 475 476 return_ACPI_STATUS (AE_OK); 477} |