rsutils.c revision 70243
167754Smsmith/*******************************************************************************
267754Smsmith *
367754Smsmith * Module Name: rsutils - Utilities for the resource manager
470243Smsmith *              $Revision: 13 $
567754Smsmith *
667754Smsmith ******************************************************************************/
767754Smsmith
867754Smsmith/******************************************************************************
967754Smsmith *
1067754Smsmith * 1. Copyright Notice
1167754Smsmith *
1270243Smsmith * Some or all of this work - Copyright (c) 1999, 2000, Intel Corp.
1370243Smsmith * All rights reserved.
1467754Smsmith *
1567754Smsmith * 2. License
1667754Smsmith *
1767754Smsmith * 2.1. This is your license from Intel Corp. under its intellectual property
1867754Smsmith * rights.  You may have additional license terms from the party that provided
1967754Smsmith * you this software, covering your right to use that party's intellectual
2067754Smsmith * property rights.
2167754Smsmith *
2267754Smsmith * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
2367754Smsmith * copy of the source code appearing in this file ("Covered Code") an
2467754Smsmith * irrevocable, perpetual, worldwide license under Intel's copyrights in the
2567754Smsmith * base code distributed originally by Intel ("Original Intel Code") to copy,
2667754Smsmith * make derivatives, distribute, use and display any portion of the Covered
2767754Smsmith * Code in any form, with the right to sublicense such rights; and
2867754Smsmith *
2967754Smsmith * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
3067754Smsmith * license (with the right to sublicense), under only those claims of Intel
3167754Smsmith * patents that are infringed by the Original Intel Code, to make, use, sell,
3267754Smsmith * offer to sell, and import the Covered Code and derivative works thereof
3367754Smsmith * solely to the minimum extent necessary to exercise the above copyright
3467754Smsmith * license, and in no event shall the patent license extend to any additions
3567754Smsmith * to or modifications of the Original Intel Code.  No other license or right
3667754Smsmith * is granted directly or by implication, estoppel or otherwise;
3767754Smsmith *
3867754Smsmith * The above copyright and patent license is granted only if the following
3967754Smsmith * conditions are met:
4067754Smsmith *
4167754Smsmith * 3. Conditions
4267754Smsmith *
4367754Smsmith * 3.1. Redistribution of Source with Rights to Further Distribute Source.
4467754Smsmith * Redistribution of source code of any substantial portion of the Covered
4567754Smsmith * Code or modification with rights to further distribute source must include
4667754Smsmith * the above Copyright Notice, the above License, this list of Conditions,
4767754Smsmith * and the following Disclaimer and Export Compliance provision.  In addition,
4867754Smsmith * Licensee must cause all Covered Code to which Licensee contributes to
4967754Smsmith * contain a file documenting the changes Licensee made to create that Covered
5067754Smsmith * Code and the date of any change.  Licensee must include in that file the
5167754Smsmith * documentation of any changes made by any predecessor Licensee.  Licensee
5267754Smsmith * must include a prominent statement that the modification is derived,
5367754Smsmith * directly or indirectly, from Original Intel Code.
5467754Smsmith *
5567754Smsmith * 3.2. Redistribution of Source with no Rights to Further Distribute Source.
5667754Smsmith * Redistribution of source code of any substantial portion of the Covered
5767754Smsmith * Code or modification without rights to further distribute source must
5867754Smsmith * include the following Disclaimer and Export Compliance provision in the
5967754Smsmith * documentation and/or other materials provided with distribution.  In
6067754Smsmith * addition, Licensee may not authorize further sublicense of source of any
6167754Smsmith * portion of the Covered Code, and must include terms to the effect that the
6267754Smsmith * license from Licensee to its licensee is limited to the intellectual
6367754Smsmith * property embodied in the software Licensee provides to its licensee, and
6467754Smsmith * not to intellectual property embodied in modifications its licensee may
6567754Smsmith * make.
6667754Smsmith *
6767754Smsmith * 3.3. Redistribution of Executable. Redistribution in executable form of any
6867754Smsmith * substantial portion of the Covered Code or modification must reproduce the
6967754Smsmith * above Copyright Notice, and the following Disclaimer and Export Compliance
7067754Smsmith * provision in the documentation and/or other materials provided with the
7167754Smsmith * distribution.
7267754Smsmith *
7367754Smsmith * 3.4. Intel retains all right, title, and interest in and to the Original
7467754Smsmith * Intel Code.
7567754Smsmith *
7667754Smsmith * 3.5. Neither the name Intel nor any other trademark owned or controlled by
7767754Smsmith * Intel shall be used in advertising or otherwise to promote the sale, use or
7867754Smsmith * other dealings in products derived from or relating to the Covered Code
7967754Smsmith * without prior written authorization from Intel.
8067754Smsmith *
8167754Smsmith * 4. Disclaimer and Export Compliance
8267754Smsmith *
8367754Smsmith * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
8467754Smsmith * HERE.  ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
8567754Smsmith * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT,  ASSISTANCE,
8667754Smsmith * INSTALLATION, TRAINING OR OTHER SERVICES.  INTEL WILL NOT PROVIDE ANY
8767754Smsmith * UPDATES, ENHANCEMENTS OR EXTENSIONS.  INTEL SPECIFICALLY DISCLAIMS ANY
8867754Smsmith * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
8967754Smsmith * PARTICULAR PURPOSE.
9067754Smsmith *
9167754Smsmith * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
9267754Smsmith * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
9367754Smsmith * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
9467754Smsmith * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
9567754Smsmith * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
9667754Smsmith * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES.  THESE LIMITATIONS
9767754Smsmith * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
9867754Smsmith * LIMITED REMEDY.
9967754Smsmith *
10067754Smsmith * 4.3. Licensee shall not export, either directly or indirectly, any of this
10167754Smsmith * software or system incorporating such software without first obtaining any
10267754Smsmith * required license or other approval from the U. S. Department of Commerce or
10367754Smsmith * any other agency or department of the United States Government.  In the
10467754Smsmith * event Licensee exports any such software from the United States or
10567754Smsmith * re-exports any such software from a foreign destination, Licensee shall
10667754Smsmith * ensure that the distribution and export/re-export of the software is in
10767754Smsmith * compliance with all laws, regulations, orders, or other restrictions of the
10867754Smsmith * U.S. Export Administration Regulations. Licensee agrees that neither it nor
10967754Smsmith * any of its subsidiaries will export/re-export any technical data, process,
11067754Smsmith * software, or service, directly or indirectly, to any country for which the
11167754Smsmith * United States government or any agency thereof requires an export license,
11267754Smsmith * other governmental approval, or letter of assurance, without first obtaining
11367754Smsmith * such license, approval or letter.
11467754Smsmith *
11567754Smsmith *****************************************************************************/
11667754Smsmith
11767754Smsmith
11867754Smsmith#define __RSUTILS_C__
11967754Smsmith
12067754Smsmith#include "acpi.h"
12167754Smsmith#include "acnamesp.h"
12267754Smsmith#include "acresrc.h"
12367754Smsmith
12467754Smsmith
12567754Smsmith#define _COMPONENT          RESOURCE_MANAGER
12667754Smsmith        MODULE_NAME         ("rsutils")
12767754Smsmith
12867754Smsmith
12967754Smsmith/*******************************************************************************
13067754Smsmith *
13167754Smsmith * FUNCTION:    AcpiRsGetPrtMethodData
13267754Smsmith *
13367754Smsmith * PARAMETERS:  Handle          - a handle to the containing object
13467754Smsmith *              RetBuffer       - a pointer to a buffer structure for the
13567754Smsmith *                                  results
13667754Smsmith *
13767754Smsmith * RETURN:      Status          - the status of the call
13867754Smsmith *
13967754Smsmith * DESCRIPTION: This function is called to get the _PRT value of an object
14067754Smsmith *              contained in an object specified by the handle passed in
14167754Smsmith *
14267754Smsmith *              If the function fails an appropriate status will be returned
14367754Smsmith *              and the contents of the callers buffer is undefined.
14467754Smsmith *
14567754Smsmith ******************************************************************************/
14667754Smsmith
14767754SmsmithACPI_STATUS
14867754SmsmithAcpiRsGetPrtMethodData (
14967754Smsmith    ACPI_HANDLE             Handle,
15067754Smsmith    ACPI_BUFFER             *RetBuffer)
15167754Smsmith{
15267754Smsmith    ACPI_OPERAND_OBJECT     *RetObj;
15367754Smsmith    ACPI_STATUS             Status;
15467754Smsmith    UINT32                  BufferSpaceNeeded;
15567754Smsmith
15667754Smsmith
15767754Smsmith    FUNCTION_TRACE ("RsGetPrtMethodData");
15867754Smsmith
15967754Smsmith
16067754Smsmith    /* already validated params, so we won't repeat here */
16167754Smsmith
16267754Smsmith    BufferSpaceNeeded = RetBuffer->Length;
16367754Smsmith
16467754Smsmith    /*
16567754Smsmith     *  Execute the method, no parameters
16667754Smsmith     */
16767754Smsmith    Status = AcpiNsEvaluateRelative (Handle, "_PRT", NULL, &RetObj);
16867754Smsmith    if (ACPI_FAILURE (Status))
16967754Smsmith    {
17067754Smsmith        return_ACPI_STATUS (Status);
17167754Smsmith    }
17267754Smsmith
17367754Smsmith    if (!RetObj)
17467754Smsmith    {
17567754Smsmith        /* Return object is required */
17667754Smsmith
17767754Smsmith        DEBUG_PRINT (ACPI_ERROR, ("No object was returned from _PRT\n"));
17867754Smsmith        return_ACPI_STATUS (AE_TYPE);
17967754Smsmith    }
18067754Smsmith
18167754Smsmith
18267754Smsmith    /*
18367754Smsmith     * The return object will be a package, so check the
18467754Smsmith     *  parameters.  If the return object is not a package,
18567754Smsmith     *  then the underlying AML code is corrupt or improperly
18667754Smsmith     *  written.
18767754Smsmith     */
18867754Smsmith    if (ACPI_TYPE_PACKAGE != RetObj->Common.Type)
18967754Smsmith    {
19067754Smsmith        Status = AE_AML_OPERAND_TYPE;
19167754Smsmith        goto Cleanup;
19267754Smsmith    }
19367754Smsmith
19467754Smsmith    /*
19567754Smsmith     * Make the call to create a resource linked list from the
19667754Smsmith     *  byte stream buffer that comes back from the _CRS method
19767754Smsmith     *  execution.
19867754Smsmith     */
19967754Smsmith    Status = AcpiRsCreatePciRoutingTable (RetObj,
20067754Smsmith                                      RetBuffer->Pointer,
20167754Smsmith                                      &BufferSpaceNeeded);
20267754Smsmith
20367754Smsmith    /*
20467754Smsmith     * Tell the user how much of the buffer we have used or is needed
20567754Smsmith     *  and return the final status.
20667754Smsmith     */
20767754Smsmith    RetBuffer->Length = BufferSpaceNeeded;
20867754Smsmith
20967754Smsmith
21067754Smsmith    /* On exit, we must delete the object returned by evaluateObject */
21167754Smsmith
21267754SmsmithCleanup:
21367754Smsmith
21467754Smsmith    AcpiCmRemoveReference (RetObj);
21567754Smsmith
21667754Smsmith    return_ACPI_STATUS (Status);
21767754Smsmith}
21867754Smsmith
21967754Smsmith
22067754Smsmith/*******************************************************************************
22167754Smsmith *
22267754Smsmith * FUNCTION:    AcpiRsGetCrsMethodData
22367754Smsmith *
22467754Smsmith * PARAMETERS:  Handle          - a handle to the containing object
22567754Smsmith *              RetBuffer       - a pointer to a buffer structure for the
22667754Smsmith *                                  results
22767754Smsmith *
22867754Smsmith * RETURN:      Status          - the status of the call
22967754Smsmith *
23067754Smsmith * DESCRIPTION: This function is called to get the _CRS value of an object
23167754Smsmith *              contained in an object specified by the handle passed in
23267754Smsmith *
23367754Smsmith *              If the function fails an appropriate status will be returned
23467754Smsmith *              and the contents of the callers buffer is undefined.
23567754Smsmith *
23667754Smsmith ******************************************************************************/
23767754Smsmith
23867754SmsmithACPI_STATUS
23967754SmsmithAcpiRsGetCrsMethodData (
24067754Smsmith    ACPI_HANDLE             Handle,
24167754Smsmith    ACPI_BUFFER             *RetBuffer)
24267754Smsmith{
24367754Smsmith    ACPI_OPERAND_OBJECT     *RetObj;
24467754Smsmith    ACPI_STATUS             Status;
24567754Smsmith    UINT32                  BufferSpaceNeeded = RetBuffer->Length;
24667754Smsmith
24767754Smsmith
24867754Smsmith    FUNCTION_TRACE ("RsGetCrsMethodData");
24967754Smsmith
25067754Smsmith
25167754Smsmith    /* already validated params, so we won't repeat here */
25267754Smsmith
25367754Smsmith    /*
25467754Smsmith     *  Execute the method, no parameters
25567754Smsmith     */
25667754Smsmith    Status = AcpiNsEvaluateRelative (Handle, "_CRS", NULL, &RetObj);
25767754Smsmith    if (ACPI_FAILURE (Status))
25867754Smsmith    {
25967754Smsmith        return_ACPI_STATUS (Status);
26067754Smsmith    }
26167754Smsmith
26267754Smsmith    if (!RetObj)
26367754Smsmith    {
26467754Smsmith        /* Return object is required */
26567754Smsmith
26667754Smsmith        DEBUG_PRINT (ACPI_ERROR, ("No object was returned from _CRS\n"));
26767754Smsmith        return_ACPI_STATUS (AE_TYPE);
26867754Smsmith    }
26967754Smsmith
27067754Smsmith    /*
27167754Smsmith     * The return object will be a buffer, but check the
27267754Smsmith     *  parameters.  If the return object is not a buffer,
27367754Smsmith     *  then the underlying AML code is corrupt or improperly
27467754Smsmith     *  written.
27567754Smsmith     */
27667754Smsmith    if (ACPI_TYPE_BUFFER != RetObj->Common.Type)
27767754Smsmith    {
27867754Smsmith        Status = AE_AML_OPERAND_TYPE;
27967754Smsmith        goto Cleanup;
28067754Smsmith    }
28167754Smsmith
28267754Smsmith    /*
28367754Smsmith     * Make the call to create a resource linked list from the
28467754Smsmith     *  byte stream buffer that comes back from the _CRS method
28567754Smsmith     *  execution.
28667754Smsmith     */
28767754Smsmith    Status = AcpiRsCreateResourceList (RetObj,
28867754Smsmith                                   RetBuffer->Pointer,
28967754Smsmith                                   &BufferSpaceNeeded);
29067754Smsmith
29167754Smsmith
29267754Smsmith    if (ACPI_SUCCESS (Status))
29367754Smsmith    {
29467754Smsmith        DUMP_RESOURCE_LIST(RetBuffer->Pointer);
29567754Smsmith    }
29667754Smsmith
29767754Smsmith    /*
29867754Smsmith     * Tell the user how much of the buffer we have used or is needed
29967754Smsmith     *  and return the final status.
30067754Smsmith     */
30167754Smsmith    RetBuffer->Length = BufferSpaceNeeded;
30267754Smsmith
30367754Smsmith
30467754Smsmith    /* On exit, we must delete the object returned by evaluateObject */
30567754Smsmith
30667754SmsmithCleanup:
30767754Smsmith
30867754Smsmith    AcpiCmRemoveReference (RetObj);
30967754Smsmith
31067754Smsmith    return_ACPI_STATUS (Status);
31167754Smsmith}
31267754Smsmith
31367754Smsmith
31467754Smsmith/*******************************************************************************
31567754Smsmith *
31667754Smsmith * FUNCTION:    AcpiRsGetPrsMethodData
31767754Smsmith *
31867754Smsmith * PARAMETERS:  Handle          - a handle to the containing object
31967754Smsmith *              RetBuffer       - a pointer to a buffer structure for the
32067754Smsmith *                                  results
32167754Smsmith *
32267754Smsmith * RETURN:      Status          - the status of the call
32367754Smsmith *
32467754Smsmith * DESCRIPTION: This function is called to get the _PRS value of an object
32567754Smsmith *              contained in an object specified by the handle passed in
32667754Smsmith *
32767754Smsmith *              If the function fails an appropriate status will be returned
32867754Smsmith *              and the contents of the callers buffer is undefined.
32967754Smsmith *
33067754Smsmith ******************************************************************************/
33167754Smsmith
33267754SmsmithACPI_STATUS
33367754SmsmithAcpiRsGetPrsMethodData (
33467754Smsmith    ACPI_HANDLE             Handle,
33567754Smsmith    ACPI_BUFFER             *RetBuffer)
33667754Smsmith{
33767754Smsmith    ACPI_OPERAND_OBJECT     *RetObj;
33867754Smsmith    ACPI_STATUS             Status;
33967754Smsmith    UINT32                  BufferSpaceNeeded = RetBuffer->Length;
34067754Smsmith
34167754Smsmith
34267754Smsmith    FUNCTION_TRACE ("RsGetPrsMethodData");
34367754Smsmith
34467754Smsmith
34567754Smsmith    /* already validated params, so we won't repeat here */
34667754Smsmith
34767754Smsmith    /*
34867754Smsmith     *  Execute the method, no parameters
34967754Smsmith     */
35067754Smsmith    Status = AcpiNsEvaluateRelative (Handle, "_PRS", NULL, &RetObj);
35167754Smsmith    if (ACPI_FAILURE (Status))
35267754Smsmith    {
35367754Smsmith        return_ACPI_STATUS (Status);
35467754Smsmith    }
35567754Smsmith
35667754Smsmith    if (!RetObj)
35767754Smsmith    {
35867754Smsmith        /* Return object is required */
35967754Smsmith
36067754Smsmith        DEBUG_PRINT (ACPI_ERROR, ("No object was returned from _PRS\n"));
36167754Smsmith        return_ACPI_STATUS (AE_TYPE);
36267754Smsmith    }
36367754Smsmith
36467754Smsmith    /*
36567754Smsmith     * The return object will be a buffer, but check the
36667754Smsmith     *  parameters.  If the return object is not a buffer,
36767754Smsmith     *  then the underlying AML code is corrupt or improperly
36867754Smsmith     *  written..
36967754Smsmith     */
37067754Smsmith    if (ACPI_TYPE_BUFFER != RetObj->Common.Type)
37167754Smsmith    {
37267754Smsmith        Status = AE_AML_OPERAND_TYPE;
37367754Smsmith        goto Cleanup;
37467754Smsmith    }
37567754Smsmith
37667754Smsmith    /*
37767754Smsmith     * Make the call to create a resource linked list from the
37867754Smsmith     *  byte stream buffer that comes back from the _CRS method
37967754Smsmith     *  execution.
38067754Smsmith     */
38167754Smsmith    Status = AcpiRsCreateResourceList (RetObj,
38267754Smsmith                                   RetBuffer->Pointer,
38367754Smsmith                                   &BufferSpaceNeeded);
38467754Smsmith
38567754Smsmith    /*
38667754Smsmith     * Tell the user how much of the buffer we have used or is needed
38767754Smsmith     *  and return the final status.
38867754Smsmith     */
38967754Smsmith    RetBuffer->Length = BufferSpaceNeeded;
39067754Smsmith
39167754Smsmith
39267754Smsmith    /* On exit, we must delete the object returned by evaluateObject */
39367754Smsmith
39467754SmsmithCleanup:
39567754Smsmith
39667754Smsmith    AcpiCmRemoveReference (RetObj);
39767754Smsmith
39867754Smsmith    return_ACPI_STATUS (Status);
39967754Smsmith}
40067754Smsmith
40167754Smsmith
40267754Smsmith/*******************************************************************************
40367754Smsmith *
40467754Smsmith * FUNCTION:    AcpiRsSetSrsMethodData
40567754Smsmith *
40667754Smsmith * PARAMETERS:  Handle          - a handle to the containing object
40767754Smsmith *              InBuffer        - a pointer to a buffer structure of the
40867754Smsmith *                                  parameter
40967754Smsmith *
41067754Smsmith * RETURN:      Status          - the status of the call
41167754Smsmith *
41267754Smsmith * DESCRIPTION: This function is called to set the _SRS of an object contained
41367754Smsmith *              in an object specified by the handle passed in
41467754Smsmith *
41567754Smsmith *              If the function fails an appropriate status will be returned
41667754Smsmith *              and the contents of the callers buffer is undefined.
41767754Smsmith *
41867754Smsmith ******************************************************************************/
41967754Smsmith
42067754SmsmithACPI_STATUS
42167754SmsmithAcpiRsSetSrsMethodData (
42267754Smsmith    ACPI_HANDLE             Handle,
42367754Smsmith    ACPI_BUFFER             *InBuffer)
42467754Smsmith{
42567754Smsmith    ACPI_OPERAND_OBJECT     *Params[2];
42667754Smsmith    ACPI_OPERAND_OBJECT     ParamObj;
42767754Smsmith    ACPI_STATUS             Status;
42867754Smsmith    UINT8                   *ByteStream = NULL;
42967754Smsmith    UINT32                  BufferSizeNeeded = 0;
43067754Smsmith
43167754Smsmith
43267754Smsmith    FUNCTION_TRACE ("RsSetSrsMethodData");
43367754Smsmith
43467754Smsmith
43567754Smsmith    /* already validated params, so we won't repeat here */
43667754Smsmith
43767754Smsmith    /*
43867754Smsmith     * The InBuffer parameter will point to a linked list of
43967754Smsmith     *  resource parameters.  It needs to be formatted into a
44067754Smsmith     *  byte stream to be sent in as an input parameter.
44167754Smsmith     */
44267754Smsmith    BufferSizeNeeded = 0;
44367754Smsmith
44467754Smsmith    /*
44567754Smsmith     * First call is to get the buffer size needed
44667754Smsmith     */
44767754Smsmith    Status = AcpiRsCreateByteStream (InBuffer->Pointer,
44867754Smsmith                                 ByteStream,
44967754Smsmith                                 &BufferSizeNeeded);
45067754Smsmith    /*
45167754Smsmith     * We expect a return of AE_BUFFER_OVERFLOW
45267754Smsmith     *  if not, exit with the error
45367754Smsmith     */
45467754Smsmith    if (AE_BUFFER_OVERFLOW != Status)
45567754Smsmith    {
45667754Smsmith        return_ACPI_STATUS (Status);
45767754Smsmith    }
45867754Smsmith
45967754Smsmith    /*
46067754Smsmith     * Allocate the buffer needed
46167754Smsmith     */
46267754Smsmith    ByteStream = AcpiCmCallocate(BufferSizeNeeded);
46367754Smsmith    if (NULL == ByteStream)
46467754Smsmith    {
46567754Smsmith        return_ACPI_STATUS (AE_NO_MEMORY);
46667754Smsmith    }
46767754Smsmith
46867754Smsmith    /*
46967754Smsmith     * Now call to convert the linked list into a byte stream
47067754Smsmith     */
47167754Smsmith    Status = AcpiRsCreateByteStream (InBuffer->Pointer,
47267754Smsmith                                 ByteStream,
47367754Smsmith                                 &BufferSizeNeeded);
47467754Smsmith    if (ACPI_FAILURE (Status))
47567754Smsmith    {
47667754Smsmith        goto Cleanup;
47767754Smsmith    }
47867754Smsmith
47967754Smsmith    /*
48067754Smsmith     *  Init the param object
48167754Smsmith     */
48267754Smsmith    AcpiCmInitStaticObject (&ParamObj);
48367754Smsmith
48467754Smsmith    /*
48567754Smsmith     *  Method requires one parameter.  Set it up
48667754Smsmith     */
48767754Smsmith    Params [0] = &ParamObj;
48867754Smsmith    Params [1] = NULL;
48967754Smsmith
49067754Smsmith    /*
49167754Smsmith     *  Set up the parameter object
49267754Smsmith     */
49367754Smsmith    ParamObj.Common.Type    = ACPI_TYPE_BUFFER;
49467754Smsmith    ParamObj.Buffer.Length  = BufferSizeNeeded;
49567754Smsmith    ParamObj.Buffer.Pointer = ByteStream;
49667754Smsmith
49767754Smsmith    /*
49867754Smsmith     *  Execute the method, no return value
49967754Smsmith     */
50067754Smsmith    Status = AcpiNsEvaluateRelative (Handle, "_SRS", Params, NULL);
50167754Smsmith
50267754Smsmith    /*
50367754Smsmith     *  Clean up and return the status from AcpiNsEvaluateRelative
50467754Smsmith     */
50567754Smsmith
50667754SmsmithCleanup:
50767754Smsmith
50867754Smsmith    AcpiCmFree (ByteStream);
50967754Smsmith    return_ACPI_STATUS (Status);
51067754Smsmith}
51167754Smsmith
512