nsobject.c (cb5629b10d64a8006622ce3a52bc887d91057d69) | nsobject.c (3371c19c294a4cb3649aa4e84606be8a1d999e61) |
---|---|
1/******************************************************************************* 2 * 3 * Module Name: nsobject - Utilities for objects attached to namespace 4 * table entries 5 * 6 ******************************************************************************/ 7 8/* --- 195 unchanged lines hidden (view full) --- 204void acpi_ns_detach_object(struct acpi_namespace_node *node) 205{ 206 union acpi_operand_object *obj_desc; 207 208 ACPI_FUNCTION_TRACE(ns_detach_object); 209 210 obj_desc = node->object; 211 | 1/******************************************************************************* 2 * 3 * Module Name: nsobject - Utilities for objects attached to namespace 4 * table entries 5 * 6 ******************************************************************************/ 7 8/* --- 195 unchanged lines hidden (view full) --- 204void acpi_ns_detach_object(struct acpi_namespace_node *node) 205{ 206 union acpi_operand_object *obj_desc; 207 208 ACPI_FUNCTION_TRACE(ns_detach_object); 209 210 obj_desc = node->object; 211 |
212 if (!obj_desc || 213 (ACPI_GET_OBJECT_TYPE(obj_desc) == ACPI_TYPE_LOCAL_DATA)) { | 212 if (!obj_desc || (obj_desc->common.type == ACPI_TYPE_LOCAL_DATA)) { |
214 return_VOID; 215 } 216 217 /* Clear the entry in all cases */ 218 219 node->object = NULL; 220 if (ACPI_GET_DESCRIPTOR_TYPE(obj_desc) == ACPI_DESC_TYPE_OPERAND) { 221 node->object = obj_desc->common.next_object; 222 if (node->object && | 213 return_VOID; 214 } 215 216 /* Clear the entry in all cases */ 217 218 node->object = NULL; 219 if (ACPI_GET_DESCRIPTOR_TYPE(obj_desc) == ACPI_DESC_TYPE_OPERAND) { 220 node->object = obj_desc->common.next_object; 221 if (node->object && |
223 (ACPI_GET_OBJECT_TYPE(node->object) != 224 ACPI_TYPE_LOCAL_DATA)) { | 222 ((node->object)->common.type != ACPI_TYPE_LOCAL_DATA)) { |
225 node->object = node->object->common.next_object; 226 } 227 } 228 229 /* Reset the node type to untyped */ 230 231 node->type = ACPI_TYPE_ANY; 232 --- 29 unchanged lines hidden (view full) --- 262 ACPI_WARNING((AE_INFO, "Null Node ptr")); 263 return_PTR(NULL); 264 } 265 266 if (!node->object || 267 ((ACPI_GET_DESCRIPTOR_TYPE(node->object) != ACPI_DESC_TYPE_OPERAND) 268 && (ACPI_GET_DESCRIPTOR_TYPE(node->object) != 269 ACPI_DESC_TYPE_NAMED)) | 223 node->object = node->object->common.next_object; 224 } 225 } 226 227 /* Reset the node type to untyped */ 228 229 node->type = ACPI_TYPE_ANY; 230 --- 29 unchanged lines hidden (view full) --- 260 ACPI_WARNING((AE_INFO, "Null Node ptr")); 261 return_PTR(NULL); 262 } 263 264 if (!node->object || 265 ((ACPI_GET_DESCRIPTOR_TYPE(node->object) != ACPI_DESC_TYPE_OPERAND) 266 && (ACPI_GET_DESCRIPTOR_TYPE(node->object) != 267 ACPI_DESC_TYPE_NAMED)) |
270 || (ACPI_GET_OBJECT_TYPE(node->object) == ACPI_TYPE_LOCAL_DATA)) { | 268 || ((node->object)->common.type == ACPI_TYPE_LOCAL_DATA)) { |
271 return_PTR(NULL); 272 } 273 274 return_PTR(node->object); 275} 276 277/******************************************************************************* 278 * --- 10 unchanged lines hidden (view full) --- 289 290union acpi_operand_object *acpi_ns_get_secondary_object(union 291 acpi_operand_object 292 *obj_desc) 293{ 294 ACPI_FUNCTION_TRACE_PTR(ns_get_secondary_object, obj_desc); 295 296 if ((!obj_desc) || | 269 return_PTR(NULL); 270 } 271 272 return_PTR(node->object); 273} 274 275/******************************************************************************* 276 * --- 10 unchanged lines hidden (view full) --- 287 288union acpi_operand_object *acpi_ns_get_secondary_object(union 289 acpi_operand_object 290 *obj_desc) 291{ 292 ACPI_FUNCTION_TRACE_PTR(ns_get_secondary_object, obj_desc); 293 294 if ((!obj_desc) || |
297 (ACPI_GET_OBJECT_TYPE(obj_desc) == ACPI_TYPE_LOCAL_DATA) || | 295 (obj_desc->common.type == ACPI_TYPE_LOCAL_DATA) || |
298 (!obj_desc->common.next_object) || | 296 (!obj_desc->common.next_object) || |
299 (ACPI_GET_OBJECT_TYPE(obj_desc->common.next_object) == | 297 ((obj_desc->common.next_object)->common.type == |
300 ACPI_TYPE_LOCAL_DATA)) { 301 return_PTR(NULL); 302 } 303 304 return_PTR(obj_desc->common.next_object); 305} 306 307/******************************************************************************* --- 18 unchanged lines hidden (view full) --- 326 union acpi_operand_object *obj_desc; 327 union acpi_operand_object *data_desc; 328 329 /* We only allow one attachment per handler */ 330 331 prev_obj_desc = NULL; 332 obj_desc = node->object; 333 while (obj_desc) { | 298 ACPI_TYPE_LOCAL_DATA)) { 299 return_PTR(NULL); 300 } 301 302 return_PTR(obj_desc->common.next_object); 303} 304 305/******************************************************************************* --- 18 unchanged lines hidden (view full) --- 324 union acpi_operand_object *obj_desc; 325 union acpi_operand_object *data_desc; 326 327 /* We only allow one attachment per handler */ 328 329 prev_obj_desc = NULL; 330 obj_desc = node->object; 331 while (obj_desc) { |
334 if ((ACPI_GET_OBJECT_TYPE(obj_desc) == ACPI_TYPE_LOCAL_DATA) && | 332 if ((obj_desc->common.type == ACPI_TYPE_LOCAL_DATA) && |
335 (obj_desc->data.handler == handler)) { 336 return (AE_ALREADY_EXISTS); 337 } 338 339 prev_obj_desc = obj_desc; 340 obj_desc = obj_desc->common.next_object; 341 } 342 --- 37 unchanged lines hidden (view full) --- 380 acpi_object_handler handler) 381{ 382 union acpi_operand_object *obj_desc; 383 union acpi_operand_object *prev_obj_desc; 384 385 prev_obj_desc = NULL; 386 obj_desc = node->object; 387 while (obj_desc) { | 333 (obj_desc->data.handler == handler)) { 334 return (AE_ALREADY_EXISTS); 335 } 336 337 prev_obj_desc = obj_desc; 338 obj_desc = obj_desc->common.next_object; 339 } 340 --- 37 unchanged lines hidden (view full) --- 378 acpi_object_handler handler) 379{ 380 union acpi_operand_object *obj_desc; 381 union acpi_operand_object *prev_obj_desc; 382 383 prev_obj_desc = NULL; 384 obj_desc = node->object; 385 while (obj_desc) { |
388 if ((ACPI_GET_OBJECT_TYPE(obj_desc) == ACPI_TYPE_LOCAL_DATA) && | 386 if ((obj_desc->common.type == ACPI_TYPE_LOCAL_DATA) && |
389 (obj_desc->data.handler == handler)) { 390 if (prev_obj_desc) { 391 prev_obj_desc->common.next_object = 392 obj_desc->common.next_object; 393 } else { 394 node->object = obj_desc->common.next_object; 395 } 396 --- 26 unchanged lines hidden (view full) --- 423acpi_status 424acpi_ns_get_attached_data(struct acpi_namespace_node * node, 425 acpi_object_handler handler, void **data) 426{ 427 union acpi_operand_object *obj_desc; 428 429 obj_desc = node->object; 430 while (obj_desc) { | 387 (obj_desc->data.handler == handler)) { 388 if (prev_obj_desc) { 389 prev_obj_desc->common.next_object = 390 obj_desc->common.next_object; 391 } else { 392 node->object = obj_desc->common.next_object; 393 } 394 --- 26 unchanged lines hidden (view full) --- 421acpi_status 422acpi_ns_get_attached_data(struct acpi_namespace_node * node, 423 acpi_object_handler handler, void **data) 424{ 425 union acpi_operand_object *obj_desc; 426 427 obj_desc = node->object; 428 while (obj_desc) { |
431 if ((ACPI_GET_OBJECT_TYPE(obj_desc) == ACPI_TYPE_LOCAL_DATA) && | 429 if ((obj_desc->common.type == ACPI_TYPE_LOCAL_DATA) && |
432 (obj_desc->data.handler == handler)) { 433 *data = obj_desc->data.pointer; 434 return (AE_OK); 435 } 436 437 obj_desc = obj_desc->common.next_object; 438 } 439 440 return (AE_NOT_FOUND); 441} | 430 (obj_desc->data.handler == handler)) { 431 *data = obj_desc->data.pointer; 432 return (AE_OK); 433 } 434 435 obj_desc = obj_desc->common.next_object; 436 } 437 438 return (AE_NOT_FOUND); 439} |