utstate.c (151937) | utstate.c (167802) |
---|---|
1/******************************************************************************* 2 * 3 * Module Name: utstate - state object support procedures | 1/******************************************************************************* 2 * 3 * Module Name: utstate - state object support procedures |
4 * $Revision: 1.2 $ | 4 * $Revision: 1.8 $ |
5 * 6 ******************************************************************************/ 7 8/****************************************************************************** 9 * 10 * 1. Copyright Notice 11 * | 5 * 6 ******************************************************************************/ 7 8/****************************************************************************** 9 * 10 * 1. Copyright Notice 11 * |
12 * Some or all of this work - Copyright (c) 1999 - 2005, Intel Corp. | 12 * Some or all of this work - Copyright (c) 1999 - 2007, Intel Corp. |
13 * All rights reserved. 14 * 15 * 2. License 16 * 17 * 2.1. This is your license from Intel Corp. under its intellectual property 18 * rights. You may have additional license terms from the party that provided 19 * you this software, covering your right to use that party's intellectual 20 * property rights. --- 153 unchanged lines hidden (view full) --- 174 * 175 ******************************************************************************/ 176 177void 178AcpiUtPushGenericState ( 179 ACPI_GENERIC_STATE **ListHead, 180 ACPI_GENERIC_STATE *State) 181{ | 13 * All rights reserved. 14 * 15 * 2. License 16 * 17 * 2.1. This is your license from Intel Corp. under its intellectual property 18 * rights. You may have additional license terms from the party that provided 19 * you this software, covering your right to use that party's intellectual 20 * property rights. --- 153 unchanged lines hidden (view full) --- 174 * 175 ******************************************************************************/ 176 177void 178AcpiUtPushGenericState ( 179 ACPI_GENERIC_STATE **ListHead, 180 ACPI_GENERIC_STATE *State) 181{ |
182 ACPI_FUNCTION_TRACE ("UtPushGenericState"); | 182 ACPI_FUNCTION_TRACE (UtPushGenericState); |
183 184 185 /* Push the state object onto the front of the list (stack) */ 186 187 State->Common.Next = *ListHead; 188 *ListHead = State; 189 190 return_VOID; --- 14 unchanged lines hidden (view full) --- 205 206ACPI_GENERIC_STATE * 207AcpiUtPopGenericState ( 208 ACPI_GENERIC_STATE **ListHead) 209{ 210 ACPI_GENERIC_STATE *State; 211 212 | 183 184 185 /* Push the state object onto the front of the list (stack) */ 186 187 State->Common.Next = *ListHead; 188 *ListHead = State; 189 190 return_VOID; --- 14 unchanged lines hidden (view full) --- 205 206ACPI_GENERIC_STATE * 207AcpiUtPopGenericState ( 208 ACPI_GENERIC_STATE **ListHead) 209{ 210 ACPI_GENERIC_STATE *State; 211 212 |
213 ACPI_FUNCTION_TRACE ("UtPopGenericState"); | 213 ACPI_FUNCTION_TRACE (UtPopGenericState); |
214 215 216 /* Remove the state object at the head of the list (stack) */ 217 218 State = *ListHead; 219 if (State) 220 { 221 /* Update the list head */ --- 27 unchanged lines hidden (view full) --- 249 250 ACPI_FUNCTION_ENTRY (); 251 252 253 State = AcpiOsAcquireObject (AcpiGbl_StateCache); 254 if (State) 255 { 256 /* Initialize */ | 214 215 216 /* Remove the state object at the head of the list (stack) */ 217 218 State = *ListHead; 219 if (State) 220 { 221 /* Update the list head */ --- 27 unchanged lines hidden (view full) --- 249 250 ACPI_FUNCTION_ENTRY (); 251 252 253 State = AcpiOsAcquireObject (AcpiGbl_StateCache); 254 if (State) 255 { 256 /* Initialize */ |
257 State->Common.DataType = ACPI_DESC_TYPE_STATE; | 257 State->Common.DescriptorType = ACPI_DESC_TYPE_STATE; |
258 } 259 260 return (State); 261} 262 263 264/******************************************************************************* 265 * --- 10 unchanged lines hidden (view full) --- 276 277ACPI_THREAD_STATE * 278AcpiUtCreateThreadState ( 279 void) 280{ 281 ACPI_GENERIC_STATE *State; 282 283 | 258 } 259 260 return (State); 261} 262 263 264/******************************************************************************* 265 * --- 10 unchanged lines hidden (view full) --- 276 277ACPI_THREAD_STATE * 278AcpiUtCreateThreadState ( 279 void) 280{ 281 ACPI_GENERIC_STATE *State; 282 283 |
284 ACPI_FUNCTION_TRACE ("UtCreateThreadState"); | 284 ACPI_FUNCTION_TRACE (UtCreateThreadState); |
285 286 287 /* Create the generic state object */ 288 289 State = AcpiUtCreateGenericState (); 290 if (!State) 291 { 292 return_PTR (NULL); 293 } 294 295 /* Init fields specific to the update struct */ 296 | 285 286 287 /* Create the generic state object */ 288 289 State = AcpiUtCreateGenericState (); 290 if (!State) 291 { 292 return_PTR (NULL); 293 } 294 295 /* Init fields specific to the update struct */ 296 |
297 State->Common.DataType = ACPI_DESC_TYPE_STATE_THREAD; | 297 State->Common.DescriptorType = ACPI_DESC_TYPE_STATE_THREAD; |
298 State->Thread.ThreadId = AcpiOsGetThreadId (); 299 | 298 State->Thread.ThreadId = AcpiOsGetThreadId (); 299 |
300 /* Check for invalid thread ID - zero is very bad, it will break things */ 301 302 if (!State->Thread.ThreadId) 303 { 304 ACPI_ERROR ((AE_INFO, "Invalid zero ID from AcpiOsGetThreadId")); 305 State->Thread.ThreadId = 1; 306 } 307 |
|
300 return_PTR ((ACPI_THREAD_STATE *) State); 301} 302 303 304/******************************************************************************* 305 * 306 * FUNCTION: AcpiUtCreateUpdateState 307 * --- 11 unchanged lines hidden (view full) --- 319ACPI_GENERIC_STATE * 320AcpiUtCreateUpdateState ( 321 ACPI_OPERAND_OBJECT *Object, 322 UINT16 Action) 323{ 324 ACPI_GENERIC_STATE *State; 325 326 | 308 return_PTR ((ACPI_THREAD_STATE *) State); 309} 310 311 312/******************************************************************************* 313 * 314 * FUNCTION: AcpiUtCreateUpdateState 315 * --- 11 unchanged lines hidden (view full) --- 327ACPI_GENERIC_STATE * 328AcpiUtCreateUpdateState ( 329 ACPI_OPERAND_OBJECT *Object, 330 UINT16 Action) 331{ 332 ACPI_GENERIC_STATE *State; 333 334 |
327 ACPI_FUNCTION_TRACE_PTR ("UtCreateUpdateState", Object); | 335 ACPI_FUNCTION_TRACE_PTR (UtCreateUpdateState, Object); |
328 329 330 /* Create the generic state object */ 331 332 State = AcpiUtCreateGenericState (); 333 if (!State) 334 { 335 return_PTR (NULL); 336 } 337 338 /* Init fields specific to the update struct */ 339 | 336 337 338 /* Create the generic state object */ 339 340 State = AcpiUtCreateGenericState (); 341 if (!State) 342 { 343 return_PTR (NULL); 344 } 345 346 /* Init fields specific to the update struct */ 347 |
340 State->Common.DataType = ACPI_DESC_TYPE_STATE_UPDATE; | 348 State->Common.DescriptorType = ACPI_DESC_TYPE_STATE_UPDATE; |
341 State->Update.Object = Object; | 349 State->Update.Object = Object; |
342 State->Update.Value = Action; | 350 State->Update.Value = Action; |
343 344 return_PTR (State); 345} 346 347 348/******************************************************************************* 349 * 350 * FUNCTION: AcpiUtCreatePkgState --- 11 unchanged lines hidden (view full) --- 362AcpiUtCreatePkgState ( 363 void *InternalObject, 364 void *ExternalObject, 365 UINT16 Index) 366{ 367 ACPI_GENERIC_STATE *State; 368 369 | 351 352 return_PTR (State); 353} 354 355 356/******************************************************************************* 357 * 358 * FUNCTION: AcpiUtCreatePkgState --- 11 unchanged lines hidden (view full) --- 370AcpiUtCreatePkgState ( 371 void *InternalObject, 372 void *ExternalObject, 373 UINT16 Index) 374{ 375 ACPI_GENERIC_STATE *State; 376 377 |
370 ACPI_FUNCTION_TRACE_PTR ("UtCreatePkgState", InternalObject); | 378 ACPI_FUNCTION_TRACE_PTR (UtCreatePkgState, InternalObject); |
371 372 373 /* Create the generic state object */ 374 375 State = AcpiUtCreateGenericState (); 376 if (!State) 377 { 378 return_PTR (NULL); 379 } 380 381 /* Init fields specific to the update struct */ 382 | 379 380 381 /* Create the generic state object */ 382 383 State = AcpiUtCreateGenericState (); 384 if (!State) 385 { 386 return_PTR (NULL); 387 } 388 389 /* Init fields specific to the update struct */ 390 |
383 State->Common.DataType = ACPI_DESC_TYPE_STATE_PACKAGE; | 391 State->Common.DescriptorType = ACPI_DESC_TYPE_STATE_PACKAGE; |
384 State->Pkg.SourceObject = (ACPI_OPERAND_OBJECT *) InternalObject; | 392 State->Pkg.SourceObject = (ACPI_OPERAND_OBJECT *) InternalObject; |
385 State->Pkg.DestObject = ExternalObject; 386 State->Pkg.Index = Index; 387 State->Pkg.NumPackages = 1; | 393 State->Pkg.DestObject = ExternalObject; 394 State->Pkg.Index= Index; 395 State->Pkg.NumPackages = 1; |
388 389 return_PTR (State); 390} 391 392 393/******************************************************************************* 394 * 395 * FUNCTION: AcpiUtCreateControlState --- 9 unchanged lines hidden (view full) --- 405 406ACPI_GENERIC_STATE * 407AcpiUtCreateControlState ( 408 void) 409{ 410 ACPI_GENERIC_STATE *State; 411 412 | 396 397 return_PTR (State); 398} 399 400 401/******************************************************************************* 402 * 403 * FUNCTION: AcpiUtCreateControlState --- 9 unchanged lines hidden (view full) --- 413 414ACPI_GENERIC_STATE * 415AcpiUtCreateControlState ( 416 void) 417{ 418 ACPI_GENERIC_STATE *State; 419 420 |
413 ACPI_FUNCTION_TRACE ("UtCreateControlState"); | 421 ACPI_FUNCTION_TRACE (UtCreateControlState); |
414 415 416 /* Create the generic state object */ 417 418 State = AcpiUtCreateGenericState (); 419 if (!State) 420 { 421 return_PTR (NULL); 422 } 423 424 /* Init fields specific to the control struct */ 425 | 422 423 424 /* Create the generic state object */ 425 426 State = AcpiUtCreateGenericState (); 427 if (!State) 428 { 429 return_PTR (NULL); 430 } 431 432 /* Init fields specific to the control struct */ 433 |
426 State->Common.DataType = ACPI_DESC_TYPE_STATE_CONTROL; 427 State->Common.State = ACPI_CONTROL_CONDITIONAL_EXECUTING; | 434 State->Common.DescriptorType = ACPI_DESC_TYPE_STATE_CONTROL; 435 State->Common.State = ACPI_CONTROL_CONDITIONAL_EXECUTING; |
428 429 return_PTR (State); 430} 431 432 433/******************************************************************************* 434 * 435 * FUNCTION: AcpiUtDeleteGenericState 436 * 437 * PARAMETERS: State - The state object to be deleted 438 * 439 * RETURN: None 440 * | 436 437 return_PTR (State); 438} 439 440 441/******************************************************************************* 442 * 443 * FUNCTION: AcpiUtDeleteGenericState 444 * 445 * PARAMETERS: State - The state object to be deleted 446 * 447 * RETURN: None 448 * |
441 * DESCRIPTION: Put a state object back into the global state cache. The object 442 * is not actually freed at this time. | 449 * DESCRIPTION: Release a state object to the state cache. NULL state objects 450 * are ignored. |
443 * 444 ******************************************************************************/ 445 446void 447AcpiUtDeleteGenericState ( 448 ACPI_GENERIC_STATE *State) 449{ | 451 * 452 ******************************************************************************/ 453 454void 455AcpiUtDeleteGenericState ( 456 ACPI_GENERIC_STATE *State) 457{ |
450 ACPI_FUNCTION_TRACE ("UtDeleteGenericState"); | 458 ACPI_FUNCTION_TRACE (UtDeleteGenericState); |
451 452 | 459 460 |
453 (void) AcpiOsReleaseObject (AcpiGbl_StateCache, State); | 461 /* Ignore null state */ 462 463 if (State) 464 { 465 (void) AcpiOsReleaseObject (AcpiGbl_StateCache, State); 466 } |
454 return_VOID; 455} 456 457 | 467 return_VOID; 468} 469 470 |