psxface.c revision 26f3cdf03f1adcc98f6d3d99843ee71e9229a8c0
/******************************************************************************
*
* Module Name: psxface - Parser external interfaces
*
*****************************************************************************/
/*
* Copyright (C) 2000 - 2011, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* Alternatively, this software may be distributed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
* NO WARRANTY
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGES.
*/
#define __PSXFACE_C__
#include "acpi.h"
#include "accommon.h"
#include "acparser.h"
#include "acdispat.h"
#include "acinterp.h"
#include "actables.h"
#define _COMPONENT ACPI_PARSER
ACPI_MODULE_NAME ("psxface")
/* Local Prototypes */
static void
static void
static void
/*******************************************************************************
*
* FUNCTION: AcpiDebugTrace
*
* PARAMETERS: MethodName - Valid ACPI name string
* DebugLevel - Optional level mask. 0 to use default
* DebugLayer - Optional layer mask. 0 to use default
* Flags - bit 1: one shot(1) or persistent(0)
*
* RETURN: Status
*
* DESCRIPTION: External interface to enable debug tracing during control
* method execution
*
******************************************************************************/
char *Name,
{
if (ACPI_FAILURE (Status))
{
return (Status);
}
/* TBDs: Validate name, allow full path or just nameseg */
if (DebugLevel)
{
}
if (DebugLayer)
{
}
(void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
return (AE_OK);
}
/*******************************************************************************
*
* FUNCTION: AcpiPsStartTrace
*
* PARAMETERS: Info - Method info struct
*
* RETURN: None
*
* DESCRIPTION: Start control method execution trace
*
******************************************************************************/
static void
{
if (ACPI_FAILURE (Status))
{
return;
}
if ((!AcpiGbl_TraceMethodName) ||
{
goto Exit;
}
AcpiDbgLevel = 0x00FFFFFF;
{
}
{
}
Exit:
(void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
}
/*******************************************************************************
*
* FUNCTION: AcpiPsStopTrace
*
* PARAMETERS: Info - Method info struct
*
* RETURN: None
*
* DESCRIPTION: Stop control method execution trace
*
******************************************************************************/
static void
{
if (ACPI_FAILURE (Status))
{
return;
}
if ((!AcpiGbl_TraceMethodName) ||
{
goto Exit;
}
/* Disable further tracing if type is one-shot */
if (AcpiGbl_TraceFlags & 1)
{
}
Exit:
(void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
}
/*******************************************************************************
*
* FUNCTION: AcpiPsExecuteMethod
*
* PARAMETERS: Info - Method info block, contains:
* Node - Method Node to execute
* ObjDesc - Method object
* Parameters - List of parameters to pass to the method,
* terminated by NULL. Params itself may be
* NULL if no parameters are being passed.
* ReturnObject - Where to put method's return value (if
* any). If NULL, no value is returned.
* ParameterType - Type of Parameter list
* ReturnObject - Where to put method's return value (if
* any). If NULL, no value is returned.
* PassNumber - Parse or execute pass
*
* RETURN: Status
*
* DESCRIPTION: Execute a control method
*
******************************************************************************/
{
/* Quick validation of DSDT header */
/* Validate the Info and method Node */
{
}
/* Init for new method, wait on concurrency semaphore */
if (ACPI_FAILURE (Status))
{
}
/*
* The caller "owns" the parameters, so give each one an extra reference
*/
/* Begin tracing if requested */
/*
* Execute the method. Performs parse simultaneously
*/
/* Create and init a Root Node */
Op = AcpiPsCreateScopeOp ();
if (!Op)
{
goto Cleanup;
}
/* Create and initialize a new walk state */
if (!WalkState)
{
goto Cleanup;
}
if (ACPI_FAILURE (Status))
{
goto Cleanup;
}
{
}
/* Invoke an internal method if necessary */
{
/* Cleanup states */
goto Cleanup;
}
/*
* Start method evaluation with an implicit return of zero. This is done
* for Windows compatibility.
*/
{
AcpiUtCreateIntegerObject ((UINT64) 0);
if (!WalkState->ImplicitReturnObj)
{
goto Cleanup;
}
}
/* Parse the AML */
/* WalkState was deleted by ParseAml */
/* End optional tracing */
/* Take away the extra reference that we gave the parameters above */
/* Exit now if error above */
if (ACPI_FAILURE (Status))
{
}
/*
* If the method has returned an object, signal this to the caller with
* a control exception code
*/
if (Info->ReturnObject)
{
Info->ReturnObject));
}
}
/*******************************************************************************
*
* FUNCTION: AcpiPsUpdateParameterList
*
* PARAMETERS: Info - See ACPI_EVALUATE_INFO
* (Used: ParameterType and Parameters)
* Action - Add or Remove reference
*
* RETURN: Status
*
* DESCRIPTION: Update reference count on all method parameter objects
*
******************************************************************************/
static void
{
UINT32 i;
if (Info->Parameters)
{
/* Update reference count for each parameter */
for (i = 0; Info->Parameters[i]; i++)
{
/* Ignore errors, just do them all */
}
}
}