Deleted Added
sdiff udiff text old ( 197104 ) new ( 199337 )
full compact
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 * 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
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.
560 * The callback function is called whenever an object that matches
561 * the type parameter is found. If the callback function returns
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
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.
570 *
571 ******************************************************************************/
572
573ACPI_STATUS
574AcpiWalkNamespace (
575 ACPI_OBJECT_TYPE Type,
576 ACPI_HANDLE StartObject,
577 UINT32 MaxDepth,
578 ACPI_WALK_CALLBACK PreOrderVisit,
579 ACPI_WALK_CALLBACK PostOrderVisit,
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) ||
593 (!PreOrderVisit && !PostOrderVisit))
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,
628 ACPI_NS_WALK_UNLOCK, PreOrderVisit,
629 PostOrderVisit, Context, ReturnValue);
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,
841 AcpiNsGetDeviceCallback, NULL, &Info, ReturnValue);
842
843 (void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
844 return_ACPI_STATUS (Status);
845}
846
847ACPI_EXPORT_SYMBOL (AcpiGetDevices)
848
849

--- 171 unchanged lines hidden ---