Deleted Added
full compact
exresolv.c (100966) exresolv.c (104470)
1
2/******************************************************************************
3 *
4 * Module Name: exresolv - AML Interpreter object resolution
1
2/******************************************************************************
3 *
4 * Module Name: exresolv - AML Interpreter object resolution
5 * $Revision: 115 $
5 * $Revision: 116 $
6 *
7 *****************************************************************************/
8
9/******************************************************************************
10 *
11 * 1. Copyright Notice
12 *
13 * Some or all of this work - Copyright (c) 1999 - 2002, Intel Corp.

--- 102 unchanged lines hidden (view full) ---

116 *****************************************************************************/
117
118#define __EXRESOLV_C__
119
120#include "acpi.h"
121#include "amlcode.h"
122#include "acdispat.h"
123#include "acinterp.h"
6 *
7 *****************************************************************************/
8
9/******************************************************************************
10 *
11 * 1. Copyright Notice
12 *
13 * Some or all of this work - Copyright (c) 1999 - 2002, Intel Corp.

--- 102 unchanged lines hidden (view full) ---

116 *****************************************************************************/
117
118#define __EXRESOLV_C__
119
120#include "acpi.h"
121#include "amlcode.h"
122#include "acdispat.h"
123#include "acinterp.h"
124#include "acnamesp.h"
124
125
126#define _COMPONENT ACPI_EXECUTER
127 ACPI_MODULE_NAME ("exresolv")
128
129
130/*******************************************************************************
131 *

--- 246 unchanged lines hidden (view full) ---

378 default:
379 break;
380 }
381
382 return_ACPI_STATUS (Status);
383}
384
385
125
126
127#define _COMPONENT ACPI_EXECUTER
128 ACPI_MODULE_NAME ("exresolv")
129
130
131/*******************************************************************************
132 *

--- 246 unchanged lines hidden (view full) ---

379 default:
380 break;
381 }
382
383 return_ACPI_STATUS (Status);
384}
385
386
387/*******************************************************************************
388 *
389 * FUNCTION: AcpiExResolveMultiple
390 *
391 * PARAMETERS: WalkState - Current state (contains AML opcode)
392 * Operand - Starting point for resolution
393 * ReturnType - Where the object type is returned
394 * ReturnDesc - Where the resolved object is returned
395 *
396 * RETURN: Status
397 *
398 * DESCRIPTION: Return the base object and type. Traverse a reference list if
399 * necessary to get to the base object.
400 *
401 ******************************************************************************/
402
403ACPI_STATUS
404AcpiExResolveMultiple (
405 ACPI_WALK_STATE *WalkState,
406 ACPI_OPERAND_OBJECT *Operand,
407 ACPI_OBJECT_TYPE *ReturnType,
408 ACPI_OPERAND_OBJECT **ReturnDesc)
409{
410 ACPI_OPERAND_OBJECT *ObjDesc = (void *) Operand;
411 ACPI_NAMESPACE_NODE *Node;
412 ACPI_OBJECT_TYPE Type;
413
414
415 ACPI_FUNCTION_TRACE ("ExGetObjectType");
416
417
418 /*
419 * For reference objects created via the RefOf or Index operators,
420 * we need to get to the base object (as per the ACPI specification
421 * of the ObjectType and SizeOf operators). This means traversing
422 * the list of possibly many nested references.
423 */
424 while (ACPI_GET_OBJECT_TYPE (ObjDesc) == INTERNAL_TYPE_REFERENCE)
425 {
426 switch (ObjDesc->Reference.Opcode)
427 {
428 case AML_REF_OF_OP:
429
430 /* Dereference the reference pointer */
431
432 Node = ObjDesc->Reference.Object;
433
434 /* All "References" point to a NS node */
435
436 if (ACPI_GET_DESCRIPTOR_TYPE (Node) != ACPI_DESC_TYPE_NAMED)
437 {
438 return_ACPI_STATUS (AE_AML_INTERNAL);
439 }
440
441 /* Get the attached object */
442
443 ObjDesc = AcpiNsGetAttachedObject (Node);
444 if (!ObjDesc)
445 {
446 /* No object, use the NS node type */
447
448 Type = AcpiNsGetType (Node);
449 goto Exit;
450 }
451
452 /* Check for circular references */
453
454 if (ObjDesc == Operand)
455 {
456 return_ACPI_STATUS (AE_AML_CIRCULAR_REFERENCE);
457 }
458 break;
459
460
461 case AML_INDEX_OP:
462
463 /* Get the type of this reference (index into another object) */
464
465 Type = ObjDesc->Reference.TargetType;
466 if (Type != ACPI_TYPE_PACKAGE)
467 {
468 goto Exit;
469 }
470
471 /*
472 * The main object is a package, we want to get the type
473 * of the individual package element that is referenced by
474 * the index.
475 *
476 * This could of course in turn be another reference object.
477 */
478 ObjDesc = *(ObjDesc->Reference.Where);
479 break;
480
481
482 case AML_INT_NAMEPATH_OP:
483
484 /* Dereference the reference pointer */
485
486 Node = ObjDesc->Reference.Node;
487
488 /* All "References" point to a NS node */
489
490 if (ACPI_GET_DESCRIPTOR_TYPE (Node) != ACPI_DESC_TYPE_NAMED)
491 {
492 return_ACPI_STATUS (AE_AML_INTERNAL);
493 }
494
495 /* Get the attached object */
496
497 ObjDesc = AcpiNsGetAttachedObject (Node);
498 if (!ObjDesc)
499 {
500 /* No object, use the NS node type */
501
502 Type = AcpiNsGetType (Node);
503 goto Exit;
504 }
505
506 /* Check for circular references */
507
508 if (ObjDesc == Operand)
509 {
510 return_ACPI_STATUS (AE_AML_CIRCULAR_REFERENCE);
511 }
512 break;
513
514
515 case AML_DEBUG_OP:
516
517 /* The Debug Object is of type "DebugObject" */
518
519 Type = ACPI_TYPE_DEBUG_OBJECT;
520 goto Exit;
521
522
523 default:
524
525 ACPI_REPORT_ERROR (("AcpiExResolveMultiple: Unknown Reference subtype %X\n",
526 ObjDesc->Reference.Opcode));
527 return_ACPI_STATUS (AE_AML_INTERNAL);
528 }
529 }
530
531 /*
532 * Now we are guaranteed to have an object that has not been created
533 * via the RefOf or Index operators.
534 */
535 Type = ACPI_GET_OBJECT_TYPE (ObjDesc);
536
537
538Exit:
539 /* Convert internal types to external types */
540
541 switch (Type)
542 {
543 case INTERNAL_TYPE_REGION_FIELD:
544 case INTERNAL_TYPE_BANK_FIELD:
545 case INTERNAL_TYPE_INDEX_FIELD:
546
547 Type = ACPI_TYPE_FIELD_UNIT;
548 break;
549
550 default:
551 /* No change to Type required */
552 break;
553 }
554
555 *ReturnType = Type;
556 if (ReturnDesc)
557 {
558 *ReturnDesc = ObjDesc;
559 }
560 return_ACPI_STATUS (AE_OK);
561}
562
563