1/******************************************************************************* 2 * 3 * Module Name: utstate - state object support procedures 4 * 5 ******************************************************************************/ 6 7/* 8 * Copyright (C) 2000 - 2012, Intel Corp. --- 93 unchanged lines hidden (view full) --- 102 * 103 ******************************************************************************/ 104 105void 106AcpiUtPushGenericState ( 107 ACPI_GENERIC_STATE **ListHead, 108 ACPI_GENERIC_STATE *State) 109{ |
110 ACPI_FUNCTION_ENTRY (); |
111 112 113 /* Push the state object onto the front of the list (stack) */ 114 115 State->Common.Next = *ListHead; 116 *ListHead = State; |
117 return; |
118} 119 120 121/******************************************************************************* 122 * 123 * FUNCTION: AcpiUtPopGenericState 124 * 125 * PARAMETERS: ListHead - Head of the state stack --- 6 unchanged lines hidden (view full) --- 132 133ACPI_GENERIC_STATE * 134AcpiUtPopGenericState ( 135 ACPI_GENERIC_STATE **ListHead) 136{ 137 ACPI_GENERIC_STATE *State; 138 139 |
140 ACPI_FUNCTION_ENTRY (); |
141 142 143 /* Remove the state object at the head of the list (stack) */ 144 145 State = *ListHead; 146 if (State) 147 { 148 /* Update the list head */ 149 150 *ListHead = State->Common.Next; 151 } 152 |
153 return (State); |
154} 155 156 157/******************************************************************************* 158 * 159 * FUNCTION: AcpiUtCreateGenericState 160 * 161 * PARAMETERS: None --- 41 unchanged lines hidden (view full) --- 203 204ACPI_THREAD_STATE * 205AcpiUtCreateThreadState ( 206 void) 207{ 208 ACPI_GENERIC_STATE *State; 209 210 |
211 ACPI_FUNCTION_ENTRY (); |
212 213 214 /* Create the generic state object */ 215 216 State = AcpiUtCreateGenericState (); 217 if (!State) 218 { |
219 return (NULL); |
220 } 221 222 /* Init fields specific to the update struct */ 223 224 State->Common.DescriptorType = ACPI_DESC_TYPE_STATE_THREAD; 225 State->Thread.ThreadId = AcpiOsGetThreadId (); 226 227 /* Check for invalid thread ID - zero is very bad, it will break things */ 228 229 if (!State->Thread.ThreadId) 230 { 231 ACPI_ERROR ((AE_INFO, "Invalid zero ID from AcpiOsGetThreadId")); 232 State->Thread.ThreadId = (ACPI_THREAD_ID) 1; 233 } 234 |
235 return ((ACPI_THREAD_STATE *) State); |
236} 237 238 239/******************************************************************************* 240 * 241 * FUNCTION: AcpiUtCreateUpdateState 242 * 243 * PARAMETERS: Object - Initial Object to be installed in the state --- 10 unchanged lines hidden (view full) --- 254ACPI_GENERIC_STATE * 255AcpiUtCreateUpdateState ( 256 ACPI_OPERAND_OBJECT *Object, 257 UINT16 Action) 258{ 259 ACPI_GENERIC_STATE *State; 260 261 |
262 ACPI_FUNCTION_ENTRY (); |
263 264 265 /* Create the generic state object */ 266 267 State = AcpiUtCreateGenericState (); 268 if (!State) 269 { |
270 return (NULL); |
271 } 272 273 /* Init fields specific to the update struct */ 274 275 State->Common.DescriptorType = ACPI_DESC_TYPE_STATE_UPDATE; 276 State->Update.Object = Object; 277 State->Update.Value = Action; |
278 return (State); |
279} 280 281 282/******************************************************************************* 283 * 284 * FUNCTION: AcpiUtCreatePkgState 285 * 286 * PARAMETERS: Object - Initial Object to be installed in the state --- 9 unchanged lines hidden (view full) --- 296AcpiUtCreatePkgState ( 297 void *InternalObject, 298 void *ExternalObject, 299 UINT16 Index) 300{ 301 ACPI_GENERIC_STATE *State; 302 303 |
304 ACPI_FUNCTION_ENTRY (); |
305 306 307 /* Create the generic state object */ 308 309 State = AcpiUtCreateGenericState (); 310 if (!State) 311 { |
312 return (NULL); |
313 } 314 315 /* Init fields specific to the update struct */ 316 317 State->Common.DescriptorType = ACPI_DESC_TYPE_STATE_PACKAGE; 318 State->Pkg.SourceObject = (ACPI_OPERAND_OBJECT *) InternalObject; 319 State->Pkg.DestObject = ExternalObject; 320 State->Pkg.Index= Index; 321 State->Pkg.NumPackages = 1; |
322 return (State); |
323} 324 325 326/******************************************************************************* 327 * 328 * FUNCTION: AcpiUtCreateControlState 329 * 330 * PARAMETERS: None --- 7 unchanged lines hidden (view full) --- 338 339ACPI_GENERIC_STATE * 340AcpiUtCreateControlState ( 341 void) 342{ 343 ACPI_GENERIC_STATE *State; 344 345 |
346 ACPI_FUNCTION_ENTRY (); |
347 348 349 /* Create the generic state object */ 350 351 State = AcpiUtCreateGenericState (); 352 if (!State) 353 { |
354 return (NULL); |
355 } 356 357 /* Init fields specific to the control struct */ 358 359 State->Common.DescriptorType = ACPI_DESC_TYPE_STATE_CONTROL; 360 State->Common.State = ACPI_CONTROL_CONDITIONAL_EXECUTING; |
361 return (State); |
362} 363 364 365/******************************************************************************* 366 * 367 * FUNCTION: AcpiUtDeleteGenericState 368 * 369 * PARAMETERS: State - The state object to be deleted --- 4 unchanged lines hidden (view full) --- 374 * are ignored. 375 * 376 ******************************************************************************/ 377 378void 379AcpiUtDeleteGenericState ( 380 ACPI_GENERIC_STATE *State) 381{ |
382 ACPI_FUNCTION_ENTRY (); |
383 384 385 /* Ignore null state */ 386 387 if (State) 388 { 389 (void) AcpiOsReleaseObject (AcpiGbl_StateCache, State); 390 } |
391 return; |
392} |