Deleted Added
full compact
nsxfeval.c (197104) nsxfeval.c (199337)
1/*******************************************************************************
2 *
3 * Module Name: nsxfeval - Public interfaces to the ACPI subsystem
4 * ACPI Object evaluation interfaces
5 *
6 ******************************************************************************/
7
8/******************************************************************************

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

539
540/*******************************************************************************
541 *
542 * FUNCTION: AcpiWalkNamespace
543 *
544 * PARAMETERS: Type - ACPI_OBJECT_TYPE to search for
545 * StartObject - Handle in namespace where search begins
546 * MaxDepth - Depth to which search is to reach
1/*******************************************************************************
2 *
3 * Module Name: nsxfeval - Public interfaces to the ACPI subsystem
4 * ACPI Object evaluation interfaces
5 *
6 ******************************************************************************/
7
8/******************************************************************************

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

539
540/*******************************************************************************
541 *
542 * FUNCTION: AcpiWalkNamespace
543 *
544 * PARAMETERS: Type - ACPI_OBJECT_TYPE to search for
545 * StartObject - Handle in namespace where search begins
546 * MaxDepth - Depth to which search is to reach
547 * UserFunction - Called when an object of "Type" is found
548 * Context - Passed to user function
547 * PreOrderVisit - Called during tree pre-order visit
548 * when an object of "Type" is found
549 * PostOrderVisit - Called during tree post-order visit
550 * when an object of "Type" is found
551 * Context - Passed to user function(s) above
549 * ReturnValue - Location where return value of
550 * UserFunction is put if terminated early
551 *
552 * RETURNS Return value from the UserFunction if terminated early.
553 * Otherwise, returns NULL.
554 *
555 * DESCRIPTION: Performs a modified depth-first walk of the namespace tree,
556 * starting (and ending) at the object specified by StartHandle.
552 * ReturnValue - Location where return value of
553 * UserFunction is put if terminated early
554 *
555 * RETURNS Return value from the UserFunction if terminated early.
556 * Otherwise, returns NULL.
557 *
558 * DESCRIPTION: Performs a modified depth-first walk of the namespace tree,
559 * starting (and ending) at the object specified by StartHandle.
557 * The UserFunction is called whenever an object that matches
558 * the type parameter is found. If the user function returns
560 * The callback function is called whenever an object that matches
561 * the type parameter is found. If the callback function returns
559 * a non-zero value, the search is terminated immediately and this
560 * value is returned to the caller.
561 *
562 * The point of this procedure is to provide a generic namespace
563 * walk routine that can be called from multiple places to
562 * a non-zero value, the search is terminated immediately and this
563 * value is returned to the caller.
564 *
565 * The point of this procedure is to provide a generic namespace
566 * walk routine that can be called from multiple places to
564 * provide multiple services; the User Function can be tailored
565 * to each task, whether it is a print function, a compare
566 * function, etc.
567 * provide multiple services; the callback function(s) can be
568 * tailored to each task, whether it is a print function,
569 * a compare function, etc.
567 *
568 ******************************************************************************/
569
570ACPI_STATUS
571AcpiWalkNamespace (
572 ACPI_OBJECT_TYPE Type,
573 ACPI_HANDLE StartObject,
574 UINT32 MaxDepth,
570 *
571 ******************************************************************************/
572
573ACPI_STATUS
574AcpiWalkNamespace (
575 ACPI_OBJECT_TYPE Type,
576 ACPI_HANDLE StartObject,
577 UINT32 MaxDepth,
575 ACPI_WALK_CALLBACK UserFunction,
578 ACPI_WALK_CALLBACK PreOrderVisit,
579 ACPI_WALK_CALLBACK PostOrderVisit,
576 void *Context,
577 void **ReturnValue)
578{
579 ACPI_STATUS Status;
580
581
582 ACPI_FUNCTION_TRACE (AcpiWalkNamespace);
583
584
585 /* Parameter validation */
586
587 if ((Type > ACPI_TYPE_LOCAL_MAX) ||
588 (!MaxDepth) ||
580 void *Context,
581 void **ReturnValue)
582{
583 ACPI_STATUS Status;
584
585
586 ACPI_FUNCTION_TRACE (AcpiWalkNamespace);
587
588
589 /* Parameter validation */
590
591 if ((Type > ACPI_TYPE_LOCAL_MAX) ||
592 (!MaxDepth) ||
589 (!UserFunction))
593 (!PreOrderVisit && !PostOrderVisit))
590 {
591 return_ACPI_STATUS (AE_BAD_PARAMETER);
592 }
593
594 /*
595 * Need to acquire the namespace reader lock to prevent interference
596 * with any concurrent table unloads (which causes the deletion of
597 * namespace objects). We cannot allow the deletion of a namespace node

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

616 */
617 Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE);
618 if (ACPI_FAILURE (Status))
619 {
620 goto UnlockAndExit;
621 }
622
623 Status = AcpiNsWalkNamespace (Type, StartObject, MaxDepth,
594 {
595 return_ACPI_STATUS (AE_BAD_PARAMETER);
596 }
597
598 /*
599 * Need to acquire the namespace reader lock to prevent interference
600 * with any concurrent table unloads (which causes the deletion of
601 * namespace objects). We cannot allow the deletion of a namespace node

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

620 */
621 Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE);
622 if (ACPI_FAILURE (Status))
623 {
624 goto UnlockAndExit;
625 }
626
627 Status = AcpiNsWalkNamespace (Type, StartObject, MaxDepth,
624 ACPI_NS_WALK_UNLOCK, UserFunction, Context, ReturnValue);
628 ACPI_NS_WALK_UNLOCK, PreOrderVisit,
629 PostOrderVisit, Context, ReturnValue);
625
626 (void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
627
628UnlockAndExit:
629 (void) AcpiUtReleaseReadLock (&AcpiGbl_NamespaceRwLock);
630 return_ACPI_STATUS (Status);
631}
632

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

828 Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE);
829 if (ACPI_FAILURE (Status))
830 {
831 return_ACPI_STATUS (Status);
832 }
833
834 Status = AcpiNsWalkNamespace (ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT,
835 ACPI_UINT32_MAX, ACPI_NS_WALK_UNLOCK,
630
631 (void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
632
633UnlockAndExit:
634 (void) AcpiUtReleaseReadLock (&AcpiGbl_NamespaceRwLock);
635 return_ACPI_STATUS (Status);
636}
637

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

833 Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE);
834 if (ACPI_FAILURE (Status))
835 {
836 return_ACPI_STATUS (Status);
837 }
838
839 Status = AcpiNsWalkNamespace (ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT,
840 ACPI_UINT32_MAX, ACPI_NS_WALK_UNLOCK,
836 AcpiNsGetDeviceCallback, &Info, ReturnValue);
841 AcpiNsGetDeviceCallback, NULL, &Info, ReturnValue);
837
838 (void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
839 return_ACPI_STATUS (Status);
840}
841
842ACPI_EXPORT_SYMBOL (AcpiGetDevices)
843
844

--- 171 unchanged lines hidden ---
842
843 (void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
844 return_ACPI_STATUS (Status);
845}
846
847ACPI_EXPORT_SYMBOL (AcpiGetDevices)
848
849

--- 171 unchanged lines hidden ---