diff options
| author | Jung-uk Kim <jkim@FreeBSD.org> | 2016-11-17 18:06:08 +0000 | 
|---|---|---|
| committer | Jung-uk Kim <jkim@FreeBSD.org> | 2016-11-17 18:06:08 +0000 | 
| commit | a56e3c255d5c5dfa4dd3a2fda4705a1607a6b7f3 (patch) | |
| tree | 830d95042126506cd52440fe9710bb4e6811cfde /source/components/namespace | |
| parent | 7600ac2283596bd000a29b9347e95346d3b740d7 (diff) | |
Diffstat (limited to 'source/components/namespace')
| -rw-r--r-- | source/components/namespace/nsload.c | 2 | ||||
| -rw-r--r-- | source/components/namespace/nsnames.c | 52 | ||||
| -rw-r--r-- | source/components/namespace/nsxfname.c | 42 | 
3 files changed, 64 insertions, 32 deletions
| diff --git a/source/components/namespace/nsload.c b/source/components/namespace/nsload.c index 6e11d6b706243..d7dbf8955fa00 100644 --- a/source/components/namespace/nsload.c +++ b/source/components/namespace/nsload.c @@ -154,7 +154,9 @@ Unlock:      ACPI_DEBUG_PRINT ((ACPI_DB_INFO,          "**** Begin Table Object Initialization\n")); +    AcpiExEnterInterpreter ();      Status = AcpiDsInitializeObjects (TableIndex, Node); +    AcpiExExitInterpreter ();      ACPI_DEBUG_PRINT ((ACPI_DB_INFO,          "**** Completed Table Object Initialization\n")); diff --git a/source/components/namespace/nsnames.c b/source/components/namespace/nsnames.c index 95f8c8db970ca..8af12f1972794 100644 --- a/source/components/namespace/nsnames.c +++ b/source/components/namespace/nsnames.c @@ -110,6 +110,58 @@ AcpiNsGetPathnameLength (  /*******************************************************************************   * + * FUNCTION:    AcpiNsHandleToName + * + * PARAMETERS:  TargetHandle            - Handle of named object whose name is + *                                        to be found + *              Buffer                  - Where the name is returned + * + * RETURN:      Status, Buffer is filled with name if status is AE_OK + * + * DESCRIPTION: Build and return a full namespace name + * + ******************************************************************************/ + +ACPI_STATUS +AcpiNsHandleToName ( +    ACPI_HANDLE             TargetHandle, +    ACPI_BUFFER             *Buffer) +{ +    ACPI_STATUS             Status; +    ACPI_NAMESPACE_NODE     *Node; +    const char              *NodeName; + + +    ACPI_FUNCTION_TRACE_PTR (NsHandleToName, TargetHandle); + + +    Node = AcpiNsValidateHandle (TargetHandle); +    if (!Node) +    { +        return_ACPI_STATUS (AE_BAD_PARAMETER); +    } + +    /* Validate/Allocate/Clear caller buffer */ + +    Status = AcpiUtInitializeBuffer (Buffer, ACPI_PATH_SEGMENT_LENGTH); +    if (ACPI_FAILURE (Status)) +    { +        return_ACPI_STATUS (Status); +    } + +    /* Just copy the ACPI name from the Node and zero terminate it */ + +    NodeName = AcpiUtGetNodeName (Node); +    ACPI_MOVE_NAME (Buffer->Pointer, NodeName); +    ((char *) Buffer->Pointer) [ACPI_NAME_SIZE] = 0; + +    ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "%4.4s\n", (char *) Buffer->Pointer)); +    return_ACPI_STATUS (AE_OK); +} + + +/******************************************************************************* + *   * FUNCTION:    AcpiNsHandleToPathname   *   * PARAMETERS:  TargetHandle            - Handle of named object whose name is diff --git a/source/components/namespace/nsxfname.c b/source/components/namespace/nsxfname.c index cfd6937f497fb..1621ba985da90 100644 --- a/source/components/namespace/nsxfname.c +++ b/source/components/namespace/nsxfname.c @@ -176,8 +176,6 @@ AcpiGetName (      ACPI_BUFFER             *Buffer)  {      ACPI_STATUS             Status; -    ACPI_NAMESPACE_NODE     *Node; -    const char              *NodeName;      /* Parameter validation */ @@ -193,16 +191,6 @@ AcpiGetName (          return (Status);      } -    if (NameType == ACPI_FULL_PATHNAME || -        NameType == ACPI_FULL_PATHNAME_NO_TRAILING) -    { -        /* Get the full pathname (From the namespace root) */ - -        Status = AcpiNsHandleToPathname (Handle, Buffer, -            NameType == ACPI_FULL_PATHNAME ? FALSE : TRUE); -        return (Status); -    } -      /*       * Wants the single segment ACPI name.       * Validate handle and convert to a namespace Node @@ -213,30 +201,20 @@ AcpiGetName (          return (Status);      } -    Node = AcpiNsValidateHandle (Handle); -    if (!Node) +    if (NameType == ACPI_FULL_PATHNAME || +        NameType == ACPI_FULL_PATHNAME_NO_TRAILING)      { -        Status = AE_BAD_PARAMETER; -        goto UnlockAndExit; -    } - -    /* Validate/Allocate/Clear caller buffer */ +        /* Get the full pathname (From the namespace root) */ -    Status = AcpiUtInitializeBuffer (Buffer, ACPI_PATH_SEGMENT_LENGTH); -    if (ACPI_FAILURE (Status)) -    { -        goto UnlockAndExit; +        Status = AcpiNsHandleToPathname (Handle, Buffer, +            NameType == ACPI_FULL_PATHNAME ? FALSE : TRUE);      } +    else +    { +        /* Get the single name */ -    /* Just copy the ACPI name from the Node and zero terminate it */ - -    NodeName = AcpiUtGetNodeName (Node); -    ACPI_MOVE_NAME (Buffer->Pointer, NodeName); -    ((char *) Buffer->Pointer) [ACPI_NAME_SIZE] = 0; -    Status = AE_OK; - - -UnlockAndExit: +        Status = AcpiNsHandleToName (Handle, Buffer); +    }      (void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);      return (Status); | 
