ACPI: upgrade to acpica-unix2-20141107
Change-Id: I96151a2756fd9814bfba180548e8a96dca63ce51
This commit is contained in:
@@ -7,125 +7,153 @@ SRCS= \
|
||||
osminixxf.c
|
||||
|
||||
ACPICA_SRCS= \
|
||||
utxface.c \
|
||||
utdelete.c \
|
||||
utobject.c \
|
||||
utcopy.c \
|
||||
utids.c \
|
||||
utglobal.c \
|
||||
utalloc.c \
|
||||
utstate.c \
|
||||
utdebug.c \
|
||||
uteval.c \
|
||||
utcache.c \
|
||||
utlock.c \
|
||||
uttrack.c \
|
||||
utclib.c \
|
||||
utinit.c \
|
||||
utmisc.c \
|
||||
utmutex.c \
|
||||
utresrc.c \
|
||||
utmath.c \
|
||||
nsparse.c \
|
||||
nsutils.c \
|
||||
nsaccess.c \
|
||||
nsrepair.c \
|
||||
nsalloc.c \
|
||||
nswalk.c \
|
||||
nsnames.c \
|
||||
nssearch.c \
|
||||
nsxfname.c \
|
||||
nseval.c \
|
||||
nsxfobj.c \
|
||||
nsobject.c \
|
||||
nspredef.c \
|
||||
nsdumpdv.c \
|
||||
nsload.c \
|
||||
nsdump.c \
|
||||
nsinit.c \
|
||||
nsrepair2.c \
|
||||
nsxfeval.c \
|
||||
rsirq.c \
|
||||
rsmisc.c \
|
||||
rsio.c \
|
||||
rsaddr.c \
|
||||
rsutils.c \
|
||||
rscreate.c \
|
||||
rsdump.c \
|
||||
rscalc.c \
|
||||
rslist.c \
|
||||
rsxface.c \
|
||||
rsinfo.c \
|
||||
rsmemory.c \
|
||||
dsobject.c \
|
||||
dsmethod.c \
|
||||
dsopcode.c \
|
||||
dswscope.c \
|
||||
dsinit.c \
|
||||
dswexec.c \
|
||||
dswstate.c \
|
||||
dsargs.c \
|
||||
dscontrol.c \
|
||||
dsfield.c \
|
||||
dsinit.c \
|
||||
dsmethod.c \
|
||||
dsmthdat.c \
|
||||
dsobject.c \
|
||||
dsopcode.c \
|
||||
dsutils.c \
|
||||
dswexec.c \
|
||||
dswload.c \
|
||||
evxfregn.c \
|
||||
evrgnini.c \
|
||||
evregion.c \
|
||||
evgpeblk.c \
|
||||
evxface.c \
|
||||
evmisc.c \
|
||||
evgpeutil.c \
|
||||
evgpeinit.c \
|
||||
evxfevnt.c \
|
||||
dswload2.c \
|
||||
dswscope.c \
|
||||
dswstate.c \
|
||||
evevent.c \
|
||||
evsci.c \
|
||||
evglock.c \
|
||||
evgpe.c \
|
||||
exoparg1.c \
|
||||
exutils.c \
|
||||
excreate.c \
|
||||
exstore.c \
|
||||
exregion.c \
|
||||
exoparg6.c \
|
||||
exprep.c \
|
||||
exmutex.c \
|
||||
exnames.c \
|
||||
exoparg2.c \
|
||||
exdump.c \
|
||||
exmisc.c \
|
||||
exresolv.c \
|
||||
exdebug.c \
|
||||
exstoren.c \
|
||||
exoparg3.c \
|
||||
exstorob.c \
|
||||
evgpeblk.c \
|
||||
evgpeinit.c \
|
||||
evgpeutil.c \
|
||||
evhandler.c \
|
||||
evmisc.c \
|
||||
evregion.c \
|
||||
evrgnini.c \
|
||||
evsci.c \
|
||||
evxface.c \
|
||||
evxfevnt.c \
|
||||
evxfregn.c \
|
||||
exconfig.c \
|
||||
exresop.c \
|
||||
exconvrt.c \
|
||||
excreate.c \
|
||||
exdebug.c \
|
||||
exdump.c \
|
||||
exfield.c \
|
||||
exfldio.c \
|
||||
exmisc.c \
|
||||
exmutex.c \
|
||||
exnames.c \
|
||||
exoparg1.c \
|
||||
exoparg2.c \
|
||||
exoparg3.c \
|
||||
exoparg6.c \
|
||||
exprep.c \
|
||||
exregion.c \
|
||||
exresnte.c \
|
||||
exconvrt.c \
|
||||
exresolv.c \
|
||||
exresop.c \
|
||||
exstore.c \
|
||||
exstoren.c \
|
||||
exstorob.c \
|
||||
exsystem.c \
|
||||
tbfadt.c \
|
||||
tbxface.c \
|
||||
tbxfroot.c \
|
||||
tbutils.c \
|
||||
tbinstal.c \
|
||||
tbfind.c \
|
||||
psutils.c \
|
||||
psargs.c \
|
||||
psloop.c \
|
||||
psparse.c \
|
||||
pswalk.c \
|
||||
pstree.c \
|
||||
psopcode.c \
|
||||
psxface.c \
|
||||
psscope.c \
|
||||
exutils.c \
|
||||
hwacpi.c \
|
||||
hwesleep.c \
|
||||
hwgpe.c \
|
||||
hwpci.c \
|
||||
hwregs.c \
|
||||
hwsleep.c \
|
||||
hwvalid.c \
|
||||
hwgpe.c \
|
||||
hwacpi.c \
|
||||
hwtimer.c \
|
||||
hwxface.c
|
||||
hwvalid.c \
|
||||
hwxface.c \
|
||||
nsaccess.c \
|
||||
nsalloc.c \
|
||||
nsarguments.c \
|
||||
nsconvert.c \
|
||||
nsdump.c \
|
||||
nsdumpdv.c \
|
||||
nseval.c \
|
||||
nsinit.c \
|
||||
nsload.c \
|
||||
nsnames.c \
|
||||
nsobject.c \
|
||||
nsparse.c \
|
||||
nspredef.c \
|
||||
nsprepkg.c \
|
||||
nsrepair.c \
|
||||
nsrepair2.c \
|
||||
nssearch.c \
|
||||
nsutils.c \
|
||||
nswalk.c \
|
||||
nsxfeval.c \
|
||||
nsxfname.c \
|
||||
nsxfobj.c \
|
||||
psargs.c \
|
||||
psloop.c \
|
||||
psobject.c \
|
||||
psopcode.c \
|
||||
psopinfo.c \
|
||||
psparse.c \
|
||||
psscope.c \
|
||||
pstree.c \
|
||||
psutils.c \
|
||||
pswalk.c \
|
||||
psxface.c \
|
||||
rsaddr.c \
|
||||
rscalc.c \
|
||||
rscreate.c \
|
||||
rsdump.c \
|
||||
rsinfo.c \
|
||||
rsio.c \
|
||||
rsirq.c \
|
||||
rslist.c \
|
||||
rsmemory.c \
|
||||
rsmisc.c \
|
||||
rsserial.c \
|
||||
rsutils.c \
|
||||
rsxface.c \
|
||||
tbdata.c \
|
||||
tbfadt.c \
|
||||
tbfind.c \
|
||||
tbinstal.c \
|
||||
tbprint.c \
|
||||
tbutils.c \
|
||||
tbxface.c \
|
||||
tbxfload.c \
|
||||
tbxfroot.c \
|
||||
utaddress.c \
|
||||
utalloc.c \
|
||||
utbuffer.c \
|
||||
utcache.c \
|
||||
utclib.c \
|
||||
utcopy.c \
|
||||
utdebug.c \
|
||||
utdecode.c \
|
||||
utdelete.c \
|
||||
uterror.c \
|
||||
uteval.c \
|
||||
utexcep.c \
|
||||
utglobal.c \
|
||||
uthex.c \
|
||||
utids.c \
|
||||
utinit.c \
|
||||
utlock.c \
|
||||
utmath.c \
|
||||
utmisc.c \
|
||||
utmutex.c \
|
||||
utobject.c \
|
||||
utosi.c \
|
||||
utownerid.c \
|
||||
utpredef.c \
|
||||
utresrc.c \
|
||||
utstate.c \
|
||||
utstring.c \
|
||||
uttrack.c \
|
||||
utxface.c \
|
||||
utxferror.c \
|
||||
utxfinit.c
|
||||
|
||||
.PATH: ${.CURDIR}/utilities ${.CURDIR}/namespace ${.CURDIR}/resources \
|
||||
${.CURDIR}/dispatcher ${.CURDIR}/events ${.CURDIR}/executer \
|
||||
|
||||
436
minix/drivers/power/acpi/dispatcher/dsargs.c
Normal file
436
minix/drivers/power/acpi/dispatcher/dsargs.c
Normal file
@@ -0,0 +1,436 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Module Name: dsargs - Support for execution of dynamic arguments for static
|
||||
* objects (regions, fields, buffer fields, etc.)
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, 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.
|
||||
*/
|
||||
|
||||
#include "acpi.h"
|
||||
#include "accommon.h"
|
||||
#include "acparser.h"
|
||||
#include "amlcode.h"
|
||||
#include "acdispat.h"
|
||||
#include "acnamesp.h"
|
||||
|
||||
#define _COMPONENT ACPI_DISPATCHER
|
||||
ACPI_MODULE_NAME ("dsargs")
|
||||
|
||||
/* Local prototypes */
|
||||
|
||||
static ACPI_STATUS
|
||||
AcpiDsExecuteArguments (
|
||||
ACPI_NAMESPACE_NODE *Node,
|
||||
ACPI_NAMESPACE_NODE *ScopeNode,
|
||||
UINT32 AmlLength,
|
||||
UINT8 *AmlStart);
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiDsExecuteArguments
|
||||
*
|
||||
* PARAMETERS: Node - Object NS node
|
||||
* ScopeNode - Parent NS node
|
||||
* AmlLength - Length of executable AML
|
||||
* AmlStart - Pointer to the AML
|
||||
*
|
||||
* RETURN: Status.
|
||||
*
|
||||
* DESCRIPTION: Late (deferred) execution of region or field arguments
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
static ACPI_STATUS
|
||||
AcpiDsExecuteArguments (
|
||||
ACPI_NAMESPACE_NODE *Node,
|
||||
ACPI_NAMESPACE_NODE *ScopeNode,
|
||||
UINT32 AmlLength,
|
||||
UINT8 *AmlStart)
|
||||
{
|
||||
ACPI_STATUS Status;
|
||||
ACPI_PARSE_OBJECT *Op;
|
||||
ACPI_WALK_STATE *WalkState;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE (DsExecuteArguments);
|
||||
|
||||
|
||||
/* Allocate a new parser op to be the root of the parsed tree */
|
||||
|
||||
Op = AcpiPsAllocOp (AML_INT_EVAL_SUBTREE_OP);
|
||||
if (!Op)
|
||||
{
|
||||
return_ACPI_STATUS (AE_NO_MEMORY);
|
||||
}
|
||||
|
||||
/* Save the Node for use in AcpiPsParseAml */
|
||||
|
||||
Op->Common.Node = ScopeNode;
|
||||
|
||||
/* Create and initialize a new parser state */
|
||||
|
||||
WalkState = AcpiDsCreateWalkState (0, NULL, NULL, NULL);
|
||||
if (!WalkState)
|
||||
{
|
||||
Status = AE_NO_MEMORY;
|
||||
goto Cleanup;
|
||||
}
|
||||
|
||||
Status = AcpiDsInitAmlWalk (WalkState, Op, NULL, AmlStart,
|
||||
AmlLength, NULL, ACPI_IMODE_LOAD_PASS1);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
AcpiDsDeleteWalkState (WalkState);
|
||||
goto Cleanup;
|
||||
}
|
||||
|
||||
/* Mark this parse as a deferred opcode */
|
||||
|
||||
WalkState->ParseFlags = ACPI_PARSE_DEFERRED_OP;
|
||||
WalkState->DeferredNode = Node;
|
||||
|
||||
/* Pass1: Parse the entire declaration */
|
||||
|
||||
Status = AcpiPsParseAml (WalkState);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
goto Cleanup;
|
||||
}
|
||||
|
||||
/* Get and init the Op created above */
|
||||
|
||||
Op->Common.Node = Node;
|
||||
AcpiPsDeleteParseTree (Op);
|
||||
|
||||
/* Evaluate the deferred arguments */
|
||||
|
||||
Op = AcpiPsAllocOp (AML_INT_EVAL_SUBTREE_OP);
|
||||
if (!Op)
|
||||
{
|
||||
return_ACPI_STATUS (AE_NO_MEMORY);
|
||||
}
|
||||
|
||||
Op->Common.Node = ScopeNode;
|
||||
|
||||
/* Create and initialize a new parser state */
|
||||
|
||||
WalkState = AcpiDsCreateWalkState (0, NULL, NULL, NULL);
|
||||
if (!WalkState)
|
||||
{
|
||||
Status = AE_NO_MEMORY;
|
||||
goto Cleanup;
|
||||
}
|
||||
|
||||
/* Execute the opcode and arguments */
|
||||
|
||||
Status = AcpiDsInitAmlWalk (WalkState, Op, NULL, AmlStart,
|
||||
AmlLength, NULL, ACPI_IMODE_EXECUTE);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
AcpiDsDeleteWalkState (WalkState);
|
||||
goto Cleanup;
|
||||
}
|
||||
|
||||
/* Mark this execution as a deferred opcode */
|
||||
|
||||
WalkState->DeferredNode = Node;
|
||||
Status = AcpiPsParseAml (WalkState);
|
||||
|
||||
Cleanup:
|
||||
AcpiPsDeleteParseTree (Op);
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiDsGetBufferFieldArguments
|
||||
*
|
||||
* PARAMETERS: ObjDesc - A valid BufferField object
|
||||
*
|
||||
* RETURN: Status.
|
||||
*
|
||||
* DESCRIPTION: Get BufferField Buffer and Index. This implements the late
|
||||
* evaluation of these field attributes.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiDsGetBufferFieldArguments (
|
||||
ACPI_OPERAND_OBJECT *ObjDesc)
|
||||
{
|
||||
ACPI_OPERAND_OBJECT *ExtraDesc;
|
||||
ACPI_NAMESPACE_NODE *Node;
|
||||
ACPI_STATUS Status;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE_PTR (DsGetBufferFieldArguments, ObjDesc);
|
||||
|
||||
|
||||
if (ObjDesc->Common.Flags & AOPOBJ_DATA_VALID)
|
||||
{
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
}
|
||||
|
||||
/* Get the AML pointer (method object) and BufferField node */
|
||||
|
||||
ExtraDesc = AcpiNsGetSecondaryObject (ObjDesc);
|
||||
Node = ObjDesc->BufferField.Node;
|
||||
|
||||
ACPI_DEBUG_EXEC (AcpiUtDisplayInitPathname (ACPI_TYPE_BUFFER_FIELD,
|
||||
Node, NULL));
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "[%4.4s] BufferField Arg Init\n",
|
||||
AcpiUtGetNodeName (Node)));
|
||||
|
||||
/* Execute the AML code for the TermArg arguments */
|
||||
|
||||
Status = AcpiDsExecuteArguments (Node, Node->Parent,
|
||||
ExtraDesc->Extra.AmlLength, ExtraDesc->Extra.AmlStart);
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiDsGetBankFieldArguments
|
||||
*
|
||||
* PARAMETERS: ObjDesc - A valid BankField object
|
||||
*
|
||||
* RETURN: Status.
|
||||
*
|
||||
* DESCRIPTION: Get BankField BankValue. This implements the late
|
||||
* evaluation of these field attributes.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiDsGetBankFieldArguments (
|
||||
ACPI_OPERAND_OBJECT *ObjDesc)
|
||||
{
|
||||
ACPI_OPERAND_OBJECT *ExtraDesc;
|
||||
ACPI_NAMESPACE_NODE *Node;
|
||||
ACPI_STATUS Status;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE_PTR (DsGetBankFieldArguments, ObjDesc);
|
||||
|
||||
|
||||
if (ObjDesc->Common.Flags & AOPOBJ_DATA_VALID)
|
||||
{
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
}
|
||||
|
||||
/* Get the AML pointer (method object) and BankField node */
|
||||
|
||||
ExtraDesc = AcpiNsGetSecondaryObject (ObjDesc);
|
||||
Node = ObjDesc->BankField.Node;
|
||||
|
||||
ACPI_DEBUG_EXEC (AcpiUtDisplayInitPathname (ACPI_TYPE_LOCAL_BANK_FIELD,
|
||||
Node, NULL));
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "[%4.4s] BankField Arg Init\n",
|
||||
AcpiUtGetNodeName (Node)));
|
||||
|
||||
/* Execute the AML code for the TermArg arguments */
|
||||
|
||||
Status = AcpiDsExecuteArguments (Node, Node->Parent,
|
||||
ExtraDesc->Extra.AmlLength, ExtraDesc->Extra.AmlStart);
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiDsGetBufferArguments
|
||||
*
|
||||
* PARAMETERS: ObjDesc - A valid Buffer object
|
||||
*
|
||||
* RETURN: Status.
|
||||
*
|
||||
* DESCRIPTION: Get Buffer length and initializer byte list. This implements
|
||||
* the late evaluation of these attributes.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiDsGetBufferArguments (
|
||||
ACPI_OPERAND_OBJECT *ObjDesc)
|
||||
{
|
||||
ACPI_NAMESPACE_NODE *Node;
|
||||
ACPI_STATUS Status;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE_PTR (DsGetBufferArguments, ObjDesc);
|
||||
|
||||
|
||||
if (ObjDesc->Common.Flags & AOPOBJ_DATA_VALID)
|
||||
{
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
}
|
||||
|
||||
/* Get the Buffer node */
|
||||
|
||||
Node = ObjDesc->Buffer.Node;
|
||||
if (!Node)
|
||||
{
|
||||
ACPI_ERROR ((AE_INFO,
|
||||
"No pointer back to namespace node in buffer object %p", ObjDesc));
|
||||
return_ACPI_STATUS (AE_AML_INTERNAL);
|
||||
}
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Buffer Arg Init\n"));
|
||||
|
||||
/* Execute the AML code for the TermArg arguments */
|
||||
|
||||
Status = AcpiDsExecuteArguments (Node, Node,
|
||||
ObjDesc->Buffer.AmlLength, ObjDesc->Buffer.AmlStart);
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiDsGetPackageArguments
|
||||
*
|
||||
* PARAMETERS: ObjDesc - A valid Package object
|
||||
*
|
||||
* RETURN: Status.
|
||||
*
|
||||
* DESCRIPTION: Get Package length and initializer byte list. This implements
|
||||
* the late evaluation of these attributes.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiDsGetPackageArguments (
|
||||
ACPI_OPERAND_OBJECT *ObjDesc)
|
||||
{
|
||||
ACPI_NAMESPACE_NODE *Node;
|
||||
ACPI_STATUS Status;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE_PTR (DsGetPackageArguments, ObjDesc);
|
||||
|
||||
|
||||
if (ObjDesc->Common.Flags & AOPOBJ_DATA_VALID)
|
||||
{
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
}
|
||||
|
||||
/* Get the Package node */
|
||||
|
||||
Node = ObjDesc->Package.Node;
|
||||
if (!Node)
|
||||
{
|
||||
ACPI_ERROR ((AE_INFO,
|
||||
"No pointer back to namespace node in package %p", ObjDesc));
|
||||
return_ACPI_STATUS (AE_AML_INTERNAL);
|
||||
}
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Package Arg Init\n"));
|
||||
|
||||
/* Execute the AML code for the TermArg arguments */
|
||||
|
||||
Status = AcpiDsExecuteArguments (Node, Node,
|
||||
ObjDesc->Package.AmlLength, ObjDesc->Package.AmlStart);
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiDsGetRegionArguments
|
||||
*
|
||||
* PARAMETERS: ObjDesc - A valid region object
|
||||
*
|
||||
* RETURN: Status.
|
||||
*
|
||||
* DESCRIPTION: Get region address and length. This implements the late
|
||||
* evaluation of these region attributes.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiDsGetRegionArguments (
|
||||
ACPI_OPERAND_OBJECT *ObjDesc)
|
||||
{
|
||||
ACPI_NAMESPACE_NODE *Node;
|
||||
ACPI_STATUS Status;
|
||||
ACPI_OPERAND_OBJECT *ExtraDesc;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE_PTR (DsGetRegionArguments, ObjDesc);
|
||||
|
||||
|
||||
if (ObjDesc->Region.Flags & AOPOBJ_DATA_VALID)
|
||||
{
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
}
|
||||
|
||||
ExtraDesc = AcpiNsGetSecondaryObject (ObjDesc);
|
||||
if (!ExtraDesc)
|
||||
{
|
||||
return_ACPI_STATUS (AE_NOT_EXIST);
|
||||
}
|
||||
|
||||
/* Get the Region node */
|
||||
|
||||
Node = ObjDesc->Region.Node;
|
||||
|
||||
ACPI_DEBUG_EXEC (AcpiUtDisplayInitPathname (ACPI_TYPE_REGION, Node, NULL));
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "[%4.4s] OpRegion Arg Init at AML %p\n",
|
||||
AcpiUtGetNodeName (Node), ExtraDesc->Extra.AmlStart));
|
||||
|
||||
/* Execute the argument AML */
|
||||
|
||||
Status = AcpiDsExecuteArguments (Node, ExtraDesc->Extra.ScopeNode,
|
||||
ExtraDesc->Extra.AmlLength, ExtraDesc->Extra.AmlStart);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
Status = AcpiUtAddAddressRange (ObjDesc->Region.SpaceId,
|
||||
ObjDesc->Region.Address, ObjDesc->Region.Length,
|
||||
Node);
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
414
minix/drivers/power/acpi/dispatcher/dscontrol.c
Normal file
414
minix/drivers/power/acpi/dispatcher/dscontrol.c
Normal file
@@ -0,0 +1,414 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Module Name: dscontrol - Support for execution control opcodes -
|
||||
* if/else/while/return
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, 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.
|
||||
*/
|
||||
|
||||
#include "acpi.h"
|
||||
#include "accommon.h"
|
||||
#include "amlcode.h"
|
||||
#include "acdispat.h"
|
||||
#include "acinterp.h"
|
||||
|
||||
#define _COMPONENT ACPI_DISPATCHER
|
||||
ACPI_MODULE_NAME ("dscontrol")
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiDsExecBeginControlOp
|
||||
*
|
||||
* PARAMETERS: WalkList - The list that owns the walk stack
|
||||
* Op - The control Op
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Handles all control ops encountered during control method
|
||||
* execution.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiDsExecBeginControlOp (
|
||||
ACPI_WALK_STATE *WalkState,
|
||||
ACPI_PARSE_OBJECT *Op)
|
||||
{
|
||||
ACPI_STATUS Status = AE_OK;
|
||||
ACPI_GENERIC_STATE *ControlState;
|
||||
|
||||
|
||||
ACPI_FUNCTION_NAME (DsExecBeginControlOp);
|
||||
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Op=%p Opcode=%2.2X State=%p\n",
|
||||
Op, Op->Common.AmlOpcode, WalkState));
|
||||
|
||||
switch (Op->Common.AmlOpcode)
|
||||
{
|
||||
case AML_WHILE_OP:
|
||||
/*
|
||||
* If this is an additional iteration of a while loop, continue.
|
||||
* There is no need to allocate a new control state.
|
||||
*/
|
||||
if (WalkState->ControlState)
|
||||
{
|
||||
if (WalkState->ControlState->Control.AmlPredicateStart ==
|
||||
(WalkState->ParserState.Aml - 1))
|
||||
{
|
||||
/* Reset the state to start-of-loop */
|
||||
|
||||
WalkState->ControlState->Common.State =
|
||||
ACPI_CONTROL_CONDITIONAL_EXECUTING;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/*lint -fallthrough */
|
||||
|
||||
case AML_IF_OP:
|
||||
/*
|
||||
* IF/WHILE: Create a new control state to manage these
|
||||
* constructs. We need to manage these as a stack, in order
|
||||
* to handle nesting.
|
||||
*/
|
||||
ControlState = AcpiUtCreateControlState ();
|
||||
if (!ControlState)
|
||||
{
|
||||
Status = AE_NO_MEMORY;
|
||||
break;
|
||||
}
|
||||
/*
|
||||
* Save a pointer to the predicate for multiple executions
|
||||
* of a loop
|
||||
*/
|
||||
ControlState->Control.AmlPredicateStart = WalkState->ParserState.Aml - 1;
|
||||
ControlState->Control.PackageEnd = WalkState->ParserState.PkgEnd;
|
||||
ControlState->Control.Opcode = Op->Common.AmlOpcode;
|
||||
|
||||
|
||||
/* Push the control state on this walk's control stack */
|
||||
|
||||
AcpiUtPushGenericState (&WalkState->ControlState, ControlState);
|
||||
break;
|
||||
|
||||
case AML_ELSE_OP:
|
||||
|
||||
/* Predicate is in the state object */
|
||||
/* If predicate is true, the IF was executed, ignore ELSE part */
|
||||
|
||||
if (WalkState->LastPredicate)
|
||||
{
|
||||
Status = AE_CTRL_TRUE;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case AML_RETURN_OP:
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
return (Status);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiDsExecEndControlOp
|
||||
*
|
||||
* PARAMETERS: WalkList - The list that owns the walk stack
|
||||
* Op - The control Op
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Handles all control ops encountered during control method
|
||||
* execution.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiDsExecEndControlOp (
|
||||
ACPI_WALK_STATE *WalkState,
|
||||
ACPI_PARSE_OBJECT *Op)
|
||||
{
|
||||
ACPI_STATUS Status = AE_OK;
|
||||
ACPI_GENERIC_STATE *ControlState;
|
||||
|
||||
|
||||
ACPI_FUNCTION_NAME (DsExecEndControlOp);
|
||||
|
||||
|
||||
switch (Op->Common.AmlOpcode)
|
||||
{
|
||||
case AML_IF_OP:
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "[IF_OP] Op=%p\n", Op));
|
||||
|
||||
/*
|
||||
* Save the result of the predicate in case there is an
|
||||
* ELSE to come
|
||||
*/
|
||||
WalkState->LastPredicate =
|
||||
(BOOLEAN) WalkState->ControlState->Common.Value;
|
||||
|
||||
/*
|
||||
* Pop the control state that was created at the start
|
||||
* of the IF and free it
|
||||
*/
|
||||
ControlState = AcpiUtPopGenericState (&WalkState->ControlState);
|
||||
AcpiUtDeleteGenericState (ControlState);
|
||||
break;
|
||||
|
||||
case AML_ELSE_OP:
|
||||
|
||||
break;
|
||||
|
||||
case AML_WHILE_OP:
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "[WHILE_OP] Op=%p\n", Op));
|
||||
|
||||
ControlState = WalkState->ControlState;
|
||||
if (ControlState->Common.Value)
|
||||
{
|
||||
/* Predicate was true, the body of the loop was just executed */
|
||||
|
||||
/*
|
||||
* This loop counter mechanism allows the interpreter to escape
|
||||
* possibly infinite loops. This can occur in poorly written AML
|
||||
* when the hardware does not respond within a while loop and the
|
||||
* loop does not implement a timeout.
|
||||
*/
|
||||
ControlState->Control.LoopCount++;
|
||||
if (ControlState->Control.LoopCount > ACPI_MAX_LOOP_ITERATIONS)
|
||||
{
|
||||
Status = AE_AML_INFINITE_LOOP;
|
||||
break;
|
||||
}
|
||||
|
||||
/*
|
||||
* Go back and evaluate the predicate and maybe execute the loop
|
||||
* another time
|
||||
*/
|
||||
Status = AE_CTRL_PENDING;
|
||||
WalkState->AmlLastWhile = ControlState->Control.AmlPredicateStart;
|
||||
break;
|
||||
}
|
||||
|
||||
/* Predicate was false, terminate this while loop */
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
|
||||
"[WHILE_OP] termination! Op=%p\n",Op));
|
||||
|
||||
/* Pop this control state and free it */
|
||||
|
||||
ControlState = AcpiUtPopGenericState (&WalkState->ControlState);
|
||||
AcpiUtDeleteGenericState (ControlState);
|
||||
break;
|
||||
|
||||
case AML_RETURN_OP:
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
|
||||
"[RETURN_OP] Op=%p Arg=%p\n",Op, Op->Common.Value.Arg));
|
||||
|
||||
/*
|
||||
* One optional operand -- the return value
|
||||
* It can be either an immediate operand or a result that
|
||||
* has been bubbled up the tree
|
||||
*/
|
||||
if (Op->Common.Value.Arg)
|
||||
{
|
||||
/* Since we have a real Return(), delete any implicit return */
|
||||
|
||||
AcpiDsClearImplicitReturn (WalkState);
|
||||
|
||||
/* Return statement has an immediate operand */
|
||||
|
||||
Status = AcpiDsCreateOperands (WalkState, Op->Common.Value.Arg);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return (Status);
|
||||
}
|
||||
|
||||
/*
|
||||
* If value being returned is a Reference (such as
|
||||
* an arg or local), resolve it now because it may
|
||||
* cease to exist at the end of the method.
|
||||
*/
|
||||
Status = AcpiExResolveToValue (&WalkState->Operands [0], WalkState);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return (Status);
|
||||
}
|
||||
|
||||
/*
|
||||
* Get the return value and save as the last result
|
||||
* value. This is the only place where WalkState->ReturnDesc
|
||||
* is set to anything other than zero!
|
||||
*/
|
||||
WalkState->ReturnDesc = WalkState->Operands[0];
|
||||
}
|
||||
else if (WalkState->ResultCount)
|
||||
{
|
||||
/* Since we have a real Return(), delete any implicit return */
|
||||
|
||||
AcpiDsClearImplicitReturn (WalkState);
|
||||
|
||||
/*
|
||||
* The return value has come from a previous calculation.
|
||||
*
|
||||
* If value being returned is a Reference (such as
|
||||
* an arg or local), resolve it now because it may
|
||||
* cease to exist at the end of the method.
|
||||
*
|
||||
* Allow references created by the Index operator to return
|
||||
* unchanged.
|
||||
*/
|
||||
if ((ACPI_GET_DESCRIPTOR_TYPE (WalkState->Results->Results.ObjDesc[0]) == ACPI_DESC_TYPE_OPERAND) &&
|
||||
((WalkState->Results->Results.ObjDesc [0])->Common.Type == ACPI_TYPE_LOCAL_REFERENCE) &&
|
||||
((WalkState->Results->Results.ObjDesc [0])->Reference.Class != ACPI_REFCLASS_INDEX))
|
||||
{
|
||||
Status = AcpiExResolveToValue (&WalkState->Results->Results.ObjDesc [0], WalkState);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return (Status);
|
||||
}
|
||||
}
|
||||
|
||||
WalkState->ReturnDesc = WalkState->Results->Results.ObjDesc [0];
|
||||
}
|
||||
else
|
||||
{
|
||||
/* No return operand */
|
||||
|
||||
if (WalkState->NumOperands)
|
||||
{
|
||||
AcpiUtRemoveReference (WalkState->Operands [0]);
|
||||
}
|
||||
|
||||
WalkState->Operands [0] = NULL;
|
||||
WalkState->NumOperands = 0;
|
||||
WalkState->ReturnDesc = NULL;
|
||||
}
|
||||
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
|
||||
"Completed RETURN_OP State=%p, RetVal=%p\n",
|
||||
WalkState, WalkState->ReturnDesc));
|
||||
|
||||
/* End the control method execution right now */
|
||||
|
||||
Status = AE_CTRL_TERMINATE;
|
||||
break;
|
||||
|
||||
case AML_NOOP_OP:
|
||||
|
||||
/* Just do nothing! */
|
||||
|
||||
break;
|
||||
|
||||
case AML_BREAK_POINT_OP:
|
||||
|
||||
/*
|
||||
* Set the single-step flag. This will cause the debugger (if present)
|
||||
* to break to the console within the AML debugger at the start of the
|
||||
* next AML instruction.
|
||||
*/
|
||||
ACPI_DEBUGGER_EXEC (
|
||||
AcpiGbl_CmSingleStep = TRUE);
|
||||
ACPI_DEBUGGER_EXEC (
|
||||
AcpiOsPrintf ("**break** Executed AML BreakPoint opcode\n"));
|
||||
|
||||
/* Call to the OSL in case OS wants a piece of the action */
|
||||
|
||||
Status = AcpiOsSignal (ACPI_SIGNAL_BREAKPOINT,
|
||||
"Executed AML Breakpoint opcode");
|
||||
break;
|
||||
|
||||
case AML_BREAK_OP:
|
||||
case AML_CONTINUE_OP: /* ACPI 2.0 */
|
||||
|
||||
/* Pop and delete control states until we find a while */
|
||||
|
||||
while (WalkState->ControlState &&
|
||||
(WalkState->ControlState->Control.Opcode != AML_WHILE_OP))
|
||||
{
|
||||
ControlState = AcpiUtPopGenericState (&WalkState->ControlState);
|
||||
AcpiUtDeleteGenericState (ControlState);
|
||||
}
|
||||
|
||||
/* No while found? */
|
||||
|
||||
if (!WalkState->ControlState)
|
||||
{
|
||||
return (AE_AML_NO_WHILE);
|
||||
}
|
||||
|
||||
/* Was: WalkState->AmlLastWhile = WalkState->ControlState->Control.AmlPredicateStart; */
|
||||
|
||||
WalkState->AmlLastWhile = WalkState->ControlState->Control.PackageEnd;
|
||||
|
||||
/* Return status depending on opcode */
|
||||
|
||||
if (Op->Common.AmlOpcode == AML_BREAK_OP)
|
||||
{
|
||||
Status = AE_CTRL_BREAK;
|
||||
}
|
||||
else
|
||||
{
|
||||
Status = AE_CTRL_CONTINUE;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
ACPI_ERROR ((AE_INFO, "Unknown control opcode=0x%X Op=%p",
|
||||
Op->Common.AmlOpcode, Op));
|
||||
|
||||
Status = AE_AML_BAD_OPCODE;
|
||||
break;
|
||||
}
|
||||
|
||||
return (Status);
|
||||
}
|
||||
@@ -4,116 +4,42 @@
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
* 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.
|
||||
*
|
||||
* 2.1. This is your license from Intel Corp. under its intellectual property
|
||||
* rights. You may have additional license terms from the party that provided
|
||||
* you this software, covering your right to use that party's intellectual
|
||||
* property rights.
|
||||
* 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.
|
||||
*
|
||||
* 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
|
||||
* copy of the source code appearing in this file ("Covered Code") an
|
||||
* irrevocable, perpetual, worldwide license under Intel's copyrights in the
|
||||
* base code distributed originally by Intel ("Original Intel Code") to copy,
|
||||
* make derivatives, distribute, use and display any portion of the Covered
|
||||
* Code in any form, with the right to sublicense such rights; and
|
||||
*
|
||||
* 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
|
||||
* license (with the right to sublicense), under only those claims of Intel
|
||||
* patents that are infringed by the Original Intel Code, to make, use, sell,
|
||||
* offer to sell, and import the Covered Code and derivative works thereof
|
||||
* solely to the minimum extent necessary to exercise the above copyright
|
||||
* license, and in no event shall the patent license extend to any additions
|
||||
* to or modifications of the Original Intel Code. No other license or right
|
||||
* is granted directly or by implication, estoppel or otherwise;
|
||||
*
|
||||
* The above copyright and patent license is granted only if the following
|
||||
* conditions are met:
|
||||
*
|
||||
* 3. Conditions
|
||||
*
|
||||
* 3.1. Redistribution of Source with Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification with rights to further distribute source must include
|
||||
* the above Copyright Notice, the above License, this list of Conditions,
|
||||
* and the following Disclaimer and Export Compliance provision. In addition,
|
||||
* Licensee must cause all Covered Code to which Licensee contributes to
|
||||
* contain a file documenting the changes Licensee made to create that Covered
|
||||
* Code and the date of any change. Licensee must include in that file the
|
||||
* documentation of any changes made by any predecessor Licensee. Licensee
|
||||
* must include a prominent statement that the modification is derived,
|
||||
* directly or indirectly, from Original Intel Code.
|
||||
*
|
||||
* 3.2. Redistribution of Source with no Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification without rights to further distribute source must
|
||||
* include the following Disclaimer and Export Compliance provision in the
|
||||
* documentation and/or other materials provided with distribution. In
|
||||
* addition, Licensee may not authorize further sublicense of source of any
|
||||
* portion of the Covered Code, and must include terms to the effect that the
|
||||
* license from Licensee to its licensee is limited to the intellectual
|
||||
* property embodied in the software Licensee provides to its licensee, and
|
||||
* not to intellectual property embodied in modifications its licensee may
|
||||
* make.
|
||||
*
|
||||
* 3.3. Redistribution of Executable. Redistribution in executable form of any
|
||||
* substantial portion of the Covered Code or modification must reproduce the
|
||||
* above Copyright Notice, and the following Disclaimer and Export Compliance
|
||||
* provision in the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3.4. Intel retains all right, title, and interest in and to the Original
|
||||
* Intel Code.
|
||||
*
|
||||
* 3.5. Neither the name Intel nor any other trademark owned or controlled by
|
||||
* Intel shall be used in advertising or otherwise to promote the sale, use or
|
||||
* other dealings in products derived from or relating to the Covered Code
|
||||
* without prior written authorization from Intel.
|
||||
*
|
||||
* 4. Disclaimer and Export Compliance
|
||||
*
|
||||
* 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
|
||||
* HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
|
||||
* IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
|
||||
* INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
|
||||
* UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
|
||||
* PARTICULAR PURPOSE.
|
||||
*
|
||||
* 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
|
||||
* OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
|
||||
* COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
|
||||
* SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
|
||||
* CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
|
||||
* HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
|
||||
* SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
|
||||
* LIMITED REMEDY.
|
||||
*
|
||||
* 4.3. Licensee shall not export, either directly or indirectly, any of this
|
||||
* software or system incorporating such software without first obtaining any
|
||||
* required license or other approval from the U. S. Department of Commerce or
|
||||
* any other agency or department of the United States Government. In the
|
||||
* event Licensee exports any such software from the United States or
|
||||
* re-exports any such software from a foreign destination, Licensee shall
|
||||
* ensure that the distribution and export/re-export of the software is in
|
||||
* compliance with all laws, regulations, orders, or other restrictions of the
|
||||
* U.S. Export Administration Regulations. Licensee agrees that neither it nor
|
||||
* any of its subsidiaries will export/re-export any technical data, process,
|
||||
* software, or service, directly or indirectly, to any country for which the
|
||||
* United States government or any agency thereof requires an export license,
|
||||
* other governmental approval, or letter of assurance, without first obtaining
|
||||
* such license, approval or letter.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
#define __DSFIELD_C__
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#include "acpi.h"
|
||||
#include "accommon.h"
|
||||
@@ -129,6 +55,18 @@
|
||||
|
||||
/* Local prototypes */
|
||||
|
||||
#ifdef ACPI_ASL_COMPILER
|
||||
#include "acdisasm.h"
|
||||
|
||||
static ACPI_STATUS
|
||||
AcpiDsCreateExternalRegion (
|
||||
ACPI_STATUS LookupStatus,
|
||||
ACPI_PARSE_OBJECT *Op,
|
||||
char *Path,
|
||||
ACPI_WALK_STATE *WalkState,
|
||||
ACPI_NAMESPACE_NODE **Node);
|
||||
#endif
|
||||
|
||||
static ACPI_STATUS
|
||||
AcpiDsGetFieldNames (
|
||||
ACPI_CREATE_FIELD_INFO *Info,
|
||||
@@ -136,6 +74,69 @@ AcpiDsGetFieldNames (
|
||||
ACPI_PARSE_OBJECT *Arg);
|
||||
|
||||
|
||||
#ifdef ACPI_ASL_COMPILER
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiDsCreateExternalRegion (iASL Disassembler only)
|
||||
*
|
||||
* PARAMETERS: LookupStatus - Status from NsLookup operation
|
||||
* Op - Op containing the Field definition and args
|
||||
* Path - Pathname of the region
|
||||
* ` WalkState - Current method state
|
||||
* Node - Where the new region node is returned
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Add region to the external list if NOT_FOUND. Create a new
|
||||
* region node/object.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
static ACPI_STATUS
|
||||
AcpiDsCreateExternalRegion (
|
||||
ACPI_STATUS LookupStatus,
|
||||
ACPI_PARSE_OBJECT *Op,
|
||||
char *Path,
|
||||
ACPI_WALK_STATE *WalkState,
|
||||
ACPI_NAMESPACE_NODE **Node)
|
||||
{
|
||||
ACPI_STATUS Status;
|
||||
ACPI_OPERAND_OBJECT *ObjDesc;
|
||||
|
||||
|
||||
if (LookupStatus != AE_NOT_FOUND)
|
||||
{
|
||||
return (LookupStatus);
|
||||
}
|
||||
|
||||
/*
|
||||
* Table disassembly:
|
||||
* OperationRegion not found. Generate an External for it, and
|
||||
* insert the name into the namespace.
|
||||
*/
|
||||
AcpiDmAddOpToExternalList (Op, Path, ACPI_TYPE_REGION, 0, 0);
|
||||
Status = AcpiNsLookup (WalkState->ScopeInfo, Path, ACPI_TYPE_REGION,
|
||||
ACPI_IMODE_LOAD_PASS1, ACPI_NS_SEARCH_PARENT, WalkState, Node);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return (Status);
|
||||
}
|
||||
|
||||
/* Must create and install a region object for the new node */
|
||||
|
||||
ObjDesc = AcpiUtCreateInternalObject (ACPI_TYPE_REGION);
|
||||
if (!ObjDesc)
|
||||
{
|
||||
return (AE_NO_MEMORY);
|
||||
}
|
||||
|
||||
ObjDesc->Region.Node = *Node;
|
||||
Status = AcpiNsAttachObject (*Node, ObjDesc, ACPI_TYPE_REGION);
|
||||
return (Status);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiDsCreateBufferField
|
||||
@@ -149,8 +150,8 @@ AcpiDsGetFieldNames (
|
||||
* CreateBitFieldOp,
|
||||
* CreateByteFieldOp,
|
||||
* CreateWordFieldOp,
|
||||
* CreateDWordFieldOp,
|
||||
* CreateQWordFieldOp,
|
||||
* CreateDwordFieldOp,
|
||||
* CreateQwordFieldOp,
|
||||
* CreateFieldOp (all of which define a field in a buffer)
|
||||
*
|
||||
******************************************************************************/
|
||||
@@ -302,7 +303,7 @@ Cleanup:
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Process all named fields in a field declaration. Names are
|
||||
* DESCRIPTION: Process all named fields in a field declaration. Names are
|
||||
* entered into the namespace.
|
||||
*
|
||||
******************************************************************************/
|
||||
@@ -315,6 +316,7 @@ AcpiDsGetFieldNames (
|
||||
{
|
||||
ACPI_STATUS Status;
|
||||
UINT64 Position;
|
||||
ACPI_PARSE_OBJECT *Child;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE_PTR (DsGetFieldNames, Info);
|
||||
@@ -329,10 +331,11 @@ AcpiDsGetFieldNames (
|
||||
while (Arg)
|
||||
{
|
||||
/*
|
||||
* Three types of field elements are handled:
|
||||
* 1) Offset - specifies a bit offset
|
||||
* 2) AccessAs - changes the access mode
|
||||
* 3) Name - Enters a new named field into the namespace
|
||||
* Four types of field elements are handled:
|
||||
* 1) Name - Enters a new named field into the namespace
|
||||
* 2) Offset - specifies a bit offset
|
||||
* 3) AccessAs - changes the access mode/attributes
|
||||
* 4) Connection - Associate a resource template with the field
|
||||
*/
|
||||
switch (Arg->Common.AmlOpcode)
|
||||
{
|
||||
@@ -351,24 +354,68 @@ AcpiDsGetFieldNames (
|
||||
Info->FieldBitPosition = (UINT32) Position;
|
||||
break;
|
||||
|
||||
|
||||
case AML_INT_ACCESSFIELD_OP:
|
||||
|
||||
case AML_INT_EXTACCESSFIELD_OP:
|
||||
/*
|
||||
* Get a new AccessType and AccessAttribute -- to be used for all
|
||||
* field units that follow, until field end or another AccessAs
|
||||
* keyword.
|
||||
* Get new AccessType, AccessAttribute, and AccessLength fields
|
||||
* -- to be used for all field units that follow, until the
|
||||
* end-of-field or another AccessAs keyword is encountered.
|
||||
* NOTE. These three bytes are encoded in the integer value
|
||||
* of the parseop for convenience.
|
||||
*
|
||||
* In FieldFlags, preserve the flag bits other than the
|
||||
* ACCESS_TYPE bits
|
||||
* ACCESS_TYPE bits.
|
||||
*/
|
||||
|
||||
/* AccessType (ByteAcc, WordAcc, etc.) */
|
||||
|
||||
Info->FieldFlags = (UINT8)
|
||||
((Info->FieldFlags & ~(AML_FIELD_ACCESS_TYPE_MASK)) |
|
||||
((UINT8) ((UINT32) Arg->Common.Value.Integer >> 8)));
|
||||
((UINT8) ((UINT32) (Arg->Common.Value.Integer & 0x07))));
|
||||
|
||||
Info->Attribute = (UINT8) (Arg->Common.Value.Integer);
|
||||
/* AccessAttribute (AttribQuick, AttribByte, etc.) */
|
||||
|
||||
Info->Attribute = (UINT8) ((Arg->Common.Value.Integer >> 8) & 0xFF);
|
||||
|
||||
/* AccessLength (for serial/buffer protocols) */
|
||||
|
||||
Info->AccessLength = (UINT8) ((Arg->Common.Value.Integer >> 16) & 0xFF);
|
||||
break;
|
||||
|
||||
case AML_INT_CONNECTION_OP:
|
||||
/*
|
||||
* Clear any previous connection. New connection is used for all
|
||||
* fields that follow, similar to AccessAs
|
||||
*/
|
||||
Info->ResourceBuffer = NULL;
|
||||
Info->ConnectionNode = NULL;
|
||||
Info->PinNumberIndex = 0;
|
||||
|
||||
/*
|
||||
* A Connection() is either an actual resource descriptor (buffer)
|
||||
* or a named reference to a resource template
|
||||
*/
|
||||
Child = Arg->Common.Value.Arg;
|
||||
if (Child->Common.AmlOpcode == AML_INT_BYTELIST_OP)
|
||||
{
|
||||
Info->ResourceBuffer = Child->Named.Data;
|
||||
Info->ResourceLength = (UINT16) Child->Named.Value.Integer;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Lookup the Connection() namepath, it should already exist */
|
||||
|
||||
Status = AcpiNsLookup (WalkState->ScopeInfo,
|
||||
Child->Common.Value.Name, ACPI_TYPE_ANY,
|
||||
ACPI_IMODE_EXECUTE, ACPI_NS_DONT_OPEN_SCOPE,
|
||||
WalkState, &Info->ConnectionNode);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
ACPI_ERROR_NAMESPACE (Child->Common.Value.Name, Status);
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case AML_INT_NAMEDFIELD_OP:
|
||||
|
||||
@@ -418,9 +465,9 @@ AcpiDsGetFieldNames (
|
||||
}
|
||||
|
||||
Info->FieldBitPosition += Info->FieldBitLength;
|
||||
Info->PinNumberIndex++; /* Index relative to previous Connection() */
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
|
||||
ACPI_ERROR ((AE_INFO,
|
||||
@@ -466,11 +513,16 @@ AcpiDsCreateField (
|
||||
/* First arg is the name of the parent OpRegion (must already exist) */
|
||||
|
||||
Arg = Op->Common.Value.Arg;
|
||||
|
||||
if (!RegionNode)
|
||||
{
|
||||
Status = AcpiNsLookup (WalkState->ScopeInfo, Arg->Common.Value.Name,
|
||||
ACPI_TYPE_REGION, ACPI_IMODE_EXECUTE,
|
||||
ACPI_NS_SEARCH_PARENT, WalkState, &RegionNode);
|
||||
#ifdef ACPI_ASL_COMPILER
|
||||
Status = AcpiDsCreateExternalRegion (Status, Arg,
|
||||
Arg->Common.Value.Name, WalkState, &RegionNode);
|
||||
#endif
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
ACPI_ERROR_NAMESPACE (Arg->Common.Value.Name, Status);
|
||||
@@ -478,6 +530,8 @@ AcpiDsCreateField (
|
||||
}
|
||||
}
|
||||
|
||||
ACPI_MEMSET (&Info, 0, sizeof (ACPI_CREATE_FIELD_INFO));
|
||||
|
||||
/* Second arg is the field flags */
|
||||
|
||||
Arg = Arg->Common.Next;
|
||||
@@ -490,7 +544,6 @@ AcpiDsCreateField (
|
||||
Info.RegionNode = RegionNode;
|
||||
|
||||
Status = AcpiDsGetFieldNames (&Info, WalkState, Arg->Common.Next);
|
||||
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
@@ -546,21 +599,25 @@ AcpiDsInitFieldObjects (
|
||||
switch (WalkState->Opcode)
|
||||
{
|
||||
case AML_FIELD_OP:
|
||||
|
||||
Arg = AcpiPsGetArg (Op, 2);
|
||||
Type = ACPI_TYPE_LOCAL_REGION_FIELD;
|
||||
break;
|
||||
|
||||
case AML_BANK_FIELD_OP:
|
||||
|
||||
Arg = AcpiPsGetArg (Op, 4);
|
||||
Type = ACPI_TYPE_LOCAL_BANK_FIELD;
|
||||
break;
|
||||
|
||||
case AML_INDEX_FIELD_OP:
|
||||
|
||||
Arg = AcpiPsGetArg (Op, 3);
|
||||
Type = ACPI_TYPE_LOCAL_INDEX_FIELD;
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
return_ACPI_STATUS (AE_BAD_PARAMETER);
|
||||
}
|
||||
|
||||
@@ -586,8 +643,8 @@ AcpiDsInitFieldObjects (
|
||||
while (Arg)
|
||||
{
|
||||
/*
|
||||
* Ignore OFFSET and ACCESSAS terms here; we are only interested in the
|
||||
* field names in order to enter them into the namespace.
|
||||
* Ignore OFFSET/ACCESSAS/CONNECTION terms here; we are only interested
|
||||
* in the field names in order to enter them into the namespace.
|
||||
*/
|
||||
if (Arg->Common.AmlOpcode == AML_INT_NAMEDFIELD_OP)
|
||||
{
|
||||
@@ -655,6 +712,10 @@ AcpiDsCreateBankField (
|
||||
Status = AcpiNsLookup (WalkState->ScopeInfo, Arg->Common.Value.Name,
|
||||
ACPI_TYPE_REGION, ACPI_IMODE_EXECUTE,
|
||||
ACPI_NS_SEARCH_PARENT, WalkState, &RegionNode);
|
||||
#ifdef ACPI_ASL_COMPILER
|
||||
Status = AcpiDsCreateExternalRegion (Status, Arg,
|
||||
Arg->Common.Value.Name, WalkState, &RegionNode);
|
||||
#endif
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
ACPI_ERROR_NAMESPACE (Arg->Common.Value.Name, Status);
|
||||
@@ -769,8 +830,5 @@ AcpiDsCreateIndexField (
|
||||
Info.RegionNode = RegionNode;
|
||||
|
||||
Status = AcpiDsGetFieldNames (&Info, WalkState, Arg->Common.Next);
|
||||
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -4,116 +4,42 @@
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
* 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.
|
||||
*
|
||||
* 2.1. This is your license from Intel Corp. under its intellectual property
|
||||
* rights. You may have additional license terms from the party that provided
|
||||
* you this software, covering your right to use that party's intellectual
|
||||
* property rights.
|
||||
* 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.
|
||||
*
|
||||
* 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
|
||||
* copy of the source code appearing in this file ("Covered Code") an
|
||||
* irrevocable, perpetual, worldwide license under Intel's copyrights in the
|
||||
* base code distributed originally by Intel ("Original Intel Code") to copy,
|
||||
* make derivatives, distribute, use and display any portion of the Covered
|
||||
* Code in any form, with the right to sublicense such rights; and
|
||||
*
|
||||
* 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
|
||||
* license (with the right to sublicense), under only those claims of Intel
|
||||
* patents that are infringed by the Original Intel Code, to make, use, sell,
|
||||
* offer to sell, and import the Covered Code and derivative works thereof
|
||||
* solely to the minimum extent necessary to exercise the above copyright
|
||||
* license, and in no event shall the patent license extend to any additions
|
||||
* to or modifications of the Original Intel Code. No other license or right
|
||||
* is granted directly or by implication, estoppel or otherwise;
|
||||
*
|
||||
* The above copyright and patent license is granted only if the following
|
||||
* conditions are met:
|
||||
*
|
||||
* 3. Conditions
|
||||
*
|
||||
* 3.1. Redistribution of Source with Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification with rights to further distribute source must include
|
||||
* the above Copyright Notice, the above License, this list of Conditions,
|
||||
* and the following Disclaimer and Export Compliance provision. In addition,
|
||||
* Licensee must cause all Covered Code to which Licensee contributes to
|
||||
* contain a file documenting the changes Licensee made to create that Covered
|
||||
* Code and the date of any change. Licensee must include in that file the
|
||||
* documentation of any changes made by any predecessor Licensee. Licensee
|
||||
* must include a prominent statement that the modification is derived,
|
||||
* directly or indirectly, from Original Intel Code.
|
||||
*
|
||||
* 3.2. Redistribution of Source with no Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification without rights to further distribute source must
|
||||
* include the following Disclaimer and Export Compliance provision in the
|
||||
* documentation and/or other materials provided with distribution. In
|
||||
* addition, Licensee may not authorize further sublicense of source of any
|
||||
* portion of the Covered Code, and must include terms to the effect that the
|
||||
* license from Licensee to its licensee is limited to the intellectual
|
||||
* property embodied in the software Licensee provides to its licensee, and
|
||||
* not to intellectual property embodied in modifications its licensee may
|
||||
* make.
|
||||
*
|
||||
* 3.3. Redistribution of Executable. Redistribution in executable form of any
|
||||
* substantial portion of the Covered Code or modification must reproduce the
|
||||
* above Copyright Notice, and the following Disclaimer and Export Compliance
|
||||
* provision in the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3.4. Intel retains all right, title, and interest in and to the Original
|
||||
* Intel Code.
|
||||
*
|
||||
* 3.5. Neither the name Intel nor any other trademark owned or controlled by
|
||||
* Intel shall be used in advertising or otherwise to promote the sale, use or
|
||||
* other dealings in products derived from or relating to the Covered Code
|
||||
* without prior written authorization from Intel.
|
||||
*
|
||||
* 4. Disclaimer and Export Compliance
|
||||
*
|
||||
* 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
|
||||
* HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
|
||||
* IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
|
||||
* INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
|
||||
* UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
|
||||
* PARTICULAR PURPOSE.
|
||||
*
|
||||
* 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
|
||||
* OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
|
||||
* COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
|
||||
* SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
|
||||
* CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
|
||||
* HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
|
||||
* SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
|
||||
* LIMITED REMEDY.
|
||||
*
|
||||
* 4.3. Licensee shall not export, either directly or indirectly, any of this
|
||||
* software or system incorporating such software without first obtaining any
|
||||
* required license or other approval from the U. S. Department of Commerce or
|
||||
* any other agency or department of the United States Government. In the
|
||||
* event Licensee exports any such software from the United States or
|
||||
* re-exports any such software from a foreign destination, Licensee shall
|
||||
* ensure that the distribution and export/re-export of the software is in
|
||||
* compliance with all laws, regulations, orders, or other restrictions of the
|
||||
* U.S. Export Administration Regulations. Licensee agrees that neither it nor
|
||||
* any of its subsidiaries will export/re-export any technical data, process,
|
||||
* software, or service, directly or indirectly, to any country for which the
|
||||
* United States government or any agency thereof requires an export license,
|
||||
* other governmental approval, or letter of assurance, without first obtaining
|
||||
* such license, approval or letter.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
#define __DSINIT_C__
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#include "acpi.h"
|
||||
#include "accommon.h"
|
||||
@@ -124,6 +50,7 @@
|
||||
#define _COMPONENT ACPI_DISPATCHER
|
||||
ACPI_MODULE_NAME ("dsinit")
|
||||
|
||||
|
||||
/* Local prototypes */
|
||||
|
||||
static ACPI_STATUS
|
||||
@@ -145,7 +72,7 @@ AcpiDsInitOneObject (
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Callback from AcpiWalkNamespace. Invoked for every object
|
||||
* DESCRIPTION: Callback from AcpiWalkNamespace. Invoked for every object
|
||||
* within the namespace.
|
||||
*
|
||||
* Currently, the only objects that require initialization are:
|
||||
@@ -163,8 +90,8 @@ AcpiDsInitOneObject (
|
||||
{
|
||||
ACPI_INIT_WALK_INFO *Info = (ACPI_INIT_WALK_INFO *) Context;
|
||||
ACPI_NAMESPACE_NODE *Node = (ACPI_NAMESPACE_NODE *) ObjHandle;
|
||||
ACPI_OBJECT_TYPE Type;
|
||||
ACPI_STATUS Status;
|
||||
ACPI_OPERAND_OBJECT *ObjDesc;
|
||||
|
||||
|
||||
ACPI_FUNCTION_ENTRY ();
|
||||
@@ -183,9 +110,7 @@ AcpiDsInitOneObject (
|
||||
|
||||
/* And even then, we are only interested in a few object types */
|
||||
|
||||
Type = AcpiNsGetType (ObjHandle);
|
||||
|
||||
switch (Type)
|
||||
switch (AcpiNsGetType (ObjHandle))
|
||||
{
|
||||
case ACPI_TYPE_REGION:
|
||||
|
||||
@@ -200,20 +125,55 @@ AcpiDsInitOneObject (
|
||||
Info->OpRegionCount++;
|
||||
break;
|
||||
|
||||
|
||||
case ACPI_TYPE_METHOD:
|
||||
|
||||
/*
|
||||
* Auto-serialization support. We will examine each method that is
|
||||
* NotSerialized to determine if it creates any Named objects. If
|
||||
* it does, it will be marked serialized to prevent problems if
|
||||
* the method is entered by two or more threads and an attempt is
|
||||
* made to create the same named object twice -- which results in
|
||||
* an AE_ALREADY_EXISTS exception and method abort.
|
||||
*/
|
||||
Info->MethodCount++;
|
||||
break;
|
||||
ObjDesc = AcpiNsGetAttachedObject (Node);
|
||||
if (!ObjDesc)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
/* Ignore if already serialized */
|
||||
|
||||
if (ObjDesc->Method.InfoFlags & ACPI_METHOD_SERIALIZED)
|
||||
{
|
||||
Info->SerialMethodCount++;
|
||||
break;
|
||||
}
|
||||
|
||||
if (AcpiGbl_AutoSerializeMethods)
|
||||
{
|
||||
/* Parse/scan method and serialize it if necessary */
|
||||
|
||||
AcpiDsAutoSerializeMethod (Node, ObjDesc);
|
||||
if (ObjDesc->Method.InfoFlags & ACPI_METHOD_SERIALIZED)
|
||||
{
|
||||
/* Method was just converted to Serialized */
|
||||
|
||||
Info->SerialMethodCount++;
|
||||
Info->SerializedMethodCount++;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Info->NonSerialMethodCount++;
|
||||
break;
|
||||
|
||||
case ACPI_TYPE_DEVICE:
|
||||
|
||||
Info->DeviceCount++;
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -261,7 +221,6 @@ AcpiDsInitializeObjects (
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
|
||||
"**** Starting initialization of namespace objects ****\n"));
|
||||
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INIT, "Parsing all Control Methods:"));
|
||||
|
||||
/* Set all init info to zero */
|
||||
|
||||
@@ -297,14 +256,14 @@ AcpiDsInitializeObjects (
|
||||
}
|
||||
|
||||
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INIT,
|
||||
"\nTable [%4.4s](id %4.4X) - %u Objects with %u Devices %u Methods %u Regions\n",
|
||||
Table->Signature, OwnerId, Info.ObjectCount,
|
||||
Info.DeviceCount, Info.MethodCount, Info.OpRegionCount));
|
||||
"Table [%4.4s] (id %4.4X) - %4u Objects with %3u Devices, "
|
||||
"%3u Regions, %3u Methods (%u/%u/%u Serial/Non/Cvt)\n",
|
||||
Table->Signature, OwnerId, Info.ObjectCount, Info.DeviceCount,
|
||||
Info.OpRegionCount, Info.MethodCount, Info.SerialMethodCount,
|
||||
Info.NonSerialMethodCount, Info.SerializedMethodCount));
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
|
||||
"%u Methods, %u Regions\n", Info.MethodCount, Info.OpRegionCount));
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "%u Methods, %u Regions\n",
|
||||
Info.MethodCount, Info.OpRegionCount));
|
||||
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -4,124 +4,51 @@
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
* 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.
|
||||
*
|
||||
* 2.1. This is your license from Intel Corp. under its intellectual property
|
||||
* rights. You may have additional license terms from the party that provided
|
||||
* you this software, covering your right to use that party's intellectual
|
||||
* property rights.
|
||||
* 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.
|
||||
*
|
||||
* 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
|
||||
* copy of the source code appearing in this file ("Covered Code") an
|
||||
* irrevocable, perpetual, worldwide license under Intel's copyrights in the
|
||||
* base code distributed originally by Intel ("Original Intel Code") to copy,
|
||||
* make derivatives, distribute, use and display any portion of the Covered
|
||||
* Code in any form, with the right to sublicense such rights; and
|
||||
*
|
||||
* 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
|
||||
* license (with the right to sublicense), under only those claims of Intel
|
||||
* patents that are infringed by the Original Intel Code, to make, use, sell,
|
||||
* offer to sell, and import the Covered Code and derivative works thereof
|
||||
* solely to the minimum extent necessary to exercise the above copyright
|
||||
* license, and in no event shall the patent license extend to any additions
|
||||
* to or modifications of the Original Intel Code. No other license or right
|
||||
* is granted directly or by implication, estoppel or otherwise;
|
||||
*
|
||||
* The above copyright and patent license is granted only if the following
|
||||
* conditions are met:
|
||||
*
|
||||
* 3. Conditions
|
||||
*
|
||||
* 3.1. Redistribution of Source with Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification with rights to further distribute source must include
|
||||
* the above Copyright Notice, the above License, this list of Conditions,
|
||||
* and the following Disclaimer and Export Compliance provision. In addition,
|
||||
* Licensee must cause all Covered Code to which Licensee contributes to
|
||||
* contain a file documenting the changes Licensee made to create that Covered
|
||||
* Code and the date of any change. Licensee must include in that file the
|
||||
* documentation of any changes made by any predecessor Licensee. Licensee
|
||||
* must include a prominent statement that the modification is derived,
|
||||
* directly or indirectly, from Original Intel Code.
|
||||
*
|
||||
* 3.2. Redistribution of Source with no Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification without rights to further distribute source must
|
||||
* include the following Disclaimer and Export Compliance provision in the
|
||||
* documentation and/or other materials provided with distribution. In
|
||||
* addition, Licensee may not authorize further sublicense of source of any
|
||||
* portion of the Covered Code, and must include terms to the effect that the
|
||||
* license from Licensee to its licensee is limited to the intellectual
|
||||
* property embodied in the software Licensee provides to its licensee, and
|
||||
* not to intellectual property embodied in modifications its licensee may
|
||||
* make.
|
||||
*
|
||||
* 3.3. Redistribution of Executable. Redistribution in executable form of any
|
||||
* substantial portion of the Covered Code or modification must reproduce the
|
||||
* above Copyright Notice, and the following Disclaimer and Export Compliance
|
||||
* provision in the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3.4. Intel retains all right, title, and interest in and to the Original
|
||||
* Intel Code.
|
||||
*
|
||||
* 3.5. Neither the name Intel nor any other trademark owned or controlled by
|
||||
* Intel shall be used in advertising or otherwise to promote the sale, use or
|
||||
* other dealings in products derived from or relating to the Covered Code
|
||||
* without prior written authorization from Intel.
|
||||
*
|
||||
* 4. Disclaimer and Export Compliance
|
||||
*
|
||||
* 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
|
||||
* HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
|
||||
* IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
|
||||
* INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
|
||||
* UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
|
||||
* PARTICULAR PURPOSE.
|
||||
*
|
||||
* 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
|
||||
* OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
|
||||
* COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
|
||||
* SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
|
||||
* CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
|
||||
* HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
|
||||
* SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
|
||||
* LIMITED REMEDY.
|
||||
*
|
||||
* 4.3. Licensee shall not export, either directly or indirectly, any of this
|
||||
* software or system incorporating such software without first obtaining any
|
||||
* required license or other approval from the U. S. Department of Commerce or
|
||||
* any other agency or department of the United States Government. In the
|
||||
* event Licensee exports any such software from the United States or
|
||||
* re-exports any such software from a foreign destination, Licensee shall
|
||||
* ensure that the distribution and export/re-export of the software is in
|
||||
* compliance with all laws, regulations, orders, or other restrictions of the
|
||||
* U.S. Export Administration Regulations. Licensee agrees that neither it nor
|
||||
* any of its subsidiaries will export/re-export any technical data, process,
|
||||
* software, or service, directly or indirectly, to any country for which the
|
||||
* United States government or any agency thereof requires an export license,
|
||||
* other governmental approval, or letter of assurance, without first obtaining
|
||||
* such license, approval or letter.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
#define __DSMETHOD_C__
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#include "acpi.h"
|
||||
#include "accommon.h"
|
||||
#include "amlcode.h"
|
||||
#include "acdispat.h"
|
||||
#include "acinterp.h"
|
||||
#include "acnamesp.h"
|
||||
#include "acdisasm.h"
|
||||
#include "acparser.h"
|
||||
#include "amlcode.h"
|
||||
|
||||
|
||||
#define _COMPONENT ACPI_DISPATCHER
|
||||
@@ -129,11 +56,155 @@
|
||||
|
||||
/* Local prototypes */
|
||||
|
||||
static ACPI_STATUS
|
||||
AcpiDsDetectNamedOpcodes (
|
||||
ACPI_WALK_STATE *WalkState,
|
||||
ACPI_PARSE_OBJECT **OutOp);
|
||||
|
||||
static ACPI_STATUS
|
||||
AcpiDsCreateMethodMutex (
|
||||
ACPI_OPERAND_OBJECT *MethodDesc);
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiDsAutoSerializeMethod
|
||||
*
|
||||
* PARAMETERS: Node - Namespace Node of the method
|
||||
* ObjDesc - Method object attached to node
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Parse a control method AML to scan for control methods that
|
||||
* need serialization due to the creation of named objects.
|
||||
*
|
||||
* NOTE: It is a bit of overkill to mark all such methods serialized, since
|
||||
* there is only a problem if the method actually blocks during execution.
|
||||
* A blocking operation is, for example, a Sleep() operation, or any access
|
||||
* to an operation region. However, it is probably not possible to easily
|
||||
* detect whether a method will block or not, so we simply mark all suspicious
|
||||
* methods as serialized.
|
||||
*
|
||||
* NOTE2: This code is essentially a generic routine for parsing a single
|
||||
* control method.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiDsAutoSerializeMethod (
|
||||
ACPI_NAMESPACE_NODE *Node,
|
||||
ACPI_OPERAND_OBJECT *ObjDesc)
|
||||
{
|
||||
ACPI_STATUS Status;
|
||||
ACPI_PARSE_OBJECT *Op = NULL;
|
||||
ACPI_WALK_STATE *WalkState;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE_PTR (DsAutoSerializeMethod, Node);
|
||||
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_PARSE,
|
||||
"Method auto-serialization parse [%4.4s] %p\n",
|
||||
AcpiUtGetNodeName (Node), Node));
|
||||
|
||||
/* Create/Init a root op for the method parse tree */
|
||||
|
||||
Op = AcpiPsAllocOp (AML_METHOD_OP);
|
||||
if (!Op)
|
||||
{
|
||||
return_ACPI_STATUS (AE_NO_MEMORY);
|
||||
}
|
||||
|
||||
AcpiPsSetName (Op, Node->Name.Integer);
|
||||
Op->Common.Node = Node;
|
||||
|
||||
/* Create and initialize a new walk state */
|
||||
|
||||
WalkState = AcpiDsCreateWalkState (Node->OwnerId, NULL, NULL, NULL);
|
||||
if (!WalkState)
|
||||
{
|
||||
return_ACPI_STATUS (AE_NO_MEMORY);
|
||||
}
|
||||
|
||||
Status = AcpiDsInitAmlWalk (WalkState, Op, Node, ObjDesc->Method.AmlStart,
|
||||
ObjDesc->Method.AmlLength, NULL, 0);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
AcpiDsDeleteWalkState (WalkState);
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
WalkState->DescendingCallback = AcpiDsDetectNamedOpcodes;
|
||||
|
||||
/* Parse the method, scan for creation of named objects */
|
||||
|
||||
Status = AcpiPsParseAml (WalkState);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
AcpiPsDeleteParseTree (Op);
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiDsDetectNamedOpcodes
|
||||
*
|
||||
* PARAMETERS: WalkState - Current state of the parse tree walk
|
||||
* OutOp - Unused, required for parser interface
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Descending callback used during the loading of ACPI tables.
|
||||
* Currently used to detect methods that must be marked serialized
|
||||
* in order to avoid problems with the creation of named objects.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
static ACPI_STATUS
|
||||
AcpiDsDetectNamedOpcodes (
|
||||
ACPI_WALK_STATE *WalkState,
|
||||
ACPI_PARSE_OBJECT **OutOp)
|
||||
{
|
||||
|
||||
ACPI_FUNCTION_NAME (AcpiDsDetectNamedOpcodes);
|
||||
|
||||
|
||||
/* We are only interested in opcodes that create a new name */
|
||||
|
||||
if (!(WalkState->OpInfo->Flags & (AML_NAMED | AML_CREATE | AML_FIELD)))
|
||||
{
|
||||
return (AE_OK);
|
||||
}
|
||||
|
||||
/*
|
||||
* At this point, we know we have a Named object opcode.
|
||||
* Mark the method as serialized. Later code will create a mutex for
|
||||
* this method to enforce serialization.
|
||||
*
|
||||
* Note, ACPI_METHOD_IGNORE_SYNC_LEVEL flag means that we will ignore the
|
||||
* Sync Level mechanism for this method, even though it is now serialized.
|
||||
* Otherwise, there can be conflicts with existing ASL code that actually
|
||||
* uses sync levels.
|
||||
*/
|
||||
WalkState->MethodDesc->Method.SyncLevel = 0;
|
||||
WalkState->MethodDesc->Method.InfoFlags |=
|
||||
(ACPI_METHOD_SERIALIZED | ACPI_METHOD_IGNORE_SYNC_LEVEL);
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
|
||||
"Method serialized [%4.4s] %p - [%s] (%4.4X)\n",
|
||||
WalkState->MethodNode->Name.Ascii, WalkState->MethodNode,
|
||||
WalkState->OpInfo->Name, WalkState->Opcode));
|
||||
|
||||
/* Abort the parse, no need to examine this method any further */
|
||||
|
||||
return (AE_CTRL_TERMINATE);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiDsMethodError
|
||||
@@ -236,6 +307,7 @@ AcpiDsCreateMethodMutex (
|
||||
Status = AcpiOsCreateMutex (&MutexDesc->Mutex.OsMutex);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
AcpiUtDeleteObjectDesc (MutexDesc);
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
@@ -256,7 +328,7 @@ AcpiDsCreateMethodMutex (
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Prepare a method for execution. Parses the method if necessary,
|
||||
* DESCRIPTION: Prepare a method for execution. Parses the method if necessary,
|
||||
* increments the thread count, and waits at the method semaphore
|
||||
* for clearance to execute.
|
||||
*
|
||||
@@ -291,7 +363,7 @@ AcpiDsBeginMethodExecution (
|
||||
/*
|
||||
* If this method is serialized, we need to acquire the method mutex.
|
||||
*/
|
||||
if (ObjDesc->Method.MethodFlags & AML_METHOD_SERIALIZED)
|
||||
if (ObjDesc->Method.InfoFlags & ACPI_METHOD_SERIALIZED)
|
||||
{
|
||||
/*
|
||||
* Create a mutex for the method if it is defined to be Serialized
|
||||
@@ -310,11 +382,16 @@ AcpiDsBeginMethodExecution (
|
||||
/*
|
||||
* The CurrentSyncLevel (per-thread) must be less than or equal to
|
||||
* the sync level of the method. This mechanism provides some
|
||||
* deadlock prevention
|
||||
* deadlock prevention.
|
||||
*
|
||||
* If the method was auto-serialized, we just ignore the sync level
|
||||
* mechanism, because auto-serialization of methods can interfere
|
||||
* with ASL code that actually uses sync levels.
|
||||
*
|
||||
* Top-level method invocation has no walk state at this point
|
||||
*/
|
||||
if (WalkState &&
|
||||
(!(ObjDesc->Method.InfoFlags & ACPI_METHOD_IGNORE_SYNC_LEVEL)) &&
|
||||
(WalkState->Thread->CurrentSyncLevel > ObjDesc->Method.Mutex->Mutex.SyncLevel))
|
||||
{
|
||||
ACPI_ERROR ((AE_INFO,
|
||||
@@ -482,7 +559,8 @@ AcpiDsCallControlMethod (
|
||||
Info = ACPI_ALLOCATE_ZEROED (sizeof (ACPI_EVALUATE_INFO));
|
||||
if (!Info)
|
||||
{
|
||||
return_ACPI_STATUS (AE_NO_MEMORY);
|
||||
Status = AE_NO_MEMORY;
|
||||
goto Cleanup;
|
||||
}
|
||||
|
||||
Info->Parameters = &ThisWalkState->Operands[0];
|
||||
@@ -517,9 +595,9 @@ AcpiDsCallControlMethod (
|
||||
|
||||
/* Invoke an internal method if necessary */
|
||||
|
||||
if (ObjDesc->Method.MethodFlags & AML_METHOD_INTERNAL_ONLY)
|
||||
if (ObjDesc->Method.InfoFlags & ACPI_METHOD_INTERNAL_ONLY)
|
||||
{
|
||||
Status = ObjDesc->Method.Extra.Implementation (NextWalkState);
|
||||
Status = ObjDesc->Method.Dispatch.Implementation (NextWalkState);
|
||||
if (Status == AE_OK)
|
||||
{
|
||||
Status = AE_CTRL_TERMINATE;
|
||||
@@ -553,7 +631,7 @@ Cleanup:
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Restart a method that was preempted by another (nested) method
|
||||
* invocation. Handle the return value (if any) from the callee.
|
||||
* invocation. Handle the return value (if any) from the callee.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
@@ -643,7 +721,7 @@ AcpiDsRestartControlMethod (
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Terminate a control method. Delete everything that the method
|
||||
* DESCRIPTION: Terminate a control method. Delete everything that the method
|
||||
* created, delete all locals and arguments, and delete the parse
|
||||
* tree if requested.
|
||||
*
|
||||
@@ -694,11 +772,14 @@ AcpiDsTerminateControlMethod (
|
||||
|
||||
/*
|
||||
* Delete any namespace objects created anywhere within the
|
||||
* namespace by the execution of this method. Unless this method
|
||||
* is a module-level executable code method, in which case we
|
||||
* want make the objects permanent.
|
||||
* namespace by the execution of this method. Unless:
|
||||
* 1) This method is a module-level executable code method, in which
|
||||
* case we want make the objects permanent.
|
||||
* 2) There are other threads executing the method, in which case we
|
||||
* will wait until the last thread has completed.
|
||||
*/
|
||||
if (!(MethodDesc->Method.Flags & AOPOBJ_MODULE_LEVEL))
|
||||
if (!(MethodDesc->Method.InfoFlags & ACPI_METHOD_MODULE_LEVEL) &&
|
||||
(MethodDesc->Method.ThreadCount == 1))
|
||||
{
|
||||
/* Delete any direct children of (created by) this method */
|
||||
|
||||
@@ -707,10 +788,14 @@ AcpiDsTerminateControlMethod (
|
||||
/*
|
||||
* Delete any objects that were created by this method
|
||||
* elsewhere in the namespace (if any were created).
|
||||
* Use of the ACPI_METHOD_MODIFIED_NAMESPACE optimizes the
|
||||
* deletion such that we don't have to perform an entire
|
||||
* namespace walk for every control method execution.
|
||||
*/
|
||||
if (MethodDesc->Method.Flags & AOPOBJ_MODIFIED_NAMESPACE)
|
||||
if (MethodDesc->Method.InfoFlags & ACPI_METHOD_MODIFIED_NAMESPACE)
|
||||
{
|
||||
AcpiNsDeleteNamespaceByOwner (MethodDesc->Method.OwnerId);
|
||||
MethodDesc->Method.InfoFlags &= ~ACPI_METHOD_MODIFIED_NAMESPACE;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -748,20 +833,40 @@ AcpiDsTerminateControlMethod (
|
||||
* Serialized if it appears that the method is incorrectly written and
|
||||
* does not support multiple thread execution. The best example of this
|
||||
* is if such a method creates namespace objects and blocks. A second
|
||||
* thread will fail with an AE_ALREADY_EXISTS exception
|
||||
* thread will fail with an AE_ALREADY_EXISTS exception.
|
||||
*
|
||||
* This code is here because we must wait until the last thread exits
|
||||
* before creating the synchronization semaphore.
|
||||
* before marking the method as serialized.
|
||||
*/
|
||||
if ((MethodDesc->Method.MethodFlags & AML_METHOD_SERIALIZED) &&
|
||||
(!MethodDesc->Method.Mutex))
|
||||
if (MethodDesc->Method.InfoFlags & ACPI_METHOD_SERIALIZED_PENDING)
|
||||
{
|
||||
(void) AcpiDsCreateMethodMutex (MethodDesc);
|
||||
if (WalkState)
|
||||
{
|
||||
ACPI_INFO ((AE_INFO,
|
||||
"Marking method %4.4s as Serialized because of AE_ALREADY_EXISTS error",
|
||||
WalkState->MethodNode->Name.Ascii));
|
||||
}
|
||||
|
||||
/*
|
||||
* Method tried to create an object twice and was marked as
|
||||
* "pending serialized". The probable cause is that the method
|
||||
* cannot handle reentrancy.
|
||||
*
|
||||
* The method was created as NotSerialized, but it tried to create
|
||||
* a named object and then blocked, causing the second thread
|
||||
* entrance to begin and then fail. Workaround this problem by
|
||||
* marking the method permanently as Serialized when the last
|
||||
* thread exits here.
|
||||
*/
|
||||
MethodDesc->Method.InfoFlags &= ~ACPI_METHOD_SERIALIZED_PENDING;
|
||||
MethodDesc->Method.InfoFlags |=
|
||||
(ACPI_METHOD_SERIALIZED | ACPI_METHOD_IGNORE_SYNC_LEVEL);
|
||||
MethodDesc->Method.SyncLevel = 0;
|
||||
}
|
||||
|
||||
/* No more threads, we can free the OwnerId */
|
||||
|
||||
if (!(MethodDesc->Method.Flags & AOPOBJ_MODULE_LEVEL))
|
||||
if (!(MethodDesc->Method.InfoFlags & ACPI_METHOD_MODULE_LEVEL))
|
||||
{
|
||||
AcpiUtReleaseOwnerId (&MethodDesc->Method.OwnerId);
|
||||
}
|
||||
@@ -769,5 +874,3 @@ AcpiDsTerminateControlMethod (
|
||||
|
||||
return_VOID;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -4,116 +4,42 @@
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
* 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.
|
||||
*
|
||||
* 2.1. This is your license from Intel Corp. under its intellectual property
|
||||
* rights. You may have additional license terms from the party that provided
|
||||
* you this software, covering your right to use that party's intellectual
|
||||
* property rights.
|
||||
* 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.
|
||||
*
|
||||
* 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
|
||||
* copy of the source code appearing in this file ("Covered Code") an
|
||||
* irrevocable, perpetual, worldwide license under Intel's copyrights in the
|
||||
* base code distributed originally by Intel ("Original Intel Code") to copy,
|
||||
* make derivatives, distribute, use and display any portion of the Covered
|
||||
* Code in any form, with the right to sublicense such rights; and
|
||||
*
|
||||
* 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
|
||||
* license (with the right to sublicense), under only those claims of Intel
|
||||
* patents that are infringed by the Original Intel Code, to make, use, sell,
|
||||
* offer to sell, and import the Covered Code and derivative works thereof
|
||||
* solely to the minimum extent necessary to exercise the above copyright
|
||||
* license, and in no event shall the patent license extend to any additions
|
||||
* to or modifications of the Original Intel Code. No other license or right
|
||||
* is granted directly or by implication, estoppel or otherwise;
|
||||
*
|
||||
* The above copyright and patent license is granted only if the following
|
||||
* conditions are met:
|
||||
*
|
||||
* 3. Conditions
|
||||
*
|
||||
* 3.1. Redistribution of Source with Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification with rights to further distribute source must include
|
||||
* the above Copyright Notice, the above License, this list of Conditions,
|
||||
* and the following Disclaimer and Export Compliance provision. In addition,
|
||||
* Licensee must cause all Covered Code to which Licensee contributes to
|
||||
* contain a file documenting the changes Licensee made to create that Covered
|
||||
* Code and the date of any change. Licensee must include in that file the
|
||||
* documentation of any changes made by any predecessor Licensee. Licensee
|
||||
* must include a prominent statement that the modification is derived,
|
||||
* directly or indirectly, from Original Intel Code.
|
||||
*
|
||||
* 3.2. Redistribution of Source with no Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification without rights to further distribute source must
|
||||
* include the following Disclaimer and Export Compliance provision in the
|
||||
* documentation and/or other materials provided with distribution. In
|
||||
* addition, Licensee may not authorize further sublicense of source of any
|
||||
* portion of the Covered Code, and must include terms to the effect that the
|
||||
* license from Licensee to its licensee is limited to the intellectual
|
||||
* property embodied in the software Licensee provides to its licensee, and
|
||||
* not to intellectual property embodied in modifications its licensee may
|
||||
* make.
|
||||
*
|
||||
* 3.3. Redistribution of Executable. Redistribution in executable form of any
|
||||
* substantial portion of the Covered Code or modification must reproduce the
|
||||
* above Copyright Notice, and the following Disclaimer and Export Compliance
|
||||
* provision in the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3.4. Intel retains all right, title, and interest in and to the Original
|
||||
* Intel Code.
|
||||
*
|
||||
* 3.5. Neither the name Intel nor any other trademark owned or controlled by
|
||||
* Intel shall be used in advertising or otherwise to promote the sale, use or
|
||||
* other dealings in products derived from or relating to the Covered Code
|
||||
* without prior written authorization from Intel.
|
||||
*
|
||||
* 4. Disclaimer and Export Compliance
|
||||
*
|
||||
* 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
|
||||
* HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
|
||||
* IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
|
||||
* INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
|
||||
* UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
|
||||
* PARTICULAR PURPOSE.
|
||||
*
|
||||
* 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
|
||||
* OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
|
||||
* COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
|
||||
* SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
|
||||
* CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
|
||||
* HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
|
||||
* SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
|
||||
* LIMITED REMEDY.
|
||||
*
|
||||
* 4.3. Licensee shall not export, either directly or indirectly, any of this
|
||||
* software or system incorporating such software without first obtaining any
|
||||
* required license or other approval from the U. S. Department of Commerce or
|
||||
* any other agency or department of the United States Government. In the
|
||||
* event Licensee exports any such software from the United States or
|
||||
* re-exports any such software from a foreign destination, Licensee shall
|
||||
* ensure that the distribution and export/re-export of the software is in
|
||||
* compliance with all laws, regulations, orders, or other restrictions of the
|
||||
* U.S. Export Administration Regulations. Licensee agrees that neither it nor
|
||||
* any of its subsidiaries will export/re-export any technical data, process,
|
||||
* software, or service, directly or indirectly, to any country for which the
|
||||
* United States government or any agency thereof requires an export license,
|
||||
* other governmental approval, or letter of assurance, without first obtaining
|
||||
* such license, approval or letter.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
#define __DSMTHDAT_C__
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#include "acpi.h"
|
||||
#include "accommon.h"
|
||||
@@ -158,7 +84,7 @@ AcpiDsMethodDataGetType (
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Initialize the data structures that hold the method's arguments
|
||||
* and locals. The data struct is an array of namespace nodes for
|
||||
* and locals. The data struct is an array of namespace nodes for
|
||||
* each - this allows RefOf and DeRefOf to work properly for these
|
||||
* special data types.
|
||||
*
|
||||
@@ -215,7 +141,7 @@ AcpiDsMethodDataInit (
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Delete method locals and arguments. Arguments are only
|
||||
* DESCRIPTION: Delete method locals and arguments. Arguments are only
|
||||
* deleted if this method was called from another method.
|
||||
*
|
||||
******************************************************************************/
|
||||
@@ -274,7 +200,7 @@ AcpiDsMethodDataDeleteAll (
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Initialize arguments for a method. The parameter list is a list
|
||||
* DESCRIPTION: Initialize arguments for a method. The parameter list is a list
|
||||
* of ACPI operand objects, either null terminated or whose length
|
||||
* is defined by MaxParamCount.
|
||||
*
|
||||
@@ -387,6 +313,7 @@ AcpiDsMethodDataGetNode (
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
ACPI_ERROR ((AE_INFO, "Type %u is invalid", Type));
|
||||
return_ACPI_STATUS (AE_TYPE);
|
||||
}
|
||||
@@ -515,7 +442,7 @@ AcpiDsMethodDataGetValue (
|
||||
* This means that either 1) The expected argument was
|
||||
* not passed to the method, or 2) A local variable
|
||||
* was referenced by the method (via the ASL)
|
||||
* before it was initialized. Either case is an error.
|
||||
* before it was initialized. Either case is an error.
|
||||
*/
|
||||
|
||||
/* If slack enabled, init the LocalX/ArgX to an Integer of value zero */
|
||||
@@ -544,7 +471,6 @@ AcpiDsMethodDataGetValue (
|
||||
return_ACPI_STATUS (AE_AML_UNINITIALIZED_ARG);
|
||||
|
||||
case ACPI_REFCLASS_LOCAL:
|
||||
|
||||
/*
|
||||
* No error message for this case, will be trapped again later to
|
||||
* detect and ignore cases of Store(LocalX,LocalX)
|
||||
@@ -580,7 +506,7 @@ AcpiDsMethodDataGetValue (
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Delete the entry at Opcode:Index. Inserts
|
||||
* DESCRIPTION: Delete the entry at Opcode:Index. Inserts
|
||||
* a null into the stack slot after the object is deleted.
|
||||
*
|
||||
******************************************************************************/
|
||||
@@ -645,7 +571,7 @@ AcpiDsMethodDataDeleteValue (
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Store a value in an Arg or Local. The ObjDesc is installed
|
||||
* DESCRIPTION: Store a value in an Arg or Local. The ObjDesc is installed
|
||||
* as the new value for the Arg or Local and the reference count
|
||||
* for ObjDesc is incremented.
|
||||
*
|
||||
@@ -693,7 +619,7 @@ AcpiDsStoreObjectToLocal (
|
||||
|
||||
/*
|
||||
* If the reference count on the object is more than one, we must
|
||||
* take a copy of the object before we store. A reference count
|
||||
* take a copy of the object before we store. A reference count
|
||||
* of exactly 1 means that the object was just created during the
|
||||
* evaluation of an expression, and we can safely use it since it
|
||||
* is not used anywhere else.
|
||||
@@ -840,5 +766,3 @@ AcpiDsMethodDataGetType (
|
||||
return_VALUE (Object->Type);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
@@ -4,116 +4,42 @@
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
* 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.
|
||||
*
|
||||
* 2.1. This is your license from Intel Corp. under its intellectual property
|
||||
* rights. You may have additional license terms from the party that provided
|
||||
* you this software, covering your right to use that party's intellectual
|
||||
* property rights.
|
||||
* 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.
|
||||
*
|
||||
* 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
|
||||
* copy of the source code appearing in this file ("Covered Code") an
|
||||
* irrevocable, perpetual, worldwide license under Intel's copyrights in the
|
||||
* base code distributed originally by Intel ("Original Intel Code") to copy,
|
||||
* make derivatives, distribute, use and display any portion of the Covered
|
||||
* Code in any form, with the right to sublicense such rights; and
|
||||
*
|
||||
* 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
|
||||
* license (with the right to sublicense), under only those claims of Intel
|
||||
* patents that are infringed by the Original Intel Code, to make, use, sell,
|
||||
* offer to sell, and import the Covered Code and derivative works thereof
|
||||
* solely to the minimum extent necessary to exercise the above copyright
|
||||
* license, and in no event shall the patent license extend to any additions
|
||||
* to or modifications of the Original Intel Code. No other license or right
|
||||
* is granted directly or by implication, estoppel or otherwise;
|
||||
*
|
||||
* The above copyright and patent license is granted only if the following
|
||||
* conditions are met:
|
||||
*
|
||||
* 3. Conditions
|
||||
*
|
||||
* 3.1. Redistribution of Source with Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification with rights to further distribute source must include
|
||||
* the above Copyright Notice, the above License, this list of Conditions,
|
||||
* and the following Disclaimer and Export Compliance provision. In addition,
|
||||
* Licensee must cause all Covered Code to which Licensee contributes to
|
||||
* contain a file documenting the changes Licensee made to create that Covered
|
||||
* Code and the date of any change. Licensee must include in that file the
|
||||
* documentation of any changes made by any predecessor Licensee. Licensee
|
||||
* must include a prominent statement that the modification is derived,
|
||||
* directly or indirectly, from Original Intel Code.
|
||||
*
|
||||
* 3.2. Redistribution of Source with no Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification without rights to further distribute source must
|
||||
* include the following Disclaimer and Export Compliance provision in the
|
||||
* documentation and/or other materials provided with distribution. In
|
||||
* addition, Licensee may not authorize further sublicense of source of any
|
||||
* portion of the Covered Code, and must include terms to the effect that the
|
||||
* license from Licensee to its licensee is limited to the intellectual
|
||||
* property embodied in the software Licensee provides to its licensee, and
|
||||
* not to intellectual property embodied in modifications its licensee may
|
||||
* make.
|
||||
*
|
||||
* 3.3. Redistribution of Executable. Redistribution in executable form of any
|
||||
* substantial portion of the Covered Code or modification must reproduce the
|
||||
* above Copyright Notice, and the following Disclaimer and Export Compliance
|
||||
* provision in the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3.4. Intel retains all right, title, and interest in and to the Original
|
||||
* Intel Code.
|
||||
*
|
||||
* 3.5. Neither the name Intel nor any other trademark owned or controlled by
|
||||
* Intel shall be used in advertising or otherwise to promote the sale, use or
|
||||
* other dealings in products derived from or relating to the Covered Code
|
||||
* without prior written authorization from Intel.
|
||||
*
|
||||
* 4. Disclaimer and Export Compliance
|
||||
*
|
||||
* 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
|
||||
* HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
|
||||
* IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
|
||||
* INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
|
||||
* UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
|
||||
* PARTICULAR PURPOSE.
|
||||
*
|
||||
* 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
|
||||
* OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
|
||||
* COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
|
||||
* SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
|
||||
* CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
|
||||
* HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
|
||||
* SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
|
||||
* LIMITED REMEDY.
|
||||
*
|
||||
* 4.3. Licensee shall not export, either directly or indirectly, any of this
|
||||
* software or system incorporating such software without first obtaining any
|
||||
* required license or other approval from the U. S. Department of Commerce or
|
||||
* any other agency or department of the United States Government. In the
|
||||
* event Licensee exports any such software from the United States or
|
||||
* re-exports any such software from a foreign destination, Licensee shall
|
||||
* ensure that the distribution and export/re-export of the software is in
|
||||
* compliance with all laws, regulations, orders, or other restrictions of the
|
||||
* U.S. Export Administration Regulations. Licensee agrees that neither it nor
|
||||
* any of its subsidiaries will export/re-export any technical data, process,
|
||||
* software, or service, directly or indirectly, to any country for which the
|
||||
* United States government or any agency thereof requires an export license,
|
||||
* other governmental approval, or letter of assurance, without first obtaining
|
||||
* such license, approval or letter.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
#define __DSOBJECT_C__
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#include "acpi.h"
|
||||
#include "accommon.h"
|
||||
@@ -368,7 +294,7 @@ AcpiDsBuildInternalBufferObj (
|
||||
|
||||
/*
|
||||
* Second arg is the buffer data (optional) ByteList can be either
|
||||
* individual bytes or a string initializer. In either case, a
|
||||
* individual bytes or a string initializer. In either case, a
|
||||
* ByteList appears in the AML.
|
||||
*/
|
||||
Arg = Op->Common.Value.Arg; /* skip first arg */
|
||||
@@ -613,7 +539,7 @@ AcpiDsBuildInternalPackageObj (
|
||||
}
|
||||
|
||||
ACPI_INFO ((AE_INFO,
|
||||
"Actual Package length (%u) is larger than NumElements field (%u), truncated\n",
|
||||
"Actual Package length (%u) is larger than NumElements field (%u), truncated",
|
||||
i, ElementCount));
|
||||
}
|
||||
else if (i < ElementCount)
|
||||
@@ -662,7 +588,7 @@ AcpiDsCreateNode (
|
||||
|
||||
/*
|
||||
* Because of the execution pass through the non-control-method
|
||||
* parts of the table, we can arrive here twice. Only init
|
||||
* parts of the table, we can arrive here twice. Only init
|
||||
* the named object node the first time through
|
||||
*/
|
||||
if (AcpiNsGetAttachedObject (Node))
|
||||
@@ -715,7 +641,7 @@ AcpiDsCreateNode (
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Initialize a namespace object from a parser Op and its
|
||||
* associated arguments. The namespace object is a more compact
|
||||
* associated arguments. The namespace object is a more compact
|
||||
* representation of the Op and its arguments.
|
||||
*
|
||||
******************************************************************************/
|
||||
@@ -749,7 +675,6 @@ AcpiDsInitObjectFromOp (
|
||||
switch (ObjDesc->Common.Type)
|
||||
{
|
||||
case ACPI_TYPE_BUFFER:
|
||||
|
||||
/*
|
||||
* Defer evaluation of Buffer TermArg operand
|
||||
*/
|
||||
@@ -759,9 +684,7 @@ AcpiDsInitObjectFromOp (
|
||||
ObjDesc->Buffer.AmlLength = Op->Named.Length;
|
||||
break;
|
||||
|
||||
|
||||
case ACPI_TYPE_PACKAGE:
|
||||
|
||||
/*
|
||||
* Defer evaluation of Package TermArg operand
|
||||
*/
|
||||
@@ -771,7 +694,6 @@ AcpiDsInitObjectFromOp (
|
||||
ObjDesc->Package.AmlLength = Op->Named.Length;
|
||||
break;
|
||||
|
||||
|
||||
case ACPI_TYPE_INTEGER:
|
||||
|
||||
switch (OpInfo->Type)
|
||||
@@ -806,7 +728,7 @@ AcpiDsInitObjectFromOp (
|
||||
/* Truncate value if we are executing from a 32-bit ACPI table */
|
||||
|
||||
#ifndef ACPI_NO_METHOD_EXECUTION
|
||||
AcpiExTruncateFor32bitTable (ObjDesc);
|
||||
(void) AcpiExTruncateFor32bitTable (ObjDesc);
|
||||
#endif
|
||||
break;
|
||||
|
||||
@@ -824,17 +746,25 @@ AcpiDsInitObjectFromOp (
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case AML_TYPE_LITERAL:
|
||||
|
||||
ObjDesc->Integer.Value = Op->Common.Value.Integer;
|
||||
|
||||
#ifndef ACPI_NO_METHOD_EXECUTION
|
||||
AcpiExTruncateFor32bitTable (ObjDesc);
|
||||
if (AcpiExTruncateFor32bitTable (ObjDesc))
|
||||
{
|
||||
/* Warn if we found a 64-bit constant in a 32-bit table */
|
||||
|
||||
ACPI_WARNING ((AE_INFO,
|
||||
"Truncated 64-bit constant found in 32-bit table: %8.8X%8.8X => %8.8X",
|
||||
ACPI_FORMAT_UINT64 (Op->Common.Value.Integer),
|
||||
(UINT32) ObjDesc->Integer.Value));
|
||||
}
|
||||
#endif
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
|
||||
ACPI_ERROR ((AE_INFO, "Unknown Integer type 0x%X",
|
||||
OpInfo->Type));
|
||||
Status = AE_AML_OPERAND_TYPE;
|
||||
@@ -842,7 +772,6 @@ AcpiDsInitObjectFromOp (
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case ACPI_TYPE_STRING:
|
||||
|
||||
ObjDesc->String.Pointer = Op->Common.Value.String;
|
||||
@@ -855,11 +784,9 @@ AcpiDsInitObjectFromOp (
|
||||
ObjDesc->Common.Flags |= AOPOBJ_STATIC_POINTER;
|
||||
break;
|
||||
|
||||
|
||||
case ACPI_TYPE_METHOD:
|
||||
break;
|
||||
|
||||
|
||||
case ACPI_TYPE_LOCAL_REFERENCE:
|
||||
|
||||
switch (OpInfo->Type)
|
||||
@@ -879,7 +806,6 @@ AcpiDsInitObjectFromOp (
|
||||
#endif
|
||||
break;
|
||||
|
||||
|
||||
case AML_TYPE_METHOD_ARGUMENT:
|
||||
|
||||
/* Arg ID (0-6) is (AML opcode - base AML_ARG_OP) */
|
||||
@@ -923,7 +849,6 @@ AcpiDsInitObjectFromOp (
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
|
||||
ACPI_ERROR ((AE_INFO, "Unimplemented data type: 0x%X",
|
||||
@@ -935,5 +860,3 @@ AcpiDsInitObjectFromOp (
|
||||
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,120 +1,45 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Module Name: dsopcode - Dispatcher Op Region support and handling of
|
||||
* "control" opcodes
|
||||
* Module Name: dsopcode - Dispatcher support for regions and fields
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
* 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.
|
||||
*
|
||||
* 2.1. This is your license from Intel Corp. under its intellectual property
|
||||
* rights. You may have additional license terms from the party that provided
|
||||
* you this software, covering your right to use that party's intellectual
|
||||
* property rights.
|
||||
* 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.
|
||||
*
|
||||
* 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
|
||||
* copy of the source code appearing in this file ("Covered Code") an
|
||||
* irrevocable, perpetual, worldwide license under Intel's copyrights in the
|
||||
* base code distributed originally by Intel ("Original Intel Code") to copy,
|
||||
* make derivatives, distribute, use and display any portion of the Covered
|
||||
* Code in any form, with the right to sublicense such rights; and
|
||||
*
|
||||
* 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
|
||||
* license (with the right to sublicense), under only those claims of Intel
|
||||
* patents that are infringed by the Original Intel Code, to make, use, sell,
|
||||
* offer to sell, and import the Covered Code and derivative works thereof
|
||||
* solely to the minimum extent necessary to exercise the above copyright
|
||||
* license, and in no event shall the patent license extend to any additions
|
||||
* to or modifications of the Original Intel Code. No other license or right
|
||||
* is granted directly or by implication, estoppel or otherwise;
|
||||
*
|
||||
* The above copyright and patent license is granted only if the following
|
||||
* conditions are met:
|
||||
*
|
||||
* 3. Conditions
|
||||
*
|
||||
* 3.1. Redistribution of Source with Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification with rights to further distribute source must include
|
||||
* the above Copyright Notice, the above License, this list of Conditions,
|
||||
* and the following Disclaimer and Export Compliance provision. In addition,
|
||||
* Licensee must cause all Covered Code to which Licensee contributes to
|
||||
* contain a file documenting the changes Licensee made to create that Covered
|
||||
* Code and the date of any change. Licensee must include in that file the
|
||||
* documentation of any changes made by any predecessor Licensee. Licensee
|
||||
* must include a prominent statement that the modification is derived,
|
||||
* directly or indirectly, from Original Intel Code.
|
||||
*
|
||||
* 3.2. Redistribution of Source with no Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification without rights to further distribute source must
|
||||
* include the following Disclaimer and Export Compliance provision in the
|
||||
* documentation and/or other materials provided with distribution. In
|
||||
* addition, Licensee may not authorize further sublicense of source of any
|
||||
* portion of the Covered Code, and must include terms to the effect that the
|
||||
* license from Licensee to its licensee is limited to the intellectual
|
||||
* property embodied in the software Licensee provides to its licensee, and
|
||||
* not to intellectual property embodied in modifications its licensee may
|
||||
* make.
|
||||
*
|
||||
* 3.3. Redistribution of Executable. Redistribution in executable form of any
|
||||
* substantial portion of the Covered Code or modification must reproduce the
|
||||
* above Copyright Notice, and the following Disclaimer and Export Compliance
|
||||
* provision in the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3.4. Intel retains all right, title, and interest in and to the Original
|
||||
* Intel Code.
|
||||
*
|
||||
* 3.5. Neither the name Intel nor any other trademark owned or controlled by
|
||||
* Intel shall be used in advertising or otherwise to promote the sale, use or
|
||||
* other dealings in products derived from or relating to the Covered Code
|
||||
* without prior written authorization from Intel.
|
||||
*
|
||||
* 4. Disclaimer and Export Compliance
|
||||
*
|
||||
* 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
|
||||
* HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
|
||||
* IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
|
||||
* INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
|
||||
* UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
|
||||
* PARTICULAR PURPOSE.
|
||||
*
|
||||
* 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
|
||||
* OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
|
||||
* COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
|
||||
* SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
|
||||
* CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
|
||||
* HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
|
||||
* SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
|
||||
* LIMITED REMEDY.
|
||||
*
|
||||
* 4.3. Licensee shall not export, either directly or indirectly, any of this
|
||||
* software or system incorporating such software without first obtaining any
|
||||
* required license or other approval from the U. S. Department of Commerce or
|
||||
* any other agency or department of the United States Government. In the
|
||||
* event Licensee exports any such software from the United States or
|
||||
* re-exports any such software from a foreign destination, Licensee shall
|
||||
* ensure that the distribution and export/re-export of the software is in
|
||||
* compliance with all laws, regulations, orders, or other restrictions of the
|
||||
* U.S. Export Administration Regulations. Licensee agrees that neither it nor
|
||||
* any of its subsidiaries will export/re-export any technical data, process,
|
||||
* software, or service, directly or indirectly, to any country for which the
|
||||
* United States government or any agency thereof requires an export license,
|
||||
* other governmental approval, or letter of assurance, without first obtaining
|
||||
* such license, approval or letter.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
#define __DSOPCODE_C__
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#include "acpi.h"
|
||||
#include "accommon.h"
|
||||
@@ -131,13 +56,6 @@
|
||||
|
||||
/* Local prototypes */
|
||||
|
||||
static ACPI_STATUS
|
||||
AcpiDsExecuteArguments (
|
||||
ACPI_NAMESPACE_NODE *Node,
|
||||
ACPI_NAMESPACE_NODE *ScopeNode,
|
||||
UINT32 AmlLength,
|
||||
UINT8 *AmlStart);
|
||||
|
||||
static ACPI_STATUS
|
||||
AcpiDsInitBufferField (
|
||||
UINT16 AmlOpcode,
|
||||
@@ -148,369 +66,6 @@ AcpiDsInitBufferField (
|
||||
ACPI_OPERAND_OBJECT *ResultDesc);
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiDsExecuteArguments
|
||||
*
|
||||
* PARAMETERS: Node - Object NS node
|
||||
* ScopeNode - Parent NS node
|
||||
* AmlLength - Length of executable AML
|
||||
* AmlStart - Pointer to the AML
|
||||
*
|
||||
* RETURN: Status.
|
||||
*
|
||||
* DESCRIPTION: Late (deferred) execution of region or field arguments
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
static ACPI_STATUS
|
||||
AcpiDsExecuteArguments (
|
||||
ACPI_NAMESPACE_NODE *Node,
|
||||
ACPI_NAMESPACE_NODE *ScopeNode,
|
||||
UINT32 AmlLength,
|
||||
UINT8 *AmlStart)
|
||||
{
|
||||
ACPI_STATUS Status;
|
||||
ACPI_PARSE_OBJECT *Op;
|
||||
ACPI_WALK_STATE *WalkState;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE (DsExecuteArguments);
|
||||
|
||||
|
||||
/*
|
||||
* Allocate a new parser op to be the root of the parsed tree
|
||||
*/
|
||||
Op = AcpiPsAllocOp (AML_INT_EVAL_SUBTREE_OP);
|
||||
if (!Op)
|
||||
{
|
||||
return_ACPI_STATUS (AE_NO_MEMORY);
|
||||
}
|
||||
|
||||
/* Save the Node for use in AcpiPsParseAml */
|
||||
|
||||
Op->Common.Node = ScopeNode;
|
||||
|
||||
/* Create and initialize a new parser state */
|
||||
|
||||
WalkState = AcpiDsCreateWalkState (0, NULL, NULL, NULL);
|
||||
if (!WalkState)
|
||||
{
|
||||
Status = AE_NO_MEMORY;
|
||||
goto Cleanup;
|
||||
}
|
||||
|
||||
Status = AcpiDsInitAmlWalk (WalkState, Op, NULL, AmlStart,
|
||||
AmlLength, NULL, ACPI_IMODE_LOAD_PASS1);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
AcpiDsDeleteWalkState (WalkState);
|
||||
goto Cleanup;
|
||||
}
|
||||
|
||||
/* Mark this parse as a deferred opcode */
|
||||
|
||||
WalkState->ParseFlags = ACPI_PARSE_DEFERRED_OP;
|
||||
WalkState->DeferredNode = Node;
|
||||
|
||||
/* Pass1: Parse the entire declaration */
|
||||
|
||||
Status = AcpiPsParseAml (WalkState);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
goto Cleanup;
|
||||
}
|
||||
|
||||
/* Get and init the Op created above */
|
||||
|
||||
Op->Common.Node = Node;
|
||||
AcpiPsDeleteParseTree (Op);
|
||||
|
||||
/* Evaluate the deferred arguments */
|
||||
|
||||
Op = AcpiPsAllocOp (AML_INT_EVAL_SUBTREE_OP);
|
||||
if (!Op)
|
||||
{
|
||||
return_ACPI_STATUS (AE_NO_MEMORY);
|
||||
}
|
||||
|
||||
Op->Common.Node = ScopeNode;
|
||||
|
||||
/* Create and initialize a new parser state */
|
||||
|
||||
WalkState = AcpiDsCreateWalkState (0, NULL, NULL, NULL);
|
||||
if (!WalkState)
|
||||
{
|
||||
Status = AE_NO_MEMORY;
|
||||
goto Cleanup;
|
||||
}
|
||||
|
||||
/* Execute the opcode and arguments */
|
||||
|
||||
Status = AcpiDsInitAmlWalk (WalkState, Op, NULL, AmlStart,
|
||||
AmlLength, NULL, ACPI_IMODE_EXECUTE);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
AcpiDsDeleteWalkState (WalkState);
|
||||
goto Cleanup;
|
||||
}
|
||||
|
||||
/* Mark this execution as a deferred opcode */
|
||||
|
||||
WalkState->DeferredNode = Node;
|
||||
Status = AcpiPsParseAml (WalkState);
|
||||
|
||||
Cleanup:
|
||||
AcpiPsDeleteParseTree (Op);
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiDsGetBufferFieldArguments
|
||||
*
|
||||
* PARAMETERS: ObjDesc - A valid BufferField object
|
||||
*
|
||||
* RETURN: Status.
|
||||
*
|
||||
* DESCRIPTION: Get BufferField Buffer and Index. This implements the late
|
||||
* evaluation of these field attributes.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiDsGetBufferFieldArguments (
|
||||
ACPI_OPERAND_OBJECT *ObjDesc)
|
||||
{
|
||||
ACPI_OPERAND_OBJECT *ExtraDesc;
|
||||
ACPI_NAMESPACE_NODE *Node;
|
||||
ACPI_STATUS Status;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE_PTR (DsGetBufferFieldArguments, ObjDesc);
|
||||
|
||||
|
||||
if (ObjDesc->Common.Flags & AOPOBJ_DATA_VALID)
|
||||
{
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
}
|
||||
|
||||
/* Get the AML pointer (method object) and BufferField node */
|
||||
|
||||
ExtraDesc = AcpiNsGetSecondaryObject (ObjDesc);
|
||||
Node = ObjDesc->BufferField.Node;
|
||||
|
||||
ACPI_DEBUG_EXEC(AcpiUtDisplayInitPathname (ACPI_TYPE_BUFFER_FIELD, Node, NULL));
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "[%4.4s] BufferField Arg Init\n",
|
||||
AcpiUtGetNodeName (Node)));
|
||||
|
||||
/* Execute the AML code for the TermArg arguments */
|
||||
|
||||
Status = AcpiDsExecuteArguments (Node, Node->Parent,
|
||||
ExtraDesc->Extra.AmlLength, ExtraDesc->Extra.AmlStart);
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiDsGetBankFieldArguments
|
||||
*
|
||||
* PARAMETERS: ObjDesc - A valid BankField object
|
||||
*
|
||||
* RETURN: Status.
|
||||
*
|
||||
* DESCRIPTION: Get BankField BankValue. This implements the late
|
||||
* evaluation of these field attributes.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiDsGetBankFieldArguments (
|
||||
ACPI_OPERAND_OBJECT *ObjDesc)
|
||||
{
|
||||
ACPI_OPERAND_OBJECT *ExtraDesc;
|
||||
ACPI_NAMESPACE_NODE *Node;
|
||||
ACPI_STATUS Status;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE_PTR (DsGetBankFieldArguments, ObjDesc);
|
||||
|
||||
|
||||
if (ObjDesc->Common.Flags & AOPOBJ_DATA_VALID)
|
||||
{
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
}
|
||||
|
||||
/* Get the AML pointer (method object) and BankField node */
|
||||
|
||||
ExtraDesc = AcpiNsGetSecondaryObject (ObjDesc);
|
||||
Node = ObjDesc->BankField.Node;
|
||||
|
||||
ACPI_DEBUG_EXEC(AcpiUtDisplayInitPathname (ACPI_TYPE_LOCAL_BANK_FIELD, Node, NULL));
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "[%4.4s] BankField Arg Init\n",
|
||||
AcpiUtGetNodeName (Node)));
|
||||
|
||||
/* Execute the AML code for the TermArg arguments */
|
||||
|
||||
Status = AcpiDsExecuteArguments (Node, Node->Parent,
|
||||
ExtraDesc->Extra.AmlLength, ExtraDesc->Extra.AmlStart);
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiDsGetBufferArguments
|
||||
*
|
||||
* PARAMETERS: ObjDesc - A valid Buffer object
|
||||
*
|
||||
* RETURN: Status.
|
||||
*
|
||||
* DESCRIPTION: Get Buffer length and initializer byte list. This implements
|
||||
* the late evaluation of these attributes.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiDsGetBufferArguments (
|
||||
ACPI_OPERAND_OBJECT *ObjDesc)
|
||||
{
|
||||
ACPI_NAMESPACE_NODE *Node;
|
||||
ACPI_STATUS Status;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE_PTR (DsGetBufferArguments, ObjDesc);
|
||||
|
||||
|
||||
if (ObjDesc->Common.Flags & AOPOBJ_DATA_VALID)
|
||||
{
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
}
|
||||
|
||||
/* Get the Buffer node */
|
||||
|
||||
Node = ObjDesc->Buffer.Node;
|
||||
if (!Node)
|
||||
{
|
||||
ACPI_ERROR ((AE_INFO,
|
||||
"No pointer back to namespace node in buffer object %p", ObjDesc));
|
||||
return_ACPI_STATUS (AE_AML_INTERNAL);
|
||||
}
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Buffer Arg Init\n"));
|
||||
|
||||
/* Execute the AML code for the TermArg arguments */
|
||||
|
||||
Status = AcpiDsExecuteArguments (Node, Node,
|
||||
ObjDesc->Buffer.AmlLength, ObjDesc->Buffer.AmlStart);
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiDsGetPackageArguments
|
||||
*
|
||||
* PARAMETERS: ObjDesc - A valid Package object
|
||||
*
|
||||
* RETURN: Status.
|
||||
*
|
||||
* DESCRIPTION: Get Package length and initializer byte list. This implements
|
||||
* the late evaluation of these attributes.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiDsGetPackageArguments (
|
||||
ACPI_OPERAND_OBJECT *ObjDesc)
|
||||
{
|
||||
ACPI_NAMESPACE_NODE *Node;
|
||||
ACPI_STATUS Status;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE_PTR (DsGetPackageArguments, ObjDesc);
|
||||
|
||||
|
||||
if (ObjDesc->Common.Flags & AOPOBJ_DATA_VALID)
|
||||
{
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
}
|
||||
|
||||
/* Get the Package node */
|
||||
|
||||
Node = ObjDesc->Package.Node;
|
||||
if (!Node)
|
||||
{
|
||||
ACPI_ERROR ((AE_INFO,
|
||||
"No pointer back to namespace node in package %p", ObjDesc));
|
||||
return_ACPI_STATUS (AE_AML_INTERNAL);
|
||||
}
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Package Arg Init\n"));
|
||||
|
||||
/* Execute the AML code for the TermArg arguments */
|
||||
|
||||
Status = AcpiDsExecuteArguments (Node, Node,
|
||||
ObjDesc->Package.AmlLength, ObjDesc->Package.AmlStart);
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiDsGetRegionArguments
|
||||
*
|
||||
* PARAMETERS: ObjDesc - A valid region object
|
||||
*
|
||||
* RETURN: Status.
|
||||
*
|
||||
* DESCRIPTION: Get region address and length. This implements the late
|
||||
* evaluation of these region attributes.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiDsGetRegionArguments (
|
||||
ACPI_OPERAND_OBJECT *ObjDesc)
|
||||
{
|
||||
ACPI_NAMESPACE_NODE *Node;
|
||||
ACPI_STATUS Status;
|
||||
ACPI_OPERAND_OBJECT *ExtraDesc;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE_PTR (DsGetRegionArguments, ObjDesc);
|
||||
|
||||
|
||||
if (ObjDesc->Region.Flags & AOPOBJ_DATA_VALID)
|
||||
{
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
}
|
||||
|
||||
ExtraDesc = AcpiNsGetSecondaryObject (ObjDesc);
|
||||
if (!ExtraDesc)
|
||||
{
|
||||
return_ACPI_STATUS (AE_NOT_EXIST);
|
||||
}
|
||||
|
||||
/* Get the Region node */
|
||||
|
||||
Node = ObjDesc->Region.Node;
|
||||
|
||||
ACPI_DEBUG_EXEC (AcpiUtDisplayInitPathname (ACPI_TYPE_REGION, Node, NULL));
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "[%4.4s] OpRegion Arg Init at AML %p\n",
|
||||
AcpiUtGetNodeName (Node), ExtraDesc->Extra.AmlStart));
|
||||
|
||||
/* Execute the argument AML */
|
||||
|
||||
Status = AcpiDsExecuteArguments (Node, Node->Parent,
|
||||
ExtraDesc->Extra.AmlLength, ExtraDesc->Extra.AmlStart);
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiDsInitializeRegion
|
||||
@@ -942,8 +497,9 @@ AcpiDsEvalRegionOperands (
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Get region address and length
|
||||
* Called from AcpiDsExecEndOp during DataTableRegion parse tree walk
|
||||
* DESCRIPTION: Get region address and length.
|
||||
* Called from AcpiDsExecEndOp during DataTableRegion parse
|
||||
* tree walk.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
@@ -965,18 +521,18 @@ AcpiDsEvalTableRegionOperands (
|
||||
|
||||
|
||||
/*
|
||||
* This is where we evaluate the SignatureString and OemIDString
|
||||
* and OemTableIDString of the DataTableRegion declaration
|
||||
* This is where we evaluate the Signature string, OemId string,
|
||||
* and OemTableId string of the Data Table Region declaration
|
||||
*/
|
||||
Node = Op->Common.Node;
|
||||
|
||||
/* NextOp points to SignatureString op */
|
||||
/* NextOp points to Signature string op */
|
||||
|
||||
NextOp = Op->Common.Value.Arg;
|
||||
|
||||
/*
|
||||
* Evaluate/create the SignatureString and OemIDString
|
||||
* and OemTableIDString operands
|
||||
* Evaluate/create the Signature string, OemId string,
|
||||
* and OemTableId string operands
|
||||
*/
|
||||
Status = AcpiDsCreateOperands (WalkState, NextOp);
|
||||
if (ACPI_FAILURE (Status))
|
||||
@@ -985,8 +541,8 @@ AcpiDsEvalTableRegionOperands (
|
||||
}
|
||||
|
||||
/*
|
||||
* Resolve the SignatureString and OemIDString
|
||||
* and OemTableIDString operands
|
||||
* Resolve the Signature string, OemId string,
|
||||
* and OemTableId string operands
|
||||
*/
|
||||
Status = AcpiExResolveOperands (Op->Common.AmlOpcode,
|
||||
ACPI_WALK_OPERANDS, WalkState);
|
||||
@@ -1122,6 +678,7 @@ AcpiDsEvalDataObjectOperands (
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
return_ACPI_STATUS (AE_AML_BAD_OPCODE);
|
||||
}
|
||||
|
||||
@@ -1248,372 +805,3 @@ AcpiDsEvalBankFieldOperands (
|
||||
AcpiUtRemoveReference (OperandDesc);
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiDsExecBeginControlOp
|
||||
*
|
||||
* PARAMETERS: WalkList - The list that owns the walk stack
|
||||
* Op - The control Op
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Handles all control ops encountered during control method
|
||||
* execution.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiDsExecBeginControlOp (
|
||||
ACPI_WALK_STATE *WalkState,
|
||||
ACPI_PARSE_OBJECT *Op)
|
||||
{
|
||||
ACPI_STATUS Status = AE_OK;
|
||||
ACPI_GENERIC_STATE *ControlState;
|
||||
|
||||
|
||||
ACPI_FUNCTION_NAME (DsExecBeginControlOp);
|
||||
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Op=%p Opcode=%2.2X State=%p\n", Op,
|
||||
Op->Common.AmlOpcode, WalkState));
|
||||
|
||||
switch (Op->Common.AmlOpcode)
|
||||
{
|
||||
case AML_WHILE_OP:
|
||||
|
||||
/*
|
||||
* If this is an additional iteration of a while loop, continue.
|
||||
* There is no need to allocate a new control state.
|
||||
*/
|
||||
if (WalkState->ControlState)
|
||||
{
|
||||
if (WalkState->ControlState->Control.AmlPredicateStart ==
|
||||
(WalkState->ParserState.Aml - 1))
|
||||
{
|
||||
/* Reset the state to start-of-loop */
|
||||
|
||||
WalkState->ControlState->Common.State = ACPI_CONTROL_CONDITIONAL_EXECUTING;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/*lint -fallthrough */
|
||||
|
||||
case AML_IF_OP:
|
||||
|
||||
/*
|
||||
* IF/WHILE: Create a new control state to manage these
|
||||
* constructs. We need to manage these as a stack, in order
|
||||
* to handle nesting.
|
||||
*/
|
||||
ControlState = AcpiUtCreateControlState ();
|
||||
if (!ControlState)
|
||||
{
|
||||
Status = AE_NO_MEMORY;
|
||||
break;
|
||||
}
|
||||
/*
|
||||
* Save a pointer to the predicate for multiple executions
|
||||
* of a loop
|
||||
*/
|
||||
ControlState->Control.AmlPredicateStart = WalkState->ParserState.Aml - 1;
|
||||
ControlState->Control.PackageEnd = WalkState->ParserState.PkgEnd;
|
||||
ControlState->Control.Opcode = Op->Common.AmlOpcode;
|
||||
|
||||
|
||||
/* Push the control state on this walk's control stack */
|
||||
|
||||
AcpiUtPushGenericState (&WalkState->ControlState, ControlState);
|
||||
break;
|
||||
|
||||
case AML_ELSE_OP:
|
||||
|
||||
/* Predicate is in the state object */
|
||||
/* If predicate is true, the IF was executed, ignore ELSE part */
|
||||
|
||||
if (WalkState->LastPredicate)
|
||||
{
|
||||
Status = AE_CTRL_TRUE;
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case AML_RETURN_OP:
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return (Status);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiDsExecEndControlOp
|
||||
*
|
||||
* PARAMETERS: WalkList - The list that owns the walk stack
|
||||
* Op - The control Op
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Handles all control ops encountered during control method
|
||||
* execution.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiDsExecEndControlOp (
|
||||
ACPI_WALK_STATE *WalkState,
|
||||
ACPI_PARSE_OBJECT *Op)
|
||||
{
|
||||
ACPI_STATUS Status = AE_OK;
|
||||
ACPI_GENERIC_STATE *ControlState;
|
||||
|
||||
|
||||
ACPI_FUNCTION_NAME (DsExecEndControlOp);
|
||||
|
||||
|
||||
switch (Op->Common.AmlOpcode)
|
||||
{
|
||||
case AML_IF_OP:
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "[IF_OP] Op=%p\n", Op));
|
||||
|
||||
/*
|
||||
* Save the result of the predicate in case there is an
|
||||
* ELSE to come
|
||||
*/
|
||||
WalkState->LastPredicate =
|
||||
(BOOLEAN) WalkState->ControlState->Common.Value;
|
||||
|
||||
/*
|
||||
* Pop the control state that was created at the start
|
||||
* of the IF and free it
|
||||
*/
|
||||
ControlState = AcpiUtPopGenericState (&WalkState->ControlState);
|
||||
AcpiUtDeleteGenericState (ControlState);
|
||||
break;
|
||||
|
||||
|
||||
case AML_ELSE_OP:
|
||||
|
||||
break;
|
||||
|
||||
|
||||
case AML_WHILE_OP:
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "[WHILE_OP] Op=%p\n", Op));
|
||||
|
||||
ControlState = WalkState->ControlState;
|
||||
if (ControlState->Common.Value)
|
||||
{
|
||||
/* Predicate was true, the body of the loop was just executed */
|
||||
|
||||
/*
|
||||
* This loop counter mechanism allows the interpreter to escape
|
||||
* possibly infinite loops. This can occur in poorly written AML
|
||||
* when the hardware does not respond within a while loop and the
|
||||
* loop does not implement a timeout.
|
||||
*/
|
||||
ControlState->Control.LoopCount++;
|
||||
if (ControlState->Control.LoopCount > ACPI_MAX_LOOP_ITERATIONS)
|
||||
{
|
||||
Status = AE_AML_INFINITE_LOOP;
|
||||
break;
|
||||
}
|
||||
|
||||
/*
|
||||
* Go back and evaluate the predicate and maybe execute the loop
|
||||
* another time
|
||||
*/
|
||||
Status = AE_CTRL_PENDING;
|
||||
WalkState->AmlLastWhile = ControlState->Control.AmlPredicateStart;
|
||||
break;
|
||||
}
|
||||
|
||||
/* Predicate was false, terminate this while loop */
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
|
||||
"[WHILE_OP] termination! Op=%p\n",Op));
|
||||
|
||||
/* Pop this control state and free it */
|
||||
|
||||
ControlState = AcpiUtPopGenericState (&WalkState->ControlState);
|
||||
AcpiUtDeleteGenericState (ControlState);
|
||||
break;
|
||||
|
||||
|
||||
case AML_RETURN_OP:
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
|
||||
"[RETURN_OP] Op=%p Arg=%p\n",Op, Op->Common.Value.Arg));
|
||||
|
||||
/*
|
||||
* One optional operand -- the return value
|
||||
* It can be either an immediate operand or a result that
|
||||
* has been bubbled up the tree
|
||||
*/
|
||||
if (Op->Common.Value.Arg)
|
||||
{
|
||||
/* Since we have a real Return(), delete any implicit return */
|
||||
|
||||
AcpiDsClearImplicitReturn (WalkState);
|
||||
|
||||
/* Return statement has an immediate operand */
|
||||
|
||||
Status = AcpiDsCreateOperands (WalkState, Op->Common.Value.Arg);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return (Status);
|
||||
}
|
||||
|
||||
/*
|
||||
* If value being returned is a Reference (such as
|
||||
* an arg or local), resolve it now because it may
|
||||
* cease to exist at the end of the method.
|
||||
*/
|
||||
Status = AcpiExResolveToValue (&WalkState->Operands [0], WalkState);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return (Status);
|
||||
}
|
||||
|
||||
/*
|
||||
* Get the return value and save as the last result
|
||||
* value. This is the only place where WalkState->ReturnDesc
|
||||
* is set to anything other than zero!
|
||||
*/
|
||||
WalkState->ReturnDesc = WalkState->Operands[0];
|
||||
}
|
||||
else if (WalkState->ResultCount)
|
||||
{
|
||||
/* Since we have a real Return(), delete any implicit return */
|
||||
|
||||
AcpiDsClearImplicitReturn (WalkState);
|
||||
|
||||
/*
|
||||
* The return value has come from a previous calculation.
|
||||
*
|
||||
* If value being returned is a Reference (such as
|
||||
* an arg or local), resolve it now because it may
|
||||
* cease to exist at the end of the method.
|
||||
*
|
||||
* Allow references created by the Index operator to return unchanged.
|
||||
*/
|
||||
if ((ACPI_GET_DESCRIPTOR_TYPE (WalkState->Results->Results.ObjDesc[0]) == ACPI_DESC_TYPE_OPERAND) &&
|
||||
((WalkState->Results->Results.ObjDesc [0])->Common.Type == ACPI_TYPE_LOCAL_REFERENCE) &&
|
||||
((WalkState->Results->Results.ObjDesc [0])->Reference.Class != ACPI_REFCLASS_INDEX))
|
||||
{
|
||||
Status = AcpiExResolveToValue (&WalkState->Results->Results.ObjDesc [0], WalkState);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return (Status);
|
||||
}
|
||||
}
|
||||
|
||||
WalkState->ReturnDesc = WalkState->Results->Results.ObjDesc [0];
|
||||
}
|
||||
else
|
||||
{
|
||||
/* No return operand */
|
||||
|
||||
if (WalkState->NumOperands)
|
||||
{
|
||||
AcpiUtRemoveReference (WalkState->Operands [0]);
|
||||
}
|
||||
|
||||
WalkState->Operands [0] = NULL;
|
||||
WalkState->NumOperands = 0;
|
||||
WalkState->ReturnDesc = NULL;
|
||||
}
|
||||
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
|
||||
"Completed RETURN_OP State=%p, RetVal=%p\n",
|
||||
WalkState, WalkState->ReturnDesc));
|
||||
|
||||
/* End the control method execution right now */
|
||||
|
||||
Status = AE_CTRL_TERMINATE;
|
||||
break;
|
||||
|
||||
|
||||
case AML_NOOP_OP:
|
||||
|
||||
/* Just do nothing! */
|
||||
break;
|
||||
|
||||
|
||||
case AML_BREAK_POINT_OP:
|
||||
|
||||
/*
|
||||
* Set the single-step flag. This will cause the debugger (if present)
|
||||
* to break to the console within the AML debugger at the start of the
|
||||
* next AML instruction.
|
||||
*/
|
||||
ACPI_DEBUGGER_EXEC (
|
||||
AcpiGbl_CmSingleStep = TRUE);
|
||||
ACPI_DEBUGGER_EXEC (
|
||||
AcpiOsPrintf ("**break** Executed AML BreakPoint opcode\n"));
|
||||
|
||||
/* Call to the OSL in case OS wants a piece of the action */
|
||||
|
||||
Status = AcpiOsSignal (ACPI_SIGNAL_BREAKPOINT,
|
||||
"Executed AML Breakpoint opcode");
|
||||
break;
|
||||
|
||||
|
||||
case AML_BREAK_OP:
|
||||
case AML_CONTINUE_OP: /* ACPI 2.0 */
|
||||
|
||||
|
||||
/* Pop and delete control states until we find a while */
|
||||
|
||||
while (WalkState->ControlState &&
|
||||
(WalkState->ControlState->Control.Opcode != AML_WHILE_OP))
|
||||
{
|
||||
ControlState = AcpiUtPopGenericState (&WalkState->ControlState);
|
||||
AcpiUtDeleteGenericState (ControlState);
|
||||
}
|
||||
|
||||
/* No while found? */
|
||||
|
||||
if (!WalkState->ControlState)
|
||||
{
|
||||
return (AE_AML_NO_WHILE);
|
||||
}
|
||||
|
||||
/* Was: WalkState->AmlLastWhile = WalkState->ControlState->Control.AmlPredicateStart; */
|
||||
|
||||
WalkState->AmlLastWhile = WalkState->ControlState->Control.PackageEnd;
|
||||
|
||||
/* Return status depending on opcode */
|
||||
|
||||
if (Op->Common.AmlOpcode == AML_BREAK_OP)
|
||||
{
|
||||
Status = AE_CTRL_BREAK;
|
||||
}
|
||||
else
|
||||
{
|
||||
Status = AE_CTRL_CONTINUE;
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
|
||||
ACPI_ERROR ((AE_INFO, "Unknown control opcode=0x%X Op=%p",
|
||||
Op->Common.AmlOpcode, Op));
|
||||
|
||||
Status = AE_AML_BAD_OPCODE;
|
||||
break;
|
||||
}
|
||||
|
||||
return (Status);
|
||||
}
|
||||
|
||||
|
||||
@@ -4,116 +4,42 @@
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
* 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.
|
||||
*
|
||||
* 2.1. This is your license from Intel Corp. under its intellectual property
|
||||
* rights. You may have additional license terms from the party that provided
|
||||
* you this software, covering your right to use that party's intellectual
|
||||
* property rights.
|
||||
* 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.
|
||||
*
|
||||
* 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
|
||||
* copy of the source code appearing in this file ("Covered Code") an
|
||||
* irrevocable, perpetual, worldwide license under Intel's copyrights in the
|
||||
* base code distributed originally by Intel ("Original Intel Code") to copy,
|
||||
* make derivatives, distribute, use and display any portion of the Covered
|
||||
* Code in any form, with the right to sublicense such rights; and
|
||||
*
|
||||
* 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
|
||||
* license (with the right to sublicense), under only those claims of Intel
|
||||
* patents that are infringed by the Original Intel Code, to make, use, sell,
|
||||
* offer to sell, and import the Covered Code and derivative works thereof
|
||||
* solely to the minimum extent necessary to exercise the above copyright
|
||||
* license, and in no event shall the patent license extend to any additions
|
||||
* to or modifications of the Original Intel Code. No other license or right
|
||||
* is granted directly or by implication, estoppel or otherwise;
|
||||
*
|
||||
* The above copyright and patent license is granted only if the following
|
||||
* conditions are met:
|
||||
*
|
||||
* 3. Conditions
|
||||
*
|
||||
* 3.1. Redistribution of Source with Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification with rights to further distribute source must include
|
||||
* the above Copyright Notice, the above License, this list of Conditions,
|
||||
* and the following Disclaimer and Export Compliance provision. In addition,
|
||||
* Licensee must cause all Covered Code to which Licensee contributes to
|
||||
* contain a file documenting the changes Licensee made to create that Covered
|
||||
* Code and the date of any change. Licensee must include in that file the
|
||||
* documentation of any changes made by any predecessor Licensee. Licensee
|
||||
* must include a prominent statement that the modification is derived,
|
||||
* directly or indirectly, from Original Intel Code.
|
||||
*
|
||||
* 3.2. Redistribution of Source with no Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification without rights to further distribute source must
|
||||
* include the following Disclaimer and Export Compliance provision in the
|
||||
* documentation and/or other materials provided with distribution. In
|
||||
* addition, Licensee may not authorize further sublicense of source of any
|
||||
* portion of the Covered Code, and must include terms to the effect that the
|
||||
* license from Licensee to its licensee is limited to the intellectual
|
||||
* property embodied in the software Licensee provides to its licensee, and
|
||||
* not to intellectual property embodied in modifications its licensee may
|
||||
* make.
|
||||
*
|
||||
* 3.3. Redistribution of Executable. Redistribution in executable form of any
|
||||
* substantial portion of the Covered Code or modification must reproduce the
|
||||
* above Copyright Notice, and the following Disclaimer and Export Compliance
|
||||
* provision in the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3.4. Intel retains all right, title, and interest in and to the Original
|
||||
* Intel Code.
|
||||
*
|
||||
* 3.5. Neither the name Intel nor any other trademark owned or controlled by
|
||||
* Intel shall be used in advertising or otherwise to promote the sale, use or
|
||||
* other dealings in products derived from or relating to the Covered Code
|
||||
* without prior written authorization from Intel.
|
||||
*
|
||||
* 4. Disclaimer and Export Compliance
|
||||
*
|
||||
* 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
|
||||
* HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
|
||||
* IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
|
||||
* INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
|
||||
* UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
|
||||
* PARTICULAR PURPOSE.
|
||||
*
|
||||
* 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
|
||||
* OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
|
||||
* COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
|
||||
* SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
|
||||
* CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
|
||||
* HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
|
||||
* SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
|
||||
* LIMITED REMEDY.
|
||||
*
|
||||
* 4.3. Licensee shall not export, either directly or indirectly, any of this
|
||||
* software or system incorporating such software without first obtaining any
|
||||
* required license or other approval from the U. S. Department of Commerce or
|
||||
* any other agency or department of the United States Government. In the
|
||||
* event Licensee exports any such software from the United States or
|
||||
* re-exports any such software from a foreign destination, Licensee shall
|
||||
* ensure that the distribution and export/re-export of the software is in
|
||||
* compliance with all laws, regulations, orders, or other restrictions of the
|
||||
* U.S. Export Administration Regulations. Licensee agrees that neither it nor
|
||||
* any of its subsidiaries will export/re-export any technical data, process,
|
||||
* software, or service, directly or indirectly, to any country for which the
|
||||
* United States government or any agency thereof requires an export license,
|
||||
* other governmental approval, or letter of assurance, without first obtaining
|
||||
* such license, approval or letter.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
#define __DSUTILS_C__
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#include "acpi.h"
|
||||
#include "accommon.h"
|
||||
@@ -136,7 +62,7 @@
|
||||
*
|
||||
* RETURN: None.
|
||||
*
|
||||
* DESCRIPTION: Clear and remove a reference on an implicit return value. Used
|
||||
* DESCRIPTION: Clear and remove a reference on an implicit return value. Used
|
||||
* to delete "stale" return values (if enabled, the return value
|
||||
* from every operator is saved at least momentarily, in case the
|
||||
* parent method exits.)
|
||||
@@ -189,7 +115,7 @@ AcpiDsClearImplicitReturn (
|
||||
*
|
||||
* DESCRIPTION: Implements the optional "implicit return". We save the result
|
||||
* of every ASL operator and control method invocation in case the
|
||||
* parent method exit. Before storing a new return value, we
|
||||
* parent method exit. Before storing a new return value, we
|
||||
* delete the previous return value.
|
||||
*
|
||||
******************************************************************************/
|
||||
@@ -292,7 +218,7 @@ AcpiDsIsResultUsed (
|
||||
*
|
||||
* If there is no parent, or the parent is a ScopeOp, we are executing
|
||||
* at the method level. An executing method typically has no parent,
|
||||
* since each method is parsed separately. A method invoked externally
|
||||
* since each method is parsed separately. A method invoked externally
|
||||
* via ExecuteControlMethod has a ScopeOp as the parent.
|
||||
*/
|
||||
if ((!Op->Common.Parent) ||
|
||||
@@ -317,7 +243,7 @@ AcpiDsIsResultUsed (
|
||||
}
|
||||
|
||||
/*
|
||||
* Decide what to do with the result based on the parent. If
|
||||
* Decide what to do with the result based on the parent. If
|
||||
* the parent opcode will not use the result, delete the object.
|
||||
* Otherwise leave it as is, it will be deleted when it is used
|
||||
* as an operand later.
|
||||
@@ -336,7 +262,6 @@ AcpiDsIsResultUsed (
|
||||
|
||||
case AML_IF_OP:
|
||||
case AML_WHILE_OP:
|
||||
|
||||
/*
|
||||
* If we are executing the predicate AND this is the predicate op,
|
||||
* we will use the return value
|
||||
@@ -349,7 +274,9 @@ AcpiDsIsResultUsed (
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
/* Ignore other control opcodes */
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -357,16 +284,13 @@ AcpiDsIsResultUsed (
|
||||
|
||||
goto ResultNotUsed;
|
||||
|
||||
|
||||
case AML_CLASS_CREATE:
|
||||
|
||||
/*
|
||||
* These opcodes allow TermArg(s) as operands and therefore
|
||||
* the operands can be method calls. The result is used.
|
||||
* the operands can be method calls. The result is used.
|
||||
*/
|
||||
goto ResultUsed;
|
||||
|
||||
|
||||
case AML_CLASS_NAMED_OBJECT:
|
||||
|
||||
if ((Op->Common.Parent->Common.AmlOpcode == AML_REGION_OP) ||
|
||||
@@ -379,16 +303,14 @@ AcpiDsIsResultUsed (
|
||||
{
|
||||
/*
|
||||
* These opcodes allow TermArg(s) as operands and therefore
|
||||
* the operands can be method calls. The result is used.
|
||||
* the operands can be method calls. The result is used.
|
||||
*/
|
||||
goto ResultUsed;
|
||||
}
|
||||
|
||||
goto ResultNotUsed;
|
||||
|
||||
|
||||
default:
|
||||
|
||||
/*
|
||||
* In all other cases. the parent will actually use the return
|
||||
* object, so keep it.
|
||||
@@ -426,9 +348,9 @@ ResultNotUsed:
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Used after interpretation of an opcode. If there is an internal
|
||||
* DESCRIPTION: Used after interpretation of an opcode. If there is an internal
|
||||
* result descriptor, check if the parent opcode will actually use
|
||||
* this result. If not, delete the result now so that it will
|
||||
* this result. If not, delete the result now so that it will
|
||||
* not become orphaned.
|
||||
*
|
||||
******************************************************************************/
|
||||
@@ -480,7 +402,7 @@ AcpiDsDeleteResultIfNotUsed (
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Resolve all operands to their values. Used to prepare
|
||||
* DESCRIPTION: Resolve all operands to their values. Used to prepare
|
||||
* arguments to a control method invocation (a call from one
|
||||
* method to another.)
|
||||
*
|
||||
@@ -499,7 +421,7 @@ AcpiDsResolveOperands (
|
||||
|
||||
/*
|
||||
* Attempt to resolve each of the valid operands
|
||||
* Method arguments are passed by reference, not by value. This means
|
||||
* Method arguments are passed by reference, not by value. This means
|
||||
* that the actual objects are passed, not copies of the objects.
|
||||
*/
|
||||
for (i = 0; i < WalkState->NumOperands; i++)
|
||||
@@ -566,7 +488,7 @@ AcpiDsClearOperands (
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Translate a parse tree object that is an argument to an AML
|
||||
* opcode to the equivalent interpreter object. This may include
|
||||
* opcode to the equivalent interpreter object. This may include
|
||||
* looking up a name or entering a new name into the internal
|
||||
* namespace.
|
||||
*
|
||||
@@ -612,11 +534,11 @@ AcpiDsCreateOperand (
|
||||
/* All prefixes have been handled, and the name is in NameString */
|
||||
|
||||
/*
|
||||
* Special handling for BufferField declarations. This is a deferred
|
||||
* Special handling for BufferField declarations. This is a deferred
|
||||
* opcode that unfortunately defines the field name as the last
|
||||
* parameter instead of the first. We get here when we are performing
|
||||
* parameter instead of the first. We get here when we are performing
|
||||
* the deferred execution, so the actual name of the field is already
|
||||
* in the namespace. We don't want to attempt to look it up again
|
||||
* in the namespace. We don't want to attempt to look it up again
|
||||
* because we may be executing in a different scope than where the
|
||||
* actual opcode exists.
|
||||
*/
|
||||
@@ -723,8 +645,8 @@ AcpiDsCreateOperand (
|
||||
/*
|
||||
* If the name is null, this means that this is an
|
||||
* optional result parameter that was not specified
|
||||
* in the original ASL. Create a Zero Constant for a
|
||||
* placeholder. (Store to a constant is a Noop.)
|
||||
* in the original ASL. Create a Zero Constant for a
|
||||
* placeholder. (Store to a constant is a Noop.)
|
||||
*/
|
||||
Opcode = AML_ZERO_OP; /* Has no arguments! */
|
||||
|
||||
@@ -855,16 +777,16 @@ AcpiDsCreateOperands (
|
||||
Index++;
|
||||
}
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
|
||||
"NumOperands %d, ArgCount %d, Index %d\n",
|
||||
WalkState->NumOperands, ArgCount, Index));
|
||||
|
||||
/* Create the interpreter arguments, in reverse order */
|
||||
|
||||
Index--;
|
||||
|
||||
/* It is the appropriate order to get objects from the Result stack */
|
||||
|
||||
for (i = 0; i < ArgCount; i++)
|
||||
{
|
||||
Arg = Arguments[Index];
|
||||
|
||||
/* Force the filling of the operand stack in inverse order */
|
||||
|
||||
WalkState->OperandIndex = (UINT8) Index;
|
||||
|
||||
Status = AcpiDsCreateOperand (WalkState, Arg, Index);
|
||||
@@ -873,10 +795,10 @@ AcpiDsCreateOperands (
|
||||
goto Cleanup;
|
||||
}
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
|
||||
"Created Arg #%u (%p) %u args total\n",
|
||||
Index, Arg, ArgCount));
|
||||
Index--;
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Arg #%u (%p) done, Arg1=%p\n",
|
||||
Index, Arg, FirstArg));
|
||||
}
|
||||
|
||||
return_ACPI_STATUS (Status);
|
||||
|
||||
@@ -5,116 +5,42 @@
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
* 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.
|
||||
*
|
||||
* 2.1. This is your license from Intel Corp. under its intellectual property
|
||||
* rights. You may have additional license terms from the party that provided
|
||||
* you this software, covering your right to use that party's intellectual
|
||||
* property rights.
|
||||
* 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.
|
||||
*
|
||||
* 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
|
||||
* copy of the source code appearing in this file ("Covered Code") an
|
||||
* irrevocable, perpetual, worldwide license under Intel's copyrights in the
|
||||
* base code distributed originally by Intel ("Original Intel Code") to copy,
|
||||
* make derivatives, distribute, use and display any portion of the Covered
|
||||
* Code in any form, with the right to sublicense such rights; and
|
||||
*
|
||||
* 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
|
||||
* license (with the right to sublicense), under only those claims of Intel
|
||||
* patents that are infringed by the Original Intel Code, to make, use, sell,
|
||||
* offer to sell, and import the Covered Code and derivative works thereof
|
||||
* solely to the minimum extent necessary to exercise the above copyright
|
||||
* license, and in no event shall the patent license extend to any additions
|
||||
* to or modifications of the Original Intel Code. No other license or right
|
||||
* is granted directly or by implication, estoppel or otherwise;
|
||||
*
|
||||
* The above copyright and patent license is granted only if the following
|
||||
* conditions are met:
|
||||
*
|
||||
* 3. Conditions
|
||||
*
|
||||
* 3.1. Redistribution of Source with Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification with rights to further distribute source must include
|
||||
* the above Copyright Notice, the above License, this list of Conditions,
|
||||
* and the following Disclaimer and Export Compliance provision. In addition,
|
||||
* Licensee must cause all Covered Code to which Licensee contributes to
|
||||
* contain a file documenting the changes Licensee made to create that Covered
|
||||
* Code and the date of any change. Licensee must include in that file the
|
||||
* documentation of any changes made by any predecessor Licensee. Licensee
|
||||
* must include a prominent statement that the modification is derived,
|
||||
* directly or indirectly, from Original Intel Code.
|
||||
*
|
||||
* 3.2. Redistribution of Source with no Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification without rights to further distribute source must
|
||||
* include the following Disclaimer and Export Compliance provision in the
|
||||
* documentation and/or other materials provided with distribution. In
|
||||
* addition, Licensee may not authorize further sublicense of source of any
|
||||
* portion of the Covered Code, and must include terms to the effect that the
|
||||
* license from Licensee to its licensee is limited to the intellectual
|
||||
* property embodied in the software Licensee provides to its licensee, and
|
||||
* not to intellectual property embodied in modifications its licensee may
|
||||
* make.
|
||||
*
|
||||
* 3.3. Redistribution of Executable. Redistribution in executable form of any
|
||||
* substantial portion of the Covered Code or modification must reproduce the
|
||||
* above Copyright Notice, and the following Disclaimer and Export Compliance
|
||||
* provision in the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3.4. Intel retains all right, title, and interest in and to the Original
|
||||
* Intel Code.
|
||||
*
|
||||
* 3.5. Neither the name Intel nor any other trademark owned or controlled by
|
||||
* Intel shall be used in advertising or otherwise to promote the sale, use or
|
||||
* other dealings in products derived from or relating to the Covered Code
|
||||
* without prior written authorization from Intel.
|
||||
*
|
||||
* 4. Disclaimer and Export Compliance
|
||||
*
|
||||
* 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
|
||||
* HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
|
||||
* IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
|
||||
* INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
|
||||
* UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
|
||||
* PARTICULAR PURPOSE.
|
||||
*
|
||||
* 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
|
||||
* OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
|
||||
* COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
|
||||
* SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
|
||||
* CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
|
||||
* HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
|
||||
* SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
|
||||
* LIMITED REMEDY.
|
||||
*
|
||||
* 4.3. Licensee shall not export, either directly or indirectly, any of this
|
||||
* software or system incorporating such software without first obtaining any
|
||||
* required license or other approval from the U. S. Department of Commerce or
|
||||
* any other agency or department of the United States Government. In the
|
||||
* event Licensee exports any such software from the United States or
|
||||
* re-exports any such software from a foreign destination, Licensee shall
|
||||
* ensure that the distribution and export/re-export of the software is in
|
||||
* compliance with all laws, regulations, orders, or other restrictions of the
|
||||
* U.S. Export Administration Regulations. Licensee agrees that neither it nor
|
||||
* any of its subsidiaries will export/re-export any technical data, process,
|
||||
* software, or service, directly or indirectly, to any country for which the
|
||||
* United States government or any agency thereof requires an export license,
|
||||
* other governmental approval, or letter of assurance, without first obtaining
|
||||
* such license, approval or letter.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
#define __DSWEXEC_C__
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#include "acpi.h"
|
||||
#include "accommon.h"
|
||||
@@ -236,7 +162,7 @@ AcpiDsGetPredicateValue (
|
||||
|
||||
/* Truncate the predicate to 32-bits if necessary */
|
||||
|
||||
AcpiExTruncateFor32bitTable (LocalObjDesc);
|
||||
(void) AcpiExTruncateFor32bitTable (LocalObjDesc);
|
||||
|
||||
/*
|
||||
* Save the result of the predicate evaluation on
|
||||
@@ -295,7 +221,7 @@ Cleanup:
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Descending callback used during the execution of control
|
||||
* methods. This is where most operators and operands are
|
||||
* methods. This is where most operators and operands are
|
||||
* dispatched to the interpreter.
|
||||
*
|
||||
****************************************************************************/
|
||||
@@ -390,30 +316,44 @@ AcpiDsExecBeginOp (
|
||||
Status = AcpiDsExecBeginControlOp (WalkState, Op);
|
||||
break;
|
||||
|
||||
|
||||
case AML_CLASS_NAMED_OBJECT:
|
||||
|
||||
if (WalkState->WalkType & ACPI_WALK_METHOD)
|
||||
{
|
||||
/*
|
||||
* Found a named object declaration during method execution;
|
||||
* we must enter this object into the namespace. The created
|
||||
* we must enter this object into the namespace. The created
|
||||
* object is temporary and will be deleted upon completion of
|
||||
* the execution of this method.
|
||||
*
|
||||
* Note 10/2010: Except for the Scope() op. This opcode does
|
||||
* not actually create a new object, it refers to an existing
|
||||
* object. However, for Scope(), we want to indeed open a
|
||||
* new scope.
|
||||
*/
|
||||
Status = AcpiDsLoad2BeginOp (WalkState, NULL);
|
||||
if (Op->Common.AmlOpcode != AML_SCOPE_OP)
|
||||
{
|
||||
Status = AcpiDsLoad2BeginOp (WalkState, NULL);
|
||||
}
|
||||
else
|
||||
{
|
||||
Status = AcpiDsScopeStackPush (Op->Named.Node,
|
||||
Op->Named.Node->Type, WalkState);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
|
||||
case AML_CLASS_EXECUTE:
|
||||
case AML_CLASS_CREATE:
|
||||
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -437,7 +377,7 @@ ErrorExit:
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Ascending callback used during the execution of control
|
||||
* methods. The only thing we really need to do here is to
|
||||
* methods. The only thing we really need to do here is to
|
||||
* notice the beginning of IF, ELSE, and WHILE blocks.
|
||||
*
|
||||
****************************************************************************/
|
||||
@@ -497,7 +437,6 @@ AcpiDsExecEndOp (
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case AML_CLASS_EXECUTE: /* Most operators with arguments */
|
||||
|
||||
/* Build resolved operand stack */
|
||||
@@ -525,7 +464,7 @@ AcpiDsExecEndOp (
|
||||
{
|
||||
/*
|
||||
* Dispatch the request to the appropriate interpreter handler
|
||||
* routine. There is one routine per opcode "type" based upon the
|
||||
* routine. There is one routine per opcode "type" based upon the
|
||||
* number of opcode arguments and return type.
|
||||
*/
|
||||
Status = AcpiGbl_OpTypeDispatch[OpType] (WalkState);
|
||||
@@ -570,7 +509,6 @@ AcpiDsExecEndOp (
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
|
||||
switch (OpType)
|
||||
@@ -583,9 +521,7 @@ AcpiDsExecEndOp (
|
||||
|
||||
break;
|
||||
|
||||
|
||||
case AML_TYPE_METHOD_CALL:
|
||||
|
||||
/*
|
||||
* If the method is referenced from within a package
|
||||
* declaration, it is not a invocation of the method, just
|
||||
@@ -603,7 +539,8 @@ AcpiDsExecEndOp (
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
}
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Method invocation, Op=%p\n", Op));
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
|
||||
"Method invocation, Op=%p\n", Op));
|
||||
|
||||
/*
|
||||
* (AML_METHODCALL) Op->Asl.Value.Arg->Asl.Node contains
|
||||
@@ -652,7 +589,6 @@ AcpiDsExecEndOp (
|
||||
*/
|
||||
return_ACPI_STATUS (Status);
|
||||
|
||||
|
||||
case AML_TYPE_CREATE_FIELD:
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
|
||||
@@ -676,7 +612,6 @@ AcpiDsExecEndOp (
|
||||
switch (Op->Common.Parent->Common.AmlOpcode)
|
||||
{
|
||||
case AML_NAME_OP:
|
||||
|
||||
/*
|
||||
* Put the Node on the object stack (Contains the ACPI Name
|
||||
* of this object)
|
||||
@@ -717,7 +652,6 @@ AcpiDsExecEndOp (
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case AML_TYPE_NAMED_FIELD:
|
||||
case AML_TYPE_NAMED_COMPLEX:
|
||||
case AML_TYPE_NAMED_SIMPLE:
|
||||
@@ -764,14 +698,12 @@ AcpiDsExecEndOp (
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case AML_TYPE_UNDEFINED:
|
||||
|
||||
ACPI_ERROR ((AE_INFO,
|
||||
"Undefined opcode type Op=%p", Op));
|
||||
return_ACPI_STATUS (AE_NOT_IMPLEMENTED);
|
||||
|
||||
|
||||
case AML_TYPE_BOGUS:
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
|
||||
@@ -779,11 +711,10 @@ AcpiDsExecEndOp (
|
||||
WalkState->Opcode, Op));
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
|
||||
ACPI_ERROR ((AE_INFO,
|
||||
"Unimplemented opcode, class=0x%X type=0x%X Opcode=-0x%X Op=%p",
|
||||
"Unimplemented opcode, class=0x%X type=0x%X Opcode=0x%X Op=%p",
|
||||
OpClass, OpType, Op->Common.AmlOpcode, Op));
|
||||
|
||||
Status = AE_NOT_IMPLEMENTED;
|
||||
@@ -795,7 +726,7 @@ AcpiDsExecEndOp (
|
||||
* ACPI 2.0 support for 64-bit integers: Truncate numeric
|
||||
* result value if we are executing from a 32-bit ACPI table
|
||||
*/
|
||||
AcpiExTruncateFor32bitTable (WalkState->ResultObj);
|
||||
(void) AcpiExTruncateFor32bitTable (WalkState->ResultObj);
|
||||
|
||||
/*
|
||||
* Check if we just completed the evaluation of a
|
||||
@@ -849,5 +780,3 @@ Cleanup:
|
||||
WalkState->NumOperands = 0;
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,119 +1,45 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Module Name: dswload - Dispatcher namespace load callbacks
|
||||
* Module Name: dswload - Dispatcher first pass namespace load callbacks
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
* 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.
|
||||
*
|
||||
* 2.1. This is your license from Intel Corp. under its intellectual property
|
||||
* rights. You may have additional license terms from the party that provided
|
||||
* you this software, covering your right to use that party's intellectual
|
||||
* property rights.
|
||||
* 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.
|
||||
*
|
||||
* 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
|
||||
* copy of the source code appearing in this file ("Covered Code") an
|
||||
* irrevocable, perpetual, worldwide license under Intel's copyrights in the
|
||||
* base code distributed originally by Intel ("Original Intel Code") to copy,
|
||||
* make derivatives, distribute, use and display any portion of the Covered
|
||||
* Code in any form, with the right to sublicense such rights; and
|
||||
*
|
||||
* 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
|
||||
* license (with the right to sublicense), under only those claims of Intel
|
||||
* patents that are infringed by the Original Intel Code, to make, use, sell,
|
||||
* offer to sell, and import the Covered Code and derivative works thereof
|
||||
* solely to the minimum extent necessary to exercise the above copyright
|
||||
* license, and in no event shall the patent license extend to any additions
|
||||
* to or modifications of the Original Intel Code. No other license or right
|
||||
* is granted directly or by implication, estoppel or otherwise;
|
||||
*
|
||||
* The above copyright and patent license is granted only if the following
|
||||
* conditions are met:
|
||||
*
|
||||
* 3. Conditions
|
||||
*
|
||||
* 3.1. Redistribution of Source with Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification with rights to further distribute source must include
|
||||
* the above Copyright Notice, the above License, this list of Conditions,
|
||||
* and the following Disclaimer and Export Compliance provision. In addition,
|
||||
* Licensee must cause all Covered Code to which Licensee contributes to
|
||||
* contain a file documenting the changes Licensee made to create that Covered
|
||||
* Code and the date of any change. Licensee must include in that file the
|
||||
* documentation of any changes made by any predecessor Licensee. Licensee
|
||||
* must include a prominent statement that the modification is derived,
|
||||
* directly or indirectly, from Original Intel Code.
|
||||
*
|
||||
* 3.2. Redistribution of Source with no Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification without rights to further distribute source must
|
||||
* include the following Disclaimer and Export Compliance provision in the
|
||||
* documentation and/or other materials provided with distribution. In
|
||||
* addition, Licensee may not authorize further sublicense of source of any
|
||||
* portion of the Covered Code, and must include terms to the effect that the
|
||||
* license from Licensee to its licensee is limited to the intellectual
|
||||
* property embodied in the software Licensee provides to its licensee, and
|
||||
* not to intellectual property embodied in modifications its licensee may
|
||||
* make.
|
||||
*
|
||||
* 3.3. Redistribution of Executable. Redistribution in executable form of any
|
||||
* substantial portion of the Covered Code or modification must reproduce the
|
||||
* above Copyright Notice, and the following Disclaimer and Export Compliance
|
||||
* provision in the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3.4. Intel retains all right, title, and interest in and to the Original
|
||||
* Intel Code.
|
||||
*
|
||||
* 3.5. Neither the name Intel nor any other trademark owned or controlled by
|
||||
* Intel shall be used in advertising or otherwise to promote the sale, use or
|
||||
* other dealings in products derived from or relating to the Covered Code
|
||||
* without prior written authorization from Intel.
|
||||
*
|
||||
* 4. Disclaimer and Export Compliance
|
||||
*
|
||||
* 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
|
||||
* HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
|
||||
* IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
|
||||
* INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
|
||||
* UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
|
||||
* PARTICULAR PURPOSE.
|
||||
*
|
||||
* 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
|
||||
* OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
|
||||
* COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
|
||||
* SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
|
||||
* CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
|
||||
* HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
|
||||
* SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
|
||||
* LIMITED REMEDY.
|
||||
*
|
||||
* 4.3. Licensee shall not export, either directly or indirectly, any of this
|
||||
* software or system incorporating such software without first obtaining any
|
||||
* required license or other approval from the U. S. Department of Commerce or
|
||||
* any other agency or department of the United States Government. In the
|
||||
* event Licensee exports any such software from the United States or
|
||||
* re-exports any such software from a foreign destination, Licensee shall
|
||||
* ensure that the distribution and export/re-export of the software is in
|
||||
* compliance with all laws, regulations, orders, or other restrictions of the
|
||||
* U.S. Export Administration Regulations. Licensee agrees that neither it nor
|
||||
* any of its subsidiaries will export/re-export any technical data, process,
|
||||
* software, or service, directly or indirectly, to any country for which the
|
||||
* United States government or any agency thereof requires an export license,
|
||||
* other governmental approval, or letter of assurance, without first obtaining
|
||||
* such license, approval or letter.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
#define __DSWLOAD_C__
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#include "acpi.h"
|
||||
#include "accommon.h"
|
||||
@@ -122,7 +48,6 @@
|
||||
#include "acdispat.h"
|
||||
#include "acinterp.h"
|
||||
#include "acnamesp.h"
|
||||
#include "acevents.h"
|
||||
|
||||
#ifdef ACPI_ASL_COMPILER
|
||||
#include "acdisasm.h"
|
||||
@@ -153,7 +78,21 @@ AcpiDsInitCallbacks (
|
||||
|
||||
switch (PassNumber)
|
||||
{
|
||||
case 0:
|
||||
|
||||
/* Parse only - caller will setup callbacks */
|
||||
|
||||
WalkState->ParseFlags = ACPI_PARSE_LOAD_PASS1 |
|
||||
ACPI_PARSE_DELETE_TREE |
|
||||
ACPI_PARSE_DISASSEMBLE;
|
||||
WalkState->DescendingCallback = NULL;
|
||||
WalkState->AscendingCallback = NULL;
|
||||
break;
|
||||
|
||||
case 1:
|
||||
|
||||
/* Load pass 1 */
|
||||
|
||||
WalkState->ParseFlags = ACPI_PARSE_LOAD_PASS1 |
|
||||
ACPI_PARSE_DELETE_TREE;
|
||||
WalkState->DescendingCallback = AcpiDsLoad1BeginOp;
|
||||
@@ -161,6 +100,9 @@ AcpiDsInitCallbacks (
|
||||
break;
|
||||
|
||||
case 2:
|
||||
|
||||
/* Load pass 2 */
|
||||
|
||||
WalkState->ParseFlags = ACPI_PARSE_LOAD_PASS1 |
|
||||
ACPI_PARSE_DELETE_TREE;
|
||||
WalkState->DescendingCallback = AcpiDsLoad2BeginOp;
|
||||
@@ -168,6 +110,9 @@ AcpiDsInitCallbacks (
|
||||
break;
|
||||
|
||||
case 3:
|
||||
|
||||
/* Execution pass */
|
||||
|
||||
#ifndef ACPI_NO_METHOD_EXECUTION
|
||||
WalkState->ParseFlags |= ACPI_PARSE_EXECUTE |
|
||||
ACPI_PARSE_DELETE_TREE;
|
||||
@@ -177,6 +122,7 @@ AcpiDsInitCallbacks (
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
return (AE_BAD_PARAMETER);
|
||||
}
|
||||
|
||||
@@ -247,7 +193,6 @@ AcpiDsLoad1BeginOp (
|
||||
switch (WalkState->Opcode)
|
||||
{
|
||||
case AML_SCOPE_OP:
|
||||
|
||||
/*
|
||||
* The target name of the Scope() operator must exist at this point so
|
||||
* that we can actually open the scope to enter new names underneath it.
|
||||
@@ -263,7 +208,7 @@ AcpiDsLoad1BeginOp (
|
||||
* Target of Scope() not found. Generate an External for it, and
|
||||
* insert the name into the namespace.
|
||||
*/
|
||||
AcpiDmAddToExternalList (Op, Path, ACPI_TYPE_DEVICE, 0);
|
||||
AcpiDmAddOpToExternalList (Op, Path, ACPI_TYPE_DEVICE, 0, 0);
|
||||
Status = AcpiNsLookup (WalkState->ScopeInfo, Path, ObjectType,
|
||||
ACPI_IMODE_LOAD_PASS1, ACPI_NS_SEARCH_PARENT,
|
||||
WalkState, &Node);
|
||||
@@ -294,7 +239,6 @@ AcpiDsLoad1BeginOp (
|
||||
case ACPI_TYPE_INTEGER:
|
||||
case ACPI_TYPE_STRING:
|
||||
case ACPI_TYPE_BUFFER:
|
||||
|
||||
/*
|
||||
* These types we will allow, but we will change the type.
|
||||
* This enables some existing code of the form:
|
||||
@@ -314,6 +258,19 @@ AcpiDsLoad1BeginOp (
|
||||
WalkState->ScopeInfo->Common.Value = ACPI_TYPE_ANY;
|
||||
break;
|
||||
|
||||
case ACPI_TYPE_METHOD:
|
||||
/*
|
||||
* Allow scope change to root during execution of module-level
|
||||
* code. Root is typed METHOD during this time.
|
||||
*/
|
||||
if ((Node == AcpiGbl_RootNode) &&
|
||||
(WalkState->ParseFlags & ACPI_PARSE_MODULE_LEVEL))
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
/*lint -fallthrough */
|
||||
|
||||
default:
|
||||
|
||||
/* All other types are an error */
|
||||
@@ -327,7 +284,6 @@ AcpiDsLoad1BeginOp (
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
/*
|
||||
* For all other named opcodes, we will enter the name into
|
||||
@@ -539,7 +495,7 @@ AcpiDsLoad1EndOp (
|
||||
else if (Op->Common.AmlOpcode == AML_DATA_REGION_OP)
|
||||
{
|
||||
Status = AcpiExCreateRegion (Op->Named.Data, Op->Named.Length,
|
||||
REGION_DATA_TABLE, WalkState);
|
||||
ACPI_ADR_SPACE_DATA_TABLE, WalkState);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return_ACPI_STATUS (Status);
|
||||
@@ -622,695 +578,3 @@ AcpiDsLoad1EndOp (
|
||||
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiDsLoad2BeginOp
|
||||
*
|
||||
* PARAMETERS: WalkState - Current state of the parse tree walk
|
||||
* OutOp - Wher to return op if a new one is created
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Descending callback used during the loading of ACPI tables.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiDsLoad2BeginOp (
|
||||
ACPI_WALK_STATE *WalkState,
|
||||
ACPI_PARSE_OBJECT **OutOp)
|
||||
{
|
||||
ACPI_PARSE_OBJECT *Op;
|
||||
ACPI_NAMESPACE_NODE *Node;
|
||||
ACPI_STATUS Status;
|
||||
ACPI_OBJECT_TYPE ObjectType;
|
||||
char *BufferPtr;
|
||||
UINT32 Flags;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE (DsLoad2BeginOp);
|
||||
|
||||
|
||||
Op = WalkState->Op;
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Op=%p State=%p\n", Op, WalkState));
|
||||
|
||||
if (Op)
|
||||
{
|
||||
if ((WalkState->ControlState) &&
|
||||
(WalkState->ControlState->Common.State ==
|
||||
ACPI_CONTROL_CONDITIONAL_EXECUTING))
|
||||
{
|
||||
/* We are executing a while loop outside of a method */
|
||||
|
||||
Status = AcpiDsExecBeginOp (WalkState, OutOp);
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
/* We only care about Namespace opcodes here */
|
||||
|
||||
if ((!(WalkState->OpInfo->Flags & AML_NSOPCODE) &&
|
||||
(WalkState->Opcode != AML_INT_NAMEPATH_OP)) ||
|
||||
(!(WalkState->OpInfo->Flags & AML_NAMED)))
|
||||
{
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
}
|
||||
|
||||
/* Get the name we are going to enter or lookup in the namespace */
|
||||
|
||||
if (WalkState->Opcode == AML_INT_NAMEPATH_OP)
|
||||
{
|
||||
/* For Namepath op, get the path string */
|
||||
|
||||
BufferPtr = Op->Common.Value.String;
|
||||
if (!BufferPtr)
|
||||
{
|
||||
/* No name, just exit */
|
||||
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Get name from the op */
|
||||
|
||||
BufferPtr = ACPI_CAST_PTR (char, &Op->Named.Name);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Get the namestring from the raw AML */
|
||||
|
||||
BufferPtr = AcpiPsGetNextNamestring (&WalkState->ParserState);
|
||||
}
|
||||
|
||||
/* Map the opcode into an internal object type */
|
||||
|
||||
ObjectType = WalkState->OpInfo->ObjectType;
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
|
||||
"State=%p Op=%p Type=%X\n", WalkState, Op, ObjectType));
|
||||
|
||||
switch (WalkState->Opcode)
|
||||
{
|
||||
case AML_FIELD_OP:
|
||||
case AML_BANK_FIELD_OP:
|
||||
case AML_INDEX_FIELD_OP:
|
||||
|
||||
Node = NULL;
|
||||
Status = AE_OK;
|
||||
break;
|
||||
|
||||
case AML_INT_NAMEPATH_OP:
|
||||
/*
|
||||
* The NamePath is an object reference to an existing object.
|
||||
* Don't enter the name into the namespace, but look it up
|
||||
* for use later.
|
||||
*/
|
||||
Status = AcpiNsLookup (WalkState->ScopeInfo, BufferPtr, ObjectType,
|
||||
ACPI_IMODE_EXECUTE, ACPI_NS_SEARCH_PARENT,
|
||||
WalkState, &(Node));
|
||||
break;
|
||||
|
||||
case AML_SCOPE_OP:
|
||||
|
||||
/* Special case for Scope(\) -> refers to the Root node */
|
||||
|
||||
if (Op && (Op->Named.Node == AcpiGbl_RootNode))
|
||||
{
|
||||
Node = Op->Named.Node;
|
||||
|
||||
Status = AcpiDsScopeStackPush (Node, ObjectType, WalkState);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
* The Path is an object reference to an existing object.
|
||||
* Don't enter the name into the namespace, but look it up
|
||||
* for use later.
|
||||
*/
|
||||
Status = AcpiNsLookup (WalkState->ScopeInfo, BufferPtr, ObjectType,
|
||||
ACPI_IMODE_EXECUTE, ACPI_NS_SEARCH_PARENT,
|
||||
WalkState, &(Node));
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
#ifdef ACPI_ASL_COMPILER
|
||||
if (Status == AE_NOT_FOUND)
|
||||
{
|
||||
Status = AE_OK;
|
||||
}
|
||||
else
|
||||
{
|
||||
ACPI_ERROR_NAMESPACE (BufferPtr, Status);
|
||||
}
|
||||
#else
|
||||
ACPI_ERROR_NAMESPACE (BufferPtr, Status);
|
||||
#endif
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* We must check to make sure that the target is
|
||||
* one of the opcodes that actually opens a scope
|
||||
*/
|
||||
switch (Node->Type)
|
||||
{
|
||||
case ACPI_TYPE_ANY:
|
||||
case ACPI_TYPE_LOCAL_SCOPE: /* Scope */
|
||||
case ACPI_TYPE_DEVICE:
|
||||
case ACPI_TYPE_POWER:
|
||||
case ACPI_TYPE_PROCESSOR:
|
||||
case ACPI_TYPE_THERMAL:
|
||||
|
||||
/* These are acceptable types */
|
||||
break;
|
||||
|
||||
case ACPI_TYPE_INTEGER:
|
||||
case ACPI_TYPE_STRING:
|
||||
case ACPI_TYPE_BUFFER:
|
||||
|
||||
/*
|
||||
* These types we will allow, but we will change the type.
|
||||
* This enables some existing code of the form:
|
||||
*
|
||||
* Name (DEB, 0)
|
||||
* Scope (DEB) { ... }
|
||||
*/
|
||||
ACPI_WARNING ((AE_INFO,
|
||||
"Type override - [%4.4s] had invalid type (%s) "
|
||||
"for Scope operator, changed to type ANY\n",
|
||||
AcpiUtGetNodeName (Node), AcpiUtGetTypeName (Node->Type)));
|
||||
|
||||
Node->Type = ACPI_TYPE_ANY;
|
||||
WalkState->ScopeInfo->Common.Value = ACPI_TYPE_ANY;
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
/* All other types are an error */
|
||||
|
||||
ACPI_ERROR ((AE_INFO,
|
||||
"Invalid type (%s) for target of "
|
||||
"Scope operator [%4.4s] (Cannot override)",
|
||||
AcpiUtGetTypeName (Node->Type), AcpiUtGetNodeName (Node)));
|
||||
|
||||
return (AE_AML_OPERAND_TYPE);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
/* All other opcodes */
|
||||
|
||||
if (Op && Op->Common.Node)
|
||||
{
|
||||
/* This op/node was previously entered into the namespace */
|
||||
|
||||
Node = Op->Common.Node;
|
||||
|
||||
if (AcpiNsOpensScope (ObjectType))
|
||||
{
|
||||
Status = AcpiDsScopeStackPush (Node, ObjectType, WalkState);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
}
|
||||
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
}
|
||||
|
||||
/*
|
||||
* Enter the named type into the internal namespace. We enter the name
|
||||
* as we go downward in the parse tree. Any necessary subobjects that
|
||||
* involve arguments to the opcode must be created as we go back up the
|
||||
* parse tree later.
|
||||
*
|
||||
* Note: Name may already exist if we are executing a deferred opcode.
|
||||
*/
|
||||
if (WalkState->DeferredNode)
|
||||
{
|
||||
/* This name is already in the namespace, get the node */
|
||||
|
||||
Node = WalkState->DeferredNode;
|
||||
Status = AE_OK;
|
||||
break;
|
||||
}
|
||||
|
||||
Flags = ACPI_NS_NO_UPSEARCH;
|
||||
if (WalkState->PassNumber == ACPI_IMODE_EXECUTE)
|
||||
{
|
||||
/* Execution mode, node cannot already exist, node is temporary */
|
||||
|
||||
Flags |= ACPI_NS_ERROR_IF_FOUND;
|
||||
|
||||
if (!(WalkState->ParseFlags & ACPI_PARSE_MODULE_LEVEL))
|
||||
{
|
||||
Flags |= ACPI_NS_TEMPORARY;
|
||||
}
|
||||
}
|
||||
|
||||
/* Add new entry or lookup existing entry */
|
||||
|
||||
Status = AcpiNsLookup (WalkState->ScopeInfo, BufferPtr, ObjectType,
|
||||
ACPI_IMODE_LOAD_PASS2, Flags, WalkState, &Node);
|
||||
|
||||
if (ACPI_SUCCESS (Status) && (Flags & ACPI_NS_TEMPORARY))
|
||||
{
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
|
||||
"***New Node [%4.4s] %p is temporary\n",
|
||||
AcpiUtGetNodeName (Node), Node));
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
ACPI_ERROR_NAMESPACE (BufferPtr, Status);
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
if (!Op)
|
||||
{
|
||||
/* Create a new op */
|
||||
|
||||
Op = AcpiPsAllocOp (WalkState->Opcode);
|
||||
if (!Op)
|
||||
{
|
||||
return_ACPI_STATUS (AE_NO_MEMORY);
|
||||
}
|
||||
|
||||
/* Initialize the new op */
|
||||
|
||||
if (Node)
|
||||
{
|
||||
Op->Named.Name = Node->Name.Integer;
|
||||
}
|
||||
*OutOp = Op;
|
||||
}
|
||||
|
||||
/*
|
||||
* Put the Node in the "op" object that the parser uses, so we
|
||||
* can get it again quickly when this scope is closed
|
||||
*/
|
||||
Op->Common.Node = Node;
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiDsLoad2EndOp
|
||||
*
|
||||
* PARAMETERS: WalkState - Current state of the parse tree walk
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Ascending callback used during the loading of the namespace,
|
||||
* both control methods and everything else.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiDsLoad2EndOp (
|
||||
ACPI_WALK_STATE *WalkState)
|
||||
{
|
||||
ACPI_PARSE_OBJECT *Op;
|
||||
ACPI_STATUS Status = AE_OK;
|
||||
ACPI_OBJECT_TYPE ObjectType;
|
||||
ACPI_NAMESPACE_NODE *Node;
|
||||
ACPI_PARSE_OBJECT *Arg;
|
||||
ACPI_NAMESPACE_NODE *NewNode;
|
||||
#ifndef ACPI_NO_METHOD_EXECUTION
|
||||
UINT32 i;
|
||||
UINT8 RegionSpace;
|
||||
#endif
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE (DsLoad2EndOp);
|
||||
|
||||
Op = WalkState->Op;
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Opcode [%s] Op %p State %p\n",
|
||||
WalkState->OpInfo->Name, Op, WalkState));
|
||||
|
||||
/* Check if opcode had an associated namespace object */
|
||||
|
||||
if (!(WalkState->OpInfo->Flags & AML_NSOBJECT))
|
||||
{
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
}
|
||||
|
||||
if (Op->Common.AmlOpcode == AML_SCOPE_OP)
|
||||
{
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
|
||||
"Ending scope Op=%p State=%p\n", Op, WalkState));
|
||||
}
|
||||
|
||||
ObjectType = WalkState->OpInfo->ObjectType;
|
||||
|
||||
/*
|
||||
* Get the Node/name from the earlier lookup
|
||||
* (It was saved in the *op structure)
|
||||
*/
|
||||
Node = Op->Common.Node;
|
||||
|
||||
/*
|
||||
* Put the Node on the object stack (Contains the ACPI Name of
|
||||
* this object)
|
||||
*/
|
||||
WalkState->Operands[0] = (void *) Node;
|
||||
WalkState->NumOperands = 1;
|
||||
|
||||
/* Pop the scope stack */
|
||||
|
||||
if (AcpiNsOpensScope (ObjectType) &&
|
||||
(Op->Common.AmlOpcode != AML_INT_METHODCALL_OP))
|
||||
{
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "(%s) Popping scope for Op %p\n",
|
||||
AcpiUtGetTypeName (ObjectType), Op));
|
||||
|
||||
Status = AcpiDsScopeStackPop (WalkState);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
goto Cleanup;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Named operations are as follows:
|
||||
*
|
||||
* AML_ALIAS
|
||||
* AML_BANKFIELD
|
||||
* AML_CREATEBITFIELD
|
||||
* AML_CREATEBYTEFIELD
|
||||
* AML_CREATEDWORDFIELD
|
||||
* AML_CREATEFIELD
|
||||
* AML_CREATEQWORDFIELD
|
||||
* AML_CREATEWORDFIELD
|
||||
* AML_DATA_REGION
|
||||
* AML_DEVICE
|
||||
* AML_EVENT
|
||||
* AML_FIELD
|
||||
* AML_INDEXFIELD
|
||||
* AML_METHOD
|
||||
* AML_METHODCALL
|
||||
* AML_MUTEX
|
||||
* AML_NAME
|
||||
* AML_NAMEDFIELD
|
||||
* AML_OPREGION
|
||||
* AML_POWERRES
|
||||
* AML_PROCESSOR
|
||||
* AML_SCOPE
|
||||
* AML_THERMALZONE
|
||||
*/
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
|
||||
"Create-Load [%s] State=%p Op=%p NamedObj=%p\n",
|
||||
AcpiPsGetOpcodeName (Op->Common.AmlOpcode), WalkState, Op, Node));
|
||||
|
||||
/* Decode the opcode */
|
||||
|
||||
Arg = Op->Common.Value.Arg;
|
||||
|
||||
switch (WalkState->OpInfo->Type)
|
||||
{
|
||||
#ifndef ACPI_NO_METHOD_EXECUTION
|
||||
|
||||
case AML_TYPE_CREATE_FIELD:
|
||||
/*
|
||||
* Create the field object, but the field buffer and index must
|
||||
* be evaluated later during the execution phase
|
||||
*/
|
||||
Status = AcpiDsCreateBufferField (Op, WalkState);
|
||||
break;
|
||||
|
||||
|
||||
case AML_TYPE_NAMED_FIELD:
|
||||
/*
|
||||
* If we are executing a method, initialize the field
|
||||
*/
|
||||
if (WalkState->MethodNode)
|
||||
{
|
||||
Status = AcpiDsInitFieldObjects (Op, WalkState);
|
||||
}
|
||||
|
||||
switch (Op->Common.AmlOpcode)
|
||||
{
|
||||
case AML_INDEX_FIELD_OP:
|
||||
|
||||
Status = AcpiDsCreateIndexField (Op, (ACPI_HANDLE) Arg->Common.Node,
|
||||
WalkState);
|
||||
break;
|
||||
|
||||
case AML_BANK_FIELD_OP:
|
||||
|
||||
Status = AcpiDsCreateBankField (Op, Arg->Common.Node, WalkState);
|
||||
break;
|
||||
|
||||
case AML_FIELD_OP:
|
||||
|
||||
Status = AcpiDsCreateField (Op, Arg->Common.Node, WalkState);
|
||||
break;
|
||||
|
||||
default:
|
||||
/* All NAMED_FIELD opcodes must be handled above */
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case AML_TYPE_NAMED_SIMPLE:
|
||||
|
||||
Status = AcpiDsCreateOperands (WalkState, Arg);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
goto Cleanup;
|
||||
}
|
||||
|
||||
switch (Op->Common.AmlOpcode)
|
||||
{
|
||||
case AML_PROCESSOR_OP:
|
||||
|
||||
Status = AcpiExCreateProcessor (WalkState);
|
||||
break;
|
||||
|
||||
case AML_POWER_RES_OP:
|
||||
|
||||
Status = AcpiExCreatePowerResource (WalkState);
|
||||
break;
|
||||
|
||||
case AML_MUTEX_OP:
|
||||
|
||||
Status = AcpiExCreateMutex (WalkState);
|
||||
break;
|
||||
|
||||
case AML_EVENT_OP:
|
||||
|
||||
Status = AcpiExCreateEvent (WalkState);
|
||||
break;
|
||||
|
||||
|
||||
case AML_ALIAS_OP:
|
||||
|
||||
Status = AcpiExCreateAlias (WalkState);
|
||||
break;
|
||||
|
||||
default:
|
||||
/* Unknown opcode */
|
||||
|
||||
Status = AE_OK;
|
||||
goto Cleanup;
|
||||
}
|
||||
|
||||
/* Delete operands */
|
||||
|
||||
for (i = 1; i < WalkState->NumOperands; i++)
|
||||
{
|
||||
AcpiUtRemoveReference (WalkState->Operands[i]);
|
||||
WalkState->Operands[i] = NULL;
|
||||
}
|
||||
|
||||
break;
|
||||
#endif /* ACPI_NO_METHOD_EXECUTION */
|
||||
|
||||
case AML_TYPE_NAMED_COMPLEX:
|
||||
|
||||
switch (Op->Common.AmlOpcode)
|
||||
{
|
||||
#ifndef ACPI_NO_METHOD_EXECUTION
|
||||
case AML_REGION_OP:
|
||||
case AML_DATA_REGION_OP:
|
||||
|
||||
if (Op->Common.AmlOpcode == AML_REGION_OP)
|
||||
{
|
||||
RegionSpace = (ACPI_ADR_SPACE_TYPE)
|
||||
((Op->Common.Value.Arg)->Common.Value.Integer);
|
||||
}
|
||||
else
|
||||
{
|
||||
RegionSpace = REGION_DATA_TABLE;
|
||||
}
|
||||
|
||||
/*
|
||||
* The OpRegion is not fully parsed at this time. The only valid
|
||||
* argument is the SpaceId. (We must save the address of the
|
||||
* AML of the address and length operands)
|
||||
*
|
||||
* If we have a valid region, initialize it. The namespace is
|
||||
* unlocked at this point.
|
||||
*
|
||||
* Need to unlock interpreter if it is locked (if we are running
|
||||
* a control method), in order to allow _REG methods to be run
|
||||
* during AcpiEvInitializeRegion.
|
||||
*/
|
||||
if (WalkState->MethodNode)
|
||||
{
|
||||
/*
|
||||
* Executing a method: initialize the region and unlock
|
||||
* the interpreter
|
||||
*/
|
||||
Status = AcpiExCreateRegion (Op->Named.Data, Op->Named.Length,
|
||||
RegionSpace, WalkState);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return (Status);
|
||||
}
|
||||
|
||||
AcpiExExitInterpreter ();
|
||||
}
|
||||
|
||||
Status = AcpiEvInitializeRegion (AcpiNsGetAttachedObject (Node),
|
||||
FALSE);
|
||||
if (WalkState->MethodNode)
|
||||
{
|
||||
AcpiExEnterInterpreter ();
|
||||
}
|
||||
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
/*
|
||||
* If AE_NOT_EXIST is returned, it is not fatal
|
||||
* because many regions get created before a handler
|
||||
* is installed for said region.
|
||||
*/
|
||||
if (AE_NOT_EXIST == Status)
|
||||
{
|
||||
Status = AE_OK;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case AML_NAME_OP:
|
||||
|
||||
Status = AcpiDsCreateNode (WalkState, Node, Op);
|
||||
break;
|
||||
|
||||
|
||||
case AML_METHOD_OP:
|
||||
/*
|
||||
* MethodOp PkgLength NameString MethodFlags TermList
|
||||
*
|
||||
* Note: We must create the method node/object pair as soon as we
|
||||
* see the method declaration. This allows later pass1 parsing
|
||||
* of invocations of the method (need to know the number of
|
||||
* arguments.)
|
||||
*/
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
|
||||
"LOADING-Method: State=%p Op=%p NamedObj=%p\n",
|
||||
WalkState, Op, Op->Named.Node));
|
||||
|
||||
if (!AcpiNsGetAttachedObject (Op->Named.Node))
|
||||
{
|
||||
WalkState->Operands[0] = ACPI_CAST_PTR (void, Op->Named.Node);
|
||||
WalkState->NumOperands = 1;
|
||||
|
||||
Status = AcpiDsCreateOperands (WalkState, Op->Common.Value.Arg);
|
||||
if (ACPI_SUCCESS (Status))
|
||||
{
|
||||
Status = AcpiExCreateMethod (Op->Named.Data,
|
||||
Op->Named.Length, WalkState);
|
||||
}
|
||||
WalkState->Operands[0] = NULL;
|
||||
WalkState->NumOperands = 0;
|
||||
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
#endif /* ACPI_NO_METHOD_EXECUTION */
|
||||
|
||||
default:
|
||||
/* All NAMED_COMPLEX opcodes must be handled above */
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case AML_CLASS_INTERNAL:
|
||||
|
||||
/* case AML_INT_NAMEPATH_OP: */
|
||||
break;
|
||||
|
||||
|
||||
case AML_CLASS_METHOD_CALL:
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
|
||||
"RESOLVING-MethodCall: State=%p Op=%p NamedObj=%p\n",
|
||||
WalkState, Op, Node));
|
||||
|
||||
/*
|
||||
* Lookup the method name and save the Node
|
||||
*/
|
||||
Status = AcpiNsLookup (WalkState->ScopeInfo, Arg->Common.Value.String,
|
||||
ACPI_TYPE_ANY, ACPI_IMODE_LOAD_PASS2,
|
||||
ACPI_NS_SEARCH_PARENT | ACPI_NS_DONT_OPEN_SCOPE,
|
||||
WalkState, &(NewNode));
|
||||
if (ACPI_SUCCESS (Status))
|
||||
{
|
||||
/*
|
||||
* Make sure that what we found is indeed a method
|
||||
* We didn't search for a method on purpose, to see if the name
|
||||
* would resolve
|
||||
*/
|
||||
if (NewNode->Type != ACPI_TYPE_METHOD)
|
||||
{
|
||||
Status = AE_AML_OPERAND_TYPE;
|
||||
}
|
||||
|
||||
/* We could put the returned object (Node) on the object stack for
|
||||
* later, but for now, we will put it in the "op" object that the
|
||||
* parser uses, so we can get it again at the end of this scope
|
||||
*/
|
||||
Op->Common.Node = NewNode;
|
||||
}
|
||||
else
|
||||
{
|
||||
ACPI_ERROR_NAMESPACE (Arg->Common.Value.String, Status);
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
Cleanup:
|
||||
|
||||
/* Remove the Node pushed at the very beginning */
|
||||
|
||||
WalkState->Operands[0] = NULL;
|
||||
WalkState->NumOperands = 0;
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
|
||||
|
||||
755
minix/drivers/power/acpi/dispatcher/dswload2.c
Normal file
755
minix/drivers/power/acpi/dispatcher/dswload2.c
Normal file
@@ -0,0 +1,755 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Module Name: dswload2 - Dispatcher second pass namespace load callbacks
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, 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.
|
||||
*/
|
||||
|
||||
#include "acpi.h"
|
||||
#include "accommon.h"
|
||||
#include "acparser.h"
|
||||
#include "amlcode.h"
|
||||
#include "acdispat.h"
|
||||
#include "acinterp.h"
|
||||
#include "acnamesp.h"
|
||||
#include "acevents.h"
|
||||
|
||||
#define _COMPONENT ACPI_DISPATCHER
|
||||
ACPI_MODULE_NAME ("dswload2")
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiDsLoad2BeginOp
|
||||
*
|
||||
* PARAMETERS: WalkState - Current state of the parse tree walk
|
||||
* OutOp - Wher to return op if a new one is created
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Descending callback used during the loading of ACPI tables.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiDsLoad2BeginOp (
|
||||
ACPI_WALK_STATE *WalkState,
|
||||
ACPI_PARSE_OBJECT **OutOp)
|
||||
{
|
||||
ACPI_PARSE_OBJECT *Op;
|
||||
ACPI_NAMESPACE_NODE *Node;
|
||||
ACPI_STATUS Status;
|
||||
ACPI_OBJECT_TYPE ObjectType;
|
||||
char *BufferPtr;
|
||||
UINT32 Flags;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE (DsLoad2BeginOp);
|
||||
|
||||
|
||||
Op = WalkState->Op;
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Op=%p State=%p\n", Op, WalkState));
|
||||
|
||||
if (Op)
|
||||
{
|
||||
if ((WalkState->ControlState) &&
|
||||
(WalkState->ControlState->Common.State ==
|
||||
ACPI_CONTROL_CONDITIONAL_EXECUTING))
|
||||
{
|
||||
/* We are executing a while loop outside of a method */
|
||||
|
||||
Status = AcpiDsExecBeginOp (WalkState, OutOp);
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
/* We only care about Namespace opcodes here */
|
||||
|
||||
if ((!(WalkState->OpInfo->Flags & AML_NSOPCODE) &&
|
||||
(WalkState->Opcode != AML_INT_NAMEPATH_OP)) ||
|
||||
(!(WalkState->OpInfo->Flags & AML_NAMED)))
|
||||
{
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
}
|
||||
|
||||
/* Get the name we are going to enter or lookup in the namespace */
|
||||
|
||||
if (WalkState->Opcode == AML_INT_NAMEPATH_OP)
|
||||
{
|
||||
/* For Namepath op, get the path string */
|
||||
|
||||
BufferPtr = Op->Common.Value.String;
|
||||
if (!BufferPtr)
|
||||
{
|
||||
/* No name, just exit */
|
||||
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Get name from the op */
|
||||
|
||||
BufferPtr = ACPI_CAST_PTR (char, &Op->Named.Name);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Get the namestring from the raw AML */
|
||||
|
||||
BufferPtr = AcpiPsGetNextNamestring (&WalkState->ParserState);
|
||||
}
|
||||
|
||||
/* Map the opcode into an internal object type */
|
||||
|
||||
ObjectType = WalkState->OpInfo->ObjectType;
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
|
||||
"State=%p Op=%p Type=%X\n", WalkState, Op, ObjectType));
|
||||
|
||||
switch (WalkState->Opcode)
|
||||
{
|
||||
case AML_FIELD_OP:
|
||||
case AML_BANK_FIELD_OP:
|
||||
case AML_INDEX_FIELD_OP:
|
||||
|
||||
Node = NULL;
|
||||
Status = AE_OK;
|
||||
break;
|
||||
|
||||
case AML_INT_NAMEPATH_OP:
|
||||
/*
|
||||
* The NamePath is an object reference to an existing object.
|
||||
* Don't enter the name into the namespace, but look it up
|
||||
* for use later.
|
||||
*/
|
||||
Status = AcpiNsLookup (WalkState->ScopeInfo, BufferPtr, ObjectType,
|
||||
ACPI_IMODE_EXECUTE, ACPI_NS_SEARCH_PARENT,
|
||||
WalkState, &(Node));
|
||||
break;
|
||||
|
||||
case AML_SCOPE_OP:
|
||||
|
||||
/* Special case for Scope(\) -> refers to the Root node */
|
||||
|
||||
if (Op && (Op->Named.Node == AcpiGbl_RootNode))
|
||||
{
|
||||
Node = Op->Named.Node;
|
||||
|
||||
Status = AcpiDsScopeStackPush (Node, ObjectType, WalkState);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
* The Path is an object reference to an existing object.
|
||||
* Don't enter the name into the namespace, but look it up
|
||||
* for use later.
|
||||
*/
|
||||
Status = AcpiNsLookup (WalkState->ScopeInfo, BufferPtr, ObjectType,
|
||||
ACPI_IMODE_EXECUTE, ACPI_NS_SEARCH_PARENT,
|
||||
WalkState, &(Node));
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
#ifdef ACPI_ASL_COMPILER
|
||||
if (Status == AE_NOT_FOUND)
|
||||
{
|
||||
Status = AE_OK;
|
||||
}
|
||||
else
|
||||
{
|
||||
ACPI_ERROR_NAMESPACE (BufferPtr, Status);
|
||||
}
|
||||
#else
|
||||
ACPI_ERROR_NAMESPACE (BufferPtr, Status);
|
||||
#endif
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* We must check to make sure that the target is
|
||||
* one of the opcodes that actually opens a scope
|
||||
*/
|
||||
switch (Node->Type)
|
||||
{
|
||||
case ACPI_TYPE_ANY:
|
||||
case ACPI_TYPE_LOCAL_SCOPE: /* Scope */
|
||||
case ACPI_TYPE_DEVICE:
|
||||
case ACPI_TYPE_POWER:
|
||||
case ACPI_TYPE_PROCESSOR:
|
||||
case ACPI_TYPE_THERMAL:
|
||||
|
||||
/* These are acceptable types */
|
||||
break;
|
||||
|
||||
case ACPI_TYPE_INTEGER:
|
||||
case ACPI_TYPE_STRING:
|
||||
case ACPI_TYPE_BUFFER:
|
||||
|
||||
/*
|
||||
* These types we will allow, but we will change the type.
|
||||
* This enables some existing code of the form:
|
||||
*
|
||||
* Name (DEB, 0)
|
||||
* Scope (DEB) { ... }
|
||||
*/
|
||||
ACPI_WARNING ((AE_INFO,
|
||||
"Type override - [%4.4s] had invalid type (%s) "
|
||||
"for Scope operator, changed to type ANY",
|
||||
AcpiUtGetNodeName (Node), AcpiUtGetTypeName (Node->Type)));
|
||||
|
||||
Node->Type = ACPI_TYPE_ANY;
|
||||
WalkState->ScopeInfo->Common.Value = ACPI_TYPE_ANY;
|
||||
break;
|
||||
|
||||
case ACPI_TYPE_METHOD:
|
||||
|
||||
/*
|
||||
* Allow scope change to root during execution of module-level
|
||||
* code. Root is typed METHOD during this time.
|
||||
*/
|
||||
if ((Node == AcpiGbl_RootNode) &&
|
||||
(WalkState->ParseFlags & ACPI_PARSE_MODULE_LEVEL))
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
/*lint -fallthrough */
|
||||
|
||||
default:
|
||||
|
||||
/* All other types are an error */
|
||||
|
||||
ACPI_ERROR ((AE_INFO,
|
||||
"Invalid type (%s) for target of "
|
||||
"Scope operator [%4.4s] (Cannot override)",
|
||||
AcpiUtGetTypeName (Node->Type), AcpiUtGetNodeName (Node)));
|
||||
|
||||
return_ACPI_STATUS (AE_AML_OPERAND_TYPE);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
/* All other opcodes */
|
||||
|
||||
if (Op && Op->Common.Node)
|
||||
{
|
||||
/* This op/node was previously entered into the namespace */
|
||||
|
||||
Node = Op->Common.Node;
|
||||
|
||||
if (AcpiNsOpensScope (ObjectType))
|
||||
{
|
||||
Status = AcpiDsScopeStackPush (Node, ObjectType, WalkState);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
}
|
||||
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
}
|
||||
|
||||
/*
|
||||
* Enter the named type into the internal namespace. We enter the name
|
||||
* as we go downward in the parse tree. Any necessary subobjects that
|
||||
* involve arguments to the opcode must be created as we go back up the
|
||||
* parse tree later.
|
||||
*
|
||||
* Note: Name may already exist if we are executing a deferred opcode.
|
||||
*/
|
||||
if (WalkState->DeferredNode)
|
||||
{
|
||||
/* This name is already in the namespace, get the node */
|
||||
|
||||
Node = WalkState->DeferredNode;
|
||||
Status = AE_OK;
|
||||
break;
|
||||
}
|
||||
|
||||
Flags = ACPI_NS_NO_UPSEARCH;
|
||||
if (WalkState->PassNumber == ACPI_IMODE_EXECUTE)
|
||||
{
|
||||
/* Execution mode, node cannot already exist, node is temporary */
|
||||
|
||||
Flags |= ACPI_NS_ERROR_IF_FOUND;
|
||||
|
||||
if (!(WalkState->ParseFlags & ACPI_PARSE_MODULE_LEVEL))
|
||||
{
|
||||
Flags |= ACPI_NS_TEMPORARY;
|
||||
}
|
||||
}
|
||||
|
||||
/* Add new entry or lookup existing entry */
|
||||
|
||||
Status = AcpiNsLookup (WalkState->ScopeInfo, BufferPtr, ObjectType,
|
||||
ACPI_IMODE_LOAD_PASS2, Flags, WalkState, &Node);
|
||||
|
||||
if (ACPI_SUCCESS (Status) && (Flags & ACPI_NS_TEMPORARY))
|
||||
{
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
|
||||
"***New Node [%4.4s] %p is temporary\n",
|
||||
AcpiUtGetNodeName (Node), Node));
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
ACPI_ERROR_NAMESPACE (BufferPtr, Status);
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
if (!Op)
|
||||
{
|
||||
/* Create a new op */
|
||||
|
||||
Op = AcpiPsAllocOp (WalkState->Opcode);
|
||||
if (!Op)
|
||||
{
|
||||
return_ACPI_STATUS (AE_NO_MEMORY);
|
||||
}
|
||||
|
||||
/* Initialize the new op */
|
||||
|
||||
if (Node)
|
||||
{
|
||||
Op->Named.Name = Node->Name.Integer;
|
||||
}
|
||||
*OutOp = Op;
|
||||
}
|
||||
|
||||
/*
|
||||
* Put the Node in the "op" object that the parser uses, so we
|
||||
* can get it again quickly when this scope is closed
|
||||
*/
|
||||
Op->Common.Node = Node;
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiDsLoad2EndOp
|
||||
*
|
||||
* PARAMETERS: WalkState - Current state of the parse tree walk
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Ascending callback used during the loading of the namespace,
|
||||
* both control methods and everything else.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiDsLoad2EndOp (
|
||||
ACPI_WALK_STATE *WalkState)
|
||||
{
|
||||
ACPI_PARSE_OBJECT *Op;
|
||||
ACPI_STATUS Status = AE_OK;
|
||||
ACPI_OBJECT_TYPE ObjectType;
|
||||
ACPI_NAMESPACE_NODE *Node;
|
||||
ACPI_PARSE_OBJECT *Arg;
|
||||
ACPI_NAMESPACE_NODE *NewNode;
|
||||
#ifndef ACPI_NO_METHOD_EXECUTION
|
||||
UINT32 i;
|
||||
UINT8 RegionSpace;
|
||||
#endif
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE (DsLoad2EndOp);
|
||||
|
||||
Op = WalkState->Op;
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "Opcode [%s] Op %p State %p\n",
|
||||
WalkState->OpInfo->Name, Op, WalkState));
|
||||
|
||||
/* Check if opcode had an associated namespace object */
|
||||
|
||||
if (!(WalkState->OpInfo->Flags & AML_NSOBJECT))
|
||||
{
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
}
|
||||
|
||||
if (Op->Common.AmlOpcode == AML_SCOPE_OP)
|
||||
{
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
|
||||
"Ending scope Op=%p State=%p\n", Op, WalkState));
|
||||
}
|
||||
|
||||
ObjectType = WalkState->OpInfo->ObjectType;
|
||||
|
||||
/*
|
||||
* Get the Node/name from the earlier lookup
|
||||
* (It was saved in the *op structure)
|
||||
*/
|
||||
Node = Op->Common.Node;
|
||||
|
||||
/*
|
||||
* Put the Node on the object stack (Contains the ACPI Name of
|
||||
* this object)
|
||||
*/
|
||||
WalkState->Operands[0] = (void *) Node;
|
||||
WalkState->NumOperands = 1;
|
||||
|
||||
/* Pop the scope stack */
|
||||
|
||||
if (AcpiNsOpensScope (ObjectType) &&
|
||||
(Op->Common.AmlOpcode != AML_INT_METHODCALL_OP))
|
||||
{
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "(%s) Popping scope for Op %p\n",
|
||||
AcpiUtGetTypeName (ObjectType), Op));
|
||||
|
||||
Status = AcpiDsScopeStackPop (WalkState);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
goto Cleanup;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Named operations are as follows:
|
||||
*
|
||||
* AML_ALIAS
|
||||
* AML_BANKFIELD
|
||||
* AML_CREATEBITFIELD
|
||||
* AML_CREATEBYTEFIELD
|
||||
* AML_CREATEDWORDFIELD
|
||||
* AML_CREATEFIELD
|
||||
* AML_CREATEQWORDFIELD
|
||||
* AML_CREATEWORDFIELD
|
||||
* AML_DATA_REGION
|
||||
* AML_DEVICE
|
||||
* AML_EVENT
|
||||
* AML_FIELD
|
||||
* AML_INDEXFIELD
|
||||
* AML_METHOD
|
||||
* AML_METHODCALL
|
||||
* AML_MUTEX
|
||||
* AML_NAME
|
||||
* AML_NAMEDFIELD
|
||||
* AML_OPREGION
|
||||
* AML_POWERRES
|
||||
* AML_PROCESSOR
|
||||
* AML_SCOPE
|
||||
* AML_THERMALZONE
|
||||
*/
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
|
||||
"Create-Load [%s] State=%p Op=%p NamedObj=%p\n",
|
||||
AcpiPsGetOpcodeName (Op->Common.AmlOpcode), WalkState, Op, Node));
|
||||
|
||||
/* Decode the opcode */
|
||||
|
||||
Arg = Op->Common.Value.Arg;
|
||||
|
||||
switch (WalkState->OpInfo->Type)
|
||||
{
|
||||
#ifndef ACPI_NO_METHOD_EXECUTION
|
||||
|
||||
case AML_TYPE_CREATE_FIELD:
|
||||
/*
|
||||
* Create the field object, but the field buffer and index must
|
||||
* be evaluated later during the execution phase
|
||||
*/
|
||||
Status = AcpiDsCreateBufferField (Op, WalkState);
|
||||
break;
|
||||
|
||||
case AML_TYPE_NAMED_FIELD:
|
||||
/*
|
||||
* If we are executing a method, initialize the field
|
||||
*/
|
||||
if (WalkState->MethodNode)
|
||||
{
|
||||
Status = AcpiDsInitFieldObjects (Op, WalkState);
|
||||
}
|
||||
|
||||
switch (Op->Common.AmlOpcode)
|
||||
{
|
||||
case AML_INDEX_FIELD_OP:
|
||||
|
||||
Status = AcpiDsCreateIndexField (Op, (ACPI_HANDLE) Arg->Common.Node,
|
||||
WalkState);
|
||||
break;
|
||||
|
||||
case AML_BANK_FIELD_OP:
|
||||
|
||||
Status = AcpiDsCreateBankField (Op, Arg->Common.Node, WalkState);
|
||||
break;
|
||||
|
||||
case AML_FIELD_OP:
|
||||
|
||||
Status = AcpiDsCreateField (Op, Arg->Common.Node, WalkState);
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
/* All NAMED_FIELD opcodes must be handled above */
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case AML_TYPE_NAMED_SIMPLE:
|
||||
|
||||
Status = AcpiDsCreateOperands (WalkState, Arg);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
goto Cleanup;
|
||||
}
|
||||
|
||||
switch (Op->Common.AmlOpcode)
|
||||
{
|
||||
case AML_PROCESSOR_OP:
|
||||
|
||||
Status = AcpiExCreateProcessor (WalkState);
|
||||
break;
|
||||
|
||||
case AML_POWER_RES_OP:
|
||||
|
||||
Status = AcpiExCreatePowerResource (WalkState);
|
||||
break;
|
||||
|
||||
case AML_MUTEX_OP:
|
||||
|
||||
Status = AcpiExCreateMutex (WalkState);
|
||||
break;
|
||||
|
||||
case AML_EVENT_OP:
|
||||
|
||||
Status = AcpiExCreateEvent (WalkState);
|
||||
break;
|
||||
|
||||
case AML_ALIAS_OP:
|
||||
|
||||
Status = AcpiExCreateAlias (WalkState);
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
/* Unknown opcode */
|
||||
|
||||
Status = AE_OK;
|
||||
goto Cleanup;
|
||||
}
|
||||
|
||||
/* Delete operands */
|
||||
|
||||
for (i = 1; i < WalkState->NumOperands; i++)
|
||||
{
|
||||
AcpiUtRemoveReference (WalkState->Operands[i]);
|
||||
WalkState->Operands[i] = NULL;
|
||||
}
|
||||
|
||||
break;
|
||||
#endif /* ACPI_NO_METHOD_EXECUTION */
|
||||
|
||||
case AML_TYPE_NAMED_COMPLEX:
|
||||
|
||||
switch (Op->Common.AmlOpcode)
|
||||
{
|
||||
#ifndef ACPI_NO_METHOD_EXECUTION
|
||||
case AML_REGION_OP:
|
||||
case AML_DATA_REGION_OP:
|
||||
|
||||
if (Op->Common.AmlOpcode == AML_REGION_OP)
|
||||
{
|
||||
RegionSpace = (ACPI_ADR_SPACE_TYPE)
|
||||
((Op->Common.Value.Arg)->Common.Value.Integer);
|
||||
}
|
||||
else
|
||||
{
|
||||
RegionSpace = ACPI_ADR_SPACE_DATA_TABLE;
|
||||
}
|
||||
|
||||
/*
|
||||
* The OpRegion is not fully parsed at this time. The only valid
|
||||
* argument is the SpaceId. (We must save the address of the
|
||||
* AML of the address and length operands)
|
||||
*
|
||||
* If we have a valid region, initialize it. The namespace is
|
||||
* unlocked at this point.
|
||||
*
|
||||
* Need to unlock interpreter if it is locked (if we are running
|
||||
* a control method), in order to allow _REG methods to be run
|
||||
* during AcpiEvInitializeRegion.
|
||||
*/
|
||||
if (WalkState->MethodNode)
|
||||
{
|
||||
/*
|
||||
* Executing a method: initialize the region and unlock
|
||||
* the interpreter
|
||||
*/
|
||||
Status = AcpiExCreateRegion (Op->Named.Data, Op->Named.Length,
|
||||
RegionSpace, WalkState);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
AcpiExExitInterpreter ();
|
||||
}
|
||||
|
||||
Status = AcpiEvInitializeRegion (AcpiNsGetAttachedObject (Node),
|
||||
FALSE);
|
||||
if (WalkState->MethodNode)
|
||||
{
|
||||
AcpiExEnterInterpreter ();
|
||||
}
|
||||
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
/*
|
||||
* If AE_NOT_EXIST is returned, it is not fatal
|
||||
* because many regions get created before a handler
|
||||
* is installed for said region.
|
||||
*/
|
||||
if (AE_NOT_EXIST == Status)
|
||||
{
|
||||
Status = AE_OK;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case AML_NAME_OP:
|
||||
|
||||
Status = AcpiDsCreateNode (WalkState, Node, Op);
|
||||
break;
|
||||
|
||||
case AML_METHOD_OP:
|
||||
/*
|
||||
* MethodOp PkgLength NameString MethodFlags TermList
|
||||
*
|
||||
* Note: We must create the method node/object pair as soon as we
|
||||
* see the method declaration. This allows later pass1 parsing
|
||||
* of invocations of the method (need to know the number of
|
||||
* arguments.)
|
||||
*/
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
|
||||
"LOADING-Method: State=%p Op=%p NamedObj=%p\n",
|
||||
WalkState, Op, Op->Named.Node));
|
||||
|
||||
if (!AcpiNsGetAttachedObject (Op->Named.Node))
|
||||
{
|
||||
WalkState->Operands[0] = ACPI_CAST_PTR (void, Op->Named.Node);
|
||||
WalkState->NumOperands = 1;
|
||||
|
||||
Status = AcpiDsCreateOperands (WalkState, Op->Common.Value.Arg);
|
||||
if (ACPI_SUCCESS (Status))
|
||||
{
|
||||
Status = AcpiExCreateMethod (Op->Named.Data,
|
||||
Op->Named.Length, WalkState);
|
||||
}
|
||||
WalkState->Operands[0] = NULL;
|
||||
WalkState->NumOperands = 0;
|
||||
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
#endif /* ACPI_NO_METHOD_EXECUTION */
|
||||
|
||||
default:
|
||||
|
||||
/* All NAMED_COMPLEX opcodes must be handled above */
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
case AML_CLASS_INTERNAL:
|
||||
|
||||
/* case AML_INT_NAMEPATH_OP: */
|
||||
break;
|
||||
|
||||
case AML_CLASS_METHOD_CALL:
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
|
||||
"RESOLVING-MethodCall: State=%p Op=%p NamedObj=%p\n",
|
||||
WalkState, Op, Node));
|
||||
|
||||
/*
|
||||
* Lookup the method name and save the Node
|
||||
*/
|
||||
Status = AcpiNsLookup (WalkState->ScopeInfo, Arg->Common.Value.String,
|
||||
ACPI_TYPE_ANY, ACPI_IMODE_LOAD_PASS2,
|
||||
ACPI_NS_SEARCH_PARENT | ACPI_NS_DONT_OPEN_SCOPE,
|
||||
WalkState, &(NewNode));
|
||||
if (ACPI_SUCCESS (Status))
|
||||
{
|
||||
/*
|
||||
* Make sure that what we found is indeed a method
|
||||
* We didn't search for a method on purpose, to see if the name
|
||||
* would resolve
|
||||
*/
|
||||
if (NewNode->Type != ACPI_TYPE_METHOD)
|
||||
{
|
||||
Status = AE_AML_OPERAND_TYPE;
|
||||
}
|
||||
|
||||
/* We could put the returned object (Node) on the object stack for
|
||||
* later, but for now, we will put it in the "op" object that the
|
||||
* parser uses, so we can get it again at the end of this scope
|
||||
*/
|
||||
Op->Common.Node = NewNode;
|
||||
}
|
||||
else
|
||||
{
|
||||
ACPI_ERROR_NAMESPACE (Arg->Common.Value.String, Status);
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
Cleanup:
|
||||
|
||||
/* Remove the Node pushed at the very beginning */
|
||||
|
||||
WalkState->Operands[0] = NULL;
|
||||
WalkState->NumOperands = 0;
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
@@ -4,116 +4,42 @@
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
* 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.
|
||||
*
|
||||
* 2.1. This is your license from Intel Corp. under its intellectual property
|
||||
* rights. You may have additional license terms from the party that provided
|
||||
* you this software, covering your right to use that party's intellectual
|
||||
* property rights.
|
||||
* 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.
|
||||
*
|
||||
* 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
|
||||
* copy of the source code appearing in this file ("Covered Code") an
|
||||
* irrevocable, perpetual, worldwide license under Intel's copyrights in the
|
||||
* base code distributed originally by Intel ("Original Intel Code") to copy,
|
||||
* make derivatives, distribute, use and display any portion of the Covered
|
||||
* Code in any form, with the right to sublicense such rights; and
|
||||
*
|
||||
* 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
|
||||
* license (with the right to sublicense), under only those claims of Intel
|
||||
* patents that are infringed by the Original Intel Code, to make, use, sell,
|
||||
* offer to sell, and import the Covered Code and derivative works thereof
|
||||
* solely to the minimum extent necessary to exercise the above copyright
|
||||
* license, and in no event shall the patent license extend to any additions
|
||||
* to or modifications of the Original Intel Code. No other license or right
|
||||
* is granted directly or by implication, estoppel or otherwise;
|
||||
*
|
||||
* The above copyright and patent license is granted only if the following
|
||||
* conditions are met:
|
||||
*
|
||||
* 3. Conditions
|
||||
*
|
||||
* 3.1. Redistribution of Source with Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification with rights to further distribute source must include
|
||||
* the above Copyright Notice, the above License, this list of Conditions,
|
||||
* and the following Disclaimer and Export Compliance provision. In addition,
|
||||
* Licensee must cause all Covered Code to which Licensee contributes to
|
||||
* contain a file documenting the changes Licensee made to create that Covered
|
||||
* Code and the date of any change. Licensee must include in that file the
|
||||
* documentation of any changes made by any predecessor Licensee. Licensee
|
||||
* must include a prominent statement that the modification is derived,
|
||||
* directly or indirectly, from Original Intel Code.
|
||||
*
|
||||
* 3.2. Redistribution of Source with no Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification without rights to further distribute source must
|
||||
* include the following Disclaimer and Export Compliance provision in the
|
||||
* documentation and/or other materials provided with distribution. In
|
||||
* addition, Licensee may not authorize further sublicense of source of any
|
||||
* portion of the Covered Code, and must include terms to the effect that the
|
||||
* license from Licensee to its licensee is limited to the intellectual
|
||||
* property embodied in the software Licensee provides to its licensee, and
|
||||
* not to intellectual property embodied in modifications its licensee may
|
||||
* make.
|
||||
*
|
||||
* 3.3. Redistribution of Executable. Redistribution in executable form of any
|
||||
* substantial portion of the Covered Code or modification must reproduce the
|
||||
* above Copyright Notice, and the following Disclaimer and Export Compliance
|
||||
* provision in the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3.4. Intel retains all right, title, and interest in and to the Original
|
||||
* Intel Code.
|
||||
*
|
||||
* 3.5. Neither the name Intel nor any other trademark owned or controlled by
|
||||
* Intel shall be used in advertising or otherwise to promote the sale, use or
|
||||
* other dealings in products derived from or relating to the Covered Code
|
||||
* without prior written authorization from Intel.
|
||||
*
|
||||
* 4. Disclaimer and Export Compliance
|
||||
*
|
||||
* 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
|
||||
* HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
|
||||
* IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
|
||||
* INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
|
||||
* UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
|
||||
* PARTICULAR PURPOSE.
|
||||
*
|
||||
* 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
|
||||
* OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
|
||||
* COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
|
||||
* SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
|
||||
* CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
|
||||
* HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
|
||||
* SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
|
||||
* LIMITED REMEDY.
|
||||
*
|
||||
* 4.3. Licensee shall not export, either directly or indirectly, any of this
|
||||
* software or system incorporating such software without first obtaining any
|
||||
* required license or other approval from the U. S. Department of Commerce or
|
||||
* any other agency or department of the United States Government. In the
|
||||
* event Licensee exports any such software from the United States or
|
||||
* re-exports any such software from a foreign destination, Licensee shall
|
||||
* ensure that the distribution and export/re-export of the software is in
|
||||
* compliance with all laws, regulations, orders, or other restrictions of the
|
||||
* U.S. Export Administration Regulations. Licensee agrees that neither it nor
|
||||
* any of its subsidiaries will export/re-export any technical data, process,
|
||||
* software, or service, directly or indirectly, to any country for which the
|
||||
* United States government or any agency thereof requires an export license,
|
||||
* other governmental approval, or letter of assurance, without first obtaining
|
||||
* such license, approval or letter.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
#define __DSWSCOPE_C__
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#include "acpi.h"
|
||||
#include "accommon.h"
|
||||
@@ -307,5 +233,3 @@ AcpiDsScopeStackPop (
|
||||
AcpiUtDeleteGenericState (ScopeInfo);
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -4,117 +4,42 @@
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
* 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.
|
||||
*
|
||||
* 2.1. This is your license from Intel Corp. under its intellectual property
|
||||
* rights. You may have additional license terms from the party that provided
|
||||
* you this software, covering your right to use that party's intellectual
|
||||
* property rights.
|
||||
* 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.
|
||||
*
|
||||
* 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
|
||||
* copy of the source code appearing in this file ("Covered Code") an
|
||||
* irrevocable, perpetual, worldwide license under Intel's copyrights in the
|
||||
* base code distributed originally by Intel ("Original Intel Code") to copy,
|
||||
* make derivatives, distribute, use and display any portion of the Covered
|
||||
* Code in any form, with the right to sublicense such rights; and
|
||||
*
|
||||
* 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
|
||||
* license (with the right to sublicense), under only those claims of Intel
|
||||
* patents that are infringed by the Original Intel Code, to make, use, sell,
|
||||
* offer to sell, and import the Covered Code and derivative works thereof
|
||||
* solely to the minimum extent necessary to exercise the above copyright
|
||||
* license, and in no event shall the patent license extend to any additions
|
||||
* to or modifications of the Original Intel Code. No other license or right
|
||||
* is granted directly or by implication, estoppel or otherwise;
|
||||
*
|
||||
* The above copyright and patent license is granted only if the following
|
||||
* conditions are met:
|
||||
*
|
||||
* 3. Conditions
|
||||
*
|
||||
* 3.1. Redistribution of Source with Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification with rights to further distribute source must include
|
||||
* the above Copyright Notice, the above License, this list of Conditions,
|
||||
* and the following Disclaimer and Export Compliance provision. In addition,
|
||||
* Licensee must cause all Covered Code to which Licensee contributes to
|
||||
* contain a file documenting the changes Licensee made to create that Covered
|
||||
* Code and the date of any change. Licensee must include in that file the
|
||||
* documentation of any changes made by any predecessor Licensee. Licensee
|
||||
* must include a prominent statement that the modification is derived,
|
||||
* directly or indirectly, from Original Intel Code.
|
||||
*
|
||||
* 3.2. Redistribution of Source with no Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification without rights to further distribute source must
|
||||
* include the following Disclaimer and Export Compliance provision in the
|
||||
* documentation and/or other materials provided with distribution. In
|
||||
* addition, Licensee may not authorize further sublicense of source of any
|
||||
* portion of the Covered Code, and must include terms to the effect that the
|
||||
* license from Licensee to its licensee is limited to the intellectual
|
||||
* property embodied in the software Licensee provides to its licensee, and
|
||||
* not to intellectual property embodied in modifications its licensee may
|
||||
* make.
|
||||
*
|
||||
* 3.3. Redistribution of Executable. Redistribution in executable form of any
|
||||
* substantial portion of the Covered Code or modification must reproduce the
|
||||
* above Copyright Notice, and the following Disclaimer and Export Compliance
|
||||
* provision in the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3.4. Intel retains all right, title, and interest in and to the Original
|
||||
* Intel Code.
|
||||
*
|
||||
* 3.5. Neither the name Intel nor any other trademark owned or controlled by
|
||||
* Intel shall be used in advertising or otherwise to promote the sale, use or
|
||||
* other dealings in products derived from or relating to the Covered Code
|
||||
* without prior written authorization from Intel.
|
||||
*
|
||||
* 4. Disclaimer and Export Compliance
|
||||
*
|
||||
* 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
|
||||
* HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
|
||||
* IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
|
||||
* INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
|
||||
* UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
|
||||
* PARTICULAR PURPOSE.
|
||||
*
|
||||
* 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
|
||||
* OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
|
||||
* COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
|
||||
* SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
|
||||
* CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
|
||||
* HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
|
||||
* SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
|
||||
* LIMITED REMEDY.
|
||||
*
|
||||
* 4.3. Licensee shall not export, either directly or indirectly, any of this
|
||||
* software or system incorporating such software without first obtaining any
|
||||
* required license or other approval from the U. S. Department of Commerce or
|
||||
* any other agency or department of the United States Government. In the
|
||||
* event Licensee exports any such software from the United States or
|
||||
* re-exports any such software from a foreign destination, Licensee shall
|
||||
* ensure that the distribution and export/re-export of the software is in
|
||||
* compliance with all laws, regulations, orders, or other restrictions of the
|
||||
* U.S. Export Administration Regulations. Licensee agrees that neither it nor
|
||||
* any of its subsidiaries will export/re-export any technical data, process,
|
||||
* software, or service, directly or indirectly, to any country for which the
|
||||
* United States government or any agency thereof requires an export license,
|
||||
* other governmental approval, or letter of assurance, without first obtaining
|
||||
* such license, approval or letter.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
|
||||
#define __DSWSTATE_C__
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#include "acpi.h"
|
||||
#include "accommon.h"
|
||||
@@ -457,7 +382,7 @@ AcpiDsObjStackPush (
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Pop this walk's object stack. Objects on the stack are NOT
|
||||
* DESCRIPTION: Pop this walk's object stack. Objects on the stack are NOT
|
||||
* deleted by this routine.
|
||||
*
|
||||
******************************************************************************/
|
||||
@@ -621,7 +546,7 @@ AcpiDsPushWalkState (
|
||||
* RETURN: A WalkState object popped from the thread's stack
|
||||
*
|
||||
* DESCRIPTION: Remove and return the walkstate object that is at the head of
|
||||
* the walk stack for the given walk list. NULL indicates that
|
||||
* the walk stack for the given walk list. NULL indicates that
|
||||
* the list is empty.
|
||||
*
|
||||
******************************************************************************/
|
||||
@@ -666,7 +591,7 @@ AcpiDsPopWalkState (
|
||||
*
|
||||
* RETURN: Pointer to the new walk state.
|
||||
*
|
||||
* DESCRIPTION: Allocate and initialize a new walk state. The current walk
|
||||
* DESCRIPTION: Allocate and initialize a new walk state. The current walk
|
||||
* state is set to this new state.
|
||||
*
|
||||
******************************************************************************/
|
||||
@@ -802,7 +727,7 @@ AcpiDsInitAmlWalk (
|
||||
/*
|
||||
* Setup the current scope.
|
||||
* Find a Named Op that has a namespace node associated with it.
|
||||
* search upwards from this Op. Current scope is the first
|
||||
* search upwards from this Op. Current scope is the first
|
||||
* Op with a namespace node.
|
||||
*/
|
||||
ExtraOp = ParserState->StartOp;
|
||||
@@ -862,14 +787,14 @@ AcpiDsDeleteWalkState (
|
||||
|
||||
if (!WalkState)
|
||||
{
|
||||
return;
|
||||
return_VOID;
|
||||
}
|
||||
|
||||
if (WalkState->DescriptorType != ACPI_DESC_TYPE_WALK)
|
||||
{
|
||||
ACPI_ERROR ((AE_INFO, "%p is not a valid walk state",
|
||||
WalkState));
|
||||
return;
|
||||
return_VOID;
|
||||
}
|
||||
|
||||
/* There should not be any open scopes */
|
||||
@@ -914,5 +839,3 @@ AcpiDsDeleteWalkState (
|
||||
ACPI_FREE (WalkState);
|
||||
return_VOID;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -4,114 +4,42 @@
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
* 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.
|
||||
*
|
||||
* 2.1. This is your license from Intel Corp. under its intellectual property
|
||||
* rights. You may have additional license terms from the party that provided
|
||||
* you this software, covering your right to use that party's intellectual
|
||||
* property rights.
|
||||
* 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.
|
||||
*
|
||||
* 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
|
||||
* copy of the source code appearing in this file ("Covered Code") an
|
||||
* irrevocable, perpetual, worldwide license under Intel's copyrights in the
|
||||
* base code distributed originally by Intel ("Original Intel Code") to copy,
|
||||
* make derivatives, distribute, use and display any portion of the Covered
|
||||
* Code in any form, with the right to sublicense such rights; and
|
||||
*
|
||||
* 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
|
||||
* license (with the right to sublicense), under only those claims of Intel
|
||||
* patents that are infringed by the Original Intel Code, to make, use, sell,
|
||||
* offer to sell, and import the Covered Code and derivative works thereof
|
||||
* solely to the minimum extent necessary to exercise the above copyright
|
||||
* license, and in no event shall the patent license extend to any additions
|
||||
* to or modifications of the Original Intel Code. No other license or right
|
||||
* is granted directly or by implication, estoppel or otherwise;
|
||||
*
|
||||
* The above copyright and patent license is granted only if the following
|
||||
* conditions are met:
|
||||
*
|
||||
* 3. Conditions
|
||||
*
|
||||
* 3.1. Redistribution of Source with Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification with rights to further distribute source must include
|
||||
* the above Copyright Notice, the above License, this list of Conditions,
|
||||
* and the following Disclaimer and Export Compliance provision. In addition,
|
||||
* Licensee must cause all Covered Code to which Licensee contributes to
|
||||
* contain a file documenting the changes Licensee made to create that Covered
|
||||
* Code and the date of any change. Licensee must include in that file the
|
||||
* documentation of any changes made by any predecessor Licensee. Licensee
|
||||
* must include a prominent statement that the modification is derived,
|
||||
* directly or indirectly, from Original Intel Code.
|
||||
*
|
||||
* 3.2. Redistribution of Source with no Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification without rights to further distribute source must
|
||||
* include the following Disclaimer and Export Compliance provision in the
|
||||
* documentation and/or other materials provided with distribution. In
|
||||
* addition, Licensee may not authorize further sublicense of source of any
|
||||
* portion of the Covered Code, and must include terms to the effect that the
|
||||
* license from Licensee to its licensee is limited to the intellectual
|
||||
* property embodied in the software Licensee provides to its licensee, and
|
||||
* not to intellectual property embodied in modifications its licensee may
|
||||
* make.
|
||||
*
|
||||
* 3.3. Redistribution of Executable. Redistribution in executable form of any
|
||||
* substantial portion of the Covered Code or modification must reproduce the
|
||||
* above Copyright Notice, and the following Disclaimer and Export Compliance
|
||||
* provision in the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3.4. Intel retains all right, title, and interest in and to the Original
|
||||
* Intel Code.
|
||||
*
|
||||
* 3.5. Neither the name Intel nor any other trademark owned or controlled by
|
||||
* Intel shall be used in advertising or otherwise to promote the sale, use or
|
||||
* other dealings in products derived from or relating to the Covered Code
|
||||
* without prior written authorization from Intel.
|
||||
*
|
||||
* 4. Disclaimer and Export Compliance
|
||||
*
|
||||
* 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
|
||||
* HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
|
||||
* IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
|
||||
* INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
|
||||
* UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
|
||||
* PARTICULAR PURPOSE.
|
||||
*
|
||||
* 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
|
||||
* OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
|
||||
* COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
|
||||
* SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
|
||||
* CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
|
||||
* HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
|
||||
* SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
|
||||
* LIMITED REMEDY.
|
||||
*
|
||||
* 4.3. Licensee shall not export, either directly or indirectly, any of this
|
||||
* software or system incorporating such software without first obtaining any
|
||||
* required license or other approval from the U. S. Department of Commerce or
|
||||
* any other agency or department of the United States Government. In the
|
||||
* event Licensee exports any such software from the United States or
|
||||
* re-exports any such software from a foreign destination, Licensee shall
|
||||
* ensure that the distribution and export/re-export of the software is in
|
||||
* compliance with all laws, regulations, orders, or other restrictions of the
|
||||
* U.S. Export Administration Regulations. Licensee agrees that neither it nor
|
||||
* any of its subsidiaries will export/re-export any technical data, process,
|
||||
* software, or service, directly or indirectly, to any country for which the
|
||||
* United States government or any agency thereof requires an export license,
|
||||
* other governmental approval, or letter of assurance, without first obtaining
|
||||
* such license, approval or letter.
|
||||
*
|
||||
*****************************************************************************/
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#include "acpi.h"
|
||||
#include "accommon.h"
|
||||
@@ -120,6 +48,8 @@
|
||||
#define _COMPONENT ACPI_EVENTS
|
||||
ACPI_MODULE_NAME ("evevent")
|
||||
|
||||
#if (!ACPI_REDUCED_HARDWARE) /* Entire module */
|
||||
|
||||
/* Local prototypes */
|
||||
|
||||
static ACPI_STATUS
|
||||
@@ -153,6 +83,13 @@ AcpiEvInitializeEvents (
|
||||
ACPI_FUNCTION_TRACE (EvInitializeEvents);
|
||||
|
||||
|
||||
/* If Hardware Reduced flag is set, there are no fixed events */
|
||||
|
||||
if (AcpiGbl_ReducedHardware)
|
||||
{
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
}
|
||||
|
||||
/*
|
||||
* Initialize the Fixed and General Purpose Events. This is done prior to
|
||||
* enabling SCIs to prevent interrupts from occurring before the handlers
|
||||
@@ -178,54 +115,6 @@ AcpiEvInitializeEvents (
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiEvInstallFadtGpes
|
||||
*
|
||||
* PARAMETERS: None
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Completes initialization of the FADT-defined GPE blocks
|
||||
* (0 and 1). This causes the _PRW methods to be run, so the HW
|
||||
* must be fully initialized at this point, including global lock
|
||||
* support.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiEvInstallFadtGpes (
|
||||
void)
|
||||
{
|
||||
ACPI_STATUS Status;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE (EvInstallFadtGpes);
|
||||
|
||||
|
||||
/* Namespace must be locked */
|
||||
|
||||
Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return (Status);
|
||||
}
|
||||
|
||||
/* FADT GPE Block 0 */
|
||||
|
||||
(void) AcpiEvInitializeGpeBlock (
|
||||
AcpiGbl_FadtGpeDevice, AcpiGbl_GpeFadtBlocks[0]);
|
||||
|
||||
/* FADT GPE Block 1 */
|
||||
|
||||
(void) AcpiEvInitializeGpeBlock (
|
||||
AcpiGbl_FadtGpeDevice, AcpiGbl_GpeFadtBlocks[1]);
|
||||
|
||||
(void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiEvInstallXruptHandlers
|
||||
@@ -248,6 +137,13 @@ AcpiEvInstallXruptHandlers (
|
||||
ACPI_FUNCTION_TRACE (EvInstallXruptHandlers);
|
||||
|
||||
|
||||
/* If Hardware Reduced flag is set, there is no ACPI h/w */
|
||||
|
||||
if (AcpiGbl_ReducedHardware)
|
||||
{
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
}
|
||||
|
||||
/* Install the SCI handler */
|
||||
|
||||
Status = AcpiEvInstallSciHandler ();
|
||||
@@ -366,9 +262,17 @@ AcpiEvFixedEventDetect (
|
||||
if ((FixedStatus & AcpiGbl_FixedEventInfo[i].StatusBitMask) &&
|
||||
(FixedEnable & AcpiGbl_FixedEventInfo[i].EnableBitMask))
|
||||
{
|
||||
/* Found an active (signalled) event */
|
||||
|
||||
/*
|
||||
* Found an active (signalled) event. Invoke global event
|
||||
* handler if present.
|
||||
*/
|
||||
AcpiFixedEventCount[i]++;
|
||||
if (AcpiGbl_GlobalEventHandler)
|
||||
{
|
||||
AcpiGbl_GlobalEventHandler (ACPI_EVENT_TYPE_FIXED, NULL,
|
||||
i, AcpiGbl_GlobalEventHandlerContext);
|
||||
}
|
||||
|
||||
IntStatus |= AcpiEvFixedEventDispatch (i);
|
||||
}
|
||||
}
|
||||
@@ -387,6 +291,8 @@ AcpiEvFixedEventDetect (
|
||||
*
|
||||
* DESCRIPTION: Clears the status bit for the requested event, calls the
|
||||
* handler that previously registered for the event.
|
||||
* NOTE: If there is no handler for the event, the event is
|
||||
* disabled to prevent further interrupts.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
@@ -405,18 +311,18 @@ AcpiEvFixedEventDispatch (
|
||||
ACPI_CLEAR_STATUS);
|
||||
|
||||
/*
|
||||
* Make sure we've got a handler. If not, report an error. The event is
|
||||
* disabled to prevent further interrupts.
|
||||
* Make sure that a handler exists. If not, report an error
|
||||
* and disable the event to prevent further interrupts.
|
||||
*/
|
||||
if (NULL == AcpiGbl_FixedEventHandlers[Event].Handler)
|
||||
if (!AcpiGbl_FixedEventHandlers[Event].Handler)
|
||||
{
|
||||
(void) AcpiWriteBitRegister (
|
||||
AcpiGbl_FixedEventInfo[Event].EnableRegisterId,
|
||||
ACPI_DISABLE_EVENT);
|
||||
|
||||
ACPI_ERROR ((AE_INFO,
|
||||
"No installed handler for fixed event [0x%08X]",
|
||||
Event));
|
||||
"No installed handler for fixed event - %s (%u), disabling",
|
||||
AcpiUtGetEventName (Event), Event));
|
||||
|
||||
return (ACPI_INTERRUPT_NOT_HANDLED);
|
||||
}
|
||||
@@ -427,4 +333,4 @@ AcpiEvFixedEventDispatch (
|
||||
AcpiGbl_FixedEventHandlers[Event].Context));
|
||||
}
|
||||
|
||||
|
||||
#endif /* !ACPI_REDUCED_HARDWARE */
|
||||
|
||||
378
minix/drivers/power/acpi/events/evglock.c
Normal file
378
minix/drivers/power/acpi/events/evglock.c
Normal file
@@ -0,0 +1,378 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Module Name: evglock - Global Lock support
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, 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.
|
||||
*/
|
||||
|
||||
#include "acpi.h"
|
||||
#include "accommon.h"
|
||||
#include "acevents.h"
|
||||
#include "acinterp.h"
|
||||
|
||||
#define _COMPONENT ACPI_EVENTS
|
||||
ACPI_MODULE_NAME ("evglock")
|
||||
|
||||
#if (!ACPI_REDUCED_HARDWARE) /* Entire module */
|
||||
|
||||
/* Local prototypes */
|
||||
|
||||
static UINT32
|
||||
AcpiEvGlobalLockHandler (
|
||||
void *Context);
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiEvInitGlobalLockHandler
|
||||
*
|
||||
* PARAMETERS: None
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Install a handler for the global lock release event
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiEvInitGlobalLockHandler (
|
||||
void)
|
||||
{
|
||||
ACPI_STATUS Status;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE (EvInitGlobalLockHandler);
|
||||
|
||||
|
||||
/* If Hardware Reduced flag is set, there is no global lock */
|
||||
|
||||
if (AcpiGbl_ReducedHardware)
|
||||
{
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
}
|
||||
|
||||
/* Attempt installation of the global lock handler */
|
||||
|
||||
Status = AcpiInstallFixedEventHandler (ACPI_EVENT_GLOBAL,
|
||||
AcpiEvGlobalLockHandler, NULL);
|
||||
|
||||
/*
|
||||
* If the global lock does not exist on this platform, the attempt to
|
||||
* enable GBL_STATUS will fail (the GBL_ENABLE bit will not stick).
|
||||
* Map to AE_OK, but mark global lock as not present. Any attempt to
|
||||
* actually use the global lock will be flagged with an error.
|
||||
*/
|
||||
AcpiGbl_GlobalLockPresent = FALSE;
|
||||
if (Status == AE_NO_HARDWARE_RESPONSE)
|
||||
{
|
||||
ACPI_ERROR ((AE_INFO,
|
||||
"No response from Global Lock hardware, disabling lock"));
|
||||
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
}
|
||||
|
||||
Status = AcpiOsCreateLock (&AcpiGbl_GlobalLockPendingLock);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
AcpiGbl_GlobalLockPending = FALSE;
|
||||
AcpiGbl_GlobalLockPresent = TRUE;
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiEvRemoveGlobalLockHandler
|
||||
*
|
||||
* PARAMETERS: None
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Remove the handler for the Global Lock
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiEvRemoveGlobalLockHandler (
|
||||
void)
|
||||
{
|
||||
ACPI_STATUS Status;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE (EvRemoveGlobalLockHandler);
|
||||
|
||||
AcpiGbl_GlobalLockPresent = FALSE;
|
||||
Status = AcpiRemoveFixedEventHandler (ACPI_EVENT_GLOBAL,
|
||||
AcpiEvGlobalLockHandler);
|
||||
|
||||
AcpiOsDeleteLock (AcpiGbl_GlobalLockPendingLock);
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiEvGlobalLockHandler
|
||||
*
|
||||
* PARAMETERS: Context - From thread interface, not used
|
||||
*
|
||||
* RETURN: ACPI_INTERRUPT_HANDLED
|
||||
*
|
||||
* DESCRIPTION: Invoked directly from the SCI handler when a global lock
|
||||
* release interrupt occurs. If there is actually a pending
|
||||
* request for the lock, signal the waiting thread.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
static UINT32
|
||||
AcpiEvGlobalLockHandler (
|
||||
void *Context)
|
||||
{
|
||||
ACPI_STATUS Status;
|
||||
ACPI_CPU_FLAGS Flags;
|
||||
|
||||
|
||||
Flags = AcpiOsAcquireLock (AcpiGbl_GlobalLockPendingLock);
|
||||
|
||||
/*
|
||||
* If a request for the global lock is not actually pending,
|
||||
* we are done. This handles "spurious" global lock interrupts
|
||||
* which are possible (and have been seen) with bad BIOSs.
|
||||
*/
|
||||
if (!AcpiGbl_GlobalLockPending)
|
||||
{
|
||||
goto CleanupAndExit;
|
||||
}
|
||||
|
||||
/*
|
||||
* Send a unit to the global lock semaphore. The actual acquisition
|
||||
* of the global lock will be performed by the waiting thread.
|
||||
*/
|
||||
Status = AcpiOsSignalSemaphore (AcpiGbl_GlobalLockSemaphore, 1);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
ACPI_ERROR ((AE_INFO, "Could not signal Global Lock semaphore"));
|
||||
}
|
||||
|
||||
AcpiGbl_GlobalLockPending = FALSE;
|
||||
|
||||
|
||||
CleanupAndExit:
|
||||
|
||||
AcpiOsReleaseLock (AcpiGbl_GlobalLockPendingLock, Flags);
|
||||
return (ACPI_INTERRUPT_HANDLED);
|
||||
}
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiEvAcquireGlobalLock
|
||||
*
|
||||
* PARAMETERS: Timeout - Max time to wait for the lock, in millisec.
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Attempt to gain ownership of the Global Lock.
|
||||
*
|
||||
* MUTEX: Interpreter must be locked
|
||||
*
|
||||
* Note: The original implementation allowed multiple threads to "acquire" the
|
||||
* Global Lock, and the OS would hold the lock until the last thread had
|
||||
* released it. However, this could potentially starve the BIOS out of the
|
||||
* lock, especially in the case where there is a tight handshake between the
|
||||
* Embedded Controller driver and the BIOS. Therefore, this implementation
|
||||
* allows only one thread to acquire the HW Global Lock at a time, and makes
|
||||
* the global lock appear as a standard mutex on the OS side.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiEvAcquireGlobalLock (
|
||||
UINT16 Timeout)
|
||||
{
|
||||
ACPI_CPU_FLAGS Flags;
|
||||
ACPI_STATUS Status;
|
||||
BOOLEAN Acquired = FALSE;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE (EvAcquireGlobalLock);
|
||||
|
||||
|
||||
/*
|
||||
* Only one thread can acquire the GL at a time, the GlobalLockMutex
|
||||
* enforces this. This interface releases the interpreter if we must wait.
|
||||
*/
|
||||
Status = AcpiExSystemWaitMutex (AcpiGbl_GlobalLockMutex->Mutex.OsMutex,
|
||||
Timeout);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
/*
|
||||
* Update the global lock handle and check for wraparound. The handle is
|
||||
* only used for the external global lock interfaces, but it is updated
|
||||
* here to properly handle the case where a single thread may acquire the
|
||||
* lock via both the AML and the AcpiAcquireGlobalLock interfaces. The
|
||||
* handle is therefore updated on the first acquire from a given thread
|
||||
* regardless of where the acquisition request originated.
|
||||
*/
|
||||
AcpiGbl_GlobalLockHandle++;
|
||||
if (AcpiGbl_GlobalLockHandle == 0)
|
||||
{
|
||||
AcpiGbl_GlobalLockHandle = 1;
|
||||
}
|
||||
|
||||
/*
|
||||
* Make sure that a global lock actually exists. If not, just
|
||||
* treat the lock as a standard mutex.
|
||||
*/
|
||||
if (!AcpiGbl_GlobalLockPresent)
|
||||
{
|
||||
AcpiGbl_GlobalLockAcquired = TRUE;
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
}
|
||||
|
||||
Flags = AcpiOsAcquireLock (AcpiGbl_GlobalLockPendingLock);
|
||||
|
||||
do
|
||||
{
|
||||
/* Attempt to acquire the actual hardware lock */
|
||||
|
||||
ACPI_ACQUIRE_GLOBAL_LOCK (AcpiGbl_FACS, Acquired);
|
||||
if (Acquired)
|
||||
{
|
||||
AcpiGbl_GlobalLockAcquired = TRUE;
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
|
||||
"Acquired hardware Global Lock\n"));
|
||||
break;
|
||||
}
|
||||
|
||||
/*
|
||||
* Did not get the lock. The pending bit was set above, and
|
||||
* we must now wait until we receive the global lock
|
||||
* released interrupt.
|
||||
*/
|
||||
AcpiGbl_GlobalLockPending = TRUE;
|
||||
AcpiOsReleaseLock (AcpiGbl_GlobalLockPendingLock, Flags);
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
|
||||
"Waiting for hardware Global Lock\n"));
|
||||
|
||||
/*
|
||||
* Wait for handshake with the global lock interrupt handler.
|
||||
* This interface releases the interpreter if we must wait.
|
||||
*/
|
||||
Status = AcpiExSystemWaitSemaphore (AcpiGbl_GlobalLockSemaphore,
|
||||
ACPI_WAIT_FOREVER);
|
||||
|
||||
Flags = AcpiOsAcquireLock (AcpiGbl_GlobalLockPendingLock);
|
||||
|
||||
} while (ACPI_SUCCESS (Status));
|
||||
|
||||
AcpiGbl_GlobalLockPending = FALSE;
|
||||
AcpiOsReleaseLock (AcpiGbl_GlobalLockPendingLock, Flags);
|
||||
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiEvReleaseGlobalLock
|
||||
*
|
||||
* PARAMETERS: None
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Releases ownership of the Global Lock.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiEvReleaseGlobalLock (
|
||||
void)
|
||||
{
|
||||
BOOLEAN Pending = FALSE;
|
||||
ACPI_STATUS Status = AE_OK;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE (EvReleaseGlobalLock);
|
||||
|
||||
|
||||
/* Lock must be already acquired */
|
||||
|
||||
if (!AcpiGbl_GlobalLockAcquired)
|
||||
{
|
||||
ACPI_WARNING ((AE_INFO,
|
||||
"Cannot release the ACPI Global Lock, it has not been acquired"));
|
||||
return_ACPI_STATUS (AE_NOT_ACQUIRED);
|
||||
}
|
||||
|
||||
if (AcpiGbl_GlobalLockPresent)
|
||||
{
|
||||
/* Allow any thread to release the lock */
|
||||
|
||||
ACPI_RELEASE_GLOBAL_LOCK (AcpiGbl_FACS, Pending);
|
||||
|
||||
/*
|
||||
* If the pending bit was set, we must write GBL_RLS to the control
|
||||
* register
|
||||
*/
|
||||
if (Pending)
|
||||
{
|
||||
Status = AcpiWriteBitRegister (
|
||||
ACPI_BITREG_GLOBAL_LOCK_RELEASE, ACPI_ENABLE_EVENT);
|
||||
}
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Released hardware Global Lock\n"));
|
||||
}
|
||||
|
||||
AcpiGbl_GlobalLockAcquired = FALSE;
|
||||
|
||||
/* Release the local GL mutex */
|
||||
|
||||
AcpiOsReleaseMutex (AcpiGbl_GlobalLockMutex->Mutex.OsMutex);
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
#endif /* !ACPI_REDUCED_HARDWARE */
|
||||
@@ -4,114 +4,42 @@
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
* 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.
|
||||
*
|
||||
* 2.1. This is your license from Intel Corp. under its intellectual property
|
||||
* rights. You may have additional license terms from the party that provided
|
||||
* you this software, covering your right to use that party's intellectual
|
||||
* property rights.
|
||||
* 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.
|
||||
*
|
||||
* 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
|
||||
* copy of the source code appearing in this file ("Covered Code") an
|
||||
* irrevocable, perpetual, worldwide license under Intel's copyrights in the
|
||||
* base code distributed originally by Intel ("Original Intel Code") to copy,
|
||||
* make derivatives, distribute, use and display any portion of the Covered
|
||||
* Code in any form, with the right to sublicense such rights; and
|
||||
*
|
||||
* 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
|
||||
* license (with the right to sublicense), under only those claims of Intel
|
||||
* patents that are infringed by the Original Intel Code, to make, use, sell,
|
||||
* offer to sell, and import the Covered Code and derivative works thereof
|
||||
* solely to the minimum extent necessary to exercise the above copyright
|
||||
* license, and in no event shall the patent license extend to any additions
|
||||
* to or modifications of the Original Intel Code. No other license or right
|
||||
* is granted directly or by implication, estoppel or otherwise;
|
||||
*
|
||||
* The above copyright and patent license is granted only if the following
|
||||
* conditions are met:
|
||||
*
|
||||
* 3. Conditions
|
||||
*
|
||||
* 3.1. Redistribution of Source with Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification with rights to further distribute source must include
|
||||
* the above Copyright Notice, the above License, this list of Conditions,
|
||||
* and the following Disclaimer and Export Compliance provision. In addition,
|
||||
* Licensee must cause all Covered Code to which Licensee contributes to
|
||||
* contain a file documenting the changes Licensee made to create that Covered
|
||||
* Code and the date of any change. Licensee must include in that file the
|
||||
* documentation of any changes made by any predecessor Licensee. Licensee
|
||||
* must include a prominent statement that the modification is derived,
|
||||
* directly or indirectly, from Original Intel Code.
|
||||
*
|
||||
* 3.2. Redistribution of Source with no Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification without rights to further distribute source must
|
||||
* include the following Disclaimer and Export Compliance provision in the
|
||||
* documentation and/or other materials provided with distribution. In
|
||||
* addition, Licensee may not authorize further sublicense of source of any
|
||||
* portion of the Covered Code, and must include terms to the effect that the
|
||||
* license from Licensee to its licensee is limited to the intellectual
|
||||
* property embodied in the software Licensee provides to its licensee, and
|
||||
* not to intellectual property embodied in modifications its licensee may
|
||||
* make.
|
||||
*
|
||||
* 3.3. Redistribution of Executable. Redistribution in executable form of any
|
||||
* substantial portion of the Covered Code or modification must reproduce the
|
||||
* above Copyright Notice, and the following Disclaimer and Export Compliance
|
||||
* provision in the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3.4. Intel retains all right, title, and interest in and to the Original
|
||||
* Intel Code.
|
||||
*
|
||||
* 3.5. Neither the name Intel nor any other trademark owned or controlled by
|
||||
* Intel shall be used in advertising or otherwise to promote the sale, use or
|
||||
* other dealings in products derived from or relating to the Covered Code
|
||||
* without prior written authorization from Intel.
|
||||
*
|
||||
* 4. Disclaimer and Export Compliance
|
||||
*
|
||||
* 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
|
||||
* HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
|
||||
* IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
|
||||
* INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
|
||||
* UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
|
||||
* PARTICULAR PURPOSE.
|
||||
*
|
||||
* 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
|
||||
* OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
|
||||
* COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
|
||||
* SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
|
||||
* CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
|
||||
* HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
|
||||
* SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
|
||||
* LIMITED REMEDY.
|
||||
*
|
||||
* 4.3. Licensee shall not export, either directly or indirectly, any of this
|
||||
* software or system incorporating such software without first obtaining any
|
||||
* required license or other approval from the U. S. Department of Commerce or
|
||||
* any other agency or department of the United States Government. In the
|
||||
* event Licensee exports any such software from the United States or
|
||||
* re-exports any such software from a foreign destination, Licensee shall
|
||||
* ensure that the distribution and export/re-export of the software is in
|
||||
* compliance with all laws, regulations, orders, or other restrictions of the
|
||||
* U.S. Export Administration Regulations. Licensee agrees that neither it nor
|
||||
* any of its subsidiaries will export/re-export any technical data, process,
|
||||
* software, or service, directly or indirectly, to any country for which the
|
||||
* United States government or any agency thereof requires an export license,
|
||||
* other governmental approval, or letter of assurance, without first obtaining
|
||||
* such license, approval or letter.
|
||||
*
|
||||
*****************************************************************************/
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#include "acpi.h"
|
||||
#include "accommon.h"
|
||||
@@ -121,6 +49,8 @@
|
||||
#define _COMPONENT ACPI_EVENTS
|
||||
ACPI_MODULE_NAME ("evgpe")
|
||||
|
||||
#if (!ACPI_REDUCED_HARDWARE) /* Entire module */
|
||||
|
||||
/* Local prototypes */
|
||||
|
||||
static void ACPI_SYSTEM_XFACE
|
||||
@@ -162,7 +92,7 @@ AcpiEvUpdateGpeEnableMask (
|
||||
return_ACPI_STATUS (AE_NOT_EXIST);
|
||||
}
|
||||
|
||||
RegisterBit = AcpiHwGetGpeRegisterBit (GpeEventInfo, GpeRegisterInfo);
|
||||
RegisterBit = AcpiHwGetGpeRegisterBit (GpeEventInfo);
|
||||
|
||||
/* Clear the run bit up front */
|
||||
|
||||
@@ -202,12 +132,13 @@ AcpiEvEnableGpe (
|
||||
|
||||
|
||||
/*
|
||||
* We will only allow a GPE to be enabled if it has either an
|
||||
* associated method (_Lxx/_Exx) or a handler. Otherwise, the
|
||||
* GPE will be immediately disabled by AcpiEvGpeDispatch the
|
||||
* first time it fires.
|
||||
* We will only allow a GPE to be enabled if it has either an associated
|
||||
* method (_Lxx/_Exx) or a handler, or is using the implicit notify
|
||||
* feature. Otherwise, the GPE will be immediately disabled by
|
||||
* AcpiEvGpeDispatch the first time it fires.
|
||||
*/
|
||||
if (!(GpeEventInfo->Flags & ACPI_GPE_DISPATCH_MASK))
|
||||
if ((GpeEventInfo->Flags & ACPI_GPE_DISPATCH_MASK) ==
|
||||
ACPI_GPE_DISPATCH_NONE)
|
||||
{
|
||||
return_ACPI_STATUS (AE_NO_HANDLER);
|
||||
}
|
||||
@@ -227,6 +158,104 @@ AcpiEvEnableGpe (
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiEvAddGpeReference
|
||||
*
|
||||
* PARAMETERS: GpeEventInfo - Add a reference to this GPE
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Add a reference to a GPE. On the first reference, the GPE is
|
||||
* hardware-enabled.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiEvAddGpeReference (
|
||||
ACPI_GPE_EVENT_INFO *GpeEventInfo)
|
||||
{
|
||||
ACPI_STATUS Status = AE_OK;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE (EvAddGpeReference);
|
||||
|
||||
|
||||
if (GpeEventInfo->RuntimeCount == ACPI_UINT8_MAX)
|
||||
{
|
||||
return_ACPI_STATUS (AE_LIMIT);
|
||||
}
|
||||
|
||||
GpeEventInfo->RuntimeCount++;
|
||||
if (GpeEventInfo->RuntimeCount == 1)
|
||||
{
|
||||
/* Enable on first reference */
|
||||
|
||||
Status = AcpiEvUpdateGpeEnableMask (GpeEventInfo);
|
||||
if (ACPI_SUCCESS (Status))
|
||||
{
|
||||
Status = AcpiEvEnableGpe (GpeEventInfo);
|
||||
}
|
||||
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
GpeEventInfo->RuntimeCount--;
|
||||
}
|
||||
}
|
||||
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiEvRemoveGpeReference
|
||||
*
|
||||
* PARAMETERS: GpeEventInfo - Remove a reference to this GPE
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Remove a reference to a GPE. When the last reference is
|
||||
* removed, the GPE is hardware-disabled.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiEvRemoveGpeReference (
|
||||
ACPI_GPE_EVENT_INFO *GpeEventInfo)
|
||||
{
|
||||
ACPI_STATUS Status = AE_OK;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE (EvRemoveGpeReference);
|
||||
|
||||
|
||||
if (!GpeEventInfo->RuntimeCount)
|
||||
{
|
||||
return_ACPI_STATUS (AE_LIMIT);
|
||||
}
|
||||
|
||||
GpeEventInfo->RuntimeCount--;
|
||||
if (!GpeEventInfo->RuntimeCount)
|
||||
{
|
||||
/* Disable on last reference */
|
||||
|
||||
Status = AcpiEvUpdateGpeEnableMask (GpeEventInfo);
|
||||
if (ACPI_SUCCESS (Status))
|
||||
{
|
||||
Status = AcpiHwLowSetGpe (GpeEventInfo, ACPI_GPE_DISABLE);
|
||||
}
|
||||
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
GpeEventInfo->RuntimeCount++;
|
||||
}
|
||||
}
|
||||
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiEvLowGetGpeInfo
|
||||
@@ -395,6 +424,23 @@ AcpiEvGpeDetect (
|
||||
|
||||
GpeRegisterInfo = &GpeBlock->RegisterInfo[i];
|
||||
|
||||
/*
|
||||
* Optimization: If there are no GPEs enabled within this
|
||||
* register, we can safely ignore the entire register.
|
||||
*/
|
||||
if (!(GpeRegisterInfo->EnableForRun |
|
||||
GpeRegisterInfo->EnableForWake))
|
||||
{
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_INTERRUPTS,
|
||||
"Ignore disabled registers for GPE %02X-%02X: "
|
||||
"RunEnable=%02X, WakeEnable=%02X\n",
|
||||
GpeRegisterInfo->BaseGpeNumber,
|
||||
GpeRegisterInfo->BaseGpeNumber + (ACPI_GPE_REGISTER_WIDTH - 1),
|
||||
GpeRegisterInfo->EnableForRun,
|
||||
GpeRegisterInfo->EnableForWake));
|
||||
continue;
|
||||
}
|
||||
|
||||
/* Read the Status Register */
|
||||
|
||||
Status = AcpiHwRead (&StatusReg, &GpeRegisterInfo->StatusAddress);
|
||||
@@ -412,8 +458,13 @@ AcpiEvGpeDetect (
|
||||
}
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_INTERRUPTS,
|
||||
"Read GPE Register at GPE%X: Status=%02X, Enable=%02X\n",
|
||||
GpeRegisterInfo->BaseGpeNumber, StatusReg, EnableReg));
|
||||
"Read registers for GPE %02X-%02X: Status=%02X, Enable=%02X, "
|
||||
"RunEnable=%02X, WakeEnable=%02X\n",
|
||||
GpeRegisterInfo->BaseGpeNumber,
|
||||
GpeRegisterInfo->BaseGpeNumber + (ACPI_GPE_REGISTER_WIDTH - 1),
|
||||
StatusReg, EnableReg,
|
||||
GpeRegisterInfo->EnableForRun,
|
||||
GpeRegisterInfo->EnableForWake));
|
||||
|
||||
/* Check if there is anything active at all in this register */
|
||||
|
||||
@@ -437,7 +488,7 @@ AcpiEvGpeDetect (
|
||||
* Found an active GPE. Dispatch the event to a handler
|
||||
* or method.
|
||||
*/
|
||||
IntStatus |= AcpiEvGpeDispatch (
|
||||
IntStatus |= AcpiEvGpeDispatch (GpeBlock->Node,
|
||||
&GpeBlock->EventInfo[((ACPI_SIZE) i *
|
||||
ACPI_GPE_REGISTER_WIDTH) + j],
|
||||
j + GpeRegisterInfo->BaseGpeNumber);
|
||||
@@ -479,6 +530,7 @@ AcpiEvAsynchExecuteGpeMethod (
|
||||
ACPI_STATUS Status;
|
||||
ACPI_GPE_EVENT_INFO *LocalGpeEventInfo;
|
||||
ACPI_EVALUATE_INFO *Info;
|
||||
ACPI_GPE_NOTIFY_INFO *Notify;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE (EvAsynchExecuteGpeMethod);
|
||||
@@ -497,6 +549,7 @@ AcpiEvAsynchExecuteGpeMethod (
|
||||
Status = AcpiUtAcquireMutex (ACPI_MTX_EVENTS);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
ACPI_FREE (LocalGpeEventInfo);
|
||||
return_VOID;
|
||||
}
|
||||
|
||||
@@ -505,6 +558,7 @@ AcpiEvAsynchExecuteGpeMethod (
|
||||
if (!AcpiEvValidGpeEvent (GpeEventInfo))
|
||||
{
|
||||
Status = AcpiUtReleaseMutex (ACPI_MTX_EVENTS);
|
||||
ACPI_FREE (LocalGpeEventInfo);
|
||||
return_VOID;
|
||||
}
|
||||
|
||||
@@ -518,16 +572,38 @@ AcpiEvAsynchExecuteGpeMethod (
|
||||
Status = AcpiUtReleaseMutex (ACPI_MTX_EVENTS);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
ACPI_FREE (LocalGpeEventInfo);
|
||||
return_VOID;
|
||||
}
|
||||
|
||||
/*
|
||||
* Must check for control method type dispatch one more time to avoid a
|
||||
* race with EvGpeInstallHandler
|
||||
*/
|
||||
if ((LocalGpeEventInfo->Flags & ACPI_GPE_DISPATCH_MASK) ==
|
||||
ACPI_GPE_DISPATCH_METHOD)
|
||||
/* Do the correct dispatch - normal method or implicit notify */
|
||||
|
||||
switch (LocalGpeEventInfo->Flags & ACPI_GPE_DISPATCH_MASK)
|
||||
{
|
||||
case ACPI_GPE_DISPATCH_NOTIFY:
|
||||
/*
|
||||
* Implicit notify.
|
||||
* Dispatch a DEVICE_WAKE notify to the appropriate handler.
|
||||
* NOTE: the request is queued for execution after this method
|
||||
* completes. The notify handlers are NOT invoked synchronously
|
||||
* from this thread -- because handlers may in turn run other
|
||||
* control methods.
|
||||
*
|
||||
* June 2012: Expand implicit notify mechanism to support
|
||||
* notifies on multiple device objects.
|
||||
*/
|
||||
Notify = LocalGpeEventInfo->Dispatch.NotifyList;
|
||||
while (ACPI_SUCCESS (Status) && Notify)
|
||||
{
|
||||
Status = AcpiEvQueueNotifyRequest (Notify->DeviceNode,
|
||||
ACPI_NOTIFY_DEVICE_WAKE);
|
||||
|
||||
Notify = Notify->Next;
|
||||
}
|
||||
break;
|
||||
|
||||
case ACPI_GPE_DISPATCH_METHOD:
|
||||
|
||||
/* Allocate the evaluation information block */
|
||||
|
||||
Info = ACPI_ALLOCATE_ZEROED (sizeof (ACPI_EVALUATE_INFO));
|
||||
@@ -538,8 +614,8 @@ AcpiEvAsynchExecuteGpeMethod (
|
||||
else
|
||||
{
|
||||
/*
|
||||
* Invoke the GPE Method (_Lxx, _Exx) i.e., evaluate the _Lxx/_Exx
|
||||
* control method that corresponds to this GPE
|
||||
* Invoke the GPE Method (_Lxx, _Exx) i.e., evaluate the
|
||||
* _Lxx/_Exx control method that corresponds to this GPE
|
||||
*/
|
||||
Info->PrefixNode = LocalGpeEventInfo->Dispatch.MethodNode;
|
||||
Info->Flags = ACPI_IGNORE_RETURN_VALUE;
|
||||
@@ -554,6 +630,11 @@ AcpiEvAsynchExecuteGpeMethod (
|
||||
"while evaluating GPE method [%4.4s]",
|
||||
AcpiUtGetNodeName (LocalGpeEventInfo->Dispatch.MethodNode)));
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
return_VOID; /* Should never happen */
|
||||
}
|
||||
|
||||
/* Defer enabling of GPE until all notify handlers are done */
|
||||
@@ -573,6 +654,7 @@ AcpiEvAsynchExecuteGpeMethod (
|
||||
* FUNCTION: AcpiEvAsynchEnableGpe
|
||||
*
|
||||
* PARAMETERS: Context (GpeEventInfo) - Info for this GPE
|
||||
* Callback from AcpiOsExecute
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
@@ -586,41 +668,66 @@ AcpiEvAsynchEnableGpe (
|
||||
void *Context)
|
||||
{
|
||||
ACPI_GPE_EVENT_INFO *GpeEventInfo = Context;
|
||||
ACPI_STATUS Status;
|
||||
|
||||
|
||||
if ((GpeEventInfo->Flags & ACPI_GPE_XRUPT_TYPE_MASK) ==
|
||||
ACPI_GPE_LEVEL_TRIGGERED)
|
||||
{
|
||||
/*
|
||||
* GPE is level-triggered, we clear the GPE status bit after handling
|
||||
* the event.
|
||||
*/
|
||||
Status = AcpiHwClearGpe (GpeEventInfo);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
goto Exit;
|
||||
}
|
||||
}
|
||||
(void) AcpiEvFinishGpe (GpeEventInfo);
|
||||
|
||||
/*
|
||||
* Enable this GPE, conditionally. This means that the GPE will only be
|
||||
* physically enabled if the EnableForRun bit is set in the EventInfo
|
||||
*/
|
||||
(void) AcpiHwLowSetGpe (GpeEventInfo, ACPI_GPE_CONDITIONAL_ENABLE);
|
||||
|
||||
Exit:
|
||||
ACPI_FREE (GpeEventInfo);
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiEvFinishGpe
|
||||
*
|
||||
* PARAMETERS: GpeEventInfo - Info for this GPE
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Clear/Enable a GPE. Common code that is used after execution
|
||||
* of a GPE method or a synchronous or asynchronous GPE handler.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiEvFinishGpe (
|
||||
ACPI_GPE_EVENT_INFO *GpeEventInfo)
|
||||
{
|
||||
ACPI_STATUS Status;
|
||||
|
||||
|
||||
if ((GpeEventInfo->Flags & ACPI_GPE_XRUPT_TYPE_MASK) ==
|
||||
ACPI_GPE_LEVEL_TRIGGERED)
|
||||
{
|
||||
/*
|
||||
* GPE is level-triggered, we clear the GPE status bit after
|
||||
* handling the event.
|
||||
*/
|
||||
Status = AcpiHwClearGpe (GpeEventInfo);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return (Status);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Enable this GPE, conditionally. This means that the GPE will
|
||||
* only be physically enabled if the EnableForRun bit is set
|
||||
* in the EventInfo.
|
||||
*/
|
||||
(void) AcpiHwLowSetGpe (GpeEventInfo, ACPI_GPE_CONDITIONAL_ENABLE);
|
||||
return (AE_OK);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiEvGpeDispatch
|
||||
*
|
||||
* PARAMETERS: GpeEventInfo - Info for this GPE
|
||||
* GpeNumber - Number relative to the parent GPE block
|
||||
* PARAMETERS: GpeDevice - Device node. NULL for GPE0/GPE1
|
||||
* GpeEventInfo - Info for this GPE
|
||||
* GpeNumber - Number relative to the parent GPE block
|
||||
*
|
||||
* RETURN: INTERRUPT_HANDLED or INTERRUPT_NOT_HANDLED
|
||||
*
|
||||
@@ -633,16 +740,42 @@ Exit:
|
||||
|
||||
UINT32
|
||||
AcpiEvGpeDispatch (
|
||||
ACPI_NAMESPACE_NODE *GpeDevice,
|
||||
ACPI_GPE_EVENT_INFO *GpeEventInfo,
|
||||
UINT32 GpeNumber)
|
||||
{
|
||||
ACPI_STATUS Status;
|
||||
UINT32 ReturnValue;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE (EvGpeDispatch);
|
||||
|
||||
|
||||
/* Invoke global event handler if present */
|
||||
|
||||
AcpiGpeCount++;
|
||||
if (AcpiGbl_GlobalEventHandler)
|
||||
{
|
||||
AcpiGbl_GlobalEventHandler (ACPI_EVENT_TYPE_GPE, GpeDevice,
|
||||
GpeNumber, AcpiGbl_GlobalEventHandlerContext);
|
||||
}
|
||||
|
||||
/*
|
||||
* Always disable the GPE so that it does not keep firing before
|
||||
* any asynchronous activity completes (either from the execution
|
||||
* of a GPE method or an asynchronous GPE handler.)
|
||||
*
|
||||
* If there is no handler or method to run, just disable the
|
||||
* GPE and leave it disabled permanently to prevent further such
|
||||
* pointless events from firing.
|
||||
*/
|
||||
Status = AcpiHwLowSetGpe (GpeEventInfo, ACPI_GPE_DISABLE);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
ACPI_EXCEPTION ((AE_INFO, Status,
|
||||
"Unable to disable GPE %02X", GpeNumber));
|
||||
return_UINT32 (ACPI_INTERRUPT_NOT_HANDLED);
|
||||
}
|
||||
|
||||
/*
|
||||
* If edge-triggered, clear the GPE status bit now. Note that
|
||||
@@ -655,59 +788,40 @@ AcpiEvGpeDispatch (
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
ACPI_EXCEPTION ((AE_INFO, Status,
|
||||
"Unable to clear GPE[0x%2X]", GpeNumber));
|
||||
"Unable to clear GPE %02X", GpeNumber));
|
||||
(void) AcpiHwLowSetGpe (GpeEventInfo,
|
||||
ACPI_GPE_CONDITIONAL_ENABLE);
|
||||
return_UINT32 (ACPI_INTERRUPT_NOT_HANDLED);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Dispatch the GPE to either an installed handler, or the control method
|
||||
* associated with this GPE (_Lxx or _Exx). If a handler exists, we invoke
|
||||
* it and do not attempt to run the method. If there is neither a handler
|
||||
* nor a method, we disable this GPE to prevent further such pointless
|
||||
* events from firing.
|
||||
* Dispatch the GPE to either an installed handler or the control
|
||||
* method associated with this GPE (_Lxx or _Exx). If a handler
|
||||
* exists, we invoke it and do not attempt to run the method.
|
||||
* If there is neither a handler nor a method, leave the GPE
|
||||
* disabled.
|
||||
*/
|
||||
switch (GpeEventInfo->Flags & ACPI_GPE_DISPATCH_MASK)
|
||||
{
|
||||
case ACPI_GPE_DISPATCH_HANDLER:
|
||||
|
||||
/*
|
||||
* Invoke the installed handler (at interrupt level)
|
||||
* Ignore return status for now.
|
||||
* TBD: leave GPE disabled on error?
|
||||
*/
|
||||
(void) GpeEventInfo->Dispatch.Handler->Address (
|
||||
GpeEventInfo->Dispatch.Handler->Context);
|
||||
/* Invoke the installed handler (at interrupt level) */
|
||||
|
||||
/* It is now safe to clear level-triggered events. */
|
||||
ReturnValue = GpeEventInfo->Dispatch.Handler->Address (
|
||||
GpeDevice, GpeNumber,
|
||||
GpeEventInfo->Dispatch.Handler->Context);
|
||||
|
||||
if ((GpeEventInfo->Flags & ACPI_GPE_XRUPT_TYPE_MASK) ==
|
||||
ACPI_GPE_LEVEL_TRIGGERED)
|
||||
/* If requested, clear (if level-triggered) and reenable the GPE */
|
||||
|
||||
if (ReturnValue & ACPI_REENABLE_GPE)
|
||||
{
|
||||
Status = AcpiHwClearGpe (GpeEventInfo);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
ACPI_EXCEPTION ((AE_INFO, Status,
|
||||
"Unable to clear GPE[0x%2X]", GpeNumber));
|
||||
return_UINT32 (ACPI_INTERRUPT_NOT_HANDLED);
|
||||
}
|
||||
(void) AcpiEvFinishGpe (GpeEventInfo);
|
||||
}
|
||||
break;
|
||||
|
||||
case ACPI_GPE_DISPATCH_METHOD:
|
||||
|
||||
/*
|
||||
* Disable the GPE, so it doesn't keep firing before the method has a
|
||||
* chance to run (it runs asynchronously with interrupts enabled).
|
||||
*/
|
||||
Status = AcpiHwLowSetGpe (GpeEventInfo, ACPI_GPE_DISABLE);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
ACPI_EXCEPTION ((AE_INFO, Status,
|
||||
"Unable to disable GPE[0x%2X]", GpeNumber));
|
||||
return_UINT32 (ACPI_INTERRUPT_NOT_HANDLED);
|
||||
}
|
||||
|
||||
case ACPI_GPE_DISPATCH_NOTIFY:
|
||||
/*
|
||||
* Execute the method associated with the GPE
|
||||
* NOTE: Level-triggered GPEs are cleared after the method completes.
|
||||
@@ -717,36 +831,24 @@ AcpiEvGpeDispatch (
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
ACPI_EXCEPTION ((AE_INFO, Status,
|
||||
"Unable to queue handler for GPE[0x%2X] - event disabled",
|
||||
"Unable to queue handler for GPE %02X - event disabled",
|
||||
GpeNumber));
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
/*
|
||||
* No handler or method to run!
|
||||
* 03/2010: This case should no longer be possible. We will not allow
|
||||
* a GPE to be enabled if it has no handler or method.
|
||||
*/
|
||||
ACPI_ERROR ((AE_INFO,
|
||||
"No handler or method for GPE[0x%2X], disabling event",
|
||||
"No handler or method for GPE %02X, disabling event",
|
||||
GpeNumber));
|
||||
|
||||
/*
|
||||
* Disable the GPE. The GPE will remain disabled until a handler
|
||||
* is installed or ACPICA is restarted.
|
||||
*/
|
||||
Status = AcpiHwLowSetGpe (GpeEventInfo, ACPI_GPE_DISABLE);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
ACPI_EXCEPTION ((AE_INFO, Status,
|
||||
"Unable to disable GPE[0x%2X]", GpeNumber));
|
||||
return_UINT32 (ACPI_INTERRUPT_NOT_HANDLED);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
return_UINT32 (ACPI_INTERRUPT_HANDLED);
|
||||
}
|
||||
|
||||
#endif /* !ACPI_REDUCED_HARDWARE */
|
||||
|
||||
@@ -4,114 +4,42 @@
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
* 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.
|
||||
*
|
||||
* 2.1. This is your license from Intel Corp. under its intellectual property
|
||||
* rights. You may have additional license terms from the party that provided
|
||||
* you this software, covering your right to use that party's intellectual
|
||||
* property rights.
|
||||
* 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.
|
||||
*
|
||||
* 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
|
||||
* copy of the source code appearing in this file ("Covered Code") an
|
||||
* irrevocable, perpetual, worldwide license under Intel's copyrights in the
|
||||
* base code distributed originally by Intel ("Original Intel Code") to copy,
|
||||
* make derivatives, distribute, use and display any portion of the Covered
|
||||
* Code in any form, with the right to sublicense such rights; and
|
||||
*
|
||||
* 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
|
||||
* license (with the right to sublicense), under only those claims of Intel
|
||||
* patents that are infringed by the Original Intel Code, to make, use, sell,
|
||||
* offer to sell, and import the Covered Code and derivative works thereof
|
||||
* solely to the minimum extent necessary to exercise the above copyright
|
||||
* license, and in no event shall the patent license extend to any additions
|
||||
* to or modifications of the Original Intel Code. No other license or right
|
||||
* is granted directly or by implication, estoppel or otherwise;
|
||||
*
|
||||
* The above copyright and patent license is granted only if the following
|
||||
* conditions are met:
|
||||
*
|
||||
* 3. Conditions
|
||||
*
|
||||
* 3.1. Redistribution of Source with Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification with rights to further distribute source must include
|
||||
* the above Copyright Notice, the above License, this list of Conditions,
|
||||
* and the following Disclaimer and Export Compliance provision. In addition,
|
||||
* Licensee must cause all Covered Code to which Licensee contributes to
|
||||
* contain a file documenting the changes Licensee made to create that Covered
|
||||
* Code and the date of any change. Licensee must include in that file the
|
||||
* documentation of any changes made by any predecessor Licensee. Licensee
|
||||
* must include a prominent statement that the modification is derived,
|
||||
* directly or indirectly, from Original Intel Code.
|
||||
*
|
||||
* 3.2. Redistribution of Source with no Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification without rights to further distribute source must
|
||||
* include the following Disclaimer and Export Compliance provision in the
|
||||
* documentation and/or other materials provided with distribution. In
|
||||
* addition, Licensee may not authorize further sublicense of source of any
|
||||
* portion of the Covered Code, and must include terms to the effect that the
|
||||
* license from Licensee to its licensee is limited to the intellectual
|
||||
* property embodied in the software Licensee provides to its licensee, and
|
||||
* not to intellectual property embodied in modifications its licensee may
|
||||
* make.
|
||||
*
|
||||
* 3.3. Redistribution of Executable. Redistribution in executable form of any
|
||||
* substantial portion of the Covered Code or modification must reproduce the
|
||||
* above Copyright Notice, and the following Disclaimer and Export Compliance
|
||||
* provision in the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3.4. Intel retains all right, title, and interest in and to the Original
|
||||
* Intel Code.
|
||||
*
|
||||
* 3.5. Neither the name Intel nor any other trademark owned or controlled by
|
||||
* Intel shall be used in advertising or otherwise to promote the sale, use or
|
||||
* other dealings in products derived from or relating to the Covered Code
|
||||
* without prior written authorization from Intel.
|
||||
*
|
||||
* 4. Disclaimer and Export Compliance
|
||||
*
|
||||
* 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
|
||||
* HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
|
||||
* IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
|
||||
* INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
|
||||
* UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
|
||||
* PARTICULAR PURPOSE.
|
||||
*
|
||||
* 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
|
||||
* OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
|
||||
* COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
|
||||
* SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
|
||||
* CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
|
||||
* HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
|
||||
* SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
|
||||
* LIMITED REMEDY.
|
||||
*
|
||||
* 4.3. Licensee shall not export, either directly or indirectly, any of this
|
||||
* software or system incorporating such software without first obtaining any
|
||||
* required license or other approval from the U. S. Department of Commerce or
|
||||
* any other agency or department of the United States Government. In the
|
||||
* event Licensee exports any such software from the United States or
|
||||
* re-exports any such software from a foreign destination, Licensee shall
|
||||
* ensure that the distribution and export/re-export of the software is in
|
||||
* compliance with all laws, regulations, orders, or other restrictions of the
|
||||
* U.S. Export Administration Regulations. Licensee agrees that neither it nor
|
||||
* any of its subsidiaries will export/re-export any technical data, process,
|
||||
* software, or service, directly or indirectly, to any country for which the
|
||||
* United States government or any agency thereof requires an export license,
|
||||
* other governmental approval, or letter of assurance, without first obtaining
|
||||
* such license, approval or letter.
|
||||
*
|
||||
*****************************************************************************/
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#include "acpi.h"
|
||||
#include "accommon.h"
|
||||
@@ -121,6 +49,8 @@
|
||||
#define _COMPONENT ACPI_EVENTS
|
||||
ACPI_MODULE_NAME ("evgpeblk")
|
||||
|
||||
#if (!ACPI_REDUCED_HARDWARE) /* Entire module */
|
||||
|
||||
/* Local prototypes */
|
||||
|
||||
static ACPI_STATUS
|
||||
@@ -167,10 +97,9 @@ AcpiEvInstallGpeBlock (
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
GpeXruptBlock = AcpiEvGetGpeXruptBlock (InterruptNumber);
|
||||
if (!GpeXruptBlock)
|
||||
Status = AcpiEvGetGpeXruptBlock (InterruptNumber, &GpeXruptBlock);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
Status = AE_NO_MEMORY;
|
||||
goto UnlockAndExit;
|
||||
}
|
||||
|
||||
@@ -198,7 +127,7 @@ AcpiEvInstallGpeBlock (
|
||||
|
||||
|
||||
UnlockAndExit:
|
||||
Status = AcpiUtReleaseMutex (ACPI_MTX_EVENTS);
|
||||
(void) AcpiUtReleaseMutex (ACPI_MTX_EVENTS);
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
@@ -353,17 +282,17 @@ AcpiEvCreateGpeInfoBlocks (
|
||||
{
|
||||
/* Init the RegisterInfo for this GPE register (8 GPEs) */
|
||||
|
||||
ThisRegister->BaseGpeNumber = (UINT8) (GpeBlock->BlockBaseNumber +
|
||||
(i * ACPI_GPE_REGISTER_WIDTH));
|
||||
ThisRegister->BaseGpeNumber = (UINT16)
|
||||
(GpeBlock->BlockBaseNumber + (i * ACPI_GPE_REGISTER_WIDTH));
|
||||
|
||||
ThisRegister->StatusAddress.Address =
|
||||
GpeBlock->BlockAddress.Address + i;
|
||||
GpeBlock->Address + i;
|
||||
|
||||
ThisRegister->EnableAddress.Address =
|
||||
GpeBlock->BlockAddress.Address + i + GpeBlock->RegisterCount;
|
||||
GpeBlock->Address + i + GpeBlock->RegisterCount;
|
||||
|
||||
ThisRegister->StatusAddress.SpaceId = GpeBlock->BlockAddress.SpaceId;
|
||||
ThisRegister->EnableAddress.SpaceId = GpeBlock->BlockAddress.SpaceId;
|
||||
ThisRegister->StatusAddress.SpaceId = GpeBlock->SpaceId;
|
||||
ThisRegister->EnableAddress.SpaceId = GpeBlock->SpaceId;
|
||||
ThisRegister->StatusAddress.BitWidth = ACPI_GPE_REGISTER_WIDTH;
|
||||
ThisRegister->EnableAddress.BitWidth = ACPI_GPE_REGISTER_WIDTH;
|
||||
ThisRegister->StatusAddress.BitOffset = 0;
|
||||
@@ -436,9 +365,10 @@ ErrorExit:
|
||||
ACPI_STATUS
|
||||
AcpiEvCreateGpeBlock (
|
||||
ACPI_NAMESPACE_NODE *GpeDevice,
|
||||
ACPI_GENERIC_ADDRESS *GpeBlockAddress,
|
||||
UINT64 Address,
|
||||
UINT8 SpaceId,
|
||||
UINT32 RegisterCount,
|
||||
UINT8 GpeBlockBaseNumber,
|
||||
UINT16 GpeBlockBaseNumber,
|
||||
UINT32 InterruptNumber,
|
||||
ACPI_GPE_BLOCK_INFO **ReturnGpeBlock)
|
||||
{
|
||||
@@ -465,14 +395,14 @@ AcpiEvCreateGpeBlock (
|
||||
|
||||
/* Initialize the new GPE block */
|
||||
|
||||
GpeBlock->Address = Address;
|
||||
GpeBlock->SpaceId = SpaceId;
|
||||
GpeBlock->Node = GpeDevice;
|
||||
GpeBlock->GpeCount = (UINT16) (RegisterCount * ACPI_GPE_REGISTER_WIDTH);
|
||||
GpeBlock->Initialized = FALSE;
|
||||
GpeBlock->RegisterCount = RegisterCount;
|
||||
GpeBlock->BlockBaseNumber = GpeBlockBaseNumber;
|
||||
|
||||
ACPI_MEMCPY (&GpeBlock->BlockAddress, GpeBlockAddress,
|
||||
sizeof (ACPI_GENERIC_ADDRESS));
|
||||
|
||||
/*
|
||||
* Create the RegisterInfo and EventInfo sub-structures
|
||||
* Note: disables and clears all GPEs in the block
|
||||
@@ -489,15 +419,18 @@ AcpiEvCreateGpeBlock (
|
||||
Status = AcpiEvInstallGpeBlock (GpeBlock, InterruptNumber);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
ACPI_FREE (GpeBlock->RegisterInfo);
|
||||
ACPI_FREE (GpeBlock->EventInfo);
|
||||
ACPI_FREE (GpeBlock);
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
AcpiGbl_AllGpesInitialized = FALSE;
|
||||
|
||||
/* Find all GPE methods (_Lxx or_Exx) for this block */
|
||||
|
||||
WalkInfo.GpeBlock = GpeBlock;
|
||||
WalkInfo.GpeDevice = GpeDevice;
|
||||
WalkInfo.EnableThisGpe = FALSE;
|
||||
WalkInfo.ExecuteByOwnerId = FALSE;
|
||||
|
||||
Status = AcpiNsWalkNamespace (ACPI_TYPE_METHOD, GpeDevice,
|
||||
@@ -511,12 +444,12 @@ AcpiEvCreateGpeBlock (
|
||||
(*ReturnGpeBlock) = GpeBlock;
|
||||
}
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_INIT,
|
||||
"GPE %02X to %02X [%4.4s] %u regs on int 0x%X\n",
|
||||
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INIT,
|
||||
" Initialized GPE %02X to %02X [%4.4s] %u regs on interrupt 0x%X%s\n",
|
||||
(UINT32) GpeBlock->BlockBaseNumber,
|
||||
(UINT32) (GpeBlock->BlockBaseNumber + (GpeBlock->GpeCount - 1)),
|
||||
GpeDevice->Name.Ascii, GpeBlock->RegisterCount,
|
||||
InterruptNumber));
|
||||
GpeDevice->Name.Ascii, GpeBlock->RegisterCount, InterruptNumber,
|
||||
InterruptNumber == AcpiGbl_FADT.SciInterrupt ? " (SCI)" : ""));
|
||||
|
||||
/* Update global count of currently available GPEs */
|
||||
|
||||
@@ -529,30 +462,26 @@ AcpiEvCreateGpeBlock (
|
||||
*
|
||||
* FUNCTION: AcpiEvInitializeGpeBlock
|
||||
*
|
||||
* PARAMETERS: GpeDevice - Handle to the parent GPE block
|
||||
* GpeBlock - Gpe Block info
|
||||
* PARAMETERS: ACPI_GPE_CALLBACK
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Initialize and enable a GPE block. First find and run any
|
||||
* _PRT methods associated with the block, then enable the
|
||||
* appropriate GPEs.
|
||||
* DESCRIPTION: Initialize and enable a GPE block. Enable GPEs that have
|
||||
* associated methods.
|
||||
* Note: Assumes namespace is locked.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiEvInitializeGpeBlock (
|
||||
ACPI_NAMESPACE_NODE *GpeDevice,
|
||||
ACPI_GPE_BLOCK_INFO *GpeBlock)
|
||||
ACPI_GPE_XRUPT_INFO *GpeXruptInfo,
|
||||
ACPI_GPE_BLOCK_INFO *GpeBlock,
|
||||
void *Ignored)
|
||||
{
|
||||
ACPI_STATUS Status;
|
||||
ACPI_GPE_EVENT_INFO *GpeEventInfo;
|
||||
ACPI_GPE_WALK_INFO WalkInfo;
|
||||
UINT32 WakeGpeCount;
|
||||
UINT32 GpeEnabledCount;
|
||||
UINT32 GpeIndex;
|
||||
UINT32 GpeNumber;
|
||||
UINT32 i;
|
||||
UINT32 j;
|
||||
|
||||
@@ -560,51 +489,22 @@ AcpiEvInitializeGpeBlock (
|
||||
ACPI_FUNCTION_TRACE (EvInitializeGpeBlock);
|
||||
|
||||
|
||||
/* Ignore a null GPE block (e.g., if no GPE block 1 exists) */
|
||||
|
||||
if (!GpeBlock)
|
||||
/*
|
||||
* Ignore a null GPE block (e.g., if no GPE block 1 exists), and
|
||||
* any GPE blocks that have been initialized already.
|
||||
*/
|
||||
if (!GpeBlock || GpeBlock->Initialized)
|
||||
{
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
}
|
||||
|
||||
/*
|
||||
* Runtime option: Should wake GPEs be enabled at runtime? The default
|
||||
* is no, they should only be enabled just as the machine goes to sleep.
|
||||
* Enable all GPEs that have a corresponding method and have the
|
||||
* ACPI_GPE_CAN_WAKE flag unset. Any other GPEs within this block
|
||||
* must be enabled via the acpi_enable_gpe() interface.
|
||||
*/
|
||||
if (AcpiGbl_LeaveWakeGpesDisabled)
|
||||
{
|
||||
/*
|
||||
* Differentiate runtime vs wake GPEs, via the _PRW control methods.
|
||||
* Each GPE that has one or more _PRWs that reference it is by
|
||||
* definition a wake GPE and will not be enabled while the machine
|
||||
* is running.
|
||||
*/
|
||||
WalkInfo.GpeBlock = GpeBlock;
|
||||
WalkInfo.GpeDevice = GpeDevice;
|
||||
WalkInfo.ExecuteByOwnerId = FALSE;
|
||||
|
||||
Status = AcpiNsWalkNamespace (ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT,
|
||||
ACPI_UINT32_MAX, ACPI_NS_WALK_UNLOCK,
|
||||
AcpiEvMatchPrwAndGpe, NULL, &WalkInfo, NULL);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
ACPI_EXCEPTION ((AE_INFO, Status, "While executing _PRW methods"));
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Enable all GPEs that have a corresponding method and are not
|
||||
* capable of generating wakeups. Any other GPEs within this block
|
||||
* must be enabled via the AcpiEnableGpe interface.
|
||||
*/
|
||||
WakeGpeCount = 0;
|
||||
GpeEnabledCount = 0;
|
||||
|
||||
if (GpeDevice == AcpiGbl_FadtGpeDevice)
|
||||
{
|
||||
GpeDevice = NULL;
|
||||
}
|
||||
|
||||
for (i = 0; i < GpeBlock->RegisterCount; i++)
|
||||
{
|
||||
for (j = 0; j < ACPI_GPE_REGISTER_WIDTH; j++)
|
||||
@@ -613,45 +513,24 @@ AcpiEvInitializeGpeBlock (
|
||||
|
||||
GpeIndex = (i * ACPI_GPE_REGISTER_WIDTH) + j;
|
||||
GpeEventInfo = &GpeBlock->EventInfo[GpeIndex];
|
||||
GpeNumber = GpeIndex + GpeBlock->BlockBaseNumber;
|
||||
|
||||
/*
|
||||
* If the GPE has already been enabled for runtime
|
||||
* signalling, make sure that it remains enabled, but
|
||||
* do not increment its reference count.
|
||||
* Ignore GPEs that have no corresponding _Lxx/_Exx method
|
||||
* and GPEs that are used to wake the system
|
||||
*/
|
||||
if (GpeEventInfo->RuntimeCount)
|
||||
{
|
||||
Status = AcpiEvEnableGpe (GpeEventInfo);
|
||||
goto Enabled;
|
||||
}
|
||||
|
||||
/* Ignore GPEs that can wake the system */
|
||||
|
||||
if (GpeEventInfo->Flags & ACPI_GPE_CAN_WAKE)
|
||||
{
|
||||
WakeGpeCount++;
|
||||
if (AcpiGbl_LeaveWakeGpesDisabled)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
/* Ignore GPEs that have no corresponding _Lxx/_Exx method */
|
||||
|
||||
if (!(GpeEventInfo->Flags & ACPI_GPE_DISPATCH_METHOD))
|
||||
if (((GpeEventInfo->Flags & ACPI_GPE_DISPATCH_MASK) == ACPI_GPE_DISPATCH_NONE) ||
|
||||
((GpeEventInfo->Flags & ACPI_GPE_DISPATCH_MASK) == ACPI_GPE_DISPATCH_HANDLER) ||
|
||||
(GpeEventInfo->Flags & ACPI_GPE_CAN_WAKE))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
/* Enable this GPE */
|
||||
|
||||
Status = AcpiEnableGpe (GpeDevice, GpeNumber);
|
||||
Enabled:
|
||||
Status = AcpiEvAddGpeReference (GpeEventInfo);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
ACPI_EXCEPTION ((AE_INFO, Status,
|
||||
"Could not enable GPE 0x%02X", GpeNumber));
|
||||
"Could not enable GPE 0x%02X",
|
||||
GpeIndex + GpeBlock->BlockBaseNumber));
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -659,13 +538,16 @@ Enabled:
|
||||
}
|
||||
}
|
||||
|
||||
if (GpeEnabledCount || WakeGpeCount)
|
||||
if (GpeEnabledCount)
|
||||
{
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_INIT,
|
||||
"Enabled %u Runtime GPEs, added %u Wake GPEs in this block\n",
|
||||
GpeEnabledCount, WakeGpeCount));
|
||||
ACPI_INFO ((AE_INFO,
|
||||
"Enabled %u GPEs in block %02X to %02X", GpeEnabledCount,
|
||||
(UINT32) GpeBlock->BlockBaseNumber,
|
||||
(UINT32) (GpeBlock->BlockBaseNumber + (GpeBlock->GpeCount - 1))));
|
||||
}
|
||||
|
||||
GpeBlock->Initialized = TRUE;
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
}
|
||||
|
||||
#endif /* !ACPI_REDUCED_HARDWARE */
|
||||
|
||||
@@ -4,125 +4,69 @@
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
* 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.
|
||||
*
|
||||
* 2.1. This is your license from Intel Corp. under its intellectual property
|
||||
* rights. You may have additional license terms from the party that provided
|
||||
* you this software, covering your right to use that party's intellectual
|
||||
* property rights.
|
||||
* 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.
|
||||
*
|
||||
* 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
|
||||
* copy of the source code appearing in this file ("Covered Code") an
|
||||
* irrevocable, perpetual, worldwide license under Intel's copyrights in the
|
||||
* base code distributed originally by Intel ("Original Intel Code") to copy,
|
||||
* make derivatives, distribute, use and display any portion of the Covered
|
||||
* Code in any form, with the right to sublicense such rights; and
|
||||
*
|
||||
* 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
|
||||
* license (with the right to sublicense), under only those claims of Intel
|
||||
* patents that are infringed by the Original Intel Code, to make, use, sell,
|
||||
* offer to sell, and import the Covered Code and derivative works thereof
|
||||
* solely to the minimum extent necessary to exercise the above copyright
|
||||
* license, and in no event shall the patent license extend to any additions
|
||||
* to or modifications of the Original Intel Code. No other license or right
|
||||
* is granted directly or by implication, estoppel or otherwise;
|
||||
*
|
||||
* The above copyright and patent license is granted only if the following
|
||||
* conditions are met:
|
||||
*
|
||||
* 3. Conditions
|
||||
*
|
||||
* 3.1. Redistribution of Source with Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification with rights to further distribute source must include
|
||||
* the above Copyright Notice, the above License, this list of Conditions,
|
||||
* and the following Disclaimer and Export Compliance provision. In addition,
|
||||
* Licensee must cause all Covered Code to which Licensee contributes to
|
||||
* contain a file documenting the changes Licensee made to create that Covered
|
||||
* Code and the date of any change. Licensee must include in that file the
|
||||
* documentation of any changes made by any predecessor Licensee. Licensee
|
||||
* must include a prominent statement that the modification is derived,
|
||||
* directly or indirectly, from Original Intel Code.
|
||||
*
|
||||
* 3.2. Redistribution of Source with no Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification without rights to further distribute source must
|
||||
* include the following Disclaimer and Export Compliance provision in the
|
||||
* documentation and/or other materials provided with distribution. In
|
||||
* addition, Licensee may not authorize further sublicense of source of any
|
||||
* portion of the Covered Code, and must include terms to the effect that the
|
||||
* license from Licensee to its licensee is limited to the intellectual
|
||||
* property embodied in the software Licensee provides to its licensee, and
|
||||
* not to intellectual property embodied in modifications its licensee may
|
||||
* make.
|
||||
*
|
||||
* 3.3. Redistribution of Executable. Redistribution in executable form of any
|
||||
* substantial portion of the Covered Code or modification must reproduce the
|
||||
* above Copyright Notice, and the following Disclaimer and Export Compliance
|
||||
* provision in the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3.4. Intel retains all right, title, and interest in and to the Original
|
||||
* Intel Code.
|
||||
*
|
||||
* 3.5. Neither the name Intel nor any other trademark owned or controlled by
|
||||
* Intel shall be used in advertising or otherwise to promote the sale, use or
|
||||
* other dealings in products derived from or relating to the Covered Code
|
||||
* without prior written authorization from Intel.
|
||||
*
|
||||
* 4. Disclaimer and Export Compliance
|
||||
*
|
||||
* 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
|
||||
* HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
|
||||
* IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
|
||||
* INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
|
||||
* UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
|
||||
* PARTICULAR PURPOSE.
|
||||
*
|
||||
* 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
|
||||
* OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
|
||||
* COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
|
||||
* SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
|
||||
* CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
|
||||
* HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
|
||||
* SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
|
||||
* LIMITED REMEDY.
|
||||
*
|
||||
* 4.3. Licensee shall not export, either directly or indirectly, any of this
|
||||
* software or system incorporating such software without first obtaining any
|
||||
* required license or other approval from the U. S. Department of Commerce or
|
||||
* any other agency or department of the United States Government. In the
|
||||
* event Licensee exports any such software from the United States or
|
||||
* re-exports any such software from a foreign destination, Licensee shall
|
||||
* ensure that the distribution and export/re-export of the software is in
|
||||
* compliance with all laws, regulations, orders, or other restrictions of the
|
||||
* U.S. Export Administration Regulations. Licensee agrees that neither it nor
|
||||
* any of its subsidiaries will export/re-export any technical data, process,
|
||||
* software, or service, directly or indirectly, to any country for which the
|
||||
* United States government or any agency thereof requires an export license,
|
||||
* other governmental approval, or letter of assurance, without first obtaining
|
||||
* such license, approval or letter.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#include "acpi.h"
|
||||
#include "accommon.h"
|
||||
#include "acevents.h"
|
||||
#include "acnamesp.h"
|
||||
#include "acinterp.h"
|
||||
|
||||
#define _COMPONENT ACPI_EVENTS
|
||||
ACPI_MODULE_NAME ("evgpeinit")
|
||||
|
||||
#if (!ACPI_REDUCED_HARDWARE) /* Entire module */
|
||||
|
||||
/*
|
||||
* Note: History of _PRW support in ACPICA
|
||||
*
|
||||
* Originally (2000 - 2010), the GPE initialization code performed a walk of
|
||||
* the entire namespace to execute the _PRW methods and detect all GPEs
|
||||
* capable of waking the system.
|
||||
*
|
||||
* As of 10/2010, the _PRW method execution has been removed since it is
|
||||
* actually unnecessary. The host OS must in fact execute all _PRW methods
|
||||
* in order to identify the device/power-resource dependencies. We now put
|
||||
* the onus on the host OS to identify the wake GPEs as part of this process
|
||||
* and to inform ACPICA of these GPEs via the AcpiSetupGpeForWake interface. This
|
||||
* not only reduces the complexity of the ACPICA initialization code, but in
|
||||
* some cases (on systems with very large namespaces) it should reduce the
|
||||
* kernel boot time as well.
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
@@ -149,6 +93,9 @@ AcpiEvGpeInitialize (
|
||||
ACPI_FUNCTION_TRACE (EvGpeInitialize);
|
||||
|
||||
|
||||
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INIT,
|
||||
"Initializing General Purpose Events (GPEs):\n"));
|
||||
|
||||
Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
@@ -186,13 +133,14 @@ AcpiEvGpeInitialize (
|
||||
/* GPE block 0 exists (has both length and address > 0) */
|
||||
|
||||
RegisterCount0 = (UINT16) (AcpiGbl_FADT.Gpe0BlockLength / 2);
|
||||
|
||||
GpeNumberMax = (RegisterCount0 * ACPI_GPE_REGISTER_WIDTH) - 1;
|
||||
|
||||
/* Install GPE Block 0 */
|
||||
|
||||
Status = AcpiEvCreateGpeBlock (AcpiGbl_FadtGpeDevice,
|
||||
&AcpiGbl_FADT.XGpe0Block, RegisterCount0, 0,
|
||||
AcpiGbl_FADT.XGpe0Block.Address,
|
||||
AcpiGbl_FADT.XGpe0Block.SpaceId,
|
||||
RegisterCount0, 0,
|
||||
AcpiGbl_FADT.SciInterrupt, &AcpiGbl_GpeFadtBlocks[0]);
|
||||
|
||||
if (ACPI_FAILURE (Status))
|
||||
@@ -230,7 +178,9 @@ AcpiEvGpeInitialize (
|
||||
/* Install GPE Block 1 */
|
||||
|
||||
Status = AcpiEvCreateGpeBlock (AcpiGbl_FadtGpeDevice,
|
||||
&AcpiGbl_FADT.XGpe1Block, RegisterCount1,
|
||||
AcpiGbl_FADT.XGpe1Block.Address,
|
||||
AcpiGbl_FADT.XGpe1Block.SpaceId,
|
||||
RegisterCount1,
|
||||
AcpiGbl_FADT.Gpe1Base,
|
||||
AcpiGbl_FADT.SciInterrupt, &AcpiGbl_GpeFadtBlocks[1]);
|
||||
|
||||
@@ -261,16 +211,6 @@ AcpiEvGpeInitialize (
|
||||
goto Cleanup;
|
||||
}
|
||||
|
||||
/* Check for Max GPE number out-of-range */
|
||||
|
||||
if (GpeNumberMax > ACPI_GPE_MAX)
|
||||
{
|
||||
ACPI_ERROR ((AE_INFO,
|
||||
"Maximum GPE number from FADT is too large: 0x%X",
|
||||
GpeNumberMax));
|
||||
Status = AE_BAD_VALUE;
|
||||
goto Cleanup;
|
||||
}
|
||||
|
||||
Cleanup:
|
||||
(void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
|
||||
@@ -288,10 +228,7 @@ Cleanup:
|
||||
*
|
||||
* DESCRIPTION: Check for new GPE methods (_Lxx/_Exx) made available as a
|
||||
* result of a Load() or LoadTable() operation. If new GPE
|
||||
* methods have been installed, register the new methods and
|
||||
* enable and runtime GPEs that are associated with them. Also,
|
||||
* run any newly loaded _PRW methods in order to discover any
|
||||
* new CAN_WAKE GPEs.
|
||||
* methods have been installed, register the new methods.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
@@ -303,49 +240,13 @@ AcpiEvUpdateGpes (
|
||||
ACPI_GPE_BLOCK_INFO *GpeBlock;
|
||||
ACPI_GPE_WALK_INFO WalkInfo;
|
||||
ACPI_STATUS Status = AE_OK;
|
||||
UINT32 NewWakeGpeCount = 0;
|
||||
|
||||
|
||||
/* We will examine only _PRW/_Lxx/_Exx methods owned by this table */
|
||||
|
||||
WalkInfo.OwnerId = TableOwnerId;
|
||||
WalkInfo.ExecuteByOwnerId = TRUE;
|
||||
WalkInfo.Count = 0;
|
||||
|
||||
if (AcpiGbl_LeaveWakeGpesDisabled)
|
||||
{
|
||||
/*
|
||||
* 1) Run any newly-loaded _PRW methods to find any GPEs that
|
||||
* can now be marked as CAN_WAKE GPEs. Note: We must run the
|
||||
* _PRW methods before we process the _Lxx/_Exx methods because
|
||||
* we will enable all runtime GPEs associated with the new
|
||||
* _Lxx/_Exx methods at the time we process those methods.
|
||||
*
|
||||
* Unlock interpreter so that we can run the _PRW methods.
|
||||
*/
|
||||
WalkInfo.GpeBlock = NULL;
|
||||
WalkInfo.GpeDevice = NULL;
|
||||
|
||||
AcpiExExitInterpreter ();
|
||||
|
||||
Status = AcpiNsWalkNamespace (ACPI_TYPE_DEVICE, ACPI_ROOT_OBJECT,
|
||||
ACPI_UINT32_MAX, ACPI_NS_WALK_NO_UNLOCK,
|
||||
AcpiEvMatchPrwAndGpe, NULL, &WalkInfo, NULL);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
ACPI_EXCEPTION ((AE_INFO, Status,
|
||||
"While executing _PRW methods"));
|
||||
}
|
||||
|
||||
AcpiExEnterInterpreter ();
|
||||
NewWakeGpeCount = WalkInfo.Count;
|
||||
}
|
||||
|
||||
/*
|
||||
* 2) Find any _Lxx/_Exx GPE methods that have just been loaded.
|
||||
* Find any _Lxx/_Exx GPE methods that have just been loaded.
|
||||
*
|
||||
* Any GPEs that correspond to new _Lxx/_Exx methods and are not
|
||||
* marked as CAN_WAKE are immediately enabled.
|
||||
* Any GPEs that correspond to new _Lxx/_Exx methods are immediately
|
||||
* enabled.
|
||||
*
|
||||
* Examine the namespace underneath each GpeDevice within the
|
||||
* GpeBlock lists.
|
||||
@@ -357,7 +258,8 @@ AcpiEvUpdateGpes (
|
||||
}
|
||||
|
||||
WalkInfo.Count = 0;
|
||||
WalkInfo.EnableThisGpe = TRUE;
|
||||
WalkInfo.OwnerId = TableOwnerId;
|
||||
WalkInfo.ExecuteByOwnerId = TRUE;
|
||||
|
||||
/* Walk the interrupt level descriptor list */
|
||||
|
||||
@@ -388,11 +290,9 @@ AcpiEvUpdateGpes (
|
||||
GpeXruptInfo = GpeXruptInfo->Next;
|
||||
}
|
||||
|
||||
if (WalkInfo.Count || NewWakeGpeCount)
|
||||
if (WalkInfo.Count)
|
||||
{
|
||||
ACPI_INFO ((AE_INFO,
|
||||
"Enabled %u new runtime GPEs, added %u new wakeup GPEs",
|
||||
WalkInfo.Count, NewWakeGpeCount));
|
||||
ACPI_INFO ((AE_INFO, "Enabled %u new GPEs", WalkInfo.Count));
|
||||
}
|
||||
|
||||
(void) AcpiUtReleaseMutex (ACPI_MTX_EVENTS);
|
||||
@@ -422,9 +322,7 @@ AcpiEvUpdateGpes (
|
||||
* xx - is the GPE number [in HEX]
|
||||
*
|
||||
* If WalkInfo->ExecuteByOwnerId is TRUE, we only execute examine GPE methods
|
||||
* with that owner.
|
||||
* If WalkInfo->EnableThisGpe is TRUE, the GPE that is referred to by a GPE
|
||||
* method is immediately enabled (Used for Load/LoadTable operators)
|
||||
* with that owner.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
@@ -438,8 +336,6 @@ AcpiEvMatchGpeMethod (
|
||||
ACPI_NAMESPACE_NODE *MethodNode = ACPI_CAST_PTR (ACPI_NAMESPACE_NODE, ObjHandle);
|
||||
ACPI_GPE_WALK_INFO *WalkInfo = ACPI_CAST_PTR (ACPI_GPE_WALK_INFO, Context);
|
||||
ACPI_GPE_EVENT_INFO *GpeEventInfo;
|
||||
ACPI_NAMESPACE_NODE *GpeDevice;
|
||||
ACPI_STATUS Status;
|
||||
UINT32 GpeNumber;
|
||||
char Name[ACPI_NAME_SIZE + 1];
|
||||
UINT8 Type;
|
||||
@@ -474,21 +370,21 @@ AcpiEvMatchGpeMethod (
|
||||
/*
|
||||
* 3) Edge/Level determination is based on the 2nd character
|
||||
* of the method name
|
||||
*
|
||||
* NOTE: Default GPE type is RUNTIME only. Later, if a _PRW object is
|
||||
* found that points to this GPE, the ACPI_GPE_CAN_WAKE flag is set.
|
||||
*/
|
||||
switch (Name[1])
|
||||
{
|
||||
case 'L':
|
||||
|
||||
Type = ACPI_GPE_LEVEL_TRIGGERED;
|
||||
break;
|
||||
|
||||
case 'E':
|
||||
|
||||
Type = ACPI_GPE_EDGE_TRIGGERED;
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
/* Unknown method type, just ignore it */
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_LOAD,
|
||||
@@ -547,216 +443,22 @@ AcpiEvMatchGpeMethod (
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
}
|
||||
|
||||
/* Disable the GPE in case it's been enabled already. */
|
||||
|
||||
(void) AcpiHwLowSetGpe (GpeEventInfo, ACPI_GPE_DISABLE);
|
||||
|
||||
/*
|
||||
* Add the GPE information from above to the GpeEventInfo block for
|
||||
* use during dispatch of this GPE.
|
||||
*/
|
||||
GpeEventInfo->Flags &= ~(ACPI_GPE_DISPATCH_MASK);
|
||||
GpeEventInfo->Flags |= (UINT8) (Type | ACPI_GPE_DISPATCH_METHOD);
|
||||
GpeEventInfo->Dispatch.MethodNode = MethodNode;
|
||||
|
||||
/*
|
||||
* Enable this GPE if requested. This only happens when during the
|
||||
* execution of a Load or LoadTable operator. We have found a new
|
||||
* GPE method and want to immediately enable the GPE if it is a
|
||||
* runtime GPE.
|
||||
*/
|
||||
if (WalkInfo->EnableThisGpe)
|
||||
{
|
||||
/* Ignore GPEs that can wake the system */
|
||||
|
||||
if (!(GpeEventInfo->Flags & ACPI_GPE_CAN_WAKE) ||
|
||||
!AcpiGbl_LeaveWakeGpesDisabled)
|
||||
{
|
||||
WalkInfo->Count++;
|
||||
GpeDevice = WalkInfo->GpeDevice;
|
||||
|
||||
if (GpeDevice == AcpiGbl_FadtGpeDevice)
|
||||
{
|
||||
GpeDevice = NULL;
|
||||
}
|
||||
|
||||
Status = AcpiEnableGpe (GpeDevice, GpeNumber);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
ACPI_EXCEPTION ((AE_INFO, Status,
|
||||
"Could not enable GPE 0x%02X", GpeNumber));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_LOAD,
|
||||
"Registered GPE method %s as GPE number 0x%.2X\n",
|
||||
Name, GpeNumber));
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiEvMatchPrwAndGpe
|
||||
*
|
||||
* PARAMETERS: Callback from WalkNamespace
|
||||
*
|
||||
* RETURN: Status. NOTE: We ignore errors so that the _PRW walk is
|
||||
* not aborted on a single _PRW failure.
|
||||
*
|
||||
* DESCRIPTION: Called from AcpiWalkNamespace. Expects each object to be a
|
||||
* Device. Run the _PRW method. If present, extract the GPE
|
||||
* number and mark the GPE as a CAN_WAKE GPE. Allows a
|
||||
* per-OwnerId execution if ExecuteByOwnerId is TRUE in the
|
||||
* WalkInfo parameter block.
|
||||
*
|
||||
* If WalkInfo->ExecuteByOwnerId is TRUE, we only execute _PRWs with that
|
||||
* owner.
|
||||
* If WalkInfo->GpeDevice is NULL, we execute every _PRW found. Otherwise,
|
||||
* we only execute _PRWs that refer to the input GpeDevice.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiEvMatchPrwAndGpe (
|
||||
ACPI_HANDLE ObjHandle,
|
||||
UINT32 Level,
|
||||
void *Context,
|
||||
void **ReturnValue)
|
||||
{
|
||||
ACPI_GPE_WALK_INFO *WalkInfo = ACPI_CAST_PTR (ACPI_GPE_WALK_INFO, Context);
|
||||
ACPI_NAMESPACE_NODE *GpeDevice;
|
||||
ACPI_GPE_BLOCK_INFO *GpeBlock;
|
||||
ACPI_NAMESPACE_NODE *TargetGpeDevice;
|
||||
ACPI_NAMESPACE_NODE *PrwNode;
|
||||
ACPI_GPE_EVENT_INFO *GpeEventInfo;
|
||||
ACPI_OPERAND_OBJECT *PkgDesc;
|
||||
ACPI_OPERAND_OBJECT *ObjDesc;
|
||||
UINT32 GpeNumber;
|
||||
ACPI_STATUS Status;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE (EvMatchPrwAndGpe);
|
||||
|
||||
|
||||
/* Check for a _PRW method under this device */
|
||||
|
||||
Status = AcpiNsGetNode (ObjHandle, METHOD_NAME__PRW,
|
||||
ACPI_NS_NO_UPSEARCH, &PrwNode);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
}
|
||||
|
||||
/* Check if requested OwnerId matches this OwnerId */
|
||||
|
||||
if ((WalkInfo->ExecuteByOwnerId) &&
|
||||
(PrwNode->OwnerId != WalkInfo->OwnerId))
|
||||
{
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
}
|
||||
|
||||
/* Execute the _PRW */
|
||||
|
||||
Status = AcpiUtEvaluateObject (PrwNode, NULL,
|
||||
ACPI_BTYPE_PACKAGE, &PkgDesc);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
}
|
||||
|
||||
/* The returned _PRW package must have at least two elements */
|
||||
|
||||
if (PkgDesc->Package.Count < 2)
|
||||
{
|
||||
goto Cleanup;
|
||||
}
|
||||
|
||||
/* Extract pointers from the input context */
|
||||
|
||||
GpeDevice = WalkInfo->GpeDevice;
|
||||
GpeBlock = WalkInfo->GpeBlock;
|
||||
|
||||
/*
|
||||
* The _PRW object must return a package, we are only interested
|
||||
* in the first element
|
||||
*/
|
||||
ObjDesc = PkgDesc->Package.Elements[0];
|
||||
|
||||
if (ObjDesc->Common.Type == ACPI_TYPE_INTEGER)
|
||||
{
|
||||
/* Use FADT-defined GPE device (from definition of _PRW) */
|
||||
|
||||
TargetGpeDevice = NULL;
|
||||
if (GpeDevice)
|
||||
{
|
||||
TargetGpeDevice = AcpiGbl_FadtGpeDevice;
|
||||
}
|
||||
|
||||
/* Integer is the GPE number in the FADT described GPE blocks */
|
||||
|
||||
GpeNumber = (UINT32) ObjDesc->Integer.Value;
|
||||
}
|
||||
else if (ObjDesc->Common.Type == ACPI_TYPE_PACKAGE)
|
||||
{
|
||||
/* Package contains a GPE reference and GPE number within a GPE block */
|
||||
|
||||
if ((ObjDesc->Package.Count < 2) ||
|
||||
((ObjDesc->Package.Elements[0])->Common.Type !=
|
||||
ACPI_TYPE_LOCAL_REFERENCE) ||
|
||||
((ObjDesc->Package.Elements[1])->Common.Type !=
|
||||
ACPI_TYPE_INTEGER))
|
||||
{
|
||||
goto Cleanup;
|
||||
}
|
||||
|
||||
/* Get GPE block reference and decode */
|
||||
|
||||
TargetGpeDevice = ObjDesc->Package.Elements[0]->Reference.Node;
|
||||
GpeNumber = (UINT32) ObjDesc->Package.Elements[1]->Integer.Value;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Unknown type, just ignore it */
|
||||
|
||||
goto Cleanup;
|
||||
}
|
||||
|
||||
/* Get the GpeEventInfo for this GPE */
|
||||
|
||||
if (GpeDevice)
|
||||
{
|
||||
/*
|
||||
* Is this GPE within this block?
|
||||
*
|
||||
* TRUE if and only if these conditions are true:
|
||||
* 1) The GPE devices match.
|
||||
* 2) The GPE index(number) is within the range of the Gpe Block
|
||||
* associated with the GPE device.
|
||||
*/
|
||||
if (GpeDevice != TargetGpeDevice)
|
||||
{
|
||||
goto Cleanup;
|
||||
}
|
||||
|
||||
GpeEventInfo = AcpiEvLowGetGpeInfo (GpeNumber, GpeBlock);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* GpeDevice is NULL, just match the TargetDevice and GpeNumber */
|
||||
|
||||
GpeEventInfo = AcpiEvGetGpeEventInfo (TargetGpeDevice, GpeNumber);
|
||||
}
|
||||
|
||||
if (GpeEventInfo)
|
||||
{
|
||||
if (!(GpeEventInfo->Flags & ACPI_GPE_CAN_WAKE))
|
||||
{
|
||||
/* This GPE can wake the system */
|
||||
|
||||
GpeEventInfo->Flags |= ACPI_GPE_CAN_WAKE;
|
||||
WalkInfo->Count++;
|
||||
}
|
||||
}
|
||||
|
||||
Cleanup:
|
||||
AcpiUtRemoveReference (PkgDesc);
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
}
|
||||
|
||||
#endif /* !ACPI_REDUCED_HARDWARE */
|
||||
|
||||
@@ -4,115 +4,42 @@
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
* 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.
|
||||
*
|
||||
* 2.1. This is your license from Intel Corp. under its intellectual property
|
||||
* rights. You may have additional license terms from the party that provided
|
||||
* you this software, covering your right to use that party's intellectual
|
||||
* property rights.
|
||||
* 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.
|
||||
*
|
||||
* 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
|
||||
* copy of the source code appearing in this file ("Covered Code") an
|
||||
* irrevocable, perpetual, worldwide license under Intel's copyrights in the
|
||||
* base code distributed originally by Intel ("Original Intel Code") to copy,
|
||||
* make derivatives, distribute, use and display any portion of the Covered
|
||||
* Code in any form, with the right to sublicense such rights; and
|
||||
*
|
||||
* 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
|
||||
* license (with the right to sublicense), under only those claims of Intel
|
||||
* patents that are infringed by the Original Intel Code, to make, use, sell,
|
||||
* offer to sell, and import the Covered Code and derivative works thereof
|
||||
* solely to the minimum extent necessary to exercise the above copyright
|
||||
* license, and in no event shall the patent license extend to any additions
|
||||
* to or modifications of the Original Intel Code. No other license or right
|
||||
* is granted directly or by implication, estoppel or otherwise;
|
||||
*
|
||||
* The above copyright and patent license is granted only if the following
|
||||
* conditions are met:
|
||||
*
|
||||
* 3. Conditions
|
||||
*
|
||||
* 3.1. Redistribution of Source with Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification with rights to further distribute source must include
|
||||
* the above Copyright Notice, the above License, this list of Conditions,
|
||||
* and the following Disclaimer and Export Compliance provision. In addition,
|
||||
* Licensee must cause all Covered Code to which Licensee contributes to
|
||||
* contain a file documenting the changes Licensee made to create that Covered
|
||||
* Code and the date of any change. Licensee must include in that file the
|
||||
* documentation of any changes made by any predecessor Licensee. Licensee
|
||||
* must include a prominent statement that the modification is derived,
|
||||
* directly or indirectly, from Original Intel Code.
|
||||
*
|
||||
* 3.2. Redistribution of Source with no Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification without rights to further distribute source must
|
||||
* include the following Disclaimer and Export Compliance provision in the
|
||||
* documentation and/or other materials provided with distribution. In
|
||||
* addition, Licensee may not authorize further sublicense of source of any
|
||||
* portion of the Covered Code, and must include terms to the effect that the
|
||||
* license from Licensee to its licensee is limited to the intellectual
|
||||
* property embodied in the software Licensee provides to its licensee, and
|
||||
* not to intellectual property embodied in modifications its licensee may
|
||||
* make.
|
||||
*
|
||||
* 3.3. Redistribution of Executable. Redistribution in executable form of any
|
||||
* substantial portion of the Covered Code or modification must reproduce the
|
||||
* above Copyright Notice, and the following Disclaimer and Export Compliance
|
||||
* provision in the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3.4. Intel retains all right, title, and interest in and to the Original
|
||||
* Intel Code.
|
||||
*
|
||||
* 3.5. Neither the name Intel nor any other trademark owned or controlled by
|
||||
* Intel shall be used in advertising or otherwise to promote the sale, use or
|
||||
* other dealings in products derived from or relating to the Covered Code
|
||||
* without prior written authorization from Intel.
|
||||
*
|
||||
* 4. Disclaimer and Export Compliance
|
||||
*
|
||||
* 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
|
||||
* HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
|
||||
* IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
|
||||
* INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
|
||||
* UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
|
||||
* PARTICULAR PURPOSE.
|
||||
*
|
||||
* 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
|
||||
* OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
|
||||
* COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
|
||||
* SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
|
||||
* CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
|
||||
* HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
|
||||
* SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
|
||||
* LIMITED REMEDY.
|
||||
*
|
||||
* 4.3. Licensee shall not export, either directly or indirectly, any of this
|
||||
* software or system incorporating such software without first obtaining any
|
||||
* required license or other approval from the U. S. Department of Commerce or
|
||||
* any other agency or department of the United States Government. In the
|
||||
* event Licensee exports any such software from the United States or
|
||||
* re-exports any such software from a foreign destination, Licensee shall
|
||||
* ensure that the distribution and export/re-export of the software is in
|
||||
* compliance with all laws, regulations, orders, or other restrictions of the
|
||||
* U.S. Export Administration Regulations. Licensee agrees that neither it nor
|
||||
* any of its subsidiaries will export/re-export any technical data, process,
|
||||
* software, or service, directly or indirectly, to any country for which the
|
||||
* United States government or any agency thereof requires an export license,
|
||||
* other governmental approval, or letter of assurance, without first obtaining
|
||||
* such license, approval or letter.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#include "acpi.h"
|
||||
#include "accommon.h"
|
||||
@@ -122,6 +49,7 @@
|
||||
ACPI_MODULE_NAME ("evgpeutil")
|
||||
|
||||
|
||||
#if (!ACPI_REDUCED_HARDWARE) /* Entire module */
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiEvWalkGpeList
|
||||
@@ -239,13 +167,59 @@ AcpiEvValidGpeEvent (
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiEvGetGpeDevice
|
||||
*
|
||||
* PARAMETERS: GPE_WALK_CALLBACK
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Matches the input GPE index (0-CurrentGpeCount) with a GPE
|
||||
* block device. NULL if the GPE is one of the FADT-defined GPEs.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiEvGetGpeDevice (
|
||||
ACPI_GPE_XRUPT_INFO *GpeXruptInfo,
|
||||
ACPI_GPE_BLOCK_INFO *GpeBlock,
|
||||
void *Context)
|
||||
{
|
||||
ACPI_GPE_DEVICE_INFO *Info = Context;
|
||||
|
||||
|
||||
/* Increment Index by the number of GPEs in this block */
|
||||
|
||||
Info->NextBlockBaseIndex += GpeBlock->GpeCount;
|
||||
|
||||
if (Info->Index < Info->NextBlockBaseIndex)
|
||||
{
|
||||
/*
|
||||
* The GPE index is within this block, get the node. Leave the node
|
||||
* NULL for the FADT-defined GPEs
|
||||
*/
|
||||
if ((GpeBlock->Node)->Type == ACPI_TYPE_DEVICE)
|
||||
{
|
||||
Info->GpeDevice = GpeBlock->Node;
|
||||
}
|
||||
|
||||
Info->Status = AE_OK;
|
||||
return (AE_CTRL_END);
|
||||
}
|
||||
|
||||
return (AE_OK);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiEvGetGpeXruptBlock
|
||||
*
|
||||
* PARAMETERS: InterruptNumber - Interrupt for a GPE block
|
||||
* PARAMETERS: InterruptNumber - Interrupt for a GPE block
|
||||
* GpeXruptBlock - Where the block is returned
|
||||
*
|
||||
* RETURN: A GPE interrupt block
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Get or Create a GPE interrupt block. There is one interrupt
|
||||
* block per unique interrupt level used for GPEs. Should be
|
||||
@@ -254,9 +228,10 @@ AcpiEvValidGpeEvent (
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_GPE_XRUPT_INFO *
|
||||
ACPI_STATUS
|
||||
AcpiEvGetGpeXruptBlock (
|
||||
UINT32 InterruptNumber)
|
||||
UINT32 InterruptNumber,
|
||||
ACPI_GPE_XRUPT_INFO **GpeXruptBlock)
|
||||
{
|
||||
ACPI_GPE_XRUPT_INFO *NextGpeXrupt;
|
||||
ACPI_GPE_XRUPT_INFO *GpeXrupt;
|
||||
@@ -274,7 +249,8 @@ AcpiEvGetGpeXruptBlock (
|
||||
{
|
||||
if (NextGpeXrupt->InterruptNumber == InterruptNumber)
|
||||
{
|
||||
return_PTR (NextGpeXrupt);
|
||||
*GpeXruptBlock = NextGpeXrupt;
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
}
|
||||
|
||||
NextGpeXrupt = NextGpeXrupt->Next;
|
||||
@@ -285,7 +261,7 @@ AcpiEvGetGpeXruptBlock (
|
||||
GpeXrupt = ACPI_ALLOCATE_ZEROED (sizeof (ACPI_GPE_XRUPT_INFO));
|
||||
if (!GpeXrupt)
|
||||
{
|
||||
return_PTR (NULL);
|
||||
return_ACPI_STATUS (AE_NO_MEMORY);
|
||||
}
|
||||
|
||||
GpeXrupt->InterruptNumber = InterruptNumber;
|
||||
@@ -308,6 +284,7 @@ AcpiEvGetGpeXruptBlock (
|
||||
{
|
||||
AcpiGbl_GpeXruptListHead = GpeXrupt;
|
||||
}
|
||||
|
||||
AcpiOsReleaseLock (AcpiGbl_GpeLock, Flags);
|
||||
|
||||
/* Install new interrupt handler if not SCI_INT */
|
||||
@@ -318,14 +295,15 @@ AcpiEvGetGpeXruptBlock (
|
||||
AcpiEvGpeXruptHandler, GpeXrupt);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
ACPI_ERROR ((AE_INFO,
|
||||
ACPI_EXCEPTION ((AE_INFO, Status,
|
||||
"Could not install GPE interrupt handler at level 0x%X",
|
||||
InterruptNumber));
|
||||
return_PTR (NULL);
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
}
|
||||
|
||||
return_PTR (GpeXrupt);
|
||||
*GpeXruptBlock = GpeXrupt;
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
}
|
||||
|
||||
|
||||
@@ -418,6 +396,8 @@ AcpiEvDeleteGpeHandlers (
|
||||
void *Context)
|
||||
{
|
||||
ACPI_GPE_EVENT_INFO *GpeEventInfo;
|
||||
ACPI_GPE_NOTIFY_INFO *Notify;
|
||||
ACPI_GPE_NOTIFY_INFO *Next;
|
||||
UINT32 i;
|
||||
UINT32 j;
|
||||
|
||||
@@ -439,13 +419,31 @@ AcpiEvDeleteGpeHandlers (
|
||||
if ((GpeEventInfo->Flags & ACPI_GPE_DISPATCH_MASK) ==
|
||||
ACPI_GPE_DISPATCH_HANDLER)
|
||||
{
|
||||
/* Delete an installed handler block */
|
||||
|
||||
ACPI_FREE (GpeEventInfo->Dispatch.Handler);
|
||||
GpeEventInfo->Dispatch.Handler = NULL;
|
||||
GpeEventInfo->Flags &= ~ACPI_GPE_DISPATCH_MASK;
|
||||
}
|
||||
else if ((GpeEventInfo->Flags & ACPI_GPE_DISPATCH_MASK) ==
|
||||
ACPI_GPE_DISPATCH_NOTIFY)
|
||||
{
|
||||
/* Delete the implicit notification device list */
|
||||
|
||||
Notify = GpeEventInfo->Dispatch.NotifyList;
|
||||
while (Notify)
|
||||
{
|
||||
Next = Notify->Next;
|
||||
ACPI_FREE (Notify);
|
||||
Notify = Next;
|
||||
}
|
||||
GpeEventInfo->Dispatch.NotifyList = NULL;
|
||||
GpeEventInfo->Flags &= ~ACPI_GPE_DISPATCH_MASK;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
}
|
||||
|
||||
#endif /* !ACPI_REDUCED_HARDWARE */
|
||||
|
||||
582
minix/drivers/power/acpi/events/evhandler.c
Normal file
582
minix/drivers/power/acpi/events/evhandler.c
Normal file
@@ -0,0 +1,582 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Module Name: evhandler - Support for Address Space handlers
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, 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.
|
||||
*/
|
||||
|
||||
#include "acpi.h"
|
||||
#include "accommon.h"
|
||||
#include "acevents.h"
|
||||
#include "acnamesp.h"
|
||||
#include "acinterp.h"
|
||||
|
||||
#define _COMPONENT ACPI_EVENTS
|
||||
ACPI_MODULE_NAME ("evhandler")
|
||||
|
||||
|
||||
/* Local prototypes */
|
||||
|
||||
static ACPI_STATUS
|
||||
AcpiEvInstallHandler (
|
||||
ACPI_HANDLE ObjHandle,
|
||||
UINT32 Level,
|
||||
void *Context,
|
||||
void **ReturnValue);
|
||||
|
||||
/* These are the address spaces that will get default handlers */
|
||||
|
||||
UINT8 AcpiGbl_DefaultAddressSpaces[ACPI_NUM_DEFAULT_SPACES] =
|
||||
{
|
||||
ACPI_ADR_SPACE_SYSTEM_MEMORY,
|
||||
ACPI_ADR_SPACE_SYSTEM_IO,
|
||||
ACPI_ADR_SPACE_PCI_CONFIG,
|
||||
ACPI_ADR_SPACE_DATA_TABLE
|
||||
};
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiEvInstallRegionHandlers
|
||||
*
|
||||
* PARAMETERS: None
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Installs the core subsystem default address space handlers.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiEvInstallRegionHandlers (
|
||||
void)
|
||||
{
|
||||
ACPI_STATUS Status;
|
||||
UINT32 i;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE (EvInstallRegionHandlers);
|
||||
|
||||
|
||||
Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
/*
|
||||
* All address spaces (PCI Config, EC, SMBus) are scope dependent and
|
||||
* registration must occur for a specific device.
|
||||
*
|
||||
* In the case of the system memory and IO address spaces there is
|
||||
* currently no device associated with the address space. For these we
|
||||
* use the root.
|
||||
*
|
||||
* We install the default PCI config space handler at the root so that
|
||||
* this space is immediately available even though the we have not
|
||||
* enumerated all the PCI Root Buses yet. This is to conform to the ACPI
|
||||
* specification which states that the PCI config space must be always
|
||||
* available -- even though we are nowhere near ready to find the PCI root
|
||||
* buses at this point.
|
||||
*
|
||||
* NOTE: We ignore AE_ALREADY_EXISTS because this means that a handler
|
||||
* has already been installed (via AcpiInstallAddressSpaceHandler).
|
||||
* Similar for AE_SAME_HANDLER.
|
||||
*/
|
||||
for (i = 0; i < ACPI_NUM_DEFAULT_SPACES; i++)
|
||||
{
|
||||
Status = AcpiEvInstallSpaceHandler (AcpiGbl_RootNode,
|
||||
AcpiGbl_DefaultAddressSpaces[i],
|
||||
ACPI_DEFAULT_HANDLER, NULL, NULL);
|
||||
switch (Status)
|
||||
{
|
||||
case AE_OK:
|
||||
case AE_SAME_HANDLER:
|
||||
case AE_ALREADY_EXISTS:
|
||||
|
||||
/* These exceptions are all OK */
|
||||
|
||||
Status = AE_OK;
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
goto UnlockAndExit;
|
||||
}
|
||||
}
|
||||
|
||||
UnlockAndExit:
|
||||
(void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiEvHasDefaultHandler
|
||||
*
|
||||
* PARAMETERS: Node - Namespace node for the device
|
||||
* SpaceId - The address space ID
|
||||
*
|
||||
* RETURN: TRUE if default handler is installed, FALSE otherwise
|
||||
*
|
||||
* DESCRIPTION: Check if the default handler is installed for the requested
|
||||
* space ID.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
BOOLEAN
|
||||
AcpiEvHasDefaultHandler (
|
||||
ACPI_NAMESPACE_NODE *Node,
|
||||
ACPI_ADR_SPACE_TYPE SpaceId)
|
||||
{
|
||||
ACPI_OPERAND_OBJECT *ObjDesc;
|
||||
ACPI_OPERAND_OBJECT *HandlerObj;
|
||||
|
||||
|
||||
/* Must have an existing internal object */
|
||||
|
||||
ObjDesc = AcpiNsGetAttachedObject (Node);
|
||||
if (ObjDesc)
|
||||
{
|
||||
HandlerObj = ObjDesc->Device.Handler;
|
||||
|
||||
/* Walk the linked list of handlers for this object */
|
||||
|
||||
while (HandlerObj)
|
||||
{
|
||||
if (HandlerObj->AddressSpace.SpaceId == SpaceId)
|
||||
{
|
||||
if (HandlerObj->AddressSpace.HandlerFlags &
|
||||
ACPI_ADDR_HANDLER_DEFAULT_INSTALLED)
|
||||
{
|
||||
return (TRUE);
|
||||
}
|
||||
}
|
||||
|
||||
HandlerObj = HandlerObj->AddressSpace.Next;
|
||||
}
|
||||
}
|
||||
|
||||
return (FALSE);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiEvInstallHandler
|
||||
*
|
||||
* PARAMETERS: WalkNamespace callback
|
||||
*
|
||||
* DESCRIPTION: This routine installs an address handler into objects that are
|
||||
* of type Region or Device.
|
||||
*
|
||||
* If the Object is a Device, and the device has a handler of
|
||||
* the same type then the search is terminated in that branch.
|
||||
*
|
||||
* This is because the existing handler is closer in proximity
|
||||
* to any more regions than the one we are trying to install.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
static ACPI_STATUS
|
||||
AcpiEvInstallHandler (
|
||||
ACPI_HANDLE ObjHandle,
|
||||
UINT32 Level,
|
||||
void *Context,
|
||||
void **ReturnValue)
|
||||
{
|
||||
ACPI_OPERAND_OBJECT *HandlerObj;
|
||||
ACPI_OPERAND_OBJECT *NextHandlerObj;
|
||||
ACPI_OPERAND_OBJECT *ObjDesc;
|
||||
ACPI_NAMESPACE_NODE *Node;
|
||||
ACPI_STATUS Status;
|
||||
|
||||
|
||||
ACPI_FUNCTION_NAME (EvInstallHandler);
|
||||
|
||||
|
||||
HandlerObj = (ACPI_OPERAND_OBJECT *) Context;
|
||||
|
||||
/* Parameter validation */
|
||||
|
||||
if (!HandlerObj)
|
||||
{
|
||||
return (AE_OK);
|
||||
}
|
||||
|
||||
/* Convert and validate the device handle */
|
||||
|
||||
Node = AcpiNsValidateHandle (ObjHandle);
|
||||
if (!Node)
|
||||
{
|
||||
return (AE_BAD_PARAMETER);
|
||||
}
|
||||
|
||||
/*
|
||||
* We only care about regions and objects that are allowed to have
|
||||
* address space handlers
|
||||
*/
|
||||
if ((Node->Type != ACPI_TYPE_DEVICE) &&
|
||||
(Node->Type != ACPI_TYPE_REGION) &&
|
||||
(Node != AcpiGbl_RootNode))
|
||||
{
|
||||
return (AE_OK);
|
||||
}
|
||||
|
||||
/* Check for an existing internal object */
|
||||
|
||||
ObjDesc = AcpiNsGetAttachedObject (Node);
|
||||
if (!ObjDesc)
|
||||
{
|
||||
/* No object, just exit */
|
||||
|
||||
return (AE_OK);
|
||||
}
|
||||
|
||||
/* Devices are handled different than regions */
|
||||
|
||||
if (ObjDesc->Common.Type == ACPI_TYPE_DEVICE)
|
||||
{
|
||||
/* Check if this Device already has a handler for this address space */
|
||||
|
||||
NextHandlerObj = ObjDesc->Device.Handler;
|
||||
while (NextHandlerObj)
|
||||
{
|
||||
/* Found a handler, is it for the same address space? */
|
||||
|
||||
if (NextHandlerObj->AddressSpace.SpaceId ==
|
||||
HandlerObj->AddressSpace.SpaceId)
|
||||
{
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_OPREGION,
|
||||
"Found handler for region [%s] in device %p(%p) "
|
||||
"handler %p\n",
|
||||
AcpiUtGetRegionName (HandlerObj->AddressSpace.SpaceId),
|
||||
ObjDesc, NextHandlerObj, HandlerObj));
|
||||
|
||||
/*
|
||||
* Since the object we found it on was a device, then it
|
||||
* means that someone has already installed a handler for
|
||||
* the branch of the namespace from this device on. Just
|
||||
* bail out telling the walk routine to not traverse this
|
||||
* branch. This preserves the scoping rule for handlers.
|
||||
*/
|
||||
return (AE_CTRL_DEPTH);
|
||||
}
|
||||
|
||||
/* Walk the linked list of handlers attached to this device */
|
||||
|
||||
NextHandlerObj = NextHandlerObj->AddressSpace.Next;
|
||||
}
|
||||
|
||||
/*
|
||||
* As long as the device didn't have a handler for this space we
|
||||
* don't care about it. We just ignore it and proceed.
|
||||
*/
|
||||
return (AE_OK);
|
||||
}
|
||||
|
||||
/* Object is a Region */
|
||||
|
||||
if (ObjDesc->Region.SpaceId != HandlerObj->AddressSpace.SpaceId)
|
||||
{
|
||||
/* This region is for a different address space, just ignore it */
|
||||
|
||||
return (AE_OK);
|
||||
}
|
||||
|
||||
/*
|
||||
* Now we have a region and it is for the handler's address space type.
|
||||
*
|
||||
* First disconnect region for any previous handler (if any)
|
||||
*/
|
||||
AcpiEvDetachRegion (ObjDesc, FALSE);
|
||||
|
||||
/* Connect the region to the new handler */
|
||||
|
||||
Status = AcpiEvAttachRegion (HandlerObj, ObjDesc, FALSE);
|
||||
return (Status);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiEvInstallSpaceHandler
|
||||
*
|
||||
* PARAMETERS: Node - Namespace node for the device
|
||||
* SpaceId - The address space ID
|
||||
* Handler - Address of the handler
|
||||
* Setup - Address of the setup function
|
||||
* Context - Value passed to the handler on each access
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Install a handler for all OpRegions of a given SpaceId.
|
||||
* Assumes namespace is locked
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiEvInstallSpaceHandler (
|
||||
ACPI_NAMESPACE_NODE *Node,
|
||||
ACPI_ADR_SPACE_TYPE SpaceId,
|
||||
ACPI_ADR_SPACE_HANDLER Handler,
|
||||
ACPI_ADR_SPACE_SETUP Setup,
|
||||
void *Context)
|
||||
{
|
||||
ACPI_OPERAND_OBJECT *ObjDesc;
|
||||
ACPI_OPERAND_OBJECT *HandlerObj;
|
||||
ACPI_STATUS Status;
|
||||
ACPI_OBJECT_TYPE Type;
|
||||
UINT8 Flags = 0;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE (EvInstallSpaceHandler);
|
||||
|
||||
|
||||
/*
|
||||
* This registration is valid for only the types below and the root. This
|
||||
* is where the default handlers get placed.
|
||||
*/
|
||||
if ((Node->Type != ACPI_TYPE_DEVICE) &&
|
||||
(Node->Type != ACPI_TYPE_PROCESSOR) &&
|
||||
(Node->Type != ACPI_TYPE_THERMAL) &&
|
||||
(Node != AcpiGbl_RootNode))
|
||||
{
|
||||
Status = AE_BAD_PARAMETER;
|
||||
goto UnlockAndExit;
|
||||
}
|
||||
|
||||
if (Handler == ACPI_DEFAULT_HANDLER)
|
||||
{
|
||||
Flags = ACPI_ADDR_HANDLER_DEFAULT_INSTALLED;
|
||||
|
||||
switch (SpaceId)
|
||||
{
|
||||
case ACPI_ADR_SPACE_SYSTEM_MEMORY:
|
||||
|
||||
Handler = AcpiExSystemMemorySpaceHandler;
|
||||
Setup = AcpiEvSystemMemoryRegionSetup;
|
||||
break;
|
||||
|
||||
case ACPI_ADR_SPACE_SYSTEM_IO:
|
||||
|
||||
Handler = AcpiExSystemIoSpaceHandler;
|
||||
Setup = AcpiEvIoSpaceRegionSetup;
|
||||
break;
|
||||
|
||||
case ACPI_ADR_SPACE_PCI_CONFIG:
|
||||
|
||||
Handler = AcpiExPciConfigSpaceHandler;
|
||||
Setup = AcpiEvPciConfigRegionSetup;
|
||||
break;
|
||||
|
||||
case ACPI_ADR_SPACE_CMOS:
|
||||
|
||||
Handler = AcpiExCmosSpaceHandler;
|
||||
Setup = AcpiEvCmosRegionSetup;
|
||||
break;
|
||||
|
||||
case ACPI_ADR_SPACE_PCI_BAR_TARGET:
|
||||
|
||||
Handler = AcpiExPciBarSpaceHandler;
|
||||
Setup = AcpiEvPciBarRegionSetup;
|
||||
break;
|
||||
|
||||
case ACPI_ADR_SPACE_DATA_TABLE:
|
||||
|
||||
Handler = AcpiExDataTableSpaceHandler;
|
||||
Setup = NULL;
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
Status = AE_BAD_PARAMETER;
|
||||
goto UnlockAndExit;
|
||||
}
|
||||
}
|
||||
|
||||
/* If the caller hasn't specified a setup routine, use the default */
|
||||
|
||||
if (!Setup)
|
||||
{
|
||||
Setup = AcpiEvDefaultRegionSetup;
|
||||
}
|
||||
|
||||
/* Check for an existing internal object */
|
||||
|
||||
ObjDesc = AcpiNsGetAttachedObject (Node);
|
||||
if (ObjDesc)
|
||||
{
|
||||
/*
|
||||
* The attached device object already exists. Make sure the handler
|
||||
* is not already installed.
|
||||
*/
|
||||
HandlerObj = ObjDesc->Device.Handler;
|
||||
|
||||
/* Walk the handler list for this device */
|
||||
|
||||
while (HandlerObj)
|
||||
{
|
||||
/* Same SpaceId indicates a handler already installed */
|
||||
|
||||
if (HandlerObj->AddressSpace.SpaceId == SpaceId)
|
||||
{
|
||||
if (HandlerObj->AddressSpace.Handler == Handler)
|
||||
{
|
||||
/*
|
||||
* It is (relatively) OK to attempt to install the SAME
|
||||
* handler twice. This can easily happen with the
|
||||
* PCI_Config space.
|
||||
*/
|
||||
Status = AE_SAME_HANDLER;
|
||||
goto UnlockAndExit;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* A handler is already installed */
|
||||
|
||||
Status = AE_ALREADY_EXISTS;
|
||||
}
|
||||
goto UnlockAndExit;
|
||||
}
|
||||
|
||||
/* Walk the linked list of handlers */
|
||||
|
||||
HandlerObj = HandlerObj->AddressSpace.Next;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_OPREGION,
|
||||
"Creating object on Device %p while installing handler\n", Node));
|
||||
|
||||
/* ObjDesc does not exist, create one */
|
||||
|
||||
if (Node->Type == ACPI_TYPE_ANY)
|
||||
{
|
||||
Type = ACPI_TYPE_DEVICE;
|
||||
}
|
||||
else
|
||||
{
|
||||
Type = Node->Type;
|
||||
}
|
||||
|
||||
ObjDesc = AcpiUtCreateInternalObject (Type);
|
||||
if (!ObjDesc)
|
||||
{
|
||||
Status = AE_NO_MEMORY;
|
||||
goto UnlockAndExit;
|
||||
}
|
||||
|
||||
/* Init new descriptor */
|
||||
|
||||
ObjDesc->Common.Type = (UINT8) Type;
|
||||
|
||||
/* Attach the new object to the Node */
|
||||
|
||||
Status = AcpiNsAttachObject (Node, ObjDesc, Type);
|
||||
|
||||
/* Remove local reference to the object */
|
||||
|
||||
AcpiUtRemoveReference (ObjDesc);
|
||||
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
goto UnlockAndExit;
|
||||
}
|
||||
}
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_OPREGION,
|
||||
"Installing address handler for region %s(%X) on Device %4.4s %p(%p)\n",
|
||||
AcpiUtGetRegionName (SpaceId), SpaceId,
|
||||
AcpiUtGetNodeName (Node), Node, ObjDesc));
|
||||
|
||||
/*
|
||||
* Install the handler
|
||||
*
|
||||
* At this point there is no existing handler. Just allocate the object
|
||||
* for the handler and link it into the list.
|
||||
*/
|
||||
HandlerObj = AcpiUtCreateInternalObject (ACPI_TYPE_LOCAL_ADDRESS_HANDLER);
|
||||
if (!HandlerObj)
|
||||
{
|
||||
Status = AE_NO_MEMORY;
|
||||
goto UnlockAndExit;
|
||||
}
|
||||
|
||||
/* Init handler obj */
|
||||
|
||||
HandlerObj->AddressSpace.SpaceId = (UINT8) SpaceId;
|
||||
HandlerObj->AddressSpace.HandlerFlags = Flags;
|
||||
HandlerObj->AddressSpace.RegionList = NULL;
|
||||
HandlerObj->AddressSpace.Node = Node;
|
||||
HandlerObj->AddressSpace.Handler = Handler;
|
||||
HandlerObj->AddressSpace.Context = Context;
|
||||
HandlerObj->AddressSpace.Setup = Setup;
|
||||
|
||||
/* Install at head of Device.AddressSpace list */
|
||||
|
||||
HandlerObj->AddressSpace.Next = ObjDesc->Device.Handler;
|
||||
|
||||
/*
|
||||
* The Device object is the first reference on the HandlerObj.
|
||||
* Each region that uses the handler adds a reference.
|
||||
*/
|
||||
ObjDesc->Device.Handler = HandlerObj;
|
||||
|
||||
/*
|
||||
* Walk the namespace finding all of the regions this
|
||||
* handler will manage.
|
||||
*
|
||||
* Start at the device and search the branch toward
|
||||
* the leaf nodes until either the leaf is encountered or
|
||||
* a device is detected that has an address handler of the
|
||||
* same type.
|
||||
*
|
||||
* In either case, back up and search down the remainder
|
||||
* of the branch
|
||||
*/
|
||||
Status = AcpiNsWalkNamespace (ACPI_TYPE_ANY, Node, ACPI_UINT32_MAX,
|
||||
ACPI_NS_WALK_UNLOCK, AcpiEvInstallHandler, NULL,
|
||||
HandlerObj, NULL);
|
||||
|
||||
UnlockAndExit:
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
@@ -4,120 +4,47 @@
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
* 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.
|
||||
*
|
||||
* 2.1. This is your license from Intel Corp. under its intellectual property
|
||||
* rights. You may have additional license terms from the party that provided
|
||||
* you this software, covering your right to use that party's intellectual
|
||||
* property rights.
|
||||
* 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.
|
||||
*
|
||||
* 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
|
||||
* copy of the source code appearing in this file ("Covered Code") an
|
||||
* irrevocable, perpetual, worldwide license under Intel's copyrights in the
|
||||
* base code distributed originally by Intel ("Original Intel Code") to copy,
|
||||
* make derivatives, distribute, use and display any portion of the Covered
|
||||
* Code in any form, with the right to sublicense such rights; and
|
||||
*
|
||||
* 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
|
||||
* license (with the right to sublicense), under only those claims of Intel
|
||||
* patents that are infringed by the Original Intel Code, to make, use, sell,
|
||||
* offer to sell, and import the Covered Code and derivative works thereof
|
||||
* solely to the minimum extent necessary to exercise the above copyright
|
||||
* license, and in no event shall the patent license extend to any additions
|
||||
* to or modifications of the Original Intel Code. No other license or right
|
||||
* is granted directly or by implication, estoppel or otherwise;
|
||||
*
|
||||
* The above copyright and patent license is granted only if the following
|
||||
* conditions are met:
|
||||
*
|
||||
* 3. Conditions
|
||||
*
|
||||
* 3.1. Redistribution of Source with Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification with rights to further distribute source must include
|
||||
* the above Copyright Notice, the above License, this list of Conditions,
|
||||
* and the following Disclaimer and Export Compliance provision. In addition,
|
||||
* Licensee must cause all Covered Code to which Licensee contributes to
|
||||
* contain a file documenting the changes Licensee made to create that Covered
|
||||
* Code and the date of any change. Licensee must include in that file the
|
||||
* documentation of any changes made by any predecessor Licensee. Licensee
|
||||
* must include a prominent statement that the modification is derived,
|
||||
* directly or indirectly, from Original Intel Code.
|
||||
*
|
||||
* 3.2. Redistribution of Source with no Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification without rights to further distribute source must
|
||||
* include the following Disclaimer and Export Compliance provision in the
|
||||
* documentation and/or other materials provided with distribution. In
|
||||
* addition, Licensee may not authorize further sublicense of source of any
|
||||
* portion of the Covered Code, and must include terms to the effect that the
|
||||
* license from Licensee to its licensee is limited to the intellectual
|
||||
* property embodied in the software Licensee provides to its licensee, and
|
||||
* not to intellectual property embodied in modifications its licensee may
|
||||
* make.
|
||||
*
|
||||
* 3.3. Redistribution of Executable. Redistribution in executable form of any
|
||||
* substantial portion of the Covered Code or modification must reproduce the
|
||||
* above Copyright Notice, and the following Disclaimer and Export Compliance
|
||||
* provision in the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3.4. Intel retains all right, title, and interest in and to the Original
|
||||
* Intel Code.
|
||||
*
|
||||
* 3.5. Neither the name Intel nor any other trademark owned or controlled by
|
||||
* Intel shall be used in advertising or otherwise to promote the sale, use or
|
||||
* other dealings in products derived from or relating to the Covered Code
|
||||
* without prior written authorization from Intel.
|
||||
*
|
||||
* 4. Disclaimer and Export Compliance
|
||||
*
|
||||
* 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
|
||||
* HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
|
||||
* IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
|
||||
* INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
|
||||
* UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
|
||||
* PARTICULAR PURPOSE.
|
||||
*
|
||||
* 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
|
||||
* OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
|
||||
* COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
|
||||
* SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
|
||||
* CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
|
||||
* HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
|
||||
* SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
|
||||
* LIMITED REMEDY.
|
||||
*
|
||||
* 4.3. Licensee shall not export, either directly or indirectly, any of this
|
||||
* software or system incorporating such software without first obtaining any
|
||||
* required license or other approval from the U. S. Department of Commerce or
|
||||
* any other agency or department of the United States Government. In the
|
||||
* event Licensee exports any such software from the United States or
|
||||
* re-exports any such software from a foreign destination, Licensee shall
|
||||
* ensure that the distribution and export/re-export of the software is in
|
||||
* compliance with all laws, regulations, orders, or other restrictions of the
|
||||
* U.S. Export Administration Regulations. Licensee agrees that neither it nor
|
||||
* any of its subsidiaries will export/re-export any technical data, process,
|
||||
* software, or service, directly or indirectly, to any country for which the
|
||||
* United States government or any agency thereof requires an export license,
|
||||
* other governmental approval, or letter of assurance, without first obtaining
|
||||
* such license, approval or letter.
|
||||
*
|
||||
*****************************************************************************/
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#include "acpi.h"
|
||||
#include "accommon.h"
|
||||
#include "acevents.h"
|
||||
#include "acnamesp.h"
|
||||
#include "acinterp.h"
|
||||
|
||||
#define _COMPONENT ACPI_EVENTS
|
||||
ACPI_MODULE_NAME ("evmisc")
|
||||
@@ -129,14 +56,6 @@ static void ACPI_SYSTEM_XFACE
|
||||
AcpiEvNotifyDispatch (
|
||||
void *Context);
|
||||
|
||||
static UINT32
|
||||
AcpiEvGlobalLockHandler (
|
||||
void *Context);
|
||||
|
||||
static ACPI_STATUS
|
||||
AcpiEvRemoveGlobalLockHandler (
|
||||
void);
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
@@ -167,6 +86,7 @@ AcpiEvIsNotifyObject (
|
||||
return (TRUE);
|
||||
|
||||
default:
|
||||
|
||||
return (FALSE);
|
||||
}
|
||||
}
|
||||
@@ -192,105 +112,82 @@ AcpiEvQueueNotifyRequest (
|
||||
UINT32 NotifyValue)
|
||||
{
|
||||
ACPI_OPERAND_OBJECT *ObjDesc;
|
||||
ACPI_OPERAND_OBJECT *HandlerObj = NULL;
|
||||
ACPI_GENERIC_STATE *NotifyInfo;
|
||||
ACPI_OPERAND_OBJECT *HandlerListHead = NULL;
|
||||
ACPI_GENERIC_STATE *Info;
|
||||
UINT8 HandlerListId = 0;
|
||||
ACPI_STATUS Status = AE_OK;
|
||||
|
||||
|
||||
ACPI_FUNCTION_NAME (EvQueueNotifyRequest);
|
||||
|
||||
|
||||
/*
|
||||
* For value 3 (Ejection Request), some device method may need to be run.
|
||||
* For value 2 (Device Wake) if _PRW exists, the _PS0 method may need
|
||||
* to be run.
|
||||
* For value 0x80 (Status Change) on the power button or sleep button,
|
||||
* initiate soft-off or sleep operation?
|
||||
*/
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
|
||||
"Dispatching Notify on [%4.4s] Node %p Value 0x%2.2X (%s)\n",
|
||||
AcpiUtGetNodeName (Node), Node, NotifyValue,
|
||||
AcpiUtGetNotifyName (NotifyValue)));
|
||||
/* Are Notifies allowed on this object? */
|
||||
|
||||
/* Get the notify object attached to the NS Node */
|
||||
if (!AcpiEvIsNotifyObject (Node))
|
||||
{
|
||||
return (AE_TYPE);
|
||||
}
|
||||
|
||||
/* Get the correct notify list type (System or Device) */
|
||||
|
||||
if (NotifyValue <= ACPI_MAX_SYS_NOTIFY)
|
||||
{
|
||||
HandlerListId = ACPI_SYSTEM_HANDLER_LIST;
|
||||
}
|
||||
else
|
||||
{
|
||||
HandlerListId = ACPI_DEVICE_HANDLER_LIST;
|
||||
}
|
||||
|
||||
/* Get the notify object attached to the namespace Node */
|
||||
|
||||
ObjDesc = AcpiNsGetAttachedObject (Node);
|
||||
if (ObjDesc)
|
||||
{
|
||||
/* We have the notify object, Get the right handler */
|
||||
/* We have an attached object, Get the correct handler list */
|
||||
|
||||
switch (Node->Type)
|
||||
{
|
||||
/* Notify allowed only on these types */
|
||||
|
||||
case ACPI_TYPE_DEVICE:
|
||||
case ACPI_TYPE_THERMAL:
|
||||
case ACPI_TYPE_PROCESSOR:
|
||||
|
||||
if (NotifyValue <= ACPI_MAX_SYS_NOTIFY)
|
||||
{
|
||||
HandlerObj = ObjDesc->CommonNotify.SystemNotify;
|
||||
}
|
||||
else
|
||||
{
|
||||
HandlerObj = ObjDesc->CommonNotify.DeviceNotify;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
/* All other types are not supported */
|
||||
|
||||
return (AE_TYPE);
|
||||
}
|
||||
HandlerListHead = ObjDesc->CommonNotify.NotifyList[HandlerListId];
|
||||
}
|
||||
|
||||
/*
|
||||
* If there is any handler to run, schedule the dispatcher.
|
||||
* Check for:
|
||||
* 1) Global system notify handler
|
||||
* 2) Global device notify handler
|
||||
* 3) Per-device notify handler
|
||||
* If there is no notify handler (Global or Local)
|
||||
* for this object, just ignore the notify
|
||||
*/
|
||||
if ((AcpiGbl_SystemNotify.Handler &&
|
||||
(NotifyValue <= ACPI_MAX_SYS_NOTIFY)) ||
|
||||
(AcpiGbl_DeviceNotify.Handler &&
|
||||
(NotifyValue > ACPI_MAX_SYS_NOTIFY)) ||
|
||||
HandlerObj)
|
||||
if (!AcpiGbl_GlobalNotify[HandlerListId].Handler && !HandlerListHead)
|
||||
{
|
||||
NotifyInfo = AcpiUtCreateGenericState ();
|
||||
if (!NotifyInfo)
|
||||
{
|
||||
return (AE_NO_MEMORY);
|
||||
}
|
||||
|
||||
if (!HandlerObj)
|
||||
{
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
|
||||
"Executing system notify handler for Notify (%4.4s, %X) "
|
||||
"node %p\n",
|
||||
AcpiUtGetNodeName (Node), NotifyValue, Node));
|
||||
}
|
||||
|
||||
NotifyInfo->Common.DescriptorType = ACPI_DESC_TYPE_STATE_NOTIFY;
|
||||
NotifyInfo->Notify.Node = Node;
|
||||
NotifyInfo->Notify.Value = (UINT16) NotifyValue;
|
||||
NotifyInfo->Notify.HandlerObj = HandlerObj;
|
||||
|
||||
Status = AcpiOsExecute (
|
||||
OSL_NOTIFY_HANDLER, AcpiEvNotifyDispatch, NotifyInfo);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
AcpiUtDeleteGenericState (NotifyInfo);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/* There is no notify handler (per-device or system) for this device */
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
|
||||
"No notify handler for Notify (%4.4s, %X) node %p\n",
|
||||
"No notify handler for Notify, ignoring (%4.4s, %X) node %p\n",
|
||||
AcpiUtGetNodeName (Node), NotifyValue, Node));
|
||||
|
||||
return (AE_OK);
|
||||
}
|
||||
|
||||
/* Setup notify info and schedule the notify dispatcher */
|
||||
|
||||
Info = AcpiUtCreateGenericState ();
|
||||
if (!Info)
|
||||
{
|
||||
return (AE_NO_MEMORY);
|
||||
}
|
||||
|
||||
Info->Common.DescriptorType = ACPI_DESC_TYPE_STATE_NOTIFY;
|
||||
|
||||
Info->Notify.Node = Node;
|
||||
Info->Notify.Value = (UINT16) NotifyValue;
|
||||
Info->Notify.HandlerListId = HandlerListId;
|
||||
Info->Notify.HandlerListHead = HandlerListHead;
|
||||
Info->Notify.Global = &AcpiGbl_GlobalNotify[HandlerListId];
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
|
||||
"Dispatching Notify on [%4.4s] (%s) Value 0x%2.2X (%s) Node %p\n",
|
||||
AcpiUtGetNodeName (Node), AcpiUtGetTypeName (Node->Type),
|
||||
NotifyValue, AcpiUtGetNotifyName (NotifyValue, ACPI_TYPE_ANY), Node));
|
||||
|
||||
Status = AcpiOsExecute (OSL_NOTIFY_HANDLER, AcpiEvNotifyDispatch,
|
||||
Info);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
AcpiUtDeleteGenericState (Info);
|
||||
}
|
||||
|
||||
return (Status);
|
||||
@@ -314,350 +211,41 @@ static void ACPI_SYSTEM_XFACE
|
||||
AcpiEvNotifyDispatch (
|
||||
void *Context)
|
||||
{
|
||||
ACPI_GENERIC_STATE *NotifyInfo = (ACPI_GENERIC_STATE *) Context;
|
||||
ACPI_NOTIFY_HANDLER GlobalHandler = NULL;
|
||||
void *GlobalContext = NULL;
|
||||
ACPI_GENERIC_STATE *Info = (ACPI_GENERIC_STATE *) Context;
|
||||
ACPI_OPERAND_OBJECT *HandlerObj;
|
||||
|
||||
|
||||
ACPI_FUNCTION_ENTRY ();
|
||||
|
||||
|
||||
/*
|
||||
* We will invoke a global notify handler if installed. This is done
|
||||
* _before_ we invoke the per-device handler attached to the device.
|
||||
*/
|
||||
if (NotifyInfo->Notify.Value <= ACPI_MAX_SYS_NOTIFY)
|
||||
{
|
||||
/* Global system notification handler */
|
||||
/* Invoke a global notify handler if installed */
|
||||
|
||||
if (AcpiGbl_SystemNotify.Handler)
|
||||
{
|
||||
GlobalHandler = AcpiGbl_SystemNotify.Handler;
|
||||
GlobalContext = AcpiGbl_SystemNotify.Context;
|
||||
}
|
||||
}
|
||||
else
|
||||
if (Info->Notify.Global->Handler)
|
||||
{
|
||||
/* Global driver notification handler */
|
||||
|
||||
if (AcpiGbl_DeviceNotify.Handler)
|
||||
{
|
||||
GlobalHandler = AcpiGbl_DeviceNotify.Handler;
|
||||
GlobalContext = AcpiGbl_DeviceNotify.Context;
|
||||
}
|
||||
Info->Notify.Global->Handler (Info->Notify.Node,
|
||||
Info->Notify.Value,
|
||||
Info->Notify.Global->Context);
|
||||
}
|
||||
|
||||
/* Invoke the system handler first, if present */
|
||||
/* Now invoke the local notify handler(s) if any are installed */
|
||||
|
||||
if (GlobalHandler)
|
||||
HandlerObj = Info->Notify.HandlerListHead;
|
||||
while (HandlerObj)
|
||||
{
|
||||
GlobalHandler (NotifyInfo->Notify.Node, NotifyInfo->Notify.Value,
|
||||
GlobalContext);
|
||||
}
|
||||
|
||||
/* Now invoke the per-device handler, if present */
|
||||
|
||||
HandlerObj = NotifyInfo->Notify.HandlerObj;
|
||||
if (HandlerObj)
|
||||
{
|
||||
HandlerObj->Notify.Handler (NotifyInfo->Notify.Node,
|
||||
NotifyInfo->Notify.Value,
|
||||
HandlerObj->Notify.Handler (Info->Notify.Node,
|
||||
Info->Notify.Value,
|
||||
HandlerObj->Notify.Context);
|
||||
|
||||
HandlerObj = HandlerObj->Notify.Next[Info->Notify.HandlerListId];
|
||||
}
|
||||
|
||||
/* All done with the info object */
|
||||
|
||||
AcpiUtDeleteGenericState (NotifyInfo);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiEvGlobalLockHandler
|
||||
*
|
||||
* PARAMETERS: Context - From thread interface, not used
|
||||
*
|
||||
* RETURN: ACPI_INTERRUPT_HANDLED
|
||||
*
|
||||
* DESCRIPTION: Invoked directly from the SCI handler when a global lock
|
||||
* release interrupt occurs. Attempt to acquire the global lock,
|
||||
* if successful, signal the thread waiting for the lock.
|
||||
*
|
||||
* NOTE: Assumes that the semaphore can be signaled from interrupt level. If
|
||||
* this is not possible for some reason, a separate thread will have to be
|
||||
* scheduled to do this.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
static UINT32
|
||||
AcpiEvGlobalLockHandler (
|
||||
void *Context)
|
||||
{
|
||||
BOOLEAN Acquired = FALSE;
|
||||
ACPI_STATUS Status;
|
||||
|
||||
|
||||
/*
|
||||
* Attempt to get the lock.
|
||||
*
|
||||
* If we don't get it now, it will be marked pending and we will
|
||||
* take another interrupt when it becomes free.
|
||||
*/
|
||||
ACPI_ACQUIRE_GLOBAL_LOCK (AcpiGbl_FACS, Acquired);
|
||||
if (Acquired)
|
||||
{
|
||||
/* Got the lock, now wake the thread waiting for it */
|
||||
|
||||
AcpiGbl_GlobalLockAcquired = TRUE;
|
||||
|
||||
/* Send a unit to the semaphore */
|
||||
|
||||
Status = AcpiOsSignalSemaphore (AcpiGbl_GlobalLockSemaphore, 1);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
ACPI_ERROR ((AE_INFO, "Could not signal Global Lock semaphore"));
|
||||
}
|
||||
}
|
||||
|
||||
return (ACPI_INTERRUPT_HANDLED);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiEvInitGlobalLockHandler
|
||||
*
|
||||
* PARAMETERS: None
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Install a handler for the global lock release event
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiEvInitGlobalLockHandler (
|
||||
void)
|
||||
{
|
||||
ACPI_STATUS Status;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE (EvInitGlobalLockHandler);
|
||||
|
||||
|
||||
/* Attempt installation of the global lock handler */
|
||||
|
||||
Status = AcpiInstallFixedEventHandler (ACPI_EVENT_GLOBAL,
|
||||
AcpiEvGlobalLockHandler, NULL);
|
||||
|
||||
/*
|
||||
* If the global lock does not exist on this platform, the attempt to
|
||||
* enable GBL_STATUS will fail (the GBL_ENABLE bit will not stick).
|
||||
* Map to AE_OK, but mark global lock as not present. Any attempt to
|
||||
* actually use the global lock will be flagged with an error.
|
||||
*/
|
||||
if (Status == AE_NO_HARDWARE_RESPONSE)
|
||||
{
|
||||
ACPI_ERROR ((AE_INFO,
|
||||
"No response from Global Lock hardware, disabling lock"));
|
||||
|
||||
AcpiGbl_GlobalLockPresent = FALSE;
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
}
|
||||
|
||||
AcpiGbl_GlobalLockPresent = TRUE;
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiEvRemoveGlobalLockHandler
|
||||
*
|
||||
* PARAMETERS: None
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Remove the handler for the Global Lock
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
static ACPI_STATUS
|
||||
AcpiEvRemoveGlobalLockHandler (
|
||||
void)
|
||||
{
|
||||
ACPI_STATUS Status;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE (EvRemoveGlobalLockHandler);
|
||||
|
||||
AcpiGbl_GlobalLockPresent = FALSE;
|
||||
Status = AcpiRemoveFixedEventHandler (ACPI_EVENT_GLOBAL,
|
||||
AcpiEvGlobalLockHandler);
|
||||
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiEvAcquireGlobalLock
|
||||
*
|
||||
* PARAMETERS: Timeout - Max time to wait for the lock, in millisec.
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Attempt to gain ownership of the Global Lock.
|
||||
*
|
||||
* MUTEX: Interpreter must be locked
|
||||
*
|
||||
* Note: The original implementation allowed multiple threads to "acquire" the
|
||||
* Global Lock, and the OS would hold the lock until the last thread had
|
||||
* released it. However, this could potentially starve the BIOS out of the
|
||||
* lock, especially in the case where there is a tight handshake between the
|
||||
* Embedded Controller driver and the BIOS. Therefore, this implementation
|
||||
* allows only one thread to acquire the HW Global Lock at a time, and makes
|
||||
* the global lock appear as a standard mutex on the OS side.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiEvAcquireGlobalLock (
|
||||
UINT16 Timeout)
|
||||
{
|
||||
ACPI_STATUS Status = AE_OK;
|
||||
BOOLEAN Acquired = FALSE;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE (EvAcquireGlobalLock);
|
||||
|
||||
|
||||
/*
|
||||
* Only one thread can acquire the GL at a time, the GlobalLockMutex
|
||||
* enforces this. This interface releases the interpreter if we must wait.
|
||||
*/
|
||||
Status = AcpiExSystemWaitMutex (AcpiGbl_GlobalLockMutex->Mutex.OsMutex,
|
||||
Timeout);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
/*
|
||||
* Update the global lock handle and check for wraparound. The handle is
|
||||
* only used for the external global lock interfaces, but it is updated
|
||||
* here to properly handle the case where a single thread may acquire the
|
||||
* lock via both the AML and the AcpiAcquireGlobalLock interfaces. The
|
||||
* handle is therefore updated on the first acquire from a given thread
|
||||
* regardless of where the acquisition request originated.
|
||||
*/
|
||||
AcpiGbl_GlobalLockHandle++;
|
||||
if (AcpiGbl_GlobalLockHandle == 0)
|
||||
{
|
||||
AcpiGbl_GlobalLockHandle = 1;
|
||||
}
|
||||
|
||||
/*
|
||||
* Make sure that a global lock actually exists. If not, just treat the
|
||||
* lock as a standard mutex.
|
||||
*/
|
||||
if (!AcpiGbl_GlobalLockPresent)
|
||||
{
|
||||
AcpiGbl_GlobalLockAcquired = TRUE;
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
}
|
||||
|
||||
/* Attempt to acquire the actual hardware lock */
|
||||
|
||||
ACPI_ACQUIRE_GLOBAL_LOCK (AcpiGbl_FACS, Acquired);
|
||||
if (Acquired)
|
||||
{
|
||||
/* We got the lock */
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Acquired hardware Global Lock\n"));
|
||||
|
||||
AcpiGbl_GlobalLockAcquired = TRUE;
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
}
|
||||
|
||||
/*
|
||||
* Did not get the lock. The pending bit was set above, and we must now
|
||||
* wait until we get the global lock released interrupt.
|
||||
*/
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Waiting for hardware Global Lock\n"));
|
||||
|
||||
/*
|
||||
* Wait for handshake with the global lock interrupt handler.
|
||||
* This interface releases the interpreter if we must wait.
|
||||
*/
|
||||
Status = AcpiExSystemWaitSemaphore (AcpiGbl_GlobalLockSemaphore,
|
||||
ACPI_WAIT_FOREVER);
|
||||
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiEvReleaseGlobalLock
|
||||
*
|
||||
* PARAMETERS: None
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Releases ownership of the Global Lock.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiEvReleaseGlobalLock (
|
||||
void)
|
||||
{
|
||||
BOOLEAN Pending = FALSE;
|
||||
ACPI_STATUS Status = AE_OK;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE (EvReleaseGlobalLock);
|
||||
|
||||
|
||||
/* Lock must be already acquired */
|
||||
|
||||
if (!AcpiGbl_GlobalLockAcquired)
|
||||
{
|
||||
ACPI_WARNING ((AE_INFO,
|
||||
"Cannot release the ACPI Global Lock, it has not been acquired"));
|
||||
return_ACPI_STATUS (AE_NOT_ACQUIRED);
|
||||
}
|
||||
|
||||
if (AcpiGbl_GlobalLockPresent)
|
||||
{
|
||||
/* Allow any thread to release the lock */
|
||||
|
||||
ACPI_RELEASE_GLOBAL_LOCK (AcpiGbl_FACS, Pending);
|
||||
|
||||
/*
|
||||
* If the pending bit was set, we must write GBL_RLS to the control
|
||||
* register
|
||||
*/
|
||||
if (Pending)
|
||||
{
|
||||
Status = AcpiWriteBitRegister (
|
||||
ACPI_BITREG_GLOBAL_LOCK_RELEASE, ACPI_ENABLE_EVENT);
|
||||
}
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Released hardware Global Lock\n"));
|
||||
}
|
||||
|
||||
AcpiGbl_GlobalLockAcquired = FALSE;
|
||||
|
||||
/* Release the local GL mutex */
|
||||
|
||||
AcpiOsReleaseMutex (AcpiGbl_GlobalLockMutex->Mutex.OsMutex);
|
||||
return_ACPI_STATUS (Status);
|
||||
AcpiUtDeleteGenericState (Info);
|
||||
}
|
||||
|
||||
|
||||
#if (!ACPI_REDUCED_HARDWARE)
|
||||
/******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiEvTerminate
|
||||
@@ -704,21 +292,23 @@ AcpiEvTerminate (
|
||||
|
||||
Status = AcpiEvWalkGpeList (AcpiHwDisableGpeBlock, NULL);
|
||||
|
||||
/* Remove SCI handler */
|
||||
|
||||
Status = AcpiEvRemoveSciHandler ();
|
||||
if (ACPI_FAILURE(Status))
|
||||
{
|
||||
ACPI_ERROR ((AE_INFO,
|
||||
"Could not remove SCI handler"));
|
||||
}
|
||||
|
||||
Status = AcpiEvRemoveGlobalLockHandler ();
|
||||
if (ACPI_FAILURE(Status))
|
||||
{
|
||||
ACPI_ERROR ((AE_INFO,
|
||||
"Could not remove Global Lock handler"));
|
||||
}
|
||||
|
||||
AcpiGbl_EventsInitialized = FALSE;
|
||||
}
|
||||
|
||||
/* Remove SCI handlers */
|
||||
|
||||
Status = AcpiEvRemoveAllSciHandlers ();
|
||||
if (ACPI_FAILURE(Status))
|
||||
{
|
||||
ACPI_ERROR ((AE_INFO,
|
||||
"Could not remove SCI handler"));
|
||||
}
|
||||
|
||||
/* Deallocate all handler objects installed within GPE info structs */
|
||||
@@ -738,3 +328,4 @@ AcpiEvTerminate (
|
||||
return_VOID;
|
||||
}
|
||||
|
||||
#endif /* !ACPI_REDUCED_HARDWARE */
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -4,117 +4,42 @@
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
* 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.
|
||||
*
|
||||
* 2.1. This is your license from Intel Corp. under its intellectual property
|
||||
* rights. You may have additional license terms from the party that provided
|
||||
* you this software, covering your right to use that party's intellectual
|
||||
* property rights.
|
||||
* 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.
|
||||
*
|
||||
* 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
|
||||
* copy of the source code appearing in this file ("Covered Code") an
|
||||
* irrevocable, perpetual, worldwide license under Intel's copyrights in the
|
||||
* base code distributed originally by Intel ("Original Intel Code") to copy,
|
||||
* make derivatives, distribute, use and display any portion of the Covered
|
||||
* Code in any form, with the right to sublicense such rights; and
|
||||
*
|
||||
* 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
|
||||
* license (with the right to sublicense), under only those claims of Intel
|
||||
* patents that are infringed by the Original Intel Code, to make, use, sell,
|
||||
* offer to sell, and import the Covered Code and derivative works thereof
|
||||
* solely to the minimum extent necessary to exercise the above copyright
|
||||
* license, and in no event shall the patent license extend to any additions
|
||||
* to or modifications of the Original Intel Code. No other license or right
|
||||
* is granted directly or by implication, estoppel or otherwise;
|
||||
*
|
||||
* The above copyright and patent license is granted only if the following
|
||||
* conditions are met:
|
||||
*
|
||||
* 3. Conditions
|
||||
*
|
||||
* 3.1. Redistribution of Source with Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification with rights to further distribute source must include
|
||||
* the above Copyright Notice, the above License, this list of Conditions,
|
||||
* and the following Disclaimer and Export Compliance provision. In addition,
|
||||
* Licensee must cause all Covered Code to which Licensee contributes to
|
||||
* contain a file documenting the changes Licensee made to create that Covered
|
||||
* Code and the date of any change. Licensee must include in that file the
|
||||
* documentation of any changes made by any predecessor Licensee. Licensee
|
||||
* must include a prominent statement that the modification is derived,
|
||||
* directly or indirectly, from Original Intel Code.
|
||||
*
|
||||
* 3.2. Redistribution of Source with no Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification without rights to further distribute source must
|
||||
* include the following Disclaimer and Export Compliance provision in the
|
||||
* documentation and/or other materials provided with distribution. In
|
||||
* addition, Licensee may not authorize further sublicense of source of any
|
||||
* portion of the Covered Code, and must include terms to the effect that the
|
||||
* license from Licensee to its licensee is limited to the intellectual
|
||||
* property embodied in the software Licensee provides to its licensee, and
|
||||
* not to intellectual property embodied in modifications its licensee may
|
||||
* make.
|
||||
*
|
||||
* 3.3. Redistribution of Executable. Redistribution in executable form of any
|
||||
* substantial portion of the Covered Code or modification must reproduce the
|
||||
* above Copyright Notice, and the following Disclaimer and Export Compliance
|
||||
* provision in the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3.4. Intel retains all right, title, and interest in and to the Original
|
||||
* Intel Code.
|
||||
*
|
||||
* 3.5. Neither the name Intel nor any other trademark owned or controlled by
|
||||
* Intel shall be used in advertising or otherwise to promote the sale, use or
|
||||
* other dealings in products derived from or relating to the Covered Code
|
||||
* without prior written authorization from Intel.
|
||||
*
|
||||
* 4. Disclaimer and Export Compliance
|
||||
*
|
||||
* 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
|
||||
* HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
|
||||
* IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
|
||||
* INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
|
||||
* UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
|
||||
* PARTICULAR PURPOSE.
|
||||
*
|
||||
* 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
|
||||
* OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
|
||||
* COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
|
||||
* SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
|
||||
* CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
|
||||
* HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
|
||||
* SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
|
||||
* LIMITED REMEDY.
|
||||
*
|
||||
* 4.3. Licensee shall not export, either directly or indirectly, any of this
|
||||
* software or system incorporating such software without first obtaining any
|
||||
* required license or other approval from the U. S. Department of Commerce or
|
||||
* any other agency or department of the United States Government. In the
|
||||
* event Licensee exports any such software from the United States or
|
||||
* re-exports any such software from a foreign destination, Licensee shall
|
||||
* ensure that the distribution and export/re-export of the software is in
|
||||
* compliance with all laws, regulations, orders, or other restrictions of the
|
||||
* U.S. Export Administration Regulations. Licensee agrees that neither it nor
|
||||
* any of its subsidiaries will export/re-export any technical data, process,
|
||||
* software, or service, directly or indirectly, to any country for which the
|
||||
* United States government or any agency thereof requires an export license,
|
||||
* other governmental approval, or letter of assurance, without first obtaining
|
||||
* such license, approval or letter.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
|
||||
#define __EVRGNINI_C__
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#include "acpi.h"
|
||||
#include "accommon.h"
|
||||
@@ -395,8 +320,8 @@ AcpiEvPciConfigRegionSetup (
|
||||
}
|
||||
|
||||
/*
|
||||
* Get the PCI device and function numbers from the _ADR object contained
|
||||
* in the parent's scope.
|
||||
* Get the PCI device and function numbers from the _ADR object
|
||||
* contained in the parent's scope.
|
||||
*/
|
||||
Status = AcpiUtEvaluateNumericObject (METHOD_NAME__ADR,
|
||||
PciDeviceNode, &PciValue);
|
||||
@@ -429,9 +354,14 @@ AcpiEvPciConfigRegionSetup (
|
||||
PciId->Bus = ACPI_LOWORD (PciValue);
|
||||
}
|
||||
|
||||
/* Complete this device's PciId */
|
||||
/* Complete/update the PCI ID for this device */
|
||||
|
||||
AcpiOsDerivePciId (PciRootNode, RegionObj->Region.Node, &PciId);
|
||||
Status = AcpiHwDerivePciId (PciId, PciRootNode, RegionObj->Region.Node);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
ACPI_FREE (PciId);
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
*RegionContext = PciId;
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
@@ -456,8 +386,8 @@ AcpiEvIsPciRootBridge (
|
||||
ACPI_NAMESPACE_NODE *Node)
|
||||
{
|
||||
ACPI_STATUS Status;
|
||||
ACPI_DEVICE_ID *Hid;
|
||||
ACPI_DEVICE_ID_LIST *Cid;
|
||||
ACPI_PNP_DEVICE_ID *Hid;
|
||||
ACPI_PNP_DEVICE_ID_LIST *Cid;
|
||||
UINT32 i;
|
||||
BOOLEAN Match;
|
||||
|
||||
@@ -724,14 +654,16 @@ AcpiEvInitializeRegion (
|
||||
*
|
||||
* See AcpiNsExecModuleCode
|
||||
*/
|
||||
if (ObjDesc->Method.Flags & AOPOBJ_MODULE_LEVEL)
|
||||
if (ObjDesc->Method.InfoFlags & ACPI_METHOD_MODULE_LEVEL)
|
||||
{
|
||||
HandlerObj = ObjDesc->Method.Extra.Handler;
|
||||
HandlerObj = ObjDesc->Method.Dispatch.Handler;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
/* Ignore other objects */
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -763,7 +695,7 @@ AcpiEvInitializeRegion (
|
||||
}
|
||||
}
|
||||
|
||||
Status = AcpiEvExecuteRegMethod (RegionObj, 1);
|
||||
Status = AcpiEvExecuteRegMethod (RegionObj, ACPI_REG_CONNECT);
|
||||
|
||||
if (AcpiNsLocked)
|
||||
{
|
||||
@@ -796,4 +728,3 @@ AcpiEvInitializeRegion (
|
||||
|
||||
return_ACPI_STATUS (AE_NOT_EXIST);
|
||||
}
|
||||
|
||||
|
||||
@@ -5,115 +5,42 @@
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
* 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.
|
||||
*
|
||||
* 2.1. This is your license from Intel Corp. under its intellectual property
|
||||
* rights. You may have additional license terms from the party that provided
|
||||
* you this software, covering your right to use that party's intellectual
|
||||
* property rights.
|
||||
* 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.
|
||||
*
|
||||
* 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
|
||||
* copy of the source code appearing in this file ("Covered Code") an
|
||||
* irrevocable, perpetual, worldwide license under Intel's copyrights in the
|
||||
* base code distributed originally by Intel ("Original Intel Code") to copy,
|
||||
* make derivatives, distribute, use and display any portion of the Covered
|
||||
* Code in any form, with the right to sublicense such rights; and
|
||||
*
|
||||
* 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
|
||||
* license (with the right to sublicense), under only those claims of Intel
|
||||
* patents that are infringed by the Original Intel Code, to make, use, sell,
|
||||
* offer to sell, and import the Covered Code and derivative works thereof
|
||||
* solely to the minimum extent necessary to exercise the above copyright
|
||||
* license, and in no event shall the patent license extend to any additions
|
||||
* to or modifications of the Original Intel Code. No other license or right
|
||||
* is granted directly or by implication, estoppel or otherwise;
|
||||
*
|
||||
* The above copyright and patent license is granted only if the following
|
||||
* conditions are met:
|
||||
*
|
||||
* 3. Conditions
|
||||
*
|
||||
* 3.1. Redistribution of Source with Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification with rights to further distribute source must include
|
||||
* the above Copyright Notice, the above License, this list of Conditions,
|
||||
* and the following Disclaimer and Export Compliance provision. In addition,
|
||||
* Licensee must cause all Covered Code to which Licensee contributes to
|
||||
* contain a file documenting the changes Licensee made to create that Covered
|
||||
* Code and the date of any change. Licensee must include in that file the
|
||||
* documentation of any changes made by any predecessor Licensee. Licensee
|
||||
* must include a prominent statement that the modification is derived,
|
||||
* directly or indirectly, from Original Intel Code.
|
||||
*
|
||||
* 3.2. Redistribution of Source with no Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification without rights to further distribute source must
|
||||
* include the following Disclaimer and Export Compliance provision in the
|
||||
* documentation and/or other materials provided with distribution. In
|
||||
* addition, Licensee may not authorize further sublicense of source of any
|
||||
* portion of the Covered Code, and must include terms to the effect that the
|
||||
* license from Licensee to its licensee is limited to the intellectual
|
||||
* property embodied in the software Licensee provides to its licensee, and
|
||||
* not to intellectual property embodied in modifications its licensee may
|
||||
|
||||
* make.
|
||||
*
|
||||
* 3.3. Redistribution of Executable. Redistribution in executable form of any
|
||||
* substantial portion of the Covered Code or modification must reproduce the
|
||||
* above Copyright Notice, and the following Disclaimer and Export Compliance
|
||||
* provision in the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3.4. Intel retains all right, title, and interest in and to the Original
|
||||
* Intel Code.
|
||||
*
|
||||
* 3.5. Neither the name Intel nor any other trademark owned or controlled by
|
||||
* Intel shall be used in advertising or otherwise to promote the sale, use or
|
||||
* other dealings in products derived from or relating to the Covered Code
|
||||
* without prior written authorization from Intel.
|
||||
*
|
||||
* 4. Disclaimer and Export Compliance
|
||||
*
|
||||
* 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
|
||||
* HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
|
||||
* IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
|
||||
* INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
|
||||
* UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
|
||||
* PARTICULAR PURPOSE.
|
||||
*
|
||||
* 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
|
||||
* OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
|
||||
* COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
|
||||
* SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
|
||||
* CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
|
||||
* HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
|
||||
* SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
|
||||
* LIMITED REMEDY.
|
||||
*
|
||||
* 4.3. Licensee shall not export, either directly or indirectly, any of this
|
||||
* software or system incorporating such software without first obtaining any
|
||||
* required license or other approval from the U. S. Department of Commerce or
|
||||
* any other agency or department of the United States Government. In the
|
||||
* event Licensee exports any such software from the United States or
|
||||
* re-exports any such software from a foreign destination, Licensee shall
|
||||
* ensure that the distribution and export/re-export of the software is in
|
||||
* compliance with all laws, regulations, orders, or other restrictions of the
|
||||
* U.S. Export Administration Regulations. Licensee agrees that neither it nor
|
||||
* any of its subsidiaries will export/re-export any technical data, process,
|
||||
* software, or service, directly or indirectly, to any country for which the
|
||||
* United States government or any agency thereof requires an export license,
|
||||
* other governmental approval, or letter of assurance, without first obtaining
|
||||
* such license, approval or letter.
|
||||
*
|
||||
*****************************************************************************/
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#include "acpi.h"
|
||||
#include "accommon.h"
|
||||
@@ -123,6 +50,8 @@
|
||||
#define _COMPONENT ACPI_EVENTS
|
||||
ACPI_MODULE_NAME ("evsci")
|
||||
|
||||
#if (!ACPI_REDUCED_HARDWARE) /* Entire module */
|
||||
|
||||
/* Local prototypes */
|
||||
|
||||
static UINT32 ACPI_SYSTEM_XFACE
|
||||
@@ -130,6 +59,57 @@ AcpiEvSciXruptHandler (
|
||||
void *Context);
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiEvSciDispatch
|
||||
*
|
||||
* PARAMETERS: None
|
||||
*
|
||||
* RETURN: Status code indicates whether interrupt was handled.
|
||||
*
|
||||
* DESCRIPTION: Dispatch the SCI to all host-installed SCI handlers.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
UINT32
|
||||
AcpiEvSciDispatch (
|
||||
void)
|
||||
{
|
||||
ACPI_SCI_HANDLER_INFO *SciHandler;
|
||||
ACPI_CPU_FLAGS Flags;
|
||||
UINT32 IntStatus = ACPI_INTERRUPT_NOT_HANDLED;
|
||||
|
||||
|
||||
ACPI_FUNCTION_NAME (EvSciDispatch);
|
||||
|
||||
|
||||
/* Are there any host-installed SCI handlers? */
|
||||
|
||||
if (!AcpiGbl_SciHandlerList)
|
||||
{
|
||||
return (IntStatus);
|
||||
}
|
||||
|
||||
Flags = AcpiOsAcquireLock (AcpiGbl_GpeLock);
|
||||
|
||||
/* Invoke all host-installed SCI handlers */
|
||||
|
||||
SciHandler = AcpiGbl_SciHandlerList;
|
||||
while (SciHandler)
|
||||
{
|
||||
/* Invoke the installed handler (at interrupt level) */
|
||||
|
||||
IntStatus |= SciHandler->Address (
|
||||
SciHandler->Context);
|
||||
|
||||
SciHandler = SciHandler->Next;
|
||||
}
|
||||
|
||||
AcpiOsReleaseLock (AcpiGbl_GpeLock, Flags);
|
||||
return (IntStatus);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiEvSciXruptHandler
|
||||
@@ -155,7 +135,7 @@ AcpiEvSciXruptHandler (
|
||||
|
||||
|
||||
/*
|
||||
* We are guaranteed by the ACPI CA initialization/shutdown code that
|
||||
* We are guaranteed by the ACPICA initialization/shutdown code that
|
||||
* if this interrupt handler is installed, ACPI is enabled.
|
||||
*/
|
||||
|
||||
@@ -171,6 +151,10 @@ AcpiEvSciXruptHandler (
|
||||
*/
|
||||
InterruptHandled |= AcpiEvGpeDetect (GpeXruptList);
|
||||
|
||||
/* Invoke all host-installed SCI handlers */
|
||||
|
||||
InterruptHandled |= AcpiEvSciDispatch ();
|
||||
|
||||
AcpiSciCount++;
|
||||
return_UINT32 (InterruptHandled);
|
||||
}
|
||||
@@ -200,14 +184,13 @@ AcpiEvGpeXruptHandler (
|
||||
|
||||
|
||||
/*
|
||||
* We are guaranteed by the ACPI CA initialization/shutdown code that
|
||||
* We are guaranteed by the ACPICA initialization/shutdown code that
|
||||
* if this interrupt handler is installed, ACPI is enabled.
|
||||
*/
|
||||
|
||||
/* GPEs: Check for and dispatch any GPEs that have occurred */
|
||||
|
||||
InterruptHandled |= AcpiEvGpeDetect (GpeXruptList);
|
||||
|
||||
return_UINT32 (InterruptHandled);
|
||||
}
|
||||
|
||||
@@ -242,15 +225,15 @@ AcpiEvInstallSciHandler (
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiEvRemoveSciHandler
|
||||
* FUNCTION: AcpiEvRemoveAllSciHandlers
|
||||
*
|
||||
* PARAMETERS: none
|
||||
*
|
||||
* RETURN: E_OK if handler uninstalled OK, E_ERROR if handler was not
|
||||
* RETURN: AE_OK if handler uninstalled, AE_ERROR if handler was not
|
||||
* installed to begin with
|
||||
*
|
||||
* DESCRIPTION: Remove the SCI interrupt handler. No further SCIs will be
|
||||
* taken.
|
||||
* taken. Remove all host-installed SCI handlers.
|
||||
*
|
||||
* Note: It doesn't seem important to disable all events or set the event
|
||||
* enable registers to their original values. The OS should disable
|
||||
@@ -260,13 +243,15 @@ AcpiEvInstallSciHandler (
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiEvRemoveSciHandler (
|
||||
AcpiEvRemoveAllSciHandlers (
|
||||
void)
|
||||
{
|
||||
ACPI_SCI_HANDLER_INFO *SciHandler;
|
||||
ACPI_CPU_FLAGS Flags;
|
||||
ACPI_STATUS Status;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE (EvRemoveSciHandler);
|
||||
ACPI_FUNCTION_TRACE (EvRemoveAllSciHandlers);
|
||||
|
||||
|
||||
/* Just let the OS remove the handler and disable the level */
|
||||
@@ -274,7 +259,24 @@ AcpiEvRemoveSciHandler (
|
||||
Status = AcpiOsRemoveInterruptHandler ((UINT32) AcpiGbl_FADT.SciInterrupt,
|
||||
AcpiEvSciXruptHandler);
|
||||
|
||||
if (!AcpiGbl_SciHandlerList)
|
||||
{
|
||||
return (Status);
|
||||
}
|
||||
|
||||
Flags = AcpiOsAcquireLock (AcpiGbl_GpeLock);
|
||||
|
||||
/* Free all host-installed SCI handlers */
|
||||
|
||||
while (AcpiGbl_SciHandlerList)
|
||||
{
|
||||
SciHandler = AcpiGbl_SciHandlerList;
|
||||
AcpiGbl_SciHandlerList = SciHandler->Next;
|
||||
ACPI_FREE (SciHandler);
|
||||
}
|
||||
|
||||
AcpiOsReleaseLock (AcpiGbl_GpeLock, Flags);
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
|
||||
#endif /* !ACPI_REDUCED_HARDWARE */
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -4,136 +4,54 @@
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
* 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.
|
||||
*
|
||||
* 2.1. This is your license from Intel Corp. under its intellectual property
|
||||
* rights. You may have additional license terms from the party that provided
|
||||
* you this software, covering your right to use that party's intellectual
|
||||
* property rights.
|
||||
* 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.
|
||||
*
|
||||
* 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
|
||||
* copy of the source code appearing in this file ("Covered Code") an
|
||||
* irrevocable, perpetual, worldwide license under Intel's copyrights in the
|
||||
* base code distributed originally by Intel ("Original Intel Code") to copy,
|
||||
* make derivatives, distribute, use and display any portion of the Covered
|
||||
* Code in any form, with the right to sublicense such rights; and
|
||||
*
|
||||
* 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
|
||||
* license (with the right to sublicense), under only those claims of Intel
|
||||
* patents that are infringed by the Original Intel Code, to make, use, sell,
|
||||
* offer to sell, and import the Covered Code and derivative works thereof
|
||||
* solely to the minimum extent necessary to exercise the above copyright
|
||||
* license, and in no event shall the patent license extend to any additions
|
||||
* to or modifications of the Original Intel Code. No other license or right
|
||||
* is granted directly or by implication, estoppel or otherwise;
|
||||
*
|
||||
* The above copyright and patent license is granted only if the following
|
||||
* conditions are met:
|
||||
*
|
||||
* 3. Conditions
|
||||
*
|
||||
* 3.1. Redistribution of Source with Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification with rights to further distribute source must include
|
||||
* the above Copyright Notice, the above License, this list of Conditions,
|
||||
* and the following Disclaimer and Export Compliance provision. In addition,
|
||||
* Licensee must cause all Covered Code to which Licensee contributes to
|
||||
* contain a file documenting the changes Licensee made to create that Covered
|
||||
* Code and the date of any change. Licensee must include in that file the
|
||||
* documentation of any changes made by any predecessor Licensee. Licensee
|
||||
* must include a prominent statement that the modification is derived,
|
||||
* directly or indirectly, from Original Intel Code.
|
||||
*
|
||||
* 3.2. Redistribution of Source with no Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification without rights to further distribute source must
|
||||
* include the following Disclaimer and Export Compliance provision in the
|
||||
* documentation and/or other materials provided with distribution. In
|
||||
* addition, Licensee may not authorize further sublicense of source of any
|
||||
* portion of the Covered Code, and must include terms to the effect that the
|
||||
* license from Licensee to its licensee is limited to the intellectual
|
||||
* property embodied in the software Licensee provides to its licensee, and
|
||||
* not to intellectual property embodied in modifications its licensee may
|
||||
* make.
|
||||
*
|
||||
* 3.3. Redistribution of Executable. Redistribution in executable form of any
|
||||
* substantial portion of the Covered Code or modification must reproduce the
|
||||
* above Copyright Notice, and the following Disclaimer and Export Compliance
|
||||
* provision in the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3.4. Intel retains all right, title, and interest in and to the Original
|
||||
* Intel Code.
|
||||
*
|
||||
* 3.5. Neither the name Intel nor any other trademark owned or controlled by
|
||||
* Intel shall be used in advertising or otherwise to promote the sale, use or
|
||||
* other dealings in products derived from or relating to the Covered Code
|
||||
* without prior written authorization from Intel.
|
||||
*
|
||||
* 4. Disclaimer and Export Compliance
|
||||
*
|
||||
* 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
|
||||
* HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
|
||||
* IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
|
||||
* INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
|
||||
* UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
|
||||
* PARTICULAR PURPOSE.
|
||||
*
|
||||
* 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
|
||||
* OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
|
||||
* COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
|
||||
* SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
|
||||
* CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
|
||||
* HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
|
||||
* SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
|
||||
* LIMITED REMEDY.
|
||||
*
|
||||
* 4.3. Licensee shall not export, either directly or indirectly, any of this
|
||||
* software or system incorporating such software without first obtaining any
|
||||
* required license or other approval from the U. S. Department of Commerce or
|
||||
* any other agency or department of the United States Government. In the
|
||||
* event Licensee exports any such software from the United States or
|
||||
* re-exports any such software from a foreign destination, Licensee shall
|
||||
* ensure that the distribution and export/re-export of the software is in
|
||||
* compliance with all laws, regulations, orders, or other restrictions of the
|
||||
* U.S. Export Administration Regulations. Licensee agrees that neither it nor
|
||||
* any of its subsidiaries will export/re-export any technical data, process,
|
||||
* software, or service, directly or indirectly, to any country for which the
|
||||
* United States government or any agency thereof requires an export license,
|
||||
* other governmental approval, or letter of assurance, without first obtaining
|
||||
* such license, approval or letter.
|
||||
*
|
||||
*****************************************************************************/
|
||||
* 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 __EVXFEVNT_C__
|
||||
#define EXPORT_ACPI_INTERFACES
|
||||
|
||||
#include "acpi.h"
|
||||
#include "accommon.h"
|
||||
#include "acevents.h"
|
||||
#include "acnamesp.h"
|
||||
#include "actables.h"
|
||||
|
||||
#define _COMPONENT ACPI_EVENTS
|
||||
ACPI_MODULE_NAME ("evxfevnt")
|
||||
|
||||
/* Local prototypes */
|
||||
|
||||
static ACPI_STATUS
|
||||
AcpiEvGetGpeDevice (
|
||||
ACPI_GPE_XRUPT_INFO *GpeXruptInfo,
|
||||
ACPI_GPE_BLOCK_INFO *GpeBlock,
|
||||
void *Context);
|
||||
|
||||
|
||||
#if (!ACPI_REDUCED_HARDWARE) /* Entire module */
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiEnable
|
||||
@@ -163,6 +81,13 @@ AcpiEnable (
|
||||
return_ACPI_STATUS (AE_NO_ACPI_TABLES);
|
||||
}
|
||||
|
||||
/* If the Hardware Reduced flag is set, machine is always in acpi mode */
|
||||
|
||||
if (AcpiGbl_ReducedHardware)
|
||||
{
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
}
|
||||
|
||||
/* Check current mode */
|
||||
|
||||
if (AcpiHwGetMode() == ACPI_SYS_MODE_ACPI)
|
||||
@@ -212,6 +137,13 @@ AcpiDisable (
|
||||
ACPI_FUNCTION_TRACE (AcpiDisable);
|
||||
|
||||
|
||||
/* If the Hardware Reduced flag is set, machine is always in acpi mode */
|
||||
|
||||
if (AcpiGbl_ReducedHardware)
|
||||
{
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
}
|
||||
|
||||
if (AcpiHwGetMode() == ACPI_SYS_MODE_LEGACY)
|
||||
{
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_INIT,
|
||||
@@ -305,293 +237,11 @@ AcpiEnableEvent (
|
||||
ACPI_EXPORT_SYMBOL (AcpiEnableEvent)
|
||||
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiGpeWakeup
|
||||
*
|
||||
* PARAMETERS: GpeDevice - Parent GPE Device. NULL for GPE0/GPE1
|
||||
* GpeNumber - GPE level within the GPE block
|
||||
* Action - Enable or Disable
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Set or clear the GPE's wakeup enable mask bit.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiGpeWakeup (
|
||||
ACPI_HANDLE GpeDevice,
|
||||
UINT32 GpeNumber,
|
||||
UINT8 Action)
|
||||
{
|
||||
ACPI_STATUS Status = AE_OK;
|
||||
ACPI_GPE_EVENT_INFO *GpeEventInfo;
|
||||
ACPI_GPE_REGISTER_INFO *GpeRegisterInfo;
|
||||
ACPI_CPU_FLAGS Flags;
|
||||
UINT32 RegisterBit;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE (AcpiGpeWakeup);
|
||||
|
||||
|
||||
Flags = AcpiOsAcquireLock (AcpiGbl_GpeLock);
|
||||
|
||||
/* Ensure that we have a valid GPE number */
|
||||
|
||||
GpeEventInfo = AcpiEvGetGpeEventInfo (GpeDevice, GpeNumber);
|
||||
if (!GpeEventInfo)
|
||||
{
|
||||
Status = AE_BAD_PARAMETER;
|
||||
goto UnlockAndExit;
|
||||
}
|
||||
|
||||
GpeRegisterInfo = GpeEventInfo->RegisterInfo;
|
||||
if (!GpeRegisterInfo)
|
||||
{
|
||||
Status = AE_NOT_EXIST;
|
||||
goto UnlockAndExit;
|
||||
}
|
||||
|
||||
RegisterBit = AcpiHwGetGpeRegisterBit (GpeEventInfo, GpeRegisterInfo);
|
||||
|
||||
/* Perform the action */
|
||||
|
||||
switch (Action)
|
||||
{
|
||||
case ACPI_GPE_ENABLE:
|
||||
ACPI_SET_BIT (GpeRegisterInfo->EnableForWake, (UINT8) RegisterBit);
|
||||
break;
|
||||
|
||||
case ACPI_GPE_DISABLE:
|
||||
ACPI_CLEAR_BIT (GpeRegisterInfo->EnableForWake, (UINT8) RegisterBit);
|
||||
break;
|
||||
|
||||
default:
|
||||
ACPI_ERROR ((AE_INFO, "%u, Invalid action", Action));
|
||||
Status = AE_BAD_PARAMETER;
|
||||
break;
|
||||
}
|
||||
|
||||
UnlockAndExit:
|
||||
AcpiOsReleaseLock (AcpiGbl_GpeLock, Flags);
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
ACPI_EXPORT_SYMBOL (AcpiGpeWakeup)
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiEnableGpe
|
||||
*
|
||||
* PARAMETERS: GpeDevice - Parent GPE Device. NULL for GPE0/GPE1
|
||||
* GpeNumber - GPE level within the GPE block
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Add a reference to a GPE. On the first reference, the GPE is
|
||||
* hardware-enabled.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiEnableGpe (
|
||||
ACPI_HANDLE GpeDevice,
|
||||
UINT32 GpeNumber)
|
||||
{
|
||||
ACPI_STATUS Status = AE_OK;
|
||||
ACPI_GPE_EVENT_INFO *GpeEventInfo;
|
||||
ACPI_CPU_FLAGS Flags;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE (AcpiEnableGpe);
|
||||
|
||||
|
||||
Flags = AcpiOsAcquireLock (AcpiGbl_GpeLock);
|
||||
|
||||
/* Ensure that we have a valid GPE number */
|
||||
|
||||
GpeEventInfo = AcpiEvGetGpeEventInfo (GpeDevice, GpeNumber);
|
||||
if (!GpeEventInfo)
|
||||
{
|
||||
Status = AE_BAD_PARAMETER;
|
||||
goto UnlockAndExit;
|
||||
}
|
||||
|
||||
if (GpeEventInfo->RuntimeCount == ACPI_UINT8_MAX)
|
||||
{
|
||||
Status = AE_LIMIT; /* Too many references */
|
||||
goto UnlockAndExit;
|
||||
}
|
||||
|
||||
GpeEventInfo->RuntimeCount++;
|
||||
if (GpeEventInfo->RuntimeCount == 1)
|
||||
{
|
||||
Status = AcpiEvUpdateGpeEnableMask (GpeEventInfo);
|
||||
if (ACPI_SUCCESS (Status))
|
||||
{
|
||||
Status = AcpiEvEnableGpe (GpeEventInfo);
|
||||
}
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
GpeEventInfo->RuntimeCount--;
|
||||
}
|
||||
}
|
||||
|
||||
UnlockAndExit:
|
||||
AcpiOsReleaseLock (AcpiGbl_GpeLock, Flags);
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
ACPI_EXPORT_SYMBOL (AcpiEnableGpe)
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiDisableGpe
|
||||
*
|
||||
* PARAMETERS: GpeDevice - Parent GPE Device. NULL for GPE0/GPE1
|
||||
* GpeNumber - GPE level within the GPE block
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Remove a reference to a GPE. When the last reference is
|
||||
* removed, only then is the GPE disabled (for runtime GPEs), or
|
||||
* the GPE mask bit disabled (for wake GPEs)
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiDisableGpe (
|
||||
ACPI_HANDLE GpeDevice,
|
||||
UINT32 GpeNumber)
|
||||
{
|
||||
ACPI_STATUS Status = AE_OK;
|
||||
ACPI_GPE_EVENT_INFO *GpeEventInfo;
|
||||
ACPI_CPU_FLAGS Flags;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE (AcpiDisableGpe);
|
||||
|
||||
|
||||
Flags = AcpiOsAcquireLock (AcpiGbl_GpeLock);
|
||||
|
||||
/* Ensure that we have a valid GPE number */
|
||||
|
||||
GpeEventInfo = AcpiEvGetGpeEventInfo (GpeDevice, GpeNumber);
|
||||
if (!GpeEventInfo)
|
||||
{
|
||||
Status = AE_BAD_PARAMETER;
|
||||
goto UnlockAndExit;
|
||||
}
|
||||
|
||||
/* Hardware-disable a runtime GPE on removal of the last reference */
|
||||
|
||||
if (!GpeEventInfo->RuntimeCount)
|
||||
{
|
||||
Status = AE_LIMIT; /* There are no references to remove */
|
||||
goto UnlockAndExit;
|
||||
}
|
||||
|
||||
GpeEventInfo->RuntimeCount--;
|
||||
if (!GpeEventInfo->RuntimeCount)
|
||||
{
|
||||
Status = AcpiEvUpdateGpeEnableMask (GpeEventInfo);
|
||||
if (ACPI_SUCCESS (Status))
|
||||
{
|
||||
Status = AcpiHwLowSetGpe (GpeEventInfo, ACPI_GPE_DISABLE);
|
||||
}
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
GpeEventInfo->RuntimeCount++;
|
||||
}
|
||||
}
|
||||
|
||||
UnlockAndExit:
|
||||
AcpiOsReleaseLock (AcpiGbl_GpeLock, Flags);
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
ACPI_EXPORT_SYMBOL (AcpiDisableGpe)
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiSetGpe
|
||||
*
|
||||
* PARAMETERS: GpeDevice - Parent GPE Device. NULL for GPE0/GPE1
|
||||
* GpeNumber - GPE level within the GPE block
|
||||
* Action - ACPI_GPE_ENABLE or ACPI_GPE_DISABLE
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Enable or disable an individual GPE. This function bypasses
|
||||
* the reference count mechanism used in the AcpiEnableGpe and
|
||||
* AcpiDisableGpe interfaces -- and should be used with care.
|
||||
*
|
||||
* Note: Typically used to disable a runtime GPE for short period of time,
|
||||
* then re-enable it, without disturbing the existing reference counts. This
|
||||
* is useful, for example, in the Embedded Controller (EC) driver.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiSetGpe (
|
||||
ACPI_HANDLE GpeDevice,
|
||||
UINT32 GpeNumber,
|
||||
UINT8 Action)
|
||||
{
|
||||
ACPI_GPE_EVENT_INFO *GpeEventInfo;
|
||||
ACPI_STATUS Status;
|
||||
ACPI_CPU_FLAGS Flags;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE (AcpiSetGpe);
|
||||
|
||||
|
||||
Flags = AcpiOsAcquireLock (AcpiGbl_GpeLock);
|
||||
|
||||
/* Ensure that we have a valid GPE number */
|
||||
|
||||
GpeEventInfo = AcpiEvGetGpeEventInfo (GpeDevice, GpeNumber);
|
||||
if (!GpeEventInfo)
|
||||
{
|
||||
Status = AE_BAD_PARAMETER;
|
||||
goto UnlockAndExit;
|
||||
}
|
||||
|
||||
/* Perform the action */
|
||||
|
||||
switch (Action)
|
||||
{
|
||||
case ACPI_GPE_ENABLE:
|
||||
Status = AcpiEvEnableGpe (GpeEventInfo);
|
||||
break;
|
||||
|
||||
case ACPI_GPE_DISABLE:
|
||||
Status = AcpiHwLowSetGpe (GpeEventInfo, ACPI_GPE_DISABLE);
|
||||
break;
|
||||
|
||||
default:
|
||||
Status = AE_BAD_PARAMETER;
|
||||
break;
|
||||
}
|
||||
|
||||
UnlockAndExit:
|
||||
AcpiOsReleaseLock (AcpiGbl_GpeLock, Flags);
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
ACPI_EXPORT_SYMBOL (AcpiSetGpe)
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiDisableEvent
|
||||
*
|
||||
* PARAMETERS: Event - The fixed eventto be enabled
|
||||
* PARAMETERS: Event - The fixed event to be disabled
|
||||
* Flags - Reserved
|
||||
*
|
||||
* RETURN: Status
|
||||
@@ -694,53 +344,6 @@ AcpiClearEvent (
|
||||
ACPI_EXPORT_SYMBOL (AcpiClearEvent)
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiClearGpe
|
||||
*
|
||||
* PARAMETERS: GpeDevice - Parent GPE Device. NULL for GPE0/GPE1
|
||||
* GpeNumber - GPE level within the GPE block
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Clear an ACPI event (general purpose)
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiClearGpe (
|
||||
ACPI_HANDLE GpeDevice,
|
||||
UINT32 GpeNumber)
|
||||
{
|
||||
ACPI_STATUS Status = AE_OK;
|
||||
ACPI_GPE_EVENT_INFO *GpeEventInfo;
|
||||
ACPI_CPU_FLAGS Flags;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE (AcpiClearGpe);
|
||||
|
||||
|
||||
Flags = AcpiOsAcquireLock (AcpiGbl_GpeLock);
|
||||
|
||||
/* Ensure that we have a valid GPE number */
|
||||
|
||||
GpeEventInfo = AcpiEvGetGpeEventInfo (GpeDevice, GpeNumber);
|
||||
if (!GpeEventInfo)
|
||||
{
|
||||
Status = AE_BAD_PARAMETER;
|
||||
goto UnlockAndExit;
|
||||
}
|
||||
|
||||
Status = AcpiHwClearGpe (GpeEventInfo);
|
||||
|
||||
UnlockAndExit:
|
||||
AcpiOsReleaseLock (AcpiGbl_GpeLock, Flags);
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
ACPI_EXPORT_SYMBOL (AcpiClearGpe)
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiGetEventStatus
|
||||
@@ -760,7 +363,9 @@ AcpiGetEventStatus (
|
||||
UINT32 Event,
|
||||
ACPI_EVENT_STATUS *EventStatus)
|
||||
{
|
||||
ACPI_STATUS Status = AE_OK;
|
||||
ACPI_STATUS Status;
|
||||
ACPI_EVENT_STATUS LocalEventStatus = 0;
|
||||
UINT32 InByte;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE (AcpiGetEventStatus);
|
||||
@@ -778,411 +383,45 @@ AcpiGetEventStatus (
|
||||
return_ACPI_STATUS (AE_BAD_PARAMETER);
|
||||
}
|
||||
|
||||
/* Get the status of the requested fixed event */
|
||||
/* Fixed event currently can be dispatched? */
|
||||
|
||||
if (AcpiGbl_FixedEventHandlers[Event].Handler)
|
||||
{
|
||||
LocalEventStatus |= ACPI_EVENT_FLAG_HAS_HANDLER;
|
||||
}
|
||||
|
||||
/* Fixed event currently enabled? */
|
||||
|
||||
Status = AcpiReadBitRegister (
|
||||
AcpiGbl_FixedEventInfo[Event].StatusRegisterId, EventStatus);
|
||||
AcpiGbl_FixedEventInfo[Event].EnableRegisterId, &InByte);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
return_ACPI_STATUS (Status);
|
||||
if (InByte)
|
||||
{
|
||||
LocalEventStatus |= ACPI_EVENT_FLAG_ENABLED;
|
||||
}
|
||||
|
||||
/* Fixed event currently active? */
|
||||
|
||||
Status = AcpiReadBitRegister (
|
||||
AcpiGbl_FixedEventInfo[Event].StatusRegisterId, &InByte);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
if (InByte)
|
||||
{
|
||||
LocalEventStatus |= ACPI_EVENT_FLAG_SET;
|
||||
}
|
||||
|
||||
(*EventStatus) = LocalEventStatus;
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
}
|
||||
|
||||
ACPI_EXPORT_SYMBOL (AcpiGetEventStatus)
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiGetGpeStatus
|
||||
*
|
||||
* PARAMETERS: GpeDevice - Parent GPE Device. NULL for GPE0/GPE1
|
||||
* GpeNumber - GPE level within the GPE block
|
||||
* EventStatus - Where the current status of the event will
|
||||
* be returned
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Get status of an event (general purpose)
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiGetGpeStatus (
|
||||
ACPI_HANDLE GpeDevice,
|
||||
UINT32 GpeNumber,
|
||||
ACPI_EVENT_STATUS *EventStatus)
|
||||
{
|
||||
ACPI_STATUS Status = AE_OK;
|
||||
ACPI_GPE_EVENT_INFO *GpeEventInfo;
|
||||
ACPI_CPU_FLAGS Flags;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE (AcpiGetGpeStatus);
|
||||
|
||||
|
||||
Flags = AcpiOsAcquireLock (AcpiGbl_GpeLock);
|
||||
|
||||
/* Ensure that we have a valid GPE number */
|
||||
|
||||
GpeEventInfo = AcpiEvGetGpeEventInfo (GpeDevice, GpeNumber);
|
||||
if (!GpeEventInfo)
|
||||
{
|
||||
Status = AE_BAD_PARAMETER;
|
||||
goto UnlockAndExit;
|
||||
}
|
||||
|
||||
/* Obtain status on the requested GPE number */
|
||||
|
||||
Status = AcpiHwGetGpeStatus (GpeEventInfo, EventStatus);
|
||||
|
||||
UnlockAndExit:
|
||||
AcpiOsReleaseLock (AcpiGbl_GpeLock, Flags);
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
ACPI_EXPORT_SYMBOL (AcpiGetGpeStatus)
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiInstallGpeBlock
|
||||
*
|
||||
* PARAMETERS: GpeDevice - Handle to the parent GPE Block Device
|
||||
* GpeBlockAddress - Address and SpaceID
|
||||
* RegisterCount - Number of GPE register pairs in the block
|
||||
* InterruptNumber - H/W interrupt for the block
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Create and Install a block of GPE registers
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiInstallGpeBlock (
|
||||
ACPI_HANDLE GpeDevice,
|
||||
ACPI_GENERIC_ADDRESS *GpeBlockAddress,
|
||||
UINT32 RegisterCount,
|
||||
UINT32 InterruptNumber)
|
||||
{
|
||||
ACPI_STATUS Status;
|
||||
ACPI_OPERAND_OBJECT *ObjDesc;
|
||||
ACPI_NAMESPACE_NODE *Node;
|
||||
ACPI_GPE_BLOCK_INFO *GpeBlock;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE (AcpiInstallGpeBlock);
|
||||
|
||||
|
||||
if ((!GpeDevice) ||
|
||||
(!GpeBlockAddress) ||
|
||||
(!RegisterCount))
|
||||
{
|
||||
return_ACPI_STATUS (AE_BAD_PARAMETER);
|
||||
}
|
||||
|
||||
Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return (Status);
|
||||
}
|
||||
|
||||
Node = AcpiNsValidateHandle (GpeDevice);
|
||||
if (!Node)
|
||||
{
|
||||
Status = AE_BAD_PARAMETER;
|
||||
goto UnlockAndExit;
|
||||
}
|
||||
|
||||
/*
|
||||
* For user-installed GPE Block Devices, the GpeBlockBaseNumber
|
||||
* is always zero
|
||||
*/
|
||||
Status = AcpiEvCreateGpeBlock (Node, GpeBlockAddress, RegisterCount,
|
||||
0, InterruptNumber, &GpeBlock);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
goto UnlockAndExit;
|
||||
}
|
||||
|
||||
/* Install block in the DeviceObject attached to the node */
|
||||
|
||||
ObjDesc = AcpiNsGetAttachedObject (Node);
|
||||
if (!ObjDesc)
|
||||
{
|
||||
/*
|
||||
* No object, create a new one (Device nodes do not always have
|
||||
* an attached object)
|
||||
*/
|
||||
ObjDesc = AcpiUtCreateInternalObject (ACPI_TYPE_DEVICE);
|
||||
if (!ObjDesc)
|
||||
{
|
||||
Status = AE_NO_MEMORY;
|
||||
goto UnlockAndExit;
|
||||
}
|
||||
|
||||
Status = AcpiNsAttachObject (Node, ObjDesc, ACPI_TYPE_DEVICE);
|
||||
|
||||
/* Remove local reference to the object */
|
||||
|
||||
AcpiUtRemoveReference (ObjDesc);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
goto UnlockAndExit;
|
||||
}
|
||||
}
|
||||
|
||||
/* Now install the GPE block in the DeviceObject */
|
||||
|
||||
ObjDesc->Device.GpeBlock = GpeBlock;
|
||||
|
||||
/* Run the _PRW methods and enable the runtime GPEs in the new block */
|
||||
|
||||
Status = AcpiEvInitializeGpeBlock (Node, GpeBlock);
|
||||
|
||||
|
||||
UnlockAndExit:
|
||||
(void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
ACPI_EXPORT_SYMBOL (AcpiInstallGpeBlock)
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiRemoveGpeBlock
|
||||
*
|
||||
* PARAMETERS: GpeDevice - Handle to the parent GPE Block Device
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Remove a previously installed block of GPE registers
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiRemoveGpeBlock (
|
||||
ACPI_HANDLE GpeDevice)
|
||||
{
|
||||
ACPI_OPERAND_OBJECT *ObjDesc;
|
||||
ACPI_STATUS Status;
|
||||
ACPI_NAMESPACE_NODE *Node;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE (AcpiRemoveGpeBlock);
|
||||
|
||||
|
||||
if (!GpeDevice)
|
||||
{
|
||||
return_ACPI_STATUS (AE_BAD_PARAMETER);
|
||||
}
|
||||
|
||||
Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return (Status);
|
||||
}
|
||||
|
||||
Node = AcpiNsValidateHandle (GpeDevice);
|
||||
if (!Node)
|
||||
{
|
||||
Status = AE_BAD_PARAMETER;
|
||||
goto UnlockAndExit;
|
||||
}
|
||||
|
||||
/* Get the DeviceObject attached to the node */
|
||||
|
||||
ObjDesc = AcpiNsGetAttachedObject (Node);
|
||||
if (!ObjDesc ||
|
||||
!ObjDesc->Device.GpeBlock)
|
||||
{
|
||||
return_ACPI_STATUS (AE_NULL_OBJECT);
|
||||
}
|
||||
|
||||
/* Delete the GPE block (but not the DeviceObject) */
|
||||
|
||||
Status = AcpiEvDeleteGpeBlock (ObjDesc->Device.GpeBlock);
|
||||
if (ACPI_SUCCESS (Status))
|
||||
{
|
||||
ObjDesc->Device.GpeBlock = NULL;
|
||||
}
|
||||
|
||||
UnlockAndExit:
|
||||
(void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
ACPI_EXPORT_SYMBOL (AcpiRemoveGpeBlock)
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiGetGpeDevice
|
||||
*
|
||||
* PARAMETERS: Index - System GPE index (0-CurrentGpeCount)
|
||||
* GpeDevice - Where the parent GPE Device is returned
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Obtain the GPE device associated with the input index. A NULL
|
||||
* gpe device indicates that the gpe number is contained in one of
|
||||
* the FADT-defined gpe blocks. Otherwise, the GPE block device.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiGetGpeDevice (
|
||||
UINT32 Index,
|
||||
ACPI_HANDLE *GpeDevice)
|
||||
{
|
||||
ACPI_GPE_DEVICE_INFO Info;
|
||||
ACPI_STATUS Status;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE (AcpiGetGpeDevice);
|
||||
|
||||
|
||||
if (!GpeDevice)
|
||||
{
|
||||
return_ACPI_STATUS (AE_BAD_PARAMETER);
|
||||
}
|
||||
|
||||
if (Index >= AcpiCurrentGpeCount)
|
||||
{
|
||||
return_ACPI_STATUS (AE_NOT_EXIST);
|
||||
}
|
||||
|
||||
/* Setup and walk the GPE list */
|
||||
|
||||
Info.Index = Index;
|
||||
Info.Status = AE_NOT_EXIST;
|
||||
Info.GpeDevice = NULL;
|
||||
Info.NextBlockBaseIndex = 0;
|
||||
|
||||
Status = AcpiEvWalkGpeList (AcpiEvGetGpeDevice, &Info);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
*GpeDevice = ACPI_CAST_PTR (ACPI_HANDLE, Info.GpeDevice);
|
||||
return_ACPI_STATUS (Info.Status);
|
||||
}
|
||||
|
||||
ACPI_EXPORT_SYMBOL (AcpiGetGpeDevice)
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiEvGetGpeDevice
|
||||
*
|
||||
* PARAMETERS: GPE_WALK_CALLBACK
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Matches the input GPE index (0-CurrentGpeCount) with a GPE
|
||||
* block device. NULL if the GPE is one of the FADT-defined GPEs.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
static ACPI_STATUS
|
||||
AcpiEvGetGpeDevice (
|
||||
ACPI_GPE_XRUPT_INFO *GpeXruptInfo,
|
||||
ACPI_GPE_BLOCK_INFO *GpeBlock,
|
||||
void *Context)
|
||||
{
|
||||
ACPI_GPE_DEVICE_INFO *Info = Context;
|
||||
|
||||
|
||||
/* Increment Index by the number of GPEs in this block */
|
||||
|
||||
Info->NextBlockBaseIndex += GpeBlock->GpeCount;
|
||||
|
||||
if (Info->Index < Info->NextBlockBaseIndex)
|
||||
{
|
||||
/*
|
||||
* The GPE index is within this block, get the node. Leave the node
|
||||
* NULL for the FADT-defined GPEs
|
||||
*/
|
||||
if ((GpeBlock->Node)->Type == ACPI_TYPE_DEVICE)
|
||||
{
|
||||
Info->GpeDevice = GpeBlock->Node;
|
||||
}
|
||||
|
||||
Info->Status = AE_OK;
|
||||
return (AE_CTRL_END);
|
||||
}
|
||||
|
||||
return (AE_OK);
|
||||
}
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiDisableAllGpes
|
||||
*
|
||||
* PARAMETERS: None
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Disable and clear all GPEs in all GPE blocks
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiDisableAllGpes (
|
||||
void)
|
||||
{
|
||||
ACPI_STATUS Status;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE (AcpiDisableAllGpes);
|
||||
|
||||
|
||||
Status = AcpiUtAcquireMutex (ACPI_MTX_EVENTS);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
Status = AcpiHwDisableAllGpes ();
|
||||
(void) AcpiUtReleaseMutex (ACPI_MTX_EVENTS);
|
||||
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiEnableAllRuntimeGpes
|
||||
*
|
||||
* PARAMETERS: None
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Enable all "runtime" GPEs, in all GPE blocks
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiEnableAllRuntimeGpes (
|
||||
void)
|
||||
{
|
||||
ACPI_STATUS Status;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE (AcpiEnableAllRuntimeGpes);
|
||||
|
||||
|
||||
Status = AcpiUtAcquireMutex (ACPI_MTX_EVENTS);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
Status = AcpiHwEnableAllRuntimeGpes ();
|
||||
(void) AcpiUtReleaseMutex (ACPI_MTX_EVENTS);
|
||||
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
|
||||
#endif /* !ACPI_REDUCED_HARDWARE */
|
||||
|
||||
1054
minix/drivers/power/acpi/events/evxfgpe.c
Normal file
1054
minix/drivers/power/acpi/events/evxfgpe.c
Normal file
File diff suppressed because it is too large
Load Diff
@@ -5,116 +5,44 @@
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
* 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.
|
||||
*
|
||||
* 2.1. This is your license from Intel Corp. under its intellectual property
|
||||
* rights. You may have additional license terms from the party that provided
|
||||
* you this software, covering your right to use that party's intellectual
|
||||
* property rights.
|
||||
* 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.
|
||||
*
|
||||
* 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
|
||||
* copy of the source code appearing in this file ("Covered Code") an
|
||||
* irrevocable, perpetual, worldwide license under Intel's copyrights in the
|
||||
* base code distributed originally by Intel ("Original Intel Code") to copy,
|
||||
* make derivatives, distribute, use and display any portion of the Covered
|
||||
* Code in any form, with the right to sublicense such rights; and
|
||||
*
|
||||
* 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
|
||||
* license (with the right to sublicense), under only those claims of Intel
|
||||
* patents that are infringed by the Original Intel Code, to make, use, sell,
|
||||
* offer to sell, and import the Covered Code and derivative works thereof
|
||||
* solely to the minimum extent necessary to exercise the above copyright
|
||||
* license, and in no event shall the patent license extend to any additions
|
||||
* to or modifications of the Original Intel Code. No other license or right
|
||||
* is granted directly or by implication, estoppel or otherwise;
|
||||
*
|
||||
* The above copyright and patent license is granted only if the following
|
||||
* conditions are met:
|
||||
*
|
||||
* 3. Conditions
|
||||
*
|
||||
* 3.1. Redistribution of Source with Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification with rights to further distribute source must include
|
||||
* the above Copyright Notice, the above License, this list of Conditions,
|
||||
* and the following Disclaimer and Export Compliance provision. In addition,
|
||||
* Licensee must cause all Covered Code to which Licensee contributes to
|
||||
* contain a file documenting the changes Licensee made to create that Covered
|
||||
* Code and the date of any change. Licensee must include in that file the
|
||||
* documentation of any changes made by any predecessor Licensee. Licensee
|
||||
* must include a prominent statement that the modification is derived,
|
||||
* directly or indirectly, from Original Intel Code.
|
||||
*
|
||||
* 3.2. Redistribution of Source with no Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification without rights to further distribute source must
|
||||
* include the following Disclaimer and Export Compliance provision in the
|
||||
* documentation and/or other materials provided with distribution. In
|
||||
* addition, Licensee may not authorize further sublicense of source of any
|
||||
* portion of the Covered Code, and must include terms to the effect that the
|
||||
* license from Licensee to its licensee is limited to the intellectual
|
||||
* property embodied in the software Licensee provides to its licensee, and
|
||||
* not to intellectual property embodied in modifications its licensee may
|
||||
* make.
|
||||
*
|
||||
* 3.3. Redistribution of Executable. Redistribution in executable form of any
|
||||
* substantial portion of the Covered Code or modification must reproduce the
|
||||
* above Copyright Notice, and the following Disclaimer and Export Compliance
|
||||
* provision in the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3.4. Intel retains all right, title, and interest in and to the Original
|
||||
* Intel Code.
|
||||
*
|
||||
* 3.5. Neither the name Intel nor any other trademark owned or controlled by
|
||||
* Intel shall be used in advertising or otherwise to promote the sale, use or
|
||||
* other dealings in products derived from or relating to the Covered Code
|
||||
* without prior written authorization from Intel.
|
||||
*
|
||||
* 4. Disclaimer and Export Compliance
|
||||
*
|
||||
* 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
|
||||
* HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
|
||||
* IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
|
||||
* INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
|
||||
* UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
|
||||
* PARTICULAR PURPOSE.
|
||||
*
|
||||
* 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
|
||||
* OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
|
||||
* COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
|
||||
* SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
|
||||
* CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
|
||||
* HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
|
||||
* SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
|
||||
* LIMITED REMEDY.
|
||||
*
|
||||
* 4.3. Licensee shall not export, either directly or indirectly, any of this
|
||||
* software or system incorporating such software without first obtaining any
|
||||
* required license or other approval from the U. S. Department of Commerce or
|
||||
* any other agency or department of the United States Government. In the
|
||||
* event Licensee exports any such software from the United States or
|
||||
* re-exports any such software from a foreign destination, Licensee shall
|
||||
* ensure that the distribution and export/re-export of the software is in
|
||||
* compliance with all laws, regulations, orders, or other restrictions of the
|
||||
* U.S. Export Administration Regulations. Licensee agrees that neither it nor
|
||||
* any of its subsidiaries will export/re-export any technical data, process,
|
||||
* software, or service, directly or indirectly, to any country for which the
|
||||
* United States government or any agency thereof requires an export license,
|
||||
* other governmental approval, or letter of assurance, without first obtaining
|
||||
* such license, approval or letter.
|
||||
*
|
||||
*****************************************************************************/
|
||||
* 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 __EVXFREGN_C__
|
||||
#define EXPORT_ACPI_INTERFACES
|
||||
|
||||
#include "acpi.h"
|
||||
#include "accommon.h"
|
||||
@@ -139,6 +67,12 @@
|
||||
*
|
||||
* DESCRIPTION: Install a handler for all OpRegions of a given SpaceId.
|
||||
*
|
||||
* NOTE: This function should only be called after AcpiEnableSubsystem has
|
||||
* been called. This is because any _REG methods associated with the Space ID
|
||||
* are executed here, and these methods can only be safely executed after
|
||||
* the default handlers have been installed and the hardware has been
|
||||
* initialized (via AcpiEnableSubsystem.)
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
@@ -186,10 +120,44 @@ AcpiInstallAddressSpaceHandler (
|
||||
goto UnlockAndExit;
|
||||
}
|
||||
|
||||
/*
|
||||
* For the default SpaceIDs, (the IDs for which there are default region handlers
|
||||
* installed) Only execute the _REG methods if the global initialization _REG
|
||||
* methods have already been run (via AcpiInitializeObjects). In other words,
|
||||
* we will defer the execution of the _REG methods for these SpaceIDs until
|
||||
* execution of AcpiInitializeObjects. This is done because we need the handlers
|
||||
* for the default spaces (mem/io/pci/table) to be installed before we can run
|
||||
* any control methods (or _REG methods). There is known BIOS code that depends
|
||||
* on this.
|
||||
*
|
||||
* For all other SpaceIDs, we can safely execute the _REG methods immediately.
|
||||
* This means that for IDs like EmbeddedController, this function should be called
|
||||
* only after AcpiEnableSubsystem has been called.
|
||||
*/
|
||||
switch (SpaceId)
|
||||
{
|
||||
case ACPI_ADR_SPACE_SYSTEM_MEMORY:
|
||||
case ACPI_ADR_SPACE_SYSTEM_IO:
|
||||
case ACPI_ADR_SPACE_PCI_CONFIG:
|
||||
case ACPI_ADR_SPACE_DATA_TABLE:
|
||||
|
||||
if (!AcpiGbl_RegMethodsExecuted)
|
||||
{
|
||||
/* We will defer execution of the _REG methods for this space */
|
||||
goto UnlockAndExit;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
/* Run all _REG methods for this address space */
|
||||
|
||||
Status = AcpiEvExecuteRegMethods (Node, SpaceId);
|
||||
|
||||
|
||||
UnlockAndExit:
|
||||
(void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
|
||||
return_ACPI_STATUS (Status);
|
||||
@@ -343,4 +311,3 @@ UnlockAndExit:
|
||||
}
|
||||
|
||||
ACPI_EXPORT_SYMBOL (AcpiRemoveAddressSpaceHandler)
|
||||
|
||||
|
||||
@@ -4,117 +4,42 @@
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
* 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.
|
||||
*
|
||||
* 2.1. This is your license from Intel Corp. under its intellectual property
|
||||
* rights. You may have additional license terms from the party that provided
|
||||
* you this software, covering your right to use that party's intellectual
|
||||
* property rights.
|
||||
* 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.
|
||||
*
|
||||
* 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
|
||||
* copy of the source code appearing in this file ("Covered Code") an
|
||||
* irrevocable, perpetual, worldwide license under Intel's copyrights in the
|
||||
* base code distributed originally by Intel ("Original Intel Code") to copy,
|
||||
* make derivatives, distribute, use and display any portion of the Covered
|
||||
* Code in any form, with the right to sublicense such rights; and
|
||||
*
|
||||
* 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
|
||||
* license (with the right to sublicense), under only those claims of Intel
|
||||
* patents that are infringed by the Original Intel Code, to make, use, sell,
|
||||
* offer to sell, and import the Covered Code and derivative works thereof
|
||||
* solely to the minimum extent necessary to exercise the above copyright
|
||||
* license, and in no event shall the patent license extend to any additions
|
||||
* to or modifications of the Original Intel Code. No other license or right
|
||||
* is granted directly or by implication, estoppel or otherwise;
|
||||
*
|
||||
* The above copyright and patent license is granted only if the following
|
||||
* conditions are met:
|
||||
*
|
||||
* 3. Conditions
|
||||
*
|
||||
* 3.1. Redistribution of Source with Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification with rights to further distribute source must include
|
||||
* the above Copyright Notice, the above License, this list of Conditions,
|
||||
* and the following Disclaimer and Export Compliance provision. In addition,
|
||||
* Licensee must cause all Covered Code to which Licensee contributes to
|
||||
* contain a file documenting the changes Licensee made to create that Covered
|
||||
* Code and the date of any change. Licensee must include in that file the
|
||||
* documentation of any changes made by any predecessor Licensee. Licensee
|
||||
* must include a prominent statement that the modification is derived,
|
||||
* directly or indirectly, from Original Intel Code.
|
||||
*
|
||||
* 3.2. Redistribution of Source with no Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification without rights to further distribute source must
|
||||
* include the following Disclaimer and Export Compliance provision in the
|
||||
* documentation and/or other materials provided with distribution. In
|
||||
* addition, Licensee may not authorize further sublicense of source of any
|
||||
* portion of the Covered Code, and must include terms to the effect that the
|
||||
* license from Licensee to its licensee is limited to the intellectual
|
||||
* property embodied in the software Licensee provides to its licensee, and
|
||||
* not to intellectual property embodied in modifications its licensee may
|
||||
* make.
|
||||
*
|
||||
* 3.3. Redistribution of Executable. Redistribution in executable form of any
|
||||
* substantial portion of the Covered Code or modification must reproduce the
|
||||
* above Copyright Notice, and the following Disclaimer and Export Compliance
|
||||
* provision in the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3.4. Intel retains all right, title, and interest in and to the Original
|
||||
* Intel Code.
|
||||
*
|
||||
* 3.5. Neither the name Intel nor any other trademark owned or controlled by
|
||||
* Intel shall be used in advertising or otherwise to promote the sale, use or
|
||||
* other dealings in products derived from or relating to the Covered Code
|
||||
* without prior written authorization from Intel.
|
||||
*
|
||||
* 4. Disclaimer and Export Compliance
|
||||
*
|
||||
* 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
|
||||
* HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
|
||||
* IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
|
||||
* INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
|
||||
|
||||
* UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
|
||||
* PARTICULAR PURPOSE.
|
||||
*
|
||||
* 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
|
||||
* OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
|
||||
* COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
|
||||
* SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
|
||||
* CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
|
||||
* HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
|
||||
* SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
|
||||
* LIMITED REMEDY.
|
||||
*
|
||||
* 4.3. Licensee shall not export, either directly or indirectly, any of this
|
||||
* software or system incorporating such software without first obtaining any
|
||||
* required license or other approval from the U. S. Department of Commerce or
|
||||
* any other agency or department of the United States Government. In the
|
||||
* event Licensee exports any such software from the United States or
|
||||
* re-exports any such software from a foreign destination, Licensee shall
|
||||
* ensure that the distribution and export/re-export of the software is in
|
||||
* compliance with all laws, regulations, orders, or other restrictions of the
|
||||
* U.S. Export Administration Regulations. Licensee agrees that neither it nor
|
||||
* any of its subsidiaries will export/re-export any technical data, process,
|
||||
* software, or service, directly or indirectly, to any country for which the
|
||||
* United States government or any agency thereof requires an export license,
|
||||
* other governmental approval, or letter of assurance, without first obtaining
|
||||
* such license, approval or letter.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
#define __EXCONFIG_C__
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#include "acpi.h"
|
||||
#include "accommon.h"
|
||||
@@ -123,6 +48,7 @@
|
||||
#include "actables.h"
|
||||
#include "acdispat.h"
|
||||
#include "acevents.h"
|
||||
#include "amlcode.h"
|
||||
|
||||
|
||||
#define _COMPONENT ACPI_EXECUTER
|
||||
@@ -206,8 +132,11 @@ AcpiExAddTable (
|
||||
AcpiNsExecModuleCodeList ();
|
||||
AcpiExEnterInterpreter ();
|
||||
|
||||
/* Update GPEs for any new _PRW or _Lxx/_Exx methods. Ignore errors */
|
||||
|
||||
/*
|
||||
* Update GPEs for any new _Lxx/_Exx methods. Ignore errors. The host is
|
||||
* responsible for discovering any new wake GPEs by running _PRW methods
|
||||
* that may have been loaded by this table.
|
||||
*/
|
||||
Status = AcpiTbGetOwnerId (TableIndex, &OwnerId);
|
||||
if (ACPI_SUCCESS (Status))
|
||||
{
|
||||
@@ -249,20 +178,21 @@ AcpiExLoadTableOp (
|
||||
ACPI_FUNCTION_TRACE (ExLoadTableOp);
|
||||
|
||||
|
||||
/* Validate lengths for the SignatureString, OEMIDString, OEMTableID */
|
||||
/* Validate lengths for the Signature, OemId, and OemTableId strings */
|
||||
|
||||
if ((Operand[0]->String.Length > ACPI_NAME_SIZE) ||
|
||||
(Operand[1]->String.Length > ACPI_OEM_ID_SIZE) ||
|
||||
(Operand[2]->String.Length > ACPI_OEM_TABLE_ID_SIZE))
|
||||
{
|
||||
return_ACPI_STATUS (AE_BAD_PARAMETER);
|
||||
return_ACPI_STATUS (AE_AML_STRING_LIMIT);
|
||||
}
|
||||
|
||||
/* Find the ACPI table in the RSDT/XSDT */
|
||||
|
||||
Status = AcpiTbFindTable (Operand[0]->String.Pointer,
|
||||
Operand[1]->String.Pointer,
|
||||
Operand[2]->String.Pointer, &TableIndex);
|
||||
Status = AcpiTbFindTable (
|
||||
Operand[0]->String.Pointer,
|
||||
Operand[1]->String.Pointer,
|
||||
Operand[2]->String.Pointer, &TableIndex);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
if (Status != AE_NOT_FOUND)
|
||||
@@ -292,7 +222,7 @@ AcpiExLoadTableOp (
|
||||
if (Operand[3]->String.Length > 0)
|
||||
{
|
||||
/*
|
||||
* Find the node referenced by the RootPathString. This is the
|
||||
* Find the node referenced by the RootPathString. This is the
|
||||
* location within the namespace where the table will be loaded.
|
||||
*/
|
||||
Status = AcpiNsGetNode (StartNode, Operand[3]->String.Pointer,
|
||||
@@ -307,8 +237,8 @@ AcpiExLoadTableOp (
|
||||
|
||||
if (Operand[4]->String.Length > 0)
|
||||
{
|
||||
if ((Operand[4]->String.Pointer[0] != '\\') &&
|
||||
(Operand[4]->String.Pointer[0] != '^'))
|
||||
if ((Operand[4]->String.Pointer[0] != AML_ROOT_PREFIX) &&
|
||||
(Operand[4]->String.Pointer[0] != AML_PARENT_PREFIX))
|
||||
{
|
||||
/*
|
||||
* Path is not absolute, so it will be relative to the node
|
||||
@@ -369,7 +299,7 @@ AcpiExLoadTableOp (
|
||||
}
|
||||
|
||||
*ReturnDesc = DdbHandle;
|
||||
return_ACPI_STATUS (Status);
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
|
||||
@@ -404,7 +334,7 @@ AcpiExRegionRead (
|
||||
|
||||
for (i = 0; i < Length; i++)
|
||||
{
|
||||
Status = AcpiEvAddressSpaceDispatch (ObjDesc, ACPI_READ,
|
||||
Status = AcpiEvAddressSpaceDispatch (ObjDesc, NULL, ACPI_READ,
|
||||
RegionOffset, 8, &Value);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
@@ -448,8 +378,8 @@ AcpiExLoadOp (
|
||||
ACPI_WALK_STATE *WalkState)
|
||||
{
|
||||
ACPI_OPERAND_OBJECT *DdbHandle;
|
||||
ACPI_TABLE_HEADER *TableHeader;
|
||||
ACPI_TABLE_HEADER *Table;
|
||||
ACPI_TABLE_DESC TableDesc;
|
||||
UINT32 TableIndex;
|
||||
ACPI_STATUS Status;
|
||||
UINT32 Length;
|
||||
@@ -458,8 +388,6 @@ AcpiExLoadOp (
|
||||
ACPI_FUNCTION_TRACE (ExLoadOp);
|
||||
|
||||
|
||||
ACPI_MEMSET (&TableDesc, 0, sizeof (ACPI_TABLE_DESC));
|
||||
|
||||
/* Source Object can be either an OpRegion or a Buffer/Field */
|
||||
|
||||
switch (ObjDesc->Common.Type)
|
||||
@@ -491,16 +419,16 @@ AcpiExLoadOp (
|
||||
|
||||
/* Get the table header first so we can get the table length */
|
||||
|
||||
Table = ACPI_ALLOCATE (sizeof (ACPI_TABLE_HEADER));
|
||||
if (!Table)
|
||||
TableHeader = ACPI_ALLOCATE (sizeof (ACPI_TABLE_HEADER));
|
||||
if (!TableHeader)
|
||||
{
|
||||
return_ACPI_STATUS (AE_NO_MEMORY);
|
||||
}
|
||||
|
||||
Status = AcpiExRegionRead (ObjDesc, sizeof (ACPI_TABLE_HEADER),
|
||||
ACPI_CAST_PTR (UINT8, Table));
|
||||
Length = Table->Length;
|
||||
ACPI_FREE (Table);
|
||||
ACPI_CAST_PTR (UINT8, TableHeader));
|
||||
Length = TableHeader->Length;
|
||||
ACPI_FREE (TableHeader);
|
||||
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
@@ -532,8 +460,8 @@ AcpiExLoadOp (
|
||||
|
||||
/* Allocate a buffer for the table */
|
||||
|
||||
TableDesc.Pointer = ACPI_ALLOCATE (Length);
|
||||
if (!TableDesc.Pointer)
|
||||
Table = ACPI_ALLOCATE (Length);
|
||||
if (!Table)
|
||||
{
|
||||
return_ACPI_STATUS (AE_NO_MEMORY);
|
||||
}
|
||||
@@ -541,17 +469,14 @@ AcpiExLoadOp (
|
||||
/* Read the entire table */
|
||||
|
||||
Status = AcpiExRegionRead (ObjDesc, Length,
|
||||
ACPI_CAST_PTR (UINT8, TableDesc.Pointer));
|
||||
ACPI_CAST_PTR (UINT8, Table));
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
ACPI_FREE (TableDesc.Pointer);
|
||||
ACPI_FREE (Table);
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
TableDesc.Address = ObjDesc->Region.Address;
|
||||
break;
|
||||
|
||||
|
||||
case ACPI_TYPE_BUFFER: /* Buffer or resolved RegionField */
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
|
||||
@@ -566,8 +491,8 @@ AcpiExLoadOp (
|
||||
|
||||
/* Get the actual table length from the table header */
|
||||
|
||||
Table = ACPI_CAST_PTR (ACPI_TABLE_HEADER, ObjDesc->Buffer.Pointer);
|
||||
Length = Table->Length;
|
||||
TableHeader = ACPI_CAST_PTR (ACPI_TABLE_HEADER, ObjDesc->Buffer.Pointer);
|
||||
Length = TableHeader->Length;
|
||||
|
||||
/* Table cannot extend beyond the buffer */
|
||||
|
||||
@@ -584,43 +509,45 @@ AcpiExLoadOp (
|
||||
* Copy the table from the buffer because the buffer could be modified
|
||||
* or even deleted in the future
|
||||
*/
|
||||
TableDesc.Pointer = ACPI_ALLOCATE (Length);
|
||||
if (!TableDesc.Pointer)
|
||||
Table = ACPI_ALLOCATE (Length);
|
||||
if (!Table)
|
||||
{
|
||||
return_ACPI_STATUS (AE_NO_MEMORY);
|
||||
}
|
||||
|
||||
ACPI_MEMCPY (TableDesc.Pointer, Table, Length);
|
||||
TableDesc.Address = ACPI_TO_INTEGER (TableDesc.Pointer);
|
||||
ACPI_MEMCPY (Table, TableHeader, Length);
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
|
||||
return_ACPI_STATUS (AE_AML_OPERAND_TYPE);
|
||||
}
|
||||
|
||||
/* Validate table checksum (will not get validated in TbAddTable) */
|
||||
|
||||
Status = AcpiTbVerifyChecksum (TableDesc.Pointer, Length);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
ACPI_FREE (TableDesc.Pointer);
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
/* Complete the table descriptor */
|
||||
|
||||
TableDesc.Length = Length;
|
||||
TableDesc.Flags = ACPI_TABLE_ORIGIN_ALLOCATED;
|
||||
|
||||
/* Install the new table into the local data structures */
|
||||
|
||||
Status = AcpiTbAddTable (&TableDesc, &TableIndex);
|
||||
ACPI_INFO ((AE_INFO, "Dynamic OEM Table Load:"));
|
||||
(void) AcpiUtAcquireMutex (ACPI_MTX_TABLES);
|
||||
|
||||
Status = AcpiTbInstallStandardTable (ACPI_PTR_TO_PHYSADDR (Table),
|
||||
ACPI_TABLE_ORIGIN_INTERNAL_VIRTUAL, TRUE, TRUE,
|
||||
&TableIndex);
|
||||
|
||||
(void) AcpiUtReleaseMutex (ACPI_MTX_TABLES);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
/* Delete allocated table buffer */
|
||||
|
||||
AcpiTbDeleteTable (&TableDesc);
|
||||
ACPI_FREE (Table);
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
/*
|
||||
* Note: Now table is "INSTALLED", it must be validated before
|
||||
* loading.
|
||||
*/
|
||||
Status = AcpiTbValidateTable (&AcpiGbl_RootTableList.Tables[TableIndex]);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
@@ -652,9 +579,6 @@ AcpiExLoadOp (
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
ACPI_INFO ((AE_INFO, "Dynamic OEM Table Load:"));
|
||||
AcpiTbPrintTableHeader (0, TableDesc.Pointer);
|
||||
|
||||
/* Remove the reference by added by AcpiExStore above */
|
||||
|
||||
AcpiUtRemoveReference (DdbHandle);
|
||||
@@ -663,7 +587,7 @@ AcpiExLoadOp (
|
||||
|
||||
if (AcpiGbl_TableHandler)
|
||||
{
|
||||
(void) AcpiGbl_TableHandler (ACPI_TABLE_EVENT_LOAD, TableDesc.Pointer,
|
||||
(void) AcpiGbl_TableHandler (ACPI_TABLE_EVENT_LOAD, Table,
|
||||
AcpiGbl_TableHandlerContext);
|
||||
}
|
||||
|
||||
@@ -696,6 +620,14 @@ AcpiExUnloadTable (
|
||||
ACPI_FUNCTION_TRACE (ExUnloadTable);
|
||||
|
||||
|
||||
/*
|
||||
* Temporarily emit a warning so that the ASL for the machine can be
|
||||
* hopefully obtained. This is to say that the Unload() operator is
|
||||
* extremely rare if not completely unused.
|
||||
*/
|
||||
ACPI_WARNING ((AE_INFO,
|
||||
"Received request to unload an ACPI table"));
|
||||
|
||||
/*
|
||||
* Validate the handle
|
||||
* Although the handle is partially validated in AcpiExReconfiguration()
|
||||
@@ -711,7 +643,7 @@ AcpiExUnloadTable (
|
||||
(DdbHandle->Common.Type != ACPI_TYPE_LOCAL_REFERENCE) ||
|
||||
(!(DdbHandle->Common.Flags & AOPOBJ_DATA_VALID)))
|
||||
{
|
||||
return_ACPI_STATUS (AE_BAD_PARAMETER);
|
||||
return_ACPI_STATUS (AE_AML_OPERAND_TYPE);
|
||||
}
|
||||
|
||||
/* Get the table index from the DdbHandle */
|
||||
@@ -755,4 +687,3 @@ AcpiExUnloadTable (
|
||||
DdbHandle->Common.Flags &= ~AOPOBJ_DATA_VALID;
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
}
|
||||
|
||||
|
||||
@@ -4,117 +4,42 @@
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
* 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.
|
||||
*
|
||||
* 2.1. This is your license from Intel Corp. under its intellectual property
|
||||
* rights. You may have additional license terms from the party that provided
|
||||
* you this software, covering your right to use that party's intellectual
|
||||
* property rights.
|
||||
* 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.
|
||||
*
|
||||
* 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
|
||||
* copy of the source code appearing in this file ("Covered Code") an
|
||||
* irrevocable, perpetual, worldwide license under Intel's copyrights in the
|
||||
* base code distributed originally by Intel ("Original Intel Code") to copy,
|
||||
* make derivatives, distribute, use and display any portion of the Covered
|
||||
* Code in any form, with the right to sublicense such rights; and
|
||||
*
|
||||
* 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
|
||||
* license (with the right to sublicense), under only those claims of Intel
|
||||
* patents that are infringed by the Original Intel Code, to make, use, sell,
|
||||
* offer to sell, and import the Covered Code and derivative works thereof
|
||||
* solely to the minimum extent necessary to exercise the above copyright
|
||||
* license, and in no event shall the patent license extend to any additions
|
||||
* to or modifications of the Original Intel Code. No other license or right
|
||||
* is granted directly or by implication, estoppel or otherwise;
|
||||
*
|
||||
* The above copyright and patent license is granted only if the following
|
||||
* conditions are met:
|
||||
*
|
||||
* 3. Conditions
|
||||
*
|
||||
* 3.1. Redistribution of Source with Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification with rights to further distribute source must include
|
||||
* the above Copyright Notice, the above License, this list of Conditions,
|
||||
* and the following Disclaimer and Export Compliance provision. In addition,
|
||||
* Licensee must cause all Covered Code to which Licensee contributes to
|
||||
* contain a file documenting the changes Licensee made to create that Covered
|
||||
* Code and the date of any change. Licensee must include in that file the
|
||||
* documentation of any changes made by any predecessor Licensee. Licensee
|
||||
* must include a prominent statement that the modification is derived,
|
||||
* directly or indirectly, from Original Intel Code.
|
||||
*
|
||||
* 3.2. Redistribution of Source with no Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification without rights to further distribute source must
|
||||
* include the following Disclaimer and Export Compliance provision in the
|
||||
* documentation and/or other materials provided with distribution. In
|
||||
* addition, Licensee may not authorize further sublicense of source of any
|
||||
* portion of the Covered Code, and must include terms to the effect that the
|
||||
* license from Licensee to its licensee is limited to the intellectual
|
||||
* property embodied in the software Licensee provides to its licensee, and
|
||||
* not to intellectual property embodied in modifications its licensee may
|
||||
* make.
|
||||
*
|
||||
* 3.3. Redistribution of Executable. Redistribution in executable form of any
|
||||
* substantial portion of the Covered Code or modification must reproduce the
|
||||
* above Copyright Notice, and the following Disclaimer and Export Compliance
|
||||
* provision in the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3.4. Intel retains all right, title, and interest in and to the Original
|
||||
* Intel Code.
|
||||
*
|
||||
* 3.5. Neither the name Intel nor any other trademark owned or controlled by
|
||||
* Intel shall be used in advertising or otherwise to promote the sale, use or
|
||||
* other dealings in products derived from or relating to the Covered Code
|
||||
* without prior written authorization from Intel.
|
||||
*
|
||||
* 4. Disclaimer and Export Compliance
|
||||
*
|
||||
* 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
|
||||
* HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
|
||||
* IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
|
||||
* INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
|
||||
* UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
|
||||
* PARTICULAR PURPOSE.
|
||||
*
|
||||
* 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
|
||||
* OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
|
||||
* COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
|
||||
* SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
|
||||
* CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
|
||||
* HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
|
||||
* SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
|
||||
* LIMITED REMEDY.
|
||||
*
|
||||
* 4.3. Licensee shall not export, either directly or indirectly, any of this
|
||||
* software or system incorporating such software without first obtaining any
|
||||
* required license or other approval from the U. S. Department of Commerce or
|
||||
* any other agency or department of the United States Government. In the
|
||||
* event Licensee exports any such software from the United States or
|
||||
* re-exports any such software from a foreign destination, Licensee shall
|
||||
* ensure that the distribution and export/re-export of the software is in
|
||||
* compliance with all laws, regulations, orders, or other restrictions of the
|
||||
* U.S. Export Administration Regulations. Licensee agrees that neither it nor
|
||||
* any of its subsidiaries will export/re-export any technical data, process,
|
||||
* software, or service, directly or indirectly, to any country for which the
|
||||
* United States government or any agency thereof requires an export license,
|
||||
* other governmental approval, or letter of assurance, without first obtaining
|
||||
* such license, approval or letter.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
|
||||
#define __EXCONVRT_C__
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#include "acpi.h"
|
||||
#include "accommon.h"
|
||||
@@ -186,6 +111,7 @@ AcpiExConvertToInteger (
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
return_ACPI_STATUS (AE_TYPE);
|
||||
}
|
||||
|
||||
@@ -205,7 +131,6 @@ AcpiExConvertToInteger (
|
||||
switch (ObjDesc->Common.Type)
|
||||
{
|
||||
case ACPI_TYPE_STRING:
|
||||
|
||||
/*
|
||||
* Convert string to an integer - for most cases, the string must be
|
||||
* hexadecimal as per the ACPI specification. The only exception (as
|
||||
@@ -219,7 +144,6 @@ AcpiExConvertToInteger (
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case ACPI_TYPE_BUFFER:
|
||||
|
||||
/* Check for zero-length buffer */
|
||||
@@ -251,10 +175,10 @@ AcpiExConvertToInteger (
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
|
||||
/* No other types can get here */
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -271,7 +195,7 @@ AcpiExConvertToInteger (
|
||||
|
||||
/* Save the Result */
|
||||
|
||||
AcpiExTruncateFor32bitTable (ReturnDesc);
|
||||
(void) AcpiExTruncateFor32bitTable (ReturnDesc);
|
||||
*ResultDesc = ReturnDesc;
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
}
|
||||
@@ -314,7 +238,6 @@ AcpiExConvertToBuffer (
|
||||
|
||||
|
||||
case ACPI_TYPE_INTEGER:
|
||||
|
||||
/*
|
||||
* Create a new Buffer object.
|
||||
* Need enough space for one integer
|
||||
@@ -333,9 +256,7 @@ AcpiExConvertToBuffer (
|
||||
AcpiGbl_IntegerByteWidth);
|
||||
break;
|
||||
|
||||
|
||||
case ACPI_TYPE_STRING:
|
||||
|
||||
/*
|
||||
* Create a new Buffer object
|
||||
* Size will be the string length
|
||||
@@ -359,8 +280,8 @@ AcpiExConvertToBuffer (
|
||||
ObjDesc->String.Length);
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
|
||||
return_ACPI_STATUS (AE_TYPE);
|
||||
}
|
||||
|
||||
@@ -416,15 +337,18 @@ AcpiExConvertToAscii (
|
||||
switch (DataWidth)
|
||||
{
|
||||
case 1:
|
||||
|
||||
DecimalLength = ACPI_MAX8_DECIMAL_DIGITS;
|
||||
break;
|
||||
|
||||
case 4:
|
||||
|
||||
DecimalLength = ACPI_MAX32_DECIMAL_DIGITS;
|
||||
break;
|
||||
|
||||
case 8:
|
||||
default:
|
||||
|
||||
DecimalLength = ACPI_MAX64_DECIMAL_DIGITS;
|
||||
break;
|
||||
}
|
||||
@@ -533,7 +457,6 @@ AcpiExConvertToString (
|
||||
*ResultDesc = ObjDesc;
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
|
||||
|
||||
case ACPI_TYPE_INTEGER:
|
||||
|
||||
switch (Type)
|
||||
@@ -577,7 +500,6 @@ AcpiExConvertToString (
|
||||
NewBuf [StringLength] = 0;
|
||||
break;
|
||||
|
||||
|
||||
case ACPI_TYPE_BUFFER:
|
||||
|
||||
/* Setup string length, base, and separator */
|
||||
@@ -676,6 +598,7 @@ AcpiExConvertToString (
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
return_ACPI_STATUS (AE_TYPE);
|
||||
}
|
||||
|
||||
@@ -735,6 +658,7 @@ AcpiExConvertToTargetType (
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
/* No conversion allowed for these types */
|
||||
|
||||
if (DestinationType != SourceDesc->Common.Type)
|
||||
@@ -748,7 +672,6 @@ AcpiExConvertToTargetType (
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case ARGI_TARGETREF:
|
||||
|
||||
switch (DestinationType)
|
||||
@@ -765,7 +688,6 @@ AcpiExConvertToTargetType (
|
||||
16);
|
||||
break;
|
||||
|
||||
|
||||
case ACPI_TYPE_STRING:
|
||||
/*
|
||||
* The operand must be a String. We can convert an
|
||||
@@ -775,7 +697,6 @@ AcpiExConvertToTargetType (
|
||||
ACPI_IMPLICIT_CONVERT_HEX);
|
||||
break;
|
||||
|
||||
|
||||
case ACPI_TYPE_BUFFER:
|
||||
/*
|
||||
* The operand must be a Buffer. We can convert an
|
||||
@@ -784,8 +705,8 @@ AcpiExConvertToTargetType (
|
||||
Status = AcpiExConvertToBuffer (SourceDesc, ResultDesc);
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
|
||||
ACPI_ERROR ((AE_INFO, "Bad destination type during conversion: 0x%X",
|
||||
DestinationType));
|
||||
Status = AE_AML_INTERNAL;
|
||||
@@ -793,15 +714,14 @@ AcpiExConvertToTargetType (
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case ARGI_REFERENCE:
|
||||
/*
|
||||
* CreateXxxxField cases - we are storing the field object into the name
|
||||
*/
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
|
||||
ACPI_ERROR ((AE_INFO,
|
||||
"Unknown Target type ID 0x%X AmlOpcode 0x%X DestType %s",
|
||||
GET_CURRENT_ARG_TYPE (WalkState->OpInfo->RuntimeArgs),
|
||||
@@ -822,5 +742,3 @@ AcpiExConvertToTargetType (
|
||||
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -4,117 +4,42 @@
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
* 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.
|
||||
*
|
||||
* 2.1. This is your license from Intel Corp. under its intellectual property
|
||||
* rights. You may have additional license terms from the party that provided
|
||||
* you this software, covering your right to use that party's intellectual
|
||||
* property rights.
|
||||
* 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.
|
||||
*
|
||||
* 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
|
||||
* copy of the source code appearing in this file ("Covered Code") an
|
||||
* irrevocable, perpetual, worldwide license under Intel's copyrights in the
|
||||
* base code distributed originally by Intel ("Original Intel Code") to copy,
|
||||
* make derivatives, distribute, use and display any portion of the Covered
|
||||
* Code in any form, with the right to sublicense such rights; and
|
||||
*
|
||||
* 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
|
||||
* license (with the right to sublicense), under only those claims of Intel
|
||||
* patents that are infringed by the Original Intel Code, to make, use, sell,
|
||||
* offer to sell, and import the Covered Code and derivative works thereof
|
||||
* solely to the minimum extent necessary to exercise the above copyright
|
||||
* license, and in no event shall the patent license extend to any additions
|
||||
* to or modifications of the Original Intel Code. No other license or right
|
||||
* is granted directly or by implication, estoppel or otherwise;
|
||||
*
|
||||
* The above copyright and patent license is granted only if the following
|
||||
* conditions are met:
|
||||
*
|
||||
* 3. Conditions
|
||||
*
|
||||
* 3.1. Redistribution of Source with Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification with rights to further distribute source must include
|
||||
* the above Copyright Notice, the above License, this list of Conditions,
|
||||
* and the following Disclaimer and Export Compliance provision. In addition,
|
||||
* Licensee must cause all Covered Code to which Licensee contributes to
|
||||
* contain a file documenting the changes Licensee made to create that Covered
|
||||
* Code and the date of any change. Licensee must include in that file the
|
||||
* documentation of any changes made by any predecessor Licensee. Licensee
|
||||
* must include a prominent statement that the modification is derived,
|
||||
* directly or indirectly, from Original Intel Code.
|
||||
*
|
||||
* 3.2. Redistribution of Source with no Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification without rights to further distribute source must
|
||||
* include the following Disclaimer and Export Compliance provision in the
|
||||
* documentation and/or other materials provided with distribution. In
|
||||
* addition, Licensee may not authorize further sublicense of source of any
|
||||
* portion of the Covered Code, and must include terms to the effect that the
|
||||
* license from Licensee to its licensee is limited to the intellectual
|
||||
* property embodied in the software Licensee provides to its licensee, and
|
||||
* not to intellectual property embodied in modifications its licensee may
|
||||
* make.
|
||||
*
|
||||
* 3.3. Redistribution of Executable. Redistribution in executable form of any
|
||||
* substantial portion of the Covered Code or modification must reproduce the
|
||||
* above Copyright Notice, and the following Disclaimer and Export Compliance
|
||||
* provision in the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3.4. Intel retains all right, title, and interest in and to the Original
|
||||
* Intel Code.
|
||||
*
|
||||
* 3.5. Neither the name Intel nor any other trademark owned or controlled by
|
||||
* Intel shall be used in advertising or otherwise to promote the sale, use or
|
||||
* other dealings in products derived from or relating to the Covered Code
|
||||
* without prior written authorization from Intel.
|
||||
*
|
||||
* 4. Disclaimer and Export Compliance
|
||||
*
|
||||
* 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
|
||||
* HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
|
||||
* IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
|
||||
* INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
|
||||
|
||||
* UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
|
||||
* PARTICULAR PURPOSE.
|
||||
*
|
||||
* 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
|
||||
* OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
|
||||
* COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
|
||||
* SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
|
||||
* CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
|
||||
* HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
|
||||
* SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
|
||||
* LIMITED REMEDY.
|
||||
*
|
||||
* 4.3. Licensee shall not export, either directly or indirectly, any of this
|
||||
* software or system incorporating such software without first obtaining any
|
||||
* required license or other approval from the U. S. Department of Commerce or
|
||||
* any other agency or department of the United States Government. In the
|
||||
* event Licensee exports any such software from the United States or
|
||||
* re-exports any such software from a foreign destination, Licensee shall
|
||||
* ensure that the distribution and export/re-export of the software is in
|
||||
* compliance with all laws, regulations, orders, or other restrictions of the
|
||||
* U.S. Export Administration Regulations. Licensee agrees that neither it nor
|
||||
* any of its subsidiaries will export/re-export any technical data, process,
|
||||
* software, or service, directly or indirectly, to any country for which the
|
||||
* United States government or any agency thereof requires an export license,
|
||||
* other governmental approval, or letter of assurance, without first obtaining
|
||||
* such license, approval or letter.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
#define __EXCREATE_C__
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#include "acpi.h"
|
||||
#include "accommon.h"
|
||||
@@ -162,7 +87,7 @@ AcpiExCreateAlias (
|
||||
{
|
||||
/*
|
||||
* Dereference an existing alias so that we don't create a chain
|
||||
* of aliases. With this code, we guarantee that an alias is
|
||||
* of aliases. With this code, we guarantee that an alias is
|
||||
* always exactly one level of indirection away from the
|
||||
* actual aliased name.
|
||||
*/
|
||||
@@ -172,7 +97,7 @@ AcpiExCreateAlias (
|
||||
/*
|
||||
* For objects that can never change (i.e., the NS node will
|
||||
* permanently point to the same object), we can simply attach
|
||||
* the object to the new NS node. For other objects (such as
|
||||
* the object to the new NS node. For other objects (such as
|
||||
* Integers, buffers, etc.), we have to point the Alias node
|
||||
* to the original Node.
|
||||
*/
|
||||
@@ -186,7 +111,6 @@ AcpiExCreateAlias (
|
||||
case ACPI_TYPE_BUFFER:
|
||||
case ACPI_TYPE_PACKAGE:
|
||||
case ACPI_TYPE_BUFFER_FIELD:
|
||||
|
||||
/*
|
||||
* These types open a new scope, so we need the NS node in order to access
|
||||
* any children.
|
||||
@@ -196,7 +120,6 @@ AcpiExCreateAlias (
|
||||
case ACPI_TYPE_PROCESSOR:
|
||||
case ACPI_TYPE_THERMAL:
|
||||
case ACPI_TYPE_LOCAL_SCOPE:
|
||||
|
||||
/*
|
||||
* The new alias has the type ALIAS and points to the original
|
||||
* NS node, not the object itself.
|
||||
@@ -206,7 +129,6 @@ AcpiExCreateAlias (
|
||||
break;
|
||||
|
||||
case ACPI_TYPE_METHOD:
|
||||
|
||||
/*
|
||||
* Control method aliases need to be differentiated
|
||||
*/
|
||||
@@ -220,7 +142,7 @@ AcpiExCreateAlias (
|
||||
|
||||
/*
|
||||
* The new alias assumes the type of the target, and it points
|
||||
* to the same object. The reference count of the object has an
|
||||
* to the same object. The reference count of the object has an
|
||||
* additional reference to prevent deletion out from under either the
|
||||
* target node or the alias Node
|
||||
*/
|
||||
@@ -357,7 +279,7 @@ Cleanup:
|
||||
*
|
||||
* PARAMETERS: AmlStart - Pointer to the region declaration AML
|
||||
* AmlLength - Max length of the declaration AML
|
||||
* RegionSpace - SpaceID for the region
|
||||
* SpaceId - Address space ID for the region
|
||||
* WalkState - Current state
|
||||
*
|
||||
* RETURN: Status
|
||||
@@ -370,7 +292,7 @@ ACPI_STATUS
|
||||
AcpiExCreateRegion (
|
||||
UINT8 *AmlStart,
|
||||
UINT32 AmlLength,
|
||||
UINT8 RegionSpace,
|
||||
UINT8 SpaceId,
|
||||
ACPI_WALK_STATE *WalkState)
|
||||
{
|
||||
ACPI_STATUS Status;
|
||||
@@ -399,15 +321,18 @@ AcpiExCreateRegion (
|
||||
* Space ID must be one of the predefined IDs, or in the user-defined
|
||||
* range
|
||||
*/
|
||||
if ((RegionSpace >= ACPI_NUM_PREDEFINED_REGIONS) &&
|
||||
(RegionSpace < ACPI_USER_REGION_BEGIN))
|
||||
if (!AcpiIsValidSpaceId (SpaceId))
|
||||
{
|
||||
ACPI_ERROR ((AE_INFO, "Invalid AddressSpace type 0x%X", RegionSpace));
|
||||
return_ACPI_STATUS (AE_AML_INVALID_SPACE_ID);
|
||||
/*
|
||||
* Print an error message, but continue. We don't want to abort
|
||||
* a table load for this exception. Instead, if the region is
|
||||
* actually used at runtime, abort the executing method.
|
||||
*/
|
||||
ACPI_ERROR ((AE_INFO, "Invalid/unknown Address Space ID: 0x%2.2X", SpaceId));
|
||||
}
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_LOAD, "Region Type - %s (0x%X)\n",
|
||||
AcpiUtGetRegionName (RegionSpace), RegionSpace));
|
||||
AcpiUtGetRegionName (SpaceId), SpaceId));
|
||||
|
||||
/* Create the region descriptor */
|
||||
|
||||
@@ -425,10 +350,18 @@ AcpiExCreateRegion (
|
||||
RegionObj2 = ObjDesc->Common.NextObject;
|
||||
RegionObj2->Extra.AmlStart = AmlStart;
|
||||
RegionObj2->Extra.AmlLength = AmlLength;
|
||||
if (WalkState->ScopeInfo)
|
||||
{
|
||||
RegionObj2->Extra.ScopeNode = WalkState->ScopeInfo->Scope.Node;
|
||||
}
|
||||
else
|
||||
{
|
||||
RegionObj2->Extra.ScopeNode = Node;
|
||||
}
|
||||
|
||||
/* Init the region from the operands */
|
||||
|
||||
ObjDesc->Region.SpaceId = RegionSpace;
|
||||
ObjDesc->Region.SpaceId = SpaceId;
|
||||
ObjDesc->Region.Address = 0;
|
||||
ObjDesc->Region.Length = 0;
|
||||
ObjDesc->Region.Node = Node;
|
||||
@@ -595,12 +528,10 @@ AcpiExCreateMethod (
|
||||
ObjDesc->Method.AmlLength = AmlLength;
|
||||
|
||||
/*
|
||||
* Disassemble the method flags. Split off the Arg Count
|
||||
* for efficiency
|
||||
* Disassemble the method flags. Split off the ArgCount, Serialized
|
||||
* flag, and SyncLevel for efficiency.
|
||||
*/
|
||||
MethodFlags = (UINT8) Operand[1]->Integer.Value;
|
||||
|
||||
ObjDesc->Method.MethodFlags = (UINT8) (MethodFlags & ~AML_METHOD_ARG_COUNT);
|
||||
ObjDesc->Method.ParamCount = (UINT8) (MethodFlags & AML_METHOD_ARG_COUNT);
|
||||
|
||||
/*
|
||||
@@ -609,6 +540,8 @@ AcpiExCreateMethod (
|
||||
*/
|
||||
if (MethodFlags & AML_METHOD_SERIALIZED)
|
||||
{
|
||||
ObjDesc->Method.InfoFlags = ACPI_METHOD_SERIALIZED;
|
||||
|
||||
/*
|
||||
* ACPI 1.0: SyncLevel = 0
|
||||
* ACPI 2.0: SyncLevel = SyncLevel in method declaration
|
||||
@@ -632,5 +565,3 @@ Exit:
|
||||
AcpiUtRemoveReference (Operand[1]);
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -4,116 +4,42 @@
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
* 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.
|
||||
*
|
||||
* 2.1. This is your license from Intel Corp. under its intellectual property
|
||||
* rights. You may have additional license terms from the party that provided
|
||||
* you this software, covering your right to use that party's intellectual
|
||||
* property rights.
|
||||
* 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.
|
||||
*
|
||||
* 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
|
||||
* copy of the source code appearing in this file ("Covered Code") an
|
||||
* irrevocable, perpetual, worldwide license under Intel's copyrights in the
|
||||
* base code distributed originally by Intel ("Original Intel Code") to copy,
|
||||
* make derivatives, distribute, use and display any portion of the Covered
|
||||
* Code in any form, with the right to sublicense such rights; and
|
||||
*
|
||||
* 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
|
||||
* license (with the right to sublicense), under only those claims of Intel
|
||||
* patents that are infringed by the Original Intel Code, to make, use, sell,
|
||||
* offer to sell, and import the Covered Code and derivative works thereof
|
||||
* solely to the minimum extent necessary to exercise the above copyright
|
||||
* license, and in no event shall the patent license extend to any additions
|
||||
* to or modifications of the Original Intel Code. No other license or right
|
||||
* is granted directly or by implication, estoppel or otherwise;
|
||||
*
|
||||
* The above copyright and patent license is granted only if the following
|
||||
* conditions are met:
|
||||
*
|
||||
* 3. Conditions
|
||||
*
|
||||
* 3.1. Redistribution of Source with Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification with rights to further distribute source must include
|
||||
* the above Copyright Notice, the above License, this list of Conditions,
|
||||
* and the following Disclaimer and Export Compliance provision. In addition,
|
||||
* Licensee must cause all Covered Code to which Licensee contributes to
|
||||
* contain a file documenting the changes Licensee made to create that Covered
|
||||
* Code and the date of any change. Licensee must include in that file the
|
||||
* documentation of any changes made by any predecessor Licensee. Licensee
|
||||
* must include a prominent statement that the modification is derived,
|
||||
* directly or indirectly, from Original Intel Code.
|
||||
*
|
||||
* 3.2. Redistribution of Source with no Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification without rights to further distribute source must
|
||||
* include the following Disclaimer and Export Compliance provision in the
|
||||
* documentation and/or other materials provided with distribution. In
|
||||
* addition, Licensee may not authorize further sublicense of source of any
|
||||
* portion of the Covered Code, and must include terms to the effect that the
|
||||
* license from Licensee to its licensee is limited to the intellectual
|
||||
* property embodied in the software Licensee provides to its licensee, and
|
||||
* not to intellectual property embodied in modifications its licensee may
|
||||
* make.
|
||||
*
|
||||
* 3.3. Redistribution of Executable. Redistribution in executable form of any
|
||||
* substantial portion of the Covered Code or modification must reproduce the
|
||||
* above Copyright Notice, and the following Disclaimer and Export Compliance
|
||||
* provision in the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3.4. Intel retains all right, title, and interest in and to the Original
|
||||
* Intel Code.
|
||||
*
|
||||
* 3.5. Neither the name Intel nor any other trademark owned or controlled by
|
||||
* Intel shall be used in advertising or otherwise to promote the sale, use or
|
||||
* other dealings in products derived from or relating to the Covered Code
|
||||
* without prior written authorization from Intel.
|
||||
*
|
||||
* 4. Disclaimer and Export Compliance
|
||||
*
|
||||
* 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
|
||||
* HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
|
||||
* IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
|
||||
* INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
|
||||
* UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
|
||||
* PARTICULAR PURPOSE.
|
||||
*
|
||||
* 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
|
||||
* OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
|
||||
* COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
|
||||
* SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
|
||||
* CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
|
||||
* HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
|
||||
* SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
|
||||
* LIMITED REMEDY.
|
||||
*
|
||||
* 4.3. Licensee shall not export, either directly or indirectly, any of this
|
||||
* software or system incorporating such software without first obtaining any
|
||||
* required license or other approval from the U. S. Department of Commerce or
|
||||
* any other agency or department of the United States Government. In the
|
||||
* event Licensee exports any such software from the United States or
|
||||
* re-exports any such software from a foreign destination, Licensee shall
|
||||
* ensure that the distribution and export/re-export of the software is in
|
||||
* compliance with all laws, regulations, orders, or other restrictions of the
|
||||
* U.S. Export Administration Regulations. Licensee agrees that neither it nor
|
||||
* any of its subsidiaries will export/re-export any technical data, process,
|
||||
* software, or service, directly or indirectly, to any country for which the
|
||||
* United States government or any agency thereof requires an export license,
|
||||
* other governmental approval, or letter of assurance, without first obtaining
|
||||
* such license, approval or letter.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
#define __EXDEBUG_C__
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#include "acpi.h"
|
||||
#include "accommon.h"
|
||||
@@ -154,6 +80,7 @@ AcpiExDoDebugObject (
|
||||
UINT32 Index)
|
||||
{
|
||||
UINT32 i;
|
||||
UINT32 Timer;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE_PTR (ExDoDebugObject, SourceDesc);
|
||||
@@ -167,13 +94,21 @@ AcpiExDoDebugObject (
|
||||
return_VOID;
|
||||
}
|
||||
|
||||
/*
|
||||
* We will emit the current timer value (in microseconds) with each
|
||||
* debug output. Only need the lower 26 bits. This allows for 67
|
||||
* million microseconds or 67 seconds before rollover.
|
||||
*/
|
||||
Timer = ((UINT32) AcpiOsGetTimer () / 10); /* (100 nanoseconds to microseconds) */
|
||||
Timer &= 0x03FFFFFF;
|
||||
|
||||
/*
|
||||
* Print line header as long as we are not in the middle of an
|
||||
* object display
|
||||
*/
|
||||
if (!((Level > 0) && Index == 0))
|
||||
{
|
||||
AcpiOsPrintf ("[ACPI Debug] %*s", Level, " ");
|
||||
AcpiOsPrintf ("[ACPI Debug %.8u] %*s", Timer, Level, " ");
|
||||
}
|
||||
|
||||
/* Display the index for package output only */
|
||||
@@ -234,9 +169,9 @@ AcpiExDoDebugObject (
|
||||
case ACPI_TYPE_BUFFER:
|
||||
|
||||
AcpiOsPrintf ("[0x%.2X]\n", (UINT32) SourceDesc->Buffer.Length);
|
||||
AcpiUtDumpBuffer2 (SourceDesc->Buffer.Pointer,
|
||||
AcpiUtDumpBuffer (SourceDesc->Buffer.Pointer,
|
||||
(SourceDesc->Buffer.Length < 256) ?
|
||||
SourceDesc->Buffer.Length : 256, DB_BYTE_DISPLAY);
|
||||
SourceDesc->Buffer.Length : 256, DB_BYTE_DISPLAY, 0);
|
||||
break;
|
||||
|
||||
case ACPI_TYPE_STRING:
|
||||
@@ -277,9 +212,10 @@ AcpiExDoDebugObject (
|
||||
/* Case for DdbHandle */
|
||||
|
||||
AcpiOsPrintf ("Table Index 0x%X\n", SourceDesc->Reference.Value);
|
||||
return;
|
||||
return_VOID;
|
||||
|
||||
default:
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -313,6 +249,7 @@ AcpiExDoDebugObject (
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
AcpiExDoDebugObject ((SourceDesc->Reference.Node)->Object,
|
||||
Level+4, 0);
|
||||
break;
|
||||
@@ -346,5 +283,3 @@ AcpiExDoDebugObject (
|
||||
return_VOID;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
@@ -4,116 +4,42 @@
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
* 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.
|
||||
*
|
||||
* 2.1. This is your license from Intel Corp. under its intellectual property
|
||||
* rights. You may have additional license terms from the party that provided
|
||||
* you this software, covering your right to use that party's intellectual
|
||||
* property rights.
|
||||
* 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.
|
||||
*
|
||||
* 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
|
||||
* copy of the source code appearing in this file ("Covered Code") an
|
||||
* irrevocable, perpetual, worldwide license under Intel's copyrights in the
|
||||
* base code distributed originally by Intel ("Original Intel Code") to copy,
|
||||
* make derivatives, distribute, use and display any portion of the Covered
|
||||
* Code in any form, with the right to sublicense such rights; and
|
||||
*
|
||||
* 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
|
||||
* license (with the right to sublicense), under only those claims of Intel
|
||||
* patents that are infringed by the Original Intel Code, to make, use, sell,
|
||||
* offer to sell, and import the Covered Code and derivative works thereof
|
||||
* solely to the minimum extent necessary to exercise the above copyright
|
||||
* license, and in no event shall the patent license extend to any additions
|
||||
* to or modifications of the Original Intel Code. No other license or right
|
||||
* is granted directly or by implication, estoppel or otherwise;
|
||||
*
|
||||
* The above copyright and patent license is granted only if the following
|
||||
* conditions are met:
|
||||
*
|
||||
* 3. Conditions
|
||||
*
|
||||
* 3.1. Redistribution of Source with Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification with rights to further distribute source must include
|
||||
* the above Copyright Notice, the above License, this list of Conditions,
|
||||
* and the following Disclaimer and Export Compliance provision. In addition,
|
||||
* Licensee must cause all Covered Code to which Licensee contributes to
|
||||
* contain a file documenting the changes Licensee made to create that Covered
|
||||
* Code and the date of any change. Licensee must include in that file the
|
||||
* documentation of any changes made by any predecessor Licensee. Licensee
|
||||
* must include a prominent statement that the modification is derived,
|
||||
* directly or indirectly, from Original Intel Code.
|
||||
*
|
||||
* 3.2. Redistribution of Source with no Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification without rights to further distribute source must
|
||||
* include the following Disclaimer and Export Compliance provision in the
|
||||
* documentation and/or other materials provided with distribution. In
|
||||
* addition, Licensee may not authorize further sublicense of source of any
|
||||
* portion of the Covered Code, and must include terms to the effect that the
|
||||
* license from Licensee to its licensee is limited to the intellectual
|
||||
* property embodied in the software Licensee provides to its licensee, and
|
||||
* not to intellectual property embodied in modifications its licensee may
|
||||
* make.
|
||||
*
|
||||
* 3.3. Redistribution of Executable. Redistribution in executable form of any
|
||||
* substantial portion of the Covered Code or modification must reproduce the
|
||||
* above Copyright Notice, and the following Disclaimer and Export Compliance
|
||||
* provision in the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3.4. Intel retains all right, title, and interest in and to the Original
|
||||
* Intel Code.
|
||||
*
|
||||
* 3.5. Neither the name Intel nor any other trademark owned or controlled by
|
||||
* Intel shall be used in advertising or otherwise to promote the sale, use or
|
||||
* other dealings in products derived from or relating to the Covered Code
|
||||
* without prior written authorization from Intel.
|
||||
*
|
||||
* 4. Disclaimer and Export Compliance
|
||||
*
|
||||
* 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
|
||||
* HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
|
||||
* IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
|
||||
* INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
|
||||
* UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
|
||||
* PARTICULAR PURPOSE.
|
||||
*
|
||||
* 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
|
||||
* OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
|
||||
* COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
|
||||
* SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
|
||||
* CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
|
||||
* HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
|
||||
* SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
|
||||
* LIMITED REMEDY.
|
||||
*
|
||||
* 4.3. Licensee shall not export, either directly or indirectly, any of this
|
||||
* software or system incorporating such software without first obtaining any
|
||||
* required license or other approval from the U. S. Department of Commerce or
|
||||
* any other agency or department of the United States Government. In the
|
||||
* event Licensee exports any such software from the United States or
|
||||
* re-exports any such software from a foreign destination, Licensee shall
|
||||
* ensure that the distribution and export/re-export of the software is in
|
||||
* compliance with all laws, regulations, orders, or other restrictions of the
|
||||
* U.S. Export Administration Regulations. Licensee agrees that neither it nor
|
||||
* any of its subsidiaries will export/re-export any technical data, process,
|
||||
* software, or service, directly or indirectly, to any country for which the
|
||||
* United States government or any agency thereof requires an export license,
|
||||
* other governmental approval, or letter of assurance, without first obtaining
|
||||
* such license, approval or letter.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
#define __EXDUMP_C__
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#include "acpi.h"
|
||||
#include "accommon.h"
|
||||
@@ -186,13 +112,14 @@ static ACPI_EXDUMP_INFO AcpiExDumpBuffer[5] =
|
||||
{ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE (AcpiExDumpBuffer), NULL},
|
||||
{ACPI_EXD_UINT32, ACPI_EXD_OFFSET (Buffer.Length), "Length"},
|
||||
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Buffer.Pointer), "Pointer"},
|
||||
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Buffer.Node), "Parent Node"},
|
||||
{ACPI_EXD_NODE, ACPI_EXD_OFFSET (Buffer.Node), "Parent Node"},
|
||||
{ACPI_EXD_BUFFER, 0, NULL}
|
||||
};
|
||||
|
||||
static ACPI_EXDUMP_INFO AcpiExDumpPackage[5] =
|
||||
static ACPI_EXDUMP_INFO AcpiExDumpPackage[6] =
|
||||
{
|
||||
{ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE (AcpiExDumpPackage), NULL},
|
||||
{ACPI_EXD_NODE, ACPI_EXD_OFFSET (Package.Node), "Parent Node"},
|
||||
{ACPI_EXD_UINT8, ACPI_EXD_OFFSET (Package.Flags), "Flags"},
|
||||
{ACPI_EXD_UINT32, ACPI_EXD_OFFSET (Package.Count), "Elements"},
|
||||
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Package.Elements), "Element List"},
|
||||
@@ -202,9 +129,9 @@ static ACPI_EXDUMP_INFO AcpiExDumpPackage[5] =
|
||||
static ACPI_EXDUMP_INFO AcpiExDumpDevice[4] =
|
||||
{
|
||||
{ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE (AcpiExDumpDevice), NULL},
|
||||
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Device.Handler), "Handler"},
|
||||
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Device.SystemNotify), "System Notify"},
|
||||
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Device.DeviceNotify), "Device Notify"}
|
||||
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Device.NotifyList[0]), "System Notify"},
|
||||
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Device.NotifyList[1]), "Device Notify"},
|
||||
{ACPI_EXD_HDLR_LIST,ACPI_EXD_OFFSET (Device.Handler), "Handler"}
|
||||
};
|
||||
|
||||
static ACPI_EXDUMP_INFO AcpiExDumpEvent[2] =
|
||||
@@ -216,7 +143,7 @@ static ACPI_EXDUMP_INFO AcpiExDumpEvent[2] =
|
||||
static ACPI_EXDUMP_INFO AcpiExDumpMethod[9] =
|
||||
{
|
||||
{ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE (AcpiExDumpMethod), NULL},
|
||||
{ACPI_EXD_UINT8, ACPI_EXD_OFFSET (Method.MethodFlags), "Method Flags"},
|
||||
{ACPI_EXD_UINT8, ACPI_EXD_OFFSET (Method.InfoFlags), "Info Flags"},
|
||||
{ACPI_EXD_UINT8, ACPI_EXD_OFFSET (Method.ParamCount), "Parameter Count"},
|
||||
{ACPI_EXD_UINT8, ACPI_EXD_OFFSET (Method.SyncLevel), "Sync Level"},
|
||||
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Method.Mutex), "Mutex"},
|
||||
@@ -226,33 +153,36 @@ static ACPI_EXDUMP_INFO AcpiExDumpMethod[9] =
|
||||
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Method.AmlStart), "Aml Start"}
|
||||
};
|
||||
|
||||
static ACPI_EXDUMP_INFO AcpiExDumpMutex[5] =
|
||||
static ACPI_EXDUMP_INFO AcpiExDumpMutex[6] =
|
||||
{
|
||||
{ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE (AcpiExDumpMutex), NULL},
|
||||
{ACPI_EXD_UINT8, ACPI_EXD_OFFSET (Mutex.SyncLevel), "Sync Level"},
|
||||
{ACPI_EXD_UINT8, ACPI_EXD_OFFSET (Mutex.OriginalSyncLevel), "Original Sync Level"},
|
||||
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Mutex.OwnerThread), "Owner Thread"},
|
||||
{ACPI_EXD_UINT16, ACPI_EXD_OFFSET (Mutex.AcquisitionDepth), "Acquire Depth"},
|
||||
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Mutex.OsMutex), "OsMutex"}
|
||||
};
|
||||
|
||||
static ACPI_EXDUMP_INFO AcpiExDumpRegion[7] =
|
||||
static ACPI_EXDUMP_INFO AcpiExDumpRegion[8] =
|
||||
{
|
||||
{ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE (AcpiExDumpRegion), NULL},
|
||||
{ACPI_EXD_UINT8, ACPI_EXD_OFFSET (Region.SpaceId), "Space Id"},
|
||||
{ACPI_EXD_UINT8, ACPI_EXD_OFFSET (Region.Flags), "Flags"},
|
||||
{ACPI_EXD_NODE, ACPI_EXD_OFFSET (Region.Node), "Parent Node"},
|
||||
{ACPI_EXD_ADDRESS, ACPI_EXD_OFFSET (Region.Address), "Address"},
|
||||
{ACPI_EXD_UINT32, ACPI_EXD_OFFSET (Region.Length), "Length"},
|
||||
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Region.Handler), "Handler"},
|
||||
{ACPI_EXD_HDLR_LIST,ACPI_EXD_OFFSET (Region.Handler), "Handler"},
|
||||
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Region.Next), "Next"}
|
||||
};
|
||||
|
||||
static ACPI_EXDUMP_INFO AcpiExDumpPower[5] =
|
||||
static ACPI_EXDUMP_INFO AcpiExDumpPower[6] =
|
||||
{
|
||||
{ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE (AcpiExDumpPower), NULL},
|
||||
{ACPI_EXD_UINT32, ACPI_EXD_OFFSET (PowerResource.SystemLevel), "System Level"},
|
||||
{ACPI_EXD_UINT32, ACPI_EXD_OFFSET (PowerResource.ResourceOrder), "Resource Order"},
|
||||
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (PowerResource.SystemNotify), "System Notify"},
|
||||
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (PowerResource.DeviceNotify), "Device Notify"}
|
||||
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (PowerResource.NotifyList[0]), "System Notify"},
|
||||
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (PowerResource.NotifyList[1]), "Device Notify"},
|
||||
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (PowerResource.Handler), "Handler"}
|
||||
};
|
||||
|
||||
static ACPI_EXDUMP_INFO AcpiExDumpProcessor[7] =
|
||||
@@ -261,16 +191,16 @@ static ACPI_EXDUMP_INFO AcpiExDumpProcessor[7] =
|
||||
{ACPI_EXD_UINT8, ACPI_EXD_OFFSET (Processor.ProcId), "Processor ID"},
|
||||
{ACPI_EXD_UINT8 , ACPI_EXD_OFFSET (Processor.Length), "Length"},
|
||||
{ACPI_EXD_ADDRESS, ACPI_EXD_OFFSET (Processor.Address), "Address"},
|
||||
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Processor.SystemNotify), "System Notify"},
|
||||
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Processor.DeviceNotify), "Device Notify"},
|
||||
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Processor.NotifyList[0]), "System Notify"},
|
||||
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Processor.NotifyList[1]), "Device Notify"},
|
||||
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Processor.Handler), "Handler"}
|
||||
};
|
||||
|
||||
static ACPI_EXDUMP_INFO AcpiExDumpThermal[4] =
|
||||
{
|
||||
{ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE (AcpiExDumpThermal), NULL},
|
||||
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (ThermalZone.SystemNotify), "System Notify"},
|
||||
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (ThermalZone.DeviceNotify), "Device Notify"},
|
||||
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (ThermalZone.NotifyList[0]), "System Notify"},
|
||||
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (ThermalZone.NotifyList[1]), "Device Notify"},
|
||||
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (ThermalZone.Handler), "Handler"}
|
||||
};
|
||||
|
||||
@@ -281,11 +211,13 @@ static ACPI_EXDUMP_INFO AcpiExDumpBufferField[3] =
|
||||
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (BufferField.BufferObj), "Buffer Object"}
|
||||
};
|
||||
|
||||
static ACPI_EXDUMP_INFO AcpiExDumpRegionField[3] =
|
||||
static ACPI_EXDUMP_INFO AcpiExDumpRegionField[5] =
|
||||
{
|
||||
{ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE (AcpiExDumpRegionField), NULL},
|
||||
{ACPI_EXD_FIELD, 0, NULL},
|
||||
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Field.RegionObj), "Region Object"}
|
||||
{ACPI_EXD_UINT8, ACPI_EXD_OFFSET (Field.AccessLength), "AccessLength"},
|
||||
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Field.RegionObj), "Region Object"},
|
||||
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Field.ResourceBuffer), "ResourceBuffer"}
|
||||
};
|
||||
|
||||
static ACPI_EXDUMP_INFO AcpiExDumpBankField[5] =
|
||||
@@ -313,7 +245,7 @@ static ACPI_EXDUMP_INFO AcpiExDumpReference[8] =
|
||||
{ACPI_EXD_UINT8, ACPI_EXD_OFFSET (Reference.TargetType), "Target Type"},
|
||||
{ACPI_EXD_UINT32, ACPI_EXD_OFFSET (Reference.Value), "Value"},
|
||||
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Reference.Object), "Object Desc"},
|
||||
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Reference.Node), "Node"},
|
||||
{ACPI_EXD_NODE, ACPI_EXD_OFFSET (Reference.Node), "Node"},
|
||||
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Reference.Where), "Where"},
|
||||
{ACPI_EXD_REFERENCE,0, NULL}
|
||||
};
|
||||
@@ -322,28 +254,49 @@ static ACPI_EXDUMP_INFO AcpiExDumpAddressHandler[6] =
|
||||
{
|
||||
{ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE (AcpiExDumpAddressHandler), NULL},
|
||||
{ACPI_EXD_UINT8, ACPI_EXD_OFFSET (AddressSpace.SpaceId), "Space Id"},
|
||||
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (AddressSpace.Next), "Next"},
|
||||
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (AddressSpace.RegionList), "Region List"},
|
||||
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (AddressSpace.Node), "Node"},
|
||||
{ACPI_EXD_HDLR_LIST,ACPI_EXD_OFFSET (AddressSpace.Next), "Next"},
|
||||
{ACPI_EXD_RGN_LIST, ACPI_EXD_OFFSET (AddressSpace.RegionList), "Region List"},
|
||||
{ACPI_EXD_NODE, ACPI_EXD_OFFSET (AddressSpace.Node), "Node"},
|
||||
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (AddressSpace.Context), "Context"}
|
||||
};
|
||||
|
||||
static ACPI_EXDUMP_INFO AcpiExDumpNotify[3] =
|
||||
static ACPI_EXDUMP_INFO AcpiExDumpNotify[7] =
|
||||
{
|
||||
{ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE (AcpiExDumpNotify), NULL},
|
||||
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Notify.Node), "Node"},
|
||||
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Notify.Context), "Context"}
|
||||
{ACPI_EXD_NODE, ACPI_EXD_OFFSET (Notify.Node), "Node"},
|
||||
{ACPI_EXD_UINT32, ACPI_EXD_OFFSET (Notify.HandlerType), "Handler Type"},
|
||||
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Notify.Handler), "Handler"},
|
||||
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Notify.Context), "Context"},
|
||||
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Notify.Next[0]), "Next System Notify"},
|
||||
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Notify.Next[1]), "Next Device Notify"}
|
||||
};
|
||||
|
||||
static ACPI_EXDUMP_INFO AcpiExDumpExtra[6] =
|
||||
{
|
||||
{ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE (AcpiExDumpExtra), NULL},
|
||||
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Extra.Method_REG), "_REG Method"},
|
||||
{ACPI_EXD_NODE, ACPI_EXD_OFFSET (Extra.ScopeNode), "Scope Node"},
|
||||
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Extra.RegionContext), "Region Context"},
|
||||
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Extra.AmlStart), "Aml Start"},
|
||||
{ACPI_EXD_UINT32, ACPI_EXD_OFFSET (Extra.AmlLength), "Aml Length"}
|
||||
};
|
||||
|
||||
static ACPI_EXDUMP_INFO AcpiExDumpData[3] =
|
||||
{
|
||||
{ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE (AcpiExDumpData), NULL},
|
||||
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Data.Handler), "Handler"},
|
||||
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Data.Pointer), "Raw Data"}
|
||||
};
|
||||
|
||||
/* Miscellaneous tables */
|
||||
|
||||
static ACPI_EXDUMP_INFO AcpiExDumpCommon[4] =
|
||||
static ACPI_EXDUMP_INFO AcpiExDumpCommon[5] =
|
||||
{
|
||||
{ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE (AcpiExDumpCommon), NULL},
|
||||
{ACPI_EXD_TYPE , 0, NULL},
|
||||
{ACPI_EXD_UINT16, ACPI_EXD_OFFSET (Common.ReferenceCount), "Reference Count"},
|
||||
{ACPI_EXD_UINT8, ACPI_EXD_OFFSET (Common.Flags), "Flags"}
|
||||
{ACPI_EXD_UINT8, ACPI_EXD_OFFSET (Common.Flags), "Flags"},
|
||||
{ACPI_EXD_LIST, ACPI_EXD_OFFSET (Common.NextObject), "Object List"}
|
||||
};
|
||||
|
||||
static ACPI_EXDUMP_INFO AcpiExDumpFieldCommon[7] =
|
||||
@@ -354,16 +307,18 @@ static ACPI_EXDUMP_INFO AcpiExDumpFieldCommon[7] =
|
||||
{ACPI_EXD_UINT32, ACPI_EXD_OFFSET (CommonField.BitLength), "Bit Length"},
|
||||
{ACPI_EXD_UINT8, ACPI_EXD_OFFSET (CommonField.StartFieldBitOffset),"Field Bit Offset"},
|
||||
{ACPI_EXD_UINT32, ACPI_EXD_OFFSET (CommonField.BaseByteOffset), "Base Byte Offset"},
|
||||
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (CommonField.Node), "Parent Node"}
|
||||
{ACPI_EXD_NODE, ACPI_EXD_OFFSET (CommonField.Node), "Parent Node"}
|
||||
};
|
||||
|
||||
static ACPI_EXDUMP_INFO AcpiExDumpNode[5] =
|
||||
static ACPI_EXDUMP_INFO AcpiExDumpNode[7] =
|
||||
{
|
||||
{ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE (AcpiExDumpNode), NULL},
|
||||
{ACPI_EXD_UINT8, ACPI_EXD_NSOFFSET (Flags), "Flags"},
|
||||
{ACPI_EXD_UINT8, ACPI_EXD_NSOFFSET (OwnerId), "Owner Id"},
|
||||
{ACPI_EXD_POINTER, ACPI_EXD_NSOFFSET (Child), "Child List"},
|
||||
{ACPI_EXD_POINTER, ACPI_EXD_NSOFFSET (Peer), "Next Peer"}
|
||||
{ACPI_EXD_LIST, ACPI_EXD_NSOFFSET (Object), "Object List"},
|
||||
{ACPI_EXD_NODE, ACPI_EXD_NSOFFSET (Parent), "Parent"},
|
||||
{ACPI_EXD_NODE, ACPI_EXD_NSOFFSET (Child), "Child"},
|
||||
{ACPI_EXD_NODE, ACPI_EXD_NSOFFSET (Peer), "Peer"}
|
||||
};
|
||||
|
||||
|
||||
@@ -398,7 +353,9 @@ static ACPI_EXDUMP_INFO *AcpiExDumpInfo[] =
|
||||
AcpiExDumpAddressHandler,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL
|
||||
NULL,
|
||||
AcpiExDumpExtra,
|
||||
AcpiExDumpData
|
||||
};
|
||||
|
||||
|
||||
@@ -423,7 +380,12 @@ AcpiExDumpObject (
|
||||
{
|
||||
UINT8 *Target;
|
||||
char *Name;
|
||||
const char *ReferenceName;
|
||||
UINT8 Count;
|
||||
ACPI_OPERAND_OBJECT *Start;
|
||||
ACPI_OPERAND_OBJECT *Data = NULL;
|
||||
ACPI_OPERAND_OBJECT *Next;
|
||||
ACPI_NAMESPACE_NODE *Node;
|
||||
|
||||
|
||||
if (!Info)
|
||||
@@ -446,11 +408,13 @@ AcpiExDumpObject (
|
||||
switch (Info->Opcode)
|
||||
{
|
||||
case ACPI_EXD_INIT:
|
||||
|
||||
break;
|
||||
|
||||
case ACPI_EXD_TYPE:
|
||||
|
||||
AcpiExOutString ("Type", AcpiUtGetObjectTypeName (ObjDesc));
|
||||
AcpiOsPrintf ("%20s : %2.2X [%s]\n", "Type",
|
||||
ObjDesc->Common.Type, AcpiUtGetObjectTypeName (ObjDesc));
|
||||
break;
|
||||
|
||||
case ACPI_EXD_UINT8:
|
||||
@@ -506,11 +470,125 @@ AcpiExDumpObject (
|
||||
|
||||
case ACPI_EXD_REFERENCE:
|
||||
|
||||
AcpiExOutString ("Class Name",
|
||||
ACPI_CAST_PTR (char, AcpiUtGetReferenceName (ObjDesc)));
|
||||
ReferenceName = AcpiUtGetReferenceName (ObjDesc);
|
||||
AcpiExOutString ("Class Name", ACPI_CAST_PTR (char, ReferenceName));
|
||||
AcpiExDumpReferenceObj (ObjDesc);
|
||||
break;
|
||||
|
||||
case ACPI_EXD_LIST:
|
||||
|
||||
Start = *ACPI_CAST_PTR (void *, Target);
|
||||
Next = Start;
|
||||
|
||||
AcpiOsPrintf ("%20s : %p", Name, Next);
|
||||
if (Next)
|
||||
{
|
||||
AcpiOsPrintf ("(%s %2.2X)",
|
||||
AcpiUtGetObjectTypeName (Next), Next->Common.Type);
|
||||
|
||||
while (Next->Common.NextObject)
|
||||
{
|
||||
if ((Next->Common.Type == ACPI_TYPE_LOCAL_DATA) &&
|
||||
!Data)
|
||||
{
|
||||
Data = Next;
|
||||
}
|
||||
|
||||
Next = Next->Common.NextObject;
|
||||
AcpiOsPrintf ("->%p(%s %2.2X)", Next,
|
||||
AcpiUtGetObjectTypeName (Next), Next->Common.Type);
|
||||
|
||||
if ((Next == Start) || (Next == Data))
|
||||
{
|
||||
AcpiOsPrintf ("\n**** Error: Object list appears to be circular linked");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
AcpiOsPrintf ("\n");
|
||||
break;
|
||||
|
||||
case ACPI_EXD_HDLR_LIST:
|
||||
|
||||
Start = *ACPI_CAST_PTR (void *, Target);
|
||||
Next = Start;
|
||||
|
||||
AcpiOsPrintf ("%20s : %p", Name, Next);
|
||||
if (Next)
|
||||
{
|
||||
AcpiOsPrintf ("(%s %2.2X)",
|
||||
AcpiUtGetObjectTypeName (Next), Next->Common.Type);
|
||||
|
||||
while (Next->AddressSpace.Next)
|
||||
{
|
||||
if ((Next->Common.Type == ACPI_TYPE_LOCAL_DATA) &&
|
||||
!Data)
|
||||
{
|
||||
Data = Next;
|
||||
}
|
||||
|
||||
Next = Next->AddressSpace.Next;
|
||||
AcpiOsPrintf ("->%p(%s %2.2X)", Next,
|
||||
AcpiUtGetObjectTypeName (Next), Next->Common.Type);
|
||||
|
||||
if ((Next == Start) || (Next == Data))
|
||||
{
|
||||
AcpiOsPrintf ("\n**** Error: Handler list appears to be circular linked");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
AcpiOsPrintf ("\n");
|
||||
break;
|
||||
|
||||
case ACPI_EXD_RGN_LIST:
|
||||
|
||||
Start = *ACPI_CAST_PTR (void *, Target);
|
||||
Next = Start;
|
||||
|
||||
AcpiOsPrintf ("%20s : %p", Name, Next);
|
||||
if (Next)
|
||||
{
|
||||
AcpiOsPrintf ("(%s %2.2X)",
|
||||
AcpiUtGetObjectTypeName (Next), Next->Common.Type);
|
||||
|
||||
while (Next->Region.Next)
|
||||
{
|
||||
if ((Next->Common.Type == ACPI_TYPE_LOCAL_DATA) &&
|
||||
!Data)
|
||||
{
|
||||
Data = Next;
|
||||
}
|
||||
|
||||
Next = Next->Region.Next;
|
||||
AcpiOsPrintf ("->%p(%s %2.2X)", Next,
|
||||
AcpiUtGetObjectTypeName (Next), Next->Common.Type);
|
||||
|
||||
if ((Next == Start) || (Next == Data))
|
||||
{
|
||||
AcpiOsPrintf ("\n**** Error: Region list appears to be circular linked");
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
AcpiOsPrintf ("\n");
|
||||
break;
|
||||
|
||||
case ACPI_EXD_NODE:
|
||||
|
||||
Node = *ACPI_CAST_PTR (ACPI_NAMESPACE_NODE *, Target);
|
||||
|
||||
AcpiOsPrintf ("%20s : %p", Name, Node);
|
||||
if (Node)
|
||||
{
|
||||
AcpiOsPrintf (" [%4.4s]", Node->Name.Ascii);
|
||||
}
|
||||
AcpiOsPrintf ("\n");
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
AcpiOsPrintf ("**** Invalid table opcode [%X] ****\n",
|
||||
@@ -549,7 +627,9 @@ AcpiExDumpOperand (
|
||||
ACPI_FUNCTION_NAME (ExDumpOperand)
|
||||
|
||||
|
||||
if (!((ACPI_LV_EXEC & AcpiDbgLevel) && (_COMPONENT & AcpiDbgLayer)))
|
||||
/* Check if debug output enabled */
|
||||
|
||||
if (!ACPI_IS_DEBUG_ENABLED (ACPI_LV_EXEC, _COMPONENT))
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -605,19 +685,16 @@ AcpiExDumpOperand (
|
||||
AcpiOsPrintf ("\n");
|
||||
break;
|
||||
|
||||
|
||||
case ACPI_REFCLASS_INDEX:
|
||||
|
||||
AcpiOsPrintf ("%p\n", ObjDesc->Reference.Object);
|
||||
break;
|
||||
|
||||
|
||||
case ACPI_REFCLASS_TABLE:
|
||||
|
||||
AcpiOsPrintf ("Table Index %X\n", ObjDesc->Reference.Value);
|
||||
break;
|
||||
|
||||
|
||||
case ACPI_REFCLASS_REFOF:
|
||||
|
||||
AcpiOsPrintf ("%p [%s]\n", ObjDesc->Reference.Object,
|
||||
@@ -625,20 +702,17 @@ AcpiExDumpOperand (
|
||||
ObjDesc->Reference.Object)->Common.Type));
|
||||
break;
|
||||
|
||||
|
||||
case ACPI_REFCLASS_NAME:
|
||||
|
||||
AcpiOsPrintf ("- [%4.4s]\n", ObjDesc->Reference.Node->Name.Ascii);
|
||||
break;
|
||||
|
||||
|
||||
case ACPI_REFCLASS_ARG:
|
||||
case ACPI_REFCLASS_LOCAL:
|
||||
|
||||
AcpiOsPrintf ("%X\n", ObjDesc->Reference.Value);
|
||||
break;
|
||||
|
||||
|
||||
default: /* Unknown reference class */
|
||||
|
||||
AcpiOsPrintf ("%2.2X\n", ObjDesc->Reference.Class);
|
||||
@@ -646,7 +720,6 @@ AcpiExDumpOperand (
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case ACPI_TYPE_BUFFER:
|
||||
|
||||
AcpiOsPrintf ("Buffer length %.2X @ %p\n",
|
||||
@@ -668,14 +741,12 @@ AcpiExDumpOperand (
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case ACPI_TYPE_INTEGER:
|
||||
|
||||
AcpiOsPrintf ("Integer %8.8X%8.8X\n",
|
||||
ACPI_FORMAT_UINT64 (ObjDesc->Integer.Value));
|
||||
break;
|
||||
|
||||
|
||||
case ACPI_TYPE_PACKAGE:
|
||||
|
||||
AcpiOsPrintf ("Package [Len %X] ElementArray %p\n",
|
||||
@@ -696,7 +767,6 @@ AcpiExDumpOperand (
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case ACPI_TYPE_REGION:
|
||||
|
||||
AcpiOsPrintf ("Region %s (%X)",
|
||||
@@ -719,7 +789,6 @@ AcpiExDumpOperand (
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case ACPI_TYPE_STRING:
|
||||
|
||||
AcpiOsPrintf ("String length %X @ %p ",
|
||||
@@ -730,13 +799,11 @@ AcpiExDumpOperand (
|
||||
AcpiOsPrintf ("\n");
|
||||
break;
|
||||
|
||||
|
||||
case ACPI_TYPE_LOCAL_BANK_FIELD:
|
||||
|
||||
AcpiOsPrintf ("BankField\n");
|
||||
break;
|
||||
|
||||
|
||||
case ACPI_TYPE_LOCAL_REGION_FIELD:
|
||||
|
||||
AcpiOsPrintf ("RegionField: Bits=%X AccWidth=%X Lock=%X Update=%X at "
|
||||
@@ -751,13 +818,11 @@ AcpiExDumpOperand (
|
||||
AcpiExDumpOperand (ObjDesc->Field.RegionObj, Depth+1);
|
||||
break;
|
||||
|
||||
|
||||
case ACPI_TYPE_LOCAL_INDEX_FIELD:
|
||||
|
||||
AcpiOsPrintf ("IndexField\n");
|
||||
break;
|
||||
|
||||
|
||||
case ACPI_TYPE_BUFFER_FIELD:
|
||||
|
||||
AcpiOsPrintf ("BufferField: %X bits at byte %X bit %X of\n",
|
||||
@@ -780,13 +845,11 @@ AcpiExDumpOperand (
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case ACPI_TYPE_EVENT:
|
||||
|
||||
AcpiOsPrintf ("Event\n");
|
||||
break;
|
||||
|
||||
|
||||
case ACPI_TYPE_METHOD:
|
||||
|
||||
AcpiOsPrintf ("Method(%X) @ %p:%X\n",
|
||||
@@ -795,38 +858,33 @@ AcpiExDumpOperand (
|
||||
ObjDesc->Method.AmlLength);
|
||||
break;
|
||||
|
||||
|
||||
case ACPI_TYPE_MUTEX:
|
||||
|
||||
AcpiOsPrintf ("Mutex\n");
|
||||
break;
|
||||
|
||||
|
||||
case ACPI_TYPE_DEVICE:
|
||||
|
||||
AcpiOsPrintf ("Device\n");
|
||||
break;
|
||||
|
||||
|
||||
case ACPI_TYPE_POWER:
|
||||
|
||||
AcpiOsPrintf ("Power\n");
|
||||
break;
|
||||
|
||||
|
||||
case ACPI_TYPE_PROCESSOR:
|
||||
|
||||
AcpiOsPrintf ("Processor\n");
|
||||
break;
|
||||
|
||||
|
||||
case ACPI_TYPE_THERMAL:
|
||||
|
||||
AcpiOsPrintf ("Thermal\n");
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
|
||||
/* Unknown Type */
|
||||
|
||||
AcpiOsPrintf ("Unknown Type %X\n", ObjDesc->Common.Type);
|
||||
@@ -894,7 +952,7 @@ AcpiExDumpOperands (
|
||||
* PARAMETERS: Title - Descriptive text
|
||||
* Value - Value to be displayed
|
||||
*
|
||||
* DESCRIPTION: Object dump output formatting functions. These functions
|
||||
* DESCRIPTION: Object dump output formatting functions. These functions
|
||||
* reduce the number of format strings required and keeps them
|
||||
* all in one place for easy modification.
|
||||
*
|
||||
@@ -939,16 +997,17 @@ AcpiExDumpNamespaceNode (
|
||||
|
||||
if (!Flags)
|
||||
{
|
||||
if (!((ACPI_LV_OBJECTS & AcpiDbgLevel) && (_COMPONENT & AcpiDbgLayer)))
|
||||
/* Check if debug output enabled */
|
||||
|
||||
if (!ACPI_IS_DEBUG_ENABLED (ACPI_LV_OBJECTS, _COMPONENT))
|
||||
{
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
AcpiOsPrintf ("%20s : %4.4s\n", "Name", AcpiUtGetNodeName (Node));
|
||||
AcpiExOutString ("Type", AcpiUtGetTypeName (Node->Type));
|
||||
AcpiExOutPointer ("Attached Object", AcpiNsGetAttachedObject (Node));
|
||||
AcpiExOutPointer ("Parent", Node->Parent);
|
||||
AcpiOsPrintf ("%20s : %2.2X [%s]\n", "Type",
|
||||
Node->Type, AcpiUtGetTypeName (Node->Type));
|
||||
|
||||
AcpiExDumpObject (ACPI_CAST_PTR (ACPI_OPERAND_OBJECT, Node),
|
||||
AcpiExDumpNode);
|
||||
@@ -1067,24 +1126,19 @@ AcpiExDumpPackageObj (
|
||||
ACPI_FORMAT_UINT64 (ObjDesc->Integer.Value));
|
||||
break;
|
||||
|
||||
|
||||
case ACPI_TYPE_STRING:
|
||||
|
||||
AcpiOsPrintf ("[String] Value: ");
|
||||
for (i = 0; i < ObjDesc->String.Length; i++)
|
||||
{
|
||||
AcpiOsPrintf ("%c", ObjDesc->String.Pointer[i]);
|
||||
}
|
||||
AcpiUtPrintString (ObjDesc->String.Pointer, ACPI_UINT8_MAX);
|
||||
AcpiOsPrintf ("\n");
|
||||
break;
|
||||
|
||||
|
||||
case ACPI_TYPE_BUFFER:
|
||||
|
||||
AcpiOsPrintf ("[Buffer] Length %.2X = ", ObjDesc->Buffer.Length);
|
||||
if (ObjDesc->Buffer.Length)
|
||||
{
|
||||
AcpiUtDumpBuffer (ACPI_CAST_PTR (UINT8, ObjDesc->Buffer.Pointer),
|
||||
AcpiUtDebugDumpBuffer (ACPI_CAST_PTR (UINT8, ObjDesc->Buffer.Pointer),
|
||||
ObjDesc->Buffer.Length, DB_DWORD_DISPLAY, _COMPONENT);
|
||||
}
|
||||
else
|
||||
@@ -1093,7 +1147,6 @@ AcpiExDumpPackageObj (
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case ACPI_TYPE_PACKAGE:
|
||||
|
||||
AcpiOsPrintf ("[Package] Contains %u Elements:\n",
|
||||
@@ -1105,7 +1158,6 @@ AcpiExDumpPackageObj (
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case ACPI_TYPE_LOCAL_REFERENCE:
|
||||
|
||||
AcpiOsPrintf ("[Object Reference] Type [%s] %2.2X",
|
||||
@@ -1114,7 +1166,6 @@ AcpiExDumpPackageObj (
|
||||
AcpiExDumpReferenceObj (ObjDesc);
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
|
||||
AcpiOsPrintf ("[Unknown Type] %X\n", ObjDesc->Common.Type);
|
||||
@@ -1149,7 +1200,9 @@ AcpiExDumpObjectDescriptor (
|
||||
|
||||
if (!Flags)
|
||||
{
|
||||
if (!((ACPI_LV_OBJECTS & AcpiDbgLevel) && (_COMPONENT & AcpiDbgLayer)))
|
||||
/* Check if debug output enabled */
|
||||
|
||||
if (!ACPI_IS_DEBUG_ENABLED (ACPI_LV_OBJECTS, _COMPONENT))
|
||||
{
|
||||
return_VOID;
|
||||
}
|
||||
@@ -1162,24 +1215,30 @@ AcpiExDumpObjectDescriptor (
|
||||
AcpiOsPrintf ("\nAttached Object (%p):\n",
|
||||
((ACPI_NAMESPACE_NODE *) ObjDesc)->Object);
|
||||
|
||||
AcpiExDumpObjectDescriptor (
|
||||
((ACPI_NAMESPACE_NODE *) ObjDesc)->Object, Flags);
|
||||
return_VOID;
|
||||
ObjDesc = ((ACPI_NAMESPACE_NODE *) ObjDesc)->Object;
|
||||
goto DumpObject;
|
||||
}
|
||||
|
||||
if (ACPI_GET_DESCRIPTOR_TYPE (ObjDesc) != ACPI_DESC_TYPE_OPERAND)
|
||||
{
|
||||
AcpiOsPrintf (
|
||||
"ExDumpObjectDescriptor: %p is not an ACPI operand object: [%s]\n",
|
||||
"%p is not an ACPI operand object: [%s]\n",
|
||||
ObjDesc, AcpiUtGetDescriptorName (ObjDesc));
|
||||
return_VOID;
|
||||
}
|
||||
|
||||
if (ObjDesc->Common.Type > ACPI_TYPE_NS_NODE_MAX)
|
||||
/* Validate the object type */
|
||||
|
||||
if (ObjDesc->Common.Type > ACPI_TYPE_LOCAL_MAX)
|
||||
{
|
||||
AcpiOsPrintf ("Not a known object type: %2.2X\n",
|
||||
ObjDesc->Common.Type);
|
||||
return_VOID;
|
||||
}
|
||||
|
||||
|
||||
DumpObject:
|
||||
|
||||
/* Common Fields */
|
||||
|
||||
AcpiExDumpObject (ObjDesc, AcpiExDumpCommon);
|
||||
@@ -1187,8 +1246,23 @@ AcpiExDumpObjectDescriptor (
|
||||
/* Object-specific fields */
|
||||
|
||||
AcpiExDumpObject (ObjDesc, AcpiExDumpInfo[ObjDesc->Common.Type]);
|
||||
|
||||
if (ObjDesc->Common.Type == ACPI_TYPE_REGION)
|
||||
{
|
||||
ObjDesc = ObjDesc->Common.NextObject;
|
||||
if (ObjDesc->Common.Type > ACPI_TYPE_LOCAL_MAX)
|
||||
{
|
||||
AcpiOsPrintf ("Secondary object is not a known object type: %2.2X\n",
|
||||
ObjDesc->Common.Type);
|
||||
|
||||
return_VOID;
|
||||
}
|
||||
|
||||
AcpiOsPrintf ("\nExtra attached Object (%p):\n", ObjDesc);
|
||||
AcpiExDumpObject (ObjDesc, AcpiExDumpInfo[ObjDesc->Common.Type]);
|
||||
}
|
||||
|
||||
return_VOID;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
@@ -4,127 +4,121 @@
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
* 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.
|
||||
*
|
||||
* 2.1. This is your license from Intel Corp. under its intellectual property
|
||||
* rights. You may have additional license terms from the party that provided
|
||||
* you this software, covering your right to use that party's intellectual
|
||||
* property rights.
|
||||
* 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.
|
||||
*
|
||||
* 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
|
||||
* copy of the source code appearing in this file ("Covered Code") an
|
||||
* irrevocable, perpetual, worldwide license under Intel's copyrights in the
|
||||
* base code distributed originally by Intel ("Original Intel Code") to copy,
|
||||
* make derivatives, distribute, use and display any portion of the Covered
|
||||
* Code in any form, with the right to sublicense such rights; and
|
||||
*
|
||||
* 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
|
||||
* license (with the right to sublicense), under only those claims of Intel
|
||||
* patents that are infringed by the Original Intel Code, to make, use, sell,
|
||||
* offer to sell, and import the Covered Code and derivative works thereof
|
||||
* solely to the minimum extent necessary to exercise the above copyright
|
||||
* license, and in no event shall the patent license extend to any additions
|
||||
* to or modifications of the Original Intel Code. No other license or right
|
||||
* is granted directly or by implication, estoppel or otherwise;
|
||||
*
|
||||
* The above copyright and patent license is granted only if the following
|
||||
* conditions are met:
|
||||
*
|
||||
* 3. Conditions
|
||||
*
|
||||
* 3.1. Redistribution of Source with Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification with rights to further distribute source must include
|
||||
* the above Copyright Notice, the above License, this list of Conditions,
|
||||
* and the following Disclaimer and Export Compliance provision. In addition,
|
||||
* Licensee must cause all Covered Code to which Licensee contributes to
|
||||
* contain a file documenting the changes Licensee made to create that Covered
|
||||
* Code and the date of any change. Licensee must include in that file the
|
||||
* documentation of any changes made by any predecessor Licensee. Licensee
|
||||
* must include a prominent statement that the modification is derived,
|
||||
* directly or indirectly, from Original Intel Code.
|
||||
*
|
||||
* 3.2. Redistribution of Source with no Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification without rights to further distribute source must
|
||||
* include the following Disclaimer and Export Compliance provision in the
|
||||
* documentation and/or other materials provided with distribution. In
|
||||
* addition, Licensee may not authorize further sublicense of source of any
|
||||
* portion of the Covered Code, and must include terms to the effect that the
|
||||
* license from Licensee to its licensee is limited to the intellectual
|
||||
* property embodied in the software Licensee provides to its licensee, and
|
||||
* not to intellectual property embodied in modifications its licensee may
|
||||
* make.
|
||||
*
|
||||
* 3.3. Redistribution of Executable. Redistribution in executable form of any
|
||||
* substantial portion of the Covered Code or modification must reproduce the
|
||||
* above Copyright Notice, and the following Disclaimer and Export Compliance
|
||||
* provision in the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3.4. Intel retains all right, title, and interest in and to the Original
|
||||
* Intel Code.
|
||||
*
|
||||
* 3.5. Neither the name Intel nor any other trademark owned or controlled by
|
||||
* Intel shall be used in advertising or otherwise to promote the sale, use or
|
||||
* other dealings in products derived from or relating to the Covered Code
|
||||
* without prior written authorization from Intel.
|
||||
*
|
||||
* 4. Disclaimer and Export Compliance
|
||||
*
|
||||
* 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
|
||||
* HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
|
||||
* IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
|
||||
* INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
|
||||
* UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
|
||||
* PARTICULAR PURPOSE.
|
||||
*
|
||||
* 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
|
||||
* OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
|
||||
* COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
|
||||
* SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
|
||||
* CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
|
||||
* HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
|
||||
* SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
|
||||
* LIMITED REMEDY.
|
||||
*
|
||||
* 4.3. Licensee shall not export, either directly or indirectly, any of this
|
||||
* software or system incorporating such software without first obtaining any
|
||||
* required license or other approval from the U. S. Department of Commerce or
|
||||
* any other agency or department of the United States Government. In the
|
||||
* event Licensee exports any such software from the United States or
|
||||
* re-exports any such software from a foreign destination, Licensee shall
|
||||
* ensure that the distribution and export/re-export of the software is in
|
||||
* compliance with all laws, regulations, orders, or other restrictions of the
|
||||
* U.S. Export Administration Regulations. Licensee agrees that neither it nor
|
||||
* any of its subsidiaries will export/re-export any technical data, process,
|
||||
* software, or service, directly or indirectly, to any country for which the
|
||||
* United States government or any agency thereof requires an export license,
|
||||
* other governmental approval, or letter of assurance, without first obtaining
|
||||
* such license, approval or letter.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
|
||||
#define __EXFIELD_C__
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#include "acpi.h"
|
||||
#include "accommon.h"
|
||||
#include "acdispat.h"
|
||||
#include "acinterp.h"
|
||||
#include "amlcode.h"
|
||||
|
||||
|
||||
#define _COMPONENT ACPI_EXECUTER
|
||||
ACPI_MODULE_NAME ("exfield")
|
||||
|
||||
/* Local prototypes */
|
||||
|
||||
static UINT32
|
||||
AcpiExGetSerialAccessLength (
|
||||
UINT32 AccessorType,
|
||||
UINT32 AccessLength);
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiExGetSerialAccessLength
|
||||
*
|
||||
* PARAMETERS: AccessorType - The type of the protocol indicated by region
|
||||
* field access attributes
|
||||
* AccessLength - The access length of the region field
|
||||
*
|
||||
* RETURN: Decoded access length
|
||||
*
|
||||
* DESCRIPTION: This routine returns the length of the GenericSerialBus
|
||||
* protocol bytes
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
static UINT32
|
||||
AcpiExGetSerialAccessLength (
|
||||
UINT32 AccessorType,
|
||||
UINT32 AccessLength)
|
||||
{
|
||||
UINT32 Length;
|
||||
|
||||
|
||||
switch (AccessorType)
|
||||
{
|
||||
case AML_FIELD_ATTRIB_QUICK:
|
||||
|
||||
Length = 0;
|
||||
break;
|
||||
|
||||
case AML_FIELD_ATTRIB_SEND_RCV:
|
||||
case AML_FIELD_ATTRIB_BYTE:
|
||||
|
||||
Length = 1;
|
||||
break;
|
||||
|
||||
case AML_FIELD_ATTRIB_WORD:
|
||||
case AML_FIELD_ATTRIB_WORD_CALL:
|
||||
|
||||
Length = 2;
|
||||
break;
|
||||
|
||||
case AML_FIELD_ATTRIB_MULTIBYTE:
|
||||
case AML_FIELD_ATTRIB_RAW_BYTES:
|
||||
case AML_FIELD_ATTRIB_RAW_PROCESS:
|
||||
|
||||
Length = AccessLength;
|
||||
break;
|
||||
|
||||
case AML_FIELD_ATTRIB_BLOCK:
|
||||
case AML_FIELD_ATTRIB_BLOCK_CALL:
|
||||
default:
|
||||
|
||||
Length = ACPI_GSBUS_BUFFER_SIZE - 2;
|
||||
break;
|
||||
}
|
||||
|
||||
return (Length);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
@@ -136,7 +130,7 @@
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Read from a named field. Returns either an Integer or a
|
||||
* DESCRIPTION: Read from a named field. Returns either an Integer or a
|
||||
* Buffer, depending on the size of the field.
|
||||
*
|
||||
******************************************************************************/
|
||||
@@ -152,6 +146,7 @@ AcpiExReadDataFromField (
|
||||
ACPI_SIZE Length;
|
||||
void *Buffer;
|
||||
UINT32 Function;
|
||||
UINT16 AccessorType;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE_PTR (ExReadDataFromField, ObjDesc);
|
||||
@@ -185,19 +180,36 @@ AcpiExReadDataFromField (
|
||||
}
|
||||
else if ((ObjDesc->Common.Type == ACPI_TYPE_LOCAL_REGION_FIELD) &&
|
||||
(ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_SMBUS ||
|
||||
ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_GSBUS ||
|
||||
ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_IPMI))
|
||||
{
|
||||
/*
|
||||
* This is an SMBus or IPMI read. We must create a buffer to hold
|
||||
* This is an SMBus, GSBus or IPMI read. We must create a buffer to hold
|
||||
* the data and then directly access the region handler.
|
||||
*
|
||||
* Note: Smbus protocol value is passed in upper 16-bits of Function
|
||||
* Note: SMBus and GSBus protocol value is passed in upper 16-bits of Function
|
||||
*/
|
||||
if (ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_SMBUS)
|
||||
{
|
||||
Length = ACPI_SMBUS_BUFFER_SIZE;
|
||||
Function = ACPI_READ | (ObjDesc->Field.Attribute << 16);
|
||||
}
|
||||
else if (ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_GSBUS)
|
||||
{
|
||||
AccessorType = ObjDesc->Field.Attribute;
|
||||
Length = AcpiExGetSerialAccessLength (AccessorType,
|
||||
ObjDesc->Field.AccessLength);
|
||||
|
||||
/*
|
||||
* Add additional 2 bytes for the GenericSerialBus data buffer:
|
||||
*
|
||||
* Status; (Byte 0 of the data buffer)
|
||||
* Length; (Byte 1 of the data buffer)
|
||||
* Data[x-1]; (Bytes 2-x of the arbitrary length data buffer)
|
||||
*/
|
||||
Length += 2;
|
||||
Function = ACPI_READ | (AccessorType << 16);
|
||||
}
|
||||
else /* IPMI */
|
||||
{
|
||||
Length = ACPI_IPMI_BUFFER_SIZE;
|
||||
@@ -227,7 +239,7 @@ AcpiExReadDataFromField (
|
||||
* Allocate a buffer for the contents of the field.
|
||||
*
|
||||
* If the field is larger than the current integer width, create
|
||||
* a BUFFER to hold it. Otherwise, use an INTEGER. This allows
|
||||
* a BUFFER to hold it. Otherwise, use an INTEGER. This allows
|
||||
* the use of arithmetic operators on the returned value if the
|
||||
* field size is equal or smaller than an Integer.
|
||||
*
|
||||
@@ -259,6 +271,39 @@ AcpiExReadDataFromField (
|
||||
Buffer = &BufferDesc->Integer.Value;
|
||||
}
|
||||
|
||||
if ((ObjDesc->Common.Type == ACPI_TYPE_LOCAL_REGION_FIELD) &&
|
||||
(ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_GPIO))
|
||||
{
|
||||
/*
|
||||
* For GPIO (GeneralPurposeIo), the Address will be the bit offset
|
||||
* from the previous Connection() operator, making it effectively a
|
||||
* pin number index. The BitLength is the length of the field, which
|
||||
* is thus the number of pins.
|
||||
*/
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD,
|
||||
"GPIO FieldRead [FROM]: Pin %u Bits %u\n",
|
||||
ObjDesc->Field.PinNumberIndex, ObjDesc->Field.BitLength));
|
||||
|
||||
/* Lock entire transaction if requested */
|
||||
|
||||
AcpiExAcquireGlobalLock (ObjDesc->CommonField.FieldFlags);
|
||||
|
||||
/* Perform the write */
|
||||
|
||||
Status = AcpiExAccessRegion (ObjDesc, 0,
|
||||
(UINT64 *) Buffer, ACPI_READ);
|
||||
AcpiExReleaseGlobalLock (ObjDesc->CommonField.FieldFlags);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
AcpiUtRemoveReference (BufferDesc);
|
||||
}
|
||||
else
|
||||
{
|
||||
*RetBufferDesc = BufferDesc;
|
||||
}
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD,
|
||||
"FieldRead [TO]: Obj %p, Type %X, Buf %p, ByteLen %X\n",
|
||||
ObjDesc, ObjDesc->Common.Type, Buffer, (UINT32) Length));
|
||||
@@ -317,6 +362,7 @@ AcpiExWriteDataToField (
|
||||
void *Buffer;
|
||||
ACPI_OPERAND_OBJECT *BufferDesc;
|
||||
UINT32 Function;
|
||||
UINT16 AccessorType;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE_PTR (ExWriteDataToField, ObjDesc);
|
||||
@@ -346,23 +392,24 @@ AcpiExWriteDataToField (
|
||||
}
|
||||
else if ((ObjDesc->Common.Type == ACPI_TYPE_LOCAL_REGION_FIELD) &&
|
||||
(ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_SMBUS ||
|
||||
ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_GSBUS ||
|
||||
ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_IPMI))
|
||||
{
|
||||
/*
|
||||
* This is an SMBus or IPMI write. We will bypass the entire field
|
||||
* This is an SMBus, GSBus or IPMI write. We will bypass the entire field
|
||||
* mechanism and handoff the buffer directly to the handler. For
|
||||
* these address spaces, the buffer is bi-directional; on a write,
|
||||
* return data is returned in the same buffer.
|
||||
*
|
||||
* Source must be a buffer of sufficient size:
|
||||
* ACPI_SMBUS_BUFFER_SIZE or ACPI_IPMI_BUFFER_SIZE.
|
||||
* ACPI_SMBUS_BUFFER_SIZE, ACPI_GSBUS_BUFFER_SIZE, or ACPI_IPMI_BUFFER_SIZE.
|
||||
*
|
||||
* Note: SMBus protocol type is passed in upper 16-bits of Function
|
||||
* Note: SMBus and GSBus protocol type is passed in upper 16-bits of Function
|
||||
*/
|
||||
if (SourceDesc->Common.Type != ACPI_TYPE_BUFFER)
|
||||
{
|
||||
ACPI_ERROR ((AE_INFO,
|
||||
"SMBus or IPMI write requires Buffer, found type %s",
|
||||
"SMBus/IPMI/GenericSerialBus write requires Buffer, found type %s",
|
||||
AcpiUtGetObjectTypeName (SourceDesc)));
|
||||
|
||||
return_ACPI_STATUS (AE_AML_OPERAND_TYPE);
|
||||
@@ -373,6 +420,22 @@ AcpiExWriteDataToField (
|
||||
Length = ACPI_SMBUS_BUFFER_SIZE;
|
||||
Function = ACPI_WRITE | (ObjDesc->Field.Attribute << 16);
|
||||
}
|
||||
else if (ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_GSBUS)
|
||||
{
|
||||
AccessorType = ObjDesc->Field.Attribute;
|
||||
Length = AcpiExGetSerialAccessLength (AccessorType,
|
||||
ObjDesc->Field.AccessLength);
|
||||
|
||||
/*
|
||||
* Add additional 2 bytes for the GenericSerialBus data buffer:
|
||||
*
|
||||
* Status; (Byte 0 of the data buffer)
|
||||
* Length; (Byte 1 of the data buffer)
|
||||
* Data[x-1]; (Bytes 2-x of the arbitrary length data buffer)
|
||||
*/
|
||||
Length += 2;
|
||||
Function = ACPI_WRITE | (AccessorType << 16);
|
||||
}
|
||||
else /* IPMI */
|
||||
{
|
||||
Length = ACPI_IPMI_BUFFER_SIZE;
|
||||
@@ -382,7 +445,7 @@ AcpiExWriteDataToField (
|
||||
if (SourceDesc->Buffer.Length < Length)
|
||||
{
|
||||
ACPI_ERROR ((AE_INFO,
|
||||
"SMBus or IPMI write requires Buffer of length %u, found length %u",
|
||||
"SMBus/IPMI/GenericSerialBus write requires Buffer of length %u, found length %u",
|
||||
Length, SourceDesc->Buffer.Length));
|
||||
|
||||
return_ACPI_STATUS (AE_AML_BUFFER_LIMIT);
|
||||
@@ -414,27 +477,66 @@ AcpiExWriteDataToField (
|
||||
*ResultDesc = BufferDesc;
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
else if ((ObjDesc->Common.Type == ACPI_TYPE_LOCAL_REGION_FIELD) &&
|
||||
(ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_GPIO))
|
||||
{
|
||||
/*
|
||||
* For GPIO (GeneralPurposeIo), we will bypass the entire field
|
||||
* mechanism and handoff the bit address and bit width directly to
|
||||
* the handler. The Address will be the bit offset
|
||||
* from the previous Connection() operator, making it effectively a
|
||||
* pin number index. The BitLength is the length of the field, which
|
||||
* is thus the number of pins.
|
||||
*/
|
||||
if (SourceDesc->Common.Type != ACPI_TYPE_INTEGER)
|
||||
{
|
||||
return_ACPI_STATUS (AE_AML_OPERAND_TYPE);
|
||||
}
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD,
|
||||
"GPIO FieldWrite [FROM]: (%s:%X), Val %.8X [TO]: Pin %u Bits %u\n",
|
||||
AcpiUtGetTypeName (SourceDesc->Common.Type),
|
||||
SourceDesc->Common.Type, (UINT32) SourceDesc->Integer.Value,
|
||||
ObjDesc->Field.PinNumberIndex, ObjDesc->Field.BitLength));
|
||||
|
||||
Buffer = &SourceDesc->Integer.Value;
|
||||
|
||||
/* Lock entire transaction if requested */
|
||||
|
||||
AcpiExAcquireGlobalLock (ObjDesc->CommonField.FieldFlags);
|
||||
|
||||
/* Perform the write */
|
||||
|
||||
Status = AcpiExAccessRegion (ObjDesc, 0,
|
||||
(UINT64 *) Buffer, ACPI_WRITE);
|
||||
AcpiExReleaseGlobalLock (ObjDesc->CommonField.FieldFlags);
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
/* Get a pointer to the data to be written */
|
||||
|
||||
switch (SourceDesc->Common.Type)
|
||||
{
|
||||
case ACPI_TYPE_INTEGER:
|
||||
|
||||
Buffer = &SourceDesc->Integer.Value;
|
||||
Length = sizeof (SourceDesc->Integer.Value);
|
||||
break;
|
||||
|
||||
case ACPI_TYPE_BUFFER:
|
||||
|
||||
Buffer = SourceDesc->Buffer.Pointer;
|
||||
Length = SourceDesc->Buffer.Length;
|
||||
break;
|
||||
|
||||
case ACPI_TYPE_STRING:
|
||||
|
||||
Buffer = SourceDesc->String.Pointer;
|
||||
Length = SourceDesc->String.Length;
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
return_ACPI_STATUS (AE_AML_OPERAND_TYPE);
|
||||
}
|
||||
|
||||
@@ -462,5 +564,3 @@ AcpiExWriteDataToField (
|
||||
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -4,117 +4,42 @@
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
* 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.
|
||||
*
|
||||
* 2.1. This is your license from Intel Corp. under its intellectual property
|
||||
* rights. You may have additional license terms from the party that provided
|
||||
* you this software, covering your right to use that party's intellectual
|
||||
* property rights.
|
||||
* 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.
|
||||
*
|
||||
* 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
|
||||
* copy of the source code appearing in this file ("Covered Code") an
|
||||
* irrevocable, perpetual, worldwide license under Intel's copyrights in the
|
||||
* base code distributed originally by Intel ("Original Intel Code") to copy,
|
||||
* make derivatives, distribute, use and display any portion of the Covered
|
||||
* Code in any form, with the right to sublicense such rights; and
|
||||
*
|
||||
* 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
|
||||
* license (with the right to sublicense), under only those claims of Intel
|
||||
* patents that are infringed by the Original Intel Code, to make, use, sell,
|
||||
* offer to sell, and import the Covered Code and derivative works thereof
|
||||
* solely to the minimum extent necessary to exercise the above copyright
|
||||
* license, and in no event shall the patent license extend to any additions
|
||||
* to or modifications of the Original Intel Code. No other license or right
|
||||
* is granted directly or by implication, estoppel or otherwise;
|
||||
*
|
||||
* The above copyright and patent license is granted only if the following
|
||||
* conditions are met:
|
||||
*
|
||||
* 3. Conditions
|
||||
*
|
||||
* 3.1. Redistribution of Source with Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification with rights to further distribute source must include
|
||||
* the above Copyright Notice, the above License, this list of Conditions,
|
||||
* and the following Disclaimer and Export Compliance provision. In addition,
|
||||
* Licensee must cause all Covered Code to which Licensee contributes to
|
||||
* contain a file documenting the changes Licensee made to create that Covered
|
||||
* Code and the date of any change. Licensee must include in that file the
|
||||
* documentation of any changes made by any predecessor Licensee. Licensee
|
||||
* must include a prominent statement that the modification is derived,
|
||||
* directly or indirectly, from Original Intel Code.
|
||||
*
|
||||
* 3.2. Redistribution of Source with no Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification without rights to further distribute source must
|
||||
* include the following Disclaimer and Export Compliance provision in the
|
||||
* documentation and/or other materials provided with distribution. In
|
||||
* addition, Licensee may not authorize further sublicense of source of any
|
||||
* portion of the Covered Code, and must include terms to the effect that the
|
||||
* license from Licensee to its licensee is limited to the intellectual
|
||||
* property embodied in the software Licensee provides to its licensee, and
|
||||
* not to intellectual property embodied in modifications its licensee may
|
||||
* make.
|
||||
*
|
||||
* 3.3. Redistribution of Executable. Redistribution in executable form of any
|
||||
* substantial portion of the Covered Code or modification must reproduce the
|
||||
* above Copyright Notice, and the following Disclaimer and Export Compliance
|
||||
* provision in the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3.4. Intel retains all right, title, and interest in and to the Original
|
||||
* Intel Code.
|
||||
*
|
||||
* 3.5. Neither the name Intel nor any other trademark owned or controlled by
|
||||
* Intel shall be used in advertising or otherwise to promote the sale, use or
|
||||
* other dealings in products derived from or relating to the Covered Code
|
||||
* without prior written authorization from Intel.
|
||||
*
|
||||
* 4. Disclaimer and Export Compliance
|
||||
*
|
||||
* 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
|
||||
* HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
|
||||
* IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
|
||||
* INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
|
||||
* UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
|
||||
* PARTICULAR PURPOSE.
|
||||
*
|
||||
* 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
|
||||
* OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
|
||||
* COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
|
||||
* SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
|
||||
* CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
|
||||
* HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
|
||||
* SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
|
||||
* LIMITED REMEDY.
|
||||
*
|
||||
* 4.3. Licensee shall not export, either directly or indirectly, any of this
|
||||
* software or system incorporating such software without first obtaining any
|
||||
* required license or other approval from the U. S. Department of Commerce or
|
||||
* any other agency or department of the United States Government. In the
|
||||
* event Licensee exports any such software from the United States or
|
||||
* re-exports any such software from a foreign destination, Licensee shall
|
||||
* ensure that the distribution and export/re-export of the software is in
|
||||
* compliance with all laws, regulations, orders, or other restrictions of the
|
||||
* U.S. Export Administration Regulations. Licensee agrees that neither it nor
|
||||
* any of its subsidiaries will export/re-export any technical data, process,
|
||||
* software, or service, directly or indirectly, to any country for which the
|
||||
* United States government or any agency thereof requires an export license,
|
||||
* other governmental approval, or letter of assurance, without first obtaining
|
||||
* such license, approval or letter.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
|
||||
#define __EXFLDIO_C__
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#include "acpi.h"
|
||||
#include "accommon.h"
|
||||
@@ -158,7 +83,7 @@ AcpiExSetupRegion (
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Common processing for AcpiExExtractFromField and
|
||||
* AcpiExInsertIntoField. Initialize the Region if necessary and
|
||||
* AcpiExInsertIntoField. Initialize the Region if necessary and
|
||||
* validate the request.
|
||||
*
|
||||
******************************************************************************/
|
||||
@@ -170,6 +95,7 @@ AcpiExSetupRegion (
|
||||
{
|
||||
ACPI_STATUS Status = AE_OK;
|
||||
ACPI_OPERAND_OBJECT *RgnDesc;
|
||||
UINT8 SpaceId;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE_U32 (ExSetupRegion, FieldDatumByteOffset);
|
||||
@@ -188,6 +114,16 @@ AcpiExSetupRegion (
|
||||
return_ACPI_STATUS (AE_AML_OPERAND_TYPE);
|
||||
}
|
||||
|
||||
SpaceId = RgnDesc->Region.SpaceId;
|
||||
|
||||
/* Validate the Space ID */
|
||||
|
||||
if (!AcpiIsValidSpaceId (SpaceId))
|
||||
{
|
||||
ACPI_ERROR ((AE_INFO, "Invalid/unknown Address Space ID: 0x%2.2X", SpaceId));
|
||||
return_ACPI_STATUS (AE_AML_INVALID_SPACE_ID);
|
||||
}
|
||||
|
||||
/*
|
||||
* If the Region Address and Length have not been previously evaluated,
|
||||
* evaluate them now and save the results.
|
||||
@@ -202,11 +138,12 @@ AcpiExSetupRegion (
|
||||
}
|
||||
|
||||
/*
|
||||
* Exit now for SMBus or IPMI address space, it has a non-linear address space
|
||||
* and the request cannot be directly validated
|
||||
* Exit now for SMBus, GSBus or IPMI address space, it has a non-linear
|
||||
* address space and the request cannot be directly validated
|
||||
*/
|
||||
if (RgnDesc->Region.SpaceId == ACPI_ADR_SPACE_SMBUS ||
|
||||
RgnDesc->Region.SpaceId == ACPI_ADR_SPACE_IPMI)
|
||||
if (SpaceId == ACPI_ADR_SPACE_SMBUS ||
|
||||
SpaceId == ACPI_ADR_SPACE_GSBUS ||
|
||||
SpaceId == ACPI_ADR_SPACE_IPMI)
|
||||
{
|
||||
/* SMBus or IPMI has a non-linear address space */
|
||||
|
||||
@@ -228,13 +165,12 @@ AcpiExSetupRegion (
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Validate the request. The entire request from the byte offset for a
|
||||
* Validate the request. The entire request from the byte offset for a
|
||||
* length of one field datum (access width) must fit within the region.
|
||||
* (Region length is specified in bytes)
|
||||
*/
|
||||
if (RgnDesc->Region.Length <
|
||||
(ObjDesc->CommonField.BaseByteOffset +
|
||||
FieldDatumByteOffset +
|
||||
(ObjDesc->CommonField.BaseByteOffset + FieldDatumByteOffset +
|
||||
ObjDesc->CommonField.AccessByteWidth))
|
||||
{
|
||||
if (AcpiGbl_EnableInterpreterSlack)
|
||||
@@ -258,7 +194,7 @@ AcpiExSetupRegion (
|
||||
{
|
||||
/*
|
||||
* This is the case where the AccessType (AccWord, etc.) is wider
|
||||
* than the region itself. For example, a region of length one
|
||||
* than the region itself. For example, a region of length one
|
||||
* byte, and a field with Dword access specified.
|
||||
*/
|
||||
ACPI_ERROR ((AE_INFO,
|
||||
@@ -363,7 +299,8 @@ AcpiExAccessRegion (
|
||||
|
||||
/* Invoke the appropriate AddressSpace/OpRegion handler */
|
||||
|
||||
Status = AcpiEvAddressSpaceDispatch (RgnDesc, Function, RegionOffset,
|
||||
Status = AcpiEvAddressSpaceDispatch (RgnDesc, ObjDesc,
|
||||
Function, RegionOffset,
|
||||
ACPI_MUL_8 (ObjDesc->CommonField.AccessByteWidth), Value);
|
||||
|
||||
if (ACPI_FAILURE (Status))
|
||||
@@ -371,14 +308,14 @@ AcpiExAccessRegion (
|
||||
if (Status == AE_NOT_IMPLEMENTED)
|
||||
{
|
||||
ACPI_ERROR ((AE_INFO,
|
||||
"Region %s(0x%X) not implemented",
|
||||
"Region %s (ID=%u) not implemented",
|
||||
AcpiUtGetRegionName (RgnDesc->Region.SpaceId),
|
||||
RgnDesc->Region.SpaceId));
|
||||
}
|
||||
else if (Status == AE_NOT_EXIST)
|
||||
{
|
||||
ACPI_ERROR ((AE_INFO,
|
||||
"Region %s(0x%X) has no handler",
|
||||
"Region %s (ID=%u) has no handler",
|
||||
AcpiUtGetRegionName (RgnDesc->Region.SpaceId),
|
||||
RgnDesc->Region.SpaceId));
|
||||
}
|
||||
@@ -399,7 +336,7 @@ AcpiExAccessRegion (
|
||||
*
|
||||
* DESCRIPTION: Check if a value is out of range of the field being written.
|
||||
* Used to check if the values written to Index and Bank registers
|
||||
* are out of range. Normally, the value is simply truncated
|
||||
* are out of range. Normally, the value is simply truncated
|
||||
* to fit the field, but this case is most likely a serious
|
||||
* coding error in the ASL.
|
||||
*
|
||||
@@ -426,6 +363,11 @@ AcpiExRegisterOverflow (
|
||||
* The Value is larger than the maximum value that can fit into
|
||||
* the register.
|
||||
*/
|
||||
ACPI_ERROR ((AE_INFO,
|
||||
"Index value 0x%8.8X%8.8X overflows field width 0x%X",
|
||||
ACPI_FORMAT_UINT64 (Value),
|
||||
ObjDesc->CommonField.BitLength));
|
||||
|
||||
return (TRUE);
|
||||
}
|
||||
|
||||
@@ -447,7 +389,7 @@ AcpiExRegisterOverflow (
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Read or Write a single datum of a field. The FieldType is
|
||||
* DESCRIPTION: Read or Write a single datum of a field. The FieldType is
|
||||
* demultiplexed here to handle the different types of fields
|
||||
* (BufferField, RegionField, IndexField, BankField)
|
||||
*
|
||||
@@ -535,9 +477,7 @@ AcpiExFieldDatumIo (
|
||||
Status = AE_OK;
|
||||
break;
|
||||
|
||||
|
||||
case ACPI_TYPE_LOCAL_BANK_FIELD:
|
||||
|
||||
/*
|
||||
* Ensure that the BankValue is not beyond the capacity of
|
||||
* the register
|
||||
@@ -567,7 +507,6 @@ AcpiExFieldDatumIo (
|
||||
|
||||
/*lint -fallthrough */
|
||||
|
||||
|
||||
case ACPI_TYPE_LOCAL_REGION_FIELD:
|
||||
/*
|
||||
* For simple RegionFields, we just directly access the owning
|
||||
@@ -577,10 +516,7 @@ AcpiExFieldDatumIo (
|
||||
ReadWrite);
|
||||
break;
|
||||
|
||||
|
||||
case ACPI_TYPE_LOCAL_INDEX_FIELD:
|
||||
|
||||
|
||||
/*
|
||||
* Ensure that the IndexValue is not beyond the capacity of
|
||||
* the register
|
||||
@@ -630,7 +566,6 @@ AcpiExFieldDatumIo (
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
|
||||
ACPI_ERROR ((AE_INFO, "Wrong object type in field I/O %u",
|
||||
@@ -794,6 +729,7 @@ AcpiExExtractFromField (
|
||||
UINT32 BufferTailBits;
|
||||
UINT32 DatumCount;
|
||||
UINT32 FieldDatumCount;
|
||||
UINT32 AccessBitWidth;
|
||||
UINT32 i;
|
||||
|
||||
|
||||
@@ -803,7 +739,7 @@ AcpiExExtractFromField (
|
||||
/* Validate target buffer and clear it */
|
||||
|
||||
if (BufferLength <
|
||||
ACPI_ROUND_BITS_UP_TO_BYTES (ObjDesc->CommonField.BitLength))
|
||||
ACPI_ROUND_BITS_UP_TO_BYTES (ObjDesc->CommonField.BitLength))
|
||||
{
|
||||
ACPI_ERROR ((AE_INFO,
|
||||
"Field size %u (bits) is too large for buffer (%u)",
|
||||
@@ -811,17 +747,48 @@ AcpiExExtractFromField (
|
||||
|
||||
return_ACPI_STATUS (AE_BUFFER_OVERFLOW);
|
||||
}
|
||||
|
||||
ACPI_MEMSET (Buffer, 0, BufferLength);
|
||||
AccessBitWidth = ACPI_MUL_8 (ObjDesc->CommonField.AccessByteWidth);
|
||||
|
||||
/* Handle the simple case here */
|
||||
|
||||
if ((ObjDesc->CommonField.StartFieldBitOffset == 0) &&
|
||||
(ObjDesc->CommonField.BitLength == AccessBitWidth))
|
||||
{
|
||||
if (BufferLength >= sizeof (UINT64))
|
||||
{
|
||||
Status = AcpiExFieldDatumIo (ObjDesc, 0, Buffer, ACPI_READ);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Use RawDatum (UINT64) to handle buffers < 64 bits */
|
||||
|
||||
Status = AcpiExFieldDatumIo (ObjDesc, 0, &RawDatum, ACPI_READ);
|
||||
ACPI_MEMCPY (Buffer, &RawDatum, BufferLength);
|
||||
}
|
||||
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
/* TBD: Move to common setup code */
|
||||
|
||||
/* Field algorithm is limited to sizeof(UINT64), truncate if needed */
|
||||
|
||||
if (ObjDesc->CommonField.AccessByteWidth > sizeof (UINT64))
|
||||
{
|
||||
ObjDesc->CommonField.AccessByteWidth = sizeof (UINT64);
|
||||
AccessBitWidth = sizeof (UINT64) * 8;
|
||||
}
|
||||
|
||||
/* Compute the number of datums (access width data items) */
|
||||
|
||||
DatumCount = ACPI_ROUND_UP_TO (
|
||||
ObjDesc->CommonField.BitLength,
|
||||
ObjDesc->CommonField.AccessBitWidth);
|
||||
ObjDesc->CommonField.BitLength, AccessBitWidth);
|
||||
|
||||
FieldDatumCount = ACPI_ROUND_UP_TO (
|
||||
ObjDesc->CommonField.BitLength +
|
||||
ObjDesc->CommonField.StartFieldBitOffset,
|
||||
ObjDesc->CommonField.AccessBitWidth);
|
||||
ObjDesc->CommonField.BitLength +
|
||||
ObjDesc->CommonField.StartFieldBitOffset, AccessBitWidth);
|
||||
|
||||
/* Priming read from the field */
|
||||
|
||||
@@ -854,12 +821,11 @@ AcpiExExtractFromField (
|
||||
* This avoids the differences in behavior between different compilers
|
||||
* concerning shift values larger than the target data width.
|
||||
*/
|
||||
if ((ObjDesc->CommonField.AccessBitWidth -
|
||||
ObjDesc->CommonField.StartFieldBitOffset) < ACPI_INTEGER_BIT_SIZE)
|
||||
if (AccessBitWidth - ObjDesc->CommonField.StartFieldBitOffset <
|
||||
ACPI_INTEGER_BIT_SIZE)
|
||||
{
|
||||
MergedDatum |= RawDatum <<
|
||||
(ObjDesc->CommonField.AccessBitWidth -
|
||||
ObjDesc->CommonField.StartFieldBitOffset);
|
||||
(AccessBitWidth - ObjDesc->CommonField.StartFieldBitOffset);
|
||||
}
|
||||
|
||||
if (i == DatumCount)
|
||||
@@ -879,8 +845,7 @@ AcpiExExtractFromField (
|
||||
|
||||
/* Mask off any extra bits in the last datum */
|
||||
|
||||
BufferTailBits = ObjDesc->CommonField.BitLength %
|
||||
ObjDesc->CommonField.AccessBitWidth;
|
||||
BufferTailBits = ObjDesc->CommonField.BitLength % AccessBitWidth;
|
||||
if (BufferTailBits)
|
||||
{
|
||||
MergedDatum &= ACPI_MASK_BITS_ABOVE (BufferTailBits);
|
||||
@@ -916,6 +881,7 @@ AcpiExInsertIntoField (
|
||||
void *Buffer,
|
||||
UINT32 BufferLength)
|
||||
{
|
||||
void *NewBuffer;
|
||||
ACPI_STATUS Status;
|
||||
UINT64 Mask;
|
||||
UINT64 WidthMask;
|
||||
@@ -926,9 +892,9 @@ AcpiExInsertIntoField (
|
||||
UINT32 BufferTailBits;
|
||||
UINT32 DatumCount;
|
||||
UINT32 FieldDatumCount;
|
||||
UINT32 i;
|
||||
UINT32 AccessBitWidth;
|
||||
UINT32 RequiredLength;
|
||||
void *NewBuffer;
|
||||
UINT32 i;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE (ExInsertIntoField);
|
||||
@@ -941,7 +907,7 @@ AcpiExInsertIntoField (
|
||||
ObjDesc->CommonField.BitLength);
|
||||
/*
|
||||
* We must have a buffer that is at least as long as the field
|
||||
* we are writing to. This is because individual fields are
|
||||
* we are writing to. This is because individual fields are
|
||||
* indivisible and partial writes are not supported -- as per
|
||||
* the ACPI specification.
|
||||
*/
|
||||
@@ -957,7 +923,7 @@ AcpiExInsertIntoField (
|
||||
|
||||
/*
|
||||
* Copy the original data to the new buffer, starting
|
||||
* at Byte zero. All unused (upper) bytes of the
|
||||
* at Byte zero. All unused (upper) bytes of the
|
||||
* buffer will be 0.
|
||||
*/
|
||||
ACPI_MEMCPY ((char *) NewBuffer, (char *) Buffer, BufferLength);
|
||||
@@ -965,31 +931,41 @@ AcpiExInsertIntoField (
|
||||
BufferLength = RequiredLength;
|
||||
}
|
||||
|
||||
/* TBD: Move to common setup code */
|
||||
|
||||
/* Algo is limited to sizeof(UINT64), so cut the AccessByteWidth */
|
||||
if (ObjDesc->CommonField.AccessByteWidth > sizeof (UINT64))
|
||||
{
|
||||
ObjDesc->CommonField.AccessByteWidth = sizeof (UINT64);
|
||||
}
|
||||
|
||||
AccessBitWidth = ACPI_MUL_8 (ObjDesc->CommonField.AccessByteWidth);
|
||||
|
||||
/*
|
||||
* Create the bitmasks used for bit insertion.
|
||||
* Note: This if/else is used to bypass compiler differences with the
|
||||
* shift operator
|
||||
*/
|
||||
if (ObjDesc->CommonField.AccessBitWidth == ACPI_INTEGER_BIT_SIZE)
|
||||
if (AccessBitWidth == ACPI_INTEGER_BIT_SIZE)
|
||||
{
|
||||
WidthMask = ACPI_UINT64_MAX;
|
||||
}
|
||||
else
|
||||
{
|
||||
WidthMask = ACPI_MASK_BITS_ABOVE (ObjDesc->CommonField.AccessBitWidth);
|
||||
WidthMask = ACPI_MASK_BITS_ABOVE (AccessBitWidth);
|
||||
}
|
||||
|
||||
Mask = WidthMask &
|
||||
ACPI_MASK_BITS_BELOW (ObjDesc->CommonField.StartFieldBitOffset);
|
||||
ACPI_MASK_BITS_BELOW (ObjDesc->CommonField.StartFieldBitOffset);
|
||||
|
||||
/* Compute the number of datums (access width data items) */
|
||||
|
||||
DatumCount = ACPI_ROUND_UP_TO (ObjDesc->CommonField.BitLength,
|
||||
ObjDesc->CommonField.AccessBitWidth);
|
||||
AccessBitWidth);
|
||||
|
||||
FieldDatumCount = ACPI_ROUND_UP_TO (ObjDesc->CommonField.BitLength +
|
||||
ObjDesc->CommonField.StartFieldBitOffset,
|
||||
ObjDesc->CommonField.AccessBitWidth);
|
||||
ObjDesc->CommonField.StartFieldBitOffset,
|
||||
AccessBitWidth);
|
||||
|
||||
/* Get initial Datum from the input buffer */
|
||||
|
||||
@@ -1024,12 +1000,11 @@ AcpiExInsertIntoField (
|
||||
* This avoids the differences in behavior between different compilers
|
||||
* concerning shift values larger than the target data width.
|
||||
*/
|
||||
if ((ObjDesc->CommonField.AccessBitWidth -
|
||||
ObjDesc->CommonField.StartFieldBitOffset) < ACPI_INTEGER_BIT_SIZE)
|
||||
if ((AccessBitWidth - ObjDesc->CommonField.StartFieldBitOffset) <
|
||||
ACPI_INTEGER_BIT_SIZE)
|
||||
{
|
||||
MergedDatum = RawDatum >>
|
||||
(ObjDesc->CommonField.AccessBitWidth -
|
||||
ObjDesc->CommonField.StartFieldBitOffset);
|
||||
(AccessBitWidth - ObjDesc->CommonField.StartFieldBitOffset);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -1048,15 +1023,15 @@ AcpiExInsertIntoField (
|
||||
BufferOffset += ObjDesc->CommonField.AccessByteWidth;
|
||||
ACPI_MEMCPY (&RawDatum, ((char *) Buffer) + BufferOffset,
|
||||
ACPI_MIN(ObjDesc->CommonField.AccessByteWidth,
|
||||
BufferLength - BufferOffset));
|
||||
BufferLength - BufferOffset));
|
||||
|
||||
MergedDatum |= RawDatum << ObjDesc->CommonField.StartFieldBitOffset;
|
||||
}
|
||||
|
||||
/* Mask off any extra bits in the last datum */
|
||||
|
||||
BufferTailBits = (ObjDesc->CommonField.BitLength +
|
||||
ObjDesc->CommonField.StartFieldBitOffset) %
|
||||
ObjDesc->CommonField.AccessBitWidth;
|
||||
ObjDesc->CommonField.StartFieldBitOffset) % AccessBitWidth;
|
||||
if (BufferTailBits)
|
||||
{
|
||||
Mask &= ACPI_MASK_BITS_ABOVE (BufferTailBits);
|
||||
@@ -1077,5 +1052,3 @@ Exit:
|
||||
}
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,121 +1,45 @@
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* Module Name: exmisc - ACPI AML (p-code) execution - specific opcodes
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
* 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.
|
||||
*
|
||||
* 2.1. This is your license from Intel Corp. under its intellectual property
|
||||
* rights. You may have additional license terms from the party that provided
|
||||
* you this software, covering your right to use that party's intellectual
|
||||
* property rights.
|
||||
* 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.
|
||||
*
|
||||
* 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
|
||||
* copy of the source code appearing in this file ("Covered Code") an
|
||||
* irrevocable, perpetual, worldwide license under Intel's copyrights in the
|
||||
* base code distributed originally by Intel ("Original Intel Code") to copy,
|
||||
* make derivatives, distribute, use and display any portion of the Covered
|
||||
* Code in any form, with the right to sublicense such rights; and
|
||||
*
|
||||
* 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
|
||||
* license (with the right to sublicense), under only those claims of Intel
|
||||
* patents that are infringed by the Original Intel Code, to make, use, sell,
|
||||
* offer to sell, and import the Covered Code and derivative works thereof
|
||||
* solely to the minimum extent necessary to exercise the above copyright
|
||||
* license, and in no event shall the patent license extend to any additions
|
||||
* to or modifications of the Original Intel Code. No other license or right
|
||||
* is granted directly or by implication, estoppel or otherwise;
|
||||
*
|
||||
* The above copyright and patent license is granted only if the following
|
||||
* conditions are met:
|
||||
*
|
||||
* 3. Conditions
|
||||
*
|
||||
* 3.1. Redistribution of Source with Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification with rights to further distribute source must include
|
||||
* the above Copyright Notice, the above License, this list of Conditions,
|
||||
* and the following Disclaimer and Export Compliance provision. In addition,
|
||||
* Licensee must cause all Covered Code to which Licensee contributes to
|
||||
* contain a file documenting the changes Licensee made to create that Covered
|
||||
* Code and the date of any change. Licensee must include in that file the
|
||||
* documentation of any changes made by any predecessor Licensee. Licensee
|
||||
* must include a prominent statement that the modification is derived,
|
||||
* directly or indirectly, from Original Intel Code.
|
||||
*
|
||||
* 3.2. Redistribution of Source with no Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification without rights to further distribute source must
|
||||
* include the following Disclaimer and Export Compliance provision in the
|
||||
* documentation and/or other materials provided with distribution. In
|
||||
* addition, Licensee may not authorize further sublicense of source of any
|
||||
* portion of the Covered Code, and must include terms to the effect that the
|
||||
* license from Licensee to its licensee is limited to the intellectual
|
||||
* property embodied in the software Licensee provides to its licensee, and
|
||||
* not to intellectual property embodied in modifications its licensee may
|
||||
* make.
|
||||
*
|
||||
* 3.3. Redistribution of Executable. Redistribution in executable form of any
|
||||
* substantial portion of the Covered Code or modification must reproduce the
|
||||
* above Copyright Notice, and the following Disclaimer and Export Compliance
|
||||
* provision in the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3.4. Intel retains all right, title, and interest in and to the Original
|
||||
* Intel Code.
|
||||
*
|
||||
* 3.5. Neither the name Intel nor any other trademark owned or controlled by
|
||||
* Intel shall be used in advertising or otherwise to promote the sale, use or
|
||||
* other dealings in products derived from or relating to the Covered Code
|
||||
* without prior written authorization from Intel.
|
||||
*
|
||||
* 4. Disclaimer and Export Compliance
|
||||
*
|
||||
* 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
|
||||
* HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
|
||||
* IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
|
||||
* INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
|
||||
|
||||
* UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
|
||||
* PARTICULAR PURPOSE.
|
||||
*
|
||||
* 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
|
||||
* OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
|
||||
* COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
|
||||
* SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
|
||||
* CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
|
||||
* HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
|
||||
* SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
|
||||
* LIMITED REMEDY.
|
||||
*
|
||||
* 4.3. Licensee shall not export, either directly or indirectly, any of this
|
||||
* software or system incorporating such software without first obtaining any
|
||||
* required license or other approval from the U. S. Department of Commerce or
|
||||
* any other agency or department of the United States Government. In the
|
||||
* event Licensee exports any such software from the United States or
|
||||
* re-exports any such software from a foreign destination, Licensee shall
|
||||
* ensure that the distribution and export/re-export of the software is in
|
||||
* compliance with all laws, regulations, orders, or other restrictions of the
|
||||
* U.S. Export Administration Regulations. Licensee agrees that neither it nor
|
||||
* any of its subsidiaries will export/re-export any technical data, process,
|
||||
* software, or service, directly or indirectly, to any country for which the
|
||||
* United States government or any agency thereof requires an export license,
|
||||
* other governmental approval, or letter of assurance, without first obtaining
|
||||
* such license, approval or letter.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
#define __EXMISC_C__
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#include "acpi.h"
|
||||
#include "accommon.h"
|
||||
@@ -189,16 +113,13 @@ AcpiExGetObjectReference (
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case ACPI_DESC_TYPE_NAMED:
|
||||
|
||||
/*
|
||||
* A named reference that has already been resolved to a Node
|
||||
*/
|
||||
ReferencedObj = ObjDesc;
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
|
||||
ACPI_ERROR ((AE_INFO, "Invalid descriptor type 0x%X",
|
||||
@@ -351,7 +272,7 @@ AcpiExDoConcatenate (
|
||||
|
||||
|
||||
/*
|
||||
* Convert the second operand if necessary. The first operand
|
||||
* Convert the second operand if necessary. The first operand
|
||||
* determines the type of the second operand, (See the Data Types
|
||||
* section of the ACPI specification.) Both object types are
|
||||
* guaranteed to be either Integer/String/Buffer by the operand
|
||||
@@ -360,19 +281,23 @@ AcpiExDoConcatenate (
|
||||
switch (Operand0->Common.Type)
|
||||
{
|
||||
case ACPI_TYPE_INTEGER:
|
||||
|
||||
Status = AcpiExConvertToInteger (Operand1, &LocalOperand1, 16);
|
||||
break;
|
||||
|
||||
case ACPI_TYPE_STRING:
|
||||
|
||||
Status = AcpiExConvertToString (Operand1, &LocalOperand1,
|
||||
ACPI_IMPLICIT_CONVERT_HEX);
|
||||
break;
|
||||
|
||||
case ACPI_TYPE_BUFFER:
|
||||
|
||||
Status = AcpiExConvertToBuffer (Operand1, &LocalOperand1);
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
ACPI_ERROR ((AE_INFO, "Invalid object type: 0x%X",
|
||||
Operand0->Common.Type));
|
||||
Status = AE_AML_INTERNAL;
|
||||
@@ -524,37 +449,30 @@ AcpiExDoMathOp (
|
||||
|
||||
return (Integer0 + Integer1);
|
||||
|
||||
|
||||
case AML_BIT_AND_OP: /* And (Integer0, Integer1, Result) */
|
||||
|
||||
return (Integer0 & Integer1);
|
||||
|
||||
|
||||
case AML_BIT_NAND_OP: /* NAnd (Integer0, Integer1, Result) */
|
||||
|
||||
return (~(Integer0 & Integer1));
|
||||
|
||||
|
||||
case AML_BIT_OR_OP: /* Or (Integer0, Integer1, Result) */
|
||||
|
||||
return (Integer0 | Integer1);
|
||||
|
||||
|
||||
case AML_BIT_NOR_OP: /* NOr (Integer0, Integer1, Result) */
|
||||
|
||||
return (~(Integer0 | Integer1));
|
||||
|
||||
|
||||
case AML_BIT_XOR_OP: /* XOr (Integer0, Integer1, Result) */
|
||||
|
||||
return (Integer0 ^ Integer1);
|
||||
|
||||
|
||||
case AML_MULTIPLY_OP: /* Multiply (Integer0, Integer1, Result) */
|
||||
|
||||
return (Integer0 * Integer1);
|
||||
|
||||
|
||||
case AML_SHIFT_LEFT_OP: /* ShiftLeft (Operand, ShiftCount, Result)*/
|
||||
|
||||
/*
|
||||
@@ -567,7 +485,6 @@ AcpiExDoMathOp (
|
||||
}
|
||||
return (Integer0 << Integer1);
|
||||
|
||||
|
||||
case AML_SHIFT_RIGHT_OP: /* ShiftRight (Operand, ShiftCount, Result) */
|
||||
|
||||
/*
|
||||
@@ -580,7 +497,6 @@ AcpiExDoMathOp (
|
||||
}
|
||||
return (Integer0 >> Integer1);
|
||||
|
||||
|
||||
case AML_SUBTRACT_OP: /* Subtract (Integer0, Integer1, Result) */
|
||||
|
||||
return (Integer0 - Integer1);
|
||||
@@ -645,6 +561,7 @@ AcpiExDoLogicalNumericOp (
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
Status = AE_AML_INTERNAL;
|
||||
break;
|
||||
}
|
||||
@@ -703,7 +620,7 @@ AcpiExDoLogicalOp (
|
||||
|
||||
|
||||
/*
|
||||
* Convert the second operand if necessary. The first operand
|
||||
* Convert the second operand if necessary. The first operand
|
||||
* determines the type of the second operand, (See the Data Types
|
||||
* section of the ACPI 3.0+ specification.) Both object types are
|
||||
* guaranteed to be either Integer/String/Buffer by the operand
|
||||
@@ -712,19 +629,23 @@ AcpiExDoLogicalOp (
|
||||
switch (Operand0->Common.Type)
|
||||
{
|
||||
case ACPI_TYPE_INTEGER:
|
||||
|
||||
Status = AcpiExConvertToInteger (Operand1, &LocalOperand1, 16);
|
||||
break;
|
||||
|
||||
case ACPI_TYPE_STRING:
|
||||
|
||||
Status = AcpiExConvertToString (Operand1, &LocalOperand1,
|
||||
ACPI_IMPLICIT_CONVERT_HEX);
|
||||
break;
|
||||
|
||||
case ACPI_TYPE_BUFFER:
|
||||
|
||||
Status = AcpiExConvertToBuffer (Operand1, &LocalOperand1);
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
Status = AE_AML_INTERNAL;
|
||||
break;
|
||||
}
|
||||
@@ -773,6 +694,7 @@ AcpiExDoLogicalOp (
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
Status = AE_AML_INTERNAL;
|
||||
break;
|
||||
}
|
||||
@@ -850,6 +772,7 @@ AcpiExDoLogicalOp (
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
Status = AE_AML_INTERNAL;
|
||||
break;
|
||||
}
|
||||
@@ -869,5 +792,3 @@ Cleanup:
|
||||
*LogicalResult = LocalResult;
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,120 +1,45 @@
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* Module Name: exmutex - ASL Mutex Acquire/Release functions
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
* 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.
|
||||
*
|
||||
* 2.1. This is your license from Intel Corp. under its intellectual property
|
||||
* rights. You may have additional license terms from the party that provided
|
||||
* you this software, covering your right to use that party's intellectual
|
||||
* property rights.
|
||||
* 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.
|
||||
*
|
||||
* 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
|
||||
* copy of the source code appearing in this file ("Covered Code") an
|
||||
* irrevocable, perpetual, worldwide license under Intel's copyrights in the
|
||||
* base code distributed originally by Intel ("Original Intel Code") to copy,
|
||||
* make derivatives, distribute, use and display any portion of the Covered
|
||||
* Code in any form, with the right to sublicense such rights; and
|
||||
*
|
||||
* 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
|
||||
* license (with the right to sublicense), under only those claims of Intel
|
||||
* patents that are infringed by the Original Intel Code, to make, use, sell,
|
||||
* offer to sell, and import the Covered Code and derivative works thereof
|
||||
* solely to the minimum extent necessary to exercise the above copyright
|
||||
* license, and in no event shall the patent license extend to any additions
|
||||
* to or modifications of the Original Intel Code. No other license or right
|
||||
* is granted directly or by implication, estoppel or otherwise;
|
||||
*
|
||||
* The above copyright and patent license is granted only if the following
|
||||
* conditions are met:
|
||||
*
|
||||
* 3. Conditions
|
||||
*
|
||||
* 3.1. Redistribution of Source with Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification with rights to further distribute source must include
|
||||
* the above Copyright Notice, the above License, this list of Conditions,
|
||||
* and the following Disclaimer and Export Compliance provision. In addition,
|
||||
* Licensee must cause all Covered Code to which Licensee contributes to
|
||||
* contain a file documenting the changes Licensee made to create that Covered
|
||||
* Code and the date of any change. Licensee must include in that file the
|
||||
* documentation of any changes made by any predecessor Licensee. Licensee
|
||||
* must include a prominent statement that the modification is derived,
|
||||
* directly or indirectly, from Original Intel Code.
|
||||
*
|
||||
* 3.2. Redistribution of Source with no Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification without rights to further distribute source must
|
||||
* include the following Disclaimer and Export Compliance provision in the
|
||||
* documentation and/or other materials provided with distribution. In
|
||||
* addition, Licensee may not authorize further sublicense of source of any
|
||||
* portion of the Covered Code, and must include terms to the effect that the
|
||||
* license from Licensee to its licensee is limited to the intellectual
|
||||
* property embodied in the software Licensee provides to its licensee, and
|
||||
* not to intellectual property embodied in modifications its licensee may
|
||||
* make.
|
||||
*
|
||||
* 3.3. Redistribution of Executable. Redistribution in executable form of any
|
||||
* substantial portion of the Covered Code or modification must reproduce the
|
||||
* above Copyright Notice, and the following Disclaimer and Export Compliance
|
||||
* provision in the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3.4. Intel retains all right, title, and interest in and to the Original
|
||||
* Intel Code.
|
||||
*
|
||||
* 3.5. Neither the name Intel nor any other trademark owned or controlled by
|
||||
* Intel shall be used in advertising or otherwise to promote the sale, use or
|
||||
* other dealings in products derived from or relating to the Covered Code
|
||||
* without prior written authorization from Intel.
|
||||
*
|
||||
* 4. Disclaimer and Export Compliance
|
||||
*
|
||||
* 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
|
||||
* HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
|
||||
* IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
|
||||
* INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
|
||||
* UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
|
||||
* PARTICULAR PURPOSE.
|
||||
*
|
||||
* 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
|
||||
* OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
|
||||
* COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
|
||||
* SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
|
||||
* CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
|
||||
* HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
|
||||
* SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
|
||||
* LIMITED REMEDY.
|
||||
*
|
||||
* 4.3. Licensee shall not export, either directly or indirectly, any of this
|
||||
* software or system incorporating such software without first obtaining any
|
||||
* required license or other approval from the U. S. Department of Commerce or
|
||||
* any other agency or department of the United States Government. In the
|
||||
* event Licensee exports any such software from the United States or
|
||||
* re-exports any such software from a foreign destination, Licensee shall
|
||||
* ensure that the distribution and export/re-export of the software is in
|
||||
* compliance with all laws, regulations, orders, or other restrictions of the
|
||||
* U.S. Export Administration Regulations. Licensee agrees that neither it nor
|
||||
* any of its subsidiaries will export/re-export any technical data, process,
|
||||
* software, or service, directly or indirectly, to any country for which the
|
||||
* United States government or any agency thereof requires an export license,
|
||||
* other governmental approval, or letter of assurance, without first obtaining
|
||||
* such license, approval or letter.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
#define __EXMUTEX_C__
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#include "acpi.h"
|
||||
#include "accommon.h"
|
||||
@@ -413,7 +338,7 @@ AcpiExReleaseMutexObject (
|
||||
|
||||
if (ObjDesc->Mutex.AcquisitionDepth == 0)
|
||||
{
|
||||
return (AE_NOT_ACQUIRED);
|
||||
return_ACPI_STATUS (AE_NOT_ACQUIRED);
|
||||
}
|
||||
|
||||
/* Match multiple Acquires with multiple Releases */
|
||||
@@ -513,10 +438,10 @@ AcpiExReleaseMutex (
|
||||
(ObjDesc != AcpiGbl_GlobalLockMutex))
|
||||
{
|
||||
ACPI_ERROR ((AE_INFO,
|
||||
"Thread %p cannot release Mutex [%4.4s] acquired by thread %p",
|
||||
ACPI_CAST_PTR (void, WalkState->Thread->ThreadId),
|
||||
"Thread %u cannot release Mutex [%4.4s] acquired by thread %u",
|
||||
(UINT32) WalkState->Thread->ThreadId,
|
||||
AcpiUtGetNodeName (ObjDesc->Mutex.Node),
|
||||
ACPI_CAST_PTR (void, OwnerThread->ThreadId)));
|
||||
(UINT32) OwnerThread->ThreadId));
|
||||
return_ACPI_STATUS (AE_AML_NOT_OWNER);
|
||||
}
|
||||
|
||||
@@ -587,7 +512,7 @@ AcpiExReleaseAllMutexes (
|
||||
ACPI_OPERAND_OBJECT *ObjDesc;
|
||||
|
||||
|
||||
ACPI_FUNCTION_ENTRY ();
|
||||
ACPI_FUNCTION_NAME (ExReleaseAllMutexes);
|
||||
|
||||
|
||||
/* Traverse the list of owned mutexes, releasing each one */
|
||||
@@ -601,6 +526,9 @@ AcpiExReleaseAllMutexes (
|
||||
ObjDesc->Mutex.Next = NULL;
|
||||
ObjDesc->Mutex.AcquisitionDepth = 0;
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
|
||||
"Force-releasing held mutex: %p\n", ObjDesc));
|
||||
|
||||
/* Release the mutex, special case for Global Lock */
|
||||
|
||||
if (ObjDesc == AcpiGbl_GlobalLockMutex)
|
||||
|
||||
@@ -1,120 +1,45 @@
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* Module Name: exnames - interpreter/scanner name load/execute
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
* 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.
|
||||
*
|
||||
* 2.1. This is your license from Intel Corp. under its intellectual property
|
||||
* rights. You may have additional license terms from the party that provided
|
||||
* you this software, covering your right to use that party's intellectual
|
||||
* property rights.
|
||||
* 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.
|
||||
*
|
||||
* 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
|
||||
* copy of the source code appearing in this file ("Covered Code") an
|
||||
* irrevocable, perpetual, worldwide license under Intel's copyrights in the
|
||||
* base code distributed originally by Intel ("Original Intel Code") to copy,
|
||||
* make derivatives, distribute, use and display any portion of the Covered
|
||||
* Code in any form, with the right to sublicense such rights; and
|
||||
*
|
||||
* 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
|
||||
* license (with the right to sublicense), under only those claims of Intel
|
||||
* patents that are infringed by the Original Intel Code, to make, use, sell,
|
||||
* offer to sell, and import the Covered Code and derivative works thereof
|
||||
* solely to the minimum extent necessary to exercise the above copyright
|
||||
* license, and in no event shall the patent license extend to any additions
|
||||
* to or modifications of the Original Intel Code. No other license or right
|
||||
* is granted directly or by implication, estoppel or otherwise;
|
||||
*
|
||||
* The above copyright and patent license is granted only if the following
|
||||
* conditions are met:
|
||||
*
|
||||
* 3. Conditions
|
||||
*
|
||||
* 3.1. Redistribution of Source with Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification with rights to further distribute source must include
|
||||
* the above Copyright Notice, the above License, this list of Conditions,
|
||||
* and the following Disclaimer and Export Compliance provision. In addition,
|
||||
* Licensee must cause all Covered Code to which Licensee contributes to
|
||||
* contain a file documenting the changes Licensee made to create that Covered
|
||||
* Code and the date of any change. Licensee must include in that file the
|
||||
* documentation of any changes made by any predecessor Licensee. Licensee
|
||||
* must include a prominent statement that the modification is derived,
|
||||
* directly or indirectly, from Original Intel Code.
|
||||
*
|
||||
* 3.2. Redistribution of Source with no Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification without rights to further distribute source must
|
||||
* include the following Disclaimer and Export Compliance provision in the
|
||||
* documentation and/or other materials provided with distribution. In
|
||||
* addition, Licensee may not authorize further sublicense of source of any
|
||||
* portion of the Covered Code, and must include terms to the effect that the
|
||||
* license from Licensee to its licensee is limited to the intellectual
|
||||
* property embodied in the software Licensee provides to its licensee, and
|
||||
* not to intellectual property embodied in modifications its licensee may
|
||||
* make.
|
||||
*
|
||||
* 3.3. Redistribution of Executable. Redistribution in executable form of any
|
||||
* substantial portion of the Covered Code or modification must reproduce the
|
||||
* above Copyright Notice, and the following Disclaimer and Export Compliance
|
||||
* provision in the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3.4. Intel retains all right, title, and interest in and to the Original
|
||||
* Intel Code.
|
||||
*
|
||||
* 3.5. Neither the name Intel nor any other trademark owned or controlled by
|
||||
* Intel shall be used in advertising or otherwise to promote the sale, use or
|
||||
* other dealings in products derived from or relating to the Covered Code
|
||||
* without prior written authorization from Intel.
|
||||
*
|
||||
* 4. Disclaimer and Export Compliance
|
||||
*
|
||||
* 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
|
||||
* HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
|
||||
* IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
|
||||
* INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
|
||||
* UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
|
||||
* PARTICULAR PURPOSE.
|
||||
*
|
||||
* 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
|
||||
* OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
|
||||
* COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
|
||||
* SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
|
||||
* CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
|
||||
* HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
|
||||
* SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
|
||||
* LIMITED REMEDY.
|
||||
*
|
||||
* 4.3. Licensee shall not export, either directly or indirectly, any of this
|
||||
* software or system incorporating such software without first obtaining any
|
||||
* required license or other approval from the U. S. Department of Commerce or
|
||||
* any other agency or department of the United States Government. In the
|
||||
* event Licensee exports any such software from the United States or
|
||||
* re-exports any such software from a foreign destination, Licensee shall
|
||||
* ensure that the distribution and export/re-export of the software is in
|
||||
* compliance with all laws, regulations, orders, or other restrictions of the
|
||||
* U.S. Export Administration Regulations. Licensee agrees that neither it nor
|
||||
* any of its subsidiaries will export/re-export any technical data, process,
|
||||
* software, or service, directly or indirectly, to any country for which the
|
||||
* United States government or any agency thereof requires an export license,
|
||||
* other governmental approval, or letter of assurance, without first obtaining
|
||||
* such license, approval or letter.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
#define __EXNAMES_C__
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#include "acpi.h"
|
||||
#include "accommon.h"
|
||||
@@ -145,7 +70,7 @@ AcpiExNameSegment (
|
||||
* (-1)==root, 0==none
|
||||
* NumNameSegs - count of 4-character name segments
|
||||
*
|
||||
* RETURN: A pointer to the allocated string segment. This segment must
|
||||
* RETURN: A pointer to the allocated string segment. This segment must
|
||||
* be deleted by the caller.
|
||||
*
|
||||
* DESCRIPTION: Allocate a buffer for a name string. Ensure allocated name
|
||||
@@ -407,7 +332,6 @@ AcpiExGetNameString (
|
||||
HasPrefix = TRUE;
|
||||
break;
|
||||
|
||||
|
||||
case AML_PARENT_PREFIX:
|
||||
|
||||
/* Increment past possibly multiple parent prefixes */
|
||||
@@ -425,7 +349,6 @@ AcpiExGetNameString (
|
||||
HasPrefix = TRUE;
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
|
||||
/* Not a prefix character */
|
||||
@@ -461,7 +384,6 @@ AcpiExGetNameString (
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case AML_MULTI_NAME_PREFIX_OP:
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_LOAD, "MultiNamePrefix at %p\n",
|
||||
@@ -493,7 +415,6 @@ AcpiExGetNameString (
|
||||
|
||||
break;
|
||||
|
||||
|
||||
case 0:
|
||||
|
||||
/* NullName valid as of 8-12-98 ASL/AML Grammar Update */
|
||||
@@ -516,7 +437,6 @@ AcpiExGetNameString (
|
||||
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
|
||||
/* Name segment string */
|
||||
@@ -556,5 +476,3 @@ AcpiExGetNameString (
|
||||
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,120 +1,45 @@
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* Module Name: exoparg1 - AML execution - opcodes with 1 argument
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
* 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.
|
||||
*
|
||||
* 2.1. This is your license from Intel Corp. under its intellectual property
|
||||
* rights. You may have additional license terms from the party that provided
|
||||
* you this software, covering your right to use that party's intellectual
|
||||
* property rights.
|
||||
* 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.
|
||||
*
|
||||
* 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
|
||||
* copy of the source code appearing in this file ("Covered Code") an
|
||||
* irrevocable, perpetual, worldwide license under Intel's copyrights in the
|
||||
* base code distributed originally by Intel ("Original Intel Code") to copy,
|
||||
* make derivatives, distribute, use and display any portion of the Covered
|
||||
* Code in any form, with the right to sublicense such rights; and
|
||||
*
|
||||
* 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
|
||||
* license (with the right to sublicense), under only those claims of Intel
|
||||
* patents that are infringed by the Original Intel Code, to make, use, sell,
|
||||
* offer to sell, and import the Covered Code and derivative works thereof
|
||||
* solely to the minimum extent necessary to exercise the above copyright
|
||||
* license, and in no event shall the patent license extend to any additions
|
||||
* to or modifications of the Original Intel Code. No other license or right
|
||||
* is granted directly or by implication, estoppel or otherwise;
|
||||
*
|
||||
* The above copyright and patent license is granted only if the following
|
||||
* conditions are met:
|
||||
*
|
||||
* 3. Conditions
|
||||
*
|
||||
* 3.1. Redistribution of Source with Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification with rights to further distribute source must include
|
||||
* the above Copyright Notice, the above License, this list of Conditions,
|
||||
* and the following Disclaimer and Export Compliance provision. In addition,
|
||||
* Licensee must cause all Covered Code to which Licensee contributes to
|
||||
* contain a file documenting the changes Licensee made to create that Covered
|
||||
* Code and the date of any change. Licensee must include in that file the
|
||||
* documentation of any changes made by any predecessor Licensee. Licensee
|
||||
* must include a prominent statement that the modification is derived,
|
||||
* directly or indirectly, from Original Intel Code.
|
||||
*
|
||||
* 3.2. Redistribution of Source with no Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification without rights to further distribute source must
|
||||
* include the following Disclaimer and Export Compliance provision in the
|
||||
* documentation and/or other materials provided with distribution. In
|
||||
* addition, Licensee may not authorize further sublicense of source of any
|
||||
* portion of the Covered Code, and must include terms to the effect that the
|
||||
* license from Licensee to its licensee is limited to the intellectual
|
||||
* property embodied in the software Licensee provides to its licensee, and
|
||||
* not to intellectual property embodied in modifications its licensee may
|
||||
* make.
|
||||
*
|
||||
* 3.3. Redistribution of Executable. Redistribution in executable form of any
|
||||
* substantial portion of the Covered Code or modification must reproduce the
|
||||
* above Copyright Notice, and the following Disclaimer and Export Compliance
|
||||
* provision in the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3.4. Intel retains all right, title, and interest in and to the Original
|
||||
* Intel Code.
|
||||
*
|
||||
* 3.5. Neither the name Intel nor any other trademark owned or controlled by
|
||||
* Intel shall be used in advertising or otherwise to promote the sale, use or
|
||||
* other dealings in products derived from or relating to the Covered Code
|
||||
* without prior written authorization from Intel.
|
||||
*
|
||||
* 4. Disclaimer and Export Compliance
|
||||
*
|
||||
* 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
|
||||
* HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
|
||||
* IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
|
||||
* INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
|
||||
* UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
|
||||
* PARTICULAR PURPOSE.
|
||||
*
|
||||
* 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
|
||||
* OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
|
||||
* COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
|
||||
* SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
|
||||
* CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
|
||||
* HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
|
||||
* SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
|
||||
* LIMITED REMEDY.
|
||||
*
|
||||
* 4.3. Licensee shall not export, either directly or indirectly, any of this
|
||||
* software or system incorporating such software without first obtaining any
|
||||
* required license or other approval from the U. S. Department of Commerce or
|
||||
* any other agency or department of the United States Government. In the
|
||||
* event Licensee exports any such software from the United States or
|
||||
* re-exports any such software from a foreign destination, Licensee shall
|
||||
* ensure that the distribution and export/re-export of the software is in
|
||||
* compliance with all laws, regulations, orders, or other restrictions of the
|
||||
* U.S. Export Administration Regulations. Licensee agrees that neither it nor
|
||||
* any of its subsidiaries will export/re-export any technical data, process,
|
||||
* software, or service, directly or indirectly, to any country for which the
|
||||
* United States government or any agency thereof requires an export license,
|
||||
* other governmental approval, or letter of assurance, without first obtaining
|
||||
* such license, approval or letter.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
#define __EXOPARG1_C__
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#include "acpi.h"
|
||||
#include "accommon.h"
|
||||
@@ -253,37 +178,31 @@ AcpiExOpcode_1A_0T_0R (
|
||||
Status = AcpiExReleaseMutex (Operand[0], WalkState);
|
||||
break;
|
||||
|
||||
|
||||
case AML_RESET_OP: /* Reset (EventObject) */
|
||||
|
||||
Status = AcpiExSystemResetEvent (Operand[0]);
|
||||
break;
|
||||
|
||||
|
||||
case AML_SIGNAL_OP: /* Signal (EventObject) */
|
||||
|
||||
Status = AcpiExSystemSignalEvent (Operand[0]);
|
||||
break;
|
||||
|
||||
|
||||
case AML_SLEEP_OP: /* Sleep (MsecTime) */
|
||||
|
||||
Status = AcpiExSystemDoSleep (Operand[0]->Integer.Value);
|
||||
break;
|
||||
|
||||
|
||||
case AML_STALL_OP: /* Stall (UsecTime) */
|
||||
|
||||
Status = AcpiExSystemDoStall ((UINT32) Operand[0]->Integer.Value);
|
||||
break;
|
||||
|
||||
|
||||
case AML_UNLOAD_OP: /* Unload (Handle) */
|
||||
|
||||
Status = AcpiExUnloadTable (Operand[0]);
|
||||
break;
|
||||
|
||||
|
||||
default: /* Unknown opcode */
|
||||
|
||||
ACPI_ERROR ((AE_INFO, "Unknown AML opcode 0x%X",
|
||||
@@ -403,7 +322,6 @@ AcpiExOpcode_1A_1T_1R (
|
||||
ReturnDesc->Integer.Value = ~Operand[0]->Integer.Value;
|
||||
break;
|
||||
|
||||
|
||||
case AML_FIND_SET_LEFT_BIT_OP: /* FindSetLeftBit (Operand, Result) */
|
||||
|
||||
ReturnDesc->Integer.Value = Operand[0]->Integer.Value;
|
||||
@@ -421,7 +339,6 @@ AcpiExOpcode_1A_1T_1R (
|
||||
ReturnDesc->Integer.Value = Temp32;
|
||||
break;
|
||||
|
||||
|
||||
case AML_FIND_SET_RIGHT_BIT_OP: /* FindSetRightBit (Operand, Result) */
|
||||
|
||||
ReturnDesc->Integer.Value = Operand[0]->Integer.Value;
|
||||
@@ -442,9 +359,7 @@ AcpiExOpcode_1A_1T_1R (
|
||||
Temp32 == 0 ? 0 : (ACPI_INTEGER_BIT_SIZE + 1) - Temp32;
|
||||
break;
|
||||
|
||||
|
||||
case AML_FROM_BCD_OP: /* FromBcd (BCDValue, Result) */
|
||||
|
||||
/*
|
||||
* The 64-bit ACPI integer can hold 16 4-bit BCD characters
|
||||
* (if table is 32-bit, integer can hold 8 BCD characters)
|
||||
@@ -489,7 +404,6 @@ AcpiExOpcode_1A_1T_1R (
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case AML_TO_BCD_OP: /* ToBcd (Operand, Result) */
|
||||
|
||||
ReturnDesc->Integer.Value = 0;
|
||||
@@ -521,9 +435,7 @@ AcpiExOpcode_1A_1T_1R (
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case AML_COND_REF_OF_OP: /* CondRefOf (SourceObject, Result) */
|
||||
|
||||
/*
|
||||
* This op is a little strange because the internal return value is
|
||||
* different than the return value stored in the result descriptor
|
||||
@@ -558,14 +470,14 @@ AcpiExOpcode_1A_1T_1R (
|
||||
|
||||
|
||||
default:
|
||||
|
||||
/* No other opcodes get here */
|
||||
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case AML_STORE_OP: /* Store (Source, Target) */
|
||||
|
||||
/*
|
||||
* A store operand is typically a number, string, buffer or lvalue
|
||||
* Be careful about deleting the source object,
|
||||
@@ -592,7 +504,6 @@ AcpiExOpcode_1A_1T_1R (
|
||||
}
|
||||
return_ACPI_STATUS (Status);
|
||||
|
||||
|
||||
/*
|
||||
* ACPI 2.0 Opcodes
|
||||
*/
|
||||
@@ -602,7 +513,6 @@ AcpiExOpcode_1A_1T_1R (
|
||||
WalkState);
|
||||
break;
|
||||
|
||||
|
||||
case AML_TO_DECSTRING_OP: /* ToDecimalString (Data, Result) */
|
||||
|
||||
Status = AcpiExConvertToString (Operand[0], &ReturnDesc,
|
||||
@@ -614,7 +524,6 @@ AcpiExOpcode_1A_1T_1R (
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case AML_TO_HEXSTRING_OP: /* ToHexString (Data, Result) */
|
||||
|
||||
Status = AcpiExConvertToString (Operand[0], &ReturnDesc,
|
||||
@@ -626,7 +535,6 @@ AcpiExOpcode_1A_1T_1R (
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case AML_TO_BUFFER_OP: /* ToBuffer (Data, Result) */
|
||||
|
||||
Status = AcpiExConvertToBuffer (Operand[0], &ReturnDesc);
|
||||
@@ -637,7 +545,6 @@ AcpiExOpcode_1A_1T_1R (
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case AML_TO_INTEGER_OP: /* ToInteger (Data, Result) */
|
||||
|
||||
Status = AcpiExConvertToInteger (Operand[0], &ReturnDesc,
|
||||
@@ -649,7 +556,6 @@ AcpiExOpcode_1A_1T_1R (
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case AML_SHIFT_LEFT_BIT_OP: /* ShiftLeftBit (Source, BitNum) */
|
||||
case AML_SHIFT_RIGHT_BIT_OP: /* ShiftRightBit (Source, BitNum) */
|
||||
|
||||
@@ -661,7 +567,6 @@ AcpiExOpcode_1A_1T_1R (
|
||||
Status = AE_SUPPORT;
|
||||
goto Cleanup;
|
||||
|
||||
|
||||
default: /* Unknown opcode */
|
||||
|
||||
ACPI_ERROR ((AE_INFO, "Unknown AML opcode 0x%X",
|
||||
@@ -740,7 +645,7 @@ AcpiExOpcode_1A_0T_1R (
|
||||
}
|
||||
|
||||
/*
|
||||
* Set result to ONES (TRUE) if Value == 0. Note:
|
||||
* Set result to ONES (TRUE) if Value == 0. Note:
|
||||
* ReturnDesc->Integer.Value is initially == 0 (FALSE) from above.
|
||||
*/
|
||||
if (!Operand[0]->Integer.Value)
|
||||
@@ -749,12 +654,10 @@ AcpiExOpcode_1A_0T_1R (
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case AML_DECREMENT_OP: /* Decrement (Operand) */
|
||||
case AML_INCREMENT_OP: /* Increment (Operand) */
|
||||
|
||||
/*
|
||||
* Create a new integer. Can't just get the base integer and
|
||||
* Create a new integer. Can't just get the base integer and
|
||||
* increment it because it may be an Arg or Field.
|
||||
*/
|
||||
ReturnDesc = AcpiUtCreateInternalObject (ACPI_TYPE_INTEGER);
|
||||
@@ -817,12 +720,10 @@ AcpiExOpcode_1A_0T_1R (
|
||||
Status = AcpiExStore (ReturnDesc, Operand[0], WalkState);
|
||||
break;
|
||||
|
||||
|
||||
case AML_TYPE_OP: /* ObjectType (SourceObject) */
|
||||
|
||||
/*
|
||||
* Note: The operand is not resolved at this point because we want to
|
||||
* get the associated object, not its value. For example, we don't
|
||||
* get the associated object, not its value. For example, we don't
|
||||
* want to resolve a FieldUnit to its value, we want the actual
|
||||
* FieldUnit object.
|
||||
*/
|
||||
@@ -845,9 +746,7 @@ AcpiExOpcode_1A_0T_1R (
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case AML_SIZE_OF_OP: /* SizeOf (SourceObject) */
|
||||
|
||||
/*
|
||||
* Note: The operand is not resolved at this point because we want to
|
||||
* get the associated object, not its value.
|
||||
@@ -864,7 +763,7 @@ AcpiExOpcode_1A_0T_1R (
|
||||
|
||||
/*
|
||||
* The type of the base object must be integer, buffer, string, or
|
||||
* package. All others are not supported.
|
||||
* package. All others are not supported.
|
||||
*
|
||||
* NOTE: Integer is not specifically supported by the ACPI spec,
|
||||
* but is supported implicitly via implicit operand conversion.
|
||||
@@ -874,10 +773,12 @@ AcpiExOpcode_1A_0T_1R (
|
||||
switch (Type)
|
||||
{
|
||||
case ACPI_TYPE_INTEGER:
|
||||
|
||||
Value = AcpiGbl_IntegerByteWidth;
|
||||
break;
|
||||
|
||||
case ACPI_TYPE_STRING:
|
||||
|
||||
Value = TempDesc->String.Length;
|
||||
break;
|
||||
|
||||
@@ -898,6 +799,7 @@ AcpiExOpcode_1A_0T_1R (
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
ACPI_ERROR ((AE_INFO,
|
||||
"Operand must be Buffer/Integer/String/Package - found type %s",
|
||||
AcpiUtGetTypeName (Type)));
|
||||
@@ -1005,9 +907,11 @@ AcpiExOpcode_1A_0T_1R (
|
||||
break;
|
||||
|
||||
case ACPI_TYPE_STRING:
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
Status = AE_AML_OPERAND_TYPE;
|
||||
goto Cleanup;
|
||||
}
|
||||
@@ -1066,7 +970,6 @@ AcpiExOpcode_1A_0T_1R (
|
||||
switch (Operand[0]->Reference.Class)
|
||||
{
|
||||
case ACPI_REFCLASS_INDEX:
|
||||
|
||||
/*
|
||||
* The target type for the Index operator must be
|
||||
* either a Buffer or a Package
|
||||
@@ -1098,20 +1001,24 @@ AcpiExOpcode_1A_0T_1R (
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case ACPI_TYPE_PACKAGE:
|
||||
|
||||
/*
|
||||
* Return the referenced element of the package. We must
|
||||
* Return the referenced element of the package. We must
|
||||
* add another reference to the referenced object, however.
|
||||
*/
|
||||
ReturnDesc = *(Operand[0]->Reference.Where);
|
||||
if (ReturnDesc)
|
||||
if (!ReturnDesc)
|
||||
{
|
||||
AcpiUtAddReference (ReturnDesc);
|
||||
/*
|
||||
* Element is NULL, do not allow the dereference.
|
||||
* This provides compatibility with other ACPI
|
||||
* implementations.
|
||||
*/
|
||||
return_ACPI_STATUS (AE_AML_UNINITIALIZED_ELEMENT);
|
||||
}
|
||||
break;
|
||||
|
||||
AcpiUtAddReference (ReturnDesc);
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
@@ -1123,25 +1030,53 @@ AcpiExOpcode_1A_0T_1R (
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case ACPI_REFCLASS_REFOF:
|
||||
|
||||
ReturnDesc = Operand[0]->Reference.Object;
|
||||
|
||||
if (ACPI_GET_DESCRIPTOR_TYPE (ReturnDesc) ==
|
||||
ACPI_DESC_TYPE_NAMED)
|
||||
ACPI_DESC_TYPE_NAMED)
|
||||
{
|
||||
ReturnDesc = AcpiNsGetAttachedObject (
|
||||
(ACPI_NAMESPACE_NODE *) ReturnDesc);
|
||||
(ACPI_NAMESPACE_NODE *) ReturnDesc);
|
||||
if (!ReturnDesc)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
/*
|
||||
* June 2013:
|
||||
* BufferFields/FieldUnits require additional resolution
|
||||
*/
|
||||
switch (ReturnDesc->Common.Type)
|
||||
{
|
||||
case ACPI_TYPE_BUFFER_FIELD:
|
||||
case ACPI_TYPE_LOCAL_REGION_FIELD:
|
||||
case ACPI_TYPE_LOCAL_BANK_FIELD:
|
||||
case ACPI_TYPE_LOCAL_INDEX_FIELD:
|
||||
|
||||
Status = AcpiExReadDataFromField (WalkState,
|
||||
ReturnDesc, &TempDesc);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
goto Cleanup;
|
||||
}
|
||||
|
||||
ReturnDesc = TempDesc;
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
/* Add another reference to the object */
|
||||
|
||||
AcpiUtAddReference (ReturnDesc);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/* Add another reference to the object! */
|
||||
|
||||
AcpiUtAddReference (ReturnDesc);
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
|
||||
ACPI_ERROR ((AE_INFO,
|
||||
"Unknown class in reference(%p) - 0x%2.2X",
|
||||
Operand[0], Operand[0]->Reference.Class));
|
||||
@@ -1152,7 +1087,6 @@ AcpiExOpcode_1A_0T_1R (
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
|
||||
ACPI_ERROR ((AE_INFO, "Unknown AML opcode 0x%X",
|
||||
@@ -1180,4 +1114,3 @@ Cleanup:
|
||||
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
|
||||
@@ -4,117 +4,42 @@
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
* 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.
|
||||
*
|
||||
* 2.1. This is your license from Intel Corp. under its intellectual property
|
||||
* rights. You may have additional license terms from the party that provided
|
||||
* you this software, covering your right to use that party's intellectual
|
||||
* property rights.
|
||||
* 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.
|
||||
*
|
||||
* 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
|
||||
* copy of the source code appearing in this file ("Covered Code") an
|
||||
* irrevocable, perpetual, worldwide license under Intel's copyrights in the
|
||||
* base code distributed originally by Intel ("Original Intel Code") to copy,
|
||||
* make derivatives, distribute, use and display any portion of the Covered
|
||||
* Code in any form, with the right to sublicense such rights; and
|
||||
*
|
||||
* 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
|
||||
* license (with the right to sublicense), under only those claims of Intel
|
||||
* patents that are infringed by the Original Intel Code, to make, use, sell,
|
||||
* offer to sell, and import the Covered Code and derivative works thereof
|
||||
* solely to the minimum extent necessary to exercise the above copyright
|
||||
* license, and in no event shall the patent license extend to any additions
|
||||
* to or modifications of the Original Intel Code. No other license or right
|
||||
* is granted directly or by implication, estoppel or otherwise;
|
||||
*
|
||||
* The above copyright and patent license is granted only if the following
|
||||
* conditions are met:
|
||||
*
|
||||
* 3. Conditions
|
||||
*
|
||||
* 3.1. Redistribution of Source with Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification with rights to further distribute source must include
|
||||
* the above Copyright Notice, the above License, this list of Conditions,
|
||||
* and the following Disclaimer and Export Compliance provision. In addition,
|
||||
* Licensee must cause all Covered Code to which Licensee contributes to
|
||||
* contain a file documenting the changes Licensee made to create that Covered
|
||||
* Code and the date of any change. Licensee must include in that file the
|
||||
* documentation of any changes made by any predecessor Licensee. Licensee
|
||||
* must include a prominent statement that the modification is derived,
|
||||
* directly or indirectly, from Original Intel Code.
|
||||
*
|
||||
* 3.2. Redistribution of Source with no Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification without rights to further distribute source must
|
||||
* include the following Disclaimer and Export Compliance provision in the
|
||||
* documentation and/or other materials provided with distribution. In
|
||||
* addition, Licensee may not authorize further sublicense of source of any
|
||||
* portion of the Covered Code, and must include terms to the effect that the
|
||||
* license from Licensee to its licensee is limited to the intellectual
|
||||
* property embodied in the software Licensee provides to its licensee, and
|
||||
* not to intellectual property embodied in modifications its licensee may
|
||||
* make.
|
||||
*
|
||||
* 3.3. Redistribution of Executable. Redistribution in executable form of any
|
||||
* substantial portion of the Covered Code or modification must reproduce the
|
||||
* above Copyright Notice, and the following Disclaimer and Export Compliance
|
||||
* provision in the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3.4. Intel retains all right, title, and interest in and to the Original
|
||||
* Intel Code.
|
||||
*
|
||||
* 3.5. Neither the name Intel nor any other trademark owned or controlled by
|
||||
* Intel shall be used in advertising or otherwise to promote the sale, use or
|
||||
* other dealings in products derived from or relating to the Covered Code
|
||||
* without prior written authorization from Intel.
|
||||
*
|
||||
* 4. Disclaimer and Export Compliance
|
||||
*
|
||||
* 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
|
||||
* HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
|
||||
* IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
|
||||
* INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
|
||||
* UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
|
||||
* PARTICULAR PURPOSE.
|
||||
*
|
||||
* 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
|
||||
* OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
|
||||
* COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
|
||||
* SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
|
||||
* CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
|
||||
* HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
|
||||
* SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
|
||||
* LIMITED REMEDY.
|
||||
*
|
||||
* 4.3. Licensee shall not export, either directly or indirectly, any of this
|
||||
* software or system incorporating such software without first obtaining any
|
||||
* required license or other approval from the U. S. Department of Commerce or
|
||||
* any other agency or department of the United States Government. In the
|
||||
* event Licensee exports any such software from the United States or
|
||||
* re-exports any such software from a foreign destination, Licensee shall
|
||||
* ensure that the distribution and export/re-export of the software is in
|
||||
* compliance with all laws, regulations, orders, or other restrictions of the
|
||||
* U.S. Export Administration Regulations. Licensee agrees that neither it nor
|
||||
* any of its subsidiaries will export/re-export any technical data, process,
|
||||
* software, or service, directly or indirectly, to any country for which the
|
||||
* United States government or any agency thereof requires an export license,
|
||||
* other governmental approval, or letter of assurance, without first obtaining
|
||||
* such license, approval or letter.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
|
||||
#define __EXOPARG2_C__
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#include "acpi.h"
|
||||
#include "accommon.h"
|
||||
@@ -209,14 +134,13 @@ AcpiExOpcode_2A_0T_0R (
|
||||
/*
|
||||
* Dispatch the notify to the appropriate handler
|
||||
* NOTE: the request is queued for execution after this method
|
||||
* completes. The notify handlers are NOT invoked synchronously
|
||||
* completes. The notify handlers are NOT invoked synchronously
|
||||
* from this thread -- because handlers may in turn run other
|
||||
* control methods.
|
||||
*/
|
||||
Status = AcpiEvQueueNotifyRequest (Node, Value);
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
|
||||
ACPI_ERROR ((AE_INFO, "Unknown AML opcode 0x%X",
|
||||
@@ -289,7 +213,6 @@ AcpiExOpcode_2A_2T_1R (
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
|
||||
ACPI_ERROR ((AE_INFO, "Unknown AML opcode 0x%X",
|
||||
@@ -358,7 +281,7 @@ AcpiExOpcode_2A_1T_1R (
|
||||
ACPI_OPERAND_OBJECT *ReturnDesc = NULL;
|
||||
UINT64 Index;
|
||||
ACPI_STATUS Status = AE_OK;
|
||||
ACPI_SIZE Length;
|
||||
ACPI_SIZE Length = 0;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE_STR (ExOpcode_2A_1T_1R,
|
||||
@@ -403,16 +326,13 @@ AcpiExOpcode_2A_1T_1R (
|
||||
&ReturnDesc->Integer.Value);
|
||||
break;
|
||||
|
||||
|
||||
case AML_CONCAT_OP: /* Concatenate (Data1, Data2, Result) */
|
||||
|
||||
Status = AcpiExDoConcatenate (Operand[0], Operand[1],
|
||||
&ReturnDesc, WalkState);
|
||||
break;
|
||||
|
||||
|
||||
case AML_TO_STRING_OP: /* ToString (Buffer, Length, Result) (ACPI 2.0) */
|
||||
|
||||
/*
|
||||
* Input object is guaranteed to be a buffer at this point (it may have
|
||||
* been converted.) Copy the raw buffer data to a new object of
|
||||
@@ -428,7 +348,6 @@ AcpiExOpcode_2A_1T_1R (
|
||||
* NOTE: A length of zero is ok, and will create a zero-length, null
|
||||
* terminated string.
|
||||
*/
|
||||
Length = 0;
|
||||
while ((Length < Operand[0]->Buffer.Length) &&
|
||||
(Length < Operand[1]->Integer.Value) &&
|
||||
(Operand[0]->Buffer.Pointer[Length]))
|
||||
@@ -453,7 +372,6 @@ AcpiExOpcode_2A_1T_1R (
|
||||
Operand[0]->Buffer.Pointer, Length);
|
||||
break;
|
||||
|
||||
|
||||
case AML_CONCAT_RES_OP:
|
||||
|
||||
/* ConcatenateResTemplate (Buffer, Buffer, Result) (ACPI 2.0) */
|
||||
@@ -462,7 +380,6 @@ AcpiExOpcode_2A_1T_1R (
|
||||
&ReturnDesc, WalkState);
|
||||
break;
|
||||
|
||||
|
||||
case AML_INDEX_OP: /* Index (Source Index Result) */
|
||||
|
||||
/* Create the internal return object */
|
||||
@@ -490,6 +407,7 @@ AcpiExOpcode_2A_1T_1R (
|
||||
|
||||
if (Index >= Operand[0]->String.Length)
|
||||
{
|
||||
Length = Operand[0]->String.Length;
|
||||
Status = AE_AML_STRING_LIMIT;
|
||||
}
|
||||
|
||||
@@ -500,6 +418,7 @@ AcpiExOpcode_2A_1T_1R (
|
||||
|
||||
if (Index >= Operand[0]->Buffer.Length)
|
||||
{
|
||||
Length = Operand[0]->Buffer.Length;
|
||||
Status = AE_AML_BUFFER_LIMIT;
|
||||
}
|
||||
|
||||
@@ -510,6 +429,7 @@ AcpiExOpcode_2A_1T_1R (
|
||||
|
||||
if (Index >= Operand[0]->Package.Count)
|
||||
{
|
||||
Length = Operand[0]->Package.Count;
|
||||
Status = AE_AML_PACKAGE_LIMIT;
|
||||
}
|
||||
|
||||
@@ -528,8 +448,8 @@ AcpiExOpcode_2A_1T_1R (
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
ACPI_EXCEPTION ((AE_INFO, Status,
|
||||
"Index (0x%8.8X%8.8X) is beyond end of object",
|
||||
ACPI_FORMAT_UINT64 (Index)));
|
||||
"Index (0x%X%8.8X) is beyond end of object (length 0x%X)",
|
||||
ACPI_FORMAT_UINT64 (Index), (UINT32) Length));
|
||||
goto Cleanup;
|
||||
}
|
||||
|
||||
@@ -549,7 +469,6 @@ AcpiExOpcode_2A_1T_1R (
|
||||
WalkState->ResultObj = ReturnDesc;
|
||||
goto Cleanup;
|
||||
|
||||
|
||||
default:
|
||||
|
||||
ACPI_ERROR ((AE_INFO, "Unknown AML opcode 0x%X",
|
||||
@@ -672,7 +591,6 @@ AcpiExOpcode_2A_0T_1R (
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
|
||||
ACPI_ERROR ((AE_INFO, "Unknown AML opcode 0x%X",
|
||||
@@ -710,5 +628,3 @@ Cleanup:
|
||||
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,121 +1,45 @@
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* Module Name: exoparg3 - AML execution - opcodes with 3 arguments
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
* 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.
|
||||
*
|
||||
* 2.1. This is your license from Intel Corp. under its intellectual property
|
||||
* rights. You may have additional license terms from the party that provided
|
||||
* you this software, covering your right to use that party's intellectual
|
||||
* property rights.
|
||||
* 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.
|
||||
*
|
||||
* 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
|
||||
* copy of the source code appearing in this file ("Covered Code") an
|
||||
* irrevocable, perpetual, worldwide license under Intel's copyrights in the
|
||||
* base code distributed originally by Intel ("Original Intel Code") to copy,
|
||||
* make derivatives, distribute, use and display any portion of the Covered
|
||||
* Code in any form, with the right to sublicense such rights; and
|
||||
*
|
||||
* 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
|
||||
* license (with the right to sublicense), under only those claims of Intel
|
||||
* patents that are infringed by the Original Intel Code, to make, use, sell,
|
||||
* offer to sell, and import the Covered Code and derivative works thereof
|
||||
* solely to the minimum extent necessary to exercise the above copyright
|
||||
* license, and in no event shall the patent license extend to any additions
|
||||
* to or modifications of the Original Intel Code. No other license or right
|
||||
* is granted directly or by implication, estoppel or otherwise;
|
||||
*
|
||||
* The above copyright and patent license is granted only if the following
|
||||
* conditions are met:
|
||||
*
|
||||
* 3. Conditions
|
||||
*
|
||||
* 3.1. Redistribution of Source with Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification with rights to further distribute source must include
|
||||
* the above Copyright Notice, the above License, this list of Conditions,
|
||||
* and the following Disclaimer and Export Compliance provision. In addition,
|
||||
* Licensee must cause all Covered Code to which Licensee contributes to
|
||||
* contain a file documenting the changes Licensee made to create that Covered
|
||||
* Code and the date of any change. Licensee must include in that file the
|
||||
* documentation of any changes made by any predecessor Licensee. Licensee
|
||||
* must include a prominent statement that the modification is derived,
|
||||
* directly or indirectly, from Original Intel Code.
|
||||
*
|
||||
* 3.2. Redistribution of Source with no Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification without rights to further distribute source must
|
||||
* include the following Disclaimer and Export Compliance provision in the
|
||||
* documentation and/or other materials provided with distribution. In
|
||||
* addition, Licensee may not authorize further sublicense of source of any
|
||||
* portion of the Covered Code, and must include terms to the effect that the
|
||||
* license from Licensee to its licensee is limited to the intellectual
|
||||
* property embodied in the software Licensee provides to its licensee, and
|
||||
* not to intellectual property embodied in modifications its licensee may
|
||||
* make.
|
||||
*
|
||||
* 3.3. Redistribution of Executable. Redistribution in executable form of any
|
||||
* substantial portion of the Covered Code or modification must reproduce the
|
||||
* above Copyright Notice, and the following Disclaimer and Export Compliance
|
||||
* provision in the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3.4. Intel retains all right, title, and interest in and to the Original
|
||||
* Intel Code.
|
||||
*
|
||||
* 3.5. Neither the name Intel nor any other trademark owned or controlled by
|
||||
* Intel shall be used in advertising or otherwise to promote the sale, use or
|
||||
* other dealings in products derived from or relating to the Covered Code
|
||||
* without prior written authorization from Intel.
|
||||
*
|
||||
* 4. Disclaimer and Export Compliance
|
||||
*
|
||||
* 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
|
||||
* HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
|
||||
* IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
|
||||
* INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
|
||||
|
||||
* UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
|
||||
* PARTICULAR PURPOSE.
|
||||
*
|
||||
* 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
|
||||
* OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
|
||||
* COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
|
||||
* SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
|
||||
* CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
|
||||
* HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
|
||||
* SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
|
||||
* LIMITED REMEDY.
|
||||
*
|
||||
* 4.3. Licensee shall not export, either directly or indirectly, any of this
|
||||
* software or system incorporating such software without first obtaining any
|
||||
* required license or other approval from the U. S. Department of Commerce or
|
||||
* any other agency or department of the United States Government. In the
|
||||
* event Licensee exports any such software from the United States or
|
||||
* re-exports any such software from a foreign destination, Licensee shall
|
||||
* ensure that the distribution and export/re-export of the software is in
|
||||
* compliance with all laws, regulations, orders, or other restrictions of the
|
||||
* U.S. Export Administration Regulations. Licensee agrees that neither it nor
|
||||
* any of its subsidiaries will export/re-export any technical data, process,
|
||||
* software, or service, directly or indirectly, to any country for which the
|
||||
* United States government or any agency thereof requires an export license,
|
||||
* other governmental approval, or letter of assurance, without first obtaining
|
||||
* such license, approval or letter.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
#define __EXOPARG3_C__
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#include "acpi.h"
|
||||
#include "accommon.h"
|
||||
@@ -203,7 +127,6 @@ AcpiExOpcode_3A_0T_0R (
|
||||
ACPI_FREE (Fatal);
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
|
||||
ACPI_ERROR ((AE_INFO, "Unknown AML opcode 0x%X",
|
||||
@@ -250,9 +173,8 @@ AcpiExOpcode_3A_1T_1R (
|
||||
switch (WalkState->Opcode)
|
||||
{
|
||||
case AML_MID_OP: /* Mid (Source[0], Index[1], Length[2], Result[3]) */
|
||||
|
||||
/*
|
||||
* Create the return object. The Source operand is guaranteed to be
|
||||
* Create the return object. The Source operand is guaranteed to be
|
||||
* either a String or a Buffer, so just use its type.
|
||||
*/
|
||||
ReturnDesc = AcpiUtCreateInternalObject (
|
||||
@@ -342,7 +264,6 @@ AcpiExOpcode_3A_1T_1R (
|
||||
ReturnDesc->Buffer.Flags |= AOPOBJ_DATA_VALID;
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
|
||||
ACPI_ERROR ((AE_INFO, "Unknown AML opcode 0x%X",
|
||||
@@ -373,5 +294,3 @@ Cleanup:
|
||||
}
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,121 +1,45 @@
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* Module Name: exoparg6 - AML execution - opcodes with 6 arguments
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
* 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.
|
||||
*
|
||||
* 2.1. This is your license from Intel Corp. under its intellectual property
|
||||
* rights. You may have additional license terms from the party that provided
|
||||
* you this software, covering your right to use that party's intellectual
|
||||
* property rights.
|
||||
* 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.
|
||||
*
|
||||
* 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
|
||||
* copy of the source code appearing in this file ("Covered Code") an
|
||||
* irrevocable, perpetual, worldwide license under Intel's copyrights in the
|
||||
* base code distributed originally by Intel ("Original Intel Code") to copy,
|
||||
* make derivatives, distribute, use and display any portion of the Covered
|
||||
* Code in any form, with the right to sublicense such rights; and
|
||||
*
|
||||
* 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
|
||||
* license (with the right to sublicense), under only those claims of Intel
|
||||
* patents that are infringed by the Original Intel Code, to make, use, sell,
|
||||
* offer to sell, and import the Covered Code and derivative works thereof
|
||||
* solely to the minimum extent necessary to exercise the above copyright
|
||||
* license, and in no event shall the patent license extend to any additions
|
||||
* to or modifications of the Original Intel Code. No other license or right
|
||||
* is granted directly or by implication, estoppel or otherwise;
|
||||
*
|
||||
* The above copyright and patent license is granted only if the following
|
||||
* conditions are met:
|
||||
*
|
||||
* 3. Conditions
|
||||
*
|
||||
* 3.1. Redistribution of Source with Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification with rights to further distribute source must include
|
||||
* the above Copyright Notice, the above License, this list of Conditions,
|
||||
* and the following Disclaimer and Export Compliance provision. In addition,
|
||||
* Licensee must cause all Covered Code to which Licensee contributes to
|
||||
* contain a file documenting the changes Licensee made to create that Covered
|
||||
* Code and the date of any change. Licensee must include in that file the
|
||||
* documentation of any changes made by any predecessor Licensee. Licensee
|
||||
* must include a prominent statement that the modification is derived,
|
||||
* directly or indirectly, from Original Intel Code.
|
||||
*
|
||||
* 3.2. Redistribution of Source with no Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification without rights to further distribute source must
|
||||
* include the following Disclaimer and Export Compliance provision in the
|
||||
* documentation and/or other materials provided with distribution. In
|
||||
* addition, Licensee may not authorize further sublicense of source of any
|
||||
* portion of the Covered Code, and must include terms to the effect that the
|
||||
* license from Licensee to its licensee is limited to the intellectual
|
||||
* property embodied in the software Licensee provides to its licensee, and
|
||||
* not to intellectual property embodied in modifications its licensee may
|
||||
* make.
|
||||
*
|
||||
* 3.3. Redistribution of Executable. Redistribution in executable form of any
|
||||
* substantial portion of the Covered Code or modification must reproduce the
|
||||
* above Copyright Notice, and the following Disclaimer and Export Compliance
|
||||
* provision in the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3.4. Intel retains all right, title, and interest in and to the Original
|
||||
* Intel Code.
|
||||
*
|
||||
* 3.5. Neither the name Intel nor any other trademark owned or controlled by
|
||||
* Intel shall be used in advertising or otherwise to promote the sale, use or
|
||||
* other dealings in products derived from or relating to the Covered Code
|
||||
* without prior written authorization from Intel.
|
||||
*
|
||||
* 4. Disclaimer and Export Compliance
|
||||
*
|
||||
* 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
|
||||
* HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
|
||||
* IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
|
||||
* INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
|
||||
|
||||
* UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
|
||||
* PARTICULAR PURPOSE.
|
||||
*
|
||||
* 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
|
||||
* OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
|
||||
* COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
|
||||
* SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
|
||||
* CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
|
||||
* HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
|
||||
* SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
|
||||
* LIMITED REMEDY.
|
||||
*
|
||||
* 4.3. Licensee shall not export, either directly or indirectly, any of this
|
||||
* software or system incorporating such software without first obtaining any
|
||||
* required license or other approval from the U. S. Department of Commerce or
|
||||
* any other agency or department of the United States Government. In the
|
||||
* event Licensee exports any such software from the United States or
|
||||
* re-exports any such software from a foreign destination, Licensee shall
|
||||
* ensure that the distribution and export/re-export of the software is in
|
||||
* compliance with all laws, regulations, orders, or other restrictions of the
|
||||
* U.S. Export Administration Regulations. Licensee agrees that neither it nor
|
||||
* any of its subsidiaries will export/re-export any technical data, process,
|
||||
* software, or service, directly or indirectly, to any country for which the
|
||||
* United States government or any agency thereof requires an export license,
|
||||
* other governmental approval, or letter of assurance, without first obtaining
|
||||
* such license, approval or letter.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
#define __EXOPARG6_C__
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#include "acpi.h"
|
||||
#include "accommon.h"
|
||||
@@ -204,7 +128,6 @@ AcpiExDoMatch (
|
||||
break;
|
||||
|
||||
case MATCH_MEQ:
|
||||
|
||||
/*
|
||||
* True if equal: (P[i] == M)
|
||||
* Change to: (M == P[i])
|
||||
@@ -218,7 +141,6 @@ AcpiExDoMatch (
|
||||
break;
|
||||
|
||||
case MATCH_MLE:
|
||||
|
||||
/*
|
||||
* True if less than or equal: (P[i] <= M) (P[i] NotGreater than M)
|
||||
* Change to: (M >= P[i]) (M NotLess than P[i])
|
||||
@@ -233,7 +155,6 @@ AcpiExDoMatch (
|
||||
break;
|
||||
|
||||
case MATCH_MLT:
|
||||
|
||||
/*
|
||||
* True if less than: (P[i] < M)
|
||||
* Change to: (M > P[i])
|
||||
@@ -247,7 +168,6 @@ AcpiExDoMatch (
|
||||
break;
|
||||
|
||||
case MATCH_MGE:
|
||||
|
||||
/*
|
||||
* True if greater than or equal: (P[i] >= M) (P[i] NotLess than M)
|
||||
* Change to: (M <= P[i]) (M NotGreater than P[i])
|
||||
@@ -262,7 +182,6 @@ AcpiExDoMatch (
|
||||
break;
|
||||
|
||||
case MATCH_MGT:
|
||||
|
||||
/*
|
||||
* True if greater than: (P[i] > M)
|
||||
* Change to: (M < P[i])
|
||||
@@ -282,7 +201,7 @@ AcpiExDoMatch (
|
||||
return (FALSE);
|
||||
}
|
||||
|
||||
return LogicalResult;
|
||||
return (LogicalResult);
|
||||
}
|
||||
|
||||
|
||||
@@ -361,7 +280,7 @@ AcpiExOpcode_6A_0T_1R (
|
||||
* and the next should be examined.
|
||||
*
|
||||
* Upon finding a match, the loop will terminate via "break" at
|
||||
* the bottom. If it terminates "normally", MatchValue will be
|
||||
* the bottom. If it terminates "normally", MatchValue will be
|
||||
* ACPI_UINT64_MAX (Ones) (its initial value) indicating that no
|
||||
* match was found.
|
||||
*/
|
||||
@@ -402,13 +321,11 @@ AcpiExOpcode_6A_0T_1R (
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case AML_LOAD_TABLE_OP:
|
||||
|
||||
Status = AcpiExLoadTableOp (WalkState, &ReturnDesc);
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
|
||||
ACPI_ERROR ((AE_INFO, "Unknown AML opcode 0x%X",
|
||||
|
||||
@@ -1,126 +1,52 @@
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* Module Name: exprep - ACPI AML (p-code) execution - field prep utilities
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
* 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.
|
||||
*
|
||||
* 2.1. This is your license from Intel Corp. under its intellectual property
|
||||
* rights. You may have additional license terms from the party that provided
|
||||
* you this software, covering your right to use that party's intellectual
|
||||
* property rights.
|
||||
* 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.
|
||||
*
|
||||
* 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
|
||||
* copy of the source code appearing in this file ("Covered Code") an
|
||||
* irrevocable, perpetual, worldwide license under Intel's copyrights in the
|
||||
* base code distributed originally by Intel ("Original Intel Code") to copy,
|
||||
* make derivatives, distribute, use and display any portion of the Covered
|
||||
* Code in any form, with the right to sublicense such rights; and
|
||||
*
|
||||
* 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
|
||||
* license (with the right to sublicense), under only those claims of Intel
|
||||
* patents that are infringed by the Original Intel Code, to make, use, sell,
|
||||
* offer to sell, and import the Covered Code and derivative works thereof
|
||||
* solely to the minimum extent necessary to exercise the above copyright
|
||||
* license, and in no event shall the patent license extend to any additions
|
||||
* to or modifications of the Original Intel Code. No other license or right
|
||||
* is granted directly or by implication, estoppel or otherwise;
|
||||
*
|
||||
* The above copyright and patent license is granted only if the following
|
||||
* conditions are met:
|
||||
*
|
||||
* 3. Conditions
|
||||
*
|
||||
* 3.1. Redistribution of Source with Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification with rights to further distribute source must include
|
||||
* the above Copyright Notice, the above License, this list of Conditions,
|
||||
* and the following Disclaimer and Export Compliance provision. In addition,
|
||||
* Licensee must cause all Covered Code to which Licensee contributes to
|
||||
* contain a file documenting the changes Licensee made to create that Covered
|
||||
* Code and the date of any change. Licensee must include in that file the
|
||||
* documentation of any changes made by any predecessor Licensee. Licensee
|
||||
* must include a prominent statement that the modification is derived,
|
||||
* directly or indirectly, from Original Intel Code.
|
||||
*
|
||||
* 3.2. Redistribution of Source with no Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification without rights to further distribute source must
|
||||
* include the following Disclaimer and Export Compliance provision in the
|
||||
* documentation and/or other materials provided with distribution. In
|
||||
* addition, Licensee may not authorize further sublicense of source of any
|
||||
* portion of the Covered Code, and must include terms to the effect that the
|
||||
* license from Licensee to its licensee is limited to the intellectual
|
||||
* property embodied in the software Licensee provides to its licensee, and
|
||||
* not to intellectual property embodied in modifications its licensee may
|
||||
* make.
|
||||
*
|
||||
* 3.3. Redistribution of Executable. Redistribution in executable form of any
|
||||
* substantial portion of the Covered Code or modification must reproduce the
|
||||
* above Copyright Notice, and the following Disclaimer and Export Compliance
|
||||
* provision in the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3.4. Intel retains all right, title, and interest in and to the Original
|
||||
* Intel Code.
|
||||
*
|
||||
* 3.5. Neither the name Intel nor any other trademark owned or controlled by
|
||||
* Intel shall be used in advertising or otherwise to promote the sale, use or
|
||||
* other dealings in products derived from or relating to the Covered Code
|
||||
* without prior written authorization from Intel.
|
||||
*
|
||||
* 4. Disclaimer and Export Compliance
|
||||
*
|
||||
* 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
|
||||
* HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
|
||||
* IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
|
||||
* INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
|
||||
* UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
|
||||
* PARTICULAR PURPOSE.
|
||||
*
|
||||
* 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
|
||||
* OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
|
||||
* COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
|
||||
* SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
|
||||
* CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
|
||||
* HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
|
||||
* SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
|
||||
* LIMITED REMEDY.
|
||||
*
|
||||
* 4.3. Licensee shall not export, either directly or indirectly, any of this
|
||||
* software or system incorporating such software without first obtaining any
|
||||
* required license or other approval from the U. S. Department of Commerce or
|
||||
* any other agency or department of the United States Government. In the
|
||||
* event Licensee exports any such software from the United States or
|
||||
* re-exports any such software from a foreign destination, Licensee shall
|
||||
* ensure that the distribution and export/re-export of the software is in
|
||||
* compliance with all laws, regulations, orders, or other restrictions of the
|
||||
* U.S. Export Administration Regulations. Licensee agrees that neither it nor
|
||||
* any of its subsidiaries will export/re-export any technical data, process,
|
||||
* software, or service, directly or indirectly, to any country for which the
|
||||
* United States government or any agency thereof requires an export license,
|
||||
* other governmental approval, or letter of assurance, without first obtaining
|
||||
* such license, approval or letter.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
#define __EXPREP_C__
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#include "acpi.h"
|
||||
#include "accommon.h"
|
||||
#include "acinterp.h"
|
||||
#include "amlcode.h"
|
||||
#include "acnamesp.h"
|
||||
#include "acdispat.h"
|
||||
|
||||
|
||||
#define _COMPONENT ACPI_EXECUTER
|
||||
@@ -158,8 +84,8 @@ AcpiExGenerateAccess (
|
||||
* AnyAcc keyword.
|
||||
*
|
||||
* NOTE: Need to have the RegionLength in order to check for boundary
|
||||
* conditions (end-of-region). However, the RegionLength is a deferred
|
||||
* operation. Therefore, to complete this implementation, the generation
|
||||
* conditions (end-of-region). However, the RegionLength is a deferred
|
||||
* operation. Therefore, to complete this implementation, the generation
|
||||
* of this access width must be deferred until the region length has
|
||||
* been evaluated.
|
||||
*
|
||||
@@ -193,12 +119,12 @@ AcpiExGenerateAccess (
|
||||
FieldByteLength = FieldByteEndOffset - FieldByteOffset;
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD,
|
||||
"Bit length %u, Bit offset %u\n",
|
||||
FieldBitLength, FieldBitOffset));
|
||||
"Bit length %u, Bit offset %u\n",
|
||||
FieldBitLength, FieldBitOffset));
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD,
|
||||
"Byte Length %u, Byte Offset %u, End Offset %u\n",
|
||||
FieldByteLength, FieldByteOffset, FieldByteEndOffset));
|
||||
"Byte Length %u, Byte Offset %u, End Offset %u\n",
|
||||
FieldByteLength, FieldByteOffset, FieldByteEndOffset));
|
||||
|
||||
/*
|
||||
* Iterative search for the maximum access width that is both aligned
|
||||
@@ -228,11 +154,11 @@ AcpiExGenerateAccess (
|
||||
Accesses = FieldEndOffset - FieldStartOffset;
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD,
|
||||
"AccessWidth %u end is within region\n", AccessByteWidth));
|
||||
"AccessWidth %u end is within region\n", AccessByteWidth));
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD,
|
||||
"Field Start %u, Field End %u -- requires %u accesses\n",
|
||||
FieldStartOffset, FieldEndOffset, Accesses));
|
||||
"Field Start %u, Field End %u -- requires %u accesses\n",
|
||||
FieldStartOffset, FieldEndOffset, Accesses));
|
||||
|
||||
/* Single access is optimal */
|
||||
|
||||
@@ -261,7 +187,7 @@ AcpiExGenerateAccess (
|
||||
if (AccessByteWidth == 1)
|
||||
{
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD,
|
||||
"Field goes beyond end-of-region!\n"));
|
||||
"Field goes beyond end-of-region!\n"));
|
||||
|
||||
/* Field does not fit in the region at all */
|
||||
|
||||
@@ -273,8 +199,8 @@ AcpiExGenerateAccess (
|
||||
* previous access
|
||||
*/
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD,
|
||||
"Backing off to previous optimal access width of %u\n",
|
||||
MinimumAccessWidth));
|
||||
"Backing off to previous optimal access width of %u\n",
|
||||
MinimumAccessWidth));
|
||||
return_VALUE (MinimumAccessWidth);
|
||||
}
|
||||
}
|
||||
@@ -284,7 +210,7 @@ AcpiExGenerateAccess (
|
||||
* just use max access width
|
||||
*/
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD,
|
||||
"Cannot access field in one operation, using width 8\n"));
|
||||
"Cannot access field in one operation, using width 8\n"));
|
||||
return_VALUE (8);
|
||||
}
|
||||
#endif /* ACPI_UNDER_DEVELOPMENT */
|
||||
@@ -339,26 +265,31 @@ AcpiExDecodeFieldAccess (
|
||||
|
||||
case AML_FIELD_ACCESS_BYTE:
|
||||
case AML_FIELD_ACCESS_BUFFER: /* ACPI 2.0 (SMBus Buffer) */
|
||||
|
||||
ByteAlignment = 1;
|
||||
BitLength = 8;
|
||||
break;
|
||||
|
||||
case AML_FIELD_ACCESS_WORD:
|
||||
|
||||
ByteAlignment = 2;
|
||||
BitLength = 16;
|
||||
break;
|
||||
|
||||
case AML_FIELD_ACCESS_DWORD:
|
||||
|
||||
ByteAlignment = 4;
|
||||
BitLength = 32;
|
||||
break;
|
||||
|
||||
case AML_FIELD_ACCESS_QWORD: /* ACPI 2.0 */
|
||||
|
||||
ByteAlignment = 8;
|
||||
BitLength = 64;
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
/* Invalid field access type */
|
||||
|
||||
ACPI_ERROR ((AE_INFO,
|
||||
@@ -397,7 +328,7 @@ AcpiExDecodeFieldAccess (
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Initialize the areas of the field object that are common
|
||||
* to the various types of fields. Note: This is very "sensitive"
|
||||
* to the various types of fields. Note: This is very "sensitive"
|
||||
* code because we are solving the general case for field
|
||||
* alignment.
|
||||
*
|
||||
@@ -429,13 +360,13 @@ AcpiExPrepCommonFieldObject (
|
||||
ObjDesc->CommonField.BitLength = FieldBitLength;
|
||||
|
||||
/*
|
||||
* Decode the access type so we can compute offsets. The access type gives
|
||||
* Decode the access type so we can compute offsets. The access type gives
|
||||
* two pieces of information - the width of each field access and the
|
||||
* necessary ByteAlignment (address granularity) of the access.
|
||||
*
|
||||
* For AnyAcc, the AccessBitWidth is the largest width that is both
|
||||
* necessary and possible in an attempt to access the whole field in one
|
||||
* I/O operation. However, for AnyAcc, the ByteAlignment is always one
|
||||
* I/O operation. However, for AnyAcc, the ByteAlignment is always one
|
||||
* byte.
|
||||
*
|
||||
* For all Buffer Fields, the ByteAlignment is always one byte.
|
||||
@@ -444,22 +375,20 @@ AcpiExPrepCommonFieldObject (
|
||||
* the same (equivalent) as the ByteAlignment.
|
||||
*/
|
||||
AccessBitWidth = AcpiExDecodeFieldAccess (ObjDesc, FieldFlags,
|
||||
&ByteAlignment);
|
||||
&ByteAlignment);
|
||||
if (!AccessBitWidth)
|
||||
{
|
||||
return_ACPI_STATUS (AE_AML_OPERAND_VALUE);
|
||||
}
|
||||
|
||||
/* Setup width (access granularity) fields */
|
||||
/* Setup width (access granularity) fields (values are: 1, 2, 4, 8) */
|
||||
|
||||
ObjDesc->CommonField.AccessByteWidth = (UINT8)
|
||||
ACPI_DIV_8 (AccessBitWidth); /* 1, 2, 4, 8 */
|
||||
|
||||
ObjDesc->CommonField.AccessBitWidth = (UINT8) AccessBitWidth;
|
||||
ACPI_DIV_8 (AccessBitWidth);
|
||||
|
||||
/*
|
||||
* BaseByteOffset is the address of the start of the field within the
|
||||
* region. It is the byte address of the first *datum* (field-width data
|
||||
* region. It is the byte address of the first *datum* (field-width data
|
||||
* unit) of the field. (i.e., the first datum that contains at least the
|
||||
* first *bit* of the field.)
|
||||
*
|
||||
@@ -468,9 +397,9 @@ AcpiExPrepCommonFieldObject (
|
||||
* region or buffer.
|
||||
*/
|
||||
NearestByteAddress =
|
||||
ACPI_ROUND_BITS_DOWN_TO_BYTES (FieldBitPosition);
|
||||
ACPI_ROUND_BITS_DOWN_TO_BYTES (FieldBitPosition);
|
||||
ObjDesc->CommonField.BaseByteOffset = (UINT32)
|
||||
ACPI_ROUND_DOWN (NearestByteAddress, ByteAlignment);
|
||||
ACPI_ROUND_DOWN (NearestByteAddress, ByteAlignment);
|
||||
|
||||
/*
|
||||
* StartFieldBitOffset is the offset of the first bit of the field within
|
||||
@@ -491,8 +420,8 @@ AcpiExPrepCommonFieldObject (
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Construct an ACPI_OPERAND_OBJECT of type DefField and
|
||||
* connect it to the parent Node.
|
||||
* DESCRIPTION: Construct an object of type ACPI_OPERAND_OBJECT with a
|
||||
* subtype of DefField and connect it to the parent Node.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
@@ -502,8 +431,9 @@ AcpiExPrepFieldValue (
|
||||
{
|
||||
ACPI_OPERAND_OBJECT *ObjDesc;
|
||||
ACPI_OPERAND_OBJECT *SecondDesc = NULL;
|
||||
UINT32 Type;
|
||||
ACPI_STATUS Status;
|
||||
UINT32 AccessByteWidth;
|
||||
UINT32 Type;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE (ExPrepFieldValue);
|
||||
@@ -522,8 +452,7 @@ AcpiExPrepFieldValue (
|
||||
Type = AcpiNsGetType (Info->RegionNode);
|
||||
if (Type != ACPI_TYPE_REGION)
|
||||
{
|
||||
ACPI_ERROR ((AE_INFO,
|
||||
"Needed Region, found type 0x%X (%s)",
|
||||
ACPI_ERROR ((AE_INFO, "Needed Region, found type 0x%X (%s)",
|
||||
Type, AcpiUtGetTypeName (Type)));
|
||||
|
||||
return_ACPI_STATUS (AE_AML_OPERAND_TYPE);
|
||||
@@ -541,8 +470,9 @@ AcpiExPrepFieldValue (
|
||||
/* Initialize areas of the object that are common to all fields */
|
||||
|
||||
ObjDesc->CommonField.Node = Info->FieldNode;
|
||||
Status = AcpiExPrepCommonFieldObject (ObjDesc, Info->FieldFlags,
|
||||
Info->Attribute, Info->FieldBitPosition, Info->FieldBitLength);
|
||||
Status = AcpiExPrepCommonFieldObject (ObjDesc,
|
||||
Info->FieldFlags, Info->Attribute,
|
||||
Info->FieldBitPosition, Info->FieldBitLength);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
AcpiUtDeleteObjectDesc (ObjDesc);
|
||||
@@ -557,6 +487,50 @@ AcpiExPrepFieldValue (
|
||||
|
||||
ObjDesc->Field.RegionObj = AcpiNsGetAttachedObject (Info->RegionNode);
|
||||
|
||||
/* Fields specific to GenericSerialBus fields */
|
||||
|
||||
ObjDesc->Field.AccessLength = Info->AccessLength;
|
||||
|
||||
if (Info->ConnectionNode)
|
||||
{
|
||||
SecondDesc = Info->ConnectionNode->Object;
|
||||
if (!(SecondDesc->Common.Flags & AOPOBJ_DATA_VALID))
|
||||
{
|
||||
Status = AcpiDsGetBufferArguments (SecondDesc);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
AcpiUtDeleteObjectDesc (ObjDesc);
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
}
|
||||
|
||||
ObjDesc->Field.ResourceBuffer = SecondDesc->Buffer.Pointer;
|
||||
ObjDesc->Field.ResourceLength = (UINT16) SecondDesc->Buffer.Length;
|
||||
}
|
||||
else if (Info->ResourceBuffer)
|
||||
{
|
||||
ObjDesc->Field.ResourceBuffer = Info->ResourceBuffer;
|
||||
ObjDesc->Field.ResourceLength = Info->ResourceLength;
|
||||
}
|
||||
|
||||
ObjDesc->Field.PinNumberIndex = Info->PinNumberIndex;
|
||||
|
||||
/* Allow full data read from EC address space */
|
||||
|
||||
if ((ObjDesc->Field.RegionObj->Region.SpaceId == ACPI_ADR_SPACE_EC) &&
|
||||
(ObjDesc->CommonField.BitLength > 8))
|
||||
{
|
||||
AccessByteWidth = ACPI_ROUND_BITS_UP_TO_BYTES (
|
||||
ObjDesc->CommonField.BitLength);
|
||||
|
||||
/* Maximum byte width supported is 255 */
|
||||
|
||||
if (AccessByteWidth < 256)
|
||||
{
|
||||
ObjDesc->CommonField.AccessByteWidth = (UINT8) AccessByteWidth;
|
||||
}
|
||||
}
|
||||
|
||||
/* An additional reference for the container */
|
||||
|
||||
AcpiUtAddReference (ObjDesc->Field.RegionObj);
|
||||
@@ -567,14 +541,13 @@ AcpiExPrepFieldValue (
|
||||
ObjDesc->Field.AccessByteWidth, ObjDesc->Field.RegionObj));
|
||||
break;
|
||||
|
||||
|
||||
case ACPI_TYPE_LOCAL_BANK_FIELD:
|
||||
|
||||
ObjDesc->BankField.Value = Info->BankValue;
|
||||
ObjDesc->BankField.RegionObj = AcpiNsGetAttachedObject (
|
||||
Info->RegionNode);
|
||||
ObjDesc->BankField.BankObj = AcpiNsGetAttachedObject (
|
||||
Info->RegisterNode);
|
||||
ObjDesc->BankField.Value = Info->BankValue;
|
||||
ObjDesc->BankField.RegionObj =
|
||||
AcpiNsGetAttachedObject (Info->RegionNode);
|
||||
ObjDesc->BankField.BankObj =
|
||||
AcpiNsGetAttachedObject (Info->RegisterNode);
|
||||
|
||||
/* An additional reference for the attached objects */
|
||||
|
||||
@@ -594,21 +567,22 @@ AcpiExPrepFieldValue (
|
||||
* opcode and operands -- since the BankValue
|
||||
* operands must be evaluated.
|
||||
*/
|
||||
SecondDesc = ObjDesc->Common.NextObject;
|
||||
SecondDesc->Extra.AmlStart = ACPI_CAST_PTR (ACPI_PARSE_OBJECT, Info->DataRegisterNode)->Named.Data;
|
||||
SecondDesc->Extra.AmlLength = ACPI_CAST_PTR (ACPI_PARSE_OBJECT, Info->DataRegisterNode)->Named.Length;
|
||||
SecondDesc = ObjDesc->Common.NextObject;
|
||||
SecondDesc->Extra.AmlStart = ACPI_CAST_PTR (ACPI_PARSE_OBJECT,
|
||||
Info->DataRegisterNode)->Named.Data;
|
||||
SecondDesc->Extra.AmlLength = ACPI_CAST_PTR (ACPI_PARSE_OBJECT,
|
||||
Info->DataRegisterNode)->Named.Length;
|
||||
|
||||
break;
|
||||
|
||||
|
||||
case ACPI_TYPE_LOCAL_INDEX_FIELD:
|
||||
|
||||
/* Get the Index and Data registers */
|
||||
|
||||
ObjDesc->IndexField.IndexObj = AcpiNsGetAttachedObject (
|
||||
Info->RegisterNode);
|
||||
ObjDesc->IndexField.DataObj = AcpiNsGetAttachedObject (
|
||||
Info->DataRegisterNode);
|
||||
ObjDesc->IndexField.IndexObj =
|
||||
AcpiNsGetAttachedObject (Info->RegisterNode);
|
||||
ObjDesc->IndexField.DataObj =
|
||||
AcpiNsGetAttachedObject (Info->DataRegisterNode);
|
||||
|
||||
if (!ObjDesc->IndexField.DataObj || !ObjDesc->IndexField.IndexObj)
|
||||
{
|
||||
@@ -654,7 +628,9 @@ AcpiExPrepFieldValue (
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
/* No other types should get here */
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -663,14 +639,13 @@ AcpiExPrepFieldValue (
|
||||
* preserving the current type of that NamedObj.
|
||||
*/
|
||||
Status = AcpiNsAttachObject (Info->FieldNode, ObjDesc,
|
||||
AcpiNsGetType (Info->FieldNode));
|
||||
AcpiNsGetType (Info->FieldNode));
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_BFIELD, "Set NamedObj %p [%4.4s], ObjDesc %p\n",
|
||||
Info->FieldNode, AcpiUtGetNodeName (Info->FieldNode), ObjDesc));
|
||||
Info->FieldNode, AcpiUtGetNodeName (Info->FieldNode), ObjDesc));
|
||||
|
||||
/* Remove local reference to the object */
|
||||
|
||||
AcpiUtRemoveReference (ObjDesc);
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,121 +1,45 @@
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* Module Name: exregion - ACPI default OpRegion (address space) handlers
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
* 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.
|
||||
*
|
||||
* 2.1. This is your license from Intel Corp. under its intellectual property
|
||||
* rights. You may have additional license terms from the party that provided
|
||||
* you this software, covering your right to use that party's intellectual
|
||||
* property rights.
|
||||
* 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.
|
||||
*
|
||||
* 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
|
||||
* copy of the source code appearing in this file ("Covered Code") an
|
||||
* irrevocable, perpetual, worldwide license under Intel's copyrights in the
|
||||
* base code distributed originally by Intel ("Original Intel Code") to copy,
|
||||
* make derivatives, distribute, use and display any portion of the Covered
|
||||
* Code in any form, with the right to sublicense such rights; and
|
||||
*
|
||||
* 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
|
||||
* license (with the right to sublicense), under only those claims of Intel
|
||||
* patents that are infringed by the Original Intel Code, to make, use, sell,
|
||||
* offer to sell, and import the Covered Code and derivative works thereof
|
||||
* solely to the minimum extent necessary to exercise the above copyright
|
||||
* license, and in no event shall the patent license extend to any additions
|
||||
* to or modifications of the Original Intel Code. No other license or right
|
||||
* is granted directly or by implication, estoppel or otherwise;
|
||||
*
|
||||
* The above copyright and patent license is granted only if the following
|
||||
* conditions are met:
|
||||
*
|
||||
* 3. Conditions
|
||||
*
|
||||
* 3.1. Redistribution of Source with Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification with rights to further distribute source must include
|
||||
* the above Copyright Notice, the above License, this list of Conditions,
|
||||
* and the following Disclaimer and Export Compliance provision. In addition,
|
||||
* Licensee must cause all Covered Code to which Licensee contributes to
|
||||
* contain a file documenting the changes Licensee made to create that Covered
|
||||
* Code and the date of any change. Licensee must include in that file the
|
||||
* documentation of any changes made by any predecessor Licensee. Licensee
|
||||
* must include a prominent statement that the modification is derived,
|
||||
* directly or indirectly, from Original Intel Code.
|
||||
*
|
||||
* 3.2. Redistribution of Source with no Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification without rights to further distribute source must
|
||||
* include the following Disclaimer and Export Compliance provision in the
|
||||
* documentation and/or other materials provided with distribution. In
|
||||
* addition, Licensee may not authorize further sublicense of source of any
|
||||
* portion of the Covered Code, and must include terms to the effect that the
|
||||
* license from Licensee to its licensee is limited to the intellectual
|
||||
* property embodied in the software Licensee provides to its licensee, and
|
||||
* not to intellectual property embodied in modifications its licensee may
|
||||
* make.
|
||||
*
|
||||
* 3.3. Redistribution of Executable. Redistribution in executable form of any
|
||||
* substantial portion of the Covered Code or modification must reproduce the
|
||||
* above Copyright Notice, and the following Disclaimer and Export Compliance
|
||||
* provision in the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3.4. Intel retains all right, title, and interest in and to the Original
|
||||
* Intel Code.
|
||||
*
|
||||
* 3.5. Neither the name Intel nor any other trademark owned or controlled by
|
||||
* Intel shall be used in advertising or otherwise to promote the sale, use or
|
||||
* other dealings in products derived from or relating to the Covered Code
|
||||
* without prior written authorization from Intel.
|
||||
*
|
||||
* 4. Disclaimer and Export Compliance
|
||||
*
|
||||
* 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
|
||||
* HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
|
||||
* IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
|
||||
* INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
|
||||
* UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
|
||||
* PARTICULAR PURPOSE.
|
||||
*
|
||||
* 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
|
||||
* OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
|
||||
* COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
|
||||
* SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
|
||||
* CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
|
||||
* HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
|
||||
* SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
|
||||
* LIMITED REMEDY.
|
||||
*
|
||||
* 4.3. Licensee shall not export, either directly or indirectly, any of this
|
||||
* software or system incorporating such software without first obtaining any
|
||||
* required license or other approval from the U. S. Department of Commerce or
|
||||
* any other agency or department of the United States Government. In the
|
||||
* event Licensee exports any such software from the United States or
|
||||
* re-exports any such software from a foreign destination, Licensee shall
|
||||
* ensure that the distribution and export/re-export of the software is in
|
||||
* compliance with all laws, regulations, orders, or other restrictions of the
|
||||
* U.S. Export Administration Regulations. Licensee agrees that neither it nor
|
||||
* any of its subsidiaries will export/re-export any technical data, process,
|
||||
* software, or service, directly or indirectly, to any country for which the
|
||||
* United States government or any agency thereof requires an export license,
|
||||
* other governmental approval, or letter of assurance, without first obtaining
|
||||
* such license, approval or letter.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
|
||||
#define __EXREGION_C__
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#include "acpi.h"
|
||||
#include "accommon.h"
|
||||
@@ -172,22 +96,27 @@ AcpiExSystemMemorySpaceHandler (
|
||||
switch (BitWidth)
|
||||
{
|
||||
case 8:
|
||||
|
||||
Length = 1;
|
||||
break;
|
||||
|
||||
case 16:
|
||||
|
||||
Length = 2;
|
||||
break;
|
||||
|
||||
case 32:
|
||||
|
||||
Length = 4;
|
||||
break;
|
||||
|
||||
case 64:
|
||||
|
||||
Length = 8;
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
ACPI_ERROR ((AE_INFO, "Invalid SystemMemory width %u",
|
||||
BitWidth));
|
||||
return_ACPI_STATUS (AE_AML_OPERAND_VALUE);
|
||||
@@ -292,7 +221,7 @@ AcpiExSystemMemorySpaceHandler (
|
||||
* Perform the memory read or write
|
||||
*
|
||||
* Note: For machines that do not support non-aligned transfers, the target
|
||||
* address was checked for alignment above. We do not attempt to break the
|
||||
* address was checked for alignment above. We do not attempt to break the
|
||||
* transfer up into smaller (byte-size) chunks because the AML specifically
|
||||
* asked for a transfer width that the hardware may require.
|
||||
*/
|
||||
@@ -304,23 +233,29 @@ AcpiExSystemMemorySpaceHandler (
|
||||
switch (BitWidth)
|
||||
{
|
||||
case 8:
|
||||
|
||||
*Value = (UINT64) ACPI_GET8 (LogicalAddrPtr);
|
||||
break;
|
||||
|
||||
case 16:
|
||||
|
||||
*Value = (UINT64) ACPI_GET16 (LogicalAddrPtr);
|
||||
break;
|
||||
|
||||
case 32:
|
||||
|
||||
*Value = (UINT64) ACPI_GET32 (LogicalAddrPtr);
|
||||
break;
|
||||
|
||||
case 64:
|
||||
|
||||
*Value = (UINT64) ACPI_GET64 (LogicalAddrPtr);
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
/* BitWidth was already validated */
|
||||
|
||||
break;
|
||||
}
|
||||
break;
|
||||
@@ -330,28 +265,35 @@ AcpiExSystemMemorySpaceHandler (
|
||||
switch (BitWidth)
|
||||
{
|
||||
case 8:
|
||||
ACPI_SET8 (LogicalAddrPtr) = (UINT8) *Value;
|
||||
|
||||
ACPI_SET8 (LogicalAddrPtr, *Value);
|
||||
break;
|
||||
|
||||
case 16:
|
||||
ACPI_SET16 (LogicalAddrPtr) = (UINT16) *Value;
|
||||
|
||||
ACPI_SET16 (LogicalAddrPtr, *Value);
|
||||
break;
|
||||
|
||||
case 32:
|
||||
ACPI_SET32 ( LogicalAddrPtr) = (UINT32) *Value;
|
||||
|
||||
ACPI_SET32 (LogicalAddrPtr, *Value);
|
||||
break;
|
||||
|
||||
case 64:
|
||||
ACPI_SET64 (LogicalAddrPtr) = (UINT64) *Value;
|
||||
|
||||
ACPI_SET64 (LogicalAddrPtr, *Value);
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
/* BitWidth was already validated */
|
||||
|
||||
break;
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
Status = AE_BAD_PARAMETER;
|
||||
break;
|
||||
}
|
||||
@@ -416,6 +358,7 @@ AcpiExSystemIoSpaceHandler (
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
Status = AE_BAD_PARAMETER;
|
||||
break;
|
||||
}
|
||||
@@ -633,5 +576,3 @@ AcpiExDataTableSpaceHandler (
|
||||
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,120 +1,45 @@
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* Module Name: exresnte - AML Interpreter object resolution
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
* 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.
|
||||
*
|
||||
* 2.1. This is your license from Intel Corp. under its intellectual property
|
||||
* rights. You may have additional license terms from the party that provided
|
||||
* you this software, covering your right to use that party's intellectual
|
||||
* property rights.
|
||||
* 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.
|
||||
*
|
||||
* 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
|
||||
* copy of the source code appearing in this file ("Covered Code") an
|
||||
* irrevocable, perpetual, worldwide license under Intel's copyrights in the
|
||||
* base code distributed originally by Intel ("Original Intel Code") to copy,
|
||||
* make derivatives, distribute, use and display any portion of the Covered
|
||||
* Code in any form, with the right to sublicense such rights; and
|
||||
*
|
||||
* 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
|
||||
* license (with the right to sublicense), under only those claims of Intel
|
||||
* patents that are infringed by the Original Intel Code, to make, use, sell,
|
||||
* offer to sell, and import the Covered Code and derivative works thereof
|
||||
* solely to the minimum extent necessary to exercise the above copyright
|
||||
* license, and in no event shall the patent license extend to any additions
|
||||
* to or modifications of the Original Intel Code. No other license or right
|
||||
* is granted directly or by implication, estoppel or otherwise;
|
||||
*
|
||||
* The above copyright and patent license is granted only if the following
|
||||
* conditions are met:
|
||||
*
|
||||
* 3. Conditions
|
||||
*
|
||||
* 3.1. Redistribution of Source with Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification with rights to further distribute source must include
|
||||
* the above Copyright Notice, the above License, this list of Conditions,
|
||||
* and the following Disclaimer and Export Compliance provision. In addition,
|
||||
* Licensee must cause all Covered Code to which Licensee contributes to
|
||||
* contain a file documenting the changes Licensee made to create that Covered
|
||||
* Code and the date of any change. Licensee must include in that file the
|
||||
* documentation of any changes made by any predecessor Licensee. Licensee
|
||||
* must include a prominent statement that the modification is derived,
|
||||
* directly or indirectly, from Original Intel Code.
|
||||
*
|
||||
* 3.2. Redistribution of Source with no Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification without rights to further distribute source must
|
||||
* include the following Disclaimer and Export Compliance provision in the
|
||||
* documentation and/or other materials provided with distribution. In
|
||||
* addition, Licensee may not authorize further sublicense of source of any
|
||||
* portion of the Covered Code, and must include terms to the effect that the
|
||||
* license from Licensee to its licensee is limited to the intellectual
|
||||
* property embodied in the software Licensee provides to its licensee, and
|
||||
* not to intellectual property embodied in modifications its licensee may
|
||||
* make.
|
||||
*
|
||||
* 3.3. Redistribution of Executable. Redistribution in executable form of any
|
||||
* substantial portion of the Covered Code or modification must reproduce the
|
||||
* above Copyright Notice, and the following Disclaimer and Export Compliance
|
||||
* provision in the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3.4. Intel retains all right, title, and interest in and to the Original
|
||||
* Intel Code.
|
||||
*
|
||||
* 3.5. Neither the name Intel nor any other trademark owned or controlled by
|
||||
* Intel shall be used in advertising or otherwise to promote the sale, use or
|
||||
* other dealings in products derived from or relating to the Covered Code
|
||||
* without prior written authorization from Intel.
|
||||
*
|
||||
* 4. Disclaimer and Export Compliance
|
||||
*
|
||||
* 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
|
||||
* HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
|
||||
* IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
|
||||
* INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
|
||||
* UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
|
||||
* PARTICULAR PURPOSE.
|
||||
*
|
||||
* 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
|
||||
* OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
|
||||
* COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
|
||||
* SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
|
||||
* CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
|
||||
* HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
|
||||
* SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
|
||||
* LIMITED REMEDY.
|
||||
*
|
||||
* 4.3. Licensee shall not export, either directly or indirectly, any of this
|
||||
* software or system incorporating such software without first obtaining any
|
||||
* required license or other approval from the U. S. Department of Commerce or
|
||||
* any other agency or department of the United States Government. In the
|
||||
* event Licensee exports any such software from the United States or
|
||||
* re-exports any such software from a foreign destination, Licensee shall
|
||||
* ensure that the distribution and export/re-export of the software is in
|
||||
* compliance with all laws, regulations, orders, or other restrictions of the
|
||||
* U.S. Export Administration Regulations. Licensee agrees that neither it nor
|
||||
* any of its subsidiaries will export/re-export any technical data, process,
|
||||
* software, or service, directly or indirectly, to any country for which the
|
||||
* United States government or any agency thereof requires an export license,
|
||||
* other governmental approval, or letter of assurance, without first obtaining
|
||||
* such license, approval or letter.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
#define __EXRESNTE_C__
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#include "acpi.h"
|
||||
#include "accommon.h"
|
||||
@@ -134,8 +59,8 @@
|
||||
* PARAMETERS: ObjectPtr - Pointer to a location that contains
|
||||
* a pointer to a NS node, and will receive a
|
||||
* pointer to the resolved object.
|
||||
* WalkState - Current state. Valid only if executing AML
|
||||
* code. NULL if simply resolving an object
|
||||
* WalkState - Current state. Valid only if executing AML
|
||||
* code. NULL if simply resolving an object
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
@@ -143,7 +68,7 @@
|
||||
*
|
||||
* Note: for some of the data types, the pointer attached to the Node
|
||||
* can be either a pointer to an actual internal object or a pointer into the
|
||||
* AML stream itself. These types are currently:
|
||||
* AML stream itself. These types are currently:
|
||||
*
|
||||
* ACPI_TYPE_INTEGER
|
||||
* ACPI_TYPE_STRING
|
||||
@@ -170,7 +95,7 @@ AcpiExResolveNodeToValue (
|
||||
|
||||
|
||||
/*
|
||||
* The stack pointer points to a ACPI_NAMESPACE_NODE (Node). Get the
|
||||
* The stack pointer points to a ACPI_NAMESPACE_NODE (Node). Get the
|
||||
* object that is attached to the Node.
|
||||
*/
|
||||
Node = *ObjectPtr;
|
||||
@@ -207,8 +132,8 @@ AcpiExResolveNodeToValue (
|
||||
|
||||
if (!SourceDesc)
|
||||
{
|
||||
ACPI_ERROR ((AE_INFO, "No object attached to node %p",
|
||||
Node));
|
||||
ACPI_ERROR ((AE_INFO, "No object attached to node [%4.4s] %p",
|
||||
Node->Name.Ascii, Node));
|
||||
return_ACPI_STATUS (AE_AML_NO_OPERAND);
|
||||
}
|
||||
|
||||
@@ -237,7 +162,6 @@ AcpiExResolveNodeToValue (
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case ACPI_TYPE_BUFFER:
|
||||
|
||||
if (SourceDesc->Common.Type != ACPI_TYPE_BUFFER)
|
||||
@@ -257,7 +181,6 @@ AcpiExResolveNodeToValue (
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case ACPI_TYPE_STRING:
|
||||
|
||||
if (SourceDesc->Common.Type != ACPI_TYPE_STRING)
|
||||
@@ -273,7 +196,6 @@ AcpiExResolveNodeToValue (
|
||||
AcpiUtAddReference (ObjDesc);
|
||||
break;
|
||||
|
||||
|
||||
case ACPI_TYPE_INTEGER:
|
||||
|
||||
if (SourceDesc->Common.Type != ACPI_TYPE_INTEGER)
|
||||
@@ -289,7 +211,6 @@ AcpiExResolveNodeToValue (
|
||||
AcpiUtAddReference (ObjDesc);
|
||||
break;
|
||||
|
||||
|
||||
case ACPI_TYPE_BUFFER_FIELD:
|
||||
case ACPI_TYPE_LOCAL_REGION_FIELD:
|
||||
case ACPI_TYPE_LOCAL_BANK_FIELD:
|
||||
@@ -325,7 +246,6 @@ AcpiExResolveNodeToValue (
|
||||
|
||||
return_ACPI_STATUS (AE_AML_OPERAND_TYPE); /* Cannot be AE_TYPE */
|
||||
|
||||
|
||||
case ACPI_TYPE_LOCAL_REFERENCE:
|
||||
|
||||
switch (SourceDesc->Reference.Class)
|
||||
@@ -341,6 +261,7 @@ AcpiExResolveNodeToValue (
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
/* No named references are allowed here */
|
||||
|
||||
ACPI_ERROR ((AE_INFO,
|
||||
@@ -351,7 +272,6 @@ AcpiExResolveNodeToValue (
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
|
||||
/* Default case is for unknown types */
|
||||
@@ -370,5 +290,3 @@ AcpiExResolveNodeToValue (
|
||||
*ObjectPtr = (void *) ObjDesc;
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,120 +1,45 @@
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* Module Name: exresolv - AML Interpreter object resolution
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
* 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.
|
||||
*
|
||||
* 2.1. This is your license from Intel Corp. under its intellectual property
|
||||
* rights. You may have additional license terms from the party that provided
|
||||
* you this software, covering your right to use that party's intellectual
|
||||
* property rights.
|
||||
* 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.
|
||||
*
|
||||
* 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
|
||||
* copy of the source code appearing in this file ("Covered Code") an
|
||||
* irrevocable, perpetual, worldwide license under Intel's copyrights in the
|
||||
* base code distributed originally by Intel ("Original Intel Code") to copy,
|
||||
* make derivatives, distribute, use and display any portion of the Covered
|
||||
* Code in any form, with the right to sublicense such rights; and
|
||||
*
|
||||
* 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
|
||||
* license (with the right to sublicense), under only those claims of Intel
|
||||
* patents that are infringed by the Original Intel Code, to make, use, sell,
|
||||
* offer to sell, and import the Covered Code and derivative works thereof
|
||||
* solely to the minimum extent necessary to exercise the above copyright
|
||||
* license, and in no event shall the patent license extend to any additions
|
||||
* to or modifications of the Original Intel Code. No other license or right
|
||||
* is granted directly or by implication, estoppel or otherwise;
|
||||
*
|
||||
* The above copyright and patent license is granted only if the following
|
||||
* conditions are met:
|
||||
*
|
||||
* 3. Conditions
|
||||
*
|
||||
* 3.1. Redistribution of Source with Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification with rights to further distribute source must include
|
||||
* the above Copyright Notice, the above License, this list of Conditions,
|
||||
* and the following Disclaimer and Export Compliance provision. In addition,
|
||||
* Licensee must cause all Covered Code to which Licensee contributes to
|
||||
* contain a file documenting the changes Licensee made to create that Covered
|
||||
* Code and the date of any change. Licensee must include in that file the
|
||||
* documentation of any changes made by any predecessor Licensee. Licensee
|
||||
* must include a prominent statement that the modification is derived,
|
||||
* directly or indirectly, from Original Intel Code.
|
||||
*
|
||||
* 3.2. Redistribution of Source with no Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification without rights to further distribute source must
|
||||
* include the following Disclaimer and Export Compliance provision in the
|
||||
* documentation and/or other materials provided with distribution. In
|
||||
* addition, Licensee may not authorize further sublicense of source of any
|
||||
* portion of the Covered Code, and must include terms to the effect that the
|
||||
* license from Licensee to its licensee is limited to the intellectual
|
||||
* property embodied in the software Licensee provides to its licensee, and
|
||||
* not to intellectual property embodied in modifications its licensee may
|
||||
* make.
|
||||
*
|
||||
* 3.3. Redistribution of Executable. Redistribution in executable form of any
|
||||
* substantial portion of the Covered Code or modification must reproduce the
|
||||
* above Copyright Notice, and the following Disclaimer and Export Compliance
|
||||
* provision in the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3.4. Intel retains all right, title, and interest in and to the Original
|
||||
* Intel Code.
|
||||
*
|
||||
* 3.5. Neither the name Intel nor any other trademark owned or controlled by
|
||||
* Intel shall be used in advertising or otherwise to promote the sale, use or
|
||||
* other dealings in products derived from or relating to the Covered Code
|
||||
* without prior written authorization from Intel.
|
||||
*
|
||||
* 4. Disclaimer and Export Compliance
|
||||
*
|
||||
* 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
|
||||
* HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
|
||||
* IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
|
||||
* INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
|
||||
* UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
|
||||
* PARTICULAR PURPOSE.
|
||||
*
|
||||
* 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
|
||||
* OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
|
||||
* COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
|
||||
* SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
|
||||
* CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
|
||||
* HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
|
||||
* SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
|
||||
* LIMITED REMEDY.
|
||||
*
|
||||
* 4.3. Licensee shall not export, either directly or indirectly, any of this
|
||||
* software or system incorporating such software without first obtaining any
|
||||
* required license or other approval from the U. S. Department of Commerce or
|
||||
* any other agency or department of the United States Government. In the
|
||||
* event Licensee exports any such software from the United States or
|
||||
* re-exports any such software from a foreign destination, Licensee shall
|
||||
* ensure that the distribution and export/re-export of the software is in
|
||||
* compliance with all laws, regulations, orders, or other restrictions of the
|
||||
* U.S. Export Administration Regulations. Licensee agrees that neither it nor
|
||||
* any of its subsidiaries will export/re-export any technical data, process,
|
||||
* software, or service, directly or indirectly, to any country for which the
|
||||
* United States government or any agency thereof requires an export license,
|
||||
* other governmental approval, or letter of assurance, without first obtaining
|
||||
* such license, approval or letter.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
#define __EXRESOLV_C__
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#include "acpi.h"
|
||||
#include "accommon.h"
|
||||
@@ -237,7 +162,7 @@ AcpiExResolveObjectToValue (
|
||||
|
||||
StackDesc = *StackPtr;
|
||||
|
||||
/* This is an ACPI_OPERAND_OBJECT */
|
||||
/* This is an object of type ACPI_OPERAND_OBJECT */
|
||||
|
||||
switch (StackDesc->Common.Type)
|
||||
{
|
||||
@@ -249,7 +174,6 @@ AcpiExResolveObjectToValue (
|
||||
{
|
||||
case ACPI_REFCLASS_LOCAL:
|
||||
case ACPI_REFCLASS_ARG:
|
||||
|
||||
/*
|
||||
* Get the local from the method's state info
|
||||
* Note: this increments the local's object reference count
|
||||
@@ -272,7 +196,6 @@ AcpiExResolveObjectToValue (
|
||||
*StackPtr = ObjDesc;
|
||||
break;
|
||||
|
||||
|
||||
case ACPI_REFCLASS_INDEX:
|
||||
|
||||
switch (StackDesc->Reference.TargetType)
|
||||
@@ -282,7 +205,6 @@ AcpiExResolveObjectToValue (
|
||||
/* Just return - do not dereference */
|
||||
break;
|
||||
|
||||
|
||||
case ACPI_TYPE_PACKAGE:
|
||||
|
||||
/* If method call or CopyObject - do not dereference */
|
||||
@@ -320,7 +242,6 @@ AcpiExResolveObjectToValue (
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
|
||||
/* Invalid reference object */
|
||||
@@ -333,7 +254,6 @@ AcpiExResolveObjectToValue (
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case ACPI_REFCLASS_REFOF:
|
||||
case ACPI_REFCLASS_DEBUG:
|
||||
case ACPI_REFCLASS_TABLE:
|
||||
@@ -373,19 +293,16 @@ AcpiExResolveObjectToValue (
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case ACPI_TYPE_BUFFER:
|
||||
|
||||
Status = AcpiDsGetBufferArguments (StackDesc);
|
||||
break;
|
||||
|
||||
|
||||
case ACPI_TYPE_PACKAGE:
|
||||
|
||||
Status = AcpiDsGetPackageArguments (StackDesc);
|
||||
break;
|
||||
|
||||
|
||||
case ACPI_TYPE_BUFFER_FIELD:
|
||||
case ACPI_TYPE_LOCAL_REGION_FIELD:
|
||||
case ACPI_TYPE_LOCAL_BANK_FIELD:
|
||||
@@ -403,6 +320,7 @@ AcpiExResolveObjectToValue (
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -421,7 +339,7 @@ AcpiExResolveObjectToValue (
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Return the base object and type. Traverse a reference list if
|
||||
* DESCRIPTION: Return the base object and type. Traverse a reference list if
|
||||
* necessary to get to the base object.
|
||||
*
|
||||
******************************************************************************/
|
||||
@@ -447,10 +365,12 @@ AcpiExResolveMultiple (
|
||||
switch (ACPI_GET_DESCRIPTOR_TYPE (ObjDesc))
|
||||
{
|
||||
case ACPI_DESC_TYPE_OPERAND:
|
||||
|
||||
Type = ObjDesc->Common.Type;
|
||||
break;
|
||||
|
||||
case ACPI_DESC_TYPE_NAMED:
|
||||
|
||||
Type = ((ACPI_NAMESPACE_NODE *) ObjDesc)->Type;
|
||||
ObjDesc = AcpiNsGetAttachedObject ((ACPI_NAMESPACE_NODE *) ObjDesc);
|
||||
|
||||
@@ -527,7 +447,6 @@ AcpiExResolveMultiple (
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case ACPI_REFCLASS_INDEX:
|
||||
|
||||
/* Get the type of this reference (index into another object) */
|
||||
@@ -555,13 +474,11 @@ AcpiExResolveMultiple (
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case ACPI_REFCLASS_TABLE:
|
||||
|
||||
Type = ACPI_TYPE_DDB_HANDLE;
|
||||
goto Exit;
|
||||
|
||||
|
||||
case ACPI_REFCLASS_LOCAL:
|
||||
case ACPI_REFCLASS_ARG:
|
||||
|
||||
@@ -593,7 +510,6 @@ AcpiExResolveMultiple (
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case ACPI_REFCLASS_DEBUG:
|
||||
|
||||
/* The Debug Object is of type "DebugObject" */
|
||||
@@ -601,7 +517,6 @@ AcpiExResolveMultiple (
|
||||
Type = ACPI_TYPE_DEBUG_OBJECT;
|
||||
goto Exit;
|
||||
|
||||
|
||||
default:
|
||||
|
||||
ACPI_ERROR ((AE_INFO,
|
||||
@@ -637,7 +552,9 @@ Exit:
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
/* No change to Type required */
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -648,5 +565,3 @@ Exit:
|
||||
}
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,120 +1,45 @@
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* Module Name: exresop - AML Interpreter operand/object resolution
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
* 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.
|
||||
*
|
||||
* 2.1. This is your license from Intel Corp. under its intellectual property
|
||||
* rights. You may have additional license terms from the party that provided
|
||||
* you this software, covering your right to use that party's intellectual
|
||||
* property rights.
|
||||
* 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.
|
||||
*
|
||||
* 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
|
||||
* copy of the source code appearing in this file ("Covered Code") an
|
||||
* irrevocable, perpetual, worldwide license under Intel's copyrights in the
|
||||
* base code distributed originally by Intel ("Original Intel Code") to copy,
|
||||
* make derivatives, distribute, use and display any portion of the Covered
|
||||
* Code in any form, with the right to sublicense such rights; and
|
||||
*
|
||||
* 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
|
||||
* license (with the right to sublicense), under only those claims of Intel
|
||||
* patents that are infringed by the Original Intel Code, to make, use, sell,
|
||||
* offer to sell, and import the Covered Code and derivative works thereof
|
||||
* solely to the minimum extent necessary to exercise the above copyright
|
||||
* license, and in no event shall the patent license extend to any additions
|
||||
* to or modifications of the Original Intel Code. No other license or right
|
||||
* is granted directly or by implication, estoppel or otherwise;
|
||||
*
|
||||
* The above copyright and patent license is granted only if the following
|
||||
* conditions are met:
|
||||
*
|
||||
* 3. Conditions
|
||||
*
|
||||
* 3.1. Redistribution of Source with Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification with rights to further distribute source must include
|
||||
* the above Copyright Notice, the above License, this list of Conditions,
|
||||
* and the following Disclaimer and Export Compliance provision. In addition,
|
||||
* Licensee must cause all Covered Code to which Licensee contributes to
|
||||
* contain a file documenting the changes Licensee made to create that Covered
|
||||
* Code and the date of any change. Licensee must include in that file the
|
||||
* documentation of any changes made by any predecessor Licensee. Licensee
|
||||
* must include a prominent statement that the modification is derived,
|
||||
* directly or indirectly, from Original Intel Code.
|
||||
*
|
||||
* 3.2. Redistribution of Source with no Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification without rights to further distribute source must
|
||||
* include the following Disclaimer and Export Compliance provision in the
|
||||
* documentation and/or other materials provided with distribution. In
|
||||
* addition, Licensee may not authorize further sublicense of source of any
|
||||
* portion of the Covered Code, and must include terms to the effect that the
|
||||
* license from Licensee to its licensee is limited to the intellectual
|
||||
* property embodied in the software Licensee provides to its licensee, and
|
||||
* not to intellectual property embodied in modifications its licensee may
|
||||
* make.
|
||||
*
|
||||
* 3.3. Redistribution of Executable. Redistribution in executable form of any
|
||||
* substantial portion of the Covered Code or modification must reproduce the
|
||||
* above Copyright Notice, and the following Disclaimer and Export Compliance
|
||||
* provision in the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3.4. Intel retains all right, title, and interest in and to the Original
|
||||
* Intel Code.
|
||||
*
|
||||
* 3.5. Neither the name Intel nor any other trademark owned or controlled by
|
||||
* Intel shall be used in advertising or otherwise to promote the sale, use or
|
||||
* other dealings in products derived from or relating to the Covered Code
|
||||
* without prior written authorization from Intel.
|
||||
*
|
||||
* 4. Disclaimer and Export Compliance
|
||||
*
|
||||
* 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
|
||||
* HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
|
||||
* IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
|
||||
* INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
|
||||
* UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
|
||||
* PARTICULAR PURPOSE.
|
||||
*
|
||||
* 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
|
||||
* OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
|
||||
* COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
|
||||
* SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
|
||||
* CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
|
||||
* HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
|
||||
* SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
|
||||
* LIMITED REMEDY.
|
||||
*
|
||||
* 4.3. Licensee shall not export, either directly or indirectly, any of this
|
||||
* software or system incorporating such software without first obtaining any
|
||||
* required license or other approval from the U. S. Department of Commerce or
|
||||
* any other agency or department of the United States Government. In the
|
||||
* event Licensee exports any such software from the United States or
|
||||
* re-exports any such software from a foreign destination, Licensee shall
|
||||
* ensure that the distribution and export/re-export of the software is in
|
||||
* compliance with all laws, regulations, orders, or other restrictions of the
|
||||
* U.S. Export Administration Regulations. Licensee agrees that neither it nor
|
||||
* any of its subsidiaries will export/re-export any technical data, process,
|
||||
* software, or service, directly or indirectly, to any country for which the
|
||||
* United States government or any agency thereof requires an export license,
|
||||
* other governmental approval, or letter of assurance, without first obtaining
|
||||
* such license, approval or letter.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
#define __EXRESOP_C__
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#include "acpi.h"
|
||||
#include "accommon.h"
|
||||
@@ -170,7 +95,7 @@ AcpiExCheckObjectType (
|
||||
{
|
||||
/*
|
||||
* Allow the AML "Constant" opcodes (Zero, One, etc.) to be reference
|
||||
* objects and thus allow them to be targets. (As per the ACPI
|
||||
* objects and thus allow them to be targets. (As per the ACPI
|
||||
* specification, a store to a constant is a noop.)
|
||||
*/
|
||||
if ((ThisType == ACPI_TYPE_INTEGER) &&
|
||||
@@ -297,7 +222,6 @@ AcpiExResolveOperands (
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case ACPI_DESC_TYPE_OPERAND:
|
||||
|
||||
/* ACPI internal object */
|
||||
@@ -350,7 +274,6 @@ AcpiExResolveOperands (
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
|
||||
/* Invalid descriptor */
|
||||
@@ -397,7 +320,6 @@ AcpiExResolveOperands (
|
||||
case ARGI_TARGETREF: /* Allows implicit conversion rules before store */
|
||||
case ARGI_FIXED_TARGET: /* No implicit conversion before store to target */
|
||||
case ARGI_SIMPLE_TARGET: /* Name, Local, or Arg - no implicit conversion */
|
||||
|
||||
/*
|
||||
* Need an operand of type ACPI_TYPE_LOCAL_REFERENCE
|
||||
* A Namespace Node is OK as-is
|
||||
@@ -415,9 +337,7 @@ AcpiExResolveOperands (
|
||||
}
|
||||
goto NextOperand;
|
||||
|
||||
|
||||
case ARGI_DATAREFOBJ: /* Store operator only */
|
||||
|
||||
/*
|
||||
* We don't want to resolve IndexOp reference objects during
|
||||
* a store because this would be an implicit DeRefOf operation.
|
||||
@@ -433,7 +353,9 @@ AcpiExResolveOperands (
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
/* All cases covered above */
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -526,9 +448,7 @@ AcpiExResolveOperands (
|
||||
}
|
||||
goto NextOperand;
|
||||
|
||||
|
||||
case ARGI_BUFFER:
|
||||
|
||||
/*
|
||||
* Need an operand of type ACPI_TYPE_BUFFER,
|
||||
* But we can implicitly convert from a STRING or INTEGER
|
||||
@@ -555,9 +475,7 @@ AcpiExResolveOperands (
|
||||
}
|
||||
goto NextOperand;
|
||||
|
||||
|
||||
case ARGI_STRING:
|
||||
|
||||
/*
|
||||
* Need an operand of type ACPI_TYPE_STRING,
|
||||
* But we can implicitly convert from a BUFFER or INTEGER
|
||||
@@ -585,7 +503,6 @@ AcpiExResolveOperands (
|
||||
}
|
||||
goto NextOperand;
|
||||
|
||||
|
||||
case ARGI_COMPUTEDATA:
|
||||
|
||||
/* Need an operand of type INTEGER, STRING or BUFFER */
|
||||
@@ -608,7 +525,6 @@ AcpiExResolveOperands (
|
||||
}
|
||||
goto NextOperand;
|
||||
|
||||
|
||||
case ARGI_BUFFER_OR_STRING:
|
||||
|
||||
/* Need an operand of type STRING or BUFFER */
|
||||
@@ -646,7 +562,6 @@ AcpiExResolveOperands (
|
||||
}
|
||||
goto NextOperand;
|
||||
|
||||
|
||||
case ARGI_DATAOBJECT:
|
||||
/*
|
||||
* ARGI_DATAOBJECT is only used by the SizeOf operator.
|
||||
@@ -666,6 +581,7 @@ AcpiExResolveOperands (
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
ACPI_ERROR ((AE_INFO,
|
||||
"Needed [Buffer/String/Package/Reference], found [%s] %p",
|
||||
AcpiUtGetObjectTypeName (ObjDesc), ObjDesc));
|
||||
@@ -674,7 +590,6 @@ AcpiExResolveOperands (
|
||||
}
|
||||
goto NextOperand;
|
||||
|
||||
|
||||
case ARGI_COMPLEXOBJ:
|
||||
|
||||
/* Need a buffer or package or (ACPI 2.0) String */
|
||||
@@ -689,6 +604,7 @@ AcpiExResolveOperands (
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
ACPI_ERROR ((AE_INFO,
|
||||
"Needed [Buffer/String/Package], found [%s] %p",
|
||||
AcpiUtGetObjectTypeName (ObjDesc), ObjDesc));
|
||||
@@ -697,7 +613,6 @@ AcpiExResolveOperands (
|
||||
}
|
||||
goto NextOperand;
|
||||
|
||||
|
||||
case ARGI_REGION_OR_BUFFER: /* Used by Load() only */
|
||||
|
||||
/* Need an operand of type REGION or a BUFFER (which could be a resolved region field) */
|
||||
@@ -711,6 +626,7 @@ AcpiExResolveOperands (
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
ACPI_ERROR ((AE_INFO,
|
||||
"Needed [Region/Buffer], found [%s] %p",
|
||||
AcpiUtGetObjectTypeName (ObjDesc), ObjDesc));
|
||||
@@ -719,7 +635,6 @@ AcpiExResolveOperands (
|
||||
}
|
||||
goto NextOperand;
|
||||
|
||||
|
||||
case ARGI_DATAREFOBJ:
|
||||
|
||||
/* Used by the Store() operator only */
|
||||
@@ -746,7 +661,7 @@ AcpiExResolveOperands (
|
||||
{
|
||||
/*
|
||||
* Enable original behavior of Store(), allowing any and all
|
||||
* objects as the source operand. The ACPI spec does not
|
||||
* objects as the source operand. The ACPI spec does not
|
||||
* allow this, however.
|
||||
*/
|
||||
break;
|
||||
@@ -767,7 +682,6 @@ AcpiExResolveOperands (
|
||||
}
|
||||
goto NextOperand;
|
||||
|
||||
|
||||
default:
|
||||
|
||||
/* Unknown type */
|
||||
@@ -806,5 +720,3 @@ NextOperand:
|
||||
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -4,116 +4,42 @@
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
* 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.
|
||||
*
|
||||
* 2.1. This is your license from Intel Corp. under its intellectual property
|
||||
* rights. You may have additional license terms from the party that provided
|
||||
* you this software, covering your right to use that party's intellectual
|
||||
* property rights.
|
||||
* 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.
|
||||
*
|
||||
* 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
|
||||
* copy of the source code appearing in this file ("Covered Code") an
|
||||
* irrevocable, perpetual, worldwide license under Intel's copyrights in the
|
||||
* base code distributed originally by Intel ("Original Intel Code") to copy,
|
||||
* make derivatives, distribute, use and display any portion of the Covered
|
||||
* Code in any form, with the right to sublicense such rights; and
|
||||
*
|
||||
* 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
|
||||
* license (with the right to sublicense), under only those claims of Intel
|
||||
* patents that are infringed by the Original Intel Code, to make, use, sell,
|
||||
* offer to sell, and import the Covered Code and derivative works thereof
|
||||
* solely to the minimum extent necessary to exercise the above copyright
|
||||
* license, and in no event shall the patent license extend to any additions
|
||||
* to or modifications of the Original Intel Code. No other license or right
|
||||
* is granted directly or by implication, estoppel or otherwise;
|
||||
*
|
||||
* The above copyright and patent license is granted only if the following
|
||||
* conditions are met:
|
||||
*
|
||||
* 3. Conditions
|
||||
*
|
||||
* 3.1. Redistribution of Source with Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification with rights to further distribute source must include
|
||||
* the above Copyright Notice, the above License, this list of Conditions,
|
||||
* and the following Disclaimer and Export Compliance provision. In addition,
|
||||
* Licensee must cause all Covered Code to which Licensee contributes to
|
||||
* contain a file documenting the changes Licensee made to create that Covered
|
||||
* Code and the date of any change. Licensee must include in that file the
|
||||
* documentation of any changes made by any predecessor Licensee. Licensee
|
||||
* must include a prominent statement that the modification is derived,
|
||||
* directly or indirectly, from Original Intel Code.
|
||||
*
|
||||
* 3.2. Redistribution of Source with no Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification without rights to further distribute source must
|
||||
* include the following Disclaimer and Export Compliance provision in the
|
||||
* documentation and/or other materials provided with distribution. In
|
||||
* addition, Licensee may not authorize further sublicense of source of any
|
||||
* portion of the Covered Code, and must include terms to the effect that the
|
||||
* license from Licensee to its licensee is limited to the intellectual
|
||||
* property embodied in the software Licensee provides to its licensee, and
|
||||
* not to intellectual property embodied in modifications its licensee may
|
||||
* make.
|
||||
*
|
||||
* 3.3. Redistribution of Executable. Redistribution in executable form of any
|
||||
* substantial portion of the Covered Code or modification must reproduce the
|
||||
* above Copyright Notice, and the following Disclaimer and Export Compliance
|
||||
* provision in the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3.4. Intel retains all right, title, and interest in and to the Original
|
||||
* Intel Code.
|
||||
*
|
||||
* 3.5. Neither the name Intel nor any other trademark owned or controlled by
|
||||
* Intel shall be used in advertising or otherwise to promote the sale, use or
|
||||
* other dealings in products derived from or relating to the Covered Code
|
||||
* without prior written authorization from Intel.
|
||||
*
|
||||
* 4. Disclaimer and Export Compliance
|
||||
*
|
||||
* 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
|
||||
* HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
|
||||
* IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
|
||||
* INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
|
||||
* UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
|
||||
* PARTICULAR PURPOSE.
|
||||
*
|
||||
* 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
|
||||
* OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
|
||||
* COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
|
||||
* SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
|
||||
* CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
|
||||
* HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
|
||||
* SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
|
||||
* LIMITED REMEDY.
|
||||
*
|
||||
* 4.3. Licensee shall not export, either directly or indirectly, any of this
|
||||
* software or system incorporating such software without first obtaining any
|
||||
* required license or other approval from the U. S. Department of Commerce or
|
||||
* any other agency or department of the United States Government. In the
|
||||
* event Licensee exports any such software from the United States or
|
||||
* re-exports any such software from a foreign destination, Licensee shall
|
||||
* ensure that the distribution and export/re-export of the software is in
|
||||
* compliance with all laws, regulations, orders, or other restrictions of the
|
||||
* U.S. Export Administration Regulations. Licensee agrees that neither it nor
|
||||
* any of its subsidiaries will export/re-export any technical data, process,
|
||||
* software, or service, directly or indirectly, to any country for which the
|
||||
* United States government or any agency thereof requires an export license,
|
||||
* other governmental approval, or letter of assurance, without first obtaining
|
||||
* such license, approval or letter.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
#define __EXSTORE_C__
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#include "acpi.h"
|
||||
#include "accommon.h"
|
||||
@@ -134,21 +60,27 @@ AcpiExStoreObjectToIndex (
|
||||
ACPI_OPERAND_OBJECT *DestDesc,
|
||||
ACPI_WALK_STATE *WalkState);
|
||||
|
||||
static ACPI_STATUS
|
||||
AcpiExStoreDirectToNode (
|
||||
ACPI_OPERAND_OBJECT *SourceDesc,
|
||||
ACPI_NAMESPACE_NODE *Node,
|
||||
ACPI_WALK_STATE *WalkState);
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiExStore
|
||||
*
|
||||
* PARAMETERS: *SourceDesc - Value to be stored
|
||||
* *DestDesc - Where to store it. Must be an NS node
|
||||
* or an ACPI_OPERAND_OBJECT of type
|
||||
* *DestDesc - Where to store it. Must be an NS node
|
||||
* or ACPI_OPERAND_OBJECT of type
|
||||
* Reference;
|
||||
* WalkState - Current walk state
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Store the value described by SourceDesc into the location
|
||||
* described by DestDesc. Called by various interpreter
|
||||
* described by DestDesc. Called by various interpreter
|
||||
* functions to store the result of an operation into
|
||||
* the destination operand -- not just simply the actual "Store"
|
||||
* ASL operator.
|
||||
@@ -196,6 +128,7 @@ AcpiExStore (
|
||||
switch (DestDesc->Common.Type)
|
||||
{
|
||||
case ACPI_TYPE_LOCAL_REFERENCE:
|
||||
|
||||
break;
|
||||
|
||||
case ACPI_TYPE_INTEGER:
|
||||
@@ -239,7 +172,6 @@ AcpiExStore (
|
||||
WalkState, ACPI_IMPLICIT_CONVERSION);
|
||||
break;
|
||||
|
||||
|
||||
case ACPI_REFCLASS_INDEX:
|
||||
|
||||
/* Storing to an Index (pointer into a packager or buffer) */
|
||||
@@ -247,7 +179,6 @@ AcpiExStore (
|
||||
Status = AcpiExStoreObjectToIndex (SourceDesc, RefDesc, WalkState);
|
||||
break;
|
||||
|
||||
|
||||
case ACPI_REFCLASS_LOCAL:
|
||||
case ACPI_REFCLASS_ARG:
|
||||
|
||||
@@ -257,9 +188,7 @@ AcpiExStore (
|
||||
RefDesc->Reference.Value, SourceDesc, WalkState);
|
||||
break;
|
||||
|
||||
|
||||
case ACPI_REFCLASS_DEBUG:
|
||||
|
||||
/*
|
||||
* Storing to the Debug object causes the value stored to be
|
||||
* displayed and otherwise has no effect -- see ACPI Specification
|
||||
@@ -271,7 +200,6 @@ AcpiExStore (
|
||||
ACPI_DEBUG_OBJECT (SourceDesc, 0, 0);
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
|
||||
ACPI_ERROR ((AE_INFO, "Unknown Reference Class 0x%2.2X",
|
||||
@@ -380,9 +308,7 @@ AcpiExStoreObjectToIndex (
|
||||
|
||||
break;
|
||||
|
||||
|
||||
case ACPI_TYPE_BUFFER_FIELD:
|
||||
|
||||
/*
|
||||
* Store into a Buffer or String (not actually a real BufferField)
|
||||
* at a location defined by an Index.
|
||||
@@ -440,7 +366,6 @@ AcpiExStoreObjectToIndex (
|
||||
ObjDesc->Buffer.Pointer[IndexDesc->Reference.Value] = Value;
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
ACPI_ERROR ((AE_INFO,
|
||||
"Target is not a Package or BufferField"));
|
||||
@@ -470,9 +395,13 @@ AcpiExStoreObjectToIndex (
|
||||
* with the input value.
|
||||
*
|
||||
* When storing into an object the data is converted to the
|
||||
* target object type then stored in the object. This means
|
||||
* target object type then stored in the object. This means
|
||||
* that the target object type (for an initialized target) will
|
||||
* not be changed by a store operation.
|
||||
* not be changed by a store operation. A CopyObject can change
|
||||
* the target type, however.
|
||||
*
|
||||
* The ImplicitConversion flag is set to NO/FALSE only when
|
||||
* storing to an ArgX -- as per the rules of the ACPI spec.
|
||||
*
|
||||
* Assumes parameters are already validated.
|
||||
*
|
||||
@@ -499,7 +428,7 @@ AcpiExStoreObjectToNode (
|
||||
TargetType = AcpiNsGetType (Node);
|
||||
TargetDesc = AcpiNsGetAttachedObject (Node);
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Storing %p(%s) into node %p(%s)\n",
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Storing %p (%s) to node %p (%s)\n",
|
||||
SourceDesc, AcpiUtGetObjectTypeName (SourceDesc),
|
||||
Node, AcpiUtGetTypeName (TargetType)));
|
||||
|
||||
@@ -513,51 +442,35 @@ AcpiExStoreObjectToNode (
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
/* If no implicit conversion, drop into the default case below */
|
||||
|
||||
if ((!ImplicitConversion) ||
|
||||
((WalkState->Opcode == AML_COPY_OP) &&
|
||||
(TargetType != ACPI_TYPE_LOCAL_REGION_FIELD) &&
|
||||
(TargetType != ACPI_TYPE_LOCAL_BANK_FIELD) &&
|
||||
(TargetType != ACPI_TYPE_LOCAL_INDEX_FIELD)))
|
||||
{
|
||||
/*
|
||||
* Force execution of default (no implicit conversion). Note:
|
||||
* CopyObject does not perform an implicit conversion, as per the ACPI
|
||||
* spec -- except in case of region/bank/index fields -- because these
|
||||
* objects must retain their original type permanently.
|
||||
*/
|
||||
TargetType = ACPI_TYPE_ANY;
|
||||
}
|
||||
|
||||
/* Do the actual store operation */
|
||||
|
||||
switch (TargetType)
|
||||
{
|
||||
case ACPI_TYPE_BUFFER_FIELD:
|
||||
case ACPI_TYPE_LOCAL_REGION_FIELD:
|
||||
case ACPI_TYPE_LOCAL_BANK_FIELD:
|
||||
case ACPI_TYPE_LOCAL_INDEX_FIELD:
|
||||
|
||||
/* For fields, copy the source data to the target field. */
|
||||
|
||||
Status = AcpiExWriteDataToField (SourceDesc, TargetDesc,
|
||||
&WalkState->ResultObj);
|
||||
break;
|
||||
|
||||
|
||||
case ACPI_TYPE_INTEGER:
|
||||
case ACPI_TYPE_STRING:
|
||||
case ACPI_TYPE_BUFFER:
|
||||
|
||||
/*
|
||||
* These target types are all of type Integer/String/Buffer, and
|
||||
* therefore support implicit conversion before the store.
|
||||
*
|
||||
* Copy and/or convert the source object to a new target object
|
||||
* The simple data types all support implicit source operand
|
||||
* conversion before the store.
|
||||
*/
|
||||
|
||||
if ((WalkState->Opcode == AML_COPY_OP) ||
|
||||
!ImplicitConversion)
|
||||
{
|
||||
/*
|
||||
* However, CopyObject and Stores to ArgX do not perform
|
||||
* an implicit conversion, as per the ACPI specification.
|
||||
* A direct store is performed instead.
|
||||
*/
|
||||
Status = AcpiExStoreDirectToNode (SourceDesc, Node,
|
||||
WalkState);
|
||||
break;
|
||||
}
|
||||
|
||||
/* Store with implicit source operand conversion support */
|
||||
|
||||
Status = AcpiExStoreObjectToObject (SourceDesc, TargetDesc,
|
||||
&NewDesc, WalkState);
|
||||
&NewDesc, WalkState);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return_ACPI_STATUS (Status);
|
||||
@@ -570,11 +483,12 @@ AcpiExStoreObjectToNode (
|
||||
* the Name's type to that of the value being stored in it.
|
||||
* SourceDesc reference count is incremented by AttachObject.
|
||||
*
|
||||
* Note: This may change the type of the node if an explicit store
|
||||
* has been performed such that the node/object type has been
|
||||
* changed.
|
||||
* Note: This may change the type of the node if an explicit
|
||||
* store has been performed such that the node/object type
|
||||
* has been changed.
|
||||
*/
|
||||
Status = AcpiNsAttachObject (Node, NewDesc, NewDesc->Common.Type);
|
||||
Status = AcpiNsAttachObject (Node, NewDesc,
|
||||
NewDesc->Common.Type);
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
|
||||
"Store %s into %s via Convert/Attach\n",
|
||||
@@ -583,17 +497,34 @@ AcpiExStoreObjectToNode (
|
||||
}
|
||||
break;
|
||||
|
||||
case ACPI_TYPE_BUFFER_FIELD:
|
||||
case ACPI_TYPE_LOCAL_REGION_FIELD:
|
||||
case ACPI_TYPE_LOCAL_BANK_FIELD:
|
||||
case ACPI_TYPE_LOCAL_INDEX_FIELD:
|
||||
/*
|
||||
* For all fields, always write the source data to the target
|
||||
* field. Any required implicit source operand conversion is
|
||||
* performed in the function below as necessary. Note, field
|
||||
* objects must retain their original type permanently.
|
||||
*/
|
||||
Status = AcpiExWriteDataToField (SourceDesc, TargetDesc,
|
||||
&WalkState->ResultObj);
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
|
||||
"Storing %s (%p) directly into node (%p) with no implicit conversion\n",
|
||||
AcpiUtGetObjectTypeName (SourceDesc), SourceDesc, Node));
|
||||
|
||||
/* No conversions for all other types. Just attach the source object */
|
||||
|
||||
Status = AcpiNsAttachObject (Node, SourceDesc,
|
||||
SourceDesc->Common.Type);
|
||||
/*
|
||||
* No conversions for all other types. Directly store a copy of
|
||||
* the source object. This is the ACPI spec-defined behavior for
|
||||
* the CopyObject operator.
|
||||
*
|
||||
* NOTE: For the Store operator, this is a departure from the
|
||||
* ACPI spec, which states "If conversion is impossible, abort
|
||||
* the running control method". Instead, this code implements
|
||||
* "If conversion is impossible, treat the Store operation as
|
||||
* a CopyObject".
|
||||
*/
|
||||
Status = AcpiExStoreDirectToNode (SourceDesc, Node,
|
||||
WalkState);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -601,3 +532,51 @@ AcpiExStoreObjectToNode (
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiExStoreDirectToNode
|
||||
*
|
||||
* PARAMETERS: SourceDesc - Value to be stored
|
||||
* Node - Named object to receive the value
|
||||
* WalkState - Current walk state
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: "Store" an object directly to a node. This involves a copy
|
||||
* and an attach.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
static ACPI_STATUS
|
||||
AcpiExStoreDirectToNode (
|
||||
ACPI_OPERAND_OBJECT *SourceDesc,
|
||||
ACPI_NAMESPACE_NODE *Node,
|
||||
ACPI_WALK_STATE *WalkState)
|
||||
{
|
||||
ACPI_STATUS Status;
|
||||
ACPI_OPERAND_OBJECT *NewDesc;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE (ExStoreDirectToNode);
|
||||
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
|
||||
"Storing [%s] (%p) directly into node [%s] (%p)"
|
||||
" with no implicit conversion\n",
|
||||
AcpiUtGetObjectTypeName (SourceDesc), SourceDesc,
|
||||
AcpiUtGetTypeName (Node->Type), Node));
|
||||
|
||||
/* Copy the source object to a new object */
|
||||
|
||||
Status = AcpiUtCopyIobjectToIobject (SourceDesc, &NewDesc, WalkState);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
/* Attach the new object to the node */
|
||||
|
||||
Status = AcpiNsAttachObject (Node, NewDesc, NewDesc->Common.Type);
|
||||
AcpiUtRemoveReference (NewDesc);
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* Module Name: exstoren - AML Interpreter object store support,
|
||||
@@ -6,116 +5,42 @@
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
* 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.
|
||||
*
|
||||
* 2.1. This is your license from Intel Corp. under its intellectual property
|
||||
* rights. You may have additional license terms from the party that provided
|
||||
* you this software, covering your right to use that party's intellectual
|
||||
* property rights.
|
||||
* 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.
|
||||
*
|
||||
* 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
|
||||
* copy of the source code appearing in this file ("Covered Code") an
|
||||
* irrevocable, perpetual, worldwide license under Intel's copyrights in the
|
||||
* base code distributed originally by Intel ("Original Intel Code") to copy,
|
||||
* make derivatives, distribute, use and display any portion of the Covered
|
||||
* Code in any form, with the right to sublicense such rights; and
|
||||
*
|
||||
* 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
|
||||
* license (with the right to sublicense), under only those claims of Intel
|
||||
* patents that are infringed by the Original Intel Code, to make, use, sell,
|
||||
* offer to sell, and import the Covered Code and derivative works thereof
|
||||
* solely to the minimum extent necessary to exercise the above copyright
|
||||
* license, and in no event shall the patent license extend to any additions
|
||||
* to or modifications of the Original Intel Code. No other license or right
|
||||
* is granted directly or by implication, estoppel or otherwise;
|
||||
*
|
||||
* The above copyright and patent license is granted only if the following
|
||||
* conditions are met:
|
||||
*
|
||||
* 3. Conditions
|
||||
*
|
||||
* 3.1. Redistribution of Source with Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification with rights to further distribute source must include
|
||||
* the above Copyright Notice, the above License, this list of Conditions,
|
||||
* and the following Disclaimer and Export Compliance provision. In addition,
|
||||
* Licensee must cause all Covered Code to which Licensee contributes to
|
||||
* contain a file documenting the changes Licensee made to create that Covered
|
||||
* Code and the date of any change. Licensee must include in that file the
|
||||
* documentation of any changes made by any predecessor Licensee. Licensee
|
||||
* must include a prominent statement that the modification is derived,
|
||||
* directly or indirectly, from Original Intel Code.
|
||||
*
|
||||
* 3.2. Redistribution of Source with no Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification without rights to further distribute source must
|
||||
* include the following Disclaimer and Export Compliance provision in the
|
||||
* documentation and/or other materials provided with distribution. In
|
||||
* addition, Licensee may not authorize further sublicense of source of any
|
||||
* portion of the Covered Code, and must include terms to the effect that the
|
||||
* license from Licensee to its licensee is limited to the intellectual
|
||||
* property embodied in the software Licensee provides to its licensee, and
|
||||
* not to intellectual property embodied in modifications its licensee may
|
||||
* make.
|
||||
*
|
||||
* 3.3. Redistribution of Executable. Redistribution in executable form of any
|
||||
* substantial portion of the Covered Code or modification must reproduce the
|
||||
* above Copyright Notice, and the following Disclaimer and Export Compliance
|
||||
* provision in the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3.4. Intel retains all right, title, and interest in and to the Original
|
||||
* Intel Code.
|
||||
*
|
||||
* 3.5. Neither the name Intel nor any other trademark owned or controlled by
|
||||
* Intel shall be used in advertising or otherwise to promote the sale, use or
|
||||
* other dealings in products derived from or relating to the Covered Code
|
||||
* without prior written authorization from Intel.
|
||||
*
|
||||
* 4. Disclaimer and Export Compliance
|
||||
*
|
||||
* 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
|
||||
* HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
|
||||
* IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
|
||||
* INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
|
||||
* UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
|
||||
* PARTICULAR PURPOSE.
|
||||
*
|
||||
* 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
|
||||
* OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
|
||||
* COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
|
||||
* SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
|
||||
* CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
|
||||
* HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
|
||||
* SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
|
||||
* LIMITED REMEDY.
|
||||
*
|
||||
* 4.3. Licensee shall not export, either directly or indirectly, any of this
|
||||
* software or system incorporating such software without first obtaining any
|
||||
* required license or other approval from the U. S. Department of Commerce or
|
||||
* any other agency or department of the United States Government. In the
|
||||
* event Licensee exports any such software from the United States or
|
||||
* re-exports any such software from a foreign destination, Licensee shall
|
||||
* ensure that the distribution and export/re-export of the software is in
|
||||
* compliance with all laws, regulations, orders, or other restrictions of the
|
||||
* U.S. Export Administration Regulations. Licensee agrees that neither it nor
|
||||
* any of its subsidiaries will export/re-export any technical data, process,
|
||||
* software, or service, directly or indirectly, to any country for which the
|
||||
* United States government or any agency thereof requires an export license,
|
||||
* other governmental approval, or letter of assurance, without first obtaining
|
||||
* such license, approval or letter.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
#define __EXSTOREN_C__
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#include "acpi.h"
|
||||
#include "accommon.h"
|
||||
@@ -137,7 +62,7 @@
|
||||
*
|
||||
* RETURN: Status, resolved object in SourceDescPtr.
|
||||
*
|
||||
* DESCRIPTION: Resolve an object. If the object is a reference, dereference
|
||||
* DESCRIPTION: Resolve an object. If the object is a reference, dereference
|
||||
* it and return the actual object in the SourceDescPtr.
|
||||
*
|
||||
******************************************************************************/
|
||||
@@ -167,14 +92,12 @@ AcpiExResolveObject (
|
||||
* These cases all require only Integers or values that
|
||||
* can be converted to Integers (Strings or Buffers)
|
||||
*/
|
||||
|
||||
case ACPI_TYPE_INTEGER:
|
||||
case ACPI_TYPE_STRING:
|
||||
case ACPI_TYPE_BUFFER:
|
||||
|
||||
/*
|
||||
* Stores into a Field/Region or into a Integer/Buffer/String
|
||||
* are all essentially the same. This case handles the
|
||||
* are all essentially the same. This case handles the
|
||||
* "interchangeable" types Integer, String, and Buffer.
|
||||
*/
|
||||
if (SourceDesc->Common.Type == ACPI_TYPE_LOCAL_REFERENCE)
|
||||
@@ -213,10 +136,8 @@ AcpiExResolveObject (
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case ACPI_TYPE_LOCAL_ALIAS:
|
||||
case ACPI_TYPE_LOCAL_METHOD_ALIAS:
|
||||
|
||||
/*
|
||||
* All aliases should have been resolved earlier, during the
|
||||
* operand resolution phase.
|
||||
@@ -225,10 +146,8 @@ AcpiExResolveObject (
|
||||
Status = AE_AML_INTERNAL;
|
||||
break;
|
||||
|
||||
|
||||
case ACPI_TYPE_PACKAGE:
|
||||
default:
|
||||
|
||||
/*
|
||||
* All other types than Alias and the various Fields come here,
|
||||
* including the untyped case - ACPI_TYPE_ANY.
|
||||
@@ -251,7 +170,7 @@ AcpiExResolveObject (
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: "Store" an object to another object. This may include
|
||||
* DESCRIPTION: "Store" an object to another object. This may include
|
||||
* converting the source type to the target type (implicit
|
||||
* conversion), and a copy of the value of the source to
|
||||
* the target.
|
||||
@@ -262,14 +181,14 @@ AcpiExResolveObject (
|
||||
* with the input value.
|
||||
*
|
||||
* When storing into an object the data is converted to the
|
||||
* target object type then stored in the object. This means
|
||||
* target object type then stored in the object. This means
|
||||
* that the target object type (for an initialized target) will
|
||||
* not be changed by a store operation.
|
||||
*
|
||||
* This module allows destination types of Number, String,
|
||||
* Buffer, and Package.
|
||||
*
|
||||
* Assumes parameters are already validated. NOTE: SourceDesc
|
||||
* Assumes parameters are already validated. NOTE: SourceDesc
|
||||
* resolution (from a reference object) must be performed by
|
||||
* the caller if necessary.
|
||||
*
|
||||
@@ -342,7 +261,7 @@ AcpiExStoreObjectToObject (
|
||||
|
||||
/* Truncate value if we are executing from a 32-bit ACPI table */
|
||||
|
||||
AcpiExTruncateFor32bitTable (DestDesc);
|
||||
(void) AcpiExTruncateFor32bitTable (DestDesc);
|
||||
break;
|
||||
|
||||
case ACPI_TYPE_STRING:
|
||||
@@ -382,5 +301,3 @@ AcpiExStoreObjectToObject (
|
||||
*NewDesc = DestDesc;
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,120 +1,45 @@
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* Module Name: exstorob - AML Interpreter object store support, store to object
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
* 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.
|
||||
*
|
||||
* 2.1. This is your license from Intel Corp. under its intellectual property
|
||||
* rights. You may have additional license terms from the party that provided
|
||||
* you this software, covering your right to use that party's intellectual
|
||||
* property rights.
|
||||
* 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.
|
||||
*
|
||||
* 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
|
||||
* copy of the source code appearing in this file ("Covered Code") an
|
||||
* irrevocable, perpetual, worldwide license under Intel's copyrights in the
|
||||
* base code distributed originally by Intel ("Original Intel Code") to copy,
|
||||
* make derivatives, distribute, use and display any portion of the Covered
|
||||
* Code in any form, with the right to sublicense such rights; and
|
||||
*
|
||||
* 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
|
||||
* license (with the right to sublicense), under only those claims of Intel
|
||||
* patents that are infringed by the Original Intel Code, to make, use, sell,
|
||||
* offer to sell, and import the Covered Code and derivative works thereof
|
||||
* solely to the minimum extent necessary to exercise the above copyright
|
||||
* license, and in no event shall the patent license extend to any additions
|
||||
* to or modifications of the Original Intel Code. No other license or right
|
||||
* is granted directly or by implication, estoppel or otherwise;
|
||||
*
|
||||
* The above copyright and patent license is granted only if the following
|
||||
* conditions are met:
|
||||
*
|
||||
* 3. Conditions
|
||||
*
|
||||
* 3.1. Redistribution of Source with Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification with rights to further distribute source must include
|
||||
* the above Copyright Notice, the above License, this list of Conditions,
|
||||
* and the following Disclaimer and Export Compliance provision. In addition,
|
||||
* Licensee must cause all Covered Code to which Licensee contributes to
|
||||
* contain a file documenting the changes Licensee made to create that Covered
|
||||
* Code and the date of any change. Licensee must include in that file the
|
||||
* documentation of any changes made by any predecessor Licensee. Licensee
|
||||
* must include a prominent statement that the modification is derived,
|
||||
* directly or indirectly, from Original Intel Code.
|
||||
*
|
||||
* 3.2. Redistribution of Source with no Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification without rights to further distribute source must
|
||||
* include the following Disclaimer and Export Compliance provision in the
|
||||
* documentation and/or other materials provided with distribution. In
|
||||
* addition, Licensee may not authorize further sublicense of source of any
|
||||
* portion of the Covered Code, and must include terms to the effect that the
|
||||
* license from Licensee to its licensee is limited to the intellectual
|
||||
* property embodied in the software Licensee provides to its licensee, and
|
||||
* not to intellectual property embodied in modifications its licensee may
|
||||
* make.
|
||||
*
|
||||
* 3.3. Redistribution of Executable. Redistribution in executable form of any
|
||||
* substantial portion of the Covered Code or modification must reproduce the
|
||||
* above Copyright Notice, and the following Disclaimer and Export Compliance
|
||||
* provision in the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3.4. Intel retains all right, title, and interest in and to the Original
|
||||
* Intel Code.
|
||||
*
|
||||
* 3.5. Neither the name Intel nor any other trademark owned or controlled by
|
||||
* Intel shall be used in advertising or otherwise to promote the sale, use or
|
||||
* other dealings in products derived from or relating to the Covered Code
|
||||
* without prior written authorization from Intel.
|
||||
*
|
||||
* 4. Disclaimer and Export Compliance
|
||||
*
|
||||
* 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
|
||||
* HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
|
||||
* IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
|
||||
* INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
|
||||
* UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
|
||||
* PARTICULAR PURPOSE.
|
||||
*
|
||||
* 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
|
||||
* OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
|
||||
* COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
|
||||
* SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
|
||||
* CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
|
||||
* HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
|
||||
* SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
|
||||
* LIMITED REMEDY.
|
||||
*
|
||||
* 4.3. Licensee shall not export, either directly or indirectly, any of this
|
||||
* software or system incorporating such software without first obtaining any
|
||||
* required license or other approval from the U. S. Department of Commerce or
|
||||
* any other agency or department of the United States Government. In the
|
||||
* event Licensee exports any such software from the United States or
|
||||
* re-exports any such software from a foreign destination, Licensee shall
|
||||
* ensure that the distribution and export/re-export of the software is in
|
||||
* compliance with all laws, regulations, orders, or other restrictions of the
|
||||
* U.S. Export Administration Regulations. Licensee agrees that neither it nor
|
||||
* any of its subsidiaries will export/re-export any technical data, process,
|
||||
* software, or service, directly or indirectly, to any country for which the
|
||||
* United States government or any agency thereof requires an export license,
|
||||
* other governmental approval, or letter of assurance, without first obtaining
|
||||
* such license, approval or letter.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
#define __EXSTOROB_C__
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#include "acpi.h"
|
||||
#include "accommon.h"
|
||||
@@ -190,7 +115,7 @@ AcpiExStoreBufferToBuffer (
|
||||
#ifdef ACPI_OBSOLETE_BEHAVIOR
|
||||
/*
|
||||
* NOTE: ACPI versions up to 3.0 specified that the buffer must be
|
||||
* truncated if the string is smaller than the buffer. However, "other"
|
||||
* truncated if the string is smaller than the buffer. However, "other"
|
||||
* implementations of ACPI never did this and thus became the defacto
|
||||
* standard. ACPI 3.0A changes this behavior such that the buffer
|
||||
* is no longer truncated.
|
||||
@@ -199,7 +124,7 @@ AcpiExStoreBufferToBuffer (
|
||||
/*
|
||||
* OBSOLETE BEHAVIOR:
|
||||
* If the original source was a string, we must truncate the buffer,
|
||||
* according to the ACPI spec. Integer-to-Buffer and Buffer-to-Buffer
|
||||
* according to the ACPI spec. Integer-to-Buffer and Buffer-to-Buffer
|
||||
* copy must not truncate the original buffer.
|
||||
*/
|
||||
if (OriginalSrcType == ACPI_TYPE_STRING)
|
||||
@@ -312,5 +237,3 @@ AcpiExStoreStringToString (
|
||||
TargetDesc->String.Length = Length;
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,120 +1,45 @@
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* Module Name: exsystem - Interface to OS services
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
* 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.
|
||||
*
|
||||
* 2.1. This is your license from Intel Corp. under its intellectual property
|
||||
* rights. You may have additional license terms from the party that provided
|
||||
* you this software, covering your right to use that party's intellectual
|
||||
* property rights.
|
||||
* 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.
|
||||
*
|
||||
* 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
|
||||
* copy of the source code appearing in this file ("Covered Code") an
|
||||
* irrevocable, perpetual, worldwide license under Intel's copyrights in the
|
||||
* base code distributed originally by Intel ("Original Intel Code") to copy,
|
||||
* make derivatives, distribute, use and display any portion of the Covered
|
||||
* Code in any form, with the right to sublicense such rights; and
|
||||
*
|
||||
* 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
|
||||
* license (with the right to sublicense), under only those claims of Intel
|
||||
* patents that are infringed by the Original Intel Code, to make, use, sell,
|
||||
* offer to sell, and import the Covered Code and derivative works thereof
|
||||
* solely to the minimum extent necessary to exercise the above copyright
|
||||
* license, and in no event shall the patent license extend to any additions
|
||||
* to or modifications of the Original Intel Code. No other license or right
|
||||
* is granted directly or by implication, estoppel or otherwise;
|
||||
*
|
||||
* The above copyright and patent license is granted only if the following
|
||||
* conditions are met:
|
||||
*
|
||||
* 3. Conditions
|
||||
*
|
||||
* 3.1. Redistribution of Source with Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification with rights to further distribute source must include
|
||||
* the above Copyright Notice, the above License, this list of Conditions,
|
||||
* and the following Disclaimer and Export Compliance provision. In addition,
|
||||
* Licensee must cause all Covered Code to which Licensee contributes to
|
||||
* contain a file documenting the changes Licensee made to create that Covered
|
||||
* Code and the date of any change. Licensee must include in that file the
|
||||
* documentation of any changes made by any predecessor Licensee. Licensee
|
||||
* must include a prominent statement that the modification is derived,
|
||||
* directly or indirectly, from Original Intel Code.
|
||||
*
|
||||
* 3.2. Redistribution of Source with no Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification without rights to further distribute source must
|
||||
* include the following Disclaimer and Export Compliance provision in the
|
||||
* documentation and/or other materials provided with distribution. In
|
||||
* addition, Licensee may not authorize further sublicense of source of any
|
||||
* portion of the Covered Code, and must include terms to the effect that the
|
||||
* license from Licensee to its licensee is limited to the intellectual
|
||||
* property embodied in the software Licensee provides to its licensee, and
|
||||
* not to intellectual property embodied in modifications its licensee may
|
||||
* make.
|
||||
*
|
||||
* 3.3. Redistribution of Executable. Redistribution in executable form of any
|
||||
* substantial portion of the Covered Code or modification must reproduce the
|
||||
* above Copyright Notice, and the following Disclaimer and Export Compliance
|
||||
* provision in the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3.4. Intel retains all right, title, and interest in and to the Original
|
||||
* Intel Code.
|
||||
*
|
||||
* 3.5. Neither the name Intel nor any other trademark owned or controlled by
|
||||
* Intel shall be used in advertising or otherwise to promote the sale, use or
|
||||
* other dealings in products derived from or relating to the Covered Code
|
||||
* without prior written authorization from Intel.
|
||||
*
|
||||
* 4. Disclaimer and Export Compliance
|
||||
*
|
||||
* 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
|
||||
* HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
|
||||
* IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
|
||||
* INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
|
||||
* UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
|
||||
* PARTICULAR PURPOSE.
|
||||
*
|
||||
* 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
|
||||
* OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
|
||||
* COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
|
||||
* SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
|
||||
* CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
|
||||
* HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
|
||||
* SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
|
||||
* LIMITED REMEDY.
|
||||
*
|
||||
* 4.3. Licensee shall not export, either directly or indirectly, any of this
|
||||
* software or system incorporating such software without first obtaining any
|
||||
* required license or other approval from the U. S. Department of Commerce or
|
||||
* any other agency or department of the United States Government. In the
|
||||
* event Licensee exports any such software from the United States or
|
||||
* re-exports any such software from a foreign destination, Licensee shall
|
||||
* ensure that the distribution and export/re-export of the software is in
|
||||
* compliance with all laws, regulations, orders, or other restrictions of the
|
||||
* U.S. Export Administration Regulations. Licensee agrees that neither it nor
|
||||
* any of its subsidiaries will export/re-export any technical data, process,
|
||||
* software, or service, directly or indirectly, to any country for which the
|
||||
* United States government or any agency thereof requires an export license,
|
||||
* other governmental approval, or letter of assurance, without first obtaining
|
||||
* such license, approval or letter.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
#define __EXSYSTEM_C__
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#include "acpi.h"
|
||||
#include "accommon.h"
|
||||
@@ -134,7 +59,7 @@
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Implements a semaphore wait with a check to see if the
|
||||
* semaphore is available immediately. If it is not, the
|
||||
* semaphore is available immediately. If it is not, the
|
||||
* interpreter is released before waiting.
|
||||
*
|
||||
******************************************************************************/
|
||||
@@ -160,7 +85,7 @@ AcpiExSystemWaitSemaphore (
|
||||
{
|
||||
/* We must wait, so unlock the interpreter */
|
||||
|
||||
AcpiExRelinquishInterpreter ();
|
||||
AcpiExExitInterpreter ();
|
||||
|
||||
Status = AcpiOsWaitSemaphore (Semaphore, 1, Timeout);
|
||||
|
||||
@@ -170,7 +95,7 @@ AcpiExSystemWaitSemaphore (
|
||||
|
||||
/* Reacquire the interpreter */
|
||||
|
||||
AcpiExReacquireInterpreter ();
|
||||
AcpiExEnterInterpreter ();
|
||||
}
|
||||
|
||||
return_ACPI_STATUS (Status);
|
||||
@@ -187,7 +112,7 @@ AcpiExSystemWaitSemaphore (
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Implements a mutex wait with a check to see if the
|
||||
* mutex is available immediately. If it is not, the
|
||||
* mutex is available immediately. If it is not, the
|
||||
* interpreter is released before waiting.
|
||||
*
|
||||
******************************************************************************/
|
||||
@@ -213,7 +138,7 @@ AcpiExSystemWaitMutex (
|
||||
{
|
||||
/* We must wait, so unlock the interpreter */
|
||||
|
||||
AcpiExRelinquishInterpreter ();
|
||||
AcpiExExitInterpreter ();
|
||||
|
||||
Status = AcpiOsAcquireMutex (Mutex, Timeout);
|
||||
|
||||
@@ -223,7 +148,7 @@ AcpiExSystemWaitMutex (
|
||||
|
||||
/* Reacquire the interpreter */
|
||||
|
||||
AcpiExReacquireInterpreter ();
|
||||
AcpiExEnterInterpreter ();
|
||||
}
|
||||
|
||||
return_ACPI_STATUS (Status);
|
||||
@@ -242,7 +167,7 @@ AcpiExSystemWaitMutex (
|
||||
* DESCRIPTION: Suspend running thread for specified amount of time.
|
||||
* Note: ACPI specification requires that Stall() does not
|
||||
* relinquish the processor, and delays longer than 100 usec
|
||||
* should use Sleep() instead. We allow stalls up to 255 usec
|
||||
* should use Sleep() instead. We allow stalls up to 255 usec
|
||||
* for compatibility with other interpreters and existing BIOSs.
|
||||
*
|
||||
******************************************************************************/
|
||||
@@ -300,7 +225,7 @@ AcpiExSystemDoSleep (
|
||||
|
||||
/* Since this thread will sleep, we must release the interpreter */
|
||||
|
||||
AcpiExRelinquishInterpreter ();
|
||||
AcpiExExitInterpreter ();
|
||||
|
||||
/*
|
||||
* For compatibility with other ACPI implementations and to prevent
|
||||
@@ -315,7 +240,7 @@ AcpiExSystemDoSleep (
|
||||
|
||||
/* And now we must get the interpreter again */
|
||||
|
||||
AcpiExReacquireInterpreter ();
|
||||
AcpiExEnterInterpreter ();
|
||||
return (AE_OK);
|
||||
}
|
||||
|
||||
@@ -362,7 +287,7 @@ AcpiExSystemSignalEvent (
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Provides an access point to perform synchronization operations
|
||||
* within the AML. This operation is a request to wait for an
|
||||
* within the AML. This operation is a request to wait for an
|
||||
* event.
|
||||
*
|
||||
******************************************************************************/
|
||||
@@ -424,4 +349,3 @@ AcpiExSystemResetEvent (
|
||||
|
||||
return (Status);
|
||||
}
|
||||
|
||||
|
||||
@@ -1,130 +1,55 @@
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* Module Name: exutils - interpreter/scanner utilities
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
* 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.
|
||||
*
|
||||
* 2.1. This is your license from Intel Corp. under its intellectual property
|
||||
* rights. You may have additional license terms from the party that provided
|
||||
* you this software, covering your right to use that party's intellectual
|
||||
* property rights.
|
||||
* 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.
|
||||
*
|
||||
* 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
|
||||
* copy of the source code appearing in this file ("Covered Code") an
|
||||
* irrevocable, perpetual, worldwide license under Intel's copyrights in the
|
||||
* base code distributed originally by Intel ("Original Intel Code") to copy,
|
||||
* make derivatives, distribute, use and display any portion of the Covered
|
||||
* Code in any form, with the right to sublicense such rights; and
|
||||
*
|
||||
* 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
|
||||
* license (with the right to sublicense), under only those claims of Intel
|
||||
* patents that are infringed by the Original Intel Code, to make, use, sell,
|
||||
* offer to sell, and import the Covered Code and derivative works thereof
|
||||
* solely to the minimum extent necessary to exercise the above copyright
|
||||
* license, and in no event shall the patent license extend to any additions
|
||||
* to or modifications of the Original Intel Code. No other license or right
|
||||
* is granted directly or by implication, estoppel or otherwise;
|
||||
*
|
||||
* The above copyright and patent license is granted only if the following
|
||||
* conditions are met:
|
||||
*
|
||||
* 3. Conditions
|
||||
*
|
||||
* 3.1. Redistribution of Source with Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification with rights to further distribute source must include
|
||||
* the above Copyright Notice, the above License, this list of Conditions,
|
||||
* and the following Disclaimer and Export Compliance provision. In addition,
|
||||
* Licensee must cause all Covered Code to which Licensee contributes to
|
||||
* contain a file documenting the changes Licensee made to create that Covered
|
||||
* Code and the date of any change. Licensee must include in that file the
|
||||
* documentation of any changes made by any predecessor Licensee. Licensee
|
||||
* must include a prominent statement that the modification is derived,
|
||||
* directly or indirectly, from Original Intel Code.
|
||||
*
|
||||
* 3.2. Redistribution of Source with no Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification without rights to further distribute source must
|
||||
* include the following Disclaimer and Export Compliance provision in the
|
||||
* documentation and/or other materials provided with distribution. In
|
||||
* addition, Licensee may not authorize further sublicense of source of any
|
||||
* portion of the Covered Code, and must include terms to the effect that the
|
||||
* license from Licensee to its licensee is limited to the intellectual
|
||||
* property embodied in the software Licensee provides to its licensee, and
|
||||
* not to intellectual property embodied in modifications its licensee may
|
||||
* make.
|
||||
*
|
||||
* 3.3. Redistribution of Executable. Redistribution in executable form of any
|
||||
* substantial portion of the Covered Code or modification must reproduce the
|
||||
* above Copyright Notice, and the following Disclaimer and Export Compliance
|
||||
* provision in the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3.4. Intel retains all right, title, and interest in and to the Original
|
||||
* Intel Code.
|
||||
*
|
||||
* 3.5. Neither the name Intel nor any other trademark owned or controlled by
|
||||
* Intel shall be used in advertising or otherwise to promote the sale, use or
|
||||
* other dealings in products derived from or relating to the Covered Code
|
||||
* without prior written authorization from Intel.
|
||||
*
|
||||
* 4. Disclaimer and Export Compliance
|
||||
*
|
||||
* 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
|
||||
* HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
|
||||
* IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
|
||||
* INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
|
||||
* UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
|
||||
* PARTICULAR PURPOSE.
|
||||
*
|
||||
* 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
|
||||
* OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
|
||||
* COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
|
||||
* SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
|
||||
* CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
|
||||
* HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
|
||||
* SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
|
||||
* LIMITED REMEDY.
|
||||
*
|
||||
* 4.3. Licensee shall not export, either directly or indirectly, any of this
|
||||
* software or system incorporating such software without first obtaining any
|
||||
* required license or other approval from the U. S. Department of Commerce or
|
||||
* any other agency or department of the United States Government. In the
|
||||
* event Licensee exports any such software from the United States or
|
||||
* re-exports any such software from a foreign destination, Licensee shall
|
||||
* ensure that the distribution and export/re-export of the software is in
|
||||
* compliance with all laws, regulations, orders, or other restrictions of the
|
||||
* U.S. Export Administration Regulations. Licensee agrees that neither it nor
|
||||
* any of its subsidiaries will export/re-export any technical data, process,
|
||||
* software, or service, directly or indirectly, to any country for which the
|
||||
* United States government or any agency thereof requires an export license,
|
||||
* other governmental approval, or letter of assurance, without first obtaining
|
||||
* such license, approval or letter.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
#define __EXUTILS_C__
|
||||
* 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_AML_GLOBALS is tested in amlcode.h
|
||||
* to determine whether certain global names should be "defined" or only
|
||||
* "declared" in the current compilation. This enhances maintainability
|
||||
* "declared" in the current compilation. This enhances maintainability
|
||||
* by enabling a single header file to embody all knowledge of the names
|
||||
* in question.
|
||||
*
|
||||
* Exactly one module of any executable should #define DEFINE_GLOBALS
|
||||
* before #including the header files which use this convention. The
|
||||
* before #including the header files which use this convention. The
|
||||
* names in question will be defined and initialized in that module,
|
||||
* and declared as extern in all other modules which #include those
|
||||
* header files.
|
||||
@@ -183,42 +108,6 @@ AcpiExEnterInterpreter (
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiExReacquireInterpreter
|
||||
*
|
||||
* PARAMETERS: None
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Reacquire the interpreter execution region from within the
|
||||
* interpreter code. Failure to enter the interpreter region is a
|
||||
* fatal system error. Used in conjuction with
|
||||
* RelinquishInterpreter
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
void
|
||||
AcpiExReacquireInterpreter (
|
||||
void)
|
||||
{
|
||||
ACPI_FUNCTION_TRACE (ExReacquireInterpreter);
|
||||
|
||||
|
||||
/*
|
||||
* If the global serialized flag is set, do not release the interpreter,
|
||||
* since it was not actually released by AcpiExRelinquishInterpreter.
|
||||
* This forces the interpreter to be single threaded.
|
||||
*/
|
||||
if (!AcpiGbl_AllMethodsSerialized)
|
||||
{
|
||||
AcpiExEnterInterpreter ();
|
||||
}
|
||||
|
||||
return_VOID;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiExExitInterpreter
|
||||
@@ -229,7 +118,16 @@ AcpiExReacquireInterpreter (
|
||||
*
|
||||
* DESCRIPTION: Exit the interpreter execution region. This is the top level
|
||||
* routine used to exit the interpreter when all processing has
|
||||
* been completed.
|
||||
* been completed, or when the method blocks.
|
||||
*
|
||||
* Cases where the interpreter is unlocked internally:
|
||||
* 1) Method will be blocked on a Sleep() AML opcode
|
||||
* 2) Method will be blocked on an Acquire() AML opcode
|
||||
* 3) Method will be blocked on a Wait() AML opcode
|
||||
* 4) Method will be blocked to acquire the global lock
|
||||
* 5) Method will be blocked waiting to execute a serialized control
|
||||
* method that is currently executing
|
||||
* 6) About to invoke a user-installed opregion handler
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
@@ -253,63 +151,20 @@ AcpiExExitInterpreter (
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiExRelinquishInterpreter
|
||||
*
|
||||
* PARAMETERS: None
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Exit the interpreter execution region, from within the
|
||||
* interpreter - before attempting an operation that will possibly
|
||||
* block the running thread.
|
||||
*
|
||||
* Cases where the interpreter is unlocked internally
|
||||
* 1) Method to be blocked on a Sleep() AML opcode
|
||||
* 2) Method to be blocked on an Acquire() AML opcode
|
||||
* 3) Method to be blocked on a Wait() AML opcode
|
||||
* 4) Method to be blocked to acquire the global lock
|
||||
* 5) Method to be blocked waiting to execute a serialized control method
|
||||
* that is currently executing
|
||||
* 6) About to invoke a user-installed opregion handler
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
void
|
||||
AcpiExRelinquishInterpreter (
|
||||
void)
|
||||
{
|
||||
ACPI_FUNCTION_TRACE (ExRelinquishInterpreter);
|
||||
|
||||
|
||||
/*
|
||||
* If the global serialized flag is set, do not release the interpreter.
|
||||
* This forces the interpreter to be single threaded.
|
||||
*/
|
||||
if (!AcpiGbl_AllMethodsSerialized)
|
||||
{
|
||||
AcpiExExitInterpreter ();
|
||||
}
|
||||
|
||||
return_VOID;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiExTruncateFor32bitTable
|
||||
*
|
||||
* PARAMETERS: ObjDesc - Object to be truncated
|
||||
*
|
||||
* RETURN: none
|
||||
* RETURN: TRUE if a truncation was performed, FALSE otherwise.
|
||||
*
|
||||
* DESCRIPTION: Truncate an ACPI Integer to 32 bits if the execution mode is
|
||||
* 32-bit, as determined by the revision of the DSDT.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
void
|
||||
BOOLEAN
|
||||
AcpiExTruncateFor32bitTable (
|
||||
ACPI_OPERAND_OBJECT *ObjDesc)
|
||||
{
|
||||
@@ -319,23 +174,27 @@ AcpiExTruncateFor32bitTable (
|
||||
|
||||
/*
|
||||
* Object must be a valid number and we must be executing
|
||||
* a control method. NS node could be there for AML_INT_NAMEPATH_OP.
|
||||
* a control method. Object could be NS node for AML_INT_NAMEPATH_OP.
|
||||
*/
|
||||
if ((!ObjDesc) ||
|
||||
(ACPI_GET_DESCRIPTOR_TYPE (ObjDesc) != ACPI_DESC_TYPE_OPERAND) ||
|
||||
(ObjDesc->Common.Type != ACPI_TYPE_INTEGER))
|
||||
{
|
||||
return;
|
||||
return (FALSE);
|
||||
}
|
||||
|
||||
if (AcpiGbl_IntegerByteWidth == 4)
|
||||
if ((AcpiGbl_IntegerByteWidth == 4) &&
|
||||
(ObjDesc->Integer.Value > (UINT64) ACPI_UINT32_MAX))
|
||||
{
|
||||
/*
|
||||
* We are running a method that exists in a 32-bit ACPI table.
|
||||
* We are executing in a 32-bit ACPI table.
|
||||
* Truncate the value to 32 bits by zeroing out the upper 32-bit field
|
||||
*/
|
||||
ObjDesc->Integer.Value &= (UINT64) ACPI_UINT32_MAX;
|
||||
return (TRUE);
|
||||
}
|
||||
|
||||
return (FALSE);
|
||||
}
|
||||
|
||||
|
||||
@@ -571,4 +430,34 @@ AcpiExIntegerToString (
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiIsValidSpaceId
|
||||
*
|
||||
* PARAMETERS: SpaceId - ID to be validated
|
||||
*
|
||||
* RETURN: TRUE if valid/supported ID.
|
||||
*
|
||||
* DESCRIPTION: Validate an operation region SpaceID.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
BOOLEAN
|
||||
AcpiIsValidSpaceId (
|
||||
UINT8 SpaceId)
|
||||
{
|
||||
|
||||
if ((SpaceId >= ACPI_NUM_PREDEFINED_REGIONS) &&
|
||||
(SpaceId < ACPI_USER_REGION_BEGIN) &&
|
||||
(SpaceId != ACPI_ADR_SPACE_DATA_TABLE) &&
|
||||
(SpaceId != ACPI_ADR_SPACE_FIXED_HARDWARE))
|
||||
{
|
||||
return (FALSE);
|
||||
}
|
||||
|
||||
return (TRUE);
|
||||
}
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
@@ -1,120 +1,45 @@
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* Module Name: hwacpi - ACPI Hardware Initialization/Mode Interface
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
* 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.
|
||||
*
|
||||
* 2.1. This is your license from Intel Corp. under its intellectual property
|
||||
* rights. You may have additional license terms from the party that provided
|
||||
* you this software, covering your right to use that party's intellectual
|
||||
* property rights.
|
||||
* 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.
|
||||
*
|
||||
* 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
|
||||
* copy of the source code appearing in this file ("Covered Code") an
|
||||
* irrevocable, perpetual, worldwide license under Intel's copyrights in the
|
||||
* base code distributed originally by Intel ("Original Intel Code") to copy,
|
||||
* make derivatives, distribute, use and display any portion of the Covered
|
||||
* Code in any form, with the right to sublicense such rights; and
|
||||
*
|
||||
* 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
|
||||
* license (with the right to sublicense), under only those claims of Intel
|
||||
* patents that are infringed by the Original Intel Code, to make, use, sell,
|
||||
* offer to sell, and import the Covered Code and derivative works thereof
|
||||
* solely to the minimum extent necessary to exercise the above copyright
|
||||
* license, and in no event shall the patent license extend to any additions
|
||||
* to or modifications of the Original Intel Code. No other license or right
|
||||
* is granted directly or by implication, estoppel or otherwise;
|
||||
*
|
||||
* The above copyright and patent license is granted only if the following
|
||||
* conditions are met:
|
||||
*
|
||||
* 3. Conditions
|
||||
*
|
||||
* 3.1. Redistribution of Source with Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification with rights to further distribute source must include
|
||||
* the above Copyright Notice, the above License, this list of Conditions,
|
||||
* and the following Disclaimer and Export Compliance provision. In addition,
|
||||
* Licensee must cause all Covered Code to which Licensee contributes to
|
||||
* contain a file documenting the changes Licensee made to create that Covered
|
||||
* Code and the date of any change. Licensee must include in that file the
|
||||
* documentation of any changes made by any predecessor Licensee. Licensee
|
||||
* must include a prominent statement that the modification is derived,
|
||||
* directly or indirectly, from Original Intel Code.
|
||||
*
|
||||
* 3.2. Redistribution of Source with no Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification without rights to further distribute source must
|
||||
* include the following Disclaimer and Export Compliance provision in the
|
||||
* documentation and/or other materials provided with distribution. In
|
||||
* addition, Licensee may not authorize further sublicense of source of any
|
||||
* portion of the Covered Code, and must include terms to the effect that the
|
||||
* license from Licensee to its licensee is limited to the intellectual
|
||||
* property embodied in the software Licensee provides to its licensee, and
|
||||
* not to intellectual property embodied in modifications its licensee may
|
||||
* make.
|
||||
*
|
||||
* 3.3. Redistribution of Executable. Redistribution in executable form of any
|
||||
* substantial portion of the Covered Code or modification must reproduce the
|
||||
* above Copyright Notice, and the following Disclaimer and Export Compliance
|
||||
* provision in the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3.4. Intel retains all right, title, and interest in and to the Original
|
||||
* Intel Code.
|
||||
*
|
||||
* 3.5. Neither the name Intel nor any other trademark owned or controlled by
|
||||
* Intel shall be used in advertising or otherwise to promote the sale, use or
|
||||
* other dealings in products derived from or relating to the Covered Code
|
||||
* without prior written authorization from Intel.
|
||||
*
|
||||
* 4. Disclaimer and Export Compliance
|
||||
*
|
||||
* 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
|
||||
* HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
|
||||
* IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
|
||||
* INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
|
||||
* UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
|
||||
* PARTICULAR PURPOSE.
|
||||
*
|
||||
* 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
|
||||
* OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
|
||||
* COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
|
||||
* SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
|
||||
* CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
|
||||
* HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
|
||||
* SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
|
||||
* LIMITED REMEDY.
|
||||
*
|
||||
* 4.3. Licensee shall not export, either directly or indirectly, any of this
|
||||
* software or system incorporating such software without first obtaining any
|
||||
* required license or other approval from the U. S. Department of Commerce or
|
||||
* any other agency or department of the United States Government. In the
|
||||
* event Licensee exports any such software from the United States or
|
||||
* re-exports any such software from a foreign destination, Licensee shall
|
||||
* ensure that the distribution and export/re-export of the software is in
|
||||
* compliance with all laws, regulations, orders, or other restrictions of the
|
||||
* U.S. Export Administration Regulations. Licensee agrees that neither it nor
|
||||
* any of its subsidiaries will export/re-export any technical data, process,
|
||||
* software, or service, directly or indirectly, to any country for which the
|
||||
* United States government or any agency thereof requires an export license,
|
||||
* other governmental approval, or letter of assurance, without first obtaining
|
||||
* such license, approval or letter.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
#define __HWACPI_C__
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#include "acpi.h"
|
||||
#include "accommon.h"
|
||||
@@ -124,6 +49,7 @@
|
||||
ACPI_MODULE_NAME ("hwacpi")
|
||||
|
||||
|
||||
#if (!ACPI_REDUCED_HARDWARE) /* Entire module */
|
||||
/******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiHwSetMode
|
||||
@@ -147,6 +73,14 @@ AcpiHwSetMode (
|
||||
|
||||
ACPI_FUNCTION_TRACE (HwSetMode);
|
||||
|
||||
|
||||
/* If the Hardware Reduced flag is set, machine is always in acpi mode */
|
||||
|
||||
if (AcpiGbl_ReducedHardware)
|
||||
{
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
}
|
||||
|
||||
/*
|
||||
* ACPI 2.0 clarified that if SMI_CMD in FADT is zero,
|
||||
* system does not support mode transition.
|
||||
@@ -184,7 +118,6 @@ AcpiHwSetMode (
|
||||
break;
|
||||
|
||||
case ACPI_SYS_MODE_LEGACY:
|
||||
|
||||
/*
|
||||
* BIOS should clear all fixed status bits and restore fixed event
|
||||
* enable bits to default
|
||||
@@ -196,6 +129,7 @@ AcpiHwSetMode (
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
return_ACPI_STATUS (AE_BAD_PARAMETER);
|
||||
}
|
||||
|
||||
@@ -213,13 +147,13 @@ AcpiHwSetMode (
|
||||
Retry = 3000;
|
||||
while (Retry)
|
||||
{
|
||||
if (AcpiHwGetMode() == Mode)
|
||||
if (AcpiHwGetMode () == Mode)
|
||||
{
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_INFO, "Mode %X successfully enabled\n",
|
||||
Mode));
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
}
|
||||
AcpiOsStall(1000);
|
||||
AcpiOsStall (ACPI_USEC_PER_MSEC);
|
||||
Retry--;
|
||||
}
|
||||
|
||||
@@ -236,7 +170,7 @@ AcpiHwSetMode (
|
||||
*
|
||||
* RETURN: SYS_MODE_ACPI or SYS_MODE_LEGACY
|
||||
*
|
||||
* DESCRIPTION: Return current operating state of system. Determined by
|
||||
* DESCRIPTION: Return current operating state of system. Determined by
|
||||
* querying the SCI_EN bit.
|
||||
*
|
||||
******************************************************************************/
|
||||
@@ -252,6 +186,13 @@ AcpiHwGetMode (
|
||||
ACPI_FUNCTION_TRACE (HwGetMode);
|
||||
|
||||
|
||||
/* If the Hardware Reduced flag is set, machine is always in acpi mode */
|
||||
|
||||
if (AcpiGbl_ReducedHardware)
|
||||
{
|
||||
return_UINT32 (ACPI_SYS_MODE_ACPI);
|
||||
}
|
||||
|
||||
/*
|
||||
* ACPI 2.0 clarified that if SMI_CMD in FADT is zero,
|
||||
* system does not support mode transition.
|
||||
@@ -276,3 +217,5 @@ AcpiHwGetMode (
|
||||
return_UINT32 (ACPI_SYS_MODE_LEGACY);
|
||||
}
|
||||
}
|
||||
|
||||
#endif /* !ACPI_REDUCED_HARDWARE */
|
||||
|
||||
258
minix/drivers/power/acpi/hardware/hwesleep.c
Normal file
258
minix/drivers/power/acpi/hardware/hwesleep.c
Normal file
@@ -0,0 +1,258 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Name: hwesleep.c - ACPI Hardware Sleep/Wake Support functions for the
|
||||
* extended FADT-V5 sleep registers.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, 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.
|
||||
*/
|
||||
|
||||
#include "acpi.h"
|
||||
#include "accommon.h"
|
||||
|
||||
#define _COMPONENT ACPI_HARDWARE
|
||||
ACPI_MODULE_NAME ("hwesleep")
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiHwExecuteSleepMethod
|
||||
*
|
||||
* PARAMETERS: MethodPathname - Pathname of method to execute
|
||||
* IntegerArgument - Argument to pass to the method
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Execute a sleep/wake related method with one integer argument
|
||||
* and no return value.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
void
|
||||
AcpiHwExecuteSleepMethod (
|
||||
char *MethodPathname,
|
||||
UINT32 IntegerArgument)
|
||||
{
|
||||
ACPI_OBJECT_LIST ArgList;
|
||||
ACPI_OBJECT Arg;
|
||||
ACPI_STATUS Status;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE (HwExecuteSleepMethod);
|
||||
|
||||
|
||||
/* One argument, IntegerArgument; No return value expected */
|
||||
|
||||
ArgList.Count = 1;
|
||||
ArgList.Pointer = &Arg;
|
||||
Arg.Type = ACPI_TYPE_INTEGER;
|
||||
Arg.Integer.Value = (UINT64) IntegerArgument;
|
||||
|
||||
Status = AcpiEvaluateObject (NULL, MethodPathname, &ArgList, NULL);
|
||||
if (ACPI_FAILURE (Status) && Status != AE_NOT_FOUND)
|
||||
{
|
||||
ACPI_EXCEPTION ((AE_INFO, Status, "While executing method %s",
|
||||
MethodPathname));
|
||||
}
|
||||
|
||||
return_VOID;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiHwExtendedSleep
|
||||
*
|
||||
* PARAMETERS: SleepState - Which sleep state to enter
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Enter a system sleep state via the extended FADT sleep
|
||||
* registers (V5 FADT).
|
||||
* THIS FUNCTION MUST BE CALLED WITH INTERRUPTS DISABLED
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiHwExtendedSleep (
|
||||
UINT8 SleepState)
|
||||
{
|
||||
ACPI_STATUS Status;
|
||||
UINT8 SleepTypeValue;
|
||||
UINT64 SleepStatus;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE (HwExtendedSleep);
|
||||
|
||||
|
||||
/* Extended sleep registers must be valid */
|
||||
|
||||
if (!AcpiGbl_FADT.SleepControl.Address ||
|
||||
!AcpiGbl_FADT.SleepStatus.Address)
|
||||
{
|
||||
return_ACPI_STATUS (AE_NOT_EXIST);
|
||||
}
|
||||
|
||||
/* Clear wake status (WAK_STS) */
|
||||
|
||||
Status = AcpiWrite ((UINT64) ACPI_X_WAKE_STATUS, &AcpiGbl_FADT.SleepStatus);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
AcpiGbl_SystemAwakeAndRunning = FALSE;
|
||||
|
||||
/* Flush caches, as per ACPI specification */
|
||||
|
||||
ACPI_FLUSH_CPU_CACHE ();
|
||||
|
||||
/*
|
||||
* Set the SLP_TYP and SLP_EN bits.
|
||||
*
|
||||
* Note: We only use the first value returned by the \_Sx method
|
||||
* (AcpiGbl_SleepTypeA) - As per ACPI specification.
|
||||
*/
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_INIT,
|
||||
"Entering sleep state [S%u]\n", SleepState));
|
||||
|
||||
SleepTypeValue = ((AcpiGbl_SleepTypeA << ACPI_X_SLEEP_TYPE_POSITION) &
|
||||
ACPI_X_SLEEP_TYPE_MASK);
|
||||
|
||||
Status = AcpiWrite ((UINT64) (SleepTypeValue | ACPI_X_SLEEP_ENABLE),
|
||||
&AcpiGbl_FADT.SleepControl);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
/* Wait for transition back to Working State */
|
||||
|
||||
do
|
||||
{
|
||||
Status = AcpiRead (&SleepStatus, &AcpiGbl_FADT.SleepStatus);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
} while (!(((UINT8) SleepStatus) & ACPI_X_WAKE_STATUS));
|
||||
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiHwExtendedWakePrep
|
||||
*
|
||||
* PARAMETERS: SleepState - Which sleep state we just exited
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Perform first part of OS-independent ACPI cleanup after
|
||||
* a sleep. Called with interrupts ENABLED.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiHwExtendedWakePrep (
|
||||
UINT8 SleepState)
|
||||
{
|
||||
ACPI_STATUS Status;
|
||||
UINT8 SleepTypeValue;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE (HwExtendedWakePrep);
|
||||
|
||||
|
||||
Status = AcpiGetSleepTypeData (ACPI_STATE_S0,
|
||||
&AcpiGbl_SleepTypeA, &AcpiGbl_SleepTypeB);
|
||||
if (ACPI_SUCCESS (Status))
|
||||
{
|
||||
SleepTypeValue = ((AcpiGbl_SleepTypeA << ACPI_X_SLEEP_TYPE_POSITION) &
|
||||
ACPI_X_SLEEP_TYPE_MASK);
|
||||
|
||||
(void) AcpiWrite ((UINT64) (SleepTypeValue | ACPI_X_SLEEP_ENABLE),
|
||||
&AcpiGbl_FADT.SleepControl);
|
||||
}
|
||||
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiHwExtendedWake
|
||||
*
|
||||
* PARAMETERS: SleepState - Which sleep state we just exited
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Perform OS-independent ACPI cleanup after a sleep
|
||||
* Called with interrupts ENABLED.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiHwExtendedWake (
|
||||
UINT8 SleepState)
|
||||
{
|
||||
ACPI_FUNCTION_TRACE (HwExtendedWake);
|
||||
|
||||
|
||||
/* Ensure EnterSleepStatePrep -> EnterSleepState ordering */
|
||||
|
||||
AcpiGbl_SleepTypeA = ACPI_SLEEP_TYPE_INVALID;
|
||||
|
||||
/* Execute the wake methods */
|
||||
|
||||
AcpiHwExecuteSleepMethod (METHOD_PATHNAME__SST, ACPI_SST_WAKING);
|
||||
AcpiHwExecuteSleepMethod (METHOD_PATHNAME__WAK, SleepState);
|
||||
|
||||
/*
|
||||
* Some BIOS code assumes that WAK_STS will be cleared on resume
|
||||
* and use it to determine whether the system is rebooting or
|
||||
* resuming. Clear WAK_STS for compatibility.
|
||||
*/
|
||||
(void) AcpiWrite ((UINT64) ACPI_X_WAKE_STATUS, &AcpiGbl_FADT.SleepStatus);
|
||||
AcpiGbl_SystemAwakeAndRunning = TRUE;
|
||||
|
||||
AcpiHwExecuteSleepMethod (METHOD_PATHNAME__SST, ACPI_SST_WORKING);
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
}
|
||||
@@ -1,118 +1,45 @@
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* Module Name: hwgpe - Low level GPE enable/disable/clear functions
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
* 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.
|
||||
*
|
||||
* 2.1. This is your license from Intel Corp. under its intellectual property
|
||||
* rights. You may have additional license terms from the party that provided
|
||||
* you this software, covering your right to use that party's intellectual
|
||||
* property rights.
|
||||
* 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.
|
||||
*
|
||||
* 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
|
||||
* copy of the source code appearing in this file ("Covered Code") an
|
||||
* irrevocable, perpetual, worldwide license under Intel's copyrights in the
|
||||
* base code distributed originally by Intel ("Original Intel Code") to copy,
|
||||
* make derivatives, distribute, use and display any portion of the Covered
|
||||
* Code in any form, with the right to sublicense such rights; and
|
||||
*
|
||||
* 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
|
||||
* license (with the right to sublicense), under only those claims of Intel
|
||||
* patents that are infringed by the Original Intel Code, to make, use, sell,
|
||||
* offer to sell, and import the Covered Code and derivative works thereof
|
||||
* solely to the minimum extent necessary to exercise the above copyright
|
||||
* license, and in no event shall the patent license extend to any additions
|
||||
* to or modifications of the Original Intel Code. No other license or right
|
||||
* is granted directly or by implication, estoppel or otherwise;
|
||||
*
|
||||
* The above copyright and patent license is granted only if the following
|
||||
* conditions are met:
|
||||
*
|
||||
* 3. Conditions
|
||||
*
|
||||
* 3.1. Redistribution of Source with Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification with rights to further distribute source must include
|
||||
* the above Copyright Notice, the above License, this list of Conditions,
|
||||
* and the following Disclaimer and Export Compliance provision. In addition,
|
||||
* Licensee must cause all Covered Code to which Licensee contributes to
|
||||
* contain a file documenting the changes Licensee made to create that Covered
|
||||
* Code and the date of any change. Licensee must include in that file the
|
||||
* documentation of any changes made by any predecessor Licensee. Licensee
|
||||
* must include a prominent statement that the modification is derived,
|
||||
* directly or indirectly, from Original Intel Code.
|
||||
*
|
||||
* 3.2. Redistribution of Source with no Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification without rights to further distribute source must
|
||||
* include the following Disclaimer and Export Compliance provision in the
|
||||
* documentation and/or other materials provided with distribution. In
|
||||
* addition, Licensee may not authorize further sublicense of source of any
|
||||
* portion of the Covered Code, and must include terms to the effect that the
|
||||
* license from Licensee to its licensee is limited to the intellectual
|
||||
* property embodied in the software Licensee provides to its licensee, and
|
||||
* not to intellectual property embodied in modifications its licensee may
|
||||
* make.
|
||||
*
|
||||
* 3.3. Redistribution of Executable. Redistribution in executable form of any
|
||||
* substantial portion of the Covered Code or modification must reproduce the
|
||||
* above Copyright Notice, and the following Disclaimer and Export Compliance
|
||||
* provision in the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3.4. Intel retains all right, title, and interest in and to the Original
|
||||
* Intel Code.
|
||||
*
|
||||
* 3.5. Neither the name Intel nor any other trademark owned or controlled by
|
||||
* Intel shall be used in advertising or otherwise to promote the sale, use or
|
||||
* other dealings in products derived from or relating to the Covered Code
|
||||
* without prior written authorization from Intel.
|
||||
*
|
||||
* 4. Disclaimer and Export Compliance
|
||||
*
|
||||
* 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
|
||||
* HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
|
||||
* IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
|
||||
* INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
|
||||
* UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
|
||||
* PARTICULAR PURPOSE.
|
||||
*
|
||||
* 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
|
||||
* OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
|
||||
* COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
|
||||
* SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
|
||||
* CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
|
||||
* HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
|
||||
* SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
|
||||
* LIMITED REMEDY.
|
||||
*
|
||||
* 4.3. Licensee shall not export, either directly or indirectly, any of this
|
||||
* software or system incorporating such software without first obtaining any
|
||||
* required license or other approval from the U. S. Department of Commerce or
|
||||
* any other agency or department of the United States Government. In the
|
||||
* event Licensee exports any such software from the United States or
|
||||
* re-exports any such software from a foreign destination, Licensee shall
|
||||
* ensure that the distribution and export/re-export of the software is in
|
||||
* compliance with all laws, regulations, orders, or other restrictions of the
|
||||
* U.S. Export Administration Regulations. Licensee agrees that neither it nor
|
||||
* any of its subsidiaries will export/re-export any technical data, process,
|
||||
* software, or service, directly or indirectly, to any country for which the
|
||||
* United States government or any agency thereof requires an export license,
|
||||
* other governmental approval, or letter of assurance, without first obtaining
|
||||
* such license, approval or letter.
|
||||
*
|
||||
*****************************************************************************/
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#include "acpi.h"
|
||||
#include "accommon.h"
|
||||
@@ -121,6 +48,8 @@
|
||||
#define _COMPONENT ACPI_HARDWARE
|
||||
ACPI_MODULE_NAME ("hwgpe")
|
||||
|
||||
#if (!ACPI_REDUCED_HARDWARE) /* Entire module */
|
||||
|
||||
/* Local prototypes */
|
||||
|
||||
static ACPI_STATUS
|
||||
@@ -135,7 +64,6 @@ AcpiHwEnableWakeupGpeBlock (
|
||||
* FUNCTION: AcpiHwGetGpeRegisterBit
|
||||
*
|
||||
* PARAMETERS: GpeEventInfo - Info block for the GPE
|
||||
* GpeRegisterInfo - Info block for the GPE register
|
||||
*
|
||||
* RETURN: Register mask with a one in the GPE bit position
|
||||
*
|
||||
@@ -146,12 +74,11 @@ AcpiHwEnableWakeupGpeBlock (
|
||||
|
||||
UINT32
|
||||
AcpiHwGetGpeRegisterBit (
|
||||
ACPI_GPE_EVENT_INFO *GpeEventInfo,
|
||||
ACPI_GPE_REGISTER_INFO *GpeRegisterInfo)
|
||||
ACPI_GPE_EVENT_INFO *GpeEventInfo)
|
||||
{
|
||||
|
||||
return ((UINT32) 1 <<
|
||||
(GpeEventInfo->GpeNumber - GpeRegisterInfo->BaseGpeNumber));
|
||||
(GpeEventInfo->GpeNumber - GpeEventInfo->RegisterInfo->BaseGpeNumber));
|
||||
}
|
||||
|
||||
|
||||
@@ -200,7 +127,7 @@ AcpiHwLowSetGpe (
|
||||
|
||||
/* Set or clear just the bit that corresponds to this GPE */
|
||||
|
||||
RegisterBit = AcpiHwGetGpeRegisterBit (GpeEventInfo, GpeRegisterInfo);
|
||||
RegisterBit = AcpiHwGetGpeRegisterBit (GpeEventInfo);
|
||||
switch (Action)
|
||||
{
|
||||
case ACPI_GPE_CONDITIONAL_ENABLE:
|
||||
@@ -215,15 +142,18 @@ AcpiHwLowSetGpe (
|
||||
/*lint -fallthrough */
|
||||
|
||||
case ACPI_GPE_ENABLE:
|
||||
|
||||
ACPI_SET_BIT (EnableMask, RegisterBit);
|
||||
break;
|
||||
|
||||
case ACPI_GPE_DISABLE:
|
||||
|
||||
ACPI_CLEAR_BIT (EnableMask, RegisterBit);
|
||||
break;
|
||||
|
||||
default:
|
||||
ACPI_ERROR ((AE_INFO, "Invalid GPE Action, %u\n", Action));
|
||||
|
||||
ACPI_ERROR ((AE_INFO, "Invalid GPE Action, %u", Action));
|
||||
return (AE_BAD_PARAMETER);
|
||||
}
|
||||
|
||||
@@ -269,7 +199,7 @@ AcpiHwClearGpe (
|
||||
* Write a one to the appropriate bit in the status register to
|
||||
* clear this GPE.
|
||||
*/
|
||||
RegisterBit = AcpiHwGetGpeRegisterBit (GpeEventInfo, GpeRegisterInfo);
|
||||
RegisterBit = AcpiHwGetGpeRegisterBit (GpeEventInfo);
|
||||
|
||||
Status = AcpiHwWrite (RegisterBit,
|
||||
&GpeRegisterInfo->StatusAddress);
|
||||
@@ -311,13 +241,21 @@ AcpiHwGetGpeStatus (
|
||||
return (AE_BAD_PARAMETER);
|
||||
}
|
||||
|
||||
/* GPE currently handled? */
|
||||
|
||||
if ((GpeEventInfo->Flags & ACPI_GPE_DISPATCH_MASK) !=
|
||||
ACPI_GPE_DISPATCH_NONE)
|
||||
{
|
||||
LocalEventStatus |= ACPI_EVENT_FLAG_HAS_HANDLER;
|
||||
}
|
||||
|
||||
/* Get the info block for the entire GPE register */
|
||||
|
||||
GpeRegisterInfo = GpeEventInfo->RegisterInfo;
|
||||
|
||||
/* Get the register bitmask for this GPE */
|
||||
|
||||
RegisterBit = AcpiHwGetGpeRegisterBit (GpeEventInfo, GpeRegisterInfo);
|
||||
RegisterBit = AcpiHwGetGpeRegisterBit (GpeEventInfo);
|
||||
|
||||
/* GPE currently enabled? (enabled for runtime?) */
|
||||
|
||||
@@ -610,3 +548,4 @@ AcpiHwEnableAllWakeupGpes (
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
#endif /* !ACPI_REDUCED_HARDWARE */
|
||||
|
||||
464
minix/drivers/power/acpi/hardware/hwpci.c
Normal file
464
minix/drivers/power/acpi/hardware/hwpci.c
Normal file
@@ -0,0 +1,464 @@
|
||||
/*******************************************************************************
|
||||
*
|
||||
* Module Name: hwpci - Obtain PCI bus, device, and function numbers
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, 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.
|
||||
*/
|
||||
|
||||
#include "acpi.h"
|
||||
#include "accommon.h"
|
||||
|
||||
|
||||
#define _COMPONENT ACPI_NAMESPACE
|
||||
ACPI_MODULE_NAME ("hwpci")
|
||||
|
||||
|
||||
/* PCI configuration space values */
|
||||
|
||||
#define PCI_CFG_HEADER_TYPE_REG 0x0E
|
||||
#define PCI_CFG_PRIMARY_BUS_NUMBER_REG 0x18
|
||||
#define PCI_CFG_SECONDARY_BUS_NUMBER_REG 0x19
|
||||
|
||||
/* PCI header values */
|
||||
|
||||
#define PCI_HEADER_TYPE_MASK 0x7F
|
||||
#define PCI_TYPE_BRIDGE 0x01
|
||||
#define PCI_TYPE_CARDBUS_BRIDGE 0x02
|
||||
|
||||
typedef struct acpi_pci_device
|
||||
{
|
||||
ACPI_HANDLE Device;
|
||||
struct acpi_pci_device *Next;
|
||||
|
||||
} ACPI_PCI_DEVICE;
|
||||
|
||||
|
||||
/* Local prototypes */
|
||||
|
||||
static ACPI_STATUS
|
||||
AcpiHwBuildPciList (
|
||||
ACPI_HANDLE RootPciDevice,
|
||||
ACPI_HANDLE PciRegion,
|
||||
ACPI_PCI_DEVICE **ReturnListHead);
|
||||
|
||||
static ACPI_STATUS
|
||||
AcpiHwProcessPciList (
|
||||
ACPI_PCI_ID *PciId,
|
||||
ACPI_PCI_DEVICE *ListHead);
|
||||
|
||||
static void
|
||||
AcpiHwDeletePciList (
|
||||
ACPI_PCI_DEVICE *ListHead);
|
||||
|
||||
static ACPI_STATUS
|
||||
AcpiHwGetPciDeviceInfo (
|
||||
ACPI_PCI_ID *PciId,
|
||||
ACPI_HANDLE PciDevice,
|
||||
UINT16 *BusNumber,
|
||||
BOOLEAN *IsBridge);
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiHwDerivePciId
|
||||
*
|
||||
* PARAMETERS: PciId - Initial values for the PCI ID. May be
|
||||
* modified by this function.
|
||||
* RootPciDevice - A handle to a PCI device object. This
|
||||
* object must be a PCI Root Bridge having a
|
||||
* _HID value of either PNP0A03 or PNP0A08
|
||||
* PciRegion - A handle to a PCI configuration space
|
||||
* Operation Region being initialized
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: This function derives a full PCI ID for a PCI device,
|
||||
* consisting of a Segment number, Bus number, Device number,
|
||||
* and function code.
|
||||
*
|
||||
* The PCI hardware dynamically configures PCI bus numbers
|
||||
* depending on the bus topology discovered during system
|
||||
* initialization. This function is invoked during configuration
|
||||
* of a PCI_Config Operation Region in order to (possibly) update
|
||||
* the Bus/Device/Function numbers in the PciId with the actual
|
||||
* values as determined by the hardware and operating system
|
||||
* configuration.
|
||||
*
|
||||
* The PciId parameter is initially populated during the Operation
|
||||
* Region initialization. This function is then called, and is
|
||||
* will make any necessary modifications to the Bus, Device, or
|
||||
* Function number PCI ID subfields as appropriate for the
|
||||
* current hardware and OS configuration.
|
||||
*
|
||||
* NOTE: Created 08/2010. Replaces the previous OSL AcpiOsDerivePciId
|
||||
* interface since this feature is OS-independent. This module
|
||||
* specifically avoids any use of recursion by building a local
|
||||
* temporary device list.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiHwDerivePciId (
|
||||
ACPI_PCI_ID *PciId,
|
||||
ACPI_HANDLE RootPciDevice,
|
||||
ACPI_HANDLE PciRegion)
|
||||
{
|
||||
ACPI_STATUS Status;
|
||||
ACPI_PCI_DEVICE *ListHead = NULL;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE (HwDerivePciId);
|
||||
|
||||
|
||||
if (!PciId)
|
||||
{
|
||||
return_ACPI_STATUS (AE_BAD_PARAMETER);
|
||||
}
|
||||
|
||||
/* Build a list of PCI devices, from PciRegion up to RootPciDevice */
|
||||
|
||||
Status = AcpiHwBuildPciList (RootPciDevice, PciRegion, &ListHead);
|
||||
if (ACPI_SUCCESS (Status))
|
||||
{
|
||||
/* Walk the list, updating the PCI device/function/bus numbers */
|
||||
|
||||
Status = AcpiHwProcessPciList (PciId, ListHead);
|
||||
|
||||
/* Delete the list */
|
||||
|
||||
AcpiHwDeletePciList (ListHead);
|
||||
}
|
||||
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiHwBuildPciList
|
||||
*
|
||||
* PARAMETERS: RootPciDevice - A handle to a PCI device object. This
|
||||
* object is guaranteed to be a PCI Root
|
||||
* Bridge having a _HID value of either
|
||||
* PNP0A03 or PNP0A08
|
||||
* PciRegion - A handle to the PCI configuration space
|
||||
* Operation Region
|
||||
* ReturnListHead - Where the PCI device list is returned
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Builds a list of devices from the input PCI region up to the
|
||||
* Root PCI device for this namespace subtree.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
static ACPI_STATUS
|
||||
AcpiHwBuildPciList (
|
||||
ACPI_HANDLE RootPciDevice,
|
||||
ACPI_HANDLE PciRegion,
|
||||
ACPI_PCI_DEVICE **ReturnListHead)
|
||||
{
|
||||
ACPI_HANDLE CurrentDevice;
|
||||
ACPI_HANDLE ParentDevice;
|
||||
ACPI_STATUS Status;
|
||||
ACPI_PCI_DEVICE *ListElement;
|
||||
ACPI_PCI_DEVICE *ListHead = NULL;
|
||||
|
||||
|
||||
/*
|
||||
* Ascend namespace branch until the RootPciDevice is reached, building
|
||||
* a list of device nodes. Loop will exit when either the PCI device is
|
||||
* found, or the root of the namespace is reached.
|
||||
*/
|
||||
CurrentDevice = PciRegion;
|
||||
while (1)
|
||||
{
|
||||
Status = AcpiGetParent (CurrentDevice, &ParentDevice);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
/* Must delete the list before exit */
|
||||
|
||||
AcpiHwDeletePciList (*ReturnListHead);
|
||||
return (Status);
|
||||
}
|
||||
|
||||
/* Finished when we reach the PCI root device (PNP0A03 or PNP0A08) */
|
||||
|
||||
if (ParentDevice == RootPciDevice)
|
||||
{
|
||||
*ReturnListHead = ListHead;
|
||||
return (AE_OK);
|
||||
}
|
||||
|
||||
ListElement = ACPI_ALLOCATE (sizeof (ACPI_PCI_DEVICE));
|
||||
if (!ListElement)
|
||||
{
|
||||
/* Must delete the list before exit */
|
||||
|
||||
AcpiHwDeletePciList (*ReturnListHead);
|
||||
return (AE_NO_MEMORY);
|
||||
}
|
||||
|
||||
/* Put new element at the head of the list */
|
||||
|
||||
ListElement->Next = ListHead;
|
||||
ListElement->Device = ParentDevice;
|
||||
ListHead = ListElement;
|
||||
|
||||
CurrentDevice = ParentDevice;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiHwProcessPciList
|
||||
*
|
||||
* PARAMETERS: PciId - Initial values for the PCI ID. May be
|
||||
* modified by this function.
|
||||
* ListHead - Device list created by
|
||||
* AcpiHwBuildPciList
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Walk downward through the PCI device list, getting the device
|
||||
* info for each, via the PCI configuration space and updating
|
||||
* the PCI ID as necessary. Deletes the list during traversal.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
static ACPI_STATUS
|
||||
AcpiHwProcessPciList (
|
||||
ACPI_PCI_ID *PciId,
|
||||
ACPI_PCI_DEVICE *ListHead)
|
||||
{
|
||||
ACPI_STATUS Status = AE_OK;
|
||||
ACPI_PCI_DEVICE *Info;
|
||||
UINT16 BusNumber;
|
||||
BOOLEAN IsBridge = TRUE;
|
||||
|
||||
|
||||
ACPI_FUNCTION_NAME (HwProcessPciList);
|
||||
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_OPREGION,
|
||||
"Input PciId: Seg %4.4X Bus %4.4X Dev %4.4X Func %4.4X\n",
|
||||
PciId->Segment, PciId->Bus, PciId->Device, PciId->Function));
|
||||
|
||||
BusNumber = PciId->Bus;
|
||||
|
||||
/*
|
||||
* Descend down the namespace tree, collecting PCI device, function,
|
||||
* and bus numbers. BusNumber is only important for PCI bridges.
|
||||
* Algorithm: As we descend the tree, use the last valid PCI device,
|
||||
* function, and bus numbers that are discovered, and assign them
|
||||
* to the PCI ID for the target device.
|
||||
*/
|
||||
Info = ListHead;
|
||||
while (Info)
|
||||
{
|
||||
Status = AcpiHwGetPciDeviceInfo (PciId, Info->Device,
|
||||
&BusNumber, &IsBridge);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return (Status);
|
||||
}
|
||||
|
||||
Info = Info->Next;
|
||||
}
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_OPREGION,
|
||||
"Output PciId: Seg %4.4X Bus %4.4X Dev %4.4X Func %4.4X "
|
||||
"Status %X BusNumber %X IsBridge %X\n",
|
||||
PciId->Segment, PciId->Bus, PciId->Device, PciId->Function,
|
||||
Status, BusNumber, IsBridge));
|
||||
|
||||
return (AE_OK);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiHwDeletePciList
|
||||
*
|
||||
* PARAMETERS: ListHead - Device list created by
|
||||
* AcpiHwBuildPciList
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Free the entire PCI list.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
static void
|
||||
AcpiHwDeletePciList (
|
||||
ACPI_PCI_DEVICE *ListHead)
|
||||
{
|
||||
ACPI_PCI_DEVICE *Next;
|
||||
ACPI_PCI_DEVICE *Previous;
|
||||
|
||||
|
||||
Next = ListHead;
|
||||
while (Next)
|
||||
{
|
||||
Previous = Next;
|
||||
Next = Previous->Next;
|
||||
ACPI_FREE (Previous);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiHwGetPciDeviceInfo
|
||||
*
|
||||
* PARAMETERS: PciId - Initial values for the PCI ID. May be
|
||||
* modified by this function.
|
||||
* PciDevice - Handle for the PCI device object
|
||||
* BusNumber - Where a PCI bridge bus number is returned
|
||||
* IsBridge - Return value, indicates if this PCI
|
||||
* device is a PCI bridge
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Get the device info for a single PCI device object. Get the
|
||||
* _ADR (contains PCI device and function numbers), and for PCI
|
||||
* bridge devices, get the bus number from PCI configuration
|
||||
* space.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
static ACPI_STATUS
|
||||
AcpiHwGetPciDeviceInfo (
|
||||
ACPI_PCI_ID *PciId,
|
||||
ACPI_HANDLE PciDevice,
|
||||
UINT16 *BusNumber,
|
||||
BOOLEAN *IsBridge)
|
||||
{
|
||||
ACPI_STATUS Status;
|
||||
ACPI_OBJECT_TYPE ObjectType;
|
||||
UINT64 ReturnValue;
|
||||
UINT64 PciValue;
|
||||
|
||||
|
||||
/* We only care about objects of type Device */
|
||||
|
||||
Status = AcpiGetType (PciDevice, &ObjectType);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return (Status);
|
||||
}
|
||||
|
||||
if (ObjectType != ACPI_TYPE_DEVICE)
|
||||
{
|
||||
return (AE_OK);
|
||||
}
|
||||
|
||||
/* We need an _ADR. Ignore device if not present */
|
||||
|
||||
Status = AcpiUtEvaluateNumericObject (METHOD_NAME__ADR,
|
||||
PciDevice, &ReturnValue);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return (AE_OK);
|
||||
}
|
||||
|
||||
/*
|
||||
* From _ADR, get the PCI Device and Function and
|
||||
* update the PCI ID.
|
||||
*/
|
||||
PciId->Device = ACPI_HIWORD (ACPI_LODWORD (ReturnValue));
|
||||
PciId->Function = ACPI_LOWORD (ACPI_LODWORD (ReturnValue));
|
||||
|
||||
/*
|
||||
* If the previous device was a bridge, use the previous
|
||||
* device bus number
|
||||
*/
|
||||
if (*IsBridge)
|
||||
{
|
||||
PciId->Bus = *BusNumber;
|
||||
}
|
||||
|
||||
/*
|
||||
* Get the bus numbers from PCI Config space:
|
||||
*
|
||||
* First, get the PCI HeaderType
|
||||
*/
|
||||
*IsBridge = FALSE;
|
||||
Status = AcpiOsReadPciConfiguration (PciId,
|
||||
PCI_CFG_HEADER_TYPE_REG, &PciValue, 8);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return (Status);
|
||||
}
|
||||
|
||||
/* We only care about bridges (1=PciBridge, 2=CardBusBridge) */
|
||||
|
||||
PciValue &= PCI_HEADER_TYPE_MASK;
|
||||
|
||||
if ((PciValue != PCI_TYPE_BRIDGE) &&
|
||||
(PciValue != PCI_TYPE_CARDBUS_BRIDGE))
|
||||
{
|
||||
return (AE_OK);
|
||||
}
|
||||
|
||||
/* Bridge: Get the Primary BusNumber */
|
||||
|
||||
Status = AcpiOsReadPciConfiguration (PciId,
|
||||
PCI_CFG_PRIMARY_BUS_NUMBER_REG, &PciValue, 8);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return (Status);
|
||||
}
|
||||
|
||||
*IsBridge = TRUE;
|
||||
PciId->Bus = (UINT16) PciValue;
|
||||
|
||||
/* Bridge: Get the Secondary BusNumber */
|
||||
|
||||
Status = AcpiOsReadPciConfiguration (PciId,
|
||||
PCI_CFG_SECONDARY_BUS_NUMBER_REG, &PciValue, 8);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return (Status);
|
||||
}
|
||||
|
||||
*BusNumber = (UINT16) PciValue;
|
||||
return (AE_OK);
|
||||
}
|
||||
@@ -1,4 +1,3 @@
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* Module Name: hwregs - Read/write access functions for the various ACPI
|
||||
@@ -6,116 +5,42 @@
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
* 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.
|
||||
*
|
||||
* 2.1. This is your license from Intel Corp. under its intellectual property
|
||||
* rights. You may have additional license terms from the party that provided
|
||||
* you this software, covering your right to use that party's intellectual
|
||||
* property rights.
|
||||
* 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.
|
||||
*
|
||||
* 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
|
||||
* copy of the source code appearing in this file ("Covered Code") an
|
||||
* irrevocable, perpetual, worldwide license under Intel's copyrights in the
|
||||
* base code distributed originally by Intel ("Original Intel Code") to copy,
|
||||
* make derivatives, distribute, use and display any portion of the Covered
|
||||
* Code in any form, with the right to sublicense such rights; and
|
||||
*
|
||||
* 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
|
||||
* license (with the right to sublicense), under only those claims of Intel
|
||||
* patents that are infringed by the Original Intel Code, to make, use, sell,
|
||||
* offer to sell, and import the Covered Code and derivative works thereof
|
||||
* solely to the minimum extent necessary to exercise the above copyright
|
||||
* license, and in no event shall the patent license extend to any additions
|
||||
* to or modifications of the Original Intel Code. No other license or right
|
||||
* is granted directly or by implication, estoppel or otherwise;
|
||||
*
|
||||
* The above copyright and patent license is granted only if the following
|
||||
* conditions are met:
|
||||
*
|
||||
* 3. Conditions
|
||||
*
|
||||
* 3.1. Redistribution of Source with Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification with rights to further distribute source must include
|
||||
* the above Copyright Notice, the above License, this list of Conditions,
|
||||
* and the following Disclaimer and Export Compliance provision. In addition,
|
||||
* Licensee must cause all Covered Code to which Licensee contributes to
|
||||
* contain a file documenting the changes Licensee made to create that Covered
|
||||
* Code and the date of any change. Licensee must include in that file the
|
||||
* documentation of any changes made by any predecessor Licensee. Licensee
|
||||
* must include a prominent statement that the modification is derived,
|
||||
* directly or indirectly, from Original Intel Code.
|
||||
*
|
||||
* 3.2. Redistribution of Source with no Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification without rights to further distribute source must
|
||||
* include the following Disclaimer and Export Compliance provision in the
|
||||
* documentation and/or other materials provided with distribution. In
|
||||
* addition, Licensee may not authorize further sublicense of source of any
|
||||
* portion of the Covered Code, and must include terms to the effect that the
|
||||
* license from Licensee to its licensee is limited to the intellectual
|
||||
* property embodied in the software Licensee provides to its licensee, and
|
||||
* not to intellectual property embodied in modifications its licensee may
|
||||
* make.
|
||||
*
|
||||
* 3.3. Redistribution of Executable. Redistribution in executable form of any
|
||||
* substantial portion of the Covered Code or modification must reproduce the
|
||||
* above Copyright Notice, and the following Disclaimer and Export Compliance
|
||||
* provision in the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3.4. Intel retains all right, title, and interest in and to the Original
|
||||
* Intel Code.
|
||||
*
|
||||
* 3.5. Neither the name Intel nor any other trademark owned or controlled by
|
||||
* Intel shall be used in advertising or otherwise to promote the sale, use or
|
||||
* other dealings in products derived from or relating to the Covered Code
|
||||
* without prior written authorization from Intel.
|
||||
*
|
||||
* 4. Disclaimer and Export Compliance
|
||||
*
|
||||
* 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
|
||||
* HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
|
||||
* IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
|
||||
* INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
|
||||
* UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
|
||||
* PARTICULAR PURPOSE.
|
||||
*
|
||||
* 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
|
||||
* OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
|
||||
* COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
|
||||
* SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
|
||||
* CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
|
||||
* HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
|
||||
* SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
|
||||
* LIMITED REMEDY.
|
||||
*
|
||||
* 4.3. Licensee shall not export, either directly or indirectly, any of this
|
||||
* software or system incorporating such software without first obtaining any
|
||||
* required license or other approval from the U. S. Department of Commerce or
|
||||
* any other agency or department of the United States Government. In the
|
||||
* event Licensee exports any such software from the United States or
|
||||
* re-exports any such software from a foreign destination, Licensee shall
|
||||
* ensure that the distribution and export/re-export of the software is in
|
||||
* compliance with all laws, regulations, orders, or other restrictions of the
|
||||
* U.S. Export Administration Regulations. Licensee agrees that neither it nor
|
||||
* any of its subsidiaries will export/re-export any technical data, process,
|
||||
* software, or service, directly or indirectly, to any country for which the
|
||||
* United States government or any agency thereof requires an export license,
|
||||
* other governmental approval, or letter of assurance, without first obtaining
|
||||
* such license, approval or letter.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
#define __HWREGS_C__
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#include "acpi.h"
|
||||
#include "accommon.h"
|
||||
@@ -125,6 +50,8 @@
|
||||
ACPI_MODULE_NAME ("hwregs")
|
||||
|
||||
|
||||
#if (!ACPI_REDUCED_HARDWARE)
|
||||
|
||||
/* Local Prototypes */
|
||||
|
||||
static ACPI_STATUS
|
||||
@@ -139,6 +66,7 @@ AcpiHwWriteMultiple (
|
||||
ACPI_GENERIC_ADDRESS *RegisterA,
|
||||
ACPI_GENERIC_ADDRESS *RegisterB);
|
||||
|
||||
#endif /* !ACPI_REDUCED_HARDWARE */
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
@@ -242,6 +170,7 @@ AcpiHwRead (
|
||||
ACPI_GENERIC_ADDRESS *Reg)
|
||||
{
|
||||
UINT64 Address;
|
||||
UINT64 Value64;
|
||||
ACPI_STATUS Status;
|
||||
|
||||
|
||||
@@ -267,7 +196,9 @@ AcpiHwRead (
|
||||
if (Reg->SpaceId == ACPI_ADR_SPACE_SYSTEM_MEMORY)
|
||||
{
|
||||
Status = AcpiOsReadMemory ((ACPI_PHYSICAL_ADDRESS)
|
||||
Address, Value, Reg->BitWidth);
|
||||
Address, &Value64, Reg->BitWidth);
|
||||
|
||||
*Value = (UINT32) Value64;
|
||||
}
|
||||
else /* ACPI_ADR_SPACE_SYSTEM_IO, validated earlier */
|
||||
{
|
||||
@@ -326,7 +257,7 @@ AcpiHwWrite (
|
||||
if (Reg->SpaceId == ACPI_ADR_SPACE_SYSTEM_MEMORY)
|
||||
{
|
||||
Status = AcpiOsWriteMemory ((ACPI_PHYSICAL_ADDRESS)
|
||||
Address, Value, Reg->BitWidth);
|
||||
Address, (UINT64) Value, Reg->BitWidth);
|
||||
}
|
||||
else /* ACPI_ADR_SPACE_SYSTEM_IO, validated earlier */
|
||||
{
|
||||
@@ -343,6 +274,7 @@ AcpiHwWrite (
|
||||
}
|
||||
|
||||
|
||||
#if (!ACPI_REDUCED_HARDWARE)
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiHwClearAcpiStatus
|
||||
@@ -376,24 +308,26 @@ AcpiHwClearAcpiStatus (
|
||||
|
||||
Status = AcpiHwRegisterWrite (ACPI_REGISTER_PM1_STATUS,
|
||||
ACPI_BITMASK_ALL_FIXED_STATUS);
|
||||
|
||||
AcpiOsReleaseLock (AcpiGbl_HardwareLock, LockFlags);
|
||||
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
goto UnlockAndExit;
|
||||
goto Exit;
|
||||
}
|
||||
|
||||
/* Clear the GPE Bits in all GPE registers in all GPE blocks */
|
||||
|
||||
Status = AcpiEvWalkGpeList (AcpiHwClearGpeBlock, NULL);
|
||||
|
||||
UnlockAndExit:
|
||||
AcpiOsReleaseLock (AcpiGbl_HardwareLock, LockFlags);
|
||||
Exit:
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiHwGetRegisterBitMask
|
||||
* FUNCTION: AcpiHwGetBitRegisterInfo
|
||||
*
|
||||
* PARAMETERS: RegisterId - Index of ACPI Register to access
|
||||
*
|
||||
@@ -496,7 +430,6 @@ AcpiHwRegisterRead (
|
||||
&AcpiGbl_XPm1bStatus);
|
||||
break;
|
||||
|
||||
|
||||
case ACPI_REGISTER_PM1_ENABLE: /* PM1 A/B: 16-bit access each */
|
||||
|
||||
Status = AcpiHwReadMultiple (&Value,
|
||||
@@ -504,7 +437,6 @@ AcpiHwRegisterRead (
|
||||
&AcpiGbl_XPm1bEnable);
|
||||
break;
|
||||
|
||||
|
||||
case ACPI_REGISTER_PM1_CONTROL: /* PM1 A/B: 16-bit access each */
|
||||
|
||||
Status = AcpiHwReadMultiple (&Value,
|
||||
@@ -519,26 +451,23 @@ AcpiHwRegisterRead (
|
||||
Value &= ~ACPI_PM1_CONTROL_WRITEONLY_BITS;
|
||||
break;
|
||||
|
||||
|
||||
case ACPI_REGISTER_PM2_CONTROL: /* 8-bit access */
|
||||
|
||||
Status = AcpiHwRead (&Value, &AcpiGbl_FADT.XPm2ControlBlock);
|
||||
break;
|
||||
|
||||
|
||||
case ACPI_REGISTER_PM_TIMER: /* 32-bit access */
|
||||
|
||||
Status = AcpiHwRead (&Value, &AcpiGbl_FADT.XPmTimerBlock);
|
||||
break;
|
||||
|
||||
|
||||
case ACPI_REGISTER_SMI_COMMAND_BLOCK: /* 8-bit access */
|
||||
|
||||
Status = AcpiHwReadPort (AcpiGbl_FADT.SmiCommand, &Value, 8);
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
|
||||
ACPI_ERROR ((AE_INFO, "Unknown Register ID: 0x%X",
|
||||
RegisterId));
|
||||
Status = AE_BAD_PARAMETER;
|
||||
@@ -612,7 +541,6 @@ AcpiHwRegisterWrite (
|
||||
&AcpiGbl_XPm1bStatus);
|
||||
break;
|
||||
|
||||
|
||||
case ACPI_REGISTER_PM1_ENABLE: /* PM1 A/B: 16-bit access each */
|
||||
|
||||
Status = AcpiHwWriteMultiple (Value,
|
||||
@@ -620,9 +548,7 @@ AcpiHwRegisterWrite (
|
||||
&AcpiGbl_XPm1bEnable);
|
||||
break;
|
||||
|
||||
|
||||
case ACPI_REGISTER_PM1_CONTROL: /* PM1 A/B: 16-bit access each */
|
||||
|
||||
/*
|
||||
* Perform a read first to preserve certain bits (per ACPI spec)
|
||||
* Note: This includes SCI_EN, we never want to change this bit
|
||||
@@ -646,9 +572,7 @@ AcpiHwRegisterWrite (
|
||||
&AcpiGbl_FADT.XPm1bControlBlock);
|
||||
break;
|
||||
|
||||
|
||||
case ACPI_REGISTER_PM2_CONTROL: /* 8-bit access */
|
||||
|
||||
/*
|
||||
* For control registers, all reserved bits must be preserved,
|
||||
* as per the ACPI spec.
|
||||
@@ -666,13 +590,11 @@ AcpiHwRegisterWrite (
|
||||
Status = AcpiHwWrite (Value, &AcpiGbl_FADT.XPm2ControlBlock);
|
||||
break;
|
||||
|
||||
|
||||
case ACPI_REGISTER_PM_TIMER: /* 32-bit access */
|
||||
|
||||
Status = AcpiHwWrite (Value, &AcpiGbl_FADT.XPmTimerBlock);
|
||||
break;
|
||||
|
||||
|
||||
case ACPI_REGISTER_SMI_COMMAND_BLOCK: /* 8-bit access */
|
||||
|
||||
/* SMI_CMD is currently always in IO space */
|
||||
@@ -680,8 +602,8 @@ AcpiHwRegisterWrite (
|
||||
Status = AcpiHwWritePort (AcpiGbl_FADT.SmiCommand, Value, 8);
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
|
||||
ACPI_ERROR ((AE_INFO, "Unknown Register ID: 0x%X",
|
||||
RegisterId));
|
||||
Status = AE_BAD_PARAMETER;
|
||||
@@ -803,3 +725,4 @@ AcpiHwWriteMultiple (
|
||||
return (Status);
|
||||
}
|
||||
|
||||
#endif /* !ACPI_REDUCED_HARDWARE */
|
||||
|
||||
@@ -1,118 +1,46 @@
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* Name: hwsleep.c - ACPI Hardware Sleep/Wake Interface
|
||||
* Name: hwsleep.c - ACPI Hardware Sleep/Wake Support functions for the
|
||||
* original/legacy sleep/PM registers.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
* 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.
|
||||
*
|
||||
* 2.1. This is your license from Intel Corp. under its intellectual property
|
||||
* rights. You may have additional license terms from the party that provided
|
||||
* you this software, covering your right to use that party's intellectual
|
||||
* property rights.
|
||||
* 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.
|
||||
*
|
||||
* 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
|
||||
* copy of the source code appearing in this file ("Covered Code") an
|
||||
* irrevocable, perpetual, worldwide license under Intel's copyrights in the
|
||||
* base code distributed originally by Intel ("Original Intel Code") to copy,
|
||||
* make derivatives, distribute, use and display any portion of the Covered
|
||||
* Code in any form, with the right to sublicense such rights; and
|
||||
*
|
||||
* 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
|
||||
* license (with the right to sublicense), under only those claims of Intel
|
||||
* patents that are infringed by the Original Intel Code, to make, use, sell,
|
||||
* offer to sell, and import the Covered Code and derivative works thereof
|
||||
* solely to the minimum extent necessary to exercise the above copyright
|
||||
* license, and in no event shall the patent license extend to any additions
|
||||
* to or modifications of the Original Intel Code. No other license or right
|
||||
* is granted directly or by implication, estoppel or otherwise;
|
||||
*
|
||||
* The above copyright and patent license is granted only if the following
|
||||
* conditions are met:
|
||||
*
|
||||
* 3. Conditions
|
||||
*
|
||||
* 3.1. Redistribution of Source with Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification with rights to further distribute source must include
|
||||
* the above Copyright Notice, the above License, this list of Conditions,
|
||||
* and the following Disclaimer and Export Compliance provision. In addition,
|
||||
* Licensee must cause all Covered Code to which Licensee contributes to
|
||||
* contain a file documenting the changes Licensee made to create that Covered
|
||||
* Code and the date of any change. Licensee must include in that file the
|
||||
* documentation of any changes made by any predecessor Licensee. Licensee
|
||||
* must include a prominent statement that the modification is derived,
|
||||
* directly or indirectly, from Original Intel Code.
|
||||
*
|
||||
* 3.2. Redistribution of Source with no Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification without rights to further distribute source must
|
||||
* include the following Disclaimer and Export Compliance provision in the
|
||||
* documentation and/or other materials provided with distribution. In
|
||||
* addition, Licensee may not authorize further sublicense of source of any
|
||||
* portion of the Covered Code, and must include terms to the effect that the
|
||||
* license from Licensee to its licensee is limited to the intellectual
|
||||
* property embodied in the software Licensee provides to its licensee, and
|
||||
* not to intellectual property embodied in modifications its licensee may
|
||||
* make.
|
||||
*
|
||||
* 3.3. Redistribution of Executable. Redistribution in executable form of any
|
||||
* substantial portion of the Covered Code or modification must reproduce the
|
||||
* above Copyright Notice, and the following Disclaimer and Export Compliance
|
||||
* provision in the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3.4. Intel retains all right, title, and interest in and to the Original
|
||||
* Intel Code.
|
||||
*
|
||||
* 3.5. Neither the name Intel nor any other trademark owned or controlled by
|
||||
* Intel shall be used in advertising or otherwise to promote the sale, use or
|
||||
* other dealings in products derived from or relating to the Covered Code
|
||||
* without prior written authorization from Intel.
|
||||
*
|
||||
* 4. Disclaimer and Export Compliance
|
||||
*
|
||||
* 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
|
||||
* HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
|
||||
* IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
|
||||
* INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
|
||||
* UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
|
||||
* PARTICULAR PURPOSE.
|
||||
*
|
||||
* 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
|
||||
* OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
|
||||
* COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
|
||||
* SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
|
||||
* CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
|
||||
* HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
|
||||
* SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
|
||||
* LIMITED REMEDY.
|
||||
*
|
||||
* 4.3. Licensee shall not export, either directly or indirectly, any of this
|
||||
* software or system incorporating such software without first obtaining any
|
||||
* required license or other approval from the U. S. Department of Commerce or
|
||||
* any other agency or department of the United States Government. In the
|
||||
* event Licensee exports any such software from the United States or
|
||||
* re-exports any such software from a foreign destination, Licensee shall
|
||||
* ensure that the distribution and export/re-export of the software is in
|
||||
* compliance with all laws, regulations, orders, or other restrictions of the
|
||||
* U.S. Export Administration Regulations. Licensee agrees that neither it nor
|
||||
* any of its subsidiaries will export/re-export any technical data, process,
|
||||
* software, or service, directly or indirectly, to any country for which the
|
||||
* United States government or any agency thereof requires an export license,
|
||||
* other governmental approval, or letter of assurance, without first obtaining
|
||||
* such license, approval or letter.
|
||||
*
|
||||
*****************************************************************************/
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#include "acpi.h"
|
||||
#include "accommon.h"
|
||||
@@ -121,210 +49,36 @@
|
||||
ACPI_MODULE_NAME ("hwsleep")
|
||||
|
||||
|
||||
#if (!ACPI_REDUCED_HARDWARE) /* Entire module */
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiSetFirmwareWakingVector
|
||||
*
|
||||
* PARAMETERS: PhysicalAddress - 32-bit physical address of ACPI real mode
|
||||
* entry point.
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Sets the 32-bit FirmwareWakingVector field of the FACS
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiSetFirmwareWakingVector (
|
||||
UINT32 PhysicalAddress)
|
||||
{
|
||||
ACPI_FUNCTION_TRACE (AcpiSetFirmwareWakingVector);
|
||||
|
||||
|
||||
/* Set the 32-bit vector */
|
||||
|
||||
AcpiGbl_FACS->FirmwareWakingVector = PhysicalAddress;
|
||||
|
||||
/* Clear the 64-bit vector if it exists */
|
||||
|
||||
if ((AcpiGbl_FACS->Length > 32) && (AcpiGbl_FACS->Version >= 1))
|
||||
{
|
||||
AcpiGbl_FACS->XFirmwareWakingVector = 0;
|
||||
}
|
||||
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
}
|
||||
|
||||
ACPI_EXPORT_SYMBOL (AcpiSetFirmwareWakingVector)
|
||||
|
||||
|
||||
#if ACPI_MACHINE_WIDTH == 64
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiSetFirmwareWakingVector64
|
||||
*
|
||||
* PARAMETERS: PhysicalAddress - 64-bit physical address of ACPI protected
|
||||
* mode entry point.
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Sets the 64-bit X_FirmwareWakingVector field of the FACS, if
|
||||
* it exists in the table. This function is intended for use with
|
||||
* 64-bit host operating systems.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiSetFirmwareWakingVector64 (
|
||||
UINT64 PhysicalAddress)
|
||||
{
|
||||
ACPI_FUNCTION_TRACE (AcpiSetFirmwareWakingVector64);
|
||||
|
||||
|
||||
/* Determine if the 64-bit vector actually exists */
|
||||
|
||||
if ((AcpiGbl_FACS->Length <= 32) || (AcpiGbl_FACS->Version < 1))
|
||||
{
|
||||
return_ACPI_STATUS (AE_NOT_EXIST);
|
||||
}
|
||||
|
||||
/* Clear 32-bit vector, set the 64-bit X_ vector */
|
||||
|
||||
AcpiGbl_FACS->FirmwareWakingVector = 0;
|
||||
AcpiGbl_FACS->XFirmwareWakingVector = PhysicalAddress;
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
}
|
||||
|
||||
ACPI_EXPORT_SYMBOL (AcpiSetFirmwareWakingVector64)
|
||||
#endif
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiEnterSleepStatePrep
|
||||
* FUNCTION: AcpiHwLegacySleep
|
||||
*
|
||||
* PARAMETERS: SleepState - Which sleep state to enter
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Prepare to enter a system sleep state (see ACPI 2.0 spec p 231)
|
||||
* This function must execute with interrupts enabled.
|
||||
* We break sleeping into 2 stages so that OSPM can handle
|
||||
* various OS-specific tasks between the two steps.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiEnterSleepStatePrep (
|
||||
UINT8 SleepState)
|
||||
{
|
||||
ACPI_STATUS Status;
|
||||
ACPI_OBJECT_LIST ArgList;
|
||||
ACPI_OBJECT Arg;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE (AcpiEnterSleepStatePrep);
|
||||
|
||||
|
||||
/* _PSW methods could be run here to enable wake-on keyboard, LAN, etc. */
|
||||
|
||||
Status = AcpiGetSleepTypeData (SleepState,
|
||||
&AcpiGbl_SleepTypeA, &AcpiGbl_SleepTypeB);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
/* Execute the _PTS method (Prepare To Sleep) */
|
||||
|
||||
ArgList.Count = 1;
|
||||
ArgList.Pointer = &Arg;
|
||||
Arg.Type = ACPI_TYPE_INTEGER;
|
||||
Arg.Integer.Value = SleepState;
|
||||
|
||||
Status = AcpiEvaluateObject (NULL, METHOD_NAME__PTS, &ArgList, NULL);
|
||||
if (ACPI_FAILURE (Status) && Status != AE_NOT_FOUND)
|
||||
{
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
/* Setup the argument to the _SST method (System STatus) */
|
||||
|
||||
switch (SleepState)
|
||||
{
|
||||
case ACPI_STATE_S0:
|
||||
Arg.Integer.Value = ACPI_SST_WORKING;
|
||||
break;
|
||||
|
||||
case ACPI_STATE_S1:
|
||||
case ACPI_STATE_S2:
|
||||
case ACPI_STATE_S3:
|
||||
Arg.Integer.Value = ACPI_SST_SLEEPING;
|
||||
break;
|
||||
|
||||
case ACPI_STATE_S4:
|
||||
Arg.Integer.Value = ACPI_SST_SLEEP_CONTEXT;
|
||||
break;
|
||||
|
||||
default:
|
||||
Arg.Integer.Value = ACPI_SST_INDICATOR_OFF; /* Default is off */
|
||||
break;
|
||||
}
|
||||
|
||||
/*
|
||||
* Set the system indicators to show the desired sleep state.
|
||||
* _SST is an optional method (return no error if not found)
|
||||
*/
|
||||
Status = AcpiEvaluateObject (NULL, METHOD_NAME__SST, &ArgList, NULL);
|
||||
if (ACPI_FAILURE (Status) && Status != AE_NOT_FOUND)
|
||||
{
|
||||
ACPI_EXCEPTION ((AE_INFO, Status, "While executing method _SST"));
|
||||
}
|
||||
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
}
|
||||
|
||||
ACPI_EXPORT_SYMBOL (AcpiEnterSleepStatePrep)
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiEnterSleepState
|
||||
*
|
||||
* PARAMETERS: SleepState - Which sleep state to enter
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Enter a system sleep state
|
||||
* DESCRIPTION: Enter a system sleep state via the legacy FADT PM registers
|
||||
* THIS FUNCTION MUST BE CALLED WITH INTERRUPTS DISABLED
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiEnterSleepState (
|
||||
AcpiHwLegacySleep (
|
||||
UINT8 SleepState)
|
||||
{
|
||||
UINT32 Pm1aControl;
|
||||
UINT32 Pm1bControl;
|
||||
ACPI_BIT_REGISTER_INFO *SleepTypeRegInfo;
|
||||
ACPI_BIT_REGISTER_INFO *SleepEnableRegInfo;
|
||||
UINT32 Pm1aControl;
|
||||
UINT32 Pm1bControl;
|
||||
UINT32 InValue;
|
||||
ACPI_OBJECT_LIST ArgList;
|
||||
ACPI_OBJECT Arg;
|
||||
ACPI_STATUS Status;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE (AcpiEnterSleepState);
|
||||
ACPI_FUNCTION_TRACE (HwLegacySleep);
|
||||
|
||||
|
||||
if ((AcpiGbl_SleepTypeA > ACPI_SLEEP_TYPE_MAX) ||
|
||||
(AcpiGbl_SleepTypeB > ACPI_SLEEP_TYPE_MAX))
|
||||
{
|
||||
ACPI_ERROR ((AE_INFO, "Sleep values out of range: A=0x%X B=0x%X",
|
||||
AcpiGbl_SleepTypeA, AcpiGbl_SleepTypeB));
|
||||
return_ACPI_STATUS (AE_AML_OPERAND_VALUE);
|
||||
}
|
||||
|
||||
SleepTypeRegInfo = AcpiHwGetBitRegisterInfo (ACPI_BITREG_SLEEP_TYPE);
|
||||
SleepTypeRegInfo = AcpiHwGetBitRegisterInfo (ACPI_BITREG_SLEEP_TYPE);
|
||||
SleepEnableRegInfo = AcpiHwGetBitRegisterInfo (ACPI_BITREG_SLEEP_ENABLE);
|
||||
|
||||
/* Clear wake status */
|
||||
@@ -343,20 +97,6 @@ AcpiEnterSleepState (
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
if (SleepState != ACPI_STATE_S5)
|
||||
{
|
||||
/*
|
||||
* Disable BM arbitration. This feature is contained within an
|
||||
* optional register (PM2 Control), so ignore a BAD_ADDRESS
|
||||
* exception.
|
||||
*/
|
||||
Status = AcpiWriteBitRegister (ACPI_BITREG_ARB_DISABLE, 1);
|
||||
if (ACPI_FAILURE (Status) && (Status != AE_BAD_ADDRESS))
|
||||
{
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* 1) Disable/Clear all GPEs
|
||||
* 2) Enable all wakeup GPEs
|
||||
@@ -374,19 +114,6 @@ AcpiEnterSleepState (
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
/* Execute the _GTS method (Going To Sleep) */
|
||||
|
||||
ArgList.Count = 1;
|
||||
ArgList.Pointer = &Arg;
|
||||
Arg.Type = ACPI_TYPE_INTEGER;
|
||||
Arg.Integer.Value = SleepState;
|
||||
|
||||
Status = AcpiEvaluateObject (NULL, METHOD_NAME__GTS, &ArgList, NULL);
|
||||
if (ACPI_FAILURE (Status) && Status != AE_NOT_FOUND)
|
||||
{
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
/* Get current value of PM1A control */
|
||||
|
||||
Status = AcpiHwRegisterRead (ACPI_REGISTER_PM1_CONTROL,
|
||||
@@ -452,7 +179,7 @@ AcpiEnterSleepState (
|
||||
* to still read the right value. Ideally, this block would go
|
||||
* away entirely.
|
||||
*/
|
||||
AcpiOsStall (10000000);
|
||||
AcpiOsStall (10 * ACPI_USEC_PER_SEC);
|
||||
|
||||
Status = AcpiHwRegisterWrite (ACPI_REGISTER_PM1_CONTROL,
|
||||
SleepEnableRegInfo->AccessBitMask);
|
||||
@@ -462,7 +189,7 @@ AcpiEnterSleepState (
|
||||
}
|
||||
}
|
||||
|
||||
/* Wait until we enter sleep state */
|
||||
/* Wait for transition back to Working State */
|
||||
|
||||
do
|
||||
{
|
||||
@@ -472,110 +199,30 @@ AcpiEnterSleepState (
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
/* Spin until we wake */
|
||||
|
||||
} while (!InValue);
|
||||
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
}
|
||||
|
||||
ACPI_EXPORT_SYMBOL (AcpiEnterSleepState)
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiEnterSleepStateS4bios
|
||||
*
|
||||
* PARAMETERS: None
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Perform a S4 bios request.
|
||||
* THIS FUNCTION MUST BE CALLED WITH INTERRUPTS DISABLED
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiEnterSleepStateS4bios (
|
||||
void)
|
||||
{
|
||||
UINT32 InValue;
|
||||
ACPI_STATUS Status;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE (AcpiEnterSleepStateS4bios);
|
||||
|
||||
|
||||
/* Clear the wake status bit (PM1) */
|
||||
|
||||
Status = AcpiWriteBitRegister (ACPI_BITREG_WAKE_STATUS, ACPI_CLEAR_STATUS);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
Status = AcpiHwClearAcpiStatus ();
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
/*
|
||||
* 1) Disable/Clear all GPEs
|
||||
* 2) Enable all wakeup GPEs
|
||||
*/
|
||||
Status = AcpiHwDisableAllGpes ();
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
AcpiGbl_SystemAwakeAndRunning = FALSE;
|
||||
|
||||
Status = AcpiHwEnableAllWakeupGpes ();
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
ACPI_FLUSH_CPU_CACHE ();
|
||||
|
||||
Status = AcpiHwWritePort (AcpiGbl_FADT.SmiCommand,
|
||||
(UINT32) AcpiGbl_FADT.S4BiosRequest, 8);
|
||||
|
||||
do {
|
||||
AcpiOsStall(1000);
|
||||
Status = AcpiReadBitRegister (ACPI_BITREG_WAKE_STATUS, &InValue);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
} while (!InValue);
|
||||
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
}
|
||||
|
||||
ACPI_EXPORT_SYMBOL (AcpiEnterSleepStateS4bios)
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiLeaveSleepState
|
||||
* FUNCTION: AcpiHwLegacyWakePrep
|
||||
*
|
||||
* PARAMETERS: SleepState - Which sleep state we just exited
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Perform OS-independent ACPI cleanup after a sleep
|
||||
* DESCRIPTION: Perform the first state of OS-independent ACPI cleanup after a
|
||||
* sleep.
|
||||
* Called with interrupts ENABLED.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiLeaveSleepState (
|
||||
AcpiHwLegacyWakePrep (
|
||||
UINT8 SleepState)
|
||||
{
|
||||
ACPI_OBJECT_LIST ArgList;
|
||||
ACPI_OBJECT Arg;
|
||||
ACPI_STATUS Status;
|
||||
ACPI_BIT_REGISTER_INFO *SleepTypeRegInfo;
|
||||
ACPI_BIT_REGISTER_INFO *SleepEnableRegInfo;
|
||||
@@ -583,8 +230,7 @@ AcpiLeaveSleepState (
|
||||
UINT32 Pm1bControl;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE (AcpiLeaveSleepState);
|
||||
|
||||
ACPI_FUNCTION_TRACE (HwLegacyWakePrep);
|
||||
|
||||
/*
|
||||
* Set SLP_TYPE and SLP_EN to state S0.
|
||||
@@ -625,40 +271,42 @@ AcpiLeaveSleepState (
|
||||
}
|
||||
}
|
||||
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiHwLegacyWake
|
||||
*
|
||||
* PARAMETERS: SleepState - Which sleep state we just exited
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Perform OS-independent ACPI cleanup after a sleep
|
||||
* Called with interrupts ENABLED.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiHwLegacyWake (
|
||||
UINT8 SleepState)
|
||||
{
|
||||
ACPI_STATUS Status;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE (HwLegacyWake);
|
||||
|
||||
|
||||
/* Ensure EnterSleepStatePrep -> EnterSleepState ordering */
|
||||
|
||||
AcpiGbl_SleepTypeA = ACPI_SLEEP_TYPE_INVALID;
|
||||
|
||||
/* Setup parameter object */
|
||||
|
||||
ArgList.Count = 1;
|
||||
ArgList.Pointer = &Arg;
|
||||
Arg.Type = ACPI_TYPE_INTEGER;
|
||||
|
||||
/* Ignore any errors from these methods */
|
||||
|
||||
Arg.Integer.Value = ACPI_SST_WAKING;
|
||||
Status = AcpiEvaluateObject (NULL, METHOD_NAME__SST, &ArgList, NULL);
|
||||
if (ACPI_FAILURE (Status) && Status != AE_NOT_FOUND)
|
||||
{
|
||||
ACPI_EXCEPTION ((AE_INFO, Status, "During Method _SST"));
|
||||
}
|
||||
|
||||
Arg.Integer.Value = SleepState;
|
||||
Status = AcpiEvaluateObject (NULL, METHOD_NAME__BFS, &ArgList, NULL);
|
||||
if (ACPI_FAILURE (Status) && Status != AE_NOT_FOUND)
|
||||
{
|
||||
ACPI_EXCEPTION ((AE_INFO, Status, "During Method _BFS"));
|
||||
}
|
||||
|
||||
Status = AcpiEvaluateObject (NULL, METHOD_NAME__WAK, &ArgList, NULL);
|
||||
if (ACPI_FAILURE (Status) && Status != AE_NOT_FOUND)
|
||||
{
|
||||
ACPI_EXCEPTION ((AE_INFO, Status, "During Method _WAK"));
|
||||
}
|
||||
/* TBD: _WAK "sometimes" returns stuff - do we want to look at it? */
|
||||
AcpiHwExecuteSleepMethod (METHOD_PATHNAME__SST, ACPI_SST_WAKING);
|
||||
|
||||
/*
|
||||
* GPEs must be enabled before _WAK is called as GPEs
|
||||
* might get fired there
|
||||
*
|
||||
* Restore the GPEs:
|
||||
* 1) Disable/Clear all GPEs
|
||||
* 2) Enable all runtime GPEs
|
||||
@@ -668,7 +316,6 @@ AcpiLeaveSleepState (
|
||||
{
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
AcpiGbl_SystemAwakeAndRunning = TRUE;
|
||||
|
||||
Status = AcpiHwEnableAllRuntimeGpes ();
|
||||
if (ACPI_FAILURE (Status))
|
||||
@@ -676,6 +323,20 @@ AcpiLeaveSleepState (
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
/*
|
||||
* Now we can execute _WAK, etc. Some machines require that the GPEs
|
||||
* are enabled before the wake methods are executed.
|
||||
*/
|
||||
AcpiHwExecuteSleepMethod (METHOD_PATHNAME__WAK, SleepState);
|
||||
|
||||
/*
|
||||
* Some BIOS code assumes that WAK_STS will be cleared on resume
|
||||
* and use it to determine whether the system is rebooting or
|
||||
* resuming. Clear WAK_STS for compatibility.
|
||||
*/
|
||||
(void) AcpiWriteBitRegister (ACPI_BITREG_WAKE_STATUS, ACPI_CLEAR_STATUS);
|
||||
AcpiGbl_SystemAwakeAndRunning = TRUE;
|
||||
|
||||
/* Enable power button */
|
||||
|
||||
(void) AcpiWriteBitRegister(
|
||||
@@ -686,26 +347,8 @@ AcpiLeaveSleepState (
|
||||
AcpiGbl_FixedEventInfo[ACPI_EVENT_POWER_BUTTON].StatusRegisterId,
|
||||
ACPI_CLEAR_STATUS);
|
||||
|
||||
/*
|
||||
* Enable BM arbitration. This feature is contained within an
|
||||
* optional register (PM2 Control), so ignore a BAD_ADDRESS
|
||||
* exception.
|
||||
*/
|
||||
Status = AcpiWriteBitRegister (ACPI_BITREG_ARB_DISABLE, 0);
|
||||
if (ACPI_FAILURE (Status) && (Status != AE_BAD_ADDRESS))
|
||||
{
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
Arg.Integer.Value = ACPI_SST_WORKING;
|
||||
Status = AcpiEvaluateObject (NULL, METHOD_NAME__SST, &ArgList, NULL);
|
||||
if (ACPI_FAILURE (Status) && Status != AE_NOT_FOUND)
|
||||
{
|
||||
ACPI_EXCEPTION ((AE_INFO, Status, "During Method _SST"));
|
||||
}
|
||||
|
||||
AcpiHwExecuteSleepMethod (METHOD_PATHNAME__SST, ACPI_SST_WORKING);
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
ACPI_EXPORT_SYMBOL (AcpiLeaveSleepState)
|
||||
|
||||
#endif /* !ACPI_REDUCED_HARDWARE */
|
||||
|
||||
@@ -1,118 +1,47 @@
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* Name: hwtimer.c - ACPI Power Management Timer Interface
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
* 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.
|
||||
*
|
||||
* 2.1. This is your license from Intel Corp. under its intellectual property
|
||||
* rights. You may have additional license terms from the party that provided
|
||||
* you this software, covering your right to use that party's intellectual
|
||||
* property rights.
|
||||
* 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.
|
||||
*
|
||||
* 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
|
||||
* copy of the source code appearing in this file ("Covered Code") an
|
||||
* irrevocable, perpetual, worldwide license under Intel's copyrights in the
|
||||
* base code distributed originally by Intel ("Original Intel Code") to copy,
|
||||
* make derivatives, distribute, use and display any portion of the Covered
|
||||
* Code in any form, with the right to sublicense such rights; and
|
||||
*
|
||||
* 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
|
||||
* license (with the right to sublicense), under only those claims of Intel
|
||||
* patents that are infringed by the Original Intel Code, to make, use, sell,
|
||||
* offer to sell, and import the Covered Code and derivative works thereof
|
||||
* solely to the minimum extent necessary to exercise the above copyright
|
||||
* license, and in no event shall the patent license extend to any additions
|
||||
* to or modifications of the Original Intel Code. No other license or right
|
||||
* is granted directly or by implication, estoppel or otherwise;
|
||||
*
|
||||
* The above copyright and patent license is granted only if the following
|
||||
* conditions are met:
|
||||
*
|
||||
* 3. Conditions
|
||||
*
|
||||
* 3.1. Redistribution of Source with Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification with rights to further distribute source must include
|
||||
* the above Copyright Notice, the above License, this list of Conditions,
|
||||
* and the following Disclaimer and Export Compliance provision. In addition,
|
||||
* Licensee must cause all Covered Code to which Licensee contributes to
|
||||
* contain a file documenting the changes Licensee made to create that Covered
|
||||
* Code and the date of any change. Licensee must include in that file the
|
||||
* documentation of any changes made by any predecessor Licensee. Licensee
|
||||
* must include a prominent statement that the modification is derived,
|
||||
* directly or indirectly, from Original Intel Code.
|
||||
*
|
||||
* 3.2. Redistribution of Source with no Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification without rights to further distribute source must
|
||||
* include the following Disclaimer and Export Compliance provision in the
|
||||
* documentation and/or other materials provided with distribution. In
|
||||
* addition, Licensee may not authorize further sublicense of source of any
|
||||
* portion of the Covered Code, and must include terms to the effect that the
|
||||
* license from Licensee to its licensee is limited to the intellectual
|
||||
* property embodied in the software Licensee provides to its licensee, and
|
||||
* not to intellectual property embodied in modifications its licensee may
|
||||
* make.
|
||||
*
|
||||
* 3.3. Redistribution of Executable. Redistribution in executable form of any
|
||||
* substantial portion of the Covered Code or modification must reproduce the
|
||||
* above Copyright Notice, and the following Disclaimer and Export Compliance
|
||||
* provision in the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3.4. Intel retains all right, title, and interest in and to the Original
|
||||
* Intel Code.
|
||||
*
|
||||
* 3.5. Neither the name Intel nor any other trademark owned or controlled by
|
||||
* Intel shall be used in advertising or otherwise to promote the sale, use or
|
||||
* other dealings in products derived from or relating to the Covered Code
|
||||
* without prior written authorization from Intel.
|
||||
*
|
||||
* 4. Disclaimer and Export Compliance
|
||||
*
|
||||
* 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
|
||||
* HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
|
||||
* IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
|
||||
* INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
|
||||
* UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
|
||||
* PARTICULAR PURPOSE.
|
||||
*
|
||||
* 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
|
||||
* OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
|
||||
* COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
|
||||
* SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
|
||||
* CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
|
||||
* HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
|
||||
* SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
|
||||
* LIMITED REMEDY.
|
||||
*
|
||||
* 4.3. Licensee shall not export, either directly or indirectly, any of this
|
||||
* software or system incorporating such software without first obtaining any
|
||||
* required license or other approval from the U. S. Department of Commerce or
|
||||
* any other agency or department of the United States Government. In the
|
||||
* event Licensee exports any such software from the United States or
|
||||
* re-exports any such software from a foreign destination, Licensee shall
|
||||
* ensure that the distribution and export/re-export of the software is in
|
||||
* compliance with all laws, regulations, orders, or other restrictions of the
|
||||
* U.S. Export Administration Regulations. Licensee agrees that neither it nor
|
||||
* any of its subsidiaries will export/re-export any technical data, process,
|
||||
* software, or service, directly or indirectly, to any country for which the
|
||||
* United States government or any agency thereof requires an export license,
|
||||
* other governmental approval, or letter of assurance, without first obtaining
|
||||
* such license, approval or letter.
|
||||
*
|
||||
*****************************************************************************/
|
||||
* 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 EXPORT_ACPI_INTERFACES
|
||||
|
||||
#include "acpi.h"
|
||||
#include "accommon.h"
|
||||
@@ -121,6 +50,7 @@
|
||||
ACPI_MODULE_NAME ("hwtimer")
|
||||
|
||||
|
||||
#if (!ACPI_REDUCED_HARDWARE) /* Entire module */
|
||||
/******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiGetTimerResolution
|
||||
@@ -187,8 +117,14 @@ AcpiGetTimer (
|
||||
return_ACPI_STATUS (AE_BAD_PARAMETER);
|
||||
}
|
||||
|
||||
Status = AcpiHwRead (Ticks, &AcpiGbl_FADT.XPmTimerBlock);
|
||||
/* ACPI 5.0A: PM Timer is optional */
|
||||
|
||||
if (!AcpiGbl_FADT.XPmTimerBlock.Address)
|
||||
{
|
||||
return_ACPI_STATUS (AE_SUPPORT);
|
||||
}
|
||||
|
||||
Status = AcpiHwRead (Ticks, &AcpiGbl_FADT.XPmTimerBlock);
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
@@ -215,7 +151,7 @@ ACPI_EXPORT_SYMBOL (AcpiGetTimer)
|
||||
* a versatile and accurate timer.
|
||||
*
|
||||
* Note that this function accommodates only a single timer
|
||||
* rollover. Thus for 24-bit timers, this function should only
|
||||
* rollover. Thus for 24-bit timers, this function should only
|
||||
* be used for calculating durations less than ~4.6 seconds
|
||||
* (~20 minutes for 32-bit timers) -- calculations below:
|
||||
*
|
||||
@@ -243,6 +179,13 @@ AcpiGetTimerDuration (
|
||||
return_ACPI_STATUS (AE_BAD_PARAMETER);
|
||||
}
|
||||
|
||||
/* ACPI 5.0A: PM Timer is optional */
|
||||
|
||||
if (!AcpiGbl_FADT.XPmTimerBlock.Address)
|
||||
{
|
||||
return_ACPI_STATUS (AE_SUPPORT);
|
||||
}
|
||||
|
||||
/*
|
||||
* Compute Tick Delta:
|
||||
* Handle (max one) timer rollovers on 24-bit versus 32-bit timers.
|
||||
@@ -275,10 +218,11 @@ AcpiGetTimerDuration (
|
||||
/*
|
||||
* Compute Duration (Requires a 64-bit multiply and divide):
|
||||
*
|
||||
* TimeElapsed = (DeltaTicks * 1000000) / PM_TIMER_FREQUENCY;
|
||||
* TimeElapsed (microseconds) =
|
||||
* (DeltaTicks * ACPI_USEC_PER_SEC) / ACPI_PM_TIMER_FREQUENCY;
|
||||
*/
|
||||
Status = AcpiUtShortDivide (((UINT64) DeltaTicks) * 1000000,
|
||||
PM_TIMER_FREQUENCY, &Quotient, NULL);
|
||||
Status = AcpiUtShortDivide (((UINT64) DeltaTicks) * ACPI_USEC_PER_SEC,
|
||||
ACPI_PM_TIMER_FREQUENCY, &Quotient, NULL);
|
||||
|
||||
*TimeElapsed = (UINT32) Quotient;
|
||||
return_ACPI_STATUS (Status);
|
||||
@@ -286,3 +230,4 @@ AcpiGetTimerDuration (
|
||||
|
||||
ACPI_EXPORT_SYMBOL (AcpiGetTimerDuration)
|
||||
|
||||
#endif /* !ACPI_REDUCED_HARDWARE */
|
||||
|
||||
@@ -1,120 +1,45 @@
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* Module Name: hwvalid - I/O request validation
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
* 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.
|
||||
*
|
||||
* 2.1. This is your license from Intel Corp. under its intellectual property
|
||||
* rights. You may have additional license terms from the party that provided
|
||||
* you this software, covering your right to use that party's intellectual
|
||||
* property rights.
|
||||
* 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.
|
||||
*
|
||||
* 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
|
||||
* copy of the source code appearing in this file ("Covered Code") an
|
||||
* irrevocable, perpetual, worldwide license under Intel's copyrights in the
|
||||
* base code distributed originally by Intel ("Original Intel Code") to copy,
|
||||
* make derivatives, distribute, use and display any portion of the Covered
|
||||
* Code in any form, with the right to sublicense such rights; and
|
||||
*
|
||||
* 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
|
||||
* license (with the right to sublicense), under only those claims of Intel
|
||||
* patents that are infringed by the Original Intel Code, to make, use, sell,
|
||||
* offer to sell, and import the Covered Code and derivative works thereof
|
||||
* solely to the minimum extent necessary to exercise the above copyright
|
||||
* license, and in no event shall the patent license extend to any additions
|
||||
* to or modifications of the Original Intel Code. No other license or right
|
||||
* is granted directly or by implication, estoppel or otherwise;
|
||||
*
|
||||
* The above copyright and patent license is granted only if the following
|
||||
* conditions are met:
|
||||
*
|
||||
* 3. Conditions
|
||||
*
|
||||
* 3.1. Redistribution of Source with Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification with rights to further distribute source must include
|
||||
* the above Copyright Notice, the above License, this list of Conditions,
|
||||
* and the following Disclaimer and Export Compliance provision. In addition,
|
||||
* Licensee must cause all Covered Code to which Licensee contributes to
|
||||
* contain a file documenting the changes Licensee made to create that Covered
|
||||
* Code and the date of any change. Licensee must include in that file the
|
||||
* documentation of any changes made by any predecessor Licensee. Licensee
|
||||
* must include a prominent statement that the modification is derived,
|
||||
* directly or indirectly, from Original Intel Code.
|
||||
*
|
||||
* 3.2. Redistribution of Source with no Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification without rights to further distribute source must
|
||||
* include the following Disclaimer and Export Compliance provision in the
|
||||
* documentation and/or other materials provided with distribution. In
|
||||
* addition, Licensee may not authorize further sublicense of source of any
|
||||
* portion of the Covered Code, and must include terms to the effect that the
|
||||
* license from Licensee to its licensee is limited to the intellectual
|
||||
* property embodied in the software Licensee provides to its licensee, and
|
||||
* not to intellectual property embodied in modifications its licensee may
|
||||
* make.
|
||||
*
|
||||
* 3.3. Redistribution of Executable. Redistribution in executable form of any
|
||||
* substantial portion of the Covered Code or modification must reproduce the
|
||||
* above Copyright Notice, and the following Disclaimer and Export Compliance
|
||||
* provision in the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3.4. Intel retains all right, title, and interest in and to the Original
|
||||
* Intel Code.
|
||||
*
|
||||
* 3.5. Neither the name Intel nor any other trademark owned or controlled by
|
||||
* Intel shall be used in advertising or otherwise to promote the sale, use or
|
||||
* other dealings in products derived from or relating to the Covered Code
|
||||
* without prior written authorization from Intel.
|
||||
*
|
||||
* 4. Disclaimer and Export Compliance
|
||||
*
|
||||
* 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
|
||||
* HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
|
||||
* IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
|
||||
* INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
|
||||
* UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
|
||||
* PARTICULAR PURPOSE.
|
||||
*
|
||||
* 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
|
||||
* OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
|
||||
* COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
|
||||
* SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
|
||||
* CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
|
||||
* HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
|
||||
* SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
|
||||
* LIMITED REMEDY.
|
||||
*
|
||||
* 4.3. Licensee shall not export, either directly or indirectly, any of this
|
||||
* software or system incorporating such software without first obtaining any
|
||||
* required license or other approval from the U. S. Department of Commerce or
|
||||
* any other agency or department of the United States Government. In the
|
||||
* event Licensee exports any such software from the United States or
|
||||
* re-exports any such software from a foreign destination, Licensee shall
|
||||
* ensure that the distribution and export/re-export of the software is in
|
||||
* compliance with all laws, regulations, orders, or other restrictions of the
|
||||
* U.S. Export Administration Regulations. Licensee agrees that neither it nor
|
||||
* any of its subsidiaries will export/re-export any technical data, process,
|
||||
* software, or service, directly or indirectly, to any country for which the
|
||||
* United States government or any agency thereof requires an export license,
|
||||
* other governmental approval, or letter of assurance, without first obtaining
|
||||
* such license, approval or letter.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
#define __HWVALID_C__
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#include "acpi.h"
|
||||
#include "accommon.h"
|
||||
@@ -221,6 +146,8 @@ AcpiHwValidateIoRequest (
|
||||
(BitWidth != 16) &&
|
||||
(BitWidth != 32))
|
||||
{
|
||||
ACPI_ERROR ((AE_INFO,
|
||||
"Bad BitWidth parameter: %8.8X", BitWidth));
|
||||
return (AE_BAD_PARAMETER);
|
||||
}
|
||||
|
||||
@@ -434,5 +361,3 @@ AcpiHwWritePort (
|
||||
|
||||
return (AE_OK);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,118 +1,47 @@
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* Module Name: hwxface - Public ACPICA hardware interfaces
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
* 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.
|
||||
*
|
||||
* 2.1. This is your license from Intel Corp. under its intellectual property
|
||||
* rights. You may have additional license terms from the party that provided
|
||||
* you this software, covering your right to use that party's intellectual
|
||||
* property rights.
|
||||
* 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.
|
||||
*
|
||||
* 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
|
||||
* copy of the source code appearing in this file ("Covered Code") an
|
||||
* irrevocable, perpetual, worldwide license under Intel's copyrights in the
|
||||
* base code distributed originally by Intel ("Original Intel Code") to copy,
|
||||
* make derivatives, distribute, use and display any portion of the Covered
|
||||
* Code in any form, with the right to sublicense such rights; and
|
||||
*
|
||||
* 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
|
||||
* license (with the right to sublicense), under only those claims of Intel
|
||||
* patents that are infringed by the Original Intel Code, to make, use, sell,
|
||||
* offer to sell, and import the Covered Code and derivative works thereof
|
||||
* solely to the minimum extent necessary to exercise the above copyright
|
||||
* license, and in no event shall the patent license extend to any additions
|
||||
* to or modifications of the Original Intel Code. No other license or right
|
||||
* is granted directly or by implication, estoppel or otherwise;
|
||||
*
|
||||
* The above copyright and patent license is granted only if the following
|
||||
* conditions are met:
|
||||
*
|
||||
* 3. Conditions
|
||||
*
|
||||
* 3.1. Redistribution of Source with Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification with rights to further distribute source must include
|
||||
* the above Copyright Notice, the above License, this list of Conditions,
|
||||
* and the following Disclaimer and Export Compliance provision. In addition,
|
||||
* Licensee must cause all Covered Code to which Licensee contributes to
|
||||
* contain a file documenting the changes Licensee made to create that Covered
|
||||
* Code and the date of any change. Licensee must include in that file the
|
||||
* documentation of any changes made by any predecessor Licensee. Licensee
|
||||
* must include a prominent statement that the modification is derived,
|
||||
* directly or indirectly, from Original Intel Code.
|
||||
*
|
||||
* 3.2. Redistribution of Source with no Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification without rights to further distribute source must
|
||||
* include the following Disclaimer and Export Compliance provision in the
|
||||
* documentation and/or other materials provided with distribution. In
|
||||
* addition, Licensee may not authorize further sublicense of source of any
|
||||
* portion of the Covered Code, and must include terms to the effect that the
|
||||
* license from Licensee to its licensee is limited to the intellectual
|
||||
* property embodied in the software Licensee provides to its licensee, and
|
||||
* not to intellectual property embodied in modifications its licensee may
|
||||
* make.
|
||||
*
|
||||
* 3.3. Redistribution of Executable. Redistribution in executable form of any
|
||||
* substantial portion of the Covered Code or modification must reproduce the
|
||||
* above Copyright Notice, and the following Disclaimer and Export Compliance
|
||||
* provision in the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3.4. Intel retains all right, title, and interest in and to the Original
|
||||
* Intel Code.
|
||||
*
|
||||
* 3.5. Neither the name Intel nor any other trademark owned or controlled by
|
||||
* Intel shall be used in advertising or otherwise to promote the sale, use or
|
||||
* other dealings in products derived from or relating to the Covered Code
|
||||
* without prior written authorization from Intel.
|
||||
*
|
||||
* 4. Disclaimer and Export Compliance
|
||||
*
|
||||
* 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
|
||||
* HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
|
||||
* IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
|
||||
* INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
|
||||
* UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
|
||||
* PARTICULAR PURPOSE.
|
||||
*
|
||||
* 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
|
||||
* OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
|
||||
* COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
|
||||
* SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
|
||||
* CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
|
||||
* HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
|
||||
* SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
|
||||
* LIMITED REMEDY.
|
||||
*
|
||||
* 4.3. Licensee shall not export, either directly or indirectly, any of this
|
||||
* software or system incorporating such software without first obtaining any
|
||||
* required license or other approval from the U. S. Department of Commerce or
|
||||
* any other agency or department of the United States Government. In the
|
||||
* event Licensee exports any such software from the United States or
|
||||
* re-exports any such software from a foreign destination, Licensee shall
|
||||
* ensure that the distribution and export/re-export of the software is in
|
||||
* compliance with all laws, regulations, orders, or other restrictions of the
|
||||
* U.S. Export Administration Regulations. Licensee agrees that neither it nor
|
||||
* any of its subsidiaries will export/re-export any technical data, process,
|
||||
* software, or service, directly or indirectly, to any country for which the
|
||||
* United States government or any agency thereof requires an export license,
|
||||
* other governmental approval, or letter of assurance, without first obtaining
|
||||
* such license, approval or letter.
|
||||
*
|
||||
*****************************************************************************/
|
||||
* 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 EXPORT_ACPI_INTERFACES
|
||||
|
||||
#include "acpi.h"
|
||||
#include "accommon.h"
|
||||
@@ -163,9 +92,15 @@ AcpiReset (
|
||||
* For I/O space, write directly to the OSL. This bypasses the port
|
||||
* validation mechanism, which may block a valid write to the reset
|
||||
* register.
|
||||
*
|
||||
* NOTE:
|
||||
* The ACPI spec requires the reset register width to be 8, so we
|
||||
* hardcode it here and ignore the FADT value. This maintains
|
||||
* compatibility with other ACPI implementations that have allowed
|
||||
* BIOS code with bad register width values to go unnoticed.
|
||||
*/
|
||||
Status = AcpiOsWritePort ((ACPI_IO_ADDRESS) ResetReg->Address,
|
||||
AcpiGbl_FADT.ResetValue, ResetReg->BitWidth);
|
||||
AcpiGbl_FADT.ResetValue, ACPI_RESET_REGISTER_WIDTH);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -204,7 +139,8 @@ AcpiRead (
|
||||
UINT64 *ReturnValue,
|
||||
ACPI_GENERIC_ADDRESS *Reg)
|
||||
{
|
||||
UINT32 Value;
|
||||
UINT32 ValueLo;
|
||||
UINT32 ValueHi;
|
||||
UINT32 Width;
|
||||
UINT64 Address;
|
||||
ACPI_STATUS Status;
|
||||
@@ -226,66 +162,52 @@ AcpiRead (
|
||||
return (Status);
|
||||
}
|
||||
|
||||
Width = Reg->BitWidth;
|
||||
if (Width == 64)
|
||||
{
|
||||
Width = 32; /* Break into two 32-bit transfers */
|
||||
}
|
||||
|
||||
/* Initialize entire 64-bit return value to zero */
|
||||
|
||||
*ReturnValue = 0;
|
||||
Value = 0;
|
||||
|
||||
/*
|
||||
* Two address spaces supported: Memory or IO. PCI_Config is
|
||||
* Two address spaces supported: Memory or I/O. PCI_Config is
|
||||
* not supported here because the GAS structure is insufficient
|
||||
*/
|
||||
if (Reg->SpaceId == ACPI_ADR_SPACE_SYSTEM_MEMORY)
|
||||
{
|
||||
Status = AcpiOsReadMemory ((ACPI_PHYSICAL_ADDRESS)
|
||||
Address, &Value, Width);
|
||||
Address, ReturnValue, Reg->BitWidth);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return (Status);
|
||||
}
|
||||
*ReturnValue = Value;
|
||||
|
||||
if (Reg->BitWidth == 64)
|
||||
{
|
||||
/* Read the top 32 bits */
|
||||
|
||||
Status = AcpiOsReadMemory ((ACPI_PHYSICAL_ADDRESS)
|
||||
(Address + 4), &Value, 32);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return (Status);
|
||||
}
|
||||
*ReturnValue |= ((UINT64) Value << 32);
|
||||
}
|
||||
}
|
||||
else /* ACPI_ADR_SPACE_SYSTEM_IO, validated earlier */
|
||||
{
|
||||
ValueLo = 0;
|
||||
ValueHi = 0;
|
||||
|
||||
Width = Reg->BitWidth;
|
||||
if (Width == 64)
|
||||
{
|
||||
Width = 32; /* Break into two 32-bit transfers */
|
||||
}
|
||||
|
||||
Status = AcpiHwReadPort ((ACPI_IO_ADDRESS)
|
||||
Address, &Value, Width);
|
||||
Address, &ValueLo, Width);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return (Status);
|
||||
}
|
||||
*ReturnValue = Value;
|
||||
|
||||
if (Reg->BitWidth == 64)
|
||||
{
|
||||
/* Read the top 32 bits */
|
||||
|
||||
Status = AcpiHwReadPort ((ACPI_IO_ADDRESS)
|
||||
(Address + 4), &Value, 32);
|
||||
(Address + 4), &ValueHi, 32);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return (Status);
|
||||
}
|
||||
*ReturnValue |= ((UINT64) Value << 32);
|
||||
}
|
||||
|
||||
/* Set the return value only if status is AE_OK */
|
||||
|
||||
*ReturnValue = (ValueLo | ((UINT64) ValueHi << 32));
|
||||
}
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_IO,
|
||||
@@ -294,7 +216,7 @@ AcpiRead (
|
||||
ACPI_FORMAT_UINT64 (Address),
|
||||
AcpiUtGetRegionName (Reg->SpaceId)));
|
||||
|
||||
return (Status);
|
||||
return (AE_OK);
|
||||
}
|
||||
|
||||
ACPI_EXPORT_SYMBOL (AcpiRead)
|
||||
@@ -334,12 +256,6 @@ AcpiWrite (
|
||||
return (Status);
|
||||
}
|
||||
|
||||
Width = Reg->BitWidth;
|
||||
if (Width == 64)
|
||||
{
|
||||
Width = 32; /* Break into two 32-bit transfers */
|
||||
}
|
||||
|
||||
/*
|
||||
* Two address spaces supported: Memory or IO. PCI_Config is
|
||||
* not supported here because the GAS structure is insufficient
|
||||
@@ -347,24 +263,20 @@ AcpiWrite (
|
||||
if (Reg->SpaceId == ACPI_ADR_SPACE_SYSTEM_MEMORY)
|
||||
{
|
||||
Status = AcpiOsWriteMemory ((ACPI_PHYSICAL_ADDRESS)
|
||||
Address, ACPI_LODWORD (Value), Width);
|
||||
Address, Value, Reg->BitWidth);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return (Status);
|
||||
}
|
||||
|
||||
if (Reg->BitWidth == 64)
|
||||
{
|
||||
Status = AcpiOsWriteMemory ((ACPI_PHYSICAL_ADDRESS)
|
||||
(Address + 4), ACPI_HIDWORD (Value), 32);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return (Status);
|
||||
}
|
||||
}
|
||||
}
|
||||
else /* ACPI_ADR_SPACE_SYSTEM_IO, validated earlier */
|
||||
{
|
||||
Width = Reg->BitWidth;
|
||||
if (Width == 64)
|
||||
{
|
||||
Width = 32; /* Break into two 32-bit transfers */
|
||||
}
|
||||
|
||||
Status = AcpiHwWritePort ((ACPI_IO_ADDRESS)
|
||||
Address, ACPI_LODWORD (Value), Width);
|
||||
if (ACPI_FAILURE (Status))
|
||||
@@ -395,6 +307,7 @@ AcpiWrite (
|
||||
ACPI_EXPORT_SYMBOL (AcpiWrite)
|
||||
|
||||
|
||||
#if (!ACPI_REDUCED_HARDWARE)
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiReadBitRegister
|
||||
@@ -473,7 +386,7 @@ ACPI_EXPORT_SYMBOL (AcpiReadBitRegister)
|
||||
*
|
||||
* PARAMETERS: RegisterId - ID of ACPI Bit Register to access
|
||||
* Value - Value to write to the register, in bit
|
||||
* position zero. The bit is automaticallly
|
||||
* position zero. The bit is automatically
|
||||
* shifted to the correct position.
|
||||
*
|
||||
* RETURN: Status
|
||||
@@ -577,6 +490,8 @@ UnlockAndExit:
|
||||
|
||||
ACPI_EXPORT_SYMBOL (AcpiWriteBitRegister)
|
||||
|
||||
#endif /* !ACPI_REDUCED_HARDWARE */
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
@@ -586,10 +501,33 @@ ACPI_EXPORT_SYMBOL (AcpiWriteBitRegister)
|
||||
* *SleepTypeA - Where SLP_TYPa is returned
|
||||
* *SleepTypeB - Where SLP_TYPb is returned
|
||||
*
|
||||
* RETURN: Status - ACPI status
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Obtain the SLP_TYPa and SLP_TYPb values for the requested sleep
|
||||
* state.
|
||||
* DESCRIPTION: Obtain the SLP_TYPa and SLP_TYPb values for the requested
|
||||
* sleep state via the appropriate \_Sx object.
|
||||
*
|
||||
* The sleep state package returned from the corresponding \_Sx_ object
|
||||
* must contain at least one integer.
|
||||
*
|
||||
* March 2005:
|
||||
* Added support for a package that contains two integers. This
|
||||
* goes against the ACPI specification which defines this object as a
|
||||
* package with one encoded DWORD integer. However, existing practice
|
||||
* by many BIOS vendors is to return a package with 2 or more integer
|
||||
* elements, at least one per sleep type (A/B).
|
||||
*
|
||||
* January 2013:
|
||||
* Therefore, we must be prepared to accept a package with either a
|
||||
* single integer or multiple integers.
|
||||
*
|
||||
* The single integer DWORD format is as follows:
|
||||
* BYTE 0 - Value for the PM1A SLP_TYP register
|
||||
* BYTE 1 - Value for the PM1B SLP_TYP register
|
||||
* BYTE 2-3 - Reserved
|
||||
*
|
||||
* The dual integer format is as follows:
|
||||
* Integer 0 - Value for the PM1A SLP_TYP register
|
||||
* Integer 1 - Value for the PM1A SLP_TYP register
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
@@ -599,8 +537,9 @@ AcpiGetSleepTypeData (
|
||||
UINT8 *SleepTypeA,
|
||||
UINT8 *SleepTypeB)
|
||||
{
|
||||
ACPI_STATUS Status = AE_OK;
|
||||
ACPI_STATUS Status;
|
||||
ACPI_EVALUATE_INFO *Info;
|
||||
ACPI_OPERAND_OBJECT **Elements;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE (AcpiGetSleepTypeData);
|
||||
@@ -609,8 +548,7 @@ AcpiGetSleepTypeData (
|
||||
/* Validate parameters */
|
||||
|
||||
if ((SleepState > ACPI_S_STATES_MAX) ||
|
||||
!SleepTypeA ||
|
||||
!SleepTypeB)
|
||||
!SleepTypeA || !SleepTypeB)
|
||||
{
|
||||
return_ACPI_STATUS (AE_BAD_PARAMETER);
|
||||
}
|
||||
@@ -623,17 +561,15 @@ AcpiGetSleepTypeData (
|
||||
return_ACPI_STATUS (AE_NO_MEMORY);
|
||||
}
|
||||
|
||||
Info->Pathname = ACPI_CAST_PTR (char, AcpiGbl_SleepStateNames[SleepState]);
|
||||
|
||||
/* Evaluate the namespace object containing the values for this state */
|
||||
|
||||
/*
|
||||
* Evaluate the \_Sx namespace object containing the register values
|
||||
* for this state
|
||||
*/
|
||||
Info->RelativePathname = ACPI_CAST_PTR (
|
||||
char, AcpiGbl_SleepStateNames[SleepState]);
|
||||
Status = AcpiNsEvaluate (Info);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
|
||||
"%s while evaluating SleepState [%s]\n",
|
||||
AcpiFormatException (Status), Info->Pathname));
|
||||
|
||||
goto Cleanup;
|
||||
}
|
||||
|
||||
@@ -642,67 +578,74 @@ AcpiGetSleepTypeData (
|
||||
if (!Info->ReturnObject)
|
||||
{
|
||||
ACPI_ERROR ((AE_INFO, "No Sleep State object returned from [%s]",
|
||||
Info->Pathname));
|
||||
Status = AE_NOT_EXIST;
|
||||
Info->RelativePathname));
|
||||
Status = AE_AML_NO_RETURN_VALUE;
|
||||
goto Cleanup;
|
||||
}
|
||||
|
||||
/* It must be of type Package */
|
||||
/* Return object must be of type Package */
|
||||
|
||||
else if (Info->ReturnObject->Common.Type != ACPI_TYPE_PACKAGE)
|
||||
if (Info->ReturnObject->Common.Type != ACPI_TYPE_PACKAGE)
|
||||
{
|
||||
ACPI_ERROR ((AE_INFO, "Sleep State return object is not a Package"));
|
||||
Status = AE_AML_OPERAND_TYPE;
|
||||
goto Cleanup1;
|
||||
}
|
||||
|
||||
/*
|
||||
* The package must have at least two elements. NOTE (March 2005): This
|
||||
* goes against the current ACPI spec which defines this object as a
|
||||
* package with one encoded DWORD element. However, existing practice
|
||||
* by BIOS vendors seems to be to have 2 or more elements, at least
|
||||
* one per sleep type (A/B).
|
||||
* Any warnings about the package length or the object types have
|
||||
* already been issued by the predefined name module -- there is no
|
||||
* need to repeat them here.
|
||||
*/
|
||||
else if (Info->ReturnObject->Package.Count < 2)
|
||||
Elements = Info->ReturnObject->Package.Elements;
|
||||
switch (Info->ReturnObject->Package.Count)
|
||||
{
|
||||
ACPI_ERROR ((AE_INFO,
|
||||
"Sleep State return package does not have at least two elements"));
|
||||
Status = AE_AML_NO_OPERAND;
|
||||
}
|
||||
|
||||
/* The first two elements must both be of type Integer */
|
||||
|
||||
else if (((Info->ReturnObject->Package.Elements[0])->Common.Type
|
||||
!= ACPI_TYPE_INTEGER) ||
|
||||
((Info->ReturnObject->Package.Elements[1])->Common.Type
|
||||
!= ACPI_TYPE_INTEGER))
|
||||
{
|
||||
ACPI_ERROR ((AE_INFO,
|
||||
"Sleep State return package elements are not both Integers "
|
||||
"(%s, %s)",
|
||||
AcpiUtGetObjectTypeName (Info->ReturnObject->Package.Elements[0]),
|
||||
AcpiUtGetObjectTypeName (Info->ReturnObject->Package.Elements[1])));
|
||||
Status = AE_AML_OPERAND_TYPE;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Valid _Sx_ package size, type, and value */
|
||||
|
||||
*SleepTypeA = (UINT8)
|
||||
(Info->ReturnObject->Package.Elements[0])->Integer.Value;
|
||||
*SleepTypeB = (UINT8)
|
||||
(Info->ReturnObject->Package.Elements[1])->Integer.Value;
|
||||
}
|
||||
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
ACPI_EXCEPTION ((AE_INFO, Status,
|
||||
"While evaluating SleepState [%s], bad Sleep object %p type %s",
|
||||
Info->Pathname, Info->ReturnObject,
|
||||
AcpiUtGetObjectTypeName (Info->ReturnObject)));
|
||||
case 0:
|
||||
|
||||
Status = AE_AML_PACKAGE_LIMIT;
|
||||
break;
|
||||
|
||||
case 1:
|
||||
|
||||
if (Elements[0]->Common.Type != ACPI_TYPE_INTEGER)
|
||||
{
|
||||
Status = AE_AML_OPERAND_TYPE;
|
||||
break;
|
||||
}
|
||||
|
||||
/* A valid _Sx_ package with one integer */
|
||||
|
||||
*SleepTypeA = (UINT8) Elements[0]->Integer.Value;
|
||||
*SleepTypeB = (UINT8) (Elements[0]->Integer.Value >> 8);
|
||||
break;
|
||||
|
||||
case 2:
|
||||
default:
|
||||
|
||||
if ((Elements[0]->Common.Type != ACPI_TYPE_INTEGER) ||
|
||||
(Elements[1]->Common.Type != ACPI_TYPE_INTEGER))
|
||||
{
|
||||
Status = AE_AML_OPERAND_TYPE;
|
||||
break;
|
||||
}
|
||||
|
||||
/* A valid _Sx_ package with two integers */
|
||||
|
||||
*SleepTypeA = (UINT8) Elements[0]->Integer.Value;
|
||||
*SleepTypeB = (UINT8) Elements[1]->Integer.Value;
|
||||
break;
|
||||
}
|
||||
|
||||
Cleanup1:
|
||||
AcpiUtRemoveReference (Info->ReturnObject);
|
||||
|
||||
Cleanup:
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
ACPI_EXCEPTION ((AE_INFO, Status,
|
||||
"While evaluating Sleep State [%s]", Info->RelativePathname));
|
||||
}
|
||||
|
||||
ACPI_FREE (Info);
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
487
minix/drivers/power/acpi/hardware/hwxfsleep.c
Normal file
487
minix/drivers/power/acpi/hardware/hwxfsleep.c
Normal file
@@ -0,0 +1,487 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Name: hwxfsleep.c - ACPI Hardware Sleep/Wake External Interfaces
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, 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 EXPORT_ACPI_INTERFACES
|
||||
|
||||
#include "acpi.h"
|
||||
#include "accommon.h"
|
||||
|
||||
#define _COMPONENT ACPI_HARDWARE
|
||||
ACPI_MODULE_NAME ("hwxfsleep")
|
||||
|
||||
/* Local prototypes */
|
||||
|
||||
static ACPI_STATUS
|
||||
AcpiHwSleepDispatch (
|
||||
UINT8 SleepState,
|
||||
UINT32 FunctionId);
|
||||
|
||||
/*
|
||||
* Dispatch table used to efficiently branch to the various sleep
|
||||
* functions.
|
||||
*/
|
||||
#define ACPI_SLEEP_FUNCTION_ID 0
|
||||
#define ACPI_WAKE_PREP_FUNCTION_ID 1
|
||||
#define ACPI_WAKE_FUNCTION_ID 2
|
||||
|
||||
/* Legacy functions are optional, based upon ACPI_REDUCED_HARDWARE */
|
||||
|
||||
static ACPI_SLEEP_FUNCTIONS AcpiSleepDispatch[] =
|
||||
{
|
||||
{ACPI_HW_OPTIONAL_FUNCTION (AcpiHwLegacySleep), AcpiHwExtendedSleep},
|
||||
{ACPI_HW_OPTIONAL_FUNCTION (AcpiHwLegacyWakePrep), AcpiHwExtendedWakePrep},
|
||||
{ACPI_HW_OPTIONAL_FUNCTION (AcpiHwLegacyWake), AcpiHwExtendedWake}
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
* These functions are removed for the ACPI_REDUCED_HARDWARE case:
|
||||
* AcpiSetFirmwareWakingVector
|
||||
* AcpiSetFirmwareWakingVector64
|
||||
* AcpiEnterSleepStateS4bios
|
||||
*/
|
||||
|
||||
#if (!ACPI_REDUCED_HARDWARE)
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiSetFirmwareWakingVector
|
||||
*
|
||||
* PARAMETERS: PhysicalAddress - 32-bit physical address of ACPI real mode
|
||||
* entry point.
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Sets the 32-bit FirmwareWakingVector field of the FACS
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiSetFirmwareWakingVector (
|
||||
UINT32 PhysicalAddress)
|
||||
{
|
||||
ACPI_FUNCTION_TRACE (AcpiSetFirmwareWakingVector);
|
||||
|
||||
|
||||
/*
|
||||
* According to the ACPI specification 2.0c and later, the 64-bit
|
||||
* waking vector should be cleared and the 32-bit waking vector should
|
||||
* be used, unless we want the wake-up code to be called by the BIOS in
|
||||
* Protected Mode. Some systems (for example HP dv5-1004nr) are known
|
||||
* to fail to resume if the 64-bit vector is used.
|
||||
*/
|
||||
|
||||
/* Set the 32-bit vector */
|
||||
|
||||
AcpiGbl_FACS->FirmwareWakingVector = PhysicalAddress;
|
||||
|
||||
/* Clear the 64-bit vector if it exists */
|
||||
|
||||
if ((AcpiGbl_FACS->Length > 32) && (AcpiGbl_FACS->Version >= 1))
|
||||
{
|
||||
AcpiGbl_FACS->XFirmwareWakingVector = 0;
|
||||
}
|
||||
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
}
|
||||
|
||||
ACPI_EXPORT_SYMBOL (AcpiSetFirmwareWakingVector)
|
||||
|
||||
|
||||
#if ACPI_MACHINE_WIDTH == 64
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiSetFirmwareWakingVector64
|
||||
*
|
||||
* PARAMETERS: PhysicalAddress - 64-bit physical address of ACPI protected
|
||||
* mode entry point.
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Sets the 64-bit X_FirmwareWakingVector field of the FACS, if
|
||||
* it exists in the table. This function is intended for use with
|
||||
* 64-bit host operating systems.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiSetFirmwareWakingVector64 (
|
||||
UINT64 PhysicalAddress)
|
||||
{
|
||||
ACPI_FUNCTION_TRACE (AcpiSetFirmwareWakingVector64);
|
||||
|
||||
|
||||
/* Determine if the 64-bit vector actually exists */
|
||||
|
||||
if ((AcpiGbl_FACS->Length <= 32) || (AcpiGbl_FACS->Version < 1))
|
||||
{
|
||||
return_ACPI_STATUS (AE_NOT_EXIST);
|
||||
}
|
||||
|
||||
/* Clear 32-bit vector, set the 64-bit X_ vector */
|
||||
|
||||
AcpiGbl_FACS->FirmwareWakingVector = 0;
|
||||
AcpiGbl_FACS->XFirmwareWakingVector = PhysicalAddress;
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
}
|
||||
|
||||
ACPI_EXPORT_SYMBOL (AcpiSetFirmwareWakingVector64)
|
||||
#endif
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiEnterSleepStateS4bios
|
||||
*
|
||||
* PARAMETERS: None
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Perform a S4 bios request.
|
||||
* THIS FUNCTION MUST BE CALLED WITH INTERRUPTS DISABLED
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiEnterSleepStateS4bios (
|
||||
void)
|
||||
{
|
||||
UINT32 InValue;
|
||||
ACPI_STATUS Status;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE (AcpiEnterSleepStateS4bios);
|
||||
|
||||
|
||||
/* Clear the wake status bit (PM1) */
|
||||
|
||||
Status = AcpiWriteBitRegister (ACPI_BITREG_WAKE_STATUS, ACPI_CLEAR_STATUS);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
Status = AcpiHwClearAcpiStatus ();
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
/*
|
||||
* 1) Disable/Clear all GPEs
|
||||
* 2) Enable all wakeup GPEs
|
||||
*/
|
||||
Status = AcpiHwDisableAllGpes ();
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
AcpiGbl_SystemAwakeAndRunning = FALSE;
|
||||
|
||||
Status = AcpiHwEnableAllWakeupGpes ();
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
ACPI_FLUSH_CPU_CACHE ();
|
||||
|
||||
Status = AcpiHwWritePort (AcpiGbl_FADT.SmiCommand,
|
||||
(UINT32) AcpiGbl_FADT.S4BiosRequest, 8);
|
||||
|
||||
do {
|
||||
AcpiOsStall (ACPI_USEC_PER_MSEC);
|
||||
Status = AcpiReadBitRegister (ACPI_BITREG_WAKE_STATUS, &InValue);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
} while (!InValue);
|
||||
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
}
|
||||
|
||||
ACPI_EXPORT_SYMBOL (AcpiEnterSleepStateS4bios)
|
||||
|
||||
#endif /* !ACPI_REDUCED_HARDWARE */
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiHwSleepDispatch
|
||||
*
|
||||
* PARAMETERS: SleepState - Which sleep state to enter/exit
|
||||
* FunctionId - Sleep, WakePrep, or Wake
|
||||
*
|
||||
* RETURN: Status from the invoked sleep handling function.
|
||||
*
|
||||
* DESCRIPTION: Dispatch a sleep/wake request to the appropriate handling
|
||||
* function.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
static ACPI_STATUS
|
||||
AcpiHwSleepDispatch (
|
||||
UINT8 SleepState,
|
||||
UINT32 FunctionId)
|
||||
{
|
||||
ACPI_STATUS Status;
|
||||
ACPI_SLEEP_FUNCTIONS *SleepFunctions = &AcpiSleepDispatch[FunctionId];
|
||||
|
||||
|
||||
#if (!ACPI_REDUCED_HARDWARE)
|
||||
/*
|
||||
* If the Hardware Reduced flag is set (from the FADT), we must
|
||||
* use the extended sleep registers (FADT). Note: As per the ACPI
|
||||
* specification, these extended registers are to be used for HW-reduced
|
||||
* platforms only. They are not general-purpose replacements for the
|
||||
* legacy PM register sleep support.
|
||||
*/
|
||||
if (AcpiGbl_ReducedHardware)
|
||||
{
|
||||
Status = SleepFunctions->ExtendedFunction (SleepState);
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Legacy sleep */
|
||||
|
||||
Status = SleepFunctions->LegacyFunction (SleepState);
|
||||
}
|
||||
|
||||
return (Status);
|
||||
|
||||
#else
|
||||
/*
|
||||
* For the case where reduced-hardware-only code is being generated,
|
||||
* we know that only the extended sleep registers are available
|
||||
*/
|
||||
Status = SleepFunctions->ExtendedFunction (SleepState);
|
||||
return (Status);
|
||||
|
||||
#endif /* !ACPI_REDUCED_HARDWARE */
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiEnterSleepStatePrep
|
||||
*
|
||||
* PARAMETERS: SleepState - Which sleep state to enter
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Prepare to enter a system sleep state.
|
||||
* This function must execute with interrupts enabled.
|
||||
* We break sleeping into 2 stages so that OSPM can handle
|
||||
* various OS-specific tasks between the two steps.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiEnterSleepStatePrep (
|
||||
UINT8 SleepState)
|
||||
{
|
||||
ACPI_STATUS Status;
|
||||
ACPI_OBJECT_LIST ArgList;
|
||||
ACPI_OBJECT Arg;
|
||||
UINT32 SstValue;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE (AcpiEnterSleepStatePrep);
|
||||
|
||||
|
||||
Status = AcpiGetSleepTypeData (SleepState,
|
||||
&AcpiGbl_SleepTypeA, &AcpiGbl_SleepTypeB);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
/* Execute the _PTS method (Prepare To Sleep) */
|
||||
|
||||
ArgList.Count = 1;
|
||||
ArgList.Pointer = &Arg;
|
||||
Arg.Type = ACPI_TYPE_INTEGER;
|
||||
Arg.Integer.Value = SleepState;
|
||||
|
||||
Status = AcpiEvaluateObject (NULL, METHOD_PATHNAME__PTS, &ArgList, NULL);
|
||||
if (ACPI_FAILURE (Status) && Status != AE_NOT_FOUND)
|
||||
{
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
/* Setup the argument to the _SST method (System STatus) */
|
||||
|
||||
switch (SleepState)
|
||||
{
|
||||
case ACPI_STATE_S0:
|
||||
|
||||
SstValue = ACPI_SST_WORKING;
|
||||
break;
|
||||
|
||||
case ACPI_STATE_S1:
|
||||
case ACPI_STATE_S2:
|
||||
case ACPI_STATE_S3:
|
||||
|
||||
SstValue = ACPI_SST_SLEEPING;
|
||||
break;
|
||||
|
||||
case ACPI_STATE_S4:
|
||||
|
||||
SstValue = ACPI_SST_SLEEP_CONTEXT;
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
SstValue = ACPI_SST_INDICATOR_OFF; /* Default is off */
|
||||
break;
|
||||
}
|
||||
|
||||
/*
|
||||
* Set the system indicators to show the desired sleep state.
|
||||
* _SST is an optional method (return no error if not found)
|
||||
*/
|
||||
AcpiHwExecuteSleepMethod (METHOD_PATHNAME__SST, SstValue);
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
}
|
||||
|
||||
ACPI_EXPORT_SYMBOL (AcpiEnterSleepStatePrep)
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiEnterSleepState
|
||||
*
|
||||
* PARAMETERS: SleepState - Which sleep state to enter
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Enter a system sleep state
|
||||
* THIS FUNCTION MUST BE CALLED WITH INTERRUPTS DISABLED
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiEnterSleepState (
|
||||
UINT8 SleepState)
|
||||
{
|
||||
ACPI_STATUS Status;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE (AcpiEnterSleepState);
|
||||
|
||||
|
||||
if ((AcpiGbl_SleepTypeA > ACPI_SLEEP_TYPE_MAX) ||
|
||||
(AcpiGbl_SleepTypeB > ACPI_SLEEP_TYPE_MAX))
|
||||
{
|
||||
ACPI_ERROR ((AE_INFO, "Sleep values out of range: A=0x%X B=0x%X",
|
||||
AcpiGbl_SleepTypeA, AcpiGbl_SleepTypeB));
|
||||
return_ACPI_STATUS (AE_AML_OPERAND_VALUE);
|
||||
}
|
||||
|
||||
Status = AcpiHwSleepDispatch (SleepState, ACPI_SLEEP_FUNCTION_ID);
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
ACPI_EXPORT_SYMBOL (AcpiEnterSleepState)
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiLeaveSleepStatePrep
|
||||
*
|
||||
* PARAMETERS: SleepState - Which sleep state we are exiting
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Perform the first state of OS-independent ACPI cleanup after a
|
||||
* sleep. Called with interrupts DISABLED.
|
||||
* We break wake/resume into 2 stages so that OSPM can handle
|
||||
* various OS-specific tasks between the two steps.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiLeaveSleepStatePrep (
|
||||
UINT8 SleepState)
|
||||
{
|
||||
ACPI_STATUS Status;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE (AcpiLeaveSleepStatePrep);
|
||||
|
||||
|
||||
Status = AcpiHwSleepDispatch (SleepState, ACPI_WAKE_PREP_FUNCTION_ID);
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
ACPI_EXPORT_SYMBOL (AcpiLeaveSleepStatePrep)
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiLeaveSleepState
|
||||
*
|
||||
* PARAMETERS: SleepState - Which sleep state we are exiting
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Perform OS-independent ACPI cleanup after a sleep
|
||||
* Called with interrupts ENABLED.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiLeaveSleepState (
|
||||
UINT8 SleepState)
|
||||
{
|
||||
ACPI_STATUS Status;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE (AcpiLeaveSleepState);
|
||||
|
||||
|
||||
Status = AcpiHwSleepDispatch (SleepState, ACPI_WAKE_FUNCTION_ID);
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
ACPI_EXPORT_SYMBOL (AcpiLeaveSleepState)
|
||||
@@ -4,114 +4,42 @@
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
* 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.
|
||||
*
|
||||
* 2.1. This is your license from Intel Corp. under its intellectual property
|
||||
* rights. You may have additional license terms from the party that provided
|
||||
* you this software, covering your right to use that party's intellectual
|
||||
* property rights.
|
||||
* 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.
|
||||
*
|
||||
* 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
|
||||
* copy of the source code appearing in this file ("Covered Code") an
|
||||
* irrevocable, perpetual, worldwide license under Intel's copyrights in the
|
||||
* base code distributed originally by Intel ("Original Intel Code") to copy,
|
||||
* make derivatives, distribute, use and display any portion of the Covered
|
||||
* Code in any form, with the right to sublicense such rights; and
|
||||
*
|
||||
* 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
|
||||
* license (with the right to sublicense), under only those claims of Intel
|
||||
* patents that are infringed by the Original Intel Code, to make, use, sell,
|
||||
* offer to sell, and import the Covered Code and derivative works thereof
|
||||
* solely to the minimum extent necessary to exercise the above copyright
|
||||
* license, and in no event shall the patent license extend to any additions
|
||||
* to or modifications of the Original Intel Code. No other license or right
|
||||
* is granted directly or by implication, estoppel or otherwise;
|
||||
*
|
||||
* The above copyright and patent license is granted only if the following
|
||||
* conditions are met:
|
||||
*
|
||||
* 3. Conditions
|
||||
*
|
||||
* 3.1. Redistribution of Source with Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification with rights to further distribute source must include
|
||||
* the above Copyright Notice, the above License, this list of Conditions,
|
||||
* and the following Disclaimer and Export Compliance provision. In addition,
|
||||
* Licensee must cause all Covered Code to which Licensee contributes to
|
||||
* contain a file documenting the changes Licensee made to create that Covered
|
||||
* Code and the date of any change. Licensee must include in that file the
|
||||
* documentation of any changes made by any predecessor Licensee. Licensee
|
||||
* must include a prominent statement that the modification is derived,
|
||||
* directly or indirectly, from Original Intel Code.
|
||||
*
|
||||
* 3.2. Redistribution of Source with no Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification without rights to further distribute source must
|
||||
* include the following Disclaimer and Export Compliance provision in the
|
||||
* documentation and/or other materials provided with distribution. In
|
||||
* addition, Licensee may not authorize further sublicense of source of any
|
||||
* portion of the Covered Code, and must include terms to the effect that the
|
||||
* license from Licensee to its licensee is limited to the intellectual
|
||||
* property embodied in the software Licensee provides to its licensee, and
|
||||
* not to intellectual property embodied in modifications its licensee may
|
||||
* make.
|
||||
*
|
||||
* 3.3. Redistribution of Executable. Redistribution in executable form of any
|
||||
* substantial portion of the Covered Code or modification must reproduce the
|
||||
* above Copyright Notice, and the following Disclaimer and Export Compliance
|
||||
* provision in the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3.4. Intel retains all right, title, and interest in and to the Original
|
||||
* Intel Code.
|
||||
*
|
||||
* 3.5. Neither the name Intel nor any other trademark owned or controlled by
|
||||
* Intel shall be used in advertising or otherwise to promote the sale, use or
|
||||
* other dealings in products derived from or relating to the Covered Code
|
||||
* without prior written authorization from Intel.
|
||||
*
|
||||
* 4. Disclaimer and Export Compliance
|
||||
*
|
||||
* 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
|
||||
* HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
|
||||
* IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
|
||||
* INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
|
||||
* UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
|
||||
* PARTICULAR PURPOSE.
|
||||
*
|
||||
* 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
|
||||
* OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
|
||||
* COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
|
||||
* SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
|
||||
* CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
|
||||
* HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
|
||||
* SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
|
||||
* LIMITED REMEDY.
|
||||
*
|
||||
* 4.3. Licensee shall not export, either directly or indirectly, any of this
|
||||
* software or system incorporating such software without first obtaining any
|
||||
* required license or other approval from the U. S. Department of Commerce or
|
||||
* any other agency or department of the United States Government. In the
|
||||
* event Licensee exports any such software from the United States or
|
||||
* re-exports any such software from a foreign destination, Licensee shall
|
||||
* ensure that the distribution and export/re-export of the software is in
|
||||
* compliance with all laws, regulations, orders, or other restrictions of the
|
||||
* U.S. Export Administration Regulations. Licensee agrees that neither it nor
|
||||
* any of its subsidiaries will export/re-export any technical data, process,
|
||||
* software, or service, directly or indirectly, to any country for which the
|
||||
* United States government or any agency thereof requires an export license,
|
||||
* other governmental approval, or letter of assurance, without first obtaining
|
||||
* such license, approval or letter.
|
||||
*
|
||||
*****************************************************************************/
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef _ACAPPS
|
||||
#define _ACAPPS
|
||||
@@ -121,6 +49,50 @@
|
||||
#pragma warning(disable:4100) /* warning C4100: unreferenced formal parameter */
|
||||
#endif
|
||||
|
||||
/* Common info for tool signons */
|
||||
|
||||
#define ACPICA_NAME "Intel ACPI Component Architecture"
|
||||
#define ACPICA_COPYRIGHT "Copyright (c) 2000 - 2014 Intel Corporation"
|
||||
|
||||
#if ACPI_MACHINE_WIDTH == 64
|
||||
#define ACPI_WIDTH "-64"
|
||||
|
||||
#elif ACPI_MACHINE_WIDTH == 32
|
||||
#define ACPI_WIDTH "-32"
|
||||
|
||||
#else
|
||||
#error unknown ACPI_MACHINE_WIDTH
|
||||
#define ACPI_WIDTH "-??"
|
||||
|
||||
#endif
|
||||
|
||||
/* Macros for signons and file headers */
|
||||
|
||||
#define ACPI_COMMON_SIGNON(UtilityName) \
|
||||
"\n%s\n%s version %8.8X%s [%s]\n%s\n\n", \
|
||||
ACPICA_NAME, \
|
||||
UtilityName, ((UINT32) ACPI_CA_VERSION), ACPI_WIDTH, __DATE__, \
|
||||
ACPICA_COPYRIGHT
|
||||
|
||||
#define ACPI_COMMON_HEADER(UtilityName, Prefix) \
|
||||
"%s%s\n%s%s version %8.8X%s [%s]\n%s%s\n%s\n", \
|
||||
Prefix, ACPICA_NAME, \
|
||||
Prefix, UtilityName, ((UINT32) ACPI_CA_VERSION), ACPI_WIDTH, __DATE__, \
|
||||
Prefix, ACPICA_COPYRIGHT, \
|
||||
Prefix
|
||||
|
||||
/* Macros for usage messages */
|
||||
|
||||
#define ACPI_USAGE_HEADER(Usage) \
|
||||
AcpiOsPrintf ("Usage: %s\nOptions:\n", Usage);
|
||||
|
||||
#define ACPI_USAGE_TEXT(Description) \
|
||||
AcpiOsPrintf (Description);
|
||||
|
||||
#define ACPI_OPTION(Name, Description) \
|
||||
AcpiOsPrintf (" %-18s%s\n", Name, Description);
|
||||
|
||||
|
||||
#define FILE_SUFFIX_DISASSEMBLY "dsl"
|
||||
#define ACPI_TABLE_FILE_SUFFIX ".dat"
|
||||
|
||||
@@ -134,11 +106,26 @@ AcpiGetopt(
|
||||
char **argv,
|
||||
char *opts);
|
||||
|
||||
int
|
||||
AcpiGetoptArgument (
|
||||
int argc,
|
||||
char **argv);
|
||||
|
||||
extern int AcpiGbl_Optind;
|
||||
extern int AcpiGbl_Opterr;
|
||||
extern int AcpiGbl_SubOptChar;
|
||||
extern char *AcpiGbl_Optarg;
|
||||
|
||||
|
||||
/*
|
||||
* cmfsize - Common get file size function
|
||||
*/
|
||||
UINT32
|
||||
CmGetFileSize (
|
||||
ACPI_FILE File);
|
||||
|
||||
|
||||
#ifndef ACPI_DUMP_APP
|
||||
/*
|
||||
* adisasm
|
||||
*/
|
||||
@@ -147,8 +134,7 @@ AdAmlDisassemble (
|
||||
BOOLEAN OutToFile,
|
||||
char *Filename,
|
||||
char *Prefix,
|
||||
char **OutFilename,
|
||||
BOOLEAN GetAllTables);
|
||||
char **OutFilename);
|
||||
|
||||
void
|
||||
AdPrintStatistics (
|
||||
@@ -165,8 +151,7 @@ AdDumpTables (
|
||||
|
||||
ACPI_STATUS
|
||||
AdGetLocalTables (
|
||||
char *Filename,
|
||||
BOOLEAN GetAllTables);
|
||||
void);
|
||||
|
||||
ACPI_STATUS
|
||||
AdParseTable (
|
||||
@@ -243,6 +228,6 @@ AdWriteTable (
|
||||
UINT32 Length,
|
||||
char *TableName,
|
||||
char *OemTableId);
|
||||
#endif
|
||||
|
||||
#endif /* _ACAPPS */
|
||||
|
||||
|
||||
254
minix/drivers/power/acpi/include/acbuffer.h
Normal file
254
minix/drivers/power/acpi/include/acbuffer.h
Normal file
@@ -0,0 +1,254 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Name: acbuffer.h - Support for buffers returned by ACPI predefined names
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, 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.
|
||||
*/
|
||||
|
||||
#ifndef __ACBUFFER_H__
|
||||
#define __ACBUFFER_H__
|
||||
|
||||
/*
|
||||
* Contains buffer structures for these predefined names:
|
||||
* _FDE, _GRT, _GTM, _PLD, _SRT
|
||||
*/
|
||||
|
||||
/*
|
||||
* Note: C bitfields are not used for this reason:
|
||||
*
|
||||
* "Bitfields are great and easy to read, but unfortunately the C language
|
||||
* does not specify the layout of bitfields in memory, which means they are
|
||||
* essentially useless for dealing with packed data in on-disk formats or
|
||||
* binary wire protocols." (Or ACPI tables and buffers.) "If you ask me,
|
||||
* this decision was a design error in C. Ritchie could have picked an order
|
||||
* and stuck with it." Norman Ramsey.
|
||||
* See http://stackoverflow.com/a/1053662/41661
|
||||
*/
|
||||
|
||||
|
||||
/* _FDE return value */
|
||||
|
||||
typedef struct acpi_fde_info
|
||||
{
|
||||
UINT32 Floppy0;
|
||||
UINT32 Floppy1;
|
||||
UINT32 Floppy2;
|
||||
UINT32 Floppy3;
|
||||
UINT32 Tape;
|
||||
|
||||
} ACPI_FDE_INFO;
|
||||
|
||||
/*
|
||||
* _GRT return value
|
||||
* _SRT input value
|
||||
*/
|
||||
typedef struct acpi_grt_info
|
||||
{
|
||||
UINT16 Year;
|
||||
UINT8 Month;
|
||||
UINT8 Day;
|
||||
UINT8 Hour;
|
||||
UINT8 Minute;
|
||||
UINT8 Second;
|
||||
UINT8 Valid;
|
||||
UINT16 Milliseconds;
|
||||
UINT16 Timezone;
|
||||
UINT8 Daylight;
|
||||
UINT8 Reserved[3];
|
||||
|
||||
} ACPI_GRT_INFO;
|
||||
|
||||
/* _GTM return value */
|
||||
|
||||
typedef struct acpi_gtm_info
|
||||
{
|
||||
UINT32 PioSpeed0;
|
||||
UINT32 DmaSpeed0;
|
||||
UINT32 PioSpeed1;
|
||||
UINT32 DmaSpeed1;
|
||||
UINT32 Flags;
|
||||
|
||||
} ACPI_GTM_INFO;
|
||||
|
||||
/*
|
||||
* Formatted _PLD return value. The minimum size is a package containing
|
||||
* one buffer.
|
||||
* Revision 1: Buffer is 16 bytes (128 bits)
|
||||
* Revision 2: Buffer is 20 bytes (160 bits)
|
||||
*
|
||||
* Note: This structure is returned from the AcpiDecodePldBuffer
|
||||
* interface.
|
||||
*/
|
||||
typedef struct acpi_pld_info
|
||||
{
|
||||
UINT8 Revision;
|
||||
UINT8 IgnoreColor;
|
||||
UINT8 Red;
|
||||
UINT8 Green;
|
||||
UINT8 Blue;
|
||||
UINT16 Width;
|
||||
UINT16 Height;
|
||||
UINT8 UserVisible;
|
||||
UINT8 Dock;
|
||||
UINT8 Lid;
|
||||
UINT8 Panel;
|
||||
UINT8 VerticalPosition;
|
||||
UINT8 HorizontalPosition;
|
||||
UINT8 Shape;
|
||||
UINT8 GroupOrientation;
|
||||
UINT8 GroupToken;
|
||||
UINT8 GroupPosition;
|
||||
UINT8 Bay;
|
||||
UINT8 Ejectable;
|
||||
UINT8 OspmEjectRequired;
|
||||
UINT8 CabinetNumber;
|
||||
UINT8 CardCageNumber;
|
||||
UINT8 Reference;
|
||||
UINT8 Rotation;
|
||||
UINT8 Order;
|
||||
UINT8 Reserved;
|
||||
UINT16 VerticalOffset;
|
||||
UINT16 HorizontalOffset;
|
||||
|
||||
} ACPI_PLD_INFO;
|
||||
|
||||
|
||||
/*
|
||||
* Macros to:
|
||||
* 1) Convert a _PLD buffer to internal ACPI_PLD_INFO format - ACPI_PLD_GET*
|
||||
* (Used by AcpiDecodePldBuffer)
|
||||
* 2) Construct a _PLD buffer - ACPI_PLD_SET*
|
||||
* (Intended for BIOS use only)
|
||||
*/
|
||||
#define ACPI_PLD_REV1_BUFFER_SIZE 16 /* For Revision 1 of the buffer (From ACPI spec) */
|
||||
#define ACPI_PLD_BUFFER_SIZE 20 /* For Revision 2 of the buffer (From ACPI spec) */
|
||||
|
||||
/* First 32-bit dword, bits 0:32 */
|
||||
|
||||
#define ACPI_PLD_GET_REVISION(dword) ACPI_GET_BITS (dword, 0, ACPI_7BIT_MASK)
|
||||
#define ACPI_PLD_SET_REVISION(dword,value) ACPI_SET_BITS (dword, 0, ACPI_7BIT_MASK, value) /* Offset 0, Len 7 */
|
||||
|
||||
#define ACPI_PLD_GET_IGNORE_COLOR(dword) ACPI_GET_BITS (dword, 7, ACPI_1BIT_MASK)
|
||||
#define ACPI_PLD_SET_IGNORE_COLOR(dword,value) ACPI_SET_BITS (dword, 7, ACPI_1BIT_MASK, value) /* Offset 7, Len 1 */
|
||||
|
||||
#define ACPI_PLD_GET_RED(dword) ACPI_GET_BITS (dword, 8, ACPI_8BIT_MASK)
|
||||
#define ACPI_PLD_SET_RED(dword,value) ACPI_SET_BITS (dword, 8, ACPI_8BIT_MASK, value) /* Offset 8, Len 8 */
|
||||
|
||||
#define ACPI_PLD_GET_GREEN(dword) ACPI_GET_BITS (dword, 16, ACPI_8BIT_MASK)
|
||||
#define ACPI_PLD_SET_GREEN(dword,value) ACPI_SET_BITS (dword, 16, ACPI_8BIT_MASK, value) /* Offset 16, Len 8 */
|
||||
|
||||
#define ACPI_PLD_GET_BLUE(dword) ACPI_GET_BITS (dword, 24, ACPI_8BIT_MASK)
|
||||
#define ACPI_PLD_SET_BLUE(dword,value) ACPI_SET_BITS (dword, 24, ACPI_8BIT_MASK, value) /* Offset 24, Len 8 */
|
||||
|
||||
/* Second 32-bit dword, bits 33:63 */
|
||||
|
||||
#define ACPI_PLD_GET_WIDTH(dword) ACPI_GET_BITS (dword, 0, ACPI_16BIT_MASK)
|
||||
#define ACPI_PLD_SET_WIDTH(dword,value) ACPI_SET_BITS (dword, 0, ACPI_16BIT_MASK, value) /* Offset 32+0=32, Len 16 */
|
||||
|
||||
#define ACPI_PLD_GET_HEIGHT(dword) ACPI_GET_BITS (dword, 16, ACPI_16BIT_MASK)
|
||||
#define ACPI_PLD_SET_HEIGHT(dword,value) ACPI_SET_BITS (dword, 16, ACPI_16BIT_MASK, value) /* Offset 32+16=48, Len 16 */
|
||||
|
||||
/* Third 32-bit dword, bits 64:95 */
|
||||
|
||||
#define ACPI_PLD_GET_USER_VISIBLE(dword) ACPI_GET_BITS (dword, 0, ACPI_1BIT_MASK)
|
||||
#define ACPI_PLD_SET_USER_VISIBLE(dword,value) ACPI_SET_BITS (dword, 0, ACPI_1BIT_MASK, value) /* Offset 64+0=64, Len 1 */
|
||||
|
||||
#define ACPI_PLD_GET_DOCK(dword) ACPI_GET_BITS (dword, 1, ACPI_1BIT_MASK)
|
||||
#define ACPI_PLD_SET_DOCK(dword,value) ACPI_SET_BITS (dword, 1, ACPI_1BIT_MASK, value) /* Offset 64+1=65, Len 1 */
|
||||
|
||||
#define ACPI_PLD_GET_LID(dword) ACPI_GET_BITS (dword, 2, ACPI_1BIT_MASK)
|
||||
#define ACPI_PLD_SET_LID(dword,value) ACPI_SET_BITS (dword, 2, ACPI_1BIT_MASK, value) /* Offset 64+2=66, Len 1 */
|
||||
|
||||
#define ACPI_PLD_GET_PANEL(dword) ACPI_GET_BITS (dword, 3, ACPI_3BIT_MASK)
|
||||
#define ACPI_PLD_SET_PANEL(dword,value) ACPI_SET_BITS (dword, 3, ACPI_3BIT_MASK, value) /* Offset 64+3=67, Len 3 */
|
||||
|
||||
#define ACPI_PLD_GET_VERTICAL(dword) ACPI_GET_BITS (dword, 6, ACPI_2BIT_MASK)
|
||||
#define ACPI_PLD_SET_VERTICAL(dword,value) ACPI_SET_BITS (dword, 6, ACPI_2BIT_MASK, value) /* Offset 64+6=70, Len 2 */
|
||||
|
||||
#define ACPI_PLD_GET_HORIZONTAL(dword) ACPI_GET_BITS (dword, 8, ACPI_2BIT_MASK)
|
||||
#define ACPI_PLD_SET_HORIZONTAL(dword,value) ACPI_SET_BITS (dword, 8, ACPI_2BIT_MASK, value) /* Offset 64+8=72, Len 2 */
|
||||
|
||||
#define ACPI_PLD_GET_SHAPE(dword) ACPI_GET_BITS (dword, 10, ACPI_4BIT_MASK)
|
||||
#define ACPI_PLD_SET_SHAPE(dword,value) ACPI_SET_BITS (dword, 10, ACPI_4BIT_MASK, value) /* Offset 64+10=74, Len 4 */
|
||||
|
||||
#define ACPI_PLD_GET_ORIENTATION(dword) ACPI_GET_BITS (dword, 14, ACPI_1BIT_MASK)
|
||||
#define ACPI_PLD_SET_ORIENTATION(dword,value) ACPI_SET_BITS (dword, 14, ACPI_1BIT_MASK, value) /* Offset 64+14=78, Len 1 */
|
||||
|
||||
#define ACPI_PLD_GET_TOKEN(dword) ACPI_GET_BITS (dword, 15, ACPI_8BIT_MASK)
|
||||
#define ACPI_PLD_SET_TOKEN(dword,value) ACPI_SET_BITS (dword, 15, ACPI_8BIT_MASK, value) /* Offset 64+15=79, Len 8 */
|
||||
|
||||
#define ACPI_PLD_GET_POSITION(dword) ACPI_GET_BITS (dword, 23, ACPI_8BIT_MASK)
|
||||
#define ACPI_PLD_SET_POSITION(dword,value) ACPI_SET_BITS (dword, 23, ACPI_8BIT_MASK, value) /* Offset 64+23=87, Len 8 */
|
||||
|
||||
#define ACPI_PLD_GET_BAY(dword) ACPI_GET_BITS (dword, 31, ACPI_1BIT_MASK)
|
||||
#define ACPI_PLD_SET_BAY(dword,value) ACPI_SET_BITS (dword, 31, ACPI_1BIT_MASK, value) /* Offset 64+31=95, Len 1 */
|
||||
|
||||
/* Fourth 32-bit dword, bits 96:127 */
|
||||
|
||||
#define ACPI_PLD_GET_EJECTABLE(dword) ACPI_GET_BITS (dword, 0, ACPI_1BIT_MASK)
|
||||
#define ACPI_PLD_SET_EJECTABLE(dword,value) ACPI_SET_BITS (dword, 0, ACPI_1BIT_MASK, value) /* Offset 96+0=96, Len 1 */
|
||||
|
||||
#define ACPI_PLD_GET_OSPM_EJECT(dword) ACPI_GET_BITS (dword, 1, ACPI_1BIT_MASK)
|
||||
#define ACPI_PLD_SET_OSPM_EJECT(dword,value) ACPI_SET_BITS (dword, 1, ACPI_1BIT_MASK, value) /* Offset 96+1=97, Len 1 */
|
||||
|
||||
#define ACPI_PLD_GET_CABINET(dword) ACPI_GET_BITS (dword, 2, ACPI_8BIT_MASK)
|
||||
#define ACPI_PLD_SET_CABINET(dword,value) ACPI_SET_BITS (dword, 2, ACPI_8BIT_MASK, value) /* Offset 96+2=98, Len 8 */
|
||||
|
||||
#define ACPI_PLD_GET_CARD_CAGE(dword) ACPI_GET_BITS (dword, 10, ACPI_8BIT_MASK)
|
||||
#define ACPI_PLD_SET_CARD_CAGE(dword,value) ACPI_SET_BITS (dword, 10, ACPI_8BIT_MASK, value) /* Offset 96+10=106, Len 8 */
|
||||
|
||||
#define ACPI_PLD_GET_REFERENCE(dword) ACPI_GET_BITS (dword, 18, ACPI_1BIT_MASK)
|
||||
#define ACPI_PLD_SET_REFERENCE(dword,value) ACPI_SET_BITS (dword, 18, ACPI_1BIT_MASK, value) /* Offset 96+18=114, Len 1 */
|
||||
|
||||
#define ACPI_PLD_GET_ROTATION(dword) ACPI_GET_BITS (dword, 19, ACPI_4BIT_MASK)
|
||||
#define ACPI_PLD_SET_ROTATION(dword,value) ACPI_SET_BITS (dword, 19, ACPI_4BIT_MASK, value) /* Offset 96+19=115, Len 4 */
|
||||
|
||||
#define ACPI_PLD_GET_ORDER(dword) ACPI_GET_BITS (dword, 23, ACPI_5BIT_MASK)
|
||||
#define ACPI_PLD_SET_ORDER(dword,value) ACPI_SET_BITS (dword, 23, ACPI_5BIT_MASK, value) /* Offset 96+23=119, Len 5 */
|
||||
|
||||
/* Fifth 32-bit dword, bits 128:159 (Revision 2 of _PLD only) */
|
||||
|
||||
#define ACPI_PLD_GET_VERT_OFFSET(dword) ACPI_GET_BITS (dword, 0, ACPI_16BIT_MASK)
|
||||
#define ACPI_PLD_SET_VERT_OFFSET(dword,value) ACPI_SET_BITS (dword, 0, ACPI_16BIT_MASK, value) /* Offset 128+0=128, Len 16 */
|
||||
|
||||
#define ACPI_PLD_GET_HORIZ_OFFSET(dword) ACPI_GET_BITS (dword, 16, ACPI_16BIT_MASK)
|
||||
#define ACPI_PLD_SET_HORIZ_OFFSET(dword,value) ACPI_SET_BITS (dword, 16, ACPI_16BIT_MASK, value) /* Offset 128+16=144, Len 16 */
|
||||
|
||||
|
||||
#endif /* ACBUFFER_H */
|
||||
@@ -4,114 +4,42 @@
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
* 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.
|
||||
*
|
||||
* 2.1. This is your license from Intel Corp. under its intellectual property
|
||||
* rights. You may have additional license terms from the party that provided
|
||||
* you this software, covering your right to use that party's intellectual
|
||||
* property rights.
|
||||
* 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.
|
||||
*
|
||||
* 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
|
||||
* copy of the source code appearing in this file ("Covered Code") an
|
||||
* irrevocable, perpetual, worldwide license under Intel's copyrights in the
|
||||
* base code distributed originally by Intel ("Original Intel Code") to copy,
|
||||
* make derivatives, distribute, use and display any portion of the Covered
|
||||
* Code in any form, with the right to sublicense such rights; and
|
||||
*
|
||||
* 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
|
||||
* license (with the right to sublicense), under only those claims of Intel
|
||||
* patents that are infringed by the Original Intel Code, to make, use, sell,
|
||||
* offer to sell, and import the Covered Code and derivative works thereof
|
||||
* solely to the minimum extent necessary to exercise the above copyright
|
||||
* license, and in no event shall the patent license extend to any additions
|
||||
* to or modifications of the Original Intel Code. No other license or right
|
||||
* is granted directly or by implication, estoppel or otherwise;
|
||||
*
|
||||
* The above copyright and patent license is granted only if the following
|
||||
* conditions are met:
|
||||
*
|
||||
* 3. Conditions
|
||||
*
|
||||
* 3.1. Redistribution of Source with Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification with rights to further distribute source must include
|
||||
* the above Copyright Notice, the above License, this list of Conditions,
|
||||
* and the following Disclaimer and Export Compliance provision. In addition,
|
||||
* Licensee must cause all Covered Code to which Licensee contributes to
|
||||
* contain a file documenting the changes Licensee made to create that Covered
|
||||
* Code and the date of any change. Licensee must include in that file the
|
||||
* documentation of any changes made by any predecessor Licensee. Licensee
|
||||
* must include a prominent statement that the modification is derived,
|
||||
* directly or indirectly, from Original Intel Code.
|
||||
*
|
||||
* 3.2. Redistribution of Source with no Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification without rights to further distribute source must
|
||||
* include the following Disclaimer and Export Compliance provision in the
|
||||
* documentation and/or other materials provided with distribution. In
|
||||
* addition, Licensee may not authorize further sublicense of source of any
|
||||
* portion of the Covered Code, and must include terms to the effect that the
|
||||
* license from Licensee to its licensee is limited to the intellectual
|
||||
* property embodied in the software Licensee provides to its licensee, and
|
||||
* not to intellectual property embodied in modifications its licensee may
|
||||
* make.
|
||||
*
|
||||
* 3.3. Redistribution of Executable. Redistribution in executable form of any
|
||||
* substantial portion of the Covered Code or modification must reproduce the
|
||||
* above Copyright Notice, and the following Disclaimer and Export Compliance
|
||||
* provision in the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3.4. Intel retains all right, title, and interest in and to the Original
|
||||
* Intel Code.
|
||||
*
|
||||
* 3.5. Neither the name Intel nor any other trademark owned or controlled by
|
||||
* Intel shall be used in advertising or otherwise to promote the sale, use or
|
||||
* other dealings in products derived from or relating to the Covered Code
|
||||
* without prior written authorization from Intel.
|
||||
*
|
||||
* 4. Disclaimer and Export Compliance
|
||||
*
|
||||
* 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
|
||||
* HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
|
||||
* IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
|
||||
* INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
|
||||
* UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
|
||||
* PARTICULAR PURPOSE.
|
||||
*
|
||||
* 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
|
||||
* OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
|
||||
* COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
|
||||
* SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
|
||||
* CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
|
||||
* HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
|
||||
* SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
|
||||
* LIMITED REMEDY.
|
||||
*
|
||||
* 4.3. Licensee shall not export, either directly or indirectly, any of this
|
||||
* software or system incorporating such software without first obtaining any
|
||||
* required license or other approval from the U. S. Department of Commerce or
|
||||
* any other agency or department of the United States Government. In the
|
||||
* event Licensee exports any such software from the United States or
|
||||
* re-exports any such software from a foreign destination, Licensee shall
|
||||
* ensure that the distribution and export/re-export of the software is in
|
||||
* compliance with all laws, regulations, orders, or other restrictions of the
|
||||
* U.S. Export Administration Regulations. Licensee agrees that neither it nor
|
||||
* any of its subsidiaries will export/re-export any technical data, process,
|
||||
* software, or service, directly or indirectly, to any country for which the
|
||||
* United States government or any agency thereof requires an export license,
|
||||
* other governmental approval, or letter of assurance, without first obtaining
|
||||
* such license, approval or letter.
|
||||
*
|
||||
*****************************************************************************/
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef __ACCOMMON_H__
|
||||
#define __ACCOMMON_H__
|
||||
|
||||
@@ -4,114 +4,42 @@
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
* 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.
|
||||
*
|
||||
* 2.1. This is your license from Intel Corp. under its intellectual property
|
||||
* rights. You may have additional license terms from the party that provided
|
||||
* you this software, covering your right to use that party's intellectual
|
||||
* property rights.
|
||||
* 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.
|
||||
*
|
||||
* 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
|
||||
* copy of the source code appearing in this file ("Covered Code") an
|
||||
* irrevocable, perpetual, worldwide license under Intel's copyrights in the
|
||||
* base code distributed originally by Intel ("Original Intel Code") to copy,
|
||||
* make derivatives, distribute, use and display any portion of the Covered
|
||||
* Code in any form, with the right to sublicense such rights; and
|
||||
*
|
||||
* 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
|
||||
* license (with the right to sublicense), under only those claims of Intel
|
||||
* patents that are infringed by the Original Intel Code, to make, use, sell,
|
||||
* offer to sell, and import the Covered Code and derivative works thereof
|
||||
* solely to the minimum extent necessary to exercise the above copyright
|
||||
* license, and in no event shall the patent license extend to any additions
|
||||
* to or modifications of the Original Intel Code. No other license or right
|
||||
* is granted directly or by implication, estoppel or otherwise;
|
||||
*
|
||||
* The above copyright and patent license is granted only if the following
|
||||
* conditions are met:
|
||||
*
|
||||
* 3. Conditions
|
||||
*
|
||||
* 3.1. Redistribution of Source with Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification with rights to further distribute source must include
|
||||
* the above Copyright Notice, the above License, this list of Conditions,
|
||||
* and the following Disclaimer and Export Compliance provision. In addition,
|
||||
* Licensee must cause all Covered Code to which Licensee contributes to
|
||||
* contain a file documenting the changes Licensee made to create that Covered
|
||||
* Code and the date of any change. Licensee must include in that file the
|
||||
* documentation of any changes made by any predecessor Licensee. Licensee
|
||||
* must include a prominent statement that the modification is derived,
|
||||
* directly or indirectly, from Original Intel Code.
|
||||
*
|
||||
* 3.2. Redistribution of Source with no Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification without rights to further distribute source must
|
||||
* include the following Disclaimer and Export Compliance provision in the
|
||||
* documentation and/or other materials provided with distribution. In
|
||||
* addition, Licensee may not authorize further sublicense of source of any
|
||||
* portion of the Covered Code, and must include terms to the effect that the
|
||||
* license from Licensee to its licensee is limited to the intellectual
|
||||
* property embodied in the software Licensee provides to its licensee, and
|
||||
* not to intellectual property embodied in modifications its licensee may
|
||||
* make.
|
||||
*
|
||||
* 3.3. Redistribution of Executable. Redistribution in executable form of any
|
||||
* substantial portion of the Covered Code or modification must reproduce the
|
||||
* above Copyright Notice, and the following Disclaimer and Export Compliance
|
||||
* provision in the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3.4. Intel retains all right, title, and interest in and to the Original
|
||||
* Intel Code.
|
||||
*
|
||||
* 3.5. Neither the name Intel nor any other trademark owned or controlled by
|
||||
* Intel shall be used in advertising or otherwise to promote the sale, use or
|
||||
* other dealings in products derived from or relating to the Covered Code
|
||||
* without prior written authorization from Intel.
|
||||
*
|
||||
* 4. Disclaimer and Export Compliance
|
||||
*
|
||||
* 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
|
||||
* HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
|
||||
* IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
|
||||
* INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
|
||||
* UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
|
||||
* PARTICULAR PURPOSE.
|
||||
*
|
||||
* 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
|
||||
* OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
|
||||
* COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
|
||||
* SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
|
||||
* CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
|
||||
* HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
|
||||
* SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
|
||||
* LIMITED REMEDY.
|
||||
*
|
||||
* 4.3. Licensee shall not export, either directly or indirectly, any of this
|
||||
* software or system incorporating such software without first obtaining any
|
||||
* required license or other approval from the U. S. Department of Commerce or
|
||||
* any other agency or department of the United States Government. In the
|
||||
* event Licensee exports any such software from the United States or
|
||||
* re-exports any such software from a foreign destination, Licensee shall
|
||||
* ensure that the distribution and export/re-export of the software is in
|
||||
* compliance with all laws, regulations, orders, or other restrictions of the
|
||||
* U.S. Export Administration Regulations. Licensee agrees that neither it nor
|
||||
* any of its subsidiaries will export/re-export any technical data, process,
|
||||
* software, or service, directly or indirectly, to any country for which the
|
||||
* United States government or any agency thereof requires an export license,
|
||||
* other governmental approval, or letter of assurance, without first obtaining
|
||||
* such license, approval or letter.
|
||||
*
|
||||
*****************************************************************************/
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef _ACCONFIG_H
|
||||
#define _ACCONFIG_H
|
||||
@@ -125,8 +53,8 @@
|
||||
|
||||
/*
|
||||
* ACPI_DEBUG_OUTPUT - This switch enables all the debug facilities of the
|
||||
* ACPI subsystem. This includes the DEBUG_PRINT output
|
||||
* statements. When disabled, all DEBUG_PRINT
|
||||
* ACPI subsystem. This includes the DEBUG_PRINT output
|
||||
* statements. When disabled, all DEBUG_PRINT
|
||||
* statements are compiled out.
|
||||
*
|
||||
* ACPI_APPLICATION - Use this switch if the subsystem is going to be run
|
||||
@@ -135,12 +63,12 @@
|
||||
*/
|
||||
|
||||
/*
|
||||
* OS name, used for the _OS object. The _OS object is essentially obsolete,
|
||||
* OS name, used for the _OS object. The _OS object is essentially obsolete,
|
||||
* but there is a large base of ASL/AML code in existing machines that check
|
||||
* for the string below. The use of this string usually guarantees that
|
||||
* the ASL will execute down the most tested code path. Also, there is some
|
||||
* for the string below. The use of this string usually guarantees that
|
||||
* the ASL will execute down the most tested code path. Also, there is some
|
||||
* code that will not execute the _OSI method unless _OS matches the string
|
||||
* below. Therefore, change this string at your own risk.
|
||||
* below. Therefore, change this string at your own risk.
|
||||
*/
|
||||
#define ACPI_OS_NAME "Microsoft Windows NT"
|
||||
|
||||
@@ -156,7 +84,28 @@
|
||||
* Should the subsystem abort the loading of an ACPI table if the
|
||||
* table checksum is incorrect?
|
||||
*/
|
||||
#ifndef ACPI_CHECKSUM_ABORT
|
||||
#define ACPI_CHECKSUM_ABORT FALSE
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Generate a version of ACPICA that only supports "reduced hardware"
|
||||
* platforms (as defined in ACPI 5.0). Set to TRUE to generate a specialized
|
||||
* version of ACPICA that ONLY supports the ACPI 5.0 "reduced hardware"
|
||||
* model. In other words, no ACPI hardware is supported.
|
||||
*
|
||||
* If TRUE, this means no support for the following:
|
||||
* PM Event and Control registers
|
||||
* SCI interrupt (and handler)
|
||||
* Fixed Events
|
||||
* General Purpose Events (GPEs)
|
||||
* Global Lock
|
||||
* ACPI PM timer
|
||||
* FACS table (Waking vectors and Global Lock)
|
||||
*/
|
||||
#ifndef ACPI_REDUCED_HARDWARE
|
||||
#define ACPI_REDUCED_HARDWARE FALSE
|
||||
#endif
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
@@ -167,7 +116,7 @@
|
||||
|
||||
/* Version of ACPI supported */
|
||||
|
||||
#define ACPI_CA_SUPPORT_LEVEL 3
|
||||
#define ACPI_CA_SUPPORT_LEVEL 5
|
||||
|
||||
/* Maximum count for a semaphore object */
|
||||
|
||||
@@ -195,7 +144,11 @@
|
||||
|
||||
/* Maximum sleep allowed via Sleep() operator */
|
||||
|
||||
#define ACPI_MAX_SLEEP 20000 /* Two seconds */
|
||||
#define ACPI_MAX_SLEEP 2000 /* 2000 millisec == two seconds */
|
||||
|
||||
/* Address Range lists are per-SpaceId (Memory and I/O only) */
|
||||
|
||||
#define ACPI_ADDRESS_RANGE_MAX 2
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
@@ -240,14 +193,14 @@
|
||||
|
||||
/* Operation regions */
|
||||
|
||||
#define ACPI_NUM_PREDEFINED_REGIONS 9
|
||||
#define ACPI_USER_REGION_BEGIN 0x80
|
||||
|
||||
/* Maximum SpaceIds for Operation Regions */
|
||||
|
||||
#define ACPI_MAX_ADDRESS_SPACE 255
|
||||
#define ACPI_NUM_DEFAULT_SPACES 4
|
||||
|
||||
/* Array sizes. Used for range checking also */
|
||||
/* Array sizes. Used for range checking also */
|
||||
|
||||
#define ACPI_MAX_MATCH_OPCODE 5
|
||||
|
||||
@@ -256,9 +209,10 @@
|
||||
#define ACPI_RSDP_CHECKSUM_LENGTH 20
|
||||
#define ACPI_RSDP_XCHECKSUM_LENGTH 36
|
||||
|
||||
/* SMBus and IPMI bidirectional buffer size */
|
||||
/* SMBus, GSBus and IPMI bidirectional buffer size */
|
||||
|
||||
#define ACPI_SMBUS_BUFFER_SIZE 34
|
||||
#define ACPI_GSBUS_BUFFER_SIZE 34
|
||||
#define ACPI_IPMI_BUFFER_SIZE 66
|
||||
|
||||
/* _SxD and _SxW control methods */
|
||||
@@ -267,17 +221,36 @@
|
||||
#define ACPI_NUM_SxW_METHODS 5
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* Miscellaneous constants
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/* UUID constants */
|
||||
|
||||
#define UUID_BUFFER_LENGTH 16 /* Length of UUID in memory */
|
||||
#define UUID_STRING_LENGTH 36 /* Total length of a UUID string */
|
||||
|
||||
/* Positions for required hyphens (dashes) in UUID strings */
|
||||
|
||||
#define UUID_HYPHEN1_OFFSET 8
|
||||
#define UUID_HYPHEN2_OFFSET 13
|
||||
#define UUID_HYPHEN3_OFFSET 18
|
||||
#define UUID_HYPHEN4_OFFSET 23
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* ACPI AML Debugger
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
#define ACPI_DEBUGGER_MAX_ARGS 8 /* Must be max method args + 1 */
|
||||
#define ACPI_DEBUGGER_MAX_ARGS ACPI_METHOD_NUM_ARGS + 4 /* Max command line arguments */
|
||||
#define ACPI_DB_LINE_BUFFER_SIZE 512
|
||||
|
||||
#define ACPI_DEBUGGER_COMMAND_PROMPT '-'
|
||||
#define ACPI_DEBUGGER_EXECUTE_PROMPT '%'
|
||||
|
||||
|
||||
#endif /* _ACCONFIG_H */
|
||||
|
||||
|
||||
@@ -4,140 +4,76 @@
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
* 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.
|
||||
*
|
||||
* 2.1. This is your license from Intel Corp. under its intellectual property
|
||||
* rights. You may have additional license terms from the party that provided
|
||||
* you this software, covering your right to use that party's intellectual
|
||||
* property rights.
|
||||
* 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.
|
||||
*
|
||||
* 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
|
||||
* copy of the source code appearing in this file ("Covered Code") an
|
||||
* irrevocable, perpetual, worldwide license under Intel's copyrights in the
|
||||
* base code distributed originally by Intel ("Original Intel Code") to copy,
|
||||
* make derivatives, distribute, use and display any portion of the Covered
|
||||
* Code in any form, with the right to sublicense such rights; and
|
||||
*
|
||||
* 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
|
||||
* license (with the right to sublicense), under only those claims of Intel
|
||||
* patents that are infringed by the Original Intel Code, to make, use, sell,
|
||||
* offer to sell, and import the Covered Code and derivative works thereof
|
||||
* solely to the minimum extent necessary to exercise the above copyright
|
||||
* license, and in no event shall the patent license extend to any additions
|
||||
* to or modifications of the Original Intel Code. No other license or right
|
||||
* is granted directly or by implication, estoppel or otherwise;
|
||||
*
|
||||
* The above copyright and patent license is granted only if the following
|
||||
* conditions are met:
|
||||
*
|
||||
* 3. Conditions
|
||||
*
|
||||
* 3.1. Redistribution of Source with Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification with rights to further distribute source must include
|
||||
* the above Copyright Notice, the above License, this list of Conditions,
|
||||
* and the following Disclaimer and Export Compliance provision. In addition,
|
||||
* Licensee must cause all Covered Code to which Licensee contributes to
|
||||
* contain a file documenting the changes Licensee made to create that Covered
|
||||
* Code and the date of any change. Licensee must include in that file the
|
||||
* documentation of any changes made by any predecessor Licensee. Licensee
|
||||
* must include a prominent statement that the modification is derived,
|
||||
* directly or indirectly, from Original Intel Code.
|
||||
*
|
||||
* 3.2. Redistribution of Source with no Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification without rights to further distribute source must
|
||||
* include the following Disclaimer and Export Compliance provision in the
|
||||
* documentation and/or other materials provided with distribution. In
|
||||
* addition, Licensee may not authorize further sublicense of source of any
|
||||
* portion of the Covered Code, and must include terms to the effect that the
|
||||
* license from Licensee to its licensee is limited to the intellectual
|
||||
* property embodied in the software Licensee provides to its licensee, and
|
||||
* not to intellectual property embodied in modifications its licensee may
|
||||
* make.
|
||||
*
|
||||
* 3.3. Redistribution of Executable. Redistribution in executable form of any
|
||||
* substantial portion of the Covered Code or modification must reproduce the
|
||||
* above Copyright Notice, and the following Disclaimer and Export Compliance
|
||||
* provision in the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3.4. Intel retains all right, title, and interest in and to the Original
|
||||
* Intel Code.
|
||||
*
|
||||
* 3.5. Neither the name Intel nor any other trademark owned or controlled by
|
||||
* Intel shall be used in advertising or otherwise to promote the sale, use or
|
||||
* other dealings in products derived from or relating to the Covered Code
|
||||
* without prior written authorization from Intel.
|
||||
*
|
||||
* 4. Disclaimer and Export Compliance
|
||||
*
|
||||
* 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
|
||||
* HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
|
||||
* IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
|
||||
* INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
|
||||
* UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
|
||||
* PARTICULAR PURPOSE.
|
||||
*
|
||||
* 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
|
||||
* OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
|
||||
* COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
|
||||
* SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
|
||||
* CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
|
||||
* HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
|
||||
* SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
|
||||
* LIMITED REMEDY.
|
||||
*
|
||||
* 4.3. Licensee shall not export, either directly or indirectly, any of this
|
||||
* software or system incorporating such software without first obtaining any
|
||||
* required license or other approval from the U. S. Department of Commerce or
|
||||
* any other agency or department of the United States Government. In the
|
||||
* event Licensee exports any such software from the United States or
|
||||
* re-exports any such software from a foreign destination, Licensee shall
|
||||
* ensure that the distribution and export/re-export of the software is in
|
||||
* compliance with all laws, regulations, orders, or other restrictions of the
|
||||
* U.S. Export Administration Regulations. Licensee agrees that neither it nor
|
||||
* any of its subsidiaries will export/re-export any technical data, process,
|
||||
* software, or service, directly or indirectly, to any country for which the
|
||||
* United States government or any agency thereof requires an export license,
|
||||
* other governmental approval, or letter of assurance, without first obtaining
|
||||
* such license, approval or letter.
|
||||
*
|
||||
*****************************************************************************/
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef __ACDEBUG_H__
|
||||
#define __ACDEBUG_H__
|
||||
|
||||
|
||||
#define ACPI_DEBUG_BUFFER_SIZE 4196
|
||||
#define ACPI_DEBUG_BUFFER_SIZE 0x4000 /* 16K buffer for return objects */
|
||||
|
||||
typedef struct CommandInfo
|
||||
typedef struct acpi_db_command_info
|
||||
{
|
||||
char *Name; /* Command Name */
|
||||
UINT8 MinArgs; /* Minimum arguments required */
|
||||
|
||||
} COMMAND_INFO;
|
||||
} ACPI_DB_COMMAND_INFO;
|
||||
|
||||
typedef struct ArgumentInfo
|
||||
typedef struct acpi_db_command_help
|
||||
{
|
||||
UINT8 LineCount; /* Number of help lines */
|
||||
char *Invocation; /* Command Invocation */
|
||||
char *Description; /* Command Description */
|
||||
|
||||
} ACPI_DB_COMMAND_HELP;
|
||||
|
||||
typedef struct acpi_db_argument_info
|
||||
{
|
||||
char *Name; /* Argument Name */
|
||||
|
||||
} ARGUMENT_INFO;
|
||||
} ACPI_DB_ARGUMENT_INFO;
|
||||
|
||||
typedef struct acpi_execute_walk
|
||||
typedef struct acpi_db_execute_walk
|
||||
{
|
||||
UINT32 Count;
|
||||
UINT32 MaxCount;
|
||||
|
||||
} ACPI_EXECUTE_WALK;
|
||||
} ACPI_DB_EXECUTE_WALK;
|
||||
|
||||
|
||||
#define PARAM_LIST(pl) pl
|
||||
@@ -170,20 +106,101 @@ AcpiDbSingleStep (
|
||||
/*
|
||||
* dbcmds - debug commands and output routines
|
||||
*/
|
||||
ACPI_STATUS
|
||||
AcpiDbDisassembleMethod (
|
||||
char *Name);
|
||||
ACPI_NAMESPACE_NODE *
|
||||
AcpiDbConvertToNode (
|
||||
char *InString);
|
||||
|
||||
void
|
||||
AcpiDbDisplayTableInfo (
|
||||
char *TableArg);
|
||||
|
||||
void
|
||||
AcpiDbUnloadAcpiTable (
|
||||
char *TableArg,
|
||||
char *InstanceArg);
|
||||
AcpiDbDisplayTemplate (
|
||||
char *BufferArg);
|
||||
|
||||
void
|
||||
AcpiDbUnloadAcpiTable (
|
||||
char *Name);
|
||||
|
||||
void
|
||||
AcpiDbSendNotify (
|
||||
char *Name,
|
||||
UINT32 Value);
|
||||
|
||||
void
|
||||
AcpiDbDisplayInterfaces (
|
||||
char *ActionArg,
|
||||
char *InterfaceNameArg);
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiDbSleep (
|
||||
char *ObjectArg);
|
||||
|
||||
void
|
||||
AcpiDbDisplayLocks (
|
||||
void);
|
||||
|
||||
void
|
||||
AcpiDbDisplayResources (
|
||||
char *ObjectArg);
|
||||
|
||||
ACPI_HW_DEPENDENT_RETURN_VOID (
|
||||
void
|
||||
AcpiDbDisplayGpes (
|
||||
void))
|
||||
|
||||
void
|
||||
AcpiDbDisplayHandlers (
|
||||
void);
|
||||
|
||||
ACPI_HW_DEPENDENT_RETURN_VOID (
|
||||
void
|
||||
AcpiDbGenerateGpe (
|
||||
char *GpeArg,
|
||||
char *BlockArg))
|
||||
|
||||
ACPI_HW_DEPENDENT_RETURN_VOID (
|
||||
void
|
||||
AcpiDbGenerateSci (
|
||||
void))
|
||||
|
||||
void
|
||||
AcpiDbExecuteTest (
|
||||
char *TypeArg);
|
||||
|
||||
|
||||
/*
|
||||
* dbconvert - miscellaneous conversion routines
|
||||
*/
|
||||
ACPI_STATUS
|
||||
AcpiDbHexCharToValue (
|
||||
int HexChar,
|
||||
UINT8 *ReturnValue);
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiDbConvertToPackage (
|
||||
char *String,
|
||||
ACPI_OBJECT *Object);
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiDbConvertToObject (
|
||||
ACPI_OBJECT_TYPE Type,
|
||||
char *String,
|
||||
ACPI_OBJECT *Object);
|
||||
|
||||
UINT8 *
|
||||
AcpiDbEncodePldBuffer (
|
||||
ACPI_PLD_INFO *PldInfo);
|
||||
|
||||
void
|
||||
AcpiDbDumpPldBuffer (
|
||||
ACPI_OBJECT *ObjDesc);
|
||||
|
||||
|
||||
/*
|
||||
* dbmethod - control method commands
|
||||
*/
|
||||
void
|
||||
AcpiDbSetMethodBreakpoint (
|
||||
char *Location,
|
||||
ACPI_WALK_STATE *WalkState,
|
||||
@@ -194,84 +211,71 @@ AcpiDbSetMethodCallBreakpoint (
|
||||
ACPI_PARSE_OBJECT *Op);
|
||||
|
||||
void
|
||||
AcpiDbGetBusInfo (
|
||||
void);
|
||||
AcpiDbSetMethodData (
|
||||
char *TypeArg,
|
||||
char *IndexArg,
|
||||
char *ValueArg);
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiDbDisassembleMethod (
|
||||
char *Name);
|
||||
|
||||
void
|
||||
AcpiDbDisassembleAml (
|
||||
char *Statements,
|
||||
ACPI_PARSE_OBJECT *Op);
|
||||
|
||||
void
|
||||
AcpiDbBatchExecute (
|
||||
char *CountArg);
|
||||
|
||||
|
||||
/*
|
||||
* dbnames - namespace commands
|
||||
*/
|
||||
void
|
||||
AcpiDbSetScope (
|
||||
char *Name);
|
||||
|
||||
void
|
||||
AcpiDbDumpNamespace (
|
||||
char *StartArg,
|
||||
char *DepthArg);
|
||||
|
||||
void
|
||||
AcpiDbDumpNamespacePaths (
|
||||
void);
|
||||
|
||||
void
|
||||
AcpiDbDumpNamespaceByOwner (
|
||||
char *OwnerArg,
|
||||
char *DepthArg);
|
||||
|
||||
void
|
||||
AcpiDbSendNotify (
|
||||
char *Name,
|
||||
UINT32 Value);
|
||||
ACPI_STATUS
|
||||
AcpiDbFindNameInNamespace (
|
||||
char *NameArg);
|
||||
|
||||
void
|
||||
AcpiDbSetMethodData (
|
||||
char *TypeArg,
|
||||
char *IndexArg,
|
||||
char *ValueArg);
|
||||
AcpiDbCheckPredefinedNames (
|
||||
void);
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiDbDisplayObjects (
|
||||
char *ObjTypeArg,
|
||||
char *DisplayCountArg);
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiDbFindNameInNamespace (
|
||||
char *NameArg);
|
||||
|
||||
void
|
||||
AcpiDbSetScope (
|
||||
char *Name);
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiDbSleep (
|
||||
char *ObjectArg);
|
||||
AcpiDbCheckIntegrity (
|
||||
void);
|
||||
|
||||
void
|
||||
AcpiDbFindReferences (
|
||||
char *ObjectArg);
|
||||
|
||||
void
|
||||
AcpiDbDisplayLocks (
|
||||
AcpiDbGetBusInfo (
|
||||
void);
|
||||
|
||||
void
|
||||
AcpiDbDisplayResources (
|
||||
char *ObjectArg);
|
||||
|
||||
void
|
||||
AcpiDbDisplayGpes (
|
||||
void);
|
||||
|
||||
void
|
||||
AcpiDbCheckIntegrity (
|
||||
void);
|
||||
|
||||
void
|
||||
AcpiDbGenerateGpe (
|
||||
char *GpeArg,
|
||||
char *BlockArg);
|
||||
|
||||
void
|
||||
AcpiDbCheckPredefinedNames (
|
||||
void);
|
||||
|
||||
void
|
||||
AcpiDbBatchExecute (
|
||||
char *CountArg);
|
||||
|
||||
/*
|
||||
* dbdisply - debug display commands
|
||||
@@ -327,6 +331,7 @@ void
|
||||
AcpiDbExecute (
|
||||
char *Name,
|
||||
char **Args,
|
||||
ACPI_OBJECT_TYPE *Types,
|
||||
UINT32 Flags);
|
||||
|
||||
void
|
||||
@@ -335,6 +340,11 @@ AcpiDbCreateExecutionThreads (
|
||||
char *NumLoopsArg,
|
||||
char *MethodNameArg);
|
||||
|
||||
void
|
||||
AcpiDbDeleteObjects (
|
||||
UINT32 Count,
|
||||
ACPI_OBJECT *Objects);
|
||||
|
||||
#ifdef ACPI_DBG_TRACK_ALLOCATIONS
|
||||
UINT32
|
||||
AcpiDbGetCacheInfo (
|
||||
@@ -348,7 +358,7 @@ AcpiDbGetCacheInfo (
|
||||
ACPI_OBJECT_TYPE
|
||||
AcpiDbMatchArgument (
|
||||
char *UserArgument,
|
||||
ARGUMENT_INFO *Arguments);
|
||||
ACPI_DB_ARGUMENT_INFO *Arguments);
|
||||
|
||||
void
|
||||
AcpiDbCloseDebugFile (
|
||||
@@ -367,11 +377,6 @@ AcpiDbGetTableFromFile (
|
||||
char *Filename,
|
||||
ACPI_TABLE_HEADER **Table);
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiDbReadTableFromFile (
|
||||
char *Filename,
|
||||
ACPI_TABLE_HEADER **Table);
|
||||
|
||||
|
||||
/*
|
||||
* dbhistry - debugger HISTORY command
|
||||
@@ -388,6 +393,10 @@ char *
|
||||
AcpiDbGetFromHistory (
|
||||
char *CommandNumArg);
|
||||
|
||||
char *
|
||||
AcpiDbGetHistoryByIndex (
|
||||
UINT32 CommanddNum);
|
||||
|
||||
|
||||
/*
|
||||
* dbinput - user front-end to the AML debugger
|
||||
@@ -407,6 +416,12 @@ AcpiDbUserCommands (
|
||||
char Prompt,
|
||||
ACPI_PARSE_OBJECT *Op);
|
||||
|
||||
char *
|
||||
AcpiDbGetNextToken (
|
||||
char *String,
|
||||
char **Next,
|
||||
ACPI_OBJECT_TYPE *ReturnType);
|
||||
|
||||
|
||||
/*
|
||||
* dbstats - Generation and display of ACPI table statistics
|
||||
@@ -442,7 +457,7 @@ AcpiDbLocalNsLookup (
|
||||
char *Name);
|
||||
|
||||
void
|
||||
AcpiDbUInt32ToHexString (
|
||||
AcpiDbUint32ToHexString (
|
||||
UINT32 Value,
|
||||
char *Buffer);
|
||||
|
||||
|
||||
@@ -4,114 +4,42 @@
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
* 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.
|
||||
*
|
||||
* 2.1. This is your license from Intel Corp. under its intellectual property
|
||||
* rights. You may have additional license terms from the party that provided
|
||||
* you this software, covering your right to use that party's intellectual
|
||||
* property rights.
|
||||
* 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.
|
||||
*
|
||||
* 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
|
||||
* copy of the source code appearing in this file ("Covered Code") an
|
||||
* irrevocable, perpetual, worldwide license under Intel's copyrights in the
|
||||
* base code distributed originally by Intel ("Original Intel Code") to copy,
|
||||
* make derivatives, distribute, use and display any portion of the Covered
|
||||
* Code in any form, with the right to sublicense such rights; and
|
||||
*
|
||||
* 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
|
||||
* license (with the right to sublicense), under only those claims of Intel
|
||||
* patents that are infringed by the Original Intel Code, to make, use, sell,
|
||||
* offer to sell, and import the Covered Code and derivative works thereof
|
||||
* solely to the minimum extent necessary to exercise the above copyright
|
||||
* license, and in no event shall the patent license extend to any additions
|
||||
* to or modifications of the Original Intel Code. No other license or right
|
||||
* is granted directly or by implication, estoppel or otherwise;
|
||||
*
|
||||
* The above copyright and patent license is granted only if the following
|
||||
* conditions are met:
|
||||
*
|
||||
* 3. Conditions
|
||||
*
|
||||
* 3.1. Redistribution of Source with Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification with rights to further distribute source must include
|
||||
* the above Copyright Notice, the above License, this list of Conditions,
|
||||
* and the following Disclaimer and Export Compliance provision. In addition,
|
||||
* Licensee must cause all Covered Code to which Licensee contributes to
|
||||
* contain a file documenting the changes Licensee made to create that Covered
|
||||
* Code and the date of any change. Licensee must include in that file the
|
||||
* documentation of any changes made by any predecessor Licensee. Licensee
|
||||
* must include a prominent statement that the modification is derived,
|
||||
* directly or indirectly, from Original Intel Code.
|
||||
*
|
||||
* 3.2. Redistribution of Source with no Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification without rights to further distribute source must
|
||||
* include the following Disclaimer and Export Compliance provision in the
|
||||
* documentation and/or other materials provided with distribution. In
|
||||
* addition, Licensee may not authorize further sublicense of source of any
|
||||
* portion of the Covered Code, and must include terms to the effect that the
|
||||
* license from Licensee to its licensee is limited to the intellectual
|
||||
* property embodied in the software Licensee provides to its licensee, and
|
||||
* not to intellectual property embodied in modifications its licensee may
|
||||
* make.
|
||||
*
|
||||
* 3.3. Redistribution of Executable. Redistribution in executable form of any
|
||||
* substantial portion of the Covered Code or modification must reproduce the
|
||||
* above Copyright Notice, and the following Disclaimer and Export Compliance
|
||||
* provision in the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3.4. Intel retains all right, title, and interest in and to the Original
|
||||
* Intel Code.
|
||||
*
|
||||
* 3.5. Neither the name Intel nor any other trademark owned or controlled by
|
||||
* Intel shall be used in advertising or otherwise to promote the sale, use or
|
||||
* other dealings in products derived from or relating to the Covered Code
|
||||
* without prior written authorization from Intel.
|
||||
*
|
||||
* 4. Disclaimer and Export Compliance
|
||||
*
|
||||
* 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
|
||||
* HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
|
||||
* IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
|
||||
* INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
|
||||
* UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
|
||||
* PARTICULAR PURPOSE.
|
||||
*
|
||||
* 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
|
||||
* OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
|
||||
* COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
|
||||
* SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
|
||||
* CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
|
||||
* HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
|
||||
* SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
|
||||
* LIMITED REMEDY.
|
||||
*
|
||||
* 4.3. Licensee shall not export, either directly or indirectly, any of this
|
||||
* software or system incorporating such software without first obtaining any
|
||||
* required license or other approval from the U. S. Department of Commerce or
|
||||
* any other agency or department of the United States Government. In the
|
||||
* event Licensee exports any such software from the United States or
|
||||
* re-exports any such software from a foreign destination, Licensee shall
|
||||
* ensure that the distribution and export/re-export of the software is in
|
||||
* compliance with all laws, regulations, orders, or other restrictions of the
|
||||
* U.S. Export Administration Regulations. Licensee agrees that neither it nor
|
||||
* any of its subsidiaries will export/re-export any technical data, process,
|
||||
* software, or service, directly or indirectly, to any country for which the
|
||||
* United States government or any agency thereof requires an export license,
|
||||
* other governmental approval, or letter of assurance, without first obtaining
|
||||
* such license, approval or letter.
|
||||
*
|
||||
*****************************************************************************/
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef __ACDISASM_H__
|
||||
#define __ACDISASM_H__
|
||||
@@ -125,71 +53,114 @@
|
||||
#define BLOCK_COMMA_LIST 4
|
||||
#define ACPI_DEFAULT_RESNAME *(UINT32 *) "__RD"
|
||||
|
||||
/*
|
||||
* Raw table data header. Used by disassembler and data table compiler.
|
||||
* Do not change.
|
||||
*/
|
||||
#define ACPI_RAW_TABLE_DATA_HEADER "Raw Table Data"
|
||||
|
||||
|
||||
typedef const struct acpi_dmtable_info
|
||||
{
|
||||
UINT8 Opcode;
|
||||
UINT8 Offset;
|
||||
UINT16 Offset;
|
||||
char *Name;
|
||||
UINT8 Flags;
|
||||
|
||||
} ACPI_DMTABLE_INFO;
|
||||
|
||||
/* Values for Flags field above */
|
||||
|
||||
#define DT_LENGTH 0x01 /* Field is a subtable length */
|
||||
#define DT_FLAG 0x02 /* Field is a flag value */
|
||||
#define DT_NON_ZERO 0x04 /* Field must be non-zero */
|
||||
|
||||
/* TBD: Not used at this time */
|
||||
|
||||
#define DT_OPTIONAL 0x08
|
||||
#define DT_COUNT 0x10
|
||||
#define DT_OPTIONAL 0x08 /* Field is optional */
|
||||
#define DT_DESCRIBES_OPTIONAL 0x10 /* Field describes an optional field (length, etc.) */
|
||||
#define DT_COUNT 0x20 /* Currently not used */
|
||||
|
||||
/*
|
||||
* Values for Opcode above.
|
||||
* Note: 0-7 must not change, used as a flag shift value
|
||||
* Note: 0-7 must not change, they are used as a flag shift value. Other
|
||||
* than those, new values can be added wherever appropriate.
|
||||
*/
|
||||
#define ACPI_DMT_FLAG0 0
|
||||
#define ACPI_DMT_FLAG1 1
|
||||
#define ACPI_DMT_FLAG2 2
|
||||
#define ACPI_DMT_FLAG3 3
|
||||
#define ACPI_DMT_FLAG4 4
|
||||
#define ACPI_DMT_FLAG5 5
|
||||
#define ACPI_DMT_FLAG6 6
|
||||
#define ACPI_DMT_FLAG7 7
|
||||
#define ACPI_DMT_FLAGS0 8
|
||||
#define ACPI_DMT_FLAGS2 9
|
||||
#define ACPI_DMT_UINT8 10
|
||||
#define ACPI_DMT_UINT16 11
|
||||
#define ACPI_DMT_UINT24 12
|
||||
#define ACPI_DMT_UINT32 13
|
||||
#define ACPI_DMT_UINT56 14
|
||||
#define ACPI_DMT_UINT64 15
|
||||
#define ACPI_DMT_STRING 16
|
||||
#define ACPI_DMT_NAME4 17
|
||||
#define ACPI_DMT_NAME6 18
|
||||
#define ACPI_DMT_NAME8 19
|
||||
#define ACPI_DMT_CHKSUM 20
|
||||
#define ACPI_DMT_SPACEID 21
|
||||
#define ACPI_DMT_GAS 22
|
||||
#define ACPI_DMT_ASF 23
|
||||
#define ACPI_DMT_DMAR 24
|
||||
#define ACPI_DMT_HEST 25
|
||||
#define ACPI_DMT_HESTNTFY 26
|
||||
#define ACPI_DMT_HESTNTYP 27
|
||||
#define ACPI_DMT_MADT 28
|
||||
#define ACPI_DMT_SRAT 29
|
||||
#define ACPI_DMT_EXIT 30
|
||||
#define ACPI_DMT_SIG 31
|
||||
#define ACPI_DMT_FADTPM 32
|
||||
#define ACPI_DMT_BUF16 33
|
||||
#define ACPI_DMT_IVRS 34
|
||||
#define ACPI_DMT_BUFFER 35
|
||||
#define ACPI_DMT_PCI_PATH 36
|
||||
#define ACPI_DMT_EINJACT 37
|
||||
#define ACPI_DMT_EINJINST 38
|
||||
#define ACPI_DMT_ERSTACT 39
|
||||
#define ACPI_DMT_ERSTINST 40
|
||||
typedef enum
|
||||
{
|
||||
/* Simple Data Types */
|
||||
|
||||
ACPI_DMT_FLAG0 = 0,
|
||||
ACPI_DMT_FLAG1 = 1,
|
||||
ACPI_DMT_FLAG2 = 2,
|
||||
ACPI_DMT_FLAG3 = 3,
|
||||
ACPI_DMT_FLAG4 = 4,
|
||||
ACPI_DMT_FLAG5 = 5,
|
||||
ACPI_DMT_FLAG6 = 6,
|
||||
ACPI_DMT_FLAG7 = 7,
|
||||
ACPI_DMT_FLAGS0,
|
||||
ACPI_DMT_FLAGS1,
|
||||
ACPI_DMT_FLAGS2,
|
||||
ACPI_DMT_FLAGS4,
|
||||
ACPI_DMT_UINT8,
|
||||
ACPI_DMT_UINT16,
|
||||
ACPI_DMT_UINT24,
|
||||
ACPI_DMT_UINT32,
|
||||
ACPI_DMT_UINT40,
|
||||
ACPI_DMT_UINT48,
|
||||
ACPI_DMT_UINT56,
|
||||
ACPI_DMT_UINT64,
|
||||
ACPI_DMT_BUF7,
|
||||
ACPI_DMT_BUF10,
|
||||
ACPI_DMT_BUF16,
|
||||
ACPI_DMT_BUF128,
|
||||
ACPI_DMT_SIG,
|
||||
ACPI_DMT_STRING,
|
||||
ACPI_DMT_NAME4,
|
||||
ACPI_DMT_NAME6,
|
||||
ACPI_DMT_NAME8,
|
||||
|
||||
/* Types that are decoded to strings and miscellaneous */
|
||||
|
||||
ACPI_DMT_ACCWIDTH,
|
||||
ACPI_DMT_CHKSUM,
|
||||
ACPI_DMT_GAS,
|
||||
ACPI_DMT_SPACEID,
|
||||
ACPI_DMT_UNICODE,
|
||||
ACPI_DMT_UUID,
|
||||
|
||||
/* Types used only for the Data Table Compiler */
|
||||
|
||||
ACPI_DMT_BUFFER,
|
||||
ACPI_DMT_DEVICE_PATH,
|
||||
ACPI_DMT_LABEL,
|
||||
ACPI_DMT_PCI_PATH,
|
||||
|
||||
/* Types that are specific to particular ACPI tables */
|
||||
|
||||
ACPI_DMT_ASF,
|
||||
ACPI_DMT_DMAR,
|
||||
ACPI_DMT_DMAR_SCOPE,
|
||||
ACPI_DMT_EINJACT,
|
||||
ACPI_DMT_EINJINST,
|
||||
ACPI_DMT_ERSTACT,
|
||||
ACPI_DMT_ERSTINST,
|
||||
ACPI_DMT_FADTPM,
|
||||
ACPI_DMT_GTDT,
|
||||
ACPI_DMT_HEST,
|
||||
ACPI_DMT_HESTNTFY,
|
||||
ACPI_DMT_HESTNTYP,
|
||||
ACPI_DMT_IVRS,
|
||||
ACPI_DMT_LPIT,
|
||||
ACPI_DMT_MADT,
|
||||
ACPI_DMT_PCCT,
|
||||
ACPI_DMT_PMTT,
|
||||
ACPI_DMT_SLIC,
|
||||
ACPI_DMT_SRAT,
|
||||
|
||||
/* Special opcodes */
|
||||
|
||||
ACPI_DMT_EXTRA_TEXT,
|
||||
ACPI_DMT_EXIT
|
||||
|
||||
} ACPI_ENTRY_TYPES;
|
||||
|
||||
typedef
|
||||
void (*ACPI_DMTABLE_HANDLER) (
|
||||
@@ -219,6 +190,7 @@ typedef struct acpi_op_walk_info
|
||||
UINT32 BitOffset;
|
||||
UINT32 Flags;
|
||||
ACPI_WALK_STATE *WalkState;
|
||||
ACPI_PARSE_OBJECT *MappingOp;
|
||||
|
||||
} ACPI_OP_WALK_INFO;
|
||||
|
||||
@@ -234,6 +206,12 @@ ACPI_STATUS (*ASL_WALK_CALLBACK) (
|
||||
#define ASL_WALK_CALLBACK_DEFINED
|
||||
#endif
|
||||
|
||||
typedef
|
||||
void (*ACPI_RESOURCE_HANDLER) (
|
||||
ACPI_OP_WALK_INFO *Info,
|
||||
AML_RESOURCE *Resource,
|
||||
UINT32 Length,
|
||||
UINT32 Level);
|
||||
|
||||
typedef struct acpi_resource_tag
|
||||
{
|
||||
@@ -261,8 +239,18 @@ extern ACPI_DMTABLE_INFO AcpiDmTableInfoAsf4[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoAsfHdr[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoBoot[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoBert[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoBgrt[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoCpep[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoCpep0[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoCsrt0[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoCsrt1[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoCsrt2[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoDbg2[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoDbg2Device[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoDbg2Addr[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoDbg2Size[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoDbg2Name[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoDbg2OemData[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoDbgp[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoDmar[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoDmarHdr[];
|
||||
@@ -271,6 +259,8 @@ extern ACPI_DMTABLE_INFO AcpiDmTableInfoDmar0[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoDmar1[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoDmar2[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoDmar3[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoDmar4[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoDrtm[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoEcdt[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoEinj[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoEinj0[];
|
||||
@@ -280,7 +270,17 @@ extern ACPI_DMTABLE_INFO AcpiDmTableInfoFacs[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoFadt1[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoFadt2[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoFadt3[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoFadt5[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoFpdt[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoFpdtHdr[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoFpdt0[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoFpdt1[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoGas[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoGtdt[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoGtdtHdr[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoGtdt0[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoGtdt0a[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoGtdt1[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoHeader[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoHest[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoHest0[];
|
||||
@@ -293,6 +293,9 @@ extern ACPI_DMTABLE_INFO AcpiDmTableInfoHest9[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoHestNotify[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoHestBank[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoHpet[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoLpitHdr[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoLpit0[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoLpit1[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoIvrs[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoIvrs0[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoIvrs1[];
|
||||
@@ -313,16 +316,44 @@ extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadt7[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadt8[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadt9[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadt10[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadt11[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadt12[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadt13[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadt14[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadtHdr[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoMcfg[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoMcfg0[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoMchi[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoMpst[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoMpst0[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoMpst0A[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoMpst0B[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoMpst1[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoMpst2[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoMsct[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoMsct0[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoMtmr[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoMtmr0[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoPmtt[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoPmtt0[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoPmtt1[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoPmtt1a[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoPmtt2[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoPmttHdr[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoPcct[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoPcctHdr[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoPcct0[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoPcct1[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoRsdp1[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoRsdp2[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoS3pt[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoS3ptHdr[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoS3pt0[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoS3pt1[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoSbst[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoSlic[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoSlicHdr[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoSlic0[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoSlic1[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoSlit[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoSpcr[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoSpmi[];
|
||||
@@ -331,14 +362,20 @@ extern ACPI_DMTABLE_INFO AcpiDmTableInfoSratHdr[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoSrat0[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoSrat1[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoSrat2[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoSrat3[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoTcpa[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoTpm2[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoUefi[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoVrtc[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoVrtc0[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoWaet[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoWdat[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoWdat0[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoWddt[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoWdrt[];
|
||||
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoGeneric[][2];
|
||||
|
||||
|
||||
/*
|
||||
* dmtable
|
||||
@@ -392,6 +429,14 @@ void
|
||||
AcpiDmDumpCpep (
|
||||
ACPI_TABLE_HEADER *Table);
|
||||
|
||||
void
|
||||
AcpiDmDumpCsrt (
|
||||
ACPI_TABLE_HEADER *Table);
|
||||
|
||||
void
|
||||
AcpiDmDumpDbg2 (
|
||||
ACPI_TABLE_HEADER *Table);
|
||||
|
||||
void
|
||||
AcpiDmDumpDmar (
|
||||
ACPI_TABLE_HEADER *Table);
|
||||
@@ -408,6 +453,14 @@ void
|
||||
AcpiDmDumpFadt (
|
||||
ACPI_TABLE_HEADER *Table);
|
||||
|
||||
void
|
||||
AcpiDmDumpFpdt (
|
||||
ACPI_TABLE_HEADER *Table);
|
||||
|
||||
void
|
||||
AcpiDmDumpGtdt (
|
||||
ACPI_TABLE_HEADER *Table);
|
||||
|
||||
void
|
||||
AcpiDmDumpHest (
|
||||
ACPI_TABLE_HEADER *Table);
|
||||
@@ -417,17 +470,37 @@ AcpiDmDumpIvrs (
|
||||
ACPI_TABLE_HEADER *Table);
|
||||
|
||||
void
|
||||
AcpiDmDumpMcfg (
|
||||
AcpiDmDumpLpit (
|
||||
ACPI_TABLE_HEADER *Table);
|
||||
|
||||
void
|
||||
AcpiDmDumpMadt (
|
||||
ACPI_TABLE_HEADER *Table);
|
||||
|
||||
void
|
||||
AcpiDmDumpMcfg (
|
||||
ACPI_TABLE_HEADER *Table);
|
||||
|
||||
void
|
||||
AcpiDmDumpMpst (
|
||||
ACPI_TABLE_HEADER *Table);
|
||||
|
||||
void
|
||||
AcpiDmDumpMsct (
|
||||
ACPI_TABLE_HEADER *Table);
|
||||
|
||||
void
|
||||
AcpiDmDumpMtmr (
|
||||
ACPI_TABLE_HEADER *Table);
|
||||
|
||||
void
|
||||
AcpiDmDumpPcct (
|
||||
ACPI_TABLE_HEADER *Table);
|
||||
|
||||
void
|
||||
AcpiDmDumpPmtt (
|
||||
ACPI_TABLE_HEADER *Table);
|
||||
|
||||
UINT32
|
||||
AcpiDmDumpRsdp (
|
||||
ACPI_TABLE_HEADER *Table);
|
||||
@@ -436,6 +509,14 @@ void
|
||||
AcpiDmDumpRsdt (
|
||||
ACPI_TABLE_HEADER *Table);
|
||||
|
||||
UINT32
|
||||
AcpiDmDumpS3pt (
|
||||
ACPI_TABLE_HEADER *Table);
|
||||
|
||||
void
|
||||
AcpiDmDumpSlic (
|
||||
ACPI_TABLE_HEADER *Table);
|
||||
|
||||
void
|
||||
AcpiDmDumpSlit (
|
||||
ACPI_TABLE_HEADER *Table);
|
||||
@@ -444,6 +525,10 @@ void
|
||||
AcpiDmDumpSrat (
|
||||
ACPI_TABLE_HEADER *Table);
|
||||
|
||||
void
|
||||
AcpiDmDumpVrtc (
|
||||
ACPI_TABLE_HEADER *Table);
|
||||
|
||||
void
|
||||
AcpiDmDumpWdat (
|
||||
ACPI_TABLE_HEADER *Table);
|
||||
@@ -491,6 +576,22 @@ void
|
||||
AcpiDmMethodFlags (
|
||||
ACPI_PARSE_OBJECT *Op);
|
||||
|
||||
void
|
||||
AcpiDmDisplayTargetPathname (
|
||||
ACPI_PARSE_OBJECT *Op);
|
||||
|
||||
void
|
||||
AcpiDmNotifyDescription (
|
||||
ACPI_PARSE_OBJECT *Op);
|
||||
|
||||
void
|
||||
AcpiDmPredefinedDescription (
|
||||
ACPI_PARSE_OBJECT *Op);
|
||||
|
||||
void
|
||||
AcpiDmFieldPredefinedDescription (
|
||||
ACPI_PARSE_OBJECT *Op);
|
||||
|
||||
void
|
||||
AcpiDmFieldFlags (
|
||||
ACPI_PARSE_OBJECT *Op);
|
||||
@@ -563,13 +664,17 @@ AcpiDmByteList (
|
||||
ACPI_PARSE_OBJECT *Op);
|
||||
|
||||
void
|
||||
AcpiDmIsEisaId (
|
||||
AcpiDmCheckForHardwareId (
|
||||
ACPI_PARSE_OBJECT *Op);
|
||||
|
||||
void
|
||||
AcpiDmEisaId (
|
||||
AcpiDmDecompressEisaId (
|
||||
UINT32 EncodedId);
|
||||
|
||||
BOOLEAN
|
||||
AcpiDmIsUuidBuffer (
|
||||
ACPI_PARSE_OBJECT *Op);
|
||||
|
||||
BOOLEAN
|
||||
AcpiDmIsUnicodeBuffer (
|
||||
ACPI_PARSE_OBJECT *Op);
|
||||
@@ -578,16 +683,44 @@ BOOLEAN
|
||||
AcpiDmIsStringBuffer (
|
||||
ACPI_PARSE_OBJECT *Op);
|
||||
|
||||
BOOLEAN
|
||||
AcpiDmIsPldBuffer (
|
||||
ACPI_PARSE_OBJECT *Op);
|
||||
|
||||
|
||||
/*
|
||||
* dmdeferred
|
||||
*/
|
||||
ACPI_STATUS
|
||||
AcpiDmParseDeferredOps (
|
||||
ACPI_PARSE_OBJECT *Root);
|
||||
|
||||
|
||||
/*
|
||||
* dmextern
|
||||
*/
|
||||
ACPI_STATUS
|
||||
AcpiDmAddToExternalFileList (
|
||||
char *PathList);
|
||||
|
||||
void
|
||||
AcpiDmAddToExternalList (
|
||||
AcpiDmClearExternalFileList (
|
||||
void);
|
||||
|
||||
void
|
||||
AcpiDmAddOpToExternalList (
|
||||
ACPI_PARSE_OBJECT *Op,
|
||||
char *Path,
|
||||
UINT8 Type,
|
||||
UINT32 Value);
|
||||
UINT32 Value,
|
||||
UINT16 Flags);
|
||||
|
||||
void
|
||||
AcpiDmAddNodeToExternalList (
|
||||
ACPI_NAMESPACE_NODE *Node,
|
||||
UINT8 Type,
|
||||
UINT32 Value,
|
||||
UINT16 Flags);
|
||||
|
||||
void
|
||||
AcpiDmAddExternalsToNamespace (
|
||||
@@ -605,6 +738,13 @@ void
|
||||
AcpiDmEmitExternals (
|
||||
void);
|
||||
|
||||
void
|
||||
AcpiDmUnresolvedWarning (
|
||||
UINT8 Type);
|
||||
|
||||
void
|
||||
AcpiDmGetExternalsFromFile (
|
||||
void);
|
||||
|
||||
/*
|
||||
* dmresrc
|
||||
@@ -638,6 +778,7 @@ AcpiDmResourceTemplate (
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiDmIsResourceTemplate (
|
||||
ACPI_WALK_STATE *WalkState,
|
||||
ACPI_PARSE_OBJECT *Op);
|
||||
|
||||
void
|
||||
@@ -654,60 +795,84 @@ AcpiDmDescriptorName (
|
||||
*/
|
||||
void
|
||||
AcpiDmWordDescriptor (
|
||||
ACPI_OP_WALK_INFO *Info,
|
||||
AML_RESOURCE *Resource,
|
||||
UINT32 Length,
|
||||
UINT32 Level);
|
||||
|
||||
void
|
||||
AcpiDmDwordDescriptor (
|
||||
ACPI_OP_WALK_INFO *Info,
|
||||
AML_RESOURCE *Resource,
|
||||
UINT32 Length,
|
||||
UINT32 Level);
|
||||
|
||||
void
|
||||
AcpiDmExtendedDescriptor (
|
||||
ACPI_OP_WALK_INFO *Info,
|
||||
AML_RESOURCE *Resource,
|
||||
UINT32 Length,
|
||||
UINT32 Level);
|
||||
|
||||
void
|
||||
AcpiDmQwordDescriptor (
|
||||
ACPI_OP_WALK_INFO *Info,
|
||||
AML_RESOURCE *Resource,
|
||||
UINT32 Length,
|
||||
UINT32 Level);
|
||||
|
||||
void
|
||||
AcpiDmMemory24Descriptor (
|
||||
ACPI_OP_WALK_INFO *Info,
|
||||
AML_RESOURCE *Resource,
|
||||
UINT32 Length,
|
||||
UINT32 Level);
|
||||
|
||||
void
|
||||
AcpiDmMemory32Descriptor (
|
||||
ACPI_OP_WALK_INFO *Info,
|
||||
AML_RESOURCE *Resource,
|
||||
UINT32 Length,
|
||||
UINT32 Level);
|
||||
|
||||
void
|
||||
AcpiDmFixedMemory32Descriptor (
|
||||
ACPI_OP_WALK_INFO *Info,
|
||||
AML_RESOURCE *Resource,
|
||||
UINT32 Length,
|
||||
UINT32 Level);
|
||||
|
||||
void
|
||||
AcpiDmGenericRegisterDescriptor (
|
||||
ACPI_OP_WALK_INFO *Info,
|
||||
AML_RESOURCE *Resource,
|
||||
UINT32 Length,
|
||||
UINT32 Level);
|
||||
|
||||
void
|
||||
AcpiDmInterruptDescriptor (
|
||||
ACPI_OP_WALK_INFO *Info,
|
||||
AML_RESOURCE *Resource,
|
||||
UINT32 Length,
|
||||
UINT32 Level);
|
||||
|
||||
void
|
||||
AcpiDmVendorLargeDescriptor (
|
||||
ACPI_OP_WALK_INFO *Info,
|
||||
AML_RESOURCE *Resource,
|
||||
UINT32 Length,
|
||||
UINT32 Level);
|
||||
|
||||
void
|
||||
AcpiDmGpioDescriptor (
|
||||
ACPI_OP_WALK_INFO *Info,
|
||||
AML_RESOURCE *Resource,
|
||||
UINT32 Length,
|
||||
UINT32 Level);
|
||||
|
||||
void
|
||||
AcpiDmSerialBusDescriptor (
|
||||
ACPI_OP_WALK_INFO *Info,
|
||||
AML_RESOURCE *Resource,
|
||||
UINT32 Length,
|
||||
UINT32 Level);
|
||||
@@ -725,42 +890,56 @@ AcpiDmVendorCommon (
|
||||
*/
|
||||
void
|
||||
AcpiDmIrqDescriptor (
|
||||
ACPI_OP_WALK_INFO *Info,
|
||||
AML_RESOURCE *Resource,
|
||||
UINT32 Length,
|
||||
UINT32 Level);
|
||||
|
||||
void
|
||||
AcpiDmDmaDescriptor (
|
||||
ACPI_OP_WALK_INFO *Info,
|
||||
AML_RESOURCE *Resource,
|
||||
UINT32 Length,
|
||||
UINT32 Level);
|
||||
|
||||
void
|
||||
AcpiDmFixedDmaDescriptor (
|
||||
ACPI_OP_WALK_INFO *Info,
|
||||
AML_RESOURCE *Resource,
|
||||
UINT32 Length,
|
||||
UINT32 Level);
|
||||
|
||||
void
|
||||
AcpiDmIoDescriptor (
|
||||
ACPI_OP_WALK_INFO *Info,
|
||||
AML_RESOURCE *Resource,
|
||||
UINT32 Length,
|
||||
UINT32 Level);
|
||||
|
||||
void
|
||||
AcpiDmFixedIoDescriptor (
|
||||
ACPI_OP_WALK_INFO *Info,
|
||||
AML_RESOURCE *Resource,
|
||||
UINT32 Length,
|
||||
UINT32 Level);
|
||||
|
||||
void
|
||||
AcpiDmStartDependentDescriptor (
|
||||
ACPI_OP_WALK_INFO *Info,
|
||||
AML_RESOURCE *Resource,
|
||||
UINT32 Length,
|
||||
UINT32 Level);
|
||||
|
||||
void
|
||||
AcpiDmEndDependentDescriptor (
|
||||
ACPI_OP_WALK_INFO *Info,
|
||||
AML_RESOURCE *Resource,
|
||||
UINT32 Length,
|
||||
UINT32 Level);
|
||||
|
||||
void
|
||||
AcpiDmVendorSmallDescriptor (
|
||||
ACPI_OP_WALK_INFO *Info,
|
||||
AML_RESOURCE *Resource,
|
||||
UINT32 Length,
|
||||
UINT32 Level);
|
||||
@@ -799,6 +978,19 @@ AcpiDmCheckResourceReference (
|
||||
ACPI_WALK_STATE *WalkState);
|
||||
|
||||
|
||||
/*
|
||||
* dmcstyle
|
||||
*/
|
||||
BOOLEAN
|
||||
AcpiDmCheckForSymbolicOpcode (
|
||||
ACPI_PARSE_OBJECT *Op,
|
||||
ACPI_OP_WALK_INFO *Info);
|
||||
|
||||
void
|
||||
AcpiDmCloseOperator (
|
||||
ACPI_PARSE_OBJECT *Op);
|
||||
|
||||
|
||||
/*
|
||||
* acdisasm
|
||||
*/
|
||||
@@ -806,5 +998,4 @@ void
|
||||
AdDisassemblerHeader (
|
||||
char *Filename);
|
||||
|
||||
|
||||
#endif /* __ACDISASM_H__ */
|
||||
|
||||
@@ -4,115 +4,42 @@
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
* 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.
|
||||
*
|
||||
* 2.1. This is your license from Intel Corp. under its intellectual property
|
||||
* rights. You may have additional license terms from the party that provided
|
||||
* you this software, covering your right to use that party's intellectual
|
||||
* property rights.
|
||||
* 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.
|
||||
*
|
||||
* 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
|
||||
* copy of the source code appearing in this file ("Covered Code") an
|
||||
* irrevocable, perpetual, worldwide license under Intel's copyrights in the
|
||||
* base code distributed originally by Intel ("Original Intel Code") to copy,
|
||||
* make derivatives, distribute, use and display any portion of the Covered
|
||||
* Code in any form, with the right to sublicense such rights; and
|
||||
*
|
||||
* 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
|
||||
* license (with the right to sublicense), under only those claims of Intel
|
||||
* patents that are infringed by the Original Intel Code, to make, use, sell,
|
||||
* offer to sell, and import the Covered Code and derivative works thereof
|
||||
* solely to the minimum extent necessary to exercise the above copyright
|
||||
* license, and in no event shall the patent license extend to any additions
|
||||
* to or modifications of the Original Intel Code. No other license or right
|
||||
* is granted directly or by implication, estoppel or otherwise;
|
||||
*
|
||||
* The above copyright and patent license is granted only if the following
|
||||
* conditions are met:
|
||||
*
|
||||
* 3. Conditions
|
||||
*
|
||||
* 3.1. Redistribution of Source with Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification with rights to further distribute source must include
|
||||
* the above Copyright Notice, the above License, this list of Conditions,
|
||||
* and the following Disclaimer and Export Compliance provision. In addition,
|
||||
* Licensee must cause all Covered Code to which Licensee contributes to
|
||||
* contain a file documenting the changes Licensee made to create that Covered
|
||||
* Code and the date of any change. Licensee must include in that file the
|
||||
* documentation of any changes made by any predecessor Licensee. Licensee
|
||||
* must include a prominent statement that the modification is derived,
|
||||
* directly or indirectly, from Original Intel Code.
|
||||
*
|
||||
* 3.2. Redistribution of Source with no Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification without rights to further distribute source must
|
||||
* include the following Disclaimer and Export Compliance provision in the
|
||||
* documentation and/or other materials provided with distribution. In
|
||||
* addition, Licensee may not authorize further sublicense of source of any
|
||||
* portion of the Covered Code, and must include terms to the effect that the
|
||||
* license from Licensee to its licensee is limited to the intellectual
|
||||
* property embodied in the software Licensee provides to its licensee, and
|
||||
* not to intellectual property embodied in modifications its licensee may
|
||||
* make.
|
||||
*
|
||||
* 3.3. Redistribution of Executable. Redistribution in executable form of any
|
||||
* substantial portion of the Covered Code or modification must reproduce the
|
||||
* above Copyright Notice, and the following Disclaimer and Export Compliance
|
||||
* provision in the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3.4. Intel retains all right, title, and interest in and to the Original
|
||||
* Intel Code.
|
||||
*
|
||||
* 3.5. Neither the name Intel nor any other trademark owned or controlled by
|
||||
* Intel shall be used in advertising or otherwise to promote the sale, use or
|
||||
* other dealings in products derived from or relating to the Covered Code
|
||||
* without prior written authorization from Intel.
|
||||
*
|
||||
* 4. Disclaimer and Export Compliance
|
||||
*
|
||||
* 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
|
||||
* HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
|
||||
* IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
|
||||
* INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
|
||||
* UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
|
||||
* PARTICULAR PURPOSE.
|
||||
*
|
||||
* 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
|
||||
* OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
|
||||
* COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
|
||||
* SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
|
||||
* CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
|
||||
* HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
|
||||
* SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
|
||||
* LIMITED REMEDY.
|
||||
*
|
||||
* 4.3. Licensee shall not export, either directly or indirectly, any of this
|
||||
* software or system incorporating such software without first obtaining any
|
||||
* required license or other approval from the U. S. Department of Commerce or
|
||||
* any other agency or department of the United States Government. In the
|
||||
* event Licensee exports any such software from the United States or
|
||||
* re-exports any such software from a foreign destination, Licensee shall
|
||||
* ensure that the distribution and export/re-export of the software is in
|
||||
* compliance with all laws, regulations, orders, or other restrictions of the
|
||||
* U.S. Export Administration Regulations. Licensee agrees that neither it nor
|
||||
* any of its subsidiaries will export/re-export any technical data, process,
|
||||
* software, or service, directly or indirectly, to any country for which the
|
||||
* United States government or any agency thereof requires an export license,
|
||||
* other governmental approval, or letter of assurance, without first obtaining
|
||||
* such license, approval or letter.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef _ACDISPAT_H_
|
||||
#define _ACDISPAT_H_
|
||||
@@ -123,7 +50,7 @@
|
||||
|
||||
|
||||
/*
|
||||
* dsopcode - support for late evaluation
|
||||
* dsargs - execution of dynamic arguments for static objects
|
||||
*/
|
||||
ACPI_STATUS
|
||||
AcpiDsGetBufferFieldArguments (
|
||||
@@ -145,6 +72,24 @@ ACPI_STATUS
|
||||
AcpiDsGetPackageArguments (
|
||||
ACPI_OPERAND_OBJECT *ObjDesc);
|
||||
|
||||
|
||||
/*
|
||||
* dscontrol - support for execution control opcodes
|
||||
*/
|
||||
ACPI_STATUS
|
||||
AcpiDsExecBeginControlOp (
|
||||
ACPI_WALK_STATE *WalkState,
|
||||
ACPI_PARSE_OBJECT *Op);
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiDsExecEndControlOp (
|
||||
ACPI_WALK_STATE *WalkState,
|
||||
ACPI_PARSE_OBJECT *Op);
|
||||
|
||||
|
||||
/*
|
||||
* dsopcode - support for late operand evaluation
|
||||
*/
|
||||
ACPI_STATUS
|
||||
AcpiDsEvalBufferFieldOperands (
|
||||
ACPI_WALK_STATE *WalkState,
|
||||
@@ -176,20 +121,6 @@ AcpiDsInitializeRegion (
|
||||
ACPI_HANDLE ObjHandle);
|
||||
|
||||
|
||||
/*
|
||||
* dsctrl - Parser/Interpreter interface, control stack routines
|
||||
*/
|
||||
ACPI_STATUS
|
||||
AcpiDsExecBeginControlOp (
|
||||
ACPI_WALK_STATE *WalkState,
|
||||
ACPI_PARSE_OBJECT *Op);
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiDsExecEndControlOp (
|
||||
ACPI_WALK_STATE *WalkState,
|
||||
ACPI_PARSE_OBJECT *Op);
|
||||
|
||||
|
||||
/*
|
||||
* dsexec - Parser/Interpreter interface, method execution callbacks
|
||||
*/
|
||||
@@ -241,8 +172,15 @@ AcpiDsInitFieldObjects (
|
||||
|
||||
|
||||
/*
|
||||
* dsload - Parser/Interpreter interface, namespace load callbacks
|
||||
* dsload - Parser/Interpreter interface
|
||||
*/
|
||||
ACPI_STATUS
|
||||
AcpiDsInitCallbacks (
|
||||
ACPI_WALK_STATE *WalkState,
|
||||
UINT32 PassNumber);
|
||||
|
||||
/* dsload - pass 1 namespace load callbacks */
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiDsLoad1BeginOp (
|
||||
ACPI_WALK_STATE *WalkState,
|
||||
@@ -252,6 +190,9 @@ ACPI_STATUS
|
||||
AcpiDsLoad1EndOp (
|
||||
ACPI_WALK_STATE *WalkState);
|
||||
|
||||
|
||||
/* dsload - pass 2 namespace load callbacks */
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiDsLoad2BeginOp (
|
||||
ACPI_WALK_STATE *WalkState,
|
||||
@@ -261,11 +202,6 @@ ACPI_STATUS
|
||||
AcpiDsLoad2EndOp (
|
||||
ACPI_WALK_STATE *WalkState);
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiDsInitCallbacks (
|
||||
ACPI_WALK_STATE *WalkState,
|
||||
UINT32 PassNumber);
|
||||
|
||||
|
||||
/*
|
||||
* dsmthdat - method data (locals/args)
|
||||
@@ -321,8 +257,9 @@ AcpiDsMethodDataInit (
|
||||
* dsmethod - Parser/Interpreter interface - control method parsing
|
||||
*/
|
||||
ACPI_STATUS
|
||||
AcpiDsParseMethod (
|
||||
ACPI_NAMESPACE_NODE *Node);
|
||||
AcpiDsAutoSerializeMethod (
|
||||
ACPI_NAMESPACE_NODE *Node,
|
||||
ACPI_OPERAND_OBJECT *ObjDesc);
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiDsCallControlMethod (
|
||||
|
||||
@@ -4,114 +4,42 @@
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
* 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.
|
||||
*
|
||||
* 2.1. This is your license from Intel Corp. under its intellectual property
|
||||
* rights. You may have additional license terms from the party that provided
|
||||
* you this software, covering your right to use that party's intellectual
|
||||
* property rights.
|
||||
* 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.
|
||||
*
|
||||
* 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
|
||||
* copy of the source code appearing in this file ("Covered Code") an
|
||||
* irrevocable, perpetual, worldwide license under Intel's copyrights in the
|
||||
* base code distributed originally by Intel ("Original Intel Code") to copy,
|
||||
* make derivatives, distribute, use and display any portion of the Covered
|
||||
* Code in any form, with the right to sublicense such rights; and
|
||||
*
|
||||
* 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
|
||||
* license (with the right to sublicense), under only those claims of Intel
|
||||
* patents that are infringed by the Original Intel Code, to make, use, sell,
|
||||
* offer to sell, and import the Covered Code and derivative works thereof
|
||||
* solely to the minimum extent necessary to exercise the above copyright
|
||||
* license, and in no event shall the patent license extend to any additions
|
||||
* to or modifications of the Original Intel Code. No other license or right
|
||||
* is granted directly or by implication, estoppel or otherwise;
|
||||
*
|
||||
* The above copyright and patent license is granted only if the following
|
||||
* conditions are met:
|
||||
*
|
||||
* 3. Conditions
|
||||
*
|
||||
* 3.1. Redistribution of Source with Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification with rights to further distribute source must include
|
||||
* the above Copyright Notice, the above License, this list of Conditions,
|
||||
* and the following Disclaimer and Export Compliance provision. In addition,
|
||||
* Licensee must cause all Covered Code to which Licensee contributes to
|
||||
* contain a file documenting the changes Licensee made to create that Covered
|
||||
* Code and the date of any change. Licensee must include in that file the
|
||||
* documentation of any changes made by any predecessor Licensee. Licensee
|
||||
* must include a prominent statement that the modification is derived,
|
||||
* directly or indirectly, from Original Intel Code.
|
||||
*
|
||||
* 3.2. Redistribution of Source with no Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification without rights to further distribute source must
|
||||
* include the following Disclaimer and Export Compliance provision in the
|
||||
* documentation and/or other materials provided with distribution. In
|
||||
* addition, Licensee may not authorize further sublicense of source of any
|
||||
* portion of the Covered Code, and must include terms to the effect that the
|
||||
* license from Licensee to its licensee is limited to the intellectual
|
||||
* property embodied in the software Licensee provides to its licensee, and
|
||||
* not to intellectual property embodied in modifications its licensee may
|
||||
* make.
|
||||
*
|
||||
* 3.3. Redistribution of Executable. Redistribution in executable form of any
|
||||
* substantial portion of the Covered Code or modification must reproduce the
|
||||
* above Copyright Notice, and the following Disclaimer and Export Compliance
|
||||
* provision in the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3.4. Intel retains all right, title, and interest in and to the Original
|
||||
* Intel Code.
|
||||
*
|
||||
* 3.5. Neither the name Intel nor any other trademark owned or controlled by
|
||||
* Intel shall be used in advertising or otherwise to promote the sale, use or
|
||||
* other dealings in products derived from or relating to the Covered Code
|
||||
* without prior written authorization from Intel.
|
||||
*
|
||||
* 4. Disclaimer and Export Compliance
|
||||
*
|
||||
* 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
|
||||
* HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
|
||||
* IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
|
||||
* INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
|
||||
* UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
|
||||
* PARTICULAR PURPOSE.
|
||||
*
|
||||
* 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
|
||||
* OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
|
||||
* COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
|
||||
* SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
|
||||
* CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
|
||||
* HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
|
||||
* SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
|
||||
* LIMITED REMEDY.
|
||||
*
|
||||
* 4.3. Licensee shall not export, either directly or indirectly, any of this
|
||||
* software or system incorporating such software without first obtaining any
|
||||
* required license or other approval from the U. S. Department of Commerce or
|
||||
* any other agency or department of the United States Government. In the
|
||||
* event Licensee exports any such software from the United States or
|
||||
* re-exports any such software from a foreign destination, Licensee shall
|
||||
* ensure that the distribution and export/re-export of the software is in
|
||||
* compliance with all laws, regulations, orders, or other restrictions of the
|
||||
* U.S. Export Administration Regulations. Licensee agrees that neither it nor
|
||||
* any of its subsidiaries will export/re-export any technical data, process,
|
||||
* software, or service, directly or indirectly, to any country for which the
|
||||
* United States government or any agency thereof requires an export license,
|
||||
* other governmental approval, or letter of assurance, without first obtaining
|
||||
* such license, approval or letter.
|
||||
*
|
||||
*****************************************************************************/
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef __ACEVENTS_H__
|
||||
#define __ACEVENTS_H__
|
||||
@@ -128,10 +56,6 @@ ACPI_STATUS
|
||||
AcpiEvInstallXruptHandlers (
|
||||
void);
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiEvInstallFadtGpes (
|
||||
void);
|
||||
|
||||
UINT32
|
||||
AcpiEvFixedEventDetect (
|
||||
void);
|
||||
@@ -144,18 +68,6 @@ BOOLEAN
|
||||
AcpiEvIsNotifyObject (
|
||||
ACPI_NAMESPACE_NODE *Node);
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiEvAcquireGlobalLock(
|
||||
UINT16 Timeout);
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiEvReleaseGlobalLock(
|
||||
void);
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiEvInitGlobalLockHandler (
|
||||
void);
|
||||
|
||||
UINT32
|
||||
AcpiEvGetGpeNumberIndex (
|
||||
UINT32 GpeNumber);
|
||||
@@ -166,6 +78,28 @@ AcpiEvQueueNotifyRequest (
|
||||
UINT32 NotifyValue);
|
||||
|
||||
|
||||
/*
|
||||
* evglock - Global Lock support
|
||||
*/
|
||||
ACPI_STATUS
|
||||
AcpiEvInitGlobalLockHandler (
|
||||
void);
|
||||
|
||||
ACPI_HW_DEPENDENT_RETURN_OK (
|
||||
ACPI_STATUS
|
||||
AcpiEvAcquireGlobalLock(
|
||||
UINT16 Timeout))
|
||||
|
||||
ACPI_HW_DEPENDENT_RETURN_OK (
|
||||
ACPI_STATUS
|
||||
AcpiEvReleaseGlobalLock(
|
||||
void))
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiEvRemoveGlobalLockHandler (
|
||||
void);
|
||||
|
||||
|
||||
/*
|
||||
* evgpe - Low-level GPE support
|
||||
*/
|
||||
@@ -181,6 +115,14 @@ ACPI_STATUS
|
||||
AcpiEvEnableGpe (
|
||||
ACPI_GPE_EVENT_INFO *GpeEventInfo);
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiEvAddGpeReference (
|
||||
ACPI_GPE_EVENT_INFO *GpeEventInfo);
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiEvRemoveGpeReference (
|
||||
ACPI_GPE_EVENT_INFO *GpeEventInfo);
|
||||
|
||||
ACPI_GPE_EVENT_INFO *
|
||||
AcpiEvGetGpeEventInfo (
|
||||
ACPI_HANDLE GpeDevice,
|
||||
@@ -191,6 +133,10 @@ AcpiEvLowGetGpeInfo (
|
||||
UINT32 GpeNumber,
|
||||
ACPI_GPE_BLOCK_INFO *GpeBlock);
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiEvFinishGpe (
|
||||
ACPI_GPE_EVENT_INFO *GpeEventInfo);
|
||||
|
||||
|
||||
/*
|
||||
* evgpeblk - Upper-level GPE block support
|
||||
@@ -198,26 +144,31 @@ AcpiEvLowGetGpeInfo (
|
||||
ACPI_STATUS
|
||||
AcpiEvCreateGpeBlock (
|
||||
ACPI_NAMESPACE_NODE *GpeDevice,
|
||||
ACPI_GENERIC_ADDRESS *GpeBlockAddress,
|
||||
UINT64 Address,
|
||||
UINT8 SpaceId,
|
||||
UINT32 RegisterCount,
|
||||
UINT8 GpeBlockBaseNumber,
|
||||
UINT16 GpeBlockBaseNumber,
|
||||
UINT32 InterruptNumber,
|
||||
ACPI_GPE_BLOCK_INFO **ReturnGpeBlock);
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiEvInitializeGpeBlock (
|
||||
ACPI_NAMESPACE_NODE *GpeDevice,
|
||||
ACPI_GPE_BLOCK_INFO *GpeBlock);
|
||||
ACPI_GPE_XRUPT_INFO *GpeXruptInfo,
|
||||
ACPI_GPE_BLOCK_INFO *GpeBlock,
|
||||
void *Context);
|
||||
|
||||
ACPI_HW_DEPENDENT_RETURN_OK (
|
||||
ACPI_STATUS
|
||||
AcpiEvDeleteGpeBlock (
|
||||
ACPI_GPE_BLOCK_INFO *GpeBlock);
|
||||
ACPI_GPE_BLOCK_INFO *GpeBlock))
|
||||
|
||||
UINT32
|
||||
AcpiEvGpeDispatch (
|
||||
ACPI_NAMESPACE_NODE *GpeDevice,
|
||||
ACPI_GPE_EVENT_INFO *GpeEventInfo,
|
||||
UINT32 GpeNumber);
|
||||
|
||||
|
||||
/*
|
||||
* evgpeinit - GPE initialization and update
|
||||
*/
|
||||
@@ -225,9 +176,10 @@ ACPI_STATUS
|
||||
AcpiEvGpeInitialize (
|
||||
void);
|
||||
|
||||
ACPI_HW_DEPENDENT_RETURN_VOID (
|
||||
void
|
||||
AcpiEvUpdateGpes (
|
||||
ACPI_OWNER_ID TableOwnerId);
|
||||
ACPI_OWNER_ID TableOwnerId))
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiEvMatchGpeMethod (
|
||||
@@ -236,12 +188,6 @@ AcpiEvMatchGpeMethod (
|
||||
void *Context,
|
||||
void **ReturnValue);
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiEvMatchPrwAndGpe (
|
||||
ACPI_HANDLE ObjHandle,
|
||||
UINT32 Level,
|
||||
void *Context,
|
||||
void **ReturnValue);
|
||||
|
||||
/*
|
||||
* evgpeutil - GPE utilities
|
||||
@@ -255,9 +201,16 @@ BOOLEAN
|
||||
AcpiEvValidGpeEvent (
|
||||
ACPI_GPE_EVENT_INFO *GpeEventInfo);
|
||||
|
||||
ACPI_GPE_XRUPT_INFO *
|
||||
ACPI_STATUS
|
||||
AcpiEvGetGpeDevice (
|
||||
ACPI_GPE_XRUPT_INFO *GpeXruptInfo,
|
||||
ACPI_GPE_BLOCK_INFO *GpeBlock,
|
||||
void *Context);
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiEvGetGpeXruptBlock (
|
||||
UINT32 InterruptNumber);
|
||||
UINT32 InterruptNumber,
|
||||
ACPI_GPE_XRUPT_INFO **GpeXruptBlock);
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiEvDeleteGpeXrupt (
|
||||
@@ -271,19 +224,37 @@ AcpiEvDeleteGpeHandlers (
|
||||
|
||||
|
||||
/*
|
||||
* evregion - Address Space handling
|
||||
* evhandler - Address space handling
|
||||
*/
|
||||
BOOLEAN
|
||||
AcpiEvHasDefaultHandler (
|
||||
ACPI_NAMESPACE_NODE *Node,
|
||||
ACPI_ADR_SPACE_TYPE SpaceId);
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiEvInstallRegionHandlers (
|
||||
void);
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiEvInstallSpaceHandler (
|
||||
ACPI_NAMESPACE_NODE *Node,
|
||||
ACPI_ADR_SPACE_TYPE SpaceId,
|
||||
ACPI_ADR_SPACE_HANDLER Handler,
|
||||
ACPI_ADR_SPACE_SETUP Setup,
|
||||
void *Context);
|
||||
|
||||
|
||||
/*
|
||||
* evregion - Operation region support
|
||||
*/
|
||||
ACPI_STATUS
|
||||
AcpiEvInitializeOpRegions (
|
||||
void);
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiEvAddressSpaceDispatch (
|
||||
ACPI_OPERAND_OBJECT *RegionObj,
|
||||
ACPI_OPERAND_OBJECT *RegionObj,
|
||||
ACPI_OPERAND_OBJECT *FieldObj,
|
||||
UINT32 Function,
|
||||
UINT32 RegionOffset,
|
||||
UINT32 BitWidth,
|
||||
@@ -300,14 +271,6 @@ AcpiEvDetachRegion (
|
||||
ACPI_OPERAND_OBJECT *RegionObj,
|
||||
BOOLEAN AcpiNsIsLocked);
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiEvInstallSpaceHandler (
|
||||
ACPI_NAMESPACE_NODE *Node,
|
||||
ACPI_ADR_SPACE_TYPE SpaceId,
|
||||
ACPI_ADR_SPACE_HANDLER Handler,
|
||||
ACPI_ADR_SPACE_SETUP Setup,
|
||||
void *Context);
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiEvExecuteRegMethods (
|
||||
ACPI_NAMESPACE_NODE *Node,
|
||||
@@ -377,21 +340,21 @@ UINT32 ACPI_SYSTEM_XFACE
|
||||
AcpiEvGpeXruptHandler (
|
||||
void *Context);
|
||||
|
||||
UINT32
|
||||
AcpiEvSciDispatch (
|
||||
void);
|
||||
|
||||
UINT32
|
||||
AcpiEvInstallSciHandler (
|
||||
void);
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiEvRemoveSciHandler (
|
||||
AcpiEvRemoveAllSciHandlers (
|
||||
void);
|
||||
|
||||
UINT32
|
||||
AcpiEvInitializeSCI (
|
||||
UINT32 ProgramSCI);
|
||||
|
||||
ACPI_HW_DEPENDENT_RETURN_VOID (
|
||||
void
|
||||
AcpiEvTerminate (
|
||||
void);
|
||||
|
||||
void))
|
||||
|
||||
#endif /* __ACEVENTS_H__ */
|
||||
|
||||
@@ -4,182 +4,146 @@
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
* 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.
|
||||
*
|
||||
* 2.1. This is your license from Intel Corp. under its intellectual property
|
||||
* rights. You may have additional license terms from the party that provided
|
||||
* you this software, covering your right to use that party's intellectual
|
||||
* property rights.
|
||||
* 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.
|
||||
*
|
||||
* 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
|
||||
* copy of the source code appearing in this file ("Covered Code") an
|
||||
* irrevocable, perpetual, worldwide license under Intel's copyrights in the
|
||||
* base code distributed originally by Intel ("Original Intel Code") to copy,
|
||||
* make derivatives, distribute, use and display any portion of the Covered
|
||||
* Code in any form, with the right to sublicense such rights; and
|
||||
*
|
||||
* 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
|
||||
* license (with the right to sublicense), under only those claims of Intel
|
||||
* patents that are infringed by the Original Intel Code, to make, use, sell,
|
||||
* offer to sell, and import the Covered Code and derivative works thereof
|
||||
* solely to the minimum extent necessary to exercise the above copyright
|
||||
* license, and in no event shall the patent license extend to any additions
|
||||
* to or modifications of the Original Intel Code. No other license or right
|
||||
* is granted directly or by implication, estoppel or otherwise;
|
||||
*
|
||||
* The above copyright and patent license is granted only if the following
|
||||
* conditions are met:
|
||||
*
|
||||
* 3. Conditions
|
||||
*
|
||||
* 3.1. Redistribution of Source with Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification with rights to further distribute source must include
|
||||
* the above Copyright Notice, the above License, this list of Conditions,
|
||||
* and the following Disclaimer and Export Compliance provision. In addition,
|
||||
* Licensee must cause all Covered Code to which Licensee contributes to
|
||||
* contain a file documenting the changes Licensee made to create that Covered
|
||||
* Code and the date of any change. Licensee must include in that file the
|
||||
* documentation of any changes made by any predecessor Licensee. Licensee
|
||||
* must include a prominent statement that the modification is derived,
|
||||
* directly or indirectly, from Original Intel Code.
|
||||
*
|
||||
* 3.2. Redistribution of Source with no Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification without rights to further distribute source must
|
||||
* include the following Disclaimer and Export Compliance provision in the
|
||||
* documentation and/or other materials provided with distribution. In
|
||||
* addition, Licensee may not authorize further sublicense of source of any
|
||||
* portion of the Covered Code, and must include terms to the effect that the
|
||||
* license from Licensee to its licensee is limited to the intellectual
|
||||
* property embodied in the software Licensee provides to its licensee, and
|
||||
* not to intellectual property embodied in modifications its licensee may
|
||||
* make.
|
||||
*
|
||||
* 3.3. Redistribution of Executable. Redistribution in executable form of any
|
||||
* substantial portion of the Covered Code or modification must reproduce the
|
||||
* above Copyright Notice, and the following Disclaimer and Export Compliance
|
||||
* provision in the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3.4. Intel retains all right, title, and interest in and to the Original
|
||||
* Intel Code.
|
||||
*
|
||||
* 3.5. Neither the name Intel nor any other trademark owned or controlled by
|
||||
* Intel shall be used in advertising or otherwise to promote the sale, use or
|
||||
* other dealings in products derived from or relating to the Covered Code
|
||||
* without prior written authorization from Intel.
|
||||
*
|
||||
* 4. Disclaimer and Export Compliance
|
||||
*
|
||||
* 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
|
||||
* HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
|
||||
* IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
|
||||
* INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
|
||||
* UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
|
||||
* PARTICULAR PURPOSE.
|
||||
*
|
||||
* 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
|
||||
* OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
|
||||
* COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
|
||||
* SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
|
||||
* CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
|
||||
* HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
|
||||
* SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
|
||||
* LIMITED REMEDY.
|
||||
*
|
||||
* 4.3. Licensee shall not export, either directly or indirectly, any of this
|
||||
* software or system incorporating such software without first obtaining any
|
||||
* required license or other approval from the U. S. Department of Commerce or
|
||||
* any other agency or department of the United States Government. In the
|
||||
* event Licensee exports any such software from the United States or
|
||||
* re-exports any such software from a foreign destination, Licensee shall
|
||||
* ensure that the distribution and export/re-export of the software is in
|
||||
* compliance with all laws, regulations, orders, or other restrictions of the
|
||||
* U.S. Export Administration Regulations. Licensee agrees that neither it nor
|
||||
* any of its subsidiaries will export/re-export any technical data, process,
|
||||
* software, or service, directly or indirectly, to any country for which the
|
||||
* United States government or any agency thereof requires an export license,
|
||||
* other governmental approval, or letter of assurance, without first obtaining
|
||||
* such license, approval or letter.
|
||||
*
|
||||
*****************************************************************************/
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef __ACEXCEP_H__
|
||||
#define __ACEXCEP_H__
|
||||
|
||||
|
||||
/* This module contains all possible exception codes for ACPI_STATUS */
|
||||
|
||||
/*
|
||||
* Exceptions returned by external ACPI interfaces
|
||||
* Exception code classes
|
||||
*/
|
||||
#define AE_CODE_ENVIRONMENTAL 0x0000
|
||||
#define AE_CODE_PROGRAMMER 0x1000
|
||||
#define AE_CODE_ACPI_TABLES 0x2000
|
||||
#define AE_CODE_AML 0x3000
|
||||
#define AE_CODE_CONTROL 0x4000
|
||||
#define AE_CODE_ENVIRONMENTAL 0x0000 /* General ACPICA environment */
|
||||
#define AE_CODE_PROGRAMMER 0x1000 /* External ACPICA interface caller */
|
||||
#define AE_CODE_ACPI_TABLES 0x2000 /* ACPI tables */
|
||||
#define AE_CODE_AML 0x3000 /* From executing AML code */
|
||||
#define AE_CODE_CONTROL 0x4000 /* Internal control codes */
|
||||
|
||||
#define AE_CODE_MAX 0x4000
|
||||
#define AE_CODE_MASK 0xF000
|
||||
|
||||
/*
|
||||
* Macros to insert the exception code classes
|
||||
*/
|
||||
#define EXCEP_ENV(code) ((ACPI_STATUS) (code | AE_CODE_ENVIRONMENTAL))
|
||||
#define EXCEP_PGM(code) ((ACPI_STATUS) (code | AE_CODE_PROGRAMMER))
|
||||
#define EXCEP_TBL(code) ((ACPI_STATUS) (code | AE_CODE_ACPI_TABLES))
|
||||
#define EXCEP_AML(code) ((ACPI_STATUS) (code | AE_CODE_AML))
|
||||
#define EXCEP_CTL(code) ((ACPI_STATUS) (code | AE_CODE_CONTROL))
|
||||
|
||||
/*
|
||||
* Exception info table. The "Description" field is used only by the
|
||||
* ACPICA help application (acpihelp).
|
||||
*/
|
||||
typedef struct acpi_exception_info
|
||||
{
|
||||
char *Name;
|
||||
|
||||
#ifdef ACPI_HELP_APP
|
||||
char *Description;
|
||||
#endif
|
||||
} ACPI_EXCEPTION_INFO;
|
||||
|
||||
#ifdef ACPI_HELP_APP
|
||||
#define EXCEP_TXT(Name,Description) {Name, Description}
|
||||
#else
|
||||
#define EXCEP_TXT(Name,Description) {Name}
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Success is always zero, failure is non-zero
|
||||
*/
|
||||
#define ACPI_SUCCESS(a) (!(a))
|
||||
#define ACPI_FAILURE(a) (a)
|
||||
|
||||
|
||||
#define AE_OK (ACPI_STATUS) 0x0000
|
||||
|
||||
/*
|
||||
* Environmental exceptions
|
||||
*/
|
||||
#define AE_ERROR (ACPI_STATUS) (0x0001 | AE_CODE_ENVIRONMENTAL)
|
||||
#define AE_NO_ACPI_TABLES (ACPI_STATUS) (0x0002 | AE_CODE_ENVIRONMENTAL)
|
||||
#define AE_NO_NAMESPACE (ACPI_STATUS) (0x0003 | AE_CODE_ENVIRONMENTAL)
|
||||
#define AE_NO_MEMORY (ACPI_STATUS) (0x0004 | AE_CODE_ENVIRONMENTAL)
|
||||
#define AE_NOT_FOUND (ACPI_STATUS) (0x0005 | AE_CODE_ENVIRONMENTAL)
|
||||
#define AE_NOT_EXIST (ACPI_STATUS) (0x0006 | AE_CODE_ENVIRONMENTAL)
|
||||
#define AE_ALREADY_EXISTS (ACPI_STATUS) (0x0007 | AE_CODE_ENVIRONMENTAL)
|
||||
#define AE_TYPE (ACPI_STATUS) (0x0008 | AE_CODE_ENVIRONMENTAL)
|
||||
#define AE_NULL_OBJECT (ACPI_STATUS) (0x0009 | AE_CODE_ENVIRONMENTAL)
|
||||
#define AE_NULL_ENTRY (ACPI_STATUS) (0x000A | AE_CODE_ENVIRONMENTAL)
|
||||
#define AE_BUFFER_OVERFLOW (ACPI_STATUS) (0x000B | AE_CODE_ENVIRONMENTAL)
|
||||
#define AE_STACK_OVERFLOW (ACPI_STATUS) (0x000C | AE_CODE_ENVIRONMENTAL)
|
||||
#define AE_STACK_UNDERFLOW (ACPI_STATUS) (0x000D | AE_CODE_ENVIRONMENTAL)
|
||||
#define AE_NOT_IMPLEMENTED (ACPI_STATUS) (0x000E | AE_CODE_ENVIRONMENTAL)
|
||||
#define AE_SUPPORT (ACPI_STATUS) (0x000F | AE_CODE_ENVIRONMENTAL)
|
||||
#define AE_LIMIT (ACPI_STATUS) (0x0010 | AE_CODE_ENVIRONMENTAL)
|
||||
#define AE_TIME (ACPI_STATUS) (0x0011 | AE_CODE_ENVIRONMENTAL)
|
||||
#define AE_ACQUIRE_DEADLOCK (ACPI_STATUS) (0x0012 | AE_CODE_ENVIRONMENTAL)
|
||||
#define AE_RELEASE_DEADLOCK (ACPI_STATUS) (0x0013 | AE_CODE_ENVIRONMENTAL)
|
||||
#define AE_NOT_ACQUIRED (ACPI_STATUS) (0x0014 | AE_CODE_ENVIRONMENTAL)
|
||||
#define AE_ALREADY_ACQUIRED (ACPI_STATUS) (0x0015 | AE_CODE_ENVIRONMENTAL)
|
||||
#define AE_NO_HARDWARE_RESPONSE (ACPI_STATUS) (0x0016 | AE_CODE_ENVIRONMENTAL)
|
||||
#define AE_NO_GLOBAL_LOCK (ACPI_STATUS) (0x0017 | AE_CODE_ENVIRONMENTAL)
|
||||
#define AE_ABORT_METHOD (ACPI_STATUS) (0x0018 | AE_CODE_ENVIRONMENTAL)
|
||||
#define AE_SAME_HANDLER (ACPI_STATUS) (0x0019 | AE_CODE_ENVIRONMENTAL)
|
||||
#define AE_NO_HANDLER (ACPI_STATUS) (0x001A | AE_CODE_ENVIRONMENTAL)
|
||||
#define AE_OWNER_ID_LIMIT (ACPI_STATUS) (0x001B | AE_CODE_ENVIRONMENTAL)
|
||||
#define AE_ERROR EXCEP_ENV (0x0001)
|
||||
#define AE_NO_ACPI_TABLES EXCEP_ENV (0x0002)
|
||||
#define AE_NO_NAMESPACE EXCEP_ENV (0x0003)
|
||||
#define AE_NO_MEMORY EXCEP_ENV (0x0004)
|
||||
#define AE_NOT_FOUND EXCEP_ENV (0x0005)
|
||||
#define AE_NOT_EXIST EXCEP_ENV (0x0006)
|
||||
#define AE_ALREADY_EXISTS EXCEP_ENV (0x0007)
|
||||
#define AE_TYPE EXCEP_ENV (0x0008)
|
||||
#define AE_NULL_OBJECT EXCEP_ENV (0x0009)
|
||||
#define AE_NULL_ENTRY EXCEP_ENV (0x000A)
|
||||
#define AE_BUFFER_OVERFLOW EXCEP_ENV (0x000B)
|
||||
#define AE_STACK_OVERFLOW EXCEP_ENV (0x000C)
|
||||
#define AE_STACK_UNDERFLOW EXCEP_ENV (0x000D)
|
||||
#define AE_NOT_IMPLEMENTED EXCEP_ENV (0x000E)
|
||||
#define AE_SUPPORT EXCEP_ENV (0x000F)
|
||||
#define AE_LIMIT EXCEP_ENV (0x0010)
|
||||
#define AE_TIME EXCEP_ENV (0x0011)
|
||||
#define AE_ACQUIRE_DEADLOCK EXCEP_ENV (0x0012)
|
||||
#define AE_RELEASE_DEADLOCK EXCEP_ENV (0x0013)
|
||||
#define AE_NOT_ACQUIRED EXCEP_ENV (0x0014)
|
||||
#define AE_ALREADY_ACQUIRED EXCEP_ENV (0x0015)
|
||||
#define AE_NO_HARDWARE_RESPONSE EXCEP_ENV (0x0016)
|
||||
#define AE_NO_GLOBAL_LOCK EXCEP_ENV (0x0017)
|
||||
#define AE_ABORT_METHOD EXCEP_ENV (0x0018)
|
||||
#define AE_SAME_HANDLER EXCEP_ENV (0x0019)
|
||||
#define AE_NO_HANDLER EXCEP_ENV (0x001A)
|
||||
#define AE_OWNER_ID_LIMIT EXCEP_ENV (0x001B)
|
||||
#define AE_NOT_CONFIGURED EXCEP_ENV (0x001C)
|
||||
#define AE_ACCESS EXCEP_ENV (0x001D)
|
||||
|
||||
#define AE_CODE_ENV_MAX 0x001B
|
||||
#define AE_CODE_ENV_MAX 0x001D
|
||||
|
||||
|
||||
/*
|
||||
* Programmer exceptions
|
||||
*/
|
||||
#define AE_BAD_PARAMETER (ACPI_STATUS) (0x0001 | AE_CODE_PROGRAMMER)
|
||||
#define AE_BAD_CHARACTER (ACPI_STATUS) (0x0002 | AE_CODE_PROGRAMMER)
|
||||
#define AE_BAD_PATHNAME (ACPI_STATUS) (0x0003 | AE_CODE_PROGRAMMER)
|
||||
#define AE_BAD_DATA (ACPI_STATUS) (0x0004 | AE_CODE_PROGRAMMER)
|
||||
#define AE_BAD_HEX_CONSTANT (ACPI_STATUS) (0x0005 | AE_CODE_PROGRAMMER)
|
||||
#define AE_BAD_OCTAL_CONSTANT (ACPI_STATUS) (0x0006 | AE_CODE_PROGRAMMER)
|
||||
#define AE_BAD_DECIMAL_CONSTANT (ACPI_STATUS) (0x0007 | AE_CODE_PROGRAMMER)
|
||||
#define AE_MISSING_ARGUMENTS (ACPI_STATUS) (0x0008 | AE_CODE_PROGRAMMER)
|
||||
#define AE_BAD_ADDRESS (ACPI_STATUS) (0x0009 | AE_CODE_PROGRAMMER)
|
||||
#define AE_BAD_PARAMETER EXCEP_PGM (0x0001)
|
||||
#define AE_BAD_CHARACTER EXCEP_PGM (0x0002)
|
||||
#define AE_BAD_PATHNAME EXCEP_PGM (0x0003)
|
||||
#define AE_BAD_DATA EXCEP_PGM (0x0004)
|
||||
#define AE_BAD_HEX_CONSTANT EXCEP_PGM (0x0005)
|
||||
#define AE_BAD_OCTAL_CONSTANT EXCEP_PGM (0x0006)
|
||||
#define AE_BAD_DECIMAL_CONSTANT EXCEP_PGM (0x0007)
|
||||
#define AE_MISSING_ARGUMENTS EXCEP_PGM (0x0008)
|
||||
#define AE_BAD_ADDRESS EXCEP_PGM (0x0009)
|
||||
|
||||
#define AE_CODE_PGM_MAX 0x0009
|
||||
|
||||
@@ -187,52 +151,52 @@
|
||||
/*
|
||||
* Acpi table exceptions
|
||||
*/
|
||||
#define AE_BAD_SIGNATURE (ACPI_STATUS) (0x0001 | AE_CODE_ACPI_TABLES)
|
||||
#define AE_BAD_HEADER (ACPI_STATUS) (0x0002 | AE_CODE_ACPI_TABLES)
|
||||
#define AE_BAD_CHECKSUM (ACPI_STATUS) (0x0003 | AE_CODE_ACPI_TABLES)
|
||||
#define AE_BAD_VALUE (ACPI_STATUS) (0x0004 | AE_CODE_ACPI_TABLES)
|
||||
#define AE_INVALID_TABLE_LENGTH (ACPI_STATUS) (0x0005 | AE_CODE_ACPI_TABLES)
|
||||
#define AE_BAD_SIGNATURE EXCEP_TBL (0x0001)
|
||||
#define AE_BAD_HEADER EXCEP_TBL (0x0002)
|
||||
#define AE_BAD_CHECKSUM EXCEP_TBL (0x0003)
|
||||
#define AE_BAD_VALUE EXCEP_TBL (0x0004)
|
||||
#define AE_INVALID_TABLE_LENGTH EXCEP_TBL (0x0005)
|
||||
|
||||
#define AE_CODE_TBL_MAX 0x0005
|
||||
|
||||
|
||||
/*
|
||||
* AML exceptions. These are caused by problems with
|
||||
* AML exceptions. These are caused by problems with
|
||||
* the actual AML byte stream
|
||||
*/
|
||||
#define AE_AML_BAD_OPCODE (ACPI_STATUS) (0x0001 | AE_CODE_AML)
|
||||
#define AE_AML_NO_OPERAND (ACPI_STATUS) (0x0002 | AE_CODE_AML)
|
||||
#define AE_AML_OPERAND_TYPE (ACPI_STATUS) (0x0003 | AE_CODE_AML)
|
||||
#define AE_AML_OPERAND_VALUE (ACPI_STATUS) (0x0004 | AE_CODE_AML)
|
||||
#define AE_AML_UNINITIALIZED_LOCAL (ACPI_STATUS) (0x0005 | AE_CODE_AML)
|
||||
#define AE_AML_UNINITIALIZED_ARG (ACPI_STATUS) (0x0006 | AE_CODE_AML)
|
||||
#define AE_AML_UNINITIALIZED_ELEMENT (ACPI_STATUS) (0x0007 | AE_CODE_AML)
|
||||
#define AE_AML_NUMERIC_OVERFLOW (ACPI_STATUS) (0x0008 | AE_CODE_AML)
|
||||
#define AE_AML_REGION_LIMIT (ACPI_STATUS) (0x0009 | AE_CODE_AML)
|
||||
#define AE_AML_BUFFER_LIMIT (ACPI_STATUS) (0x000A | AE_CODE_AML)
|
||||
#define AE_AML_PACKAGE_LIMIT (ACPI_STATUS) (0x000B | AE_CODE_AML)
|
||||
#define AE_AML_DIVIDE_BY_ZERO (ACPI_STATUS) (0x000C | AE_CODE_AML)
|
||||
#define AE_AML_BAD_NAME (ACPI_STATUS) (0x000D | AE_CODE_AML)
|
||||
#define AE_AML_NAME_NOT_FOUND (ACPI_STATUS) (0x000E | AE_CODE_AML)
|
||||
#define AE_AML_INTERNAL (ACPI_STATUS) (0x000F | AE_CODE_AML)
|
||||
#define AE_AML_INVALID_SPACE_ID (ACPI_STATUS) (0x0010 | AE_CODE_AML)
|
||||
#define AE_AML_STRING_LIMIT (ACPI_STATUS) (0x0011 | AE_CODE_AML)
|
||||
#define AE_AML_NO_RETURN_VALUE (ACPI_STATUS) (0x0012 | AE_CODE_AML)
|
||||
#define AE_AML_METHOD_LIMIT (ACPI_STATUS) (0x0013 | AE_CODE_AML)
|
||||
#define AE_AML_NOT_OWNER (ACPI_STATUS) (0x0014 | AE_CODE_AML)
|
||||
#define AE_AML_MUTEX_ORDER (ACPI_STATUS) (0x0015 | AE_CODE_AML)
|
||||
#define AE_AML_MUTEX_NOT_ACQUIRED (ACPI_STATUS) (0x0016 | AE_CODE_AML)
|
||||
#define AE_AML_INVALID_RESOURCE_TYPE (ACPI_STATUS) (0x0017 | AE_CODE_AML)
|
||||
#define AE_AML_INVALID_INDEX (ACPI_STATUS) (0x0018 | AE_CODE_AML)
|
||||
#define AE_AML_REGISTER_LIMIT (ACPI_STATUS) (0x0019 | AE_CODE_AML)
|
||||
#define AE_AML_NO_WHILE (ACPI_STATUS) (0x001A | AE_CODE_AML)
|
||||
#define AE_AML_ALIGNMENT (ACPI_STATUS) (0x001B | AE_CODE_AML)
|
||||
#define AE_AML_NO_RESOURCE_END_TAG (ACPI_STATUS) (0x001C | AE_CODE_AML)
|
||||
#define AE_AML_BAD_RESOURCE_VALUE (ACPI_STATUS) (0x001D | AE_CODE_AML)
|
||||
#define AE_AML_CIRCULAR_REFERENCE (ACPI_STATUS) (0x001E | AE_CODE_AML)
|
||||
#define AE_AML_BAD_RESOURCE_LENGTH (ACPI_STATUS) (0x001F | AE_CODE_AML)
|
||||
#define AE_AML_ILLEGAL_ADDRESS (ACPI_STATUS) (0x0020 | AE_CODE_AML)
|
||||
#define AE_AML_INFINITE_LOOP (ACPI_STATUS) (0x0021 | AE_CODE_AML)
|
||||
#define AE_AML_BAD_OPCODE EXCEP_AML (0x0001)
|
||||
#define AE_AML_NO_OPERAND EXCEP_AML (0x0002)
|
||||
#define AE_AML_OPERAND_TYPE EXCEP_AML (0x0003)
|
||||
#define AE_AML_OPERAND_VALUE EXCEP_AML (0x0004)
|
||||
#define AE_AML_UNINITIALIZED_LOCAL EXCEP_AML (0x0005)
|
||||
#define AE_AML_UNINITIALIZED_ARG EXCEP_AML (0x0006)
|
||||
#define AE_AML_UNINITIALIZED_ELEMENT EXCEP_AML (0x0007)
|
||||
#define AE_AML_NUMERIC_OVERFLOW EXCEP_AML (0x0008)
|
||||
#define AE_AML_REGION_LIMIT EXCEP_AML (0x0009)
|
||||
#define AE_AML_BUFFER_LIMIT EXCEP_AML (0x000A)
|
||||
#define AE_AML_PACKAGE_LIMIT EXCEP_AML (0x000B)
|
||||
#define AE_AML_DIVIDE_BY_ZERO EXCEP_AML (0x000C)
|
||||
#define AE_AML_BAD_NAME EXCEP_AML (0x000D)
|
||||
#define AE_AML_NAME_NOT_FOUND EXCEP_AML (0x000E)
|
||||
#define AE_AML_INTERNAL EXCEP_AML (0x000F)
|
||||
#define AE_AML_INVALID_SPACE_ID EXCEP_AML (0x0010)
|
||||
#define AE_AML_STRING_LIMIT EXCEP_AML (0x0011)
|
||||
#define AE_AML_NO_RETURN_VALUE EXCEP_AML (0x0012)
|
||||
#define AE_AML_METHOD_LIMIT EXCEP_AML (0x0013)
|
||||
#define AE_AML_NOT_OWNER EXCEP_AML (0x0014)
|
||||
#define AE_AML_MUTEX_ORDER EXCEP_AML (0x0015)
|
||||
#define AE_AML_MUTEX_NOT_ACQUIRED EXCEP_AML (0x0016)
|
||||
#define AE_AML_INVALID_RESOURCE_TYPE EXCEP_AML (0x0017)
|
||||
#define AE_AML_INVALID_INDEX EXCEP_AML (0x0018)
|
||||
#define AE_AML_REGISTER_LIMIT EXCEP_AML (0x0019)
|
||||
#define AE_AML_NO_WHILE EXCEP_AML (0x001A)
|
||||
#define AE_AML_ALIGNMENT EXCEP_AML (0x001B)
|
||||
#define AE_AML_NO_RESOURCE_END_TAG EXCEP_AML (0x001C)
|
||||
#define AE_AML_BAD_RESOURCE_VALUE EXCEP_AML (0x001D)
|
||||
#define AE_AML_CIRCULAR_REFERENCE EXCEP_AML (0x001E)
|
||||
#define AE_AML_BAD_RESOURCE_LENGTH EXCEP_AML (0x001F)
|
||||
#define AE_AML_ILLEGAL_ADDRESS EXCEP_AML (0x0020)
|
||||
#define AE_AML_INFINITE_LOOP EXCEP_AML (0x0021)
|
||||
|
||||
#define AE_CODE_AML_MAX 0x0021
|
||||
|
||||
@@ -240,143 +204,145 @@
|
||||
/*
|
||||
* Internal exceptions used for control
|
||||
*/
|
||||
#define AE_CTRL_RETURN_VALUE (ACPI_STATUS) (0x0001 | AE_CODE_CONTROL)
|
||||
#define AE_CTRL_PENDING (ACPI_STATUS) (0x0002 | AE_CODE_CONTROL)
|
||||
#define AE_CTRL_TERMINATE (ACPI_STATUS) (0x0003 | AE_CODE_CONTROL)
|
||||
#define AE_CTRL_TRUE (ACPI_STATUS) (0x0004 | AE_CODE_CONTROL)
|
||||
#define AE_CTRL_FALSE (ACPI_STATUS) (0x0005 | AE_CODE_CONTROL)
|
||||
#define AE_CTRL_DEPTH (ACPI_STATUS) (0x0006 | AE_CODE_CONTROL)
|
||||
#define AE_CTRL_END (ACPI_STATUS) (0x0007 | AE_CODE_CONTROL)
|
||||
#define AE_CTRL_TRANSFER (ACPI_STATUS) (0x0008 | AE_CODE_CONTROL)
|
||||
#define AE_CTRL_BREAK (ACPI_STATUS) (0x0009 | AE_CODE_CONTROL)
|
||||
#define AE_CTRL_CONTINUE (ACPI_STATUS) (0x000A | AE_CODE_CONTROL)
|
||||
#define AE_CTRL_SKIP (ACPI_STATUS) (0x000B | AE_CODE_CONTROL)
|
||||
#define AE_CTRL_PARSE_CONTINUE (ACPI_STATUS) (0x000C | AE_CODE_CONTROL)
|
||||
#define AE_CTRL_PARSE_PENDING (ACPI_STATUS) (0x000D | AE_CODE_CONTROL)
|
||||
#define AE_CTRL_RETURN_VALUE EXCEP_CTL (0x0001)
|
||||
#define AE_CTRL_PENDING EXCEP_CTL (0x0002)
|
||||
#define AE_CTRL_TERMINATE EXCEP_CTL (0x0003)
|
||||
#define AE_CTRL_TRUE EXCEP_CTL (0x0004)
|
||||
#define AE_CTRL_FALSE EXCEP_CTL (0x0005)
|
||||
#define AE_CTRL_DEPTH EXCEP_CTL (0x0006)
|
||||
#define AE_CTRL_END EXCEP_CTL (0x0007)
|
||||
#define AE_CTRL_TRANSFER EXCEP_CTL (0x0008)
|
||||
#define AE_CTRL_BREAK EXCEP_CTL (0x0009)
|
||||
#define AE_CTRL_CONTINUE EXCEP_CTL (0x000A)
|
||||
#define AE_CTRL_SKIP EXCEP_CTL (0x000B)
|
||||
#define AE_CTRL_PARSE_CONTINUE EXCEP_CTL (0x000C)
|
||||
#define AE_CTRL_PARSE_PENDING EXCEP_CTL (0x000D)
|
||||
|
||||
#define AE_CODE_CTRL_MAX 0x000D
|
||||
|
||||
|
||||
/* Exception strings for AcpiFormatException */
|
||||
|
||||
#ifdef DEFINE_ACPI_GLOBALS
|
||||
#ifdef ACPI_DEFINE_EXCEPTION_TABLE
|
||||
|
||||
/*
|
||||
* String versions of the exception codes above
|
||||
* These strings must match the corresponding defines exactly
|
||||
*/
|
||||
char const *AcpiGbl_ExceptionNames_Env[] =
|
||||
static const ACPI_EXCEPTION_INFO AcpiGbl_ExceptionNames_Env[] =
|
||||
{
|
||||
"AE_OK",
|
||||
"AE_ERROR",
|
||||
"AE_NO_ACPI_TABLES",
|
||||
"AE_NO_NAMESPACE",
|
||||
"AE_NO_MEMORY",
|
||||
"AE_NOT_FOUND",
|
||||
"AE_NOT_EXIST",
|
||||
"AE_ALREADY_EXISTS",
|
||||
"AE_TYPE",
|
||||
"AE_NULL_OBJECT",
|
||||
"AE_NULL_ENTRY",
|
||||
"AE_BUFFER_OVERFLOW",
|
||||
"AE_STACK_OVERFLOW",
|
||||
"AE_STACK_UNDERFLOW",
|
||||
"AE_NOT_IMPLEMENTED",
|
||||
"AE_SUPPORT",
|
||||
"AE_LIMIT",
|
||||
"AE_TIME",
|
||||
"AE_ACQUIRE_DEADLOCK",
|
||||
"AE_RELEASE_DEADLOCK",
|
||||
"AE_NOT_ACQUIRED",
|
||||
"AE_ALREADY_ACQUIRED",
|
||||
"AE_NO_HARDWARE_RESPONSE",
|
||||
"AE_NO_GLOBAL_LOCK",
|
||||
"AE_ABORT_METHOD",
|
||||
"AE_SAME_HANDLER",
|
||||
"AE_NO_HANDLER",
|
||||
"AE_OWNER_ID_LIMIT"
|
||||
EXCEP_TXT ("AE_OK", "No error"),
|
||||
EXCEP_TXT ("AE_ERROR", "Unspecified error"),
|
||||
EXCEP_TXT ("AE_NO_ACPI_TABLES", "ACPI tables could not be found"),
|
||||
EXCEP_TXT ("AE_NO_NAMESPACE", "A namespace has not been loaded"),
|
||||
EXCEP_TXT ("AE_NO_MEMORY", "Insufficient dynamic memory"),
|
||||
EXCEP_TXT ("AE_NOT_FOUND", "A requested entity is not found"),
|
||||
EXCEP_TXT ("AE_NOT_EXIST", "A required entity does not exist"),
|
||||
EXCEP_TXT ("AE_ALREADY_EXISTS", "An entity already exists"),
|
||||
EXCEP_TXT ("AE_TYPE", "The object type is incorrect"),
|
||||
EXCEP_TXT ("AE_NULL_OBJECT", "A required object was missing"),
|
||||
EXCEP_TXT ("AE_NULL_ENTRY", "The requested object does not exist"),
|
||||
EXCEP_TXT ("AE_BUFFER_OVERFLOW", "The buffer provided is too small"),
|
||||
EXCEP_TXT ("AE_STACK_OVERFLOW", "An internal stack overflowed"),
|
||||
EXCEP_TXT ("AE_STACK_UNDERFLOW", "An internal stack underflowed"),
|
||||
EXCEP_TXT ("AE_NOT_IMPLEMENTED", "The feature is not implemented"),
|
||||
EXCEP_TXT ("AE_SUPPORT", "The feature is not supported"),
|
||||
EXCEP_TXT ("AE_LIMIT", "A predefined limit was exceeded"),
|
||||
EXCEP_TXT ("AE_TIME", "A time limit or timeout expired"),
|
||||
EXCEP_TXT ("AE_ACQUIRE_DEADLOCK", "Internal error, attempt was made to acquire a mutex in improper order"),
|
||||
EXCEP_TXT ("AE_RELEASE_DEADLOCK", "Internal error, attempt was made to release a mutex in improper order"),
|
||||
EXCEP_TXT ("AE_NOT_ACQUIRED", "An attempt to release a mutex or Global Lock without a previous acquire"),
|
||||
EXCEP_TXT ("AE_ALREADY_ACQUIRED", "Internal error, attempt was made to acquire a mutex twice"),
|
||||
EXCEP_TXT ("AE_NO_HARDWARE_RESPONSE", "Hardware did not respond after an I/O operation"),
|
||||
EXCEP_TXT ("AE_NO_GLOBAL_LOCK", "There is no FACS Global Lock"),
|
||||
EXCEP_TXT ("AE_ABORT_METHOD", "A control method was aborted"),
|
||||
EXCEP_TXT ("AE_SAME_HANDLER", "Attempt was made to install the same handler that is already installed"),
|
||||
EXCEP_TXT ("AE_NO_HANDLER", "A handler for the operation is not installed"),
|
||||
EXCEP_TXT ("AE_OWNER_ID_LIMIT", "There are no more Owner IDs available for ACPI tables or control methods"),
|
||||
EXCEP_TXT ("AE_NOT_CONFIGURED", "The interface is not part of the current subsystem configuration"),
|
||||
EXCEP_TXT ("AE_ACCESS", "Permission denied for the requested operation")
|
||||
};
|
||||
|
||||
char const *AcpiGbl_ExceptionNames_Pgm[] =
|
||||
static const ACPI_EXCEPTION_INFO AcpiGbl_ExceptionNames_Pgm[] =
|
||||
{
|
||||
NULL,
|
||||
"AE_BAD_PARAMETER",
|
||||
"AE_BAD_CHARACTER",
|
||||
"AE_BAD_PATHNAME",
|
||||
"AE_BAD_DATA",
|
||||
"AE_BAD_HEX_CONSTANT",
|
||||
"AE_BAD_OCTAL_CONSTANT",
|
||||
"AE_BAD_DECIMAL_CONSTANT",
|
||||
"AE_MISSING_ARGUMENTS",
|
||||
"AE_BAD_ADDRESS"
|
||||
EXCEP_TXT (NULL, NULL),
|
||||
EXCEP_TXT ("AE_BAD_PARAMETER", "A parameter is out of range or invalid"),
|
||||
EXCEP_TXT ("AE_BAD_CHARACTER", "An invalid character was found in a name"),
|
||||
EXCEP_TXT ("AE_BAD_PATHNAME", "An invalid character was found in a pathname"),
|
||||
EXCEP_TXT ("AE_BAD_DATA", "A package or buffer contained incorrect data"),
|
||||
EXCEP_TXT ("AE_BAD_HEX_CONSTANT", "Invalid character in a Hex constant"),
|
||||
EXCEP_TXT ("AE_BAD_OCTAL_CONSTANT", "Invalid character in an Octal constant"),
|
||||
EXCEP_TXT ("AE_BAD_DECIMAL_CONSTANT", "Invalid character in a Decimal constant"),
|
||||
EXCEP_TXT ("AE_MISSING_ARGUMENTS", "Too few arguments were passed to a control method"),
|
||||
EXCEP_TXT ("AE_BAD_ADDRESS", "An illegal null I/O address")
|
||||
};
|
||||
|
||||
char const *AcpiGbl_ExceptionNames_Tbl[] =
|
||||
static const ACPI_EXCEPTION_INFO AcpiGbl_ExceptionNames_Tbl[] =
|
||||
{
|
||||
NULL,
|
||||
"AE_BAD_SIGNATURE",
|
||||
"AE_BAD_HEADER",
|
||||
"AE_BAD_CHECKSUM",
|
||||
"AE_BAD_VALUE",
|
||||
"AE_INVALID_TABLE_LENGTH"
|
||||
EXCEP_TXT (NULL, NULL),
|
||||
EXCEP_TXT ("AE_BAD_SIGNATURE", "An ACPI table has an invalid signature"),
|
||||
EXCEP_TXT ("AE_BAD_HEADER", "Invalid field in an ACPI table header"),
|
||||
EXCEP_TXT ("AE_BAD_CHECKSUM", "An ACPI table checksum is not correct"),
|
||||
EXCEP_TXT ("AE_BAD_VALUE", "An invalid value was found in a table"),
|
||||
EXCEP_TXT ("AE_INVALID_TABLE_LENGTH", "The FADT or FACS has improper length")
|
||||
};
|
||||
|
||||
char const *AcpiGbl_ExceptionNames_Aml[] =
|
||||
static const ACPI_EXCEPTION_INFO AcpiGbl_ExceptionNames_Aml[] =
|
||||
{
|
||||
NULL,
|
||||
"AE_AML_BAD_OPCODE",
|
||||
"AE_AML_NO_OPERAND",
|
||||
"AE_AML_OPERAND_TYPE",
|
||||
"AE_AML_OPERAND_VALUE",
|
||||
"AE_AML_UNINITIALIZED_LOCAL",
|
||||
"AE_AML_UNINITIALIZED_ARG",
|
||||
"AE_AML_UNINITIALIZED_ELEMENT",
|
||||
"AE_AML_NUMERIC_OVERFLOW",
|
||||
"AE_AML_REGION_LIMIT",
|
||||
"AE_AML_BUFFER_LIMIT",
|
||||
"AE_AML_PACKAGE_LIMIT",
|
||||
"AE_AML_DIVIDE_BY_ZERO",
|
||||
"AE_AML_BAD_NAME",
|
||||
"AE_AML_NAME_NOT_FOUND",
|
||||
"AE_AML_INTERNAL",
|
||||
"AE_AML_INVALID_SPACE_ID",
|
||||
"AE_AML_STRING_LIMIT",
|
||||
"AE_AML_NO_RETURN_VALUE",
|
||||
"AE_AML_METHOD_LIMIT",
|
||||
"AE_AML_NOT_OWNER",
|
||||
"AE_AML_MUTEX_ORDER",
|
||||
"AE_AML_MUTEX_NOT_ACQUIRED",
|
||||
"AE_AML_INVALID_RESOURCE_TYPE",
|
||||
"AE_AML_INVALID_INDEX",
|
||||
"AE_AML_REGISTER_LIMIT",
|
||||
"AE_AML_NO_WHILE",
|
||||
"AE_AML_ALIGNMENT",
|
||||
"AE_AML_NO_RESOURCE_END_TAG",
|
||||
"AE_AML_BAD_RESOURCE_VALUE",
|
||||
"AE_AML_CIRCULAR_REFERENCE",
|
||||
"AE_AML_BAD_RESOURCE_LENGTH",
|
||||
"AE_AML_ILLEGAL_ADDRESS",
|
||||
"AE_AML_INFINITE_LOOP"
|
||||
EXCEP_TXT (NULL, NULL),
|
||||
EXCEP_TXT ("AE_AML_BAD_OPCODE", "Invalid AML opcode encountered"),
|
||||
EXCEP_TXT ("AE_AML_NO_OPERAND", "A required operand is missing"),
|
||||
EXCEP_TXT ("AE_AML_OPERAND_TYPE", "An operand of an incorrect type was encountered"),
|
||||
EXCEP_TXT ("AE_AML_OPERAND_VALUE", "The operand had an inappropriate or invalid value"),
|
||||
EXCEP_TXT ("AE_AML_UNINITIALIZED_LOCAL", "Method tried to use an uninitialized local variable"),
|
||||
EXCEP_TXT ("AE_AML_UNINITIALIZED_ARG", "Method tried to use an uninitialized argument"),
|
||||
EXCEP_TXT ("AE_AML_UNINITIALIZED_ELEMENT", "Method tried to use an empty package element"),
|
||||
EXCEP_TXT ("AE_AML_NUMERIC_OVERFLOW", "Overflow during BCD conversion or other"),
|
||||
EXCEP_TXT ("AE_AML_REGION_LIMIT", "Tried to access beyond the end of an Operation Region"),
|
||||
EXCEP_TXT ("AE_AML_BUFFER_LIMIT", "Tried to access beyond the end of a buffer"),
|
||||
EXCEP_TXT ("AE_AML_PACKAGE_LIMIT", "Tried to access beyond the end of a package"),
|
||||
EXCEP_TXT ("AE_AML_DIVIDE_BY_ZERO", "During execution of AML Divide operator"),
|
||||
EXCEP_TXT ("AE_AML_BAD_NAME", "An ACPI name contains invalid character(s)"),
|
||||
EXCEP_TXT ("AE_AML_NAME_NOT_FOUND", "Could not resolve a named reference"),
|
||||
EXCEP_TXT ("AE_AML_INTERNAL", "An internal error within the interprete"),
|
||||
EXCEP_TXT ("AE_AML_INVALID_SPACE_ID", "An Operation Region SpaceID is invalid"),
|
||||
EXCEP_TXT ("AE_AML_STRING_LIMIT", "String is longer than 200 characters"),
|
||||
EXCEP_TXT ("AE_AML_NO_RETURN_VALUE", "A method did not return a required value"),
|
||||
EXCEP_TXT ("AE_AML_METHOD_LIMIT", "A control method reached the maximum reentrancy limit of 255"),
|
||||
EXCEP_TXT ("AE_AML_NOT_OWNER", "A thread tried to release a mutex that it does not own"),
|
||||
EXCEP_TXT ("AE_AML_MUTEX_ORDER", "Mutex SyncLevel release mismatch"),
|
||||
EXCEP_TXT ("AE_AML_MUTEX_NOT_ACQUIRED", "Attempt to release a mutex that was not previously acquired"),
|
||||
EXCEP_TXT ("AE_AML_INVALID_RESOURCE_TYPE", "Invalid resource type in resource list"),
|
||||
EXCEP_TXT ("AE_AML_INVALID_INDEX", "Invalid Argx or Localx (x too large)"),
|
||||
EXCEP_TXT ("AE_AML_REGISTER_LIMIT", "Bank value or Index value beyond range of register"),
|
||||
EXCEP_TXT ("AE_AML_NO_WHILE", "Break or Continue without a While"),
|
||||
EXCEP_TXT ("AE_AML_ALIGNMENT", "Non-aligned memory transfer on platform that does not support this"),
|
||||
EXCEP_TXT ("AE_AML_NO_RESOURCE_END_TAG", "No End Tag in a resource list"),
|
||||
EXCEP_TXT ("AE_AML_BAD_RESOURCE_VALUE", "Invalid value of a resource element"),
|
||||
EXCEP_TXT ("AE_AML_CIRCULAR_REFERENCE", "Two references refer to each other"),
|
||||
EXCEP_TXT ("AE_AML_BAD_RESOURCE_LENGTH", "The length of a Resource Descriptor in the AML is incorrect"),
|
||||
EXCEP_TXT ("AE_AML_ILLEGAL_ADDRESS", "A memory, I/O, or PCI configuration address is invalid"),
|
||||
EXCEP_TXT ("AE_AML_INFINITE_LOOP", "An apparent infinite AML While loop, method was aborted")
|
||||
};
|
||||
|
||||
char const *AcpiGbl_ExceptionNames_Ctrl[] =
|
||||
static const ACPI_EXCEPTION_INFO AcpiGbl_ExceptionNames_Ctrl[] =
|
||||
{
|
||||
NULL,
|
||||
"AE_CTRL_RETURN_VALUE",
|
||||
"AE_CTRL_PENDING",
|
||||
"AE_CTRL_TERMINATE",
|
||||
"AE_CTRL_TRUE",
|
||||
"AE_CTRL_FALSE",
|
||||
"AE_CTRL_DEPTH",
|
||||
"AE_CTRL_END",
|
||||
"AE_CTRL_TRANSFER",
|
||||
"AE_CTRL_BREAK",
|
||||
"AE_CTRL_CONTINUE",
|
||||
"AE_CTRL_SKIP",
|
||||
"AE_CTRL_PARSE_CONTINUE",
|
||||
"AE_CTRL_PARSE_PENDING"
|
||||
EXCEP_TXT (NULL, NULL),
|
||||
EXCEP_TXT ("AE_CTRL_RETURN_VALUE", "A Method returned a value"),
|
||||
EXCEP_TXT ("AE_CTRL_PENDING", "Method is calling another method"),
|
||||
EXCEP_TXT ("AE_CTRL_TERMINATE", "Terminate the executing method"),
|
||||
EXCEP_TXT ("AE_CTRL_TRUE", "An If or While predicate result"),
|
||||
EXCEP_TXT ("AE_CTRL_FALSE", "An If or While predicate result"),
|
||||
EXCEP_TXT ("AE_CTRL_DEPTH", "Maximum search depth has been reached"),
|
||||
EXCEP_TXT ("AE_CTRL_END", "An If or While predicate is false"),
|
||||
EXCEP_TXT ("AE_CTRL_TRANSFER", "Transfer control to called method"),
|
||||
EXCEP_TXT ("AE_CTRL_BREAK", "A Break has been executed"),
|
||||
EXCEP_TXT ("AE_CTRL_CONTINUE", "A Continue has been executed"),
|
||||
EXCEP_TXT ("AE_CTRL_SKIP", "Not currently used"),
|
||||
EXCEP_TXT ("AE_CTRL_PARSE_CONTINUE", "Used to skip over bad opcodes"),
|
||||
EXCEP_TXT ("AE_CTRL_PARSE_PENDING", "Used to implement AML While loops")
|
||||
};
|
||||
|
||||
#endif /* ACPI GLOBALS */
|
||||
#endif /* EXCEPTION_TABLE */
|
||||
|
||||
#endif /* __ACEXCEP_H__ */
|
||||
|
||||
@@ -4,258 +4,88 @@
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
* 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.
|
||||
*
|
||||
* 2.1. This is your license from Intel Corp. under its intellectual property
|
||||
* rights. You may have additional license terms from the party that provided
|
||||
* you this software, covering your right to use that party's intellectual
|
||||
* property rights.
|
||||
* 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.
|
||||
*
|
||||
* 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
|
||||
* copy of the source code appearing in this file ("Covered Code") an
|
||||
* irrevocable, perpetual, worldwide license under Intel's copyrights in the
|
||||
* base code distributed originally by Intel ("Original Intel Code") to copy,
|
||||
* make derivatives, distribute, use and display any portion of the Covered
|
||||
* Code in any form, with the right to sublicense such rights; and
|
||||
*
|
||||
* 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
|
||||
* license (with the right to sublicense), under only those claims of Intel
|
||||
* patents that are infringed by the Original Intel Code, to make, use, sell,
|
||||
* offer to sell, and import the Covered Code and derivative works thereof
|
||||
* solely to the minimum extent necessary to exercise the above copyright
|
||||
* license, and in no event shall the patent license extend to any additions
|
||||
* to or modifications of the Original Intel Code. No other license or right
|
||||
* is granted directly or by implication, estoppel or otherwise;
|
||||
*
|
||||
* The above copyright and patent license is granted only if the following
|
||||
* conditions are met:
|
||||
*
|
||||
* 3. Conditions
|
||||
*
|
||||
* 3.1. Redistribution of Source with Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification with rights to further distribute source must include
|
||||
* the above Copyright Notice, the above License, this list of Conditions,
|
||||
* and the following Disclaimer and Export Compliance provision. In addition,
|
||||
* Licensee must cause all Covered Code to which Licensee contributes to
|
||||
* contain a file documenting the changes Licensee made to create that Covered
|
||||
* Code and the date of any change. Licensee must include in that file the
|
||||
* documentation of any changes made by any predecessor Licensee. Licensee
|
||||
* must include a prominent statement that the modification is derived,
|
||||
* directly or indirectly, from Original Intel Code.
|
||||
*
|
||||
* 3.2. Redistribution of Source with no Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification without rights to further distribute source must
|
||||
* include the following Disclaimer and Export Compliance provision in the
|
||||
* documentation and/or other materials provided with distribution. In
|
||||
* addition, Licensee may not authorize further sublicense of source of any
|
||||
* portion of the Covered Code, and must include terms to the effect that the
|
||||
* license from Licensee to its licensee is limited to the intellectual
|
||||
* property embodied in the software Licensee provides to its licensee, and
|
||||
* not to intellectual property embodied in modifications its licensee may
|
||||
* make.
|
||||
*
|
||||
* 3.3. Redistribution of Executable. Redistribution in executable form of any
|
||||
* substantial portion of the Covered Code or modification must reproduce the
|
||||
* above Copyright Notice, and the following Disclaimer and Export Compliance
|
||||
* provision in the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3.4. Intel retains all right, title, and interest in and to the Original
|
||||
* Intel Code.
|
||||
*
|
||||
* 3.5. Neither the name Intel nor any other trademark owned or controlled by
|
||||
* Intel shall be used in advertising or otherwise to promote the sale, use or
|
||||
* other dealings in products derived from or relating to the Covered Code
|
||||
* without prior written authorization from Intel.
|
||||
*
|
||||
* 4. Disclaimer and Export Compliance
|
||||
*
|
||||
* 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
|
||||
* HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
|
||||
* IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
|
||||
* INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
|
||||
* UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
|
||||
* PARTICULAR PURPOSE.
|
||||
*
|
||||
* 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
|
||||
* OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
|
||||
* COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
|
||||
* SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
|
||||
* CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
|
||||
* HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
|
||||
* SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
|
||||
* LIMITED REMEDY.
|
||||
*
|
||||
* 4.3. Licensee shall not export, either directly or indirectly, any of this
|
||||
* software or system incorporating such software without first obtaining any
|
||||
* required license or other approval from the U. S. Department of Commerce or
|
||||
* any other agency or department of the United States Government. In the
|
||||
* event Licensee exports any such software from the United States or
|
||||
* re-exports any such software from a foreign destination, Licensee shall
|
||||
* ensure that the distribution and export/re-export of the software is in
|
||||
* compliance with all laws, regulations, orders, or other restrictions of the
|
||||
* U.S. Export Administration Regulations. Licensee agrees that neither it nor
|
||||
* any of its subsidiaries will export/re-export any technical data, process,
|
||||
* software, or service, directly or indirectly, to any country for which the
|
||||
* United States government or any agency thereof requires an export license,
|
||||
* other governmental approval, or letter of assurance, without first obtaining
|
||||
* such license, approval or letter.
|
||||
*
|
||||
*****************************************************************************/
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef __ACGLOBAL_H__
|
||||
#define __ACGLOBAL_H__
|
||||
|
||||
|
||||
/*
|
||||
* Ensure that the globals are actually defined and initialized only once.
|
||||
*
|
||||
* The use of these macros allows a single list of globals (here) in order
|
||||
* to simplify maintenance of the code.
|
||||
*/
|
||||
#ifdef DEFINE_ACPI_GLOBALS
|
||||
#define ACPI_EXTERN
|
||||
#define ACPI_INIT_GLOBAL(a,b) a=b
|
||||
#else
|
||||
#define ACPI_EXTERN extern
|
||||
#define ACPI_INIT_GLOBAL(a,b) a
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef DEFINE_ACPI_GLOBALS
|
||||
|
||||
/* Public globals, available from outside ACPICA subsystem */
|
||||
|
||||
/*****************************************************************************
|
||||
*
|
||||
* Runtime configuration (static defaults that can be overriden at runtime)
|
||||
* Globals related to the ACPI tables
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
* Enable "slack" in the AML interpreter? Default is FALSE, and the
|
||||
* interpreter strictly follows the ACPI specification. Setting to TRUE
|
||||
* allows the interpreter to ignore certain errors and/or bad AML constructs.
|
||||
*
|
||||
* Currently, these features are enabled by this flag:
|
||||
*
|
||||
* 1) Allow "implicit return" of last value in a control method
|
||||
* 2) Allow access beyond the end of an operation region
|
||||
* 3) Allow access to uninitialized locals/args (auto-init to integer 0)
|
||||
* 4) Allow ANY object type to be a source operand for the Store() operator
|
||||
* 5) Allow unresolved references (invalid target name) in package objects
|
||||
* 6) Enable warning messages for behavior that is not ACPI spec compliant
|
||||
*/
|
||||
UINT8 ACPI_INIT_GLOBAL (AcpiGbl_EnableInterpreterSlack, FALSE);
|
||||
/* Master list of all ACPI tables that were found in the RSDT/XSDT */
|
||||
|
||||
/*
|
||||
* Automatically serialize ALL control methods? Default is FALSE, meaning
|
||||
* to use the Serialized/NotSerialized method flags on a per method basis.
|
||||
* Only change this if the ASL code is poorly written and cannot handle
|
||||
* reentrancy even though methods are marked "NotSerialized".
|
||||
*/
|
||||
UINT8 ACPI_INIT_GLOBAL (AcpiGbl_AllMethodsSerialized, FALSE);
|
||||
|
||||
/*
|
||||
* Create the predefined _OSI method in the namespace? Default is TRUE
|
||||
* because ACPI CA is fully compatible with other ACPI implementations.
|
||||
* Changing this will revert ACPI CA (and machine ASL) to pre-OSI behavior.
|
||||
*/
|
||||
UINT8 ACPI_INIT_GLOBAL (AcpiGbl_CreateOsiMethod, TRUE);
|
||||
|
||||
/*
|
||||
* Disable wakeup GPEs during runtime? Default is TRUE because WAKE and
|
||||
* RUNTIME GPEs should never be shared, and WAKE GPEs should typically only
|
||||
* be enabled just before going to sleep.
|
||||
*/
|
||||
UINT8 ACPI_INIT_GLOBAL (AcpiGbl_LeaveWakeGpesDisabled, TRUE);
|
||||
|
||||
/*
|
||||
* Optionally use default values for the ACPI register widths. Set this to
|
||||
* TRUE to use the defaults, if an FADT contains incorrect widths/lengths.
|
||||
*/
|
||||
UINT8 ACPI_INIT_GLOBAL (AcpiGbl_UseDefaultRegisterWidths, TRUE);
|
||||
|
||||
/*
|
||||
* Optionally enable output from the AML Debug Object.
|
||||
*/
|
||||
UINT8 ACPI_INIT_GLOBAL (AcpiGbl_EnableAmlDebugObject, FALSE);
|
||||
|
||||
/*
|
||||
* Optionally copy the entire DSDT to local memory (instead of simply
|
||||
* mapping it.) There are some BIOSs that corrupt or replace the original
|
||||
* DSDT, creating the need for this option. Default is FALSE, do not copy
|
||||
* the DSDT.
|
||||
*/
|
||||
UINT8 ACPI_INIT_GLOBAL (AcpiGbl_CopyDsdtLocally, FALSE);
|
||||
|
||||
/*
|
||||
* Optionally truncate I/O addresses to 16 bits. Provides compatibility
|
||||
* with other ACPI implementations. NOTE: During ACPICA initialization,
|
||||
* this value is set to TRUE if any Windows OSI strings have been
|
||||
* requested by the BIOS.
|
||||
*/
|
||||
UINT8 ACPI_INIT_GLOBAL (AcpiGbl_TruncateIoAddresses, FALSE);
|
||||
|
||||
|
||||
/* AcpiGbl_FADT is a local copy of the FADT, converted to a common format. */
|
||||
|
||||
ACPI_TABLE_FADT AcpiGbl_FADT;
|
||||
UINT32 AcpiCurrentGpeCount;
|
||||
UINT32 AcpiGbl_TraceFlags;
|
||||
ACPI_NAME AcpiGbl_TraceMethodName;
|
||||
|
||||
#endif
|
||||
|
||||
/*****************************************************************************
|
||||
*
|
||||
* ACPI Table globals
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
/*
|
||||
* AcpiGbl_RootTableList is the master list of ACPI tables that were
|
||||
* found in the RSDT/XSDT.
|
||||
*/
|
||||
ACPI_EXTERN ACPI_TABLE_LIST AcpiGbl_RootTableList;
|
||||
ACPI_EXTERN ACPI_TABLE_FACS *AcpiGbl_FACS;
|
||||
|
||||
/* These addresses are calculated from the FADT Event Block addresses */
|
||||
|
||||
ACPI_EXTERN ACPI_GENERIC_ADDRESS AcpiGbl_XPm1aStatus;
|
||||
ACPI_EXTERN ACPI_GENERIC_ADDRESS AcpiGbl_XPm1aEnable;
|
||||
|
||||
ACPI_EXTERN ACPI_GENERIC_ADDRESS AcpiGbl_XPm1bStatus;
|
||||
ACPI_EXTERN ACPI_GENERIC_ADDRESS AcpiGbl_XPm1bEnable;
|
||||
ACPI_GLOBAL (ACPI_TABLE_LIST, AcpiGbl_RootTableList);
|
||||
|
||||
/* DSDT information. Used to check for DSDT corruption */
|
||||
|
||||
ACPI_EXTERN ACPI_TABLE_HEADER *AcpiGbl_DSDT;
|
||||
ACPI_EXTERN ACPI_TABLE_HEADER AcpiGbl_OriginalDsdtHeader;
|
||||
ACPI_GLOBAL (ACPI_TABLE_HEADER *, AcpiGbl_DSDT);
|
||||
ACPI_GLOBAL (ACPI_TABLE_HEADER, AcpiGbl_OriginalDsdtHeader);
|
||||
|
||||
#if (!ACPI_REDUCED_HARDWARE)
|
||||
ACPI_GLOBAL (ACPI_TABLE_FACS *, AcpiGbl_FACS);
|
||||
|
||||
#endif /* !ACPI_REDUCED_HARDWARE */
|
||||
|
||||
/* These addresses are calculated from the FADT Event Block addresses */
|
||||
|
||||
ACPI_GLOBAL (ACPI_GENERIC_ADDRESS, AcpiGbl_XPm1aStatus);
|
||||
ACPI_GLOBAL (ACPI_GENERIC_ADDRESS, AcpiGbl_XPm1aEnable);
|
||||
|
||||
ACPI_GLOBAL (ACPI_GENERIC_ADDRESS, AcpiGbl_XPm1bStatus);
|
||||
ACPI_GLOBAL (ACPI_GENERIC_ADDRESS, AcpiGbl_XPm1bEnable);
|
||||
|
||||
/*
|
||||
* Handle both ACPI 1.0 and ACPI 2.0 Integer widths. The integer width is
|
||||
* Handle both ACPI 1.0 and ACPI 2.0+ Integer widths. The integer width is
|
||||
* determined by the revision of the DSDT: If the DSDT revision is less than
|
||||
* 2, use only the lower 32 bits of the internal 64-bit Integer.
|
||||
*/
|
||||
ACPI_EXTERN UINT8 AcpiGbl_IntegerBitWidth;
|
||||
ACPI_EXTERN UINT8 AcpiGbl_IntegerByteWidth;
|
||||
ACPI_EXTERN UINT8 AcpiGbl_IntegerNybbleWidth;
|
||||
ACPI_GLOBAL (UINT8, AcpiGbl_IntegerBitWidth);
|
||||
ACPI_GLOBAL (UINT8, AcpiGbl_IntegerByteWidth);
|
||||
ACPI_GLOBAL (UINT8, AcpiGbl_IntegerNybbleWidth);
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
*
|
||||
* Mutual exlusion within ACPICA subsystem
|
||||
* Mutual exclusion within ACPICA subsystem
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
@@ -264,28 +94,36 @@ ACPI_EXTERN UINT8 AcpiGbl_IntegerNybbleWidth;
|
||||
* actual OS mutex handles, indexed by the local ACPI_MUTEX_HANDLEs.
|
||||
* (The table maps local handles to the real OS handles)
|
||||
*/
|
||||
ACPI_EXTERN ACPI_MUTEX_INFO AcpiGbl_MutexInfo[ACPI_NUM_MUTEX];
|
||||
ACPI_GLOBAL (ACPI_MUTEX_INFO, AcpiGbl_MutexInfo[ACPI_NUM_MUTEX]);
|
||||
|
||||
/*
|
||||
* Global lock mutex is an actual AML mutex object
|
||||
* Global lock semaphore works in conjunction with the HW global lock
|
||||
* Global lock semaphore works in conjunction with the actual global lock
|
||||
* Global lock spinlock is used for "pending" handshake
|
||||
*/
|
||||
ACPI_EXTERN ACPI_OPERAND_OBJECT *AcpiGbl_GlobalLockMutex;
|
||||
ACPI_EXTERN ACPI_SEMAPHORE AcpiGbl_GlobalLockSemaphore;
|
||||
ACPI_EXTERN UINT16 AcpiGbl_GlobalLockHandle;
|
||||
ACPI_EXTERN BOOLEAN AcpiGbl_GlobalLockAcquired;
|
||||
ACPI_EXTERN BOOLEAN AcpiGbl_GlobalLockPresent;
|
||||
ACPI_GLOBAL (ACPI_OPERAND_OBJECT *, AcpiGbl_GlobalLockMutex);
|
||||
ACPI_GLOBAL (ACPI_SEMAPHORE, AcpiGbl_GlobalLockSemaphore);
|
||||
ACPI_GLOBAL (ACPI_SPINLOCK, AcpiGbl_GlobalLockPendingLock);
|
||||
ACPI_GLOBAL (UINT16, AcpiGbl_GlobalLockHandle);
|
||||
ACPI_GLOBAL (BOOLEAN, AcpiGbl_GlobalLockAcquired);
|
||||
ACPI_GLOBAL (BOOLEAN, AcpiGbl_GlobalLockPresent);
|
||||
ACPI_GLOBAL (BOOLEAN, AcpiGbl_GlobalLockPending);
|
||||
|
||||
/*
|
||||
* Spinlocks are used for interfaces that can be possibly called at
|
||||
* interrupt level
|
||||
*/
|
||||
ACPI_EXTERN ACPI_SPINLOCK AcpiGbl_GpeLock; /* For GPE data structs and registers */
|
||||
ACPI_EXTERN ACPI_SPINLOCK AcpiGbl_HardwareLock; /* For ACPI H/W except GPE registers */
|
||||
ACPI_GLOBAL (ACPI_SPINLOCK, AcpiGbl_GpeLock); /* For GPE data structs and registers */
|
||||
ACPI_GLOBAL (ACPI_SPINLOCK, AcpiGbl_HardwareLock); /* For ACPI H/W except GPE registers */
|
||||
ACPI_GLOBAL (ACPI_SPINLOCK, AcpiGbl_ReferenceCountLock);
|
||||
|
||||
/* Mutex for _OSI support */
|
||||
|
||||
ACPI_GLOBAL (ACPI_MUTEX, AcpiGbl_OsiMutex);
|
||||
|
||||
/* Reader/Writer lock is used for namespace walk and dynamic table unload */
|
||||
|
||||
ACPI_EXTERN ACPI_RW_LOCK AcpiGbl_NamespaceRwLock;
|
||||
ACPI_GLOBAL (ACPI_RW_LOCK, AcpiGbl_NamespaceRwLock);
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
@@ -296,74 +134,67 @@ ACPI_EXTERN ACPI_RW_LOCK AcpiGbl_NamespaceRwLock;
|
||||
|
||||
/* Object caches */
|
||||
|
||||
ACPI_EXTERN ACPI_CACHE_T *AcpiGbl_NamespaceCache;
|
||||
ACPI_EXTERN ACPI_CACHE_T *AcpiGbl_StateCache;
|
||||
ACPI_EXTERN ACPI_CACHE_T *AcpiGbl_PsNodeCache;
|
||||
ACPI_EXTERN ACPI_CACHE_T *AcpiGbl_PsNodeExtCache;
|
||||
ACPI_EXTERN ACPI_CACHE_T *AcpiGbl_OperandCache;
|
||||
ACPI_GLOBAL (ACPI_CACHE_T *, AcpiGbl_NamespaceCache);
|
||||
ACPI_GLOBAL (ACPI_CACHE_T *, AcpiGbl_StateCache);
|
||||
ACPI_GLOBAL (ACPI_CACHE_T *, AcpiGbl_PsNodeCache);
|
||||
ACPI_GLOBAL (ACPI_CACHE_T *, AcpiGbl_PsNodeExtCache);
|
||||
ACPI_GLOBAL (ACPI_CACHE_T *, AcpiGbl_OperandCache);
|
||||
|
||||
/* System */
|
||||
|
||||
ACPI_INIT_GLOBAL (UINT32, AcpiGbl_StartupFlags, 0);
|
||||
ACPI_INIT_GLOBAL (BOOLEAN, AcpiGbl_Shutdown, TRUE);
|
||||
|
||||
/* Global handlers */
|
||||
|
||||
ACPI_EXTERN ACPI_OBJECT_NOTIFY_HANDLER AcpiGbl_DeviceNotify;
|
||||
ACPI_EXTERN ACPI_OBJECT_NOTIFY_HANDLER AcpiGbl_SystemNotify;
|
||||
ACPI_EXTERN ACPI_EXCEPTION_HANDLER AcpiGbl_ExceptionHandler;
|
||||
ACPI_EXTERN ACPI_INIT_HANDLER AcpiGbl_InitHandler;
|
||||
ACPI_EXTERN ACPI_TABLE_HANDLER AcpiGbl_TableHandler;
|
||||
ACPI_EXTERN void *AcpiGbl_TableHandlerContext;
|
||||
ACPI_EXTERN ACPI_WALK_STATE *AcpiGbl_BreakpointWalk;
|
||||
|
||||
ACPI_GLOBAL (ACPI_GLOBAL_NOTIFY_HANDLER,AcpiGbl_GlobalNotify[2]);
|
||||
ACPI_GLOBAL (ACPI_EXCEPTION_HANDLER, AcpiGbl_ExceptionHandler);
|
||||
ACPI_GLOBAL (ACPI_INIT_HANDLER, AcpiGbl_InitHandler);
|
||||
ACPI_GLOBAL (ACPI_TABLE_HANDLER, AcpiGbl_TableHandler);
|
||||
ACPI_GLOBAL (void *, AcpiGbl_TableHandlerContext);
|
||||
ACPI_GLOBAL (ACPI_INTERFACE_HANDLER, AcpiGbl_InterfaceHandler);
|
||||
ACPI_GLOBAL (ACPI_SCI_HANDLER_INFO *, AcpiGbl_SciHandlerList);
|
||||
|
||||
/* Owner ID support */
|
||||
|
||||
ACPI_EXTERN UINT32 AcpiGbl_OwnerIdMask[ACPI_NUM_OWNERID_MASKS];
|
||||
ACPI_EXTERN UINT8 AcpiGbl_LastOwnerIdIndex;
|
||||
ACPI_EXTERN UINT8 AcpiGbl_NextOwnerIdOffset;
|
||||
ACPI_GLOBAL (UINT32, AcpiGbl_OwnerIdMask[ACPI_NUM_OWNERID_MASKS]);
|
||||
ACPI_GLOBAL (UINT8, AcpiGbl_LastOwnerIdIndex);
|
||||
ACPI_GLOBAL (UINT8, AcpiGbl_NextOwnerIdOffset);
|
||||
|
||||
/* Initialization sequencing */
|
||||
|
||||
ACPI_GLOBAL (BOOLEAN, AcpiGbl_RegMethodsExecuted);
|
||||
|
||||
/* Misc */
|
||||
|
||||
ACPI_EXTERN UINT32 AcpiGbl_OriginalMode;
|
||||
ACPI_EXTERN UINT32 AcpiGbl_RsdpOriginalLocation;
|
||||
ACPI_EXTERN UINT32 AcpiGbl_NsLookupCount;
|
||||
ACPI_EXTERN UINT32 AcpiGbl_PsFindCount;
|
||||
ACPI_EXTERN UINT16 AcpiGbl_Pm1EnableRegisterSave;
|
||||
ACPI_EXTERN UINT8 AcpiGbl_DebuggerConfiguration;
|
||||
ACPI_EXTERN BOOLEAN AcpiGbl_StepToNextCall;
|
||||
ACPI_EXTERN BOOLEAN AcpiGbl_AcpiHardwarePresent;
|
||||
ACPI_EXTERN BOOLEAN AcpiGbl_EventsInitialized;
|
||||
ACPI_EXTERN BOOLEAN AcpiGbl_SystemAwakeAndRunning;
|
||||
ACPI_EXTERN UINT8 AcpiGbl_OsiData;
|
||||
ACPI_GLOBAL (UINT32, AcpiGbl_OriginalMode);
|
||||
ACPI_GLOBAL (UINT32, AcpiGbl_NsLookupCount);
|
||||
ACPI_GLOBAL (UINT32, AcpiGbl_PsFindCount);
|
||||
ACPI_GLOBAL (UINT16, AcpiGbl_Pm1EnableRegisterSave);
|
||||
ACPI_GLOBAL (UINT8, AcpiGbl_DebuggerConfiguration);
|
||||
ACPI_GLOBAL (BOOLEAN, AcpiGbl_StepToNextCall);
|
||||
ACPI_GLOBAL (BOOLEAN, AcpiGbl_AcpiHardwarePresent);
|
||||
ACPI_GLOBAL (BOOLEAN, AcpiGbl_EventsInitialized);
|
||||
ACPI_GLOBAL (ACPI_INTERFACE_INFO *, AcpiGbl_SupportedInterfaces);
|
||||
ACPI_GLOBAL (ACPI_ADDRESS_RANGE *, AcpiGbl_AddressRangeList[ACPI_ADDRESS_RANGE_MAX]);
|
||||
|
||||
/* Other miscellaneous, declared and initialized in utglobal */
|
||||
|
||||
#ifndef DEFINE_ACPI_GLOBALS
|
||||
|
||||
/* Exception codes */
|
||||
|
||||
extern char const *AcpiGbl_ExceptionNames_Env[];
|
||||
extern char const *AcpiGbl_ExceptionNames_Pgm[];
|
||||
extern char const *AcpiGbl_ExceptionNames_Tbl[];
|
||||
extern char const *AcpiGbl_ExceptionNames_Aml[];
|
||||
extern char const *AcpiGbl_ExceptionNames_Ctrl[];
|
||||
|
||||
/* Other miscellaneous */
|
||||
|
||||
extern BOOLEAN AcpiGbl_Shutdown;
|
||||
extern UINT32 AcpiGbl_StartupFlags;
|
||||
extern const char *AcpiGbl_SleepStateNames[ACPI_S_STATE_COUNT];
|
||||
extern const char *AcpiGbl_LowestDstateNames[ACPI_NUM_SxW_METHODS];
|
||||
extern const char *AcpiGbl_HighestDstateNames[ACPI_NUM_SxD_METHODS];
|
||||
extern const ACPI_OPCODE_INFO AcpiGbl_AmlOpInfo[AML_NUM_OPCODES];
|
||||
extern const char *AcpiGbl_RegionTypes[ACPI_NUM_PREDEFINED_REGIONS];
|
||||
#endif
|
||||
extern const ACPI_OPCODE_INFO AcpiGbl_AmlOpInfo[AML_NUM_OPCODES];
|
||||
|
||||
|
||||
#ifdef ACPI_DBG_TRACK_ALLOCATIONS
|
||||
|
||||
/* Lists for tracking memory allocations */
|
||||
/* Lists for tracking memory allocations (debug only) */
|
||||
|
||||
ACPI_EXTERN ACPI_MEMORY_LIST *AcpiGbl_GlobalList;
|
||||
ACPI_EXTERN ACPI_MEMORY_LIST *AcpiGbl_NsNodeList;
|
||||
ACPI_EXTERN BOOLEAN AcpiGbl_DisplayFinalMemStats;
|
||||
ACPI_EXTERN BOOLEAN AcpiGbl_DisableMemTracking;
|
||||
ACPI_GLOBAL (ACPI_MEMORY_LIST *, AcpiGbl_GlobalList);
|
||||
ACPI_GLOBAL (ACPI_MEMORY_LIST *, AcpiGbl_NsNodeList);
|
||||
ACPI_GLOBAL (BOOLEAN, AcpiGbl_DisplayFinalMemStats);
|
||||
ACPI_GLOBAL (BOOLEAN, AcpiGbl_DisableMemTracking);
|
||||
#endif
|
||||
|
||||
|
||||
@@ -379,22 +210,23 @@ ACPI_EXTERN BOOLEAN AcpiGbl_DisableMemTracking;
|
||||
#define NUM_PREDEFINED_NAMES 9
|
||||
#endif
|
||||
|
||||
ACPI_EXTERN ACPI_NAMESPACE_NODE AcpiGbl_RootNodeStruct;
|
||||
ACPI_EXTERN ACPI_NAMESPACE_NODE *AcpiGbl_RootNode;
|
||||
ACPI_EXTERN ACPI_NAMESPACE_NODE *AcpiGbl_FadtGpeDevice;
|
||||
ACPI_EXTERN ACPI_OPERAND_OBJECT *AcpiGbl_ModuleCodeList;
|
||||
ACPI_GLOBAL (ACPI_NAMESPACE_NODE, AcpiGbl_RootNodeStruct);
|
||||
ACPI_GLOBAL (ACPI_NAMESPACE_NODE *, AcpiGbl_RootNode);
|
||||
ACPI_GLOBAL (ACPI_NAMESPACE_NODE *, AcpiGbl_FadtGpeDevice);
|
||||
ACPI_GLOBAL (ACPI_OPERAND_OBJECT *, AcpiGbl_ModuleCodeList);
|
||||
|
||||
|
||||
extern const UINT8 AcpiGbl_NsProperties [ACPI_NUM_NS_TYPES];
|
||||
extern const ACPI_PREDEFINED_NAMES AcpiGbl_PreDefinedNames [NUM_PREDEFINED_NAMES];
|
||||
|
||||
#ifdef ACPI_DEBUG_OUTPUT
|
||||
ACPI_EXTERN UINT32 AcpiGbl_CurrentNodeCount;
|
||||
ACPI_EXTERN UINT32 AcpiGbl_CurrentNodeSize;
|
||||
ACPI_EXTERN UINT32 AcpiGbl_MaxConcurrentNodeCount;
|
||||
ACPI_EXTERN ACPI_SIZE *AcpiGbl_EntryStackPointer;
|
||||
ACPI_EXTERN ACPI_SIZE *AcpiGbl_LowestStackPointer;
|
||||
ACPI_EXTERN UINT32 AcpiGbl_DeepestNesting;
|
||||
ACPI_GLOBAL (UINT32, AcpiGbl_CurrentNodeCount);
|
||||
ACPI_GLOBAL (UINT32, AcpiGbl_CurrentNodeSize);
|
||||
ACPI_GLOBAL (UINT32, AcpiGbl_MaxConcurrentNodeCount);
|
||||
ACPI_GLOBAL (ACPI_SIZE *, AcpiGbl_EntryStackPointer);
|
||||
ACPI_GLOBAL (ACPI_SIZE *, AcpiGbl_LowestStackPointer);
|
||||
ACPI_GLOBAL (UINT32, AcpiGbl_DeepestNesting);
|
||||
ACPI_INIT_GLOBAL (UINT32, AcpiGbl_NestingLevel, 0);
|
||||
#endif
|
||||
|
||||
|
||||
@@ -404,12 +236,11 @@ ACPI_EXTERN UINT32 AcpiGbl_DeepestNesting;
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
|
||||
ACPI_EXTERN ACPI_THREAD_STATE *AcpiGbl_CurrentWalkList;
|
||||
ACPI_GLOBAL (ACPI_THREAD_STATE *, AcpiGbl_CurrentWalkList);
|
||||
|
||||
/* Control method single step flag */
|
||||
|
||||
ACPI_EXTERN UINT8 AcpiGbl_CmSingleStep;
|
||||
ACPI_GLOBAL (UINT8, AcpiGbl_CmSingleStep);
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
@@ -418,9 +249,10 @@ ACPI_EXTERN UINT8 AcpiGbl_CmSingleStep;
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
extern ACPI_BIT_REGISTER_INFO AcpiGbl_BitRegisterInfo[ACPI_NUM_BITREG];
|
||||
ACPI_EXTERN UINT8 AcpiGbl_SleepTypeA;
|
||||
ACPI_EXTERN UINT8 AcpiGbl_SleepTypeB;
|
||||
extern ACPI_BIT_REGISTER_INFO AcpiGbl_BitRegisterInfo[ACPI_NUM_BITREG];
|
||||
|
||||
ACPI_GLOBAL (UINT8, AcpiGbl_SleepTypeA);
|
||||
ACPI_GLOBAL (UINT8, AcpiGbl_SleepTypeB);
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
@@ -429,11 +261,18 @@ ACPI_EXTERN UINT8 AcpiGbl_SleepTypeB;
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
extern ACPI_FIXED_EVENT_INFO AcpiGbl_FixedEventInfo[ACPI_NUM_FIXED_EVENTS];
|
||||
ACPI_EXTERN ACPI_FIXED_EVENT_HANDLER AcpiGbl_FixedEventHandlers[ACPI_NUM_FIXED_EVENTS];
|
||||
ACPI_EXTERN ACPI_GPE_XRUPT_INFO *AcpiGbl_GpeXruptListHead;
|
||||
ACPI_EXTERN ACPI_GPE_BLOCK_INFO *AcpiGbl_GpeFadtBlocks[ACPI_MAX_GPE_BLOCKS];
|
||||
#if (!ACPI_REDUCED_HARDWARE)
|
||||
|
||||
ACPI_GLOBAL (UINT8, AcpiGbl_AllGpesInitialized);
|
||||
ACPI_GLOBAL (ACPI_GPE_XRUPT_INFO *, AcpiGbl_GpeXruptListHead);
|
||||
ACPI_GLOBAL (ACPI_GPE_BLOCK_INFO *, AcpiGbl_GpeFadtBlocks[ACPI_MAX_GPE_BLOCKS]);
|
||||
ACPI_GLOBAL (ACPI_GBL_EVENT_HANDLER, AcpiGbl_GlobalEventHandler);
|
||||
ACPI_GLOBAL (void *, AcpiGbl_GlobalEventHandlerContext);
|
||||
ACPI_GLOBAL (ACPI_FIXED_EVENT_HANDLER, AcpiGbl_FixedEventHandlers[ACPI_NUM_FIXED_EVENTS]);
|
||||
|
||||
extern ACPI_FIXED_EVENT_INFO AcpiGbl_FixedEventInfo[ACPI_NUM_FIXED_EVENTS];
|
||||
|
||||
#endif /* !ACPI_REDUCED_HARDWARE */
|
||||
|
||||
/*****************************************************************************
|
||||
*
|
||||
@@ -441,80 +280,112 @@ ACPI_EXTERN ACPI_GPE_BLOCK_INFO *AcpiGbl_GpeFadtBlocks[ACPI_MAX_GPE_BLOCK
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
/* Procedure nesting level for debug output */
|
||||
|
||||
extern UINT32 AcpiGbl_NestingLevel;
|
||||
|
||||
/* Event counters */
|
||||
|
||||
ACPI_EXTERN UINT32 AcpiMethodCount;
|
||||
ACPI_EXTERN UINT32 AcpiGpeCount;
|
||||
ACPI_EXTERN UINT32 AcpiSciCount;
|
||||
ACPI_EXTERN UINT32 AcpiFixedEventCount[ACPI_NUM_FIXED_EVENTS];
|
||||
ACPI_GLOBAL (UINT32, AcpiMethodCount);
|
||||
ACPI_GLOBAL (UINT32, AcpiGpeCount);
|
||||
ACPI_GLOBAL (UINT32, AcpiSciCount);
|
||||
ACPI_GLOBAL (UINT32, AcpiFixedEventCount[ACPI_NUM_FIXED_EVENTS]);
|
||||
|
||||
/* Support for dynamic control method tracing mechanism */
|
||||
|
||||
ACPI_EXTERN UINT32 AcpiGbl_OriginalDbgLevel;
|
||||
ACPI_EXTERN UINT32 AcpiGbl_OriginalDbgLayer;
|
||||
ACPI_EXTERN UINT32 AcpiGbl_TraceDbgLevel;
|
||||
ACPI_EXTERN UINT32 AcpiGbl_TraceDbgLayer;
|
||||
ACPI_GLOBAL (UINT32, AcpiGbl_OriginalDbgLevel);
|
||||
ACPI_GLOBAL (UINT32, AcpiGbl_OriginalDbgLayer);
|
||||
ACPI_GLOBAL (UINT32, AcpiGbl_TraceDbgLevel);
|
||||
ACPI_GLOBAL (UINT32, AcpiGbl_TraceDbgLayer);
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
*
|
||||
* Debugger globals
|
||||
* Debugger and Disassembler globals
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
ACPI_EXTERN UINT8 AcpiGbl_DbOutputFlags;
|
||||
ACPI_INIT_GLOBAL (UINT8, AcpiGbl_DbOutputFlags, ACPI_DB_CONSOLE_OUTPUT);
|
||||
|
||||
#ifdef ACPI_DISASSEMBLER
|
||||
|
||||
ACPI_EXTERN BOOLEAN AcpiGbl_DbOpt_disasm;
|
||||
ACPI_EXTERN BOOLEAN AcpiGbl_DbOpt_verbose;
|
||||
ACPI_EXTERN ACPI_EXTERNAL_LIST *AcpiGbl_ExternalList;
|
||||
#endif
|
||||
/* Do not disassemble buffers to resource descriptors */
|
||||
|
||||
ACPI_INIT_GLOBAL (UINT8, AcpiGbl_NoResourceDisassembly, FALSE);
|
||||
ACPI_INIT_GLOBAL (BOOLEAN, AcpiGbl_IgnoreNoopOperator, FALSE);
|
||||
ACPI_INIT_GLOBAL (BOOLEAN, AcpiGbl_CstyleDisassembly, TRUE);
|
||||
|
||||
ACPI_GLOBAL (BOOLEAN, AcpiGbl_DbOpt_disasm);
|
||||
ACPI_GLOBAL (BOOLEAN, AcpiGbl_DbOpt_verbose);
|
||||
ACPI_GLOBAL (BOOLEAN, AcpiGbl_NumExternalMethods);
|
||||
ACPI_GLOBAL (UINT32, AcpiGbl_ResolvedExternalMethods);
|
||||
ACPI_GLOBAL (ACPI_EXTERNAL_LIST *, AcpiGbl_ExternalList);
|
||||
ACPI_GLOBAL (ACPI_EXTERNAL_FILE *, AcpiGbl_ExternalFileList);
|
||||
#endif
|
||||
|
||||
#ifdef ACPI_DEBUGGER
|
||||
|
||||
extern BOOLEAN AcpiGbl_MethodExecuting;
|
||||
extern BOOLEAN AcpiGbl_AbortMethod;
|
||||
extern BOOLEAN AcpiGbl_DbTerminateThreads;
|
||||
ACPI_INIT_GLOBAL (BOOLEAN, AcpiGbl_DbTerminateThreads, FALSE);
|
||||
ACPI_INIT_GLOBAL (BOOLEAN, AcpiGbl_AbortMethod, FALSE);
|
||||
ACPI_INIT_GLOBAL (BOOLEAN, AcpiGbl_MethodExecuting, FALSE);
|
||||
|
||||
ACPI_EXTERN BOOLEAN AcpiGbl_DbOpt_tables;
|
||||
ACPI_EXTERN BOOLEAN AcpiGbl_DbOpt_stats;
|
||||
ACPI_EXTERN BOOLEAN AcpiGbl_DbOpt_ini_methods;
|
||||
ACPI_EXTERN BOOLEAN AcpiGbl_DbOpt_NoRegionSupport;
|
||||
ACPI_GLOBAL (BOOLEAN, AcpiGbl_DbOpt_tables);
|
||||
ACPI_GLOBAL (BOOLEAN, AcpiGbl_DbOpt_stats);
|
||||
ACPI_GLOBAL (BOOLEAN, AcpiGbl_DbOpt_ini_methods);
|
||||
ACPI_GLOBAL (BOOLEAN, AcpiGbl_DbOpt_NoRegionSupport);
|
||||
ACPI_GLOBAL (BOOLEAN, AcpiGbl_DbOutputToFile);
|
||||
ACPI_GLOBAL (char *, AcpiGbl_DbBuffer);
|
||||
ACPI_GLOBAL (char *, AcpiGbl_DbFilename);
|
||||
ACPI_GLOBAL (UINT32, AcpiGbl_DbDebugLevel);
|
||||
ACPI_GLOBAL (UINT32, AcpiGbl_DbConsoleDebugLevel);
|
||||
ACPI_GLOBAL (ACPI_NAMESPACE_NODE *, AcpiGbl_DbScopeNode);
|
||||
|
||||
ACPI_EXTERN char *AcpiGbl_DbArgs[ACPI_DEBUGGER_MAX_ARGS];
|
||||
ACPI_EXTERN char AcpiGbl_DbLineBuf[80];
|
||||
ACPI_EXTERN char AcpiGbl_DbParsedBuf[80];
|
||||
ACPI_EXTERN char AcpiGbl_DbScopeBuf[40];
|
||||
ACPI_EXTERN char AcpiGbl_DbDebugFilename[40];
|
||||
ACPI_EXTERN BOOLEAN AcpiGbl_DbOutputToFile;
|
||||
ACPI_EXTERN char *AcpiGbl_DbBuffer;
|
||||
ACPI_EXTERN char *AcpiGbl_DbFilename;
|
||||
ACPI_EXTERN UINT32 AcpiGbl_DbDebugLevel;
|
||||
ACPI_EXTERN UINT32 AcpiGbl_DbConsoleDebugLevel;
|
||||
ACPI_EXTERN ACPI_NAMESPACE_NODE *AcpiGbl_DbScopeNode;
|
||||
ACPI_GLOBAL (char *, AcpiGbl_DbArgs[ACPI_DEBUGGER_MAX_ARGS]);
|
||||
ACPI_GLOBAL (ACPI_OBJECT_TYPE, AcpiGbl_DbArgTypes[ACPI_DEBUGGER_MAX_ARGS]);
|
||||
|
||||
/* These buffers should all be the same size */
|
||||
|
||||
ACPI_GLOBAL (char, AcpiGbl_DbLineBuf[ACPI_DB_LINE_BUFFER_SIZE]);
|
||||
ACPI_GLOBAL (char, AcpiGbl_DbParsedBuf[ACPI_DB_LINE_BUFFER_SIZE]);
|
||||
ACPI_GLOBAL (char, AcpiGbl_DbScopeBuf[ACPI_DB_LINE_BUFFER_SIZE]);
|
||||
ACPI_GLOBAL (char, AcpiGbl_DbDebugFilename[ACPI_DB_LINE_BUFFER_SIZE]);
|
||||
|
||||
/*
|
||||
* Statistic globals
|
||||
*/
|
||||
ACPI_EXTERN UINT16 AcpiGbl_ObjTypeCount[ACPI_TYPE_NS_NODE_MAX+1];
|
||||
ACPI_EXTERN UINT16 AcpiGbl_NodeTypeCount[ACPI_TYPE_NS_NODE_MAX+1];
|
||||
ACPI_EXTERN UINT16 AcpiGbl_ObjTypeCountMisc;
|
||||
ACPI_EXTERN UINT16 AcpiGbl_NodeTypeCountMisc;
|
||||
ACPI_EXTERN UINT32 AcpiGbl_NumNodes;
|
||||
ACPI_EXTERN UINT32 AcpiGbl_NumObjects;
|
||||
|
||||
|
||||
ACPI_EXTERN UINT32 AcpiGbl_SizeOfParseTree;
|
||||
ACPI_EXTERN UINT32 AcpiGbl_SizeOfMethodTrees;
|
||||
ACPI_EXTERN UINT32 AcpiGbl_SizeOfNodeEntries;
|
||||
ACPI_EXTERN UINT32 AcpiGbl_SizeOfAcpiObjects;
|
||||
ACPI_GLOBAL (UINT16, AcpiGbl_ObjTypeCount[ACPI_TYPE_NS_NODE_MAX+1]);
|
||||
ACPI_GLOBAL (UINT16, AcpiGbl_NodeTypeCount[ACPI_TYPE_NS_NODE_MAX+1]);
|
||||
ACPI_GLOBAL (UINT16, AcpiGbl_ObjTypeCountMisc);
|
||||
ACPI_GLOBAL (UINT16, AcpiGbl_NodeTypeCountMisc);
|
||||
ACPI_GLOBAL (UINT32, AcpiGbl_NumNodes);
|
||||
ACPI_GLOBAL (UINT32, AcpiGbl_NumObjects);
|
||||
|
||||
#endif /* ACPI_DEBUGGER */
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
*
|
||||
* Application globals
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef ACPI_APPLICATION
|
||||
|
||||
ACPI_INIT_GLOBAL (ACPI_FILE, AcpiGbl_DebugFile, NULL);
|
||||
ACPI_INIT_GLOBAL (ACPI_FILE, AcpiGbl_OutputFile, NULL);
|
||||
|
||||
/* Print buffer */
|
||||
|
||||
ACPI_GLOBAL (ACPI_SPINLOCK, AcpiGbl_PrintLock); /* For print buffer */
|
||||
ACPI_GLOBAL (char, AcpiGbl_PrintBuffer[1024]);
|
||||
|
||||
#endif /* ACPI_APPLICATION */
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
*
|
||||
* Info/help support
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
extern const AH_PREDEFINED_NAME AslPredefinedInfo[];
|
||||
extern const AH_DEVICE_ID AslDeviceIds[];
|
||||
|
||||
|
||||
#endif /* __ACGLOBAL_H__ */
|
||||
|
||||
@@ -4,114 +4,42 @@
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
* 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.
|
||||
*
|
||||
* 2.1. This is your license from Intel Corp. under its intellectual property
|
||||
* rights. You may have additional license terms from the party that provided
|
||||
* you this software, covering your right to use that party's intellectual
|
||||
* property rights.
|
||||
* 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.
|
||||
*
|
||||
* 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
|
||||
* copy of the source code appearing in this file ("Covered Code") an
|
||||
* irrevocable, perpetual, worldwide license under Intel's copyrights in the
|
||||
* base code distributed originally by Intel ("Original Intel Code") to copy,
|
||||
* make derivatives, distribute, use and display any portion of the Covered
|
||||
* Code in any form, with the right to sublicense such rights; and
|
||||
*
|
||||
* 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
|
||||
* license (with the right to sublicense), under only those claims of Intel
|
||||
* patents that are infringed by the Original Intel Code, to make, use, sell,
|
||||
* offer to sell, and import the Covered Code and derivative works thereof
|
||||
* solely to the minimum extent necessary to exercise the above copyright
|
||||
* license, and in no event shall the patent license extend to any additions
|
||||
* to or modifications of the Original Intel Code. No other license or right
|
||||
* is granted directly or by implication, estoppel or otherwise;
|
||||
*
|
||||
* The above copyright and patent license is granted only if the following
|
||||
* conditions are met:
|
||||
*
|
||||
* 3. Conditions
|
||||
*
|
||||
* 3.1. Redistribution of Source with Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification with rights to further distribute source must include
|
||||
* the above Copyright Notice, the above License, this list of Conditions,
|
||||
* and the following Disclaimer and Export Compliance provision. In addition,
|
||||
* Licensee must cause all Covered Code to which Licensee contributes to
|
||||
* contain a file documenting the changes Licensee made to create that Covered
|
||||
* Code and the date of any change. Licensee must include in that file the
|
||||
* documentation of any changes made by any predecessor Licensee. Licensee
|
||||
* must include a prominent statement that the modification is derived,
|
||||
* directly or indirectly, from Original Intel Code.
|
||||
*
|
||||
* 3.2. Redistribution of Source with no Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification without rights to further distribute source must
|
||||
* include the following Disclaimer and Export Compliance provision in the
|
||||
* documentation and/or other materials provided with distribution. In
|
||||
* addition, Licensee may not authorize further sublicense of source of any
|
||||
* portion of the Covered Code, and must include terms to the effect that the
|
||||
* license from Licensee to its licensee is limited to the intellectual
|
||||
* property embodied in the software Licensee provides to its licensee, and
|
||||
* not to intellectual property embodied in modifications its licensee may
|
||||
* make.
|
||||
*
|
||||
* 3.3. Redistribution of Executable. Redistribution in executable form of any
|
||||
* substantial portion of the Covered Code or modification must reproduce the
|
||||
* above Copyright Notice, and the following Disclaimer and Export Compliance
|
||||
* provision in the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3.4. Intel retains all right, title, and interest in and to the Original
|
||||
* Intel Code.
|
||||
*
|
||||
* 3.5. Neither the name Intel nor any other trademark owned or controlled by
|
||||
* Intel shall be used in advertising or otherwise to promote the sale, use or
|
||||
* other dealings in products derived from or relating to the Covered Code
|
||||
* without prior written authorization from Intel.
|
||||
*
|
||||
* 4. Disclaimer and Export Compliance
|
||||
*
|
||||
* 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
|
||||
* HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
|
||||
* IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
|
||||
* INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
|
||||
* UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
|
||||
* PARTICULAR PURPOSE.
|
||||
*
|
||||
* 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
|
||||
* OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
|
||||
* COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
|
||||
* SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
|
||||
* CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
|
||||
* HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
|
||||
* SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
|
||||
* LIMITED REMEDY.
|
||||
*
|
||||
* 4.3. Licensee shall not export, either directly or indirectly, any of this
|
||||
* software or system incorporating such software without first obtaining any
|
||||
* required license or other approval from the U. S. Department of Commerce or
|
||||
* any other agency or department of the United States Government. In the
|
||||
* event Licensee exports any such software from the United States or
|
||||
* re-exports any such software from a foreign destination, Licensee shall
|
||||
* ensure that the distribution and export/re-export of the software is in
|
||||
* compliance with all laws, regulations, orders, or other restrictions of the
|
||||
* U.S. Export Administration Regulations. Licensee agrees that neither it nor
|
||||
* any of its subsidiaries will export/re-export any technical data, process,
|
||||
* software, or service, directly or indirectly, to any country for which the
|
||||
* United States government or any agency thereof requires an export license,
|
||||
* other governmental approval, or letter of assurance, without first obtaining
|
||||
* such license, approval or letter.
|
||||
*
|
||||
*****************************************************************************/
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef __ACHWARE_H__
|
||||
#define __ACHWARE_H__
|
||||
@@ -181,6 +109,43 @@ AcpiHwClearAcpiStatus (
|
||||
void);
|
||||
|
||||
|
||||
/*
|
||||
* hwsleep - sleep/wake support (Legacy sleep registers)
|
||||
*/
|
||||
ACPI_STATUS
|
||||
AcpiHwLegacySleep (
|
||||
UINT8 SleepState);
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiHwLegacyWakePrep (
|
||||
UINT8 SleepState);
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiHwLegacyWake (
|
||||
UINT8 SleepState);
|
||||
|
||||
|
||||
/*
|
||||
* hwesleep - sleep/wake support (Extended FADT-V5 sleep registers)
|
||||
*/
|
||||
void
|
||||
AcpiHwExecuteSleepMethod (
|
||||
char *MethodName,
|
||||
UINT32 IntegerArgument);
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiHwExtendedSleep (
|
||||
UINT8 SleepState);
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiHwExtendedWakePrep (
|
||||
UINT8 SleepState);
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiHwExtendedWake (
|
||||
UINT8 SleepState);
|
||||
|
||||
|
||||
/*
|
||||
* hwvalid - Port I/O with validation
|
||||
*/
|
||||
@@ -202,8 +167,7 @@ AcpiHwWritePort (
|
||||
*/
|
||||
UINT32
|
||||
AcpiHwGetGpeRegisterBit (
|
||||
ACPI_GPE_EVENT_INFO *GpeEventInfo,
|
||||
ACPI_GPE_REGISTER_INFO *GpeRegisterInfo);
|
||||
ACPI_GPE_EVENT_INFO *GpeEventInfo);
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiHwLowSetGpe (
|
||||
@@ -251,21 +215,13 @@ AcpiHwEnableRuntimeGpeBlock (
|
||||
|
||||
|
||||
/*
|
||||
* hwtimer - ACPI Timer prototypes
|
||||
* hwpci - PCI configuration support
|
||||
*/
|
||||
ACPI_STATUS
|
||||
AcpiGetTimerResolution (
|
||||
UINT32 *Resolution);
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiGetTimer (
|
||||
UINT32 *Ticks);
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiGetTimerDuration (
|
||||
UINT32 StartTicks,
|
||||
UINT32 EndTicks,
|
||||
UINT32 *TimeElapsed);
|
||||
AcpiHwDerivePciId (
|
||||
ACPI_PCI_ID *PciId,
|
||||
ACPI_HANDLE RootPciDevice,
|
||||
ACPI_HANDLE PciRegion);
|
||||
|
||||
|
||||
#endif /* __ACHWARE_H__ */
|
||||
|
||||
@@ -4,114 +4,42 @@
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
* 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.
|
||||
*
|
||||
* 2.1. This is your license from Intel Corp. under its intellectual property
|
||||
* rights. You may have additional license terms from the party that provided
|
||||
* you this software, covering your right to use that party's intellectual
|
||||
* property rights.
|
||||
* 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.
|
||||
*
|
||||
* 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
|
||||
* copy of the source code appearing in this file ("Covered Code") an
|
||||
* irrevocable, perpetual, worldwide license under Intel's copyrights in the
|
||||
* base code distributed originally by Intel ("Original Intel Code") to copy,
|
||||
* make derivatives, distribute, use and display any portion of the Covered
|
||||
* Code in any form, with the right to sublicense such rights; and
|
||||
*
|
||||
* 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
|
||||
* license (with the right to sublicense), under only those claims of Intel
|
||||
* patents that are infringed by the Original Intel Code, to make, use, sell,
|
||||
* offer to sell, and import the Covered Code and derivative works thereof
|
||||
* solely to the minimum extent necessary to exercise the above copyright
|
||||
* license, and in no event shall the patent license extend to any additions
|
||||
* to or modifications of the Original Intel Code. No other license or right
|
||||
* is granted directly or by implication, estoppel or otherwise;
|
||||
*
|
||||
* The above copyright and patent license is granted only if the following
|
||||
* conditions are met:
|
||||
*
|
||||
* 3. Conditions
|
||||
*
|
||||
* 3.1. Redistribution of Source with Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification with rights to further distribute source must include
|
||||
* the above Copyright Notice, the above License, this list of Conditions,
|
||||
* and the following Disclaimer and Export Compliance provision. In addition,
|
||||
* Licensee must cause all Covered Code to which Licensee contributes to
|
||||
* contain a file documenting the changes Licensee made to create that Covered
|
||||
* Code and the date of any change. Licensee must include in that file the
|
||||
* documentation of any changes made by any predecessor Licensee. Licensee
|
||||
* must include a prominent statement that the modification is derived,
|
||||
* directly or indirectly, from Original Intel Code.
|
||||
*
|
||||
* 3.2. Redistribution of Source with no Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification without rights to further distribute source must
|
||||
* include the following Disclaimer and Export Compliance provision in the
|
||||
* documentation and/or other materials provided with distribution. In
|
||||
* addition, Licensee may not authorize further sublicense of source of any
|
||||
* portion of the Covered Code, and must include terms to the effect that the
|
||||
* license from Licensee to its licensee is limited to the intellectual
|
||||
* property embodied in the software Licensee provides to its licensee, and
|
||||
* not to intellectual property embodied in modifications its licensee may
|
||||
* make.
|
||||
*
|
||||
* 3.3. Redistribution of Executable. Redistribution in executable form of any
|
||||
* substantial portion of the Covered Code or modification must reproduce the
|
||||
* above Copyright Notice, and the following Disclaimer and Export Compliance
|
||||
* provision in the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3.4. Intel retains all right, title, and interest in and to the Original
|
||||
* Intel Code.
|
||||
*
|
||||
* 3.5. Neither the name Intel nor any other trademark owned or controlled by
|
||||
* Intel shall be used in advertising or otherwise to promote the sale, use or
|
||||
* other dealings in products derived from or relating to the Covered Code
|
||||
* without prior written authorization from Intel.
|
||||
*
|
||||
* 4. Disclaimer and Export Compliance
|
||||
*
|
||||
* 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
|
||||
* HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
|
||||
* IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
|
||||
* INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
|
||||
* UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
|
||||
* PARTICULAR PURPOSE.
|
||||
*
|
||||
* 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
|
||||
* OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
|
||||
* COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
|
||||
* SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
|
||||
* CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
|
||||
* HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
|
||||
* SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
|
||||
* LIMITED REMEDY.
|
||||
*
|
||||
* 4.3. Licensee shall not export, either directly or indirectly, any of this
|
||||
* software or system incorporating such software without first obtaining any
|
||||
* required license or other approval from the U. S. Department of Commerce or
|
||||
* any other agency or department of the United States Government. In the
|
||||
* event Licensee exports any such software from the United States or
|
||||
* re-exports any such software from a foreign destination, Licensee shall
|
||||
* ensure that the distribution and export/re-export of the software is in
|
||||
* compliance with all laws, regulations, orders, or other restrictions of the
|
||||
* U.S. Export Administration Regulations. Licensee agrees that neither it nor
|
||||
* any of its subsidiaries will export/re-export any technical data, process,
|
||||
* software, or service, directly or indirectly, to any country for which the
|
||||
* United States government or any agency thereof requires an export license,
|
||||
* other governmental approval, or letter of assurance, without first obtaining
|
||||
* such license, approval or letter.
|
||||
*
|
||||
*****************************************************************************/
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef __ACINTERP_H__
|
||||
#define __ACINTERP_H__
|
||||
@@ -161,6 +89,10 @@ typedef const struct acpi_exdump_info
|
||||
#define ACPI_EXD_PACKAGE 11
|
||||
#define ACPI_EXD_FIELD 12
|
||||
#define ACPI_EXD_REFERENCE 13
|
||||
#define ACPI_EXD_LIST 14 /* Operand object list */
|
||||
#define ACPI_EXD_HDLR_LIST 15 /* Address Handler list */
|
||||
#define ACPI_EXD_RGN_LIST 16 /* Region list */
|
||||
#define ACPI_EXD_NODE 17 /* Namespace Node */
|
||||
|
||||
/* restore default alignment */
|
||||
|
||||
@@ -684,15 +616,7 @@ void
|
||||
AcpiExExitInterpreter (
|
||||
void);
|
||||
|
||||
void
|
||||
AcpiExReacquireInterpreter (
|
||||
void);
|
||||
|
||||
void
|
||||
AcpiExRelinquishInterpreter (
|
||||
void);
|
||||
|
||||
void
|
||||
BOOLEAN
|
||||
AcpiExTruncateFor32bitTable (
|
||||
ACPI_OPERAND_OBJECT *ObjDesc);
|
||||
|
||||
@@ -714,6 +638,10 @@ AcpiExIntegerToString (
|
||||
char *Dest,
|
||||
UINT64 Value);
|
||||
|
||||
BOOLEAN
|
||||
AcpiIsValidSpaceId (
|
||||
UINT8 SpaceId);
|
||||
|
||||
|
||||
/*
|
||||
* exregion - default OpRegion handlers
|
||||
|
||||
@@ -4,114 +4,42 @@
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
* 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.
|
||||
*
|
||||
* 2.1. This is your license from Intel Corp. under its intellectual property
|
||||
* rights. You may have additional license terms from the party that provided
|
||||
* you this software, covering your right to use that party's intellectual
|
||||
* property rights.
|
||||
* 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.
|
||||
*
|
||||
* 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
|
||||
* copy of the source code appearing in this file ("Covered Code") an
|
||||
* irrevocable, perpetual, worldwide license under Intel's copyrights in the
|
||||
* base code distributed originally by Intel ("Original Intel Code") to copy,
|
||||
* make derivatives, distribute, use and display any portion of the Covered
|
||||
* Code in any form, with the right to sublicense such rights; and
|
||||
*
|
||||
* 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
|
||||
* license (with the right to sublicense), under only those claims of Intel
|
||||
* patents that are infringed by the Original Intel Code, to make, use, sell,
|
||||
* offer to sell, and import the Covered Code and derivative works thereof
|
||||
* solely to the minimum extent necessary to exercise the above copyright
|
||||
* license, and in no event shall the patent license extend to any additions
|
||||
* to or modifications of the Original Intel Code. No other license or right
|
||||
* is granted directly or by implication, estoppel or otherwise;
|
||||
*
|
||||
* The above copyright and patent license is granted only if the following
|
||||
* conditions are met:
|
||||
*
|
||||
* 3. Conditions
|
||||
*
|
||||
* 3.1. Redistribution of Source with Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification with rights to further distribute source must include
|
||||
* the above Copyright Notice, the above License, this list of Conditions,
|
||||
* and the following Disclaimer and Export Compliance provision. In addition,
|
||||
* Licensee must cause all Covered Code to which Licensee contributes to
|
||||
* contain a file documenting the changes Licensee made to create that Covered
|
||||
* Code and the date of any change. Licensee must include in that file the
|
||||
* documentation of any changes made by any predecessor Licensee. Licensee
|
||||
* must include a prominent statement that the modification is derived,
|
||||
* directly or indirectly, from Original Intel Code.
|
||||
*
|
||||
* 3.2. Redistribution of Source with no Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification without rights to further distribute source must
|
||||
* include the following Disclaimer and Export Compliance provision in the
|
||||
* documentation and/or other materials provided with distribution. In
|
||||
* addition, Licensee may not authorize further sublicense of source of any
|
||||
* portion of the Covered Code, and must include terms to the effect that the
|
||||
* license from Licensee to its licensee is limited to the intellectual
|
||||
* property embodied in the software Licensee provides to its licensee, and
|
||||
* not to intellectual property embodied in modifications its licensee may
|
||||
* make.
|
||||
*
|
||||
* 3.3. Redistribution of Executable. Redistribution in executable form of any
|
||||
* substantial portion of the Covered Code or modification must reproduce the
|
||||
* above Copyright Notice, and the following Disclaimer and Export Compliance
|
||||
* provision in the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3.4. Intel retains all right, title, and interest in and to the Original
|
||||
* Intel Code.
|
||||
*
|
||||
* 3.5. Neither the name Intel nor any other trademark owned or controlled by
|
||||
* Intel shall be used in advertising or otherwise to promote the sale, use or
|
||||
* other dealings in products derived from or relating to the Covered Code
|
||||
* without prior written authorization from Intel.
|
||||
*
|
||||
* 4. Disclaimer and Export Compliance
|
||||
*
|
||||
* 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
|
||||
* HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
|
||||
* IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
|
||||
* INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
|
||||
* UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
|
||||
* PARTICULAR PURPOSE.
|
||||
*
|
||||
* 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
|
||||
* OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
|
||||
* COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
|
||||
* SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
|
||||
* CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
|
||||
* HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
|
||||
* SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
|
||||
* LIMITED REMEDY.
|
||||
*
|
||||
* 4.3. Licensee shall not export, either directly or indirectly, any of this
|
||||
* software or system incorporating such software without first obtaining any
|
||||
* required license or other approval from the U. S. Department of Commerce or
|
||||
* any other agency or department of the United States Government. In the
|
||||
* event Licensee exports any such software from the United States or
|
||||
* re-exports any such software from a foreign destination, Licensee shall
|
||||
* ensure that the distribution and export/re-export of the software is in
|
||||
* compliance with all laws, regulations, orders, or other restrictions of the
|
||||
* U.S. Export Administration Regulations. Licensee agrees that neither it nor
|
||||
* any of its subsidiaries will export/re-export any technical data, process,
|
||||
* software, or service, directly or indirectly, to any country for which the
|
||||
* United States government or any agency thereof requires an export license,
|
||||
* other governmental approval, or letter of assurance, without first obtaining
|
||||
* such license, approval or letter.
|
||||
*
|
||||
*****************************************************************************/
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef __ACLOCAL_H__
|
||||
#define __ACLOCAL_H__
|
||||
@@ -126,7 +54,7 @@ typedef UINT32 ACPI_MUTEX_HANDLE;
|
||||
|
||||
/* Total number of aml opcodes defined */
|
||||
|
||||
#define AML_NUM_OPCODES 0x7F
|
||||
#define AML_NUM_OPCODES 0x81
|
||||
|
||||
|
||||
/* Forward declarations */
|
||||
@@ -165,25 +93,6 @@ union acpi_parse_object;
|
||||
#define ACPI_MAX_MUTEX 7
|
||||
#define ACPI_NUM_MUTEX ACPI_MAX_MUTEX+1
|
||||
|
||||
#if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER)
|
||||
#ifdef DEFINE_ACPI_GLOBALS
|
||||
|
||||
/* Debug names for the mutexes above */
|
||||
|
||||
static char *AcpiGbl_MutexNames[ACPI_NUM_MUTEX] =
|
||||
{
|
||||
"ACPI_MTX_Interpreter",
|
||||
"ACPI_MTX_Namespace",
|
||||
"ACPI_MTX_Tables",
|
||||
"ACPI_MTX_Events",
|
||||
"ACPI_MTX_Caches",
|
||||
"ACPI_MTX_Memory",
|
||||
"ACPI_MTX_CommandComplete",
|
||||
"ACPI_MTX_CommandReady"
|
||||
};
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
/* Lock structure for reader/writer interfaces */
|
||||
|
||||
@@ -304,7 +213,6 @@ typedef struct acpi_namespace_node
|
||||
#define ANOBJ_IS_EXTERNAL 0x08 /* iASL only: This object created via External() */
|
||||
#define ANOBJ_METHOD_NO_RETVAL 0x10 /* iASL only: Method has no return value */
|
||||
#define ANOBJ_METHOD_SOME_NO_RETVAL 0x20 /* iASL only: Method has at least one return value */
|
||||
#define ANOBJ_IS_BIT_OFFSET 0x40 /* iASL only: Reference is a bit offset */
|
||||
#define ANOBJ_IS_REFERENCED 0x80 /* iASL only: Object was referenced */
|
||||
|
||||
|
||||
@@ -377,12 +285,17 @@ typedef struct acpi_create_field_info
|
||||
ACPI_NAMESPACE_NODE *FieldNode;
|
||||
ACPI_NAMESPACE_NODE *RegisterNode;
|
||||
ACPI_NAMESPACE_NODE *DataRegisterNode;
|
||||
ACPI_NAMESPACE_NODE *ConnectionNode;
|
||||
UINT8 *ResourceBuffer;
|
||||
UINT32 BankValue;
|
||||
UINT32 FieldBitPosition;
|
||||
UINT32 FieldBitLength;
|
||||
UINT16 ResourceLength;
|
||||
UINT16 PinNumberIndex;
|
||||
UINT8 FieldFlags;
|
||||
UINT8 Attribute;
|
||||
UINT8 FieldType;
|
||||
UINT8 AccessLength;
|
||||
|
||||
} ACPI_CREATE_FIELD_INFO;
|
||||
|
||||
@@ -393,7 +306,7 @@ ACPI_STATUS (*ACPI_INTERNAL_METHOD) (
|
||||
|
||||
|
||||
/*
|
||||
* Bitmapped ACPI types. Used internally only
|
||||
* Bitmapped ACPI types. Used internally only
|
||||
*/
|
||||
#define ACPI_BTYPE_ANY 0x00000000
|
||||
#define ACPI_BTYPE_INTEGER 0x00000001
|
||||
@@ -423,6 +336,7 @@ ACPI_STATUS (*ACPI_INTERNAL_METHOD) (
|
||||
#define ACPI_BTYPE_OBJECTS_AND_REFS 0x0001FFFF /* ARG or LOCAL */
|
||||
#define ACPI_BTYPE_ALL_OBJECTS 0x0000FFFF
|
||||
|
||||
#pragma pack(1)
|
||||
|
||||
/*
|
||||
* Information structure for ACPI predefined names.
|
||||
@@ -435,7 +349,7 @@ ACPI_STATUS (*ACPI_INTERNAL_METHOD) (
|
||||
typedef struct acpi_name_info
|
||||
{
|
||||
char Name[ACPI_NAME_SIZE];
|
||||
UINT8 ParamCount;
|
||||
UINT16 ArgumentList;
|
||||
UINT8 ExpectedBtypes;
|
||||
|
||||
} ACPI_NAME_INFO;
|
||||
@@ -450,7 +364,8 @@ typedef struct acpi_name_info
|
||||
|
||||
/*
|
||||
* Used for ACPI_PTYPE1_FIXED, ACPI_PTYPE1_VAR, ACPI_PTYPE2,
|
||||
* ACPI_PTYPE2_MIN, ACPI_PTYPE2_PKG_COUNT, ACPI_PTYPE2_COUNT
|
||||
* ACPI_PTYPE2_MIN, ACPI_PTYPE2_PKG_COUNT, ACPI_PTYPE2_COUNT,
|
||||
* ACPI_PTYPE2_FIX_VAR
|
||||
*/
|
||||
typedef struct acpi_package_info
|
||||
{
|
||||
@@ -459,7 +374,7 @@ typedef struct acpi_package_info
|
||||
UINT8 Count1;
|
||||
UINT8 ObjectType2;
|
||||
UINT8 Count2;
|
||||
UINT8 Reserved;
|
||||
UINT16 Reserved;
|
||||
|
||||
} ACPI_PACKAGE_INFO;
|
||||
|
||||
@@ -470,6 +385,7 @@ typedef struct acpi_package_info2
|
||||
UINT8 Type;
|
||||
UINT8 Count;
|
||||
UINT8 ObjectType[4];
|
||||
UINT8 Reserved;
|
||||
|
||||
} ACPI_PACKAGE_INFO2;
|
||||
|
||||
@@ -481,7 +397,7 @@ typedef struct acpi_package_info3
|
||||
UINT8 Count;
|
||||
UINT8 ObjectType[2];
|
||||
UINT8 TailObjectType;
|
||||
UINT8 Reserved;
|
||||
UINT16 Reserved;
|
||||
|
||||
} ACPI_PACKAGE_INFO3;
|
||||
|
||||
@@ -494,22 +410,25 @@ typedef union acpi_predefined_info
|
||||
|
||||
} ACPI_PREDEFINED_INFO;
|
||||
|
||||
/* Reset to default packing */
|
||||
|
||||
/* Data block used during object validation */
|
||||
#pragma pack()
|
||||
|
||||
typedef struct acpi_predefined_data
|
||||
|
||||
/* Return object auto-repair info */
|
||||
|
||||
typedef ACPI_STATUS (*ACPI_OBJECT_CONVERTER) (
|
||||
union acpi_operand_object *OriginalObject,
|
||||
union acpi_operand_object **ConvertedObject);
|
||||
|
||||
typedef struct acpi_simple_repair_info
|
||||
{
|
||||
char *Pathname;
|
||||
const ACPI_PREDEFINED_INFO *Predefined;
|
||||
union acpi_operand_object *ParentPackage;
|
||||
UINT32 Flags;
|
||||
UINT8 NodeFlags;
|
||||
char Name[ACPI_NAME_SIZE];
|
||||
UINT32 UnexpectedBtypes;
|
||||
UINT32 PackageIndex;
|
||||
ACPI_OBJECT_CONVERTER ObjectConverter;
|
||||
|
||||
} ACPI_PREDEFINED_DATA;
|
||||
|
||||
/* Defines for Flags field above */
|
||||
|
||||
#define ACPI_OBJECT_REPAIRED 1
|
||||
} ACPI_SIMPLE_REPAIR_INFO;
|
||||
|
||||
|
||||
/*
|
||||
@@ -535,20 +454,46 @@ typedef struct acpi_predefined_data
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
/* Dispatch info for each host-installed SCI handler */
|
||||
|
||||
typedef struct acpi_sci_handler_info
|
||||
{
|
||||
struct acpi_sci_handler_info *Next;
|
||||
ACPI_SCI_HANDLER Address; /* Address of handler */
|
||||
void *Context; /* Context to be passed to handler */
|
||||
|
||||
} ACPI_SCI_HANDLER_INFO;
|
||||
|
||||
/* Dispatch info for each GPE -- either a method or handler, cannot be both */
|
||||
|
||||
typedef struct acpi_handler_info
|
||||
typedef struct acpi_gpe_handler_info
|
||||
{
|
||||
ACPI_EVENT_HANDLER Address; /* Address of handler, if any */
|
||||
ACPI_GPE_HANDLER Address; /* Address of handler, if any */
|
||||
void *Context; /* Context to be passed to handler */
|
||||
ACPI_NAMESPACE_NODE *MethodNode; /* Method node for this GPE level (saved) */
|
||||
UINT8 OriginalFlags; /* Original (pre-handler) GPE info */
|
||||
BOOLEAN OriginallyEnabled; /* True if GPE was originally enabled */
|
||||
|
||||
} ACPI_HANDLER_INFO;
|
||||
} ACPI_GPE_HANDLER_INFO;
|
||||
|
||||
/* Notify info for implicit notify, multiple device objects */
|
||||
|
||||
typedef struct acpi_gpe_notify_info
|
||||
{
|
||||
ACPI_NAMESPACE_NODE *DeviceNode; /* Device to be notified */
|
||||
struct acpi_gpe_notify_info *Next;
|
||||
|
||||
} ACPI_GPE_NOTIFY_INFO;
|
||||
|
||||
/*
|
||||
* GPE dispatch info. At any time, the GPE can have at most one type
|
||||
* of dispatch - Method, Handler, or Implicit Notify.
|
||||
*/
|
||||
typedef union acpi_gpe_dispatch_info
|
||||
{
|
||||
ACPI_NAMESPACE_NODE *MethodNode; /* Method node for this GPE level */
|
||||
struct acpi_handler_info *Handler;
|
||||
ACPI_GPE_HANDLER_INFO *Handler; /* Installed GPE handler */
|
||||
ACPI_GPE_NOTIFY_INFO *NotifyList; /* List of _PRW devices for implicit notifies */
|
||||
|
||||
} ACPI_GPE_DISPATCH_INFO;
|
||||
|
||||
@@ -558,7 +503,7 @@ typedef union acpi_gpe_dispatch_info
|
||||
*/
|
||||
typedef struct acpi_gpe_event_info
|
||||
{
|
||||
union acpi_gpe_dispatch_info Dispatch; /* Either Method or Handler */
|
||||
union acpi_gpe_dispatch_info Dispatch; /* Either Method, Handler, or NotifyList */
|
||||
struct acpi_gpe_register_info *RegisterInfo; /* Backpointer to register info */
|
||||
UINT8 Flags; /* Misc info about this GPE */
|
||||
UINT8 GpeNumber; /* This GPE */
|
||||
@@ -572,9 +517,9 @@ typedef struct acpi_gpe_register_info
|
||||
{
|
||||
ACPI_GENERIC_ADDRESS StatusAddress; /* Address of status reg */
|
||||
ACPI_GENERIC_ADDRESS EnableAddress; /* Address of enable reg */
|
||||
UINT16 BaseGpeNumber; /* Base GPE number for this register */
|
||||
UINT8 EnableForWake; /* GPEs to keep enabled when sleeping */
|
||||
UINT8 EnableForRun; /* GPEs to keep enabled when running */
|
||||
UINT8 BaseGpeNumber; /* Base GPE number for this register */
|
||||
|
||||
} ACPI_GPE_REGISTER_INFO;
|
||||
|
||||
@@ -590,10 +535,12 @@ typedef struct acpi_gpe_block_info
|
||||
struct acpi_gpe_xrupt_info *XruptBlock; /* Backpointer to interrupt block */
|
||||
ACPI_GPE_REGISTER_INFO *RegisterInfo; /* One per GPE register pair */
|
||||
ACPI_GPE_EVENT_INFO *EventInfo; /* One for each GPE */
|
||||
ACPI_GENERIC_ADDRESS BlockAddress; /* Base address of the block */
|
||||
UINT64 Address; /* Base address of the block */
|
||||
UINT32 RegisterCount; /* Number of register pairs in block */
|
||||
UINT16 GpeCount; /* Number of individual GPEs in block */
|
||||
UINT8 BlockBaseNumber;/* Base GPE number for this block */
|
||||
UINT16 BlockBaseNumber;/* Base GPE number for this block */
|
||||
UINT8 SpaceId;
|
||||
BOOLEAN Initialized; /* TRUE if this block is initialized */
|
||||
|
||||
} ACPI_GPE_BLOCK_INFO;
|
||||
|
||||
@@ -614,7 +561,6 @@ typedef struct acpi_gpe_walk_info
|
||||
ACPI_GPE_BLOCK_INFO *GpeBlock;
|
||||
UINT16 Count;
|
||||
ACPI_OWNER_ID OwnerId;
|
||||
BOOLEAN EnableThisGpe;
|
||||
BOOLEAN ExecuteByOwnerId;
|
||||
|
||||
} ACPI_GPE_WALK_INFO;
|
||||
@@ -758,7 +704,7 @@ typedef struct acpi_pscope_state
|
||||
|
||||
|
||||
/*
|
||||
* Thread state - one per thread across multiple walk states. Multiple walk
|
||||
* Thread state - one per thread across multiple walk states. Multiple walk
|
||||
* states are created when there are nested control methods executing.
|
||||
*/
|
||||
typedef struct acpi_thread_state
|
||||
@@ -794,6 +740,15 @@ ACPI_STATUS (*ACPI_PARSE_UPWARDS) (
|
||||
struct acpi_walk_state *WalkState);
|
||||
|
||||
|
||||
/* Global handlers for AML Notifies */
|
||||
|
||||
typedef struct acpi_global_notify_handler
|
||||
{
|
||||
ACPI_NOTIFY_HANDLER Handler;
|
||||
void *Context;
|
||||
|
||||
} ACPI_GLOBAL_NOTIFY_HANDLER;
|
||||
|
||||
/*
|
||||
* Notify info - used to pass info to the deferred notify
|
||||
* handler/dispatcher.
|
||||
@@ -801,8 +756,10 @@ ACPI_STATUS (*ACPI_PARSE_UPWARDS) (
|
||||
typedef struct acpi_notify_info
|
||||
{
|
||||
ACPI_STATE_COMMON
|
||||
UINT8 HandlerListId;
|
||||
ACPI_NAMESPACE_NODE *Node;
|
||||
union acpi_operand_object *HandlerObj;
|
||||
union acpi_operand_object *HandlerListHead;
|
||||
ACPI_GLOBAL_NOTIFY_HANDLER *Global;
|
||||
|
||||
} ACPI_NOTIFY_INFO;
|
||||
|
||||
@@ -834,6 +791,17 @@ typedef
|
||||
ACPI_STATUS (*ACPI_EXECUTE_OP) (
|
||||
struct acpi_walk_state *WalkState);
|
||||
|
||||
/* Address Range info block */
|
||||
|
||||
typedef struct acpi_address_range
|
||||
{
|
||||
struct acpi_address_range *Next;
|
||||
ACPI_NAMESPACE_NODE *RegionNode;
|
||||
ACPI_PHYSICAL_ADDRESS StartAddress;
|
||||
ACPI_PHYSICAL_ADDRESS EndAddress;
|
||||
|
||||
} ACPI_ADDRESS_RANGE;
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
*
|
||||
@@ -858,6 +826,17 @@ typedef struct acpi_opcode_info
|
||||
|
||||
} ACPI_OPCODE_INFO;
|
||||
|
||||
/* Structure for Resource Tag information */
|
||||
|
||||
typedef struct acpi_tag_info
|
||||
{
|
||||
UINT32 BitOffset;
|
||||
UINT32 BitLength;
|
||||
|
||||
} ACPI_TAG_INFO;
|
||||
|
||||
/* Value associated with the parse object */
|
||||
|
||||
typedef union acpi_parse_value
|
||||
{
|
||||
UINT64 Integer; /* Integer constant (Up to 64 bits) */
|
||||
@@ -866,6 +845,7 @@ typedef union acpi_parse_value
|
||||
UINT8 *Buffer; /* buffer or string */
|
||||
char *Name; /* NULL terminated string */
|
||||
union acpi_parse_object *Arg; /* arguments and contained ops */
|
||||
ACPI_TAG_INFO Tag; /* Resource descriptor tag info */
|
||||
|
||||
} ACPI_PARSE_VALUE;
|
||||
|
||||
@@ -889,18 +869,24 @@ typedef union acpi_parse_value
|
||||
ACPI_DISASM_ONLY_MEMBERS (\
|
||||
UINT8 DisasmFlags; /* Used during AML disassembly */\
|
||||
UINT8 DisasmOpcode; /* Subtype used for disassembly */\
|
||||
char *OperatorSymbol;/* Used for C-style operator name strings */\
|
||||
char AmlOpName[16]) /* Op name (debug only) */
|
||||
|
||||
|
||||
#define ACPI_DASM_BUFFER 0x00
|
||||
#define ACPI_DASM_RESOURCE 0x01
|
||||
#define ACPI_DASM_STRING 0x02
|
||||
#define ACPI_DASM_UNICODE 0x03
|
||||
#define ACPI_DASM_EISAID 0x04
|
||||
#define ACPI_DASM_MATCHOP 0x05
|
||||
#define ACPI_DASM_LNOT_PREFIX 0x06
|
||||
#define ACPI_DASM_LNOT_SUFFIX 0x07
|
||||
#define ACPI_DASM_IGNORE 0x08
|
||||
/* Flags for DisasmFlags field above */
|
||||
|
||||
#define ACPI_DASM_BUFFER 0x00 /* Buffer is a simple data buffer */
|
||||
#define ACPI_DASM_RESOURCE 0x01 /* Buffer is a Resource Descriptor */
|
||||
#define ACPI_DASM_STRING 0x02 /* Buffer is a ASCII string */
|
||||
#define ACPI_DASM_UNICODE 0x03 /* Buffer is a Unicode string */
|
||||
#define ACPI_DASM_PLD_METHOD 0x04 /* Buffer is a _PLD method bit-packed buffer */
|
||||
#define ACPI_DASM_UUID 0x05 /* Buffer is a UUID/GUID */
|
||||
#define ACPI_DASM_EISAID 0x06 /* Integer is an EISAID */
|
||||
#define ACPI_DASM_MATCHOP 0x07 /* Parent opcode is a Match() operator */
|
||||
#define ACPI_DASM_LNOT_PREFIX 0x08 /* Start of a LNotEqual (etc.) pair of opcodes */
|
||||
#define ACPI_DASM_LNOT_SUFFIX 0x09 /* End of a LNotEqual (etc.) pair of opcodes */
|
||||
#define ACPI_DASM_HID_STRING 0x0A /* String is a _HID or _CID */
|
||||
#define ACPI_DASM_IGNORE 0x0B /* Not used at this time */
|
||||
|
||||
/*
|
||||
* Generic operation (for example: If, While, Store)
|
||||
@@ -1004,7 +990,10 @@ typedef struct acpi_parse_state
|
||||
#define ACPI_PARSEOP_IGNORE 0x01
|
||||
#define ACPI_PARSEOP_PARAMLIST 0x02
|
||||
#define ACPI_PARSEOP_EMPTY_TERMLIST 0x04
|
||||
#define ACPI_PARSEOP_PREDEF_CHECKED 0x08
|
||||
#define ACPI_PARSEOP_SPECIAL 0x10
|
||||
#define ACPI_PARSEOP_COMPOUND 0x20
|
||||
#define ACPI_PARSEOP_ASSIGNMENT 0x40
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
@@ -1080,6 +1069,7 @@ typedef struct acpi_bit_register_info
|
||||
ACPI_BITMASK_POWER_BUTTON_STATUS | \
|
||||
ACPI_BITMASK_SLEEP_BUTTON_STATUS | \
|
||||
ACPI_BITMASK_RT_CLOCK_STATUS | \
|
||||
ACPI_BITMASK_PCIEXP_WAKE_STATUS | \
|
||||
ACPI_BITMASK_WAKE_STATUS)
|
||||
|
||||
#define ACPI_BITMASK_TIMER_ENABLE 0x0001
|
||||
@@ -1127,26 +1117,23 @@ typedef struct acpi_bit_register_info
|
||||
|
||||
/* Structs and definitions for _OSI support and I/O port validation */
|
||||
|
||||
#define ACPI_OSI_WIN_2000 0x01
|
||||
#define ACPI_OSI_WIN_XP 0x02
|
||||
#define ACPI_OSI_WIN_XP_SP1 0x03
|
||||
#define ACPI_OSI_WINSRV_2003 0x04
|
||||
#define ACPI_OSI_WIN_XP_SP2 0x05
|
||||
#define ACPI_OSI_WINSRV_2003_SP1 0x06
|
||||
#define ACPI_OSI_WIN_VISTA 0x07
|
||||
#define ACPI_OSI_WINSRV_2008 0x08
|
||||
#define ACPI_OSI_WIN_VISTA_SP1 0x09
|
||||
#define ACPI_OSI_WIN_7 0x0A
|
||||
|
||||
#define ACPI_ALWAYS_ILLEGAL 0x00
|
||||
|
||||
typedef struct acpi_interface_info
|
||||
{
|
||||
char *Name;
|
||||
UINT8 Value;
|
||||
char *Name;
|
||||
struct acpi_interface_info *Next;
|
||||
UINT8 Flags;
|
||||
UINT8 Value;
|
||||
|
||||
} ACPI_INTERFACE_INFO;
|
||||
|
||||
#define ACPI_OSI_INVALID 0x01
|
||||
#define ACPI_OSI_DYNAMIC 0x02
|
||||
#define ACPI_OSI_FEATURE 0x04
|
||||
#define ACPI_OSI_DEFAULT_INVALID 0x08
|
||||
#define ACPI_OSI_OPTIONAL_FEATURE (ACPI_OSI_FEATURE | ACPI_OSI_DEFAULT_INVALID | ACPI_OSI_INVALID)
|
||||
|
||||
typedef struct acpi_port_info
|
||||
{
|
||||
char *Name;
|
||||
@@ -1189,7 +1176,7 @@ typedef struct acpi_port_info
|
||||
#define ACPI_RESOURCE_NAME_END_DEPENDENT 0x38
|
||||
#define ACPI_RESOURCE_NAME_IO 0x40
|
||||
#define ACPI_RESOURCE_NAME_FIXED_IO 0x48
|
||||
#define ACPI_RESOURCE_NAME_RESERVED_S1 0x50
|
||||
#define ACPI_RESOURCE_NAME_FIXED_DMA 0x50
|
||||
#define ACPI_RESOURCE_NAME_RESERVED_S2 0x58
|
||||
#define ACPI_RESOURCE_NAME_RESERVED_S3 0x60
|
||||
#define ACPI_RESOURCE_NAME_RESERVED_S4 0x68
|
||||
@@ -1211,7 +1198,9 @@ typedef struct acpi_port_info
|
||||
#define ACPI_RESOURCE_NAME_EXTENDED_IRQ 0x89
|
||||
#define ACPI_RESOURCE_NAME_ADDRESS64 0x8A
|
||||
#define ACPI_RESOURCE_NAME_EXTENDED_ADDRESS64 0x8B
|
||||
#define ACPI_RESOURCE_NAME_LARGE_MAX 0x8B
|
||||
#define ACPI_RESOURCE_NAME_GPIO 0x8C
|
||||
#define ACPI_RESOURCE_NAME_SERIAL_BUS 0x8E
|
||||
#define ACPI_RESOURCE_NAME_LARGE_MAX 0x8E
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
@@ -1236,14 +1225,25 @@ typedef struct acpi_external_list
|
||||
struct acpi_external_list *Next;
|
||||
UINT32 Value;
|
||||
UINT16 Length;
|
||||
UINT16 Flags;
|
||||
UINT8 Type;
|
||||
UINT8 Flags;
|
||||
|
||||
} ACPI_EXTERNAL_LIST;
|
||||
|
||||
/* Values for Flags field above */
|
||||
|
||||
#define ACPI_IPATH_ALLOCATED 0x01
|
||||
#define ACPI_EXT_RESOLVED_REFERENCE 0x01 /* Object was resolved during cross ref */
|
||||
#define ACPI_EXT_ORIGIN_FROM_FILE 0x02 /* External came from a file */
|
||||
#define ACPI_EXT_INTERNAL_PATH_ALLOCATED 0x04 /* Deallocate internal path on completion */
|
||||
#define ACPI_EXT_EXTERNAL_EMITTED 0x08 /* External() statement has been emitted */
|
||||
|
||||
|
||||
typedef struct acpi_external_file
|
||||
{
|
||||
char *Path;
|
||||
struct acpi_external_file *Next;
|
||||
|
||||
} ACPI_EXTERNAL_FILE;
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
@@ -1254,10 +1254,11 @@ typedef struct acpi_external_list
|
||||
|
||||
typedef struct acpi_db_method_info
|
||||
{
|
||||
ACPI_HANDLE Method;
|
||||
ACPI_HANDLE MainThreadGate;
|
||||
ACPI_HANDLE ThreadCompleteGate;
|
||||
ACPI_HANDLE InfoGate;
|
||||
UINT32 *Threads;
|
||||
ACPI_THREAD_ID *Threads;
|
||||
UINT32 NumThreads;
|
||||
UINT32 NumCreated;
|
||||
UINT32 NumCompleted;
|
||||
@@ -1265,8 +1266,9 @@ typedef struct acpi_db_method_info
|
||||
char *Name;
|
||||
UINT32 Flags;
|
||||
UINT32 NumLoops;
|
||||
char Pathname[128];
|
||||
char Pathname[ACPI_DB_LINE_BUFFER_SIZE];
|
||||
char **Args;
|
||||
ACPI_OBJECT_TYPE *Types;
|
||||
|
||||
/*
|
||||
* Arguments to be passed to method for the command
|
||||
@@ -1275,6 +1277,7 @@ typedef struct acpi_db_method_info
|
||||
* Index of current thread inside all them created.
|
||||
*/
|
||||
char InitArgs;
|
||||
ACPI_OBJECT_TYPE ArgTypes[4];
|
||||
char *Arguments[4];
|
||||
char NumThreadsStr[11];
|
||||
char IdOfThreadStr[11];
|
||||
@@ -1290,6 +1293,7 @@ typedef struct acpi_integrity_info
|
||||
} ACPI_INTEGRITY_INFO;
|
||||
|
||||
|
||||
#define ACPI_DB_DISABLE_OUTPUT 0x00
|
||||
#define ACPI_DB_REDIRECTABLE_OUTPUT 0x01
|
||||
#define ACPI_DB_CONSOLE_OUTPUT 0x02
|
||||
#define ACPI_DB_DUPLICATE_OUTPUT 0x03
|
||||
@@ -1336,4 +1340,34 @@ typedef struct acpi_debug_mem_block
|
||||
#define ACPI_NUM_MEM_LISTS 2
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
*
|
||||
* Info/help support
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
typedef struct ah_predefined_name
|
||||
{
|
||||
char *Name;
|
||||
char *Description;
|
||||
#ifndef ACPI_ASL_COMPILER
|
||||
char *Action;
|
||||
#endif
|
||||
|
||||
} AH_PREDEFINED_NAME;
|
||||
|
||||
typedef struct ah_device_id
|
||||
{
|
||||
char *Name;
|
||||
char *Description;
|
||||
|
||||
} AH_DEVICE_ID;
|
||||
|
||||
typedef struct ah_uuid
|
||||
{
|
||||
char *Description;
|
||||
char *String;
|
||||
|
||||
} AH_UUID;
|
||||
|
||||
#endif /* __ACLOCAL_H__ */
|
||||
|
||||
@@ -4,114 +4,42 @@
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
* 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.
|
||||
*
|
||||
* 2.1. This is your license from Intel Corp. under its intellectual property
|
||||
* rights. You may have additional license terms from the party that provided
|
||||
* you this software, covering your right to use that party's intellectual
|
||||
* property rights.
|
||||
* 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.
|
||||
*
|
||||
* 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
|
||||
* copy of the source code appearing in this file ("Covered Code") an
|
||||
* irrevocable, perpetual, worldwide license under Intel's copyrights in the
|
||||
* base code distributed originally by Intel ("Original Intel Code") to copy,
|
||||
* make derivatives, distribute, use and display any portion of the Covered
|
||||
* Code in any form, with the right to sublicense such rights; and
|
||||
*
|
||||
* 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
|
||||
* license (with the right to sublicense), under only those claims of Intel
|
||||
* patents that are infringed by the Original Intel Code, to make, use, sell,
|
||||
* offer to sell, and import the Covered Code and derivative works thereof
|
||||
* solely to the minimum extent necessary to exercise the above copyright
|
||||
* license, and in no event shall the patent license extend to any additions
|
||||
* to or modifications of the Original Intel Code. No other license or right
|
||||
* is granted directly or by implication, estoppel or otherwise;
|
||||
*
|
||||
* The above copyright and patent license is granted only if the following
|
||||
* conditions are met:
|
||||
*
|
||||
* 3. Conditions
|
||||
*
|
||||
* 3.1. Redistribution of Source with Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification with rights to further distribute source must include
|
||||
* the above Copyright Notice, the above License, this list of Conditions,
|
||||
* and the following Disclaimer and Export Compliance provision. In addition,
|
||||
* Licensee must cause all Covered Code to which Licensee contributes to
|
||||
* contain a file documenting the changes Licensee made to create that Covered
|
||||
* Code and the date of any change. Licensee must include in that file the
|
||||
* documentation of any changes made by any predecessor Licensee. Licensee
|
||||
* must include a prominent statement that the modification is derived,
|
||||
* directly or indirectly, from Original Intel Code.
|
||||
*
|
||||
* 3.2. Redistribution of Source with no Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification without rights to further distribute source must
|
||||
* include the following Disclaimer and Export Compliance provision in the
|
||||
* documentation and/or other materials provided with distribution. In
|
||||
* addition, Licensee may not authorize further sublicense of source of any
|
||||
* portion of the Covered Code, and must include terms to the effect that the
|
||||
* license from Licensee to its licensee is limited to the intellectual
|
||||
* property embodied in the software Licensee provides to its licensee, and
|
||||
* not to intellectual property embodied in modifications its licensee may
|
||||
* make.
|
||||
*
|
||||
* 3.3. Redistribution of Executable. Redistribution in executable form of any
|
||||
* substantial portion of the Covered Code or modification must reproduce the
|
||||
* above Copyright Notice, and the following Disclaimer and Export Compliance
|
||||
* provision in the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3.4. Intel retains all right, title, and interest in and to the Original
|
||||
* Intel Code.
|
||||
*
|
||||
* 3.5. Neither the name Intel nor any other trademark owned or controlled by
|
||||
* Intel shall be used in advertising or otherwise to promote the sale, use or
|
||||
* other dealings in products derived from or relating to the Covered Code
|
||||
* without prior written authorization from Intel.
|
||||
*
|
||||
* 4. Disclaimer and Export Compliance
|
||||
*
|
||||
* 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
|
||||
* HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
|
||||
* IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
|
||||
* INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
|
||||
* UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
|
||||
* PARTICULAR PURPOSE.
|
||||
*
|
||||
* 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
|
||||
* OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
|
||||
* COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
|
||||
* SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
|
||||
* CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
|
||||
* HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
|
||||
* SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
|
||||
* LIMITED REMEDY.
|
||||
*
|
||||
* 4.3. Licensee shall not export, either directly or indirectly, any of this
|
||||
* software or system incorporating such software without first obtaining any
|
||||
* required license or other approval from the U. S. Department of Commerce or
|
||||
* any other agency or department of the United States Government. In the
|
||||
* event Licensee exports any such software from the United States or
|
||||
* re-exports any such software from a foreign destination, Licensee shall
|
||||
* ensure that the distribution and export/re-export of the software is in
|
||||
* compliance with all laws, regulations, orders, or other restrictions of the
|
||||
* U.S. Export Administration Regulations. Licensee agrees that neither it nor
|
||||
* any of its subsidiaries will export/re-export any technical data, process,
|
||||
* software, or service, directly or indirectly, to any country for which the
|
||||
* United States government or any agency thereof requires an export license,
|
||||
* other governmental approval, or letter of assurance, without first obtaining
|
||||
* such license, approval or letter.
|
||||
*
|
||||
*****************************************************************************/
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef __ACMACROS_H__
|
||||
#define __ACMACROS_H__
|
||||
@@ -122,27 +50,35 @@
|
||||
* get into potential aligment issues -- see the STORE macros below.
|
||||
* Use with care.
|
||||
*/
|
||||
#define ACPI_GET8(ptr) *ACPI_CAST_PTR (UINT8, ptr)
|
||||
#define ACPI_GET16(ptr) *ACPI_CAST_PTR (UINT16, ptr)
|
||||
#define ACPI_GET32(ptr) *ACPI_CAST_PTR (UINT32, ptr)
|
||||
#define ACPI_GET64(ptr) *ACPI_CAST_PTR (UINT64, ptr)
|
||||
#define ACPI_SET8(ptr) *ACPI_CAST_PTR (UINT8, ptr)
|
||||
#define ACPI_SET16(ptr) *ACPI_CAST_PTR (UINT16, ptr)
|
||||
#define ACPI_SET32(ptr) *ACPI_CAST_PTR (UINT32, ptr)
|
||||
#define ACPI_SET64(ptr) *ACPI_CAST_PTR (UINT64, ptr)
|
||||
#define ACPI_CAST8(ptr) ACPI_CAST_PTR (UINT8, (ptr))
|
||||
#define ACPI_CAST16(ptr) ACPI_CAST_PTR (UINT16, (ptr))
|
||||
#define ACPI_CAST32(ptr) ACPI_CAST_PTR (UINT32, (ptr))
|
||||
#define ACPI_CAST64(ptr) ACPI_CAST_PTR (UINT64, (ptr))
|
||||
#define ACPI_GET8(ptr) (*ACPI_CAST8 (ptr))
|
||||
#define ACPI_GET16(ptr) (*ACPI_CAST16 (ptr))
|
||||
#define ACPI_GET32(ptr) (*ACPI_CAST32 (ptr))
|
||||
#define ACPI_GET64(ptr) (*ACPI_CAST64 (ptr))
|
||||
#define ACPI_SET8(ptr, val) (*ACPI_CAST8 (ptr) = (UINT8) (val))
|
||||
#define ACPI_SET16(ptr, val) (*ACPI_CAST16 (ptr) = (UINT16) (val))
|
||||
#define ACPI_SET32(ptr, val) (*ACPI_CAST32 (ptr) = (UINT32) (val))
|
||||
#define ACPI_SET64(ptr, val) (*ACPI_CAST64 (ptr) = (UINT64) (val))
|
||||
|
||||
/*
|
||||
* printf() format helpers
|
||||
* printf() format helpers. These macros are workarounds for the difficulties
|
||||
* with emitting 64-bit integers and 64-bit pointers with the same code
|
||||
* for both 32-bit and 64-bit hosts.
|
||||
*/
|
||||
|
||||
/* Split 64-bit integer into two 32-bit values. Use with %8.8X%8.8X */
|
||||
|
||||
#define ACPI_FORMAT_UINT64(i) ACPI_HIDWORD(i), ACPI_LODWORD(i)
|
||||
|
||||
#if ACPI_MACHINE_WIDTH == 64
|
||||
#define ACPI_FORMAT_NATIVE_UINT(i) ACPI_FORMAT_UINT64(i)
|
||||
#define ACPI_FORMAT_TO_UINT(i) ACPI_FORMAT_UINT64(i)
|
||||
#define ACPI_PRINTF_UINT "0x%8.8X%8.8X"
|
||||
|
||||
#else
|
||||
#define ACPI_FORMAT_NATIVE_UINT(i) 0, (i)
|
||||
#define ACPI_FORMAT_NATIVE_UINT(i) 0, (UINT32) (i)
|
||||
#define ACPI_FORMAT_TO_UINT(i) (UINT32) (i)
|
||||
#define ACPI_PRINTF_UINT "0x%8.8X"
|
||||
#endif
|
||||
|
||||
|
||||
@@ -340,20 +276,65 @@
|
||||
|
||||
/* Bitfields within ACPI registers */
|
||||
|
||||
#define ACPI_REGISTER_PREPARE_BITS(Val, Pos, Mask) ((Val << Pos) & Mask)
|
||||
#define ACPI_REGISTER_INSERT_VALUE(Reg, Pos, Mask, Val) Reg = (Reg & (~(Mask))) | ACPI_REGISTER_PREPARE_BITS(Val, Pos, Mask)
|
||||
#define ACPI_REGISTER_PREPARE_BITS(Val, Pos, Mask) \
|
||||
((Val << Pos) & Mask)
|
||||
|
||||
#define ACPI_INSERT_BITS(Target, Mask, Source) Target = ((Target & (~(Mask))) | (Source & Mask))
|
||||
#define ACPI_REGISTER_INSERT_VALUE(Reg, Pos, Mask, Val) \
|
||||
Reg = (Reg & (~(Mask))) | ACPI_REGISTER_PREPARE_BITS(Val, Pos, Mask)
|
||||
|
||||
#define ACPI_INSERT_BITS(Target, Mask, Source) \
|
||||
Target = ((Target & (~(Mask))) | (Source & Mask))
|
||||
|
||||
/* Generic bitfield macros and masks */
|
||||
|
||||
#define ACPI_GET_BITS(SourcePtr, Position, Mask) \
|
||||
((*SourcePtr >> Position) & Mask)
|
||||
|
||||
#define ACPI_SET_BITS(TargetPtr, Position, Mask, Value) \
|
||||
(*TargetPtr |= ((Value & Mask) << Position))
|
||||
|
||||
#define ACPI_1BIT_MASK 0x00000001
|
||||
#define ACPI_2BIT_MASK 0x00000003
|
||||
#define ACPI_3BIT_MASK 0x00000007
|
||||
#define ACPI_4BIT_MASK 0x0000000F
|
||||
#define ACPI_5BIT_MASK 0x0000001F
|
||||
#define ACPI_6BIT_MASK 0x0000003F
|
||||
#define ACPI_7BIT_MASK 0x0000007F
|
||||
#define ACPI_8BIT_MASK 0x000000FF
|
||||
#define ACPI_16BIT_MASK 0x0000FFFF
|
||||
#define ACPI_24BIT_MASK 0x00FFFFFF
|
||||
|
||||
/* Macros to extract flag bits from position zero */
|
||||
|
||||
#define ACPI_GET_1BIT_FLAG(Value) ((Value) & ACPI_1BIT_MASK)
|
||||
#define ACPI_GET_2BIT_FLAG(Value) ((Value) & ACPI_2BIT_MASK)
|
||||
#define ACPI_GET_3BIT_FLAG(Value) ((Value) & ACPI_3BIT_MASK)
|
||||
#define ACPI_GET_4BIT_FLAG(Value) ((Value) & ACPI_4BIT_MASK)
|
||||
|
||||
/* Macros to extract flag bits from position one and above */
|
||||
|
||||
#define ACPI_EXTRACT_1BIT_FLAG(Field, Position) (ACPI_GET_1BIT_FLAG ((Field) >> Position))
|
||||
#define ACPI_EXTRACT_2BIT_FLAG(Field, Position) (ACPI_GET_2BIT_FLAG ((Field) >> Position))
|
||||
#define ACPI_EXTRACT_3BIT_FLAG(Field, Position) (ACPI_GET_3BIT_FLAG ((Field) >> Position))
|
||||
#define ACPI_EXTRACT_4BIT_FLAG(Field, Position) (ACPI_GET_4BIT_FLAG ((Field) >> Position))
|
||||
|
||||
/* ACPI Pathname helpers */
|
||||
|
||||
#define ACPI_IS_ROOT_PREFIX(c) ((c) == (UINT8) 0x5C) /* Backslash */
|
||||
#define ACPI_IS_PARENT_PREFIX(c) ((c) == (UINT8) 0x5E) /* Carat */
|
||||
#define ACPI_IS_PATH_SEPARATOR(c) ((c) == (UINT8) 0x2E) /* Period (dot) */
|
||||
|
||||
/*
|
||||
* An ACPI_NAMESPACE_NODE can appear in some contexts
|
||||
* where a pointer to an ACPI_OPERAND_OBJECT can also
|
||||
* An object of type ACPI_NAMESPACE_NODE can appear in some contexts
|
||||
* where a pointer to an object of type ACPI_OPERAND_OBJECT can also
|
||||
* appear. This macro is used to distinguish them.
|
||||
*
|
||||
* The "Descriptor" field is the first field in both structures.
|
||||
* The "DescriptorType" field is the second field in both structures.
|
||||
*/
|
||||
#define ACPI_GET_DESCRIPTOR_PTR(d) (((ACPI_DESCRIPTOR *)(void *)(d))->Common.CommonPointer)
|
||||
#define ACPI_SET_DESCRIPTOR_PTR(d, p) (((ACPI_DESCRIPTOR *)(void *)(d))->Common.CommonPointer = (p))
|
||||
#define ACPI_GET_DESCRIPTOR_TYPE(d) (((ACPI_DESCRIPTOR *)(void *)(d))->Common.DescriptorType)
|
||||
#define ACPI_SET_DESCRIPTOR_TYPE(d, t) (((ACPI_DESCRIPTOR *)(void *)(d))->Common.DescriptorType = t)
|
||||
#define ACPI_SET_DESCRIPTOR_TYPE(d, t) (((ACPI_DESCRIPTOR *)(void *)(d))->Common.DescriptorType = (t))
|
||||
|
||||
/*
|
||||
* Macros for the master AML opcode table
|
||||
@@ -400,10 +381,11 @@
|
||||
* the plist contains a set of parens to allow variable-length lists.
|
||||
* These macros are used for both the debug and non-debug versions of the code.
|
||||
*/
|
||||
#define ACPI_ERROR_NAMESPACE(s, e) AcpiNsReportError (AE_INFO, s, e);
|
||||
#define ACPI_ERROR_METHOD(s, n, p, e) AcpiNsReportMethodError (AE_INFO, s, n, p, e);
|
||||
#define ACPI_WARN_PREDEFINED(plist) AcpiUtPredefinedWarning plist
|
||||
#define ACPI_INFO_PREDEFINED(plist) AcpiUtPredefinedInfo plist
|
||||
#define ACPI_ERROR_NAMESPACE(s, e) AcpiUtNamespaceError (AE_INFO, s, e);
|
||||
#define ACPI_ERROR_METHOD(s, n, p, e) AcpiUtMethodError (AE_INFO, s, n, p, e);
|
||||
#define ACPI_WARN_PREDEFINED(plist) AcpiUtPredefinedWarning plist
|
||||
#define ACPI_INFO_PREDEFINED(plist) AcpiUtPredefinedInfo plist
|
||||
#define ACPI_BIOS_ERROR_PREDEFINED(plist) AcpiUtPredefinedBiosError plist
|
||||
|
||||
#else
|
||||
|
||||
@@ -413,141 +395,16 @@
|
||||
#define ACPI_ERROR_METHOD(s, n, p, e)
|
||||
#define ACPI_WARN_PREDEFINED(plist)
|
||||
#define ACPI_INFO_PREDEFINED(plist)
|
||||
#define ACPI_BIOS_ERROR_PREDEFINED(plist)
|
||||
|
||||
#endif /* ACPI_NO_ERROR_MESSAGES */
|
||||
|
||||
/*
|
||||
* Debug macros that are conditionally compiled
|
||||
*/
|
||||
#ifdef ACPI_DEBUG_OUTPUT
|
||||
/*
|
||||
* Function entry tracing
|
||||
*/
|
||||
#define ACPI_FUNCTION_TRACE(a) ACPI_FUNCTION_NAME(a) \
|
||||
AcpiUtTrace(ACPI_DEBUG_PARAMETERS)
|
||||
#define ACPI_FUNCTION_TRACE_PTR(a, b) ACPI_FUNCTION_NAME(a) \
|
||||
AcpiUtTracePtr(ACPI_DEBUG_PARAMETERS, (void *)b)
|
||||
#define ACPI_FUNCTION_TRACE_U32(a, b) ACPI_FUNCTION_NAME(a) \
|
||||
AcpiUtTraceU32(ACPI_DEBUG_PARAMETERS, (UINT32)b)
|
||||
#define ACPI_FUNCTION_TRACE_STR(a, b) ACPI_FUNCTION_NAME(a) \
|
||||
AcpiUtTraceStr(ACPI_DEBUG_PARAMETERS, (char *)b)
|
||||
|
||||
#define ACPI_FUNCTION_ENTRY() AcpiUtTrackStackPtr()
|
||||
|
||||
/*
|
||||
* Function exit tracing.
|
||||
* WARNING: These macros include a return statement. This is usually considered
|
||||
* bad form, but having a separate exit macro is very ugly and difficult to maintain.
|
||||
* One of the FUNCTION_TRACE macros above must be used in conjunction with these macros
|
||||
* so that "_AcpiFunctionName" is defined.
|
||||
*
|
||||
* Note: the DO_WHILE0 macro is used to prevent some compilers from complaining
|
||||
* about these constructs.
|
||||
*/
|
||||
#ifdef ACPI_USE_DO_WHILE_0
|
||||
#define ACPI_DO_WHILE0(a) do a while(0)
|
||||
#if (!ACPI_REDUCED_HARDWARE)
|
||||
#define ACPI_HW_OPTIONAL_FUNCTION(addr) addr
|
||||
#else
|
||||
#define ACPI_DO_WHILE0(a) a
|
||||
#define ACPI_HW_OPTIONAL_FUNCTION(addr) NULL
|
||||
#endif
|
||||
|
||||
#define return_VOID ACPI_DO_WHILE0 ({ \
|
||||
AcpiUtExit (ACPI_DEBUG_PARAMETERS); \
|
||||
return;})
|
||||
/*
|
||||
* There are two versions of most of the return macros. The default version is
|
||||
* safer, since it avoids side-effects by guaranteeing that the argument will
|
||||
* not be evaluated twice.
|
||||
*
|
||||
* A less-safe version of the macros is provided for optional use if the
|
||||
* compiler uses excessive CPU stack (for example, this may happen in the
|
||||
* debug case if code optimzation is disabled.)
|
||||
*/
|
||||
#ifndef ACPI_SIMPLE_RETURN_MACROS
|
||||
|
||||
#define return_ACPI_STATUS(s) ACPI_DO_WHILE0 ({ \
|
||||
register ACPI_STATUS _s = (s); \
|
||||
AcpiUtStatusExit (ACPI_DEBUG_PARAMETERS, _s); \
|
||||
return (_s); })
|
||||
#define return_PTR(s) ACPI_DO_WHILE0 ({ \
|
||||
register void *_s = (void *) (s); \
|
||||
AcpiUtPtrExit (ACPI_DEBUG_PARAMETERS, (UINT8 *) _s); \
|
||||
return (_s); })
|
||||
#define return_VALUE(s) ACPI_DO_WHILE0 ({ \
|
||||
register UINT64 _s = (s); \
|
||||
AcpiUtValueExit (ACPI_DEBUG_PARAMETERS, _s); \
|
||||
return (_s); })
|
||||
#define return_UINT8(s) ACPI_DO_WHILE0 ({ \
|
||||
register UINT8 _s = (UINT8) (s); \
|
||||
AcpiUtValueExit (ACPI_DEBUG_PARAMETERS, (UINT64) _s); \
|
||||
return (_s); })
|
||||
#define return_UINT32(s) ACPI_DO_WHILE0 ({ \
|
||||
register UINT32 _s = (UINT32) (s); \
|
||||
AcpiUtValueExit (ACPI_DEBUG_PARAMETERS, (UINT64) _s); \
|
||||
return (_s); })
|
||||
#else /* Use original less-safe macros */
|
||||
|
||||
#define return_ACPI_STATUS(s) ACPI_DO_WHILE0 ({ \
|
||||
AcpiUtStatusExit (ACPI_DEBUG_PARAMETERS, (s)); \
|
||||
return((s)); })
|
||||
#define return_PTR(s) ACPI_DO_WHILE0 ({ \
|
||||
AcpiUtPtrExit (ACPI_DEBUG_PARAMETERS, (UINT8 *) (s)); \
|
||||
return((s)); })
|
||||
#define return_VALUE(s) ACPI_DO_WHILE0 ({ \
|
||||
AcpiUtValueExit (ACPI_DEBUG_PARAMETERS, (UINT64) (s)); \
|
||||
return((s)); })
|
||||
#define return_UINT8(s) return_VALUE(s)
|
||||
#define return_UINT32(s) return_VALUE(s)
|
||||
|
||||
#endif /* ACPI_SIMPLE_RETURN_MACROS */
|
||||
|
||||
|
||||
/* Conditional execution */
|
||||
|
||||
#define ACPI_DEBUG_EXEC(a) a
|
||||
#define ACPI_DEBUG_ONLY_MEMBERS(a) a;
|
||||
#define _VERBOSE_STRUCTURES
|
||||
|
||||
|
||||
/* Various object display routines for debug */
|
||||
|
||||
#define ACPI_DUMP_STACK_ENTRY(a) AcpiExDumpOperand((a), 0)
|
||||
#define ACPI_DUMP_OPERANDS(a, b ,c) AcpiExDumpOperands(a, b, c)
|
||||
#define ACPI_DUMP_ENTRY(a, b) AcpiNsDumpEntry (a, b)
|
||||
#define ACPI_DUMP_PATHNAME(a, b, c, d) AcpiNsDumpPathname(a, b, c, d)
|
||||
#define ACPI_DUMP_BUFFER(a, b) AcpiUtDumpBuffer((UINT8 *) a, b, DB_BYTE_DISPLAY, _COMPONENT)
|
||||
|
||||
#else
|
||||
/*
|
||||
* This is the non-debug case -- make everything go away,
|
||||
* leaving no executable debug code!
|
||||
*/
|
||||
#define ACPI_DEBUG_EXEC(a)
|
||||
#define ACPI_DEBUG_ONLY_MEMBERS(a)
|
||||
#define ACPI_FUNCTION_TRACE(a)
|
||||
#define ACPI_FUNCTION_TRACE_PTR(a, b)
|
||||
#define ACPI_FUNCTION_TRACE_U32(a, b)
|
||||
#define ACPI_FUNCTION_TRACE_STR(a, b)
|
||||
#define ACPI_FUNCTION_EXIT
|
||||
#define ACPI_FUNCTION_STATUS_EXIT(s)
|
||||
#define ACPI_FUNCTION_VALUE_EXIT(s)
|
||||
#define ACPI_FUNCTION_ENTRY()
|
||||
#define ACPI_DUMP_STACK_ENTRY(a)
|
||||
#define ACPI_DUMP_OPERANDS(a, b, c)
|
||||
#define ACPI_DUMP_ENTRY(a, b)
|
||||
#define ACPI_DUMP_TABLES(a, b)
|
||||
#define ACPI_DUMP_PATHNAME(a, b, c, d)
|
||||
#define ACPI_DUMP_BUFFER(a, b)
|
||||
#define ACPI_DEBUG_PRINT(pl)
|
||||
#define ACPI_DEBUG_PRINT_RAW(pl)
|
||||
|
||||
#define return_VOID return
|
||||
#define return_ACPI_STATUS(s) return(s)
|
||||
#define return_VALUE(s) return(s)
|
||||
#define return_UINT8(s) return(s)
|
||||
#define return_UINT32(s) return(s)
|
||||
#define return_PTR(s) return(s)
|
||||
|
||||
#endif /* ACPI_DEBUG_OUTPUT */
|
||||
|
||||
/*
|
||||
* Some code only gets executed when the debugger is built in.
|
||||
@@ -561,32 +418,6 @@
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Memory allocation tracking (DEBUG ONLY)
|
||||
*/
|
||||
#define ACPI_MEM_PARAMETERS _COMPONENT, _AcpiModuleName, __LINE__
|
||||
|
||||
#ifndef ACPI_DBG_TRACK_ALLOCATIONS
|
||||
|
||||
/* Memory allocation */
|
||||
|
||||
#define ACPI_ALLOCATE(a) AcpiUtAllocate((ACPI_SIZE) (a), ACPI_MEM_PARAMETERS)
|
||||
#define ACPI_ALLOCATE_ZEROED(a) AcpiUtAllocateZeroed((ACPI_SIZE) (a), ACPI_MEM_PARAMETERS)
|
||||
#define ACPI_FREE(a) AcpiOsFree(a)
|
||||
#define ACPI_MEM_TRACKING(a)
|
||||
|
||||
#else
|
||||
|
||||
/* Memory allocation */
|
||||
|
||||
#define ACPI_ALLOCATE(a) AcpiUtAllocateAndTrack((ACPI_SIZE) (a), ACPI_MEM_PARAMETERS)
|
||||
#define ACPI_ALLOCATE_ZEROED(a) AcpiUtAllocateZeroedAndTrack((ACPI_SIZE) (a), ACPI_MEM_PARAMETERS)
|
||||
#define ACPI_FREE(a) AcpiUtFreeAndTrack(a, ACPI_MEM_PARAMETERS)
|
||||
#define ACPI_MEM_TRACKING(a) a
|
||||
|
||||
#endif /* ACPI_DBG_TRACK_ALLOCATIONS */
|
||||
|
||||
|
||||
/*
|
||||
* Macros used for ACPICA utilities only
|
||||
*/
|
||||
|
||||
@@ -4,142 +4,79 @@
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
* 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.
|
||||
*
|
||||
* 2.1. This is your license from Intel Corp. under its intellectual property
|
||||
* rights. You may have additional license terms from the party that provided
|
||||
* you this software, covering your right to use that party's intellectual
|
||||
* property rights.
|
||||
* 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.
|
||||
*
|
||||
* 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
|
||||
* copy of the source code appearing in this file ("Covered Code") an
|
||||
* irrevocable, perpetual, worldwide license under Intel's copyrights in the
|
||||
* base code distributed originally by Intel ("Original Intel Code") to copy,
|
||||
* make derivatives, distribute, use and display any portion of the Covered
|
||||
* Code in any form, with the right to sublicense such rights; and
|
||||
*
|
||||
* 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
|
||||
* license (with the right to sublicense), under only those claims of Intel
|
||||
* patents that are infringed by the Original Intel Code, to make, use, sell,
|
||||
* offer to sell, and import the Covered Code and derivative works thereof
|
||||
* solely to the minimum extent necessary to exercise the above copyright
|
||||
* license, and in no event shall the patent license extend to any additions
|
||||
* to or modifications of the Original Intel Code. No other license or right
|
||||
* is granted directly or by implication, estoppel or otherwise;
|
||||
*
|
||||
* The above copyright and patent license is granted only if the following
|
||||
* conditions are met:
|
||||
*
|
||||
* 3. Conditions
|
||||
*
|
||||
* 3.1. Redistribution of Source with Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification with rights to further distribute source must include
|
||||
* the above Copyright Notice, the above License, this list of Conditions,
|
||||
* and the following Disclaimer and Export Compliance provision. In addition,
|
||||
* Licensee must cause all Covered Code to which Licensee contributes to
|
||||
* contain a file documenting the changes Licensee made to create that Covered
|
||||
* Code and the date of any change. Licensee must include in that file the
|
||||
* documentation of any changes made by any predecessor Licensee. Licensee
|
||||
* must include a prominent statement that the modification is derived,
|
||||
* directly or indirectly, from Original Intel Code.
|
||||
*
|
||||
* 3.2. Redistribution of Source with no Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification without rights to further distribute source must
|
||||
* include the following Disclaimer and Export Compliance provision in the
|
||||
* documentation and/or other materials provided with distribution. In
|
||||
* addition, Licensee may not authorize further sublicense of source of any
|
||||
* portion of the Covered Code, and must include terms to the effect that the
|
||||
* license from Licensee to its licensee is limited to the intellectual
|
||||
* property embodied in the software Licensee provides to its licensee, and
|
||||
* not to intellectual property embodied in modifications its licensee may
|
||||
* make.
|
||||
*
|
||||
* 3.3. Redistribution of Executable. Redistribution in executable form of any
|
||||
* substantial portion of the Covered Code or modification must reproduce the
|
||||
* above Copyright Notice, and the following Disclaimer and Export Compliance
|
||||
* provision in the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3.4. Intel retains all right, title, and interest in and to the Original
|
||||
* Intel Code.
|
||||
*
|
||||
* 3.5. Neither the name Intel nor any other trademark owned or controlled by
|
||||
* Intel shall be used in advertising or otherwise to promote the sale, use or
|
||||
* other dealings in products derived from or relating to the Covered Code
|
||||
* without prior written authorization from Intel.
|
||||
*
|
||||
* 4. Disclaimer and Export Compliance
|
||||
*
|
||||
* 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
|
||||
* HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
|
||||
* IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
|
||||
* INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
|
||||
* UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
|
||||
* PARTICULAR PURPOSE.
|
||||
*
|
||||
* 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
|
||||
* OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
|
||||
* COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
|
||||
* SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
|
||||
* CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
|
||||
* HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
|
||||
* SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
|
||||
* LIMITED REMEDY.
|
||||
*
|
||||
* 4.3. Licensee shall not export, either directly or indirectly, any of this
|
||||
* software or system incorporating such software without first obtaining any
|
||||
* required license or other approval from the U. S. Department of Commerce or
|
||||
* any other agency or department of the United States Government. In the
|
||||
* event Licensee exports any such software from the United States or
|
||||
* re-exports any such software from a foreign destination, Licensee shall
|
||||
* ensure that the distribution and export/re-export of the software is in
|
||||
* compliance with all laws, regulations, orders, or other restrictions of the
|
||||
* U.S. Export Administration Regulations. Licensee agrees that neither it nor
|
||||
* any of its subsidiaries will export/re-export any technical data, process,
|
||||
* software, or service, directly or indirectly, to any country for which the
|
||||
* United States government or any agency thereof requires an export license,
|
||||
* other governmental approval, or letter of assurance, without first obtaining
|
||||
* such license, approval or letter.
|
||||
*
|
||||
*****************************************************************************/
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef __ACNAMES_H__
|
||||
#define __ACNAMES_H__
|
||||
|
||||
/* Method names - these methods can appear anywhere in the namespace */
|
||||
|
||||
#define METHOD_NAME__HID "_HID"
|
||||
#define METHOD_NAME__CID "_CID"
|
||||
#define METHOD_NAME__UID "_UID"
|
||||
#define METHOD_NAME__ADR "_ADR"
|
||||
#define METHOD_NAME__INI "_INI"
|
||||
#define METHOD_NAME__STA "_STA"
|
||||
#define METHOD_NAME__REG "_REG"
|
||||
#define METHOD_NAME__SEG "_SEG"
|
||||
#define METHOD_NAME__AEI "_AEI"
|
||||
#define METHOD_NAME__BBN "_BBN"
|
||||
#define METHOD_NAME__PRT "_PRT"
|
||||
#define METHOD_NAME__CBA "_CBA"
|
||||
#define METHOD_NAME__CID "_CID"
|
||||
#define METHOD_NAME__CRS "_CRS"
|
||||
#define METHOD_NAME__DDN "_DDN"
|
||||
#define METHOD_NAME__HID "_HID"
|
||||
#define METHOD_NAME__INI "_INI"
|
||||
#define METHOD_NAME__PLD "_PLD"
|
||||
#define METHOD_NAME__DSD "_DSD"
|
||||
#define METHOD_NAME__PRS "_PRS"
|
||||
#define METHOD_NAME__PRT "_PRT"
|
||||
#define METHOD_NAME__PRW "_PRW"
|
||||
#define METHOD_NAME__PS0 "_PS0"
|
||||
#define METHOD_NAME__PS1 "_PS1"
|
||||
#define METHOD_NAME__PS2 "_PS2"
|
||||
#define METHOD_NAME__PS3 "_PS3"
|
||||
#define METHOD_NAME__REG "_REG"
|
||||
#define METHOD_NAME__SB_ "_SB_"
|
||||
#define METHOD_NAME__SEG "_SEG"
|
||||
#define METHOD_NAME__SRS "_SRS"
|
||||
#define METHOD_NAME__STA "_STA"
|
||||
#define METHOD_NAME__SUB "_SUB"
|
||||
#define METHOD_NAME__UID "_UID"
|
||||
|
||||
/* Method names - these methods must appear at the namespace root */
|
||||
|
||||
#define METHOD_NAME__BFS "\\_BFS"
|
||||
#define METHOD_NAME__GTS "\\_GTS"
|
||||
#define METHOD_NAME__PTS "\\_PTS"
|
||||
#define METHOD_NAME__SST "\\_SI._SST"
|
||||
#define METHOD_NAME__WAK "\\_WAK"
|
||||
#define METHOD_PATHNAME__PTS "\\_PTS"
|
||||
#define METHOD_PATHNAME__SST "\\_SI._SST"
|
||||
#define METHOD_PATHNAME__WAK "\\_WAK"
|
||||
|
||||
/* Definitions of the predefined namespace names */
|
||||
|
||||
@@ -150,8 +87,5 @@
|
||||
#define ACPI_PREFIX_LOWER (UINT32) 0x69706361 /* "acpi" */
|
||||
|
||||
#define ACPI_NS_ROOT_PATH "\\"
|
||||
#define ACPI_NS_SYSTEM_BUS "_SB_"
|
||||
|
||||
#endif /* __ACNAMES_H__ */
|
||||
|
||||
|
||||
|
||||
@@ -4,114 +4,42 @@
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
* 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.
|
||||
*
|
||||
* 2.1. This is your license from Intel Corp. under its intellectual property
|
||||
* rights. You may have additional license terms from the party that provided
|
||||
* you this software, covering your right to use that party's intellectual
|
||||
* property rights.
|
||||
* 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.
|
||||
*
|
||||
* 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
|
||||
* copy of the source code appearing in this file ("Covered Code") an
|
||||
* irrevocable, perpetual, worldwide license under Intel's copyrights in the
|
||||
* base code distributed originally by Intel ("Original Intel Code") to copy,
|
||||
* make derivatives, distribute, use and display any portion of the Covered
|
||||
* Code in any form, with the right to sublicense such rights; and
|
||||
*
|
||||
* 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
|
||||
* license (with the right to sublicense), under only those claims of Intel
|
||||
* patents that are infringed by the Original Intel Code, to make, use, sell,
|
||||
* offer to sell, and import the Covered Code and derivative works thereof
|
||||
* solely to the minimum extent necessary to exercise the above copyright
|
||||
* license, and in no event shall the patent license extend to any additions
|
||||
* to or modifications of the Original Intel Code. No other license or right
|
||||
* is granted directly or by implication, estoppel or otherwise;
|
||||
*
|
||||
* The above copyright and patent license is granted only if the following
|
||||
* conditions are met:
|
||||
*
|
||||
* 3. Conditions
|
||||
*
|
||||
* 3.1. Redistribution of Source with Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification with rights to further distribute source must include
|
||||
* the above Copyright Notice, the above License, this list of Conditions,
|
||||
* and the following Disclaimer and Export Compliance provision. In addition,
|
||||
* Licensee must cause all Covered Code to which Licensee contributes to
|
||||
* contain a file documenting the changes Licensee made to create that Covered
|
||||
* Code and the date of any change. Licensee must include in that file the
|
||||
* documentation of any changes made by any predecessor Licensee. Licensee
|
||||
* must include a prominent statement that the modification is derived,
|
||||
* directly or indirectly, from Original Intel Code.
|
||||
*
|
||||
* 3.2. Redistribution of Source with no Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification without rights to further distribute source must
|
||||
* include the following Disclaimer and Export Compliance provision in the
|
||||
* documentation and/or other materials provided with distribution. In
|
||||
* addition, Licensee may not authorize further sublicense of source of any
|
||||
* portion of the Covered Code, and must include terms to the effect that the
|
||||
* license from Licensee to its licensee is limited to the intellectual
|
||||
* property embodied in the software Licensee provides to its licensee, and
|
||||
* not to intellectual property embodied in modifications its licensee may
|
||||
* make.
|
||||
*
|
||||
* 3.3. Redistribution of Executable. Redistribution in executable form of any
|
||||
* substantial portion of the Covered Code or modification must reproduce the
|
||||
* above Copyright Notice, and the following Disclaimer and Export Compliance
|
||||
* provision in the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3.4. Intel retains all right, title, and interest in and to the Original
|
||||
* Intel Code.
|
||||
*
|
||||
* 3.5. Neither the name Intel nor any other trademark owned or controlled by
|
||||
* Intel shall be used in advertising or otherwise to promote the sale, use or
|
||||
* other dealings in products derived from or relating to the Covered Code
|
||||
* without prior written authorization from Intel.
|
||||
*
|
||||
* 4. Disclaimer and Export Compliance
|
||||
*
|
||||
* 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
|
||||
* HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
|
||||
* IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
|
||||
* INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
|
||||
* UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
|
||||
* PARTICULAR PURPOSE.
|
||||
*
|
||||
* 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
|
||||
* OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
|
||||
* COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
|
||||
* SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
|
||||
* CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
|
||||
* HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
|
||||
* SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
|
||||
* LIMITED REMEDY.
|
||||
*
|
||||
* 4.3. Licensee shall not export, either directly or indirectly, any of this
|
||||
* software or system incorporating such software without first obtaining any
|
||||
* required license or other approval from the U. S. Department of Commerce or
|
||||
* any other agency or department of the United States Government. In the
|
||||
* event Licensee exports any such software from the United States or
|
||||
* re-exports any such software from a foreign destination, Licensee shall
|
||||
* ensure that the distribution and export/re-export of the software is in
|
||||
* compliance with all laws, regulations, orders, or other restrictions of the
|
||||
* U.S. Export Administration Regulations. Licensee agrees that neither it nor
|
||||
* any of its subsidiaries will export/re-export any technical data, process,
|
||||
* software, or service, directly or indirectly, to any country for which the
|
||||
* United States government or any agency thereof requires an export license,
|
||||
* other governmental approval, or letter of assurance, without first obtaining
|
||||
* such license, approval or letter.
|
||||
*
|
||||
*****************************************************************************/
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef __ACNAMESP_H__
|
||||
#define __ACNAMESP_H__
|
||||
@@ -189,8 +117,8 @@ AcpiNsWalkNamespace (
|
||||
ACPI_HANDLE StartObject,
|
||||
UINT32 MaxDepth,
|
||||
UINT32 Flags,
|
||||
ACPI_WALK_CALLBACK PreOrderVisit,
|
||||
ACPI_WALK_CALLBACK PostOrderVisit,
|
||||
ACPI_WALK_CALLBACK DescendingCallback,
|
||||
ACPI_WALK_CALLBACK AscendingCallback,
|
||||
void *Context,
|
||||
void **ReturnValue);
|
||||
|
||||
@@ -275,6 +203,35 @@ AcpiNsCompareNames (
|
||||
char *Name2);
|
||||
|
||||
|
||||
/*
|
||||
* nsconvert - Dynamic object conversion routines
|
||||
*/
|
||||
ACPI_STATUS
|
||||
AcpiNsConvertToInteger (
|
||||
ACPI_OPERAND_OBJECT *OriginalObject,
|
||||
ACPI_OPERAND_OBJECT **ReturnObject);
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiNsConvertToString (
|
||||
ACPI_OPERAND_OBJECT *OriginalObject,
|
||||
ACPI_OPERAND_OBJECT **ReturnObject);
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiNsConvertToBuffer (
|
||||
ACPI_OPERAND_OBJECT *OriginalObject,
|
||||
ACPI_OPERAND_OBJECT **ReturnObject);
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiNsConvertToUnicode (
|
||||
ACPI_OPERAND_OBJECT *OriginalObject,
|
||||
ACPI_OPERAND_OBJECT **ReturnObject);
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiNsConvertToResource (
|
||||
ACPI_OPERAND_OBJECT *OriginalObject,
|
||||
ACPI_OPERAND_OBJECT **ReturnObject);
|
||||
|
||||
|
||||
/*
|
||||
* nsdump - Namespace dump/print utilities
|
||||
*/
|
||||
@@ -315,6 +272,14 @@ AcpiNsDumpObjects (
|
||||
ACPI_OWNER_ID OwnerId,
|
||||
ACPI_HANDLE StartHandle);
|
||||
|
||||
void
|
||||
AcpiNsDumpObjectPaths (
|
||||
ACPI_OBJECT_TYPE Type,
|
||||
UINT8 DisplayType,
|
||||
UINT32 MaxDepth,
|
||||
ACPI_OWNER_ID OwnerId,
|
||||
ACPI_HANDLE StartHandle);
|
||||
|
||||
|
||||
/*
|
||||
* nseval - Namespace evaluation functions
|
||||
@@ -329,26 +294,53 @@ AcpiNsExecModuleCodeList (
|
||||
|
||||
|
||||
/*
|
||||
* nspredef - Support for predefined/reserved names
|
||||
* nsarguments - Argument count/type checking for predefined/reserved names
|
||||
*/
|
||||
ACPI_STATUS
|
||||
AcpiNsCheckPredefinedNames (
|
||||
ACPI_NAMESPACE_NODE *Node,
|
||||
UINT32 UserParamCount,
|
||||
ACPI_STATUS ReturnStatus,
|
||||
ACPI_OPERAND_OBJECT **ReturnObject);
|
||||
|
||||
const ACPI_PREDEFINED_INFO *
|
||||
AcpiNsCheckForPredefinedName (
|
||||
ACPI_NAMESPACE_NODE *Node);
|
||||
|
||||
void
|
||||
AcpiNsCheckParameterCount (
|
||||
AcpiNsCheckArgumentCount (
|
||||
char *Pathname,
|
||||
ACPI_NAMESPACE_NODE *Node,
|
||||
UINT32 UserParamCount,
|
||||
const ACPI_PREDEFINED_INFO *Info);
|
||||
|
||||
void
|
||||
AcpiNsCheckAcpiCompliance (
|
||||
char *Pathname,
|
||||
ACPI_NAMESPACE_NODE *Node,
|
||||
const ACPI_PREDEFINED_INFO *Predefined);
|
||||
|
||||
void
|
||||
AcpiNsCheckArgumentTypes (
|
||||
ACPI_EVALUATE_INFO *Info);
|
||||
|
||||
|
||||
/*
|
||||
* nspredef - Return value checking for predefined/reserved names
|
||||
*/
|
||||
ACPI_STATUS
|
||||
AcpiNsCheckReturnValue (
|
||||
ACPI_NAMESPACE_NODE *Node,
|
||||
ACPI_EVALUATE_INFO *Info,
|
||||
UINT32 UserParamCount,
|
||||
ACPI_STATUS ReturnStatus,
|
||||
ACPI_OPERAND_OBJECT **ReturnObject);
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiNsCheckObjectType (
|
||||
ACPI_EVALUATE_INFO *Info,
|
||||
ACPI_OPERAND_OBJECT **ReturnObjectPtr,
|
||||
UINT32 ExpectedBtypes,
|
||||
UINT32 PackageIndex);
|
||||
|
||||
|
||||
/*
|
||||
* nsprepkg - Validation of predefined name packages
|
||||
*/
|
||||
ACPI_STATUS
|
||||
AcpiNsCheckPackage (
|
||||
ACPI_EVALUATE_INFO *Info,
|
||||
ACPI_OPERAND_OBJECT **ReturnObjectPtr);
|
||||
|
||||
|
||||
/*
|
||||
* nsnames - Name and Scope manipulation
|
||||
@@ -433,27 +425,28 @@ AcpiNsGetAttachedData (
|
||||
* predefined methods/objects
|
||||
*/
|
||||
ACPI_STATUS
|
||||
AcpiNsRepairObject (
|
||||
ACPI_PREDEFINED_DATA *Data,
|
||||
AcpiNsSimpleRepair (
|
||||
ACPI_EVALUATE_INFO *Info,
|
||||
UINT32 ExpectedBtypes,
|
||||
UINT32 PackageIndex,
|
||||
ACPI_OPERAND_OBJECT **ReturnObjectPtr);
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiNsRepairPackageList (
|
||||
ACPI_PREDEFINED_DATA *Data,
|
||||
AcpiNsWrapWithPackage (
|
||||
ACPI_EVALUATE_INFO *Info,
|
||||
ACPI_OPERAND_OBJECT *OriginalObject,
|
||||
ACPI_OPERAND_OBJECT **ObjDescPtr);
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiNsRepairNullElement (
|
||||
ACPI_PREDEFINED_DATA *Data,
|
||||
ACPI_EVALUATE_INFO *Info,
|
||||
UINT32 ExpectedBtypes,
|
||||
UINT32 PackageIndex,
|
||||
ACPI_OPERAND_OBJECT **ReturnObjectPtr);
|
||||
|
||||
void
|
||||
AcpiNsRemoveNullElements (
|
||||
ACPI_PREDEFINED_DATA *Data,
|
||||
ACPI_EVALUATE_INFO *Info,
|
||||
UINT8 PackageType,
|
||||
ACPI_OPERAND_OBJECT *ObjDesc);
|
||||
|
||||
@@ -464,7 +457,7 @@ AcpiNsRemoveNullElements (
|
||||
*/
|
||||
ACPI_STATUS
|
||||
AcpiNsComplexRepairs (
|
||||
ACPI_PREDEFINED_DATA *Data,
|
||||
ACPI_EVALUATE_INFO *Info,
|
||||
ACPI_NAMESPACE_NODE *Node,
|
||||
ACPI_STATUS ValidateStatus,
|
||||
ACPI_OPERAND_OBJECT **ReturnObjectPtr);
|
||||
@@ -501,10 +494,6 @@ AcpiNsInstallNode (
|
||||
/*
|
||||
* nsutils - Utility functions
|
||||
*/
|
||||
BOOLEAN
|
||||
AcpiNsValidRootPrefix (
|
||||
char Prefix);
|
||||
|
||||
ACPI_OBJECT_TYPE
|
||||
AcpiNsGetType (
|
||||
ACPI_NAMESPACE_NODE *Node);
|
||||
@@ -513,22 +502,6 @@ UINT32
|
||||
AcpiNsLocal (
|
||||
ACPI_OBJECT_TYPE Type);
|
||||
|
||||
void
|
||||
AcpiNsReportError (
|
||||
const char *ModuleName,
|
||||
UINT32 LineNumber,
|
||||
const char *InternalName,
|
||||
ACPI_STATUS LookupStatus);
|
||||
|
||||
void
|
||||
AcpiNsReportMethodError (
|
||||
const char *ModuleName,
|
||||
UINT32 LineNumber,
|
||||
const char *Message,
|
||||
ACPI_NAMESPACE_NODE *Node,
|
||||
const char *Path,
|
||||
ACPI_STATUS LookupStatus);
|
||||
|
||||
void
|
||||
AcpiNsPrintNodePathname (
|
||||
ACPI_NAMESPACE_NODE *Node,
|
||||
|
||||
@@ -1,118 +1,45 @@
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* Name: acobject.h - Definition of ACPI_OPERAND_OBJECT (Internal object only)
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
* 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.
|
||||
*
|
||||
* 2.1. This is your license from Intel Corp. under its intellectual property
|
||||
* rights. You may have additional license terms from the party that provided
|
||||
* you this software, covering your right to use that party's intellectual
|
||||
* property rights.
|
||||
* 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.
|
||||
*
|
||||
* 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
|
||||
* copy of the source code appearing in this file ("Covered Code") an
|
||||
* irrevocable, perpetual, worldwide license under Intel's copyrights in the
|
||||
* base code distributed originally by Intel ("Original Intel Code") to copy,
|
||||
* make derivatives, distribute, use and display any portion of the Covered
|
||||
* Code in any form, with the right to sublicense such rights; and
|
||||
*
|
||||
* 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
|
||||
* license (with the right to sublicense), under only those claims of Intel
|
||||
* patents that are infringed by the Original Intel Code, to make, use, sell,
|
||||
* offer to sell, and import the Covered Code and derivative works thereof
|
||||
* solely to the minimum extent necessary to exercise the above copyright
|
||||
* license, and in no event shall the patent license extend to any additions
|
||||
* to or modifications of the Original Intel Code. No other license or right
|
||||
* is granted directly or by implication, estoppel or otherwise;
|
||||
*
|
||||
* The above copyright and patent license is granted only if the following
|
||||
* conditions are met:
|
||||
*
|
||||
* 3. Conditions
|
||||
*
|
||||
* 3.1. Redistribution of Source with Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification with rights to further distribute source must include
|
||||
* the above Copyright Notice, the above License, this list of Conditions,
|
||||
* and the following Disclaimer and Export Compliance provision. In addition,
|
||||
* Licensee must cause all Covered Code to which Licensee contributes to
|
||||
* contain a file documenting the changes Licensee made to create that Covered
|
||||
* Code and the date of any change. Licensee must include in that file the
|
||||
* documentation of any changes made by any predecessor Licensee. Licensee
|
||||
* must include a prominent statement that the modification is derived,
|
||||
* directly or indirectly, from Original Intel Code.
|
||||
*
|
||||
* 3.2. Redistribution of Source with no Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification without rights to further distribute source must
|
||||
* include the following Disclaimer and Export Compliance provision in the
|
||||
* documentation and/or other materials provided with distribution. In
|
||||
* addition, Licensee may not authorize further sublicense of source of any
|
||||
* portion of the Covered Code, and must include terms to the effect that the
|
||||
* license from Licensee to its licensee is limited to the intellectual
|
||||
* property embodied in the software Licensee provides to its licensee, and
|
||||
* not to intellectual property embodied in modifications its licensee may
|
||||
* make.
|
||||
*
|
||||
* 3.3. Redistribution of Executable. Redistribution in executable form of any
|
||||
* substantial portion of the Covered Code or modification must reproduce the
|
||||
* above Copyright Notice, and the following Disclaimer and Export Compliance
|
||||
* provision in the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3.4. Intel retains all right, title, and interest in and to the Original
|
||||
* Intel Code.
|
||||
*
|
||||
* 3.5. Neither the name Intel nor any other trademark owned or controlled by
|
||||
* Intel shall be used in advertising or otherwise to promote the sale, use or
|
||||
* other dealings in products derived from or relating to the Covered Code
|
||||
* without prior written authorization from Intel.
|
||||
*
|
||||
* 4. Disclaimer and Export Compliance
|
||||
*
|
||||
* 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
|
||||
* HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
|
||||
* IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
|
||||
* INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
|
||||
* UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
|
||||
* PARTICULAR PURPOSE.
|
||||
*
|
||||
* 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
|
||||
* OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
|
||||
* COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
|
||||
* SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
|
||||
* CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
|
||||
* HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
|
||||
* SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
|
||||
* LIMITED REMEDY.
|
||||
*
|
||||
* 4.3. Licensee shall not export, either directly or indirectly, any of this
|
||||
* software or system incorporating such software without first obtaining any
|
||||
* required license or other approval from the U. S. Department of Commerce or
|
||||
* any other agency or department of the United States Government. In the
|
||||
* event Licensee exports any such software from the United States or
|
||||
* re-exports any such software from a foreign destination, Licensee shall
|
||||
* ensure that the distribution and export/re-export of the software is in
|
||||
* compliance with all laws, regulations, orders, or other restrictions of the
|
||||
* U.S. Export Administration Regulations. Licensee agrees that neither it nor
|
||||
* any of its subsidiaries will export/re-export any technical data, process,
|
||||
* software, or service, directly or indirectly, to any country for which the
|
||||
* United States government or any agency thereof requires an export license,
|
||||
* other governmental approval, or letter of assurance, without first obtaining
|
||||
* such license, approval or letter.
|
||||
*
|
||||
*****************************************************************************/
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef _ACOBJECT_H
|
||||
#define _ACOBJECT_H
|
||||
@@ -166,12 +93,10 @@
|
||||
|
||||
#define AOPOBJ_AML_CONSTANT 0x01 /* Integer is an AML constant */
|
||||
#define AOPOBJ_STATIC_POINTER 0x02 /* Data is part of an ACPI table, don't delete */
|
||||
#define AOPOBJ_DATA_VALID 0x04 /* Object is intialized and data is valid */
|
||||
#define AOPOBJ_DATA_VALID 0x04 /* Object is initialized and data is valid */
|
||||
#define AOPOBJ_OBJECT_INITIALIZED 0x08 /* Region is initialized, _REG was run */
|
||||
#define AOPOBJ_SETUP_COMPLETE 0x10 /* Region setup is complete */
|
||||
#define AOPOBJ_INVALID 0x20 /* Host OS won't allow a Region address */
|
||||
#define AOPOBJ_MODULE_LEVEL 0x40 /* Method is actually module-level code */
|
||||
#define AOPOBJ_MODIFIED_NAMESPACE 0x80 /* Method modified the namespace */
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
@@ -197,8 +122,8 @@ typedef struct acpi_object_integer
|
||||
|
||||
|
||||
/*
|
||||
* Note: The String and Buffer object must be identical through the Pointer
|
||||
* and length elements. There is code that depends on this.
|
||||
* Note: The String and Buffer object must be identical through the
|
||||
* pointer and length elements. There is code that depends on this.
|
||||
*
|
||||
* Fields common to both Strings and Buffers
|
||||
*/
|
||||
@@ -284,7 +209,7 @@ typedef struct acpi_object_region
|
||||
typedef struct acpi_object_method
|
||||
{
|
||||
ACPI_OBJECT_COMMON_HEADER
|
||||
UINT8 MethodFlags;
|
||||
UINT8 InfoFlags;
|
||||
UINT8 ParamCount;
|
||||
UINT8 SyncLevel;
|
||||
union acpi_operand_object *Mutex;
|
||||
@@ -293,7 +218,7 @@ typedef struct acpi_object_method
|
||||
{
|
||||
ACPI_INTERNAL_METHOD Implementation;
|
||||
union acpi_operand_object *Handler;
|
||||
} Extra;
|
||||
} Dispatch;
|
||||
|
||||
UINT32 AmlLength;
|
||||
UINT8 ThreadCount;
|
||||
@@ -301,10 +226,19 @@ typedef struct acpi_object_method
|
||||
|
||||
} ACPI_OBJECT_METHOD;
|
||||
|
||||
/* Flags for InfoFlags field above */
|
||||
|
||||
#define ACPI_METHOD_MODULE_LEVEL 0x01 /* Method is actually module-level code */
|
||||
#define ACPI_METHOD_INTERNAL_ONLY 0x02 /* Method is implemented internally (_OSI) */
|
||||
#define ACPI_METHOD_SERIALIZED 0x04 /* Method is serialized */
|
||||
#define ACPI_METHOD_SERIALIZED_PENDING 0x08 /* Method is to be marked serialized */
|
||||
#define ACPI_METHOD_IGNORE_SYNC_LEVEL 0x10 /* Method was auto-serialized at table load time */
|
||||
#define ACPI_METHOD_MODIFIED_NAMESPACE 0x20 /* Method modified the namespace */
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* Objects that can be notified. All share a common NotifyInfo area.
|
||||
* Objects that can be notified. All share a common NotifyInfo area.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
@@ -312,8 +246,7 @@ typedef struct acpi_object_method
|
||||
* Common fields for objects that support ASL notifications
|
||||
*/
|
||||
#define ACPI_COMMON_NOTIFY_INFO \
|
||||
union acpi_operand_object *SystemNotify; /* Handler for system notifies */\
|
||||
union acpi_operand_object *DeviceNotify; /* Handler for driver notifies */\
|
||||
union acpi_operand_object *NotifyList[2]; /* Handlers for system/device notifies */\
|
||||
union acpi_operand_object *Handler; /* Handler for Address space */
|
||||
|
||||
|
||||
@@ -368,7 +301,7 @@ typedef struct acpi_object_thermal_zone
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* Fields. All share a common header/info field.
|
||||
* Fields. All share a common header/info field.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
@@ -386,7 +319,7 @@ typedef struct acpi_object_thermal_zone
|
||||
UINT32 BaseByteOffset; /* Byte offset within containing object */\
|
||||
UINT32 Value; /* Value to store into the Bank or Index register */\
|
||||
UINT8 StartFieldBitOffset;/* Bit offset within first field datum (0-63) */\
|
||||
UINT8 AccessBitWidth; /* Read/Write size in bits (8-64) */
|
||||
UINT8 AccessLength; /* For serial regions/fields */
|
||||
|
||||
|
||||
typedef struct acpi_object_field_common /* COMMON FIELD (for BUFFER, REGION, BANK, and INDEX fields) */
|
||||
@@ -402,7 +335,10 @@ typedef struct acpi_object_region_field
|
||||
{
|
||||
ACPI_OBJECT_COMMON_HEADER
|
||||
ACPI_COMMON_FIELD_INFO
|
||||
UINT16 ResourceLength;
|
||||
union acpi_operand_object *RegionObj; /* Containing OpRegion object */
|
||||
UINT8 *ResourceBuffer; /* ResourceTemplate for serial regions/fields */
|
||||
UINT16 PinNumberIndex; /* Index relative to previous Connection/Template */
|
||||
|
||||
} ACPI_OBJECT_REGION_FIELD;
|
||||
|
||||
@@ -453,8 +389,10 @@ typedef struct acpi_object_notify_handler
|
||||
{
|
||||
ACPI_OBJECT_COMMON_HEADER
|
||||
ACPI_NAMESPACE_NODE *Node; /* Parent device */
|
||||
ACPI_NOTIFY_HANDLER Handler;
|
||||
UINT32 HandlerType; /* Type: Device/System/Both */
|
||||
ACPI_NOTIFY_HANDLER Handler; /* Handler address */
|
||||
void *Context;
|
||||
union acpi_operand_object *Next[2]; /* Device and System handler lists */
|
||||
|
||||
} ACPI_OBJECT_NOTIFY_HANDLER;
|
||||
|
||||
@@ -468,7 +406,7 @@ typedef struct acpi_object_addr_handler
|
||||
ACPI_NAMESPACE_NODE *Node; /* Parent device */
|
||||
void *Context;
|
||||
ACPI_ADR_SPACE_SETUP Setup;
|
||||
union acpi_operand_object *RegionList; /* regions using this handler */
|
||||
union acpi_operand_object *RegionList; /* Regions using this handler */
|
||||
union acpi_operand_object *Next;
|
||||
|
||||
} ACPI_OBJECT_ADDR_HANDLER;
|
||||
@@ -530,6 +468,7 @@ typedef struct acpi_object_extra
|
||||
{
|
||||
ACPI_OBJECT_COMMON_HEADER
|
||||
ACPI_NAMESPACE_NODE *Method_REG; /* _REG method for this region (if any) */
|
||||
ACPI_NAMESPACE_NODE *ScopeNode;
|
||||
void *RegionContext; /* Region-specific data */
|
||||
UINT8 *AmlStart;
|
||||
UINT32 AmlLength;
|
||||
|
||||
@@ -4,114 +4,42 @@
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
* 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.
|
||||
*
|
||||
* 2.1. This is your license from Intel Corp. under its intellectual property
|
||||
* rights. You may have additional license terms from the party that provided
|
||||
* you this software, covering your right to use that party's intellectual
|
||||
* property rights.
|
||||
* 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.
|
||||
*
|
||||
* 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
|
||||
* copy of the source code appearing in this file ("Covered Code") an
|
||||
* irrevocable, perpetual, worldwide license under Intel's copyrights in the
|
||||
* base code distributed originally by Intel ("Original Intel Code") to copy,
|
||||
* make derivatives, distribute, use and display any portion of the Covered
|
||||
* Code in any form, with the right to sublicense such rights; and
|
||||
*
|
||||
* 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
|
||||
* license (with the right to sublicense), under only those claims of Intel
|
||||
* patents that are infringed by the Original Intel Code, to make, use, sell,
|
||||
* offer to sell, and import the Covered Code and derivative works thereof
|
||||
* solely to the minimum extent necessary to exercise the above copyright
|
||||
* license, and in no event shall the patent license extend to any additions
|
||||
* to or modifications of the Original Intel Code. No other license or right
|
||||
* is granted directly or by implication, estoppel or otherwise;
|
||||
*
|
||||
* The above copyright and patent license is granted only if the following
|
||||
* conditions are met:
|
||||
*
|
||||
* 3. Conditions
|
||||
*
|
||||
* 3.1. Redistribution of Source with Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification with rights to further distribute source must include
|
||||
* the above Copyright Notice, the above License, this list of Conditions,
|
||||
* and the following Disclaimer and Export Compliance provision. In addition,
|
||||
* Licensee must cause all Covered Code to which Licensee contributes to
|
||||
* contain a file documenting the changes Licensee made to create that Covered
|
||||
* Code and the date of any change. Licensee must include in that file the
|
||||
* documentation of any changes made by any predecessor Licensee. Licensee
|
||||
* must include a prominent statement that the modification is derived,
|
||||
* directly or indirectly, from Original Intel Code.
|
||||
*
|
||||
* 3.2. Redistribution of Source with no Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification without rights to further distribute source must
|
||||
* include the following Disclaimer and Export Compliance provision in the
|
||||
* documentation and/or other materials provided with distribution. In
|
||||
* addition, Licensee may not authorize further sublicense of source of any
|
||||
* portion of the Covered Code, and must include terms to the effect that the
|
||||
* license from Licensee to its licensee is limited to the intellectual
|
||||
* property embodied in the software Licensee provides to its licensee, and
|
||||
* not to intellectual property embodied in modifications its licensee may
|
||||
* make.
|
||||
*
|
||||
* 3.3. Redistribution of Executable. Redistribution in executable form of any
|
||||
* substantial portion of the Covered Code or modification must reproduce the
|
||||
* above Copyright Notice, and the following Disclaimer and Export Compliance
|
||||
* provision in the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3.4. Intel retains all right, title, and interest in and to the Original
|
||||
* Intel Code.
|
||||
*
|
||||
* 3.5. Neither the name Intel nor any other trademark owned or controlled by
|
||||
* Intel shall be used in advertising or otherwise to promote the sale, use or
|
||||
* other dealings in products derived from or relating to the Covered Code
|
||||
* without prior written authorization from Intel.
|
||||
*
|
||||
* 4. Disclaimer and Export Compliance
|
||||
*
|
||||
* 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
|
||||
* HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
|
||||
* IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
|
||||
* INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
|
||||
* UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
|
||||
* PARTICULAR PURPOSE.
|
||||
*
|
||||
* 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
|
||||
* OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
|
||||
* COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
|
||||
* SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
|
||||
* CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
|
||||
* HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
|
||||
* SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
|
||||
* LIMITED REMEDY.
|
||||
*
|
||||
* 4.3. Licensee shall not export, either directly or indirectly, any of this
|
||||
* software or system incorporating such software without first obtaining any
|
||||
* required license or other approval from the U. S. Department of Commerce or
|
||||
* any other agency or department of the United States Government. In the
|
||||
* event Licensee exports any such software from the United States or
|
||||
* re-exports any such software from a foreign destination, Licensee shall
|
||||
* ensure that the distribution and export/re-export of the software is in
|
||||
* compliance with all laws, regulations, orders, or other restrictions of the
|
||||
* U.S. Export Administration Regulations. Licensee agrees that neither it nor
|
||||
* any of its subsidiaries will export/re-export any technical data, process,
|
||||
* software, or service, directly or indirectly, to any country for which the
|
||||
* United States government or any agency thereof requires an export license,
|
||||
* other governmental approval, or letter of assurance, without first obtaining
|
||||
* such license, approval or letter.
|
||||
*
|
||||
*****************************************************************************/
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef __ACOPCODE_H__
|
||||
#define __ACOPCODE_H__
|
||||
@@ -126,7 +54,7 @@
|
||||
#define _UNK 0x6B
|
||||
|
||||
/*
|
||||
* Reserved ASCII characters. Do not use any of these for
|
||||
* Reserved ASCII characters. Do not use any of these for
|
||||
* internal opcodes, since they are used to differentiate
|
||||
* name strings from AML opcodes
|
||||
*/
|
||||
@@ -136,7 +64,7 @@
|
||||
|
||||
|
||||
/*
|
||||
* All AML opcodes and the parse-time arguments for each. Used by the AML
|
||||
* All AML opcodes and the parse-time arguments for each. Used by the AML
|
||||
* parser Each list is compressed into a 32-bit number and stored in the
|
||||
* master opcode table (in psopcode.c).
|
||||
*/
|
||||
@@ -166,6 +94,7 @@
|
||||
#define ARGP_CONCAT_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_TARGET)
|
||||
#define ARGP_CONCAT_RES_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_TARGET)
|
||||
#define ARGP_COND_REF_OF_OP ARGP_LIST2 (ARGP_SUPERNAME, ARGP_SUPERNAME)
|
||||
#define ARGP_CONNECTFIELD_OP ARGP_LIST1 (ARGP_NAMESTRING)
|
||||
#define ARGP_CONTINUE_OP ARG_NONE
|
||||
#define ARGP_COPY_OP ARGP_LIST2 (ARGP_TERMARG, ARGP_SIMPLENAME)
|
||||
#define ARGP_CREATE_BIT_FIELD_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_NAME)
|
||||
@@ -237,6 +166,7 @@
|
||||
#define ARGP_RETURN_OP ARGP_LIST1 (ARGP_TERMARG)
|
||||
#define ARGP_REVISION_OP ARG_NONE
|
||||
#define ARGP_SCOPE_OP ARGP_LIST3 (ARGP_PKGLENGTH, ARGP_NAME, ARGP_TERMLIST)
|
||||
#define ARGP_SERIALFIELD_OP ARGP_LIST1 (ARGP_NAMESTRING)
|
||||
#define ARGP_SHIFT_LEFT_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_TARGET)
|
||||
#define ARGP_SHIFT_RIGHT_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_TARGET)
|
||||
#define ARGP_SIGNAL_OP ARGP_LIST1 (ARGP_SUPERNAME)
|
||||
@@ -265,7 +195,7 @@
|
||||
|
||||
|
||||
/*
|
||||
* All AML opcodes and the runtime arguments for each. Used by the AML
|
||||
* All AML opcodes and the runtime arguments for each. Used by the AML
|
||||
* interpreter Each list is compressed into a 32-bit number and stored
|
||||
* in the master opcode table (in psopcode.c).
|
||||
*
|
||||
@@ -297,6 +227,7 @@
|
||||
#define ARGI_CONCAT_OP ARGI_LIST3 (ARGI_COMPUTEDATA,ARGI_COMPUTEDATA, ARGI_TARGETREF)
|
||||
#define ARGI_CONCAT_RES_OP ARGI_LIST3 (ARGI_BUFFER, ARGI_BUFFER, ARGI_TARGETREF)
|
||||
#define ARGI_COND_REF_OF_OP ARGI_LIST2 (ARGI_OBJECT_REF, ARGI_TARGETREF)
|
||||
#define ARGI_CONNECTFIELD_OP ARGI_INVALID_OPCODE
|
||||
#define ARGI_CONTINUE_OP ARGI_INVALID_OPCODE
|
||||
#define ARGI_COPY_OP ARGI_LIST2 (ARGI_ANYTYPE, ARGI_SIMPLE_TARGET)
|
||||
#define ARGI_CREATE_BIT_FIELD_OP ARGI_LIST3 (ARGI_BUFFER, ARGI_INTEGER, ARGI_REFERENCE)
|
||||
@@ -368,6 +299,7 @@
|
||||
#define ARGI_RETURN_OP ARGI_INVALID_OPCODE
|
||||
#define ARGI_REVISION_OP ARG_NONE
|
||||
#define ARGI_SCOPE_OP ARGI_INVALID_OPCODE
|
||||
#define ARGI_SERIALFIELD_OP ARGI_INVALID_OPCODE
|
||||
#define ARGI_SHIFT_LEFT_OP ARGI_LIST3 (ARGI_INTEGER, ARGI_INTEGER, ARGI_TARGETREF)
|
||||
#define ARGI_SHIFT_RIGHT_OP ARGI_LIST3 (ARGI_INTEGER, ARGI_INTEGER, ARGI_TARGETREF)
|
||||
#define ARGI_SIGNAL_OP ARGI_LIST1 (ARGI_EVENT)
|
||||
|
||||
@@ -4,114 +4,42 @@
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
* 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.
|
||||
*
|
||||
* 2.1. This is your license from Intel Corp. under its intellectual property
|
||||
* rights. You may have additional license terms from the party that provided
|
||||
* you this software, covering your right to use that party's intellectual
|
||||
* property rights.
|
||||
* 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.
|
||||
*
|
||||
* 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
|
||||
* copy of the source code appearing in this file ("Covered Code") an
|
||||
* irrevocable, perpetual, worldwide license under Intel's copyrights in the
|
||||
* base code distributed originally by Intel ("Original Intel Code") to copy,
|
||||
* make derivatives, distribute, use and display any portion of the Covered
|
||||
* Code in any form, with the right to sublicense such rights; and
|
||||
*
|
||||
* 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
|
||||
* license (with the right to sublicense), under only those claims of Intel
|
||||
* patents that are infringed by the Original Intel Code, to make, use, sell,
|
||||
* offer to sell, and import the Covered Code and derivative works thereof
|
||||
* solely to the minimum extent necessary to exercise the above copyright
|
||||
* license, and in no event shall the patent license extend to any additions
|
||||
* to or modifications of the Original Intel Code. No other license or right
|
||||
* is granted directly or by implication, estoppel or otherwise;
|
||||
*
|
||||
* The above copyright and patent license is granted only if the following
|
||||
* conditions are met:
|
||||
*
|
||||
* 3. Conditions
|
||||
*
|
||||
* 3.1. Redistribution of Source with Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification with rights to further distribute source must include
|
||||
* the above Copyright Notice, the above License, this list of Conditions,
|
||||
* and the following Disclaimer and Export Compliance provision. In addition,
|
||||
* Licensee must cause all Covered Code to which Licensee contributes to
|
||||
* contain a file documenting the changes Licensee made to create that Covered
|
||||
* Code and the date of any change. Licensee must include in that file the
|
||||
* documentation of any changes made by any predecessor Licensee. Licensee
|
||||
* must include a prominent statement that the modification is derived,
|
||||
* directly or indirectly, from Original Intel Code.
|
||||
*
|
||||
* 3.2. Redistribution of Source with no Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification without rights to further distribute source must
|
||||
* include the following Disclaimer and Export Compliance provision in the
|
||||
* documentation and/or other materials provided with distribution. In
|
||||
* addition, Licensee may not authorize further sublicense of source of any
|
||||
* portion of the Covered Code, and must include terms to the effect that the
|
||||
* license from Licensee to its licensee is limited to the intellectual
|
||||
* property embodied in the software Licensee provides to its licensee, and
|
||||
* not to intellectual property embodied in modifications its licensee may
|
||||
* make.
|
||||
*
|
||||
* 3.3. Redistribution of Executable. Redistribution in executable form of any
|
||||
* substantial portion of the Covered Code or modification must reproduce the
|
||||
* above Copyright Notice, and the following Disclaimer and Export Compliance
|
||||
* provision in the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3.4. Intel retains all right, title, and interest in and to the Original
|
||||
* Intel Code.
|
||||
*
|
||||
* 3.5. Neither the name Intel nor any other trademark owned or controlled by
|
||||
* Intel shall be used in advertising or otherwise to promote the sale, use or
|
||||
* other dealings in products derived from or relating to the Covered Code
|
||||
* without prior written authorization from Intel.
|
||||
*
|
||||
* 4. Disclaimer and Export Compliance
|
||||
*
|
||||
* 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
|
||||
* HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
|
||||
* IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
|
||||
* INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
|
||||
* UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
|
||||
* PARTICULAR PURPOSE.
|
||||
*
|
||||
* 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
|
||||
* OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
|
||||
* COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
|
||||
* SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
|
||||
* CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
|
||||
* HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
|
||||
* SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
|
||||
* LIMITED REMEDY.
|
||||
*
|
||||
* 4.3. Licensee shall not export, either directly or indirectly, any of this
|
||||
* software or system incorporating such software without first obtaining any
|
||||
* required license or other approval from the U. S. Department of Commerce or
|
||||
* any other agency or department of the United States Government. In the
|
||||
* event Licensee exports any such software from the United States or
|
||||
* re-exports any such software from a foreign destination, Licensee shall
|
||||
* ensure that the distribution and export/re-export of the software is in
|
||||
* compliance with all laws, regulations, orders, or other restrictions of the
|
||||
* U.S. Export Administration Regulations. Licensee agrees that neither it nor
|
||||
* any of its subsidiaries will export/re-export any technical data, process,
|
||||
* software, or service, directly or indirectly, to any country for which the
|
||||
* United States government or any agency thereof requires an export license,
|
||||
* other governmental approval, or letter of assurance, without first obtaining
|
||||
* such license, approval or letter.
|
||||
*
|
||||
*****************************************************************************/
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef __ACOUTPUT_H__
|
||||
#define __ACOUTPUT_H__
|
||||
@@ -144,6 +72,7 @@
|
||||
#define ACPI_EXAMPLE 0x00004000
|
||||
#define ACPI_DRIVER 0x00008000
|
||||
#define DT_COMPILER 0x00010000
|
||||
#define ASL_PREPROCESSOR 0x00020000
|
||||
|
||||
#define ACPI_ALL_COMPONENTS 0x0001FFFF
|
||||
#define ACPI_COMPONENT_DEFAULT (ACPI_ALL_COMPONENTS)
|
||||
@@ -258,13 +187,19 @@
|
||||
|
||||
#if defined (ACPI_DEBUG_OUTPUT) || !defined (ACPI_NO_ERROR_MESSAGES)
|
||||
/*
|
||||
* Module name is included in both debug and non-debug versions primarily for
|
||||
* error messages. The __FILE__ macro is not very useful for this, because it
|
||||
* often includes the entire pathname to the module
|
||||
* The module name is used primarily for error and debug messages.
|
||||
* The __FILE__ macro is not very useful for this, because it
|
||||
* usually includes the entire pathname to the module making the
|
||||
* debug output difficult to read.
|
||||
*/
|
||||
#define ACPI_MODULE_NAME(Name) static const char ACPI_UNUSED_VAR _AcpiModuleName[] = Name;
|
||||
#else
|
||||
/*
|
||||
* For the no-debug and no-error-msg cases, we must at least define
|
||||
* a null module name.
|
||||
*/
|
||||
#define ACPI_MODULE_NAME(Name)
|
||||
#define _AcpiModuleName ""
|
||||
#endif
|
||||
|
||||
/*
|
||||
@@ -282,6 +217,8 @@
|
||||
#define ACPI_WARNING(plist) AcpiWarning plist
|
||||
#define ACPI_EXCEPTION(plist) AcpiException plist
|
||||
#define ACPI_ERROR(plist) AcpiError plist
|
||||
#define ACPI_BIOS_WARNING(plist) AcpiBiosWarning plist
|
||||
#define ACPI_BIOS_ERROR(plist) AcpiBiosError plist
|
||||
#define ACPI_DEBUG_OBJECT(obj,l,i) AcpiExDoDebugObject(obj,l,i)
|
||||
|
||||
#else
|
||||
@@ -292,6 +229,8 @@
|
||||
#define ACPI_WARNING(plist)
|
||||
#define ACPI_EXCEPTION(plist)
|
||||
#define ACPI_ERROR(plist)
|
||||
#define ACPI_BIOS_WARNING(plist)
|
||||
#define ACPI_BIOS_ERROR(plist)
|
||||
#define ACPI_DEBUG_OBJECT(obj,l,i)
|
||||
|
||||
#endif /* ACPI_NO_ERROR_MESSAGES */
|
||||
@@ -328,25 +267,199 @@
|
||||
* Common parameters used for debug output functions:
|
||||
* line number, function name, module(file) name, component ID
|
||||
*/
|
||||
#define ACPI_DEBUG_PARAMETERS __LINE__, ACPI_GET_FUNCTION_NAME, _AcpiModuleName, _COMPONENT
|
||||
#define ACPI_DEBUG_PARAMETERS \
|
||||
__LINE__, ACPI_GET_FUNCTION_NAME, _AcpiModuleName, _COMPONENT
|
||||
|
||||
/* Check if debug output is currently dynamically enabled */
|
||||
|
||||
#define ACPI_IS_DEBUG_ENABLED(Level, Component) \
|
||||
((Level & AcpiDbgLevel) && (Component & AcpiDbgLayer))
|
||||
|
||||
/*
|
||||
* Master debug print macros
|
||||
* Print message if and only if:
|
||||
* 1) Debug print for the current component is enabled
|
||||
* 2) Debug error level or trace level for the print statement is enabled
|
||||
*
|
||||
* November 2012: Moved the runtime check for whether to actually emit the
|
||||
* debug message outside of the print function itself. This improves overall
|
||||
* performance at a relatively small code cost. Implementation involves the
|
||||
* use of variadic macros supported by C99.
|
||||
*
|
||||
* Note: the ACPI_DO_WHILE0 macro is used to prevent some compilers from
|
||||
* complaining about these constructs. On other compilers the do...while
|
||||
* adds some extra code, so this feature is optional.
|
||||
*/
|
||||
#define ACPI_DEBUG_PRINT(plist) AcpiDebugPrint plist
|
||||
#define ACPI_DEBUG_PRINT_RAW(plist) AcpiDebugPrintRaw plist
|
||||
|
||||
#ifdef ACPI_USE_DO_WHILE_0
|
||||
#define ACPI_DO_WHILE0(a) do a while(0)
|
||||
#else
|
||||
#define ACPI_DO_WHILE0(a) a
|
||||
#endif
|
||||
|
||||
/* DEBUG_PRINT functions */
|
||||
|
||||
#define ACPI_DEBUG_PRINT(plist) ACPI_ACTUAL_DEBUG plist
|
||||
#define ACPI_DEBUG_PRINT_RAW(plist) ACPI_ACTUAL_DEBUG_RAW plist
|
||||
|
||||
/* Helper macros for DEBUG_PRINT */
|
||||
|
||||
#define ACPI_DO_DEBUG_PRINT(Function, Level, Line, Filename, Modulename, Component, ...) \
|
||||
ACPI_DO_WHILE0 ({ \
|
||||
if (ACPI_IS_DEBUG_ENABLED (Level, Component)) \
|
||||
{ \
|
||||
Function (Level, Line, Filename, Modulename, Component, __VA_ARGS__); \
|
||||
} \
|
||||
})
|
||||
|
||||
#define ACPI_ACTUAL_DEBUG(Level, Line, Filename, Modulename, Component, ...) \
|
||||
ACPI_DO_DEBUG_PRINT (AcpiDebugPrint, Level, Line, \
|
||||
Filename, Modulename, Component, __VA_ARGS__)
|
||||
|
||||
#define ACPI_ACTUAL_DEBUG_RAW(Level, Line, Filename, Modulename, Component, ...) \
|
||||
ACPI_DO_DEBUG_PRINT (AcpiDebugPrintRaw, Level, Line, \
|
||||
Filename, Modulename, Component, __VA_ARGS__)
|
||||
|
||||
|
||||
/*
|
||||
* Function entry tracing
|
||||
*
|
||||
* The name of the function is emitted as a local variable that is
|
||||
* intended to be used by both the entry trace and the exit trace.
|
||||
*/
|
||||
|
||||
/* Helper macro */
|
||||
|
||||
#define ACPI_TRACE_ENTRY(Name, Function, Type, Param) \
|
||||
ACPI_FUNCTION_NAME (Name) \
|
||||
Function (ACPI_DEBUG_PARAMETERS, (Type) (Param))
|
||||
|
||||
/* The actual entry trace macros */
|
||||
|
||||
#define ACPI_FUNCTION_TRACE(Name) \
|
||||
ACPI_FUNCTION_NAME(Name) \
|
||||
AcpiUtTrace (ACPI_DEBUG_PARAMETERS)
|
||||
|
||||
#define ACPI_FUNCTION_TRACE_PTR(Name, Pointer) \
|
||||
ACPI_TRACE_ENTRY (Name, AcpiUtTracePtr, void *, Pointer)
|
||||
|
||||
#define ACPI_FUNCTION_TRACE_U32(Name, Value) \
|
||||
ACPI_TRACE_ENTRY (Name, AcpiUtTraceU32, UINT32, Value)
|
||||
|
||||
#define ACPI_FUNCTION_TRACE_STR(Name, String) \
|
||||
ACPI_TRACE_ENTRY (Name, AcpiUtTraceStr, char *, String)
|
||||
|
||||
#define ACPI_FUNCTION_ENTRY() \
|
||||
AcpiUtTrackStackPtr()
|
||||
|
||||
|
||||
/*
|
||||
* Function exit tracing
|
||||
*
|
||||
* These macros include a return statement. This is usually considered
|
||||
* bad form, but having a separate exit macro before the actual return
|
||||
* is very ugly and difficult to maintain.
|
||||
*
|
||||
* One of the FUNCTION_TRACE macros above must be used in conjunction
|
||||
* with these macros so that "_AcpiFunctionName" is defined.
|
||||
*
|
||||
* There are two versions of most of the return macros. The default version is
|
||||
* safer, since it avoids side-effects by guaranteeing that the argument will
|
||||
* not be evaluated twice.
|
||||
*
|
||||
* A less-safe version of the macros is provided for optional use if the
|
||||
* compiler uses excessive CPU stack (for example, this may happen in the
|
||||
* debug case if code optimzation is disabled.)
|
||||
*/
|
||||
|
||||
/* Exit trace helper macro */
|
||||
|
||||
#ifndef ACPI_SIMPLE_RETURN_MACROS
|
||||
|
||||
#define ACPI_TRACE_EXIT(Function, Type, Param) \
|
||||
ACPI_DO_WHILE0 ({ \
|
||||
register Type _Param = (Type) (Param); \
|
||||
Function (ACPI_DEBUG_PARAMETERS, _Param); \
|
||||
return (_Param); \
|
||||
})
|
||||
|
||||
#else /* Use original less-safe macros */
|
||||
|
||||
#define ACPI_TRACE_EXIT(Function, Type, Param) \
|
||||
ACPI_DO_WHILE0 ({ \
|
||||
Function (ACPI_DEBUG_PARAMETERS, (Type) (Param)); \
|
||||
return (Param); \
|
||||
})
|
||||
|
||||
#endif /* ACPI_SIMPLE_RETURN_MACROS */
|
||||
|
||||
/* The actual exit macros */
|
||||
|
||||
#define return_VOID \
|
||||
ACPI_DO_WHILE0 ({ \
|
||||
AcpiUtExit (ACPI_DEBUG_PARAMETERS); \
|
||||
return; \
|
||||
})
|
||||
|
||||
#define return_ACPI_STATUS(Status) \
|
||||
ACPI_TRACE_EXIT (AcpiUtStatusExit, ACPI_STATUS, Status)
|
||||
|
||||
#define return_PTR(Pointer) \
|
||||
ACPI_TRACE_EXIT (AcpiUtPtrExit, void *, Pointer)
|
||||
|
||||
#define return_VALUE(Value) \
|
||||
ACPI_TRACE_EXIT (AcpiUtValueExit, UINT64, Value)
|
||||
|
||||
#define return_UINT32(Value) \
|
||||
ACPI_TRACE_EXIT (AcpiUtValueExit, UINT32, Value)
|
||||
|
||||
#define return_UINT8(Value) \
|
||||
ACPI_TRACE_EXIT (AcpiUtValueExit, UINT8, Value)
|
||||
|
||||
/* Conditional execution */
|
||||
|
||||
#define ACPI_DEBUG_EXEC(a) a
|
||||
#define ACPI_DEBUG_ONLY_MEMBERS(a) a;
|
||||
#define _VERBOSE_STRUCTURES
|
||||
|
||||
|
||||
/* Various object display routines for debug */
|
||||
|
||||
#define ACPI_DUMP_STACK_ENTRY(a) AcpiExDumpOperand((a), 0)
|
||||
#define ACPI_DUMP_OPERANDS(a, b ,c) AcpiExDumpOperands(a, b, c)
|
||||
#define ACPI_DUMP_ENTRY(a, b) AcpiNsDumpEntry (a, b)
|
||||
#define ACPI_DUMP_PATHNAME(a, b, c, d) AcpiNsDumpPathname(a, b, c, d)
|
||||
#define ACPI_DUMP_BUFFER(a, b) AcpiUtDebugDumpBuffer((UINT8 *) a, b, DB_BYTE_DISPLAY, _COMPONENT)
|
||||
|
||||
#else /* ACPI_DEBUG_OUTPUT */
|
||||
/*
|
||||
* This is the non-debug case -- make everything go away,
|
||||
* leaving no executable debug code!
|
||||
*/
|
||||
#define ACPI_FUNCTION_NAME(a)
|
||||
#define ACPI_DEBUG_PRINT(pl)
|
||||
#define ACPI_DEBUG_PRINT_RAW(pl)
|
||||
#define ACPI_DEBUG_EXEC(a)
|
||||
#define ACPI_DEBUG_ONLY_MEMBERS(a)
|
||||
#define ACPI_FUNCTION_NAME(a)
|
||||
#define ACPI_FUNCTION_TRACE(a)
|
||||
#define ACPI_FUNCTION_TRACE_PTR(a, b)
|
||||
#define ACPI_FUNCTION_TRACE_U32(a, b)
|
||||
#define ACPI_FUNCTION_TRACE_STR(a, b)
|
||||
#define ACPI_FUNCTION_ENTRY()
|
||||
#define ACPI_DUMP_STACK_ENTRY(a)
|
||||
#define ACPI_DUMP_OPERANDS(a, b, c)
|
||||
#define ACPI_DUMP_ENTRY(a, b)
|
||||
#define ACPI_DUMP_PATHNAME(a, b, c, d)
|
||||
#define ACPI_DUMP_BUFFER(a, b)
|
||||
#define ACPI_IS_DEBUG_ENABLED(Level, Component) 0
|
||||
|
||||
/* Return macros must have a return statement at the minimum */
|
||||
|
||||
#define return_VOID return
|
||||
#define return_ACPI_STATUS(s) return(s)
|
||||
#define return_PTR(s) return(s)
|
||||
#define return_VALUE(s) return(s)
|
||||
#define return_UINT8(s) return(s)
|
||||
#define return_UINT32(s) return(s)
|
||||
|
||||
#endif /* ACPI_DEBUG_OUTPUT */
|
||||
|
||||
|
||||
@@ -4,115 +4,42 @@
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
* 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.
|
||||
*
|
||||
* 2.1. This is your license from Intel Corp. under its intellectual property
|
||||
* rights. You may have additional license terms from the party that provided
|
||||
* you this software, covering your right to use that party's intellectual
|
||||
* property rights.
|
||||
* 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.
|
||||
*
|
||||
* 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
|
||||
* copy of the source code appearing in this file ("Covered Code") an
|
||||
* irrevocable, perpetual, worldwide license under Intel's copyrights in the
|
||||
* base code distributed originally by Intel ("Original Intel Code") to copy,
|
||||
* make derivatives, distribute, use and display any portion of the Covered
|
||||
* Code in any form, with the right to sublicense such rights; and
|
||||
*
|
||||
* 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
|
||||
* license (with the right to sublicense), under only those claims of Intel
|
||||
* patents that are infringed by the Original Intel Code, to make, use, sell,
|
||||
* offer to sell, and import the Covered Code and derivative works thereof
|
||||
* solely to the minimum extent necessary to exercise the above copyright
|
||||
* license, and in no event shall the patent license extend to any additions
|
||||
* to or modifications of the Original Intel Code. No other license or right
|
||||
* is granted directly or by implication, estoppel or otherwise;
|
||||
*
|
||||
* The above copyright and patent license is granted only if the following
|
||||
* conditions are met:
|
||||
*
|
||||
* 3. Conditions
|
||||
*
|
||||
* 3.1. Redistribution of Source with Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification with rights to further distribute source must include
|
||||
* the above Copyright Notice, the above License, this list of Conditions,
|
||||
* and the following Disclaimer and Export Compliance provision. In addition,
|
||||
* Licensee must cause all Covered Code to which Licensee contributes to
|
||||
* contain a file documenting the changes Licensee made to create that Covered
|
||||
* Code and the date of any change. Licensee must include in that file the
|
||||
* documentation of any changes made by any predecessor Licensee. Licensee
|
||||
* must include a prominent statement that the modification is derived,
|
||||
* directly or indirectly, from Original Intel Code.
|
||||
*
|
||||
* 3.2. Redistribution of Source with no Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification without rights to further distribute source must
|
||||
* include the following Disclaimer and Export Compliance provision in the
|
||||
* documentation and/or other materials provided with distribution. In
|
||||
* addition, Licensee may not authorize further sublicense of source of any
|
||||
* portion of the Covered Code, and must include terms to the effect that the
|
||||
* license from Licensee to its licensee is limited to the intellectual
|
||||
* property embodied in the software Licensee provides to its licensee, and
|
||||
* not to intellectual property embodied in modifications its licensee may
|
||||
* make.
|
||||
*
|
||||
* 3.3. Redistribution of Executable. Redistribution in executable form of any
|
||||
* substantial portion of the Covered Code or modification must reproduce the
|
||||
* above Copyright Notice, and the following Disclaimer and Export Compliance
|
||||
* provision in the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3.4. Intel retains all right, title, and interest in and to the Original
|
||||
* Intel Code.
|
||||
*
|
||||
* 3.5. Neither the name Intel nor any other trademark owned or controlled by
|
||||
* Intel shall be used in advertising or otherwise to promote the sale, use or
|
||||
* other dealings in products derived from or relating to the Covered Code
|
||||
* without prior written authorization from Intel.
|
||||
*
|
||||
* 4. Disclaimer and Export Compliance
|
||||
*
|
||||
* 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
|
||||
* HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
|
||||
* IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
|
||||
* INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
|
||||
* UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
|
||||
* PARTICULAR PURPOSE.
|
||||
*
|
||||
* 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
|
||||
* OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
|
||||
* COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
|
||||
* SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
|
||||
* CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
|
||||
* HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
|
||||
* SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
|
||||
* LIMITED REMEDY.
|
||||
*
|
||||
* 4.3. Licensee shall not export, either directly or indirectly, any of this
|
||||
* software or system incorporating such software without first obtaining any
|
||||
* required license or other approval from the U. S. Department of Commerce or
|
||||
* any other agency or department of the United States Government. In the
|
||||
* event Licensee exports any such software from the United States or
|
||||
* re-exports any such software from a foreign destination, Licensee shall
|
||||
* ensure that the distribution and export/re-export of the software is in
|
||||
* compliance with all laws, regulations, orders, or other restrictions of the
|
||||
* U.S. Export Administration Regulations. Licensee agrees that neither it nor
|
||||
* any of its subsidiaries will export/re-export any technical data, process,
|
||||
* software, or service, directly or indirectly, to any country for which the
|
||||
* United States government or any agency thereof requires an export license,
|
||||
* other governmental approval, or letter of assurance, without first obtaining
|
||||
* such license, approval or letter.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef __ACPARSER_H__
|
||||
#define __ACPARSER_H__
|
||||
@@ -201,7 +128,36 @@ AcpiPsGetParent (
|
||||
|
||||
|
||||
/*
|
||||
* psopcode - AML Opcode information
|
||||
* psobject - support for parse object processing
|
||||
*/
|
||||
ACPI_STATUS
|
||||
AcpiPsBuildNamedOp (
|
||||
ACPI_WALK_STATE *WalkState,
|
||||
UINT8 *AmlOpStart,
|
||||
ACPI_PARSE_OBJECT *UnnamedOp,
|
||||
ACPI_PARSE_OBJECT **Op);
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiPsCreateOp (
|
||||
ACPI_WALK_STATE *WalkState,
|
||||
UINT8 *AmlOpStart,
|
||||
ACPI_PARSE_OBJECT **NewOp);
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiPsCompleteOp (
|
||||
ACPI_WALK_STATE *WalkState,
|
||||
ACPI_PARSE_OBJECT **Op,
|
||||
ACPI_STATUS Status);
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiPsCompleteFinalOp (
|
||||
ACPI_WALK_STATE *WalkState,
|
||||
ACPI_PARSE_OBJECT *Op,
|
||||
ACPI_STATUS Status);
|
||||
|
||||
|
||||
/*
|
||||
* psopinfo - AML Opcode information
|
||||
*/
|
||||
const ACPI_OPCODE_INFO *
|
||||
AcpiPsGetOpcodeInfo (
|
||||
@@ -366,10 +322,6 @@ BOOLEAN
|
||||
AcpiPsIsLeadingChar (
|
||||
UINT32 c);
|
||||
|
||||
BOOLEAN
|
||||
AcpiPsIsPrefixChar (
|
||||
UINT32 c);
|
||||
|
||||
UINT32
|
||||
AcpiPsGetName(
|
||||
ACPI_PARSE_OBJECT *op);
|
||||
|
||||
@@ -4,114 +4,42 @@
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
* 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.
|
||||
*
|
||||
* 2.1. This is your license from Intel Corp. under its intellectual property
|
||||
* rights. You may have additional license terms from the party that provided
|
||||
* you this software, covering your right to use that party's intellectual
|
||||
* property rights.
|
||||
* 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.
|
||||
*
|
||||
* 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
|
||||
* copy of the source code appearing in this file ("Covered Code") an
|
||||
* irrevocable, perpetual, worldwide license under Intel's copyrights in the
|
||||
* base code distributed originally by Intel ("Original Intel Code") to copy,
|
||||
* make derivatives, distribute, use and display any portion of the Covered
|
||||
* Code in any form, with the right to sublicense such rights; and
|
||||
*
|
||||
* 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
|
||||
* license (with the right to sublicense), under only those claims of Intel
|
||||
* patents that are infringed by the Original Intel Code, to make, use, sell,
|
||||
* offer to sell, and import the Covered Code and derivative works thereof
|
||||
* solely to the minimum extent necessary to exercise the above copyright
|
||||
* license, and in no event shall the patent license extend to any additions
|
||||
* to or modifications of the Original Intel Code. No other license or right
|
||||
* is granted directly or by implication, estoppel or otherwise;
|
||||
*
|
||||
* The above copyright and patent license is granted only if the following
|
||||
* conditions are met:
|
||||
*
|
||||
* 3. Conditions
|
||||
*
|
||||
* 3.1. Redistribution of Source with Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification with rights to further distribute source must include
|
||||
* the above Copyright Notice, the above License, this list of Conditions,
|
||||
* and the following Disclaimer and Export Compliance provision. In addition,
|
||||
* Licensee must cause all Covered Code to which Licensee contributes to
|
||||
* contain a file documenting the changes Licensee made to create that Covered
|
||||
* Code and the date of any change. Licensee must include in that file the
|
||||
* documentation of any changes made by any predecessor Licensee. Licensee
|
||||
* must include a prominent statement that the modification is derived,
|
||||
* directly or indirectly, from Original Intel Code.
|
||||
*
|
||||
* 3.2. Redistribution of Source with no Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification without rights to further distribute source must
|
||||
* include the following Disclaimer and Export Compliance provision in the
|
||||
* documentation and/or other materials provided with distribution. In
|
||||
* addition, Licensee may not authorize further sublicense of source of any
|
||||
* portion of the Covered Code, and must include terms to the effect that the
|
||||
* license from Licensee to its licensee is limited to the intellectual
|
||||
* property embodied in the software Licensee provides to its licensee, and
|
||||
* not to intellectual property embodied in modifications its licensee may
|
||||
* make.
|
||||
*
|
||||
* 3.3. Redistribution of Executable. Redistribution in executable form of any
|
||||
* substantial portion of the Covered Code or modification must reproduce the
|
||||
* above Copyright Notice, and the following Disclaimer and Export Compliance
|
||||
* provision in the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3.4. Intel retains all right, title, and interest in and to the Original
|
||||
* Intel Code.
|
||||
*
|
||||
* 3.5. Neither the name Intel nor any other trademark owned or controlled by
|
||||
* Intel shall be used in advertising or otherwise to promote the sale, use or
|
||||
* other dealings in products derived from or relating to the Covered Code
|
||||
* without prior written authorization from Intel.
|
||||
*
|
||||
* 4. Disclaimer and Export Compliance
|
||||
*
|
||||
* 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
|
||||
* HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
|
||||
* IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
|
||||
* INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
|
||||
* UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
|
||||
* PARTICULAR PURPOSE.
|
||||
*
|
||||
* 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
|
||||
* OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
|
||||
* COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
|
||||
* SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
|
||||
* CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
|
||||
* HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
|
||||
* SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
|
||||
* LIMITED REMEDY.
|
||||
*
|
||||
* 4.3. Licensee shall not export, either directly or indirectly, any of this
|
||||
* software or system incorporating such software without first obtaining any
|
||||
* required license or other approval from the U. S. Department of Commerce or
|
||||
* any other agency or department of the United States Government. In the
|
||||
* event Licensee exports any such software from the United States or
|
||||
* re-exports any such software from a foreign destination, Licensee shall
|
||||
* ensure that the distribution and export/re-export of the software is in
|
||||
* compliance with all laws, regulations, orders, or other restrictions of the
|
||||
* U.S. Export Administration Regulations. Licensee agrees that neither it nor
|
||||
* any of its subsidiaries will export/re-export any technical data, process,
|
||||
* software, or service, directly or indirectly, to any country for which the
|
||||
* United States government or any agency thereof requires an export license,
|
||||
* other governmental approval, or letter of assurance, without first obtaining
|
||||
* such license, approval or letter.
|
||||
*
|
||||
*****************************************************************************/
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef __ACPI_H__
|
||||
#define __ACPI_H__
|
||||
@@ -134,5 +62,6 @@
|
||||
#include "acrestyp.h" /* Resource Descriptor structs */
|
||||
#include "acpiosxf.h" /* OSL interfaces (ACPICA-to-OS) */
|
||||
#include "acpixf.h" /* ACPI core subsystem external interfaces */
|
||||
#include "platform/acenvex.h" /* Extra environment-specific items */
|
||||
|
||||
#endif /* __ACPI_H__ */
|
||||
|
||||
@@ -1,122 +1,47 @@
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* Name: acpiosxf.h - All interfaces to the OS Services Layer (OSL). These
|
||||
* Name: acpiosxf.h - All interfaces to the OS Services Layer (OSL). These
|
||||
* interfaces must be implemented by OSL to interface the
|
||||
* ACPI components to the host operating system.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
* 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.
|
||||
*
|
||||
* 2.1. This is your license from Intel Corp. under its intellectual property
|
||||
* rights. You may have additional license terms from the party that provided
|
||||
* you this software, covering your right to use that party's intellectual
|
||||
* property rights.
|
||||
* 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.
|
||||
*
|
||||
* 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
|
||||
* copy of the source code appearing in this file ("Covered Code") an
|
||||
* irrevocable, perpetual, worldwide license under Intel's copyrights in the
|
||||
* base code distributed originally by Intel ("Original Intel Code") to copy,
|
||||
* make derivatives, distribute, use and display any portion of the Covered
|
||||
* Code in any form, with the right to sublicense such rights; and
|
||||
*
|
||||
* 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
|
||||
* license (with the right to sublicense), under only those claims of Intel
|
||||
* patents that are infringed by the Original Intel Code, to make, use, sell,
|
||||
* offer to sell, and import the Covered Code and derivative works thereof
|
||||
* solely to the minimum extent necessary to exer
|
||||
se the above copyright
|
||||
* license, and in no event shall the patent license extend to any additions
|
||||
* to or modifications of the Original Intel Code. No other license or right
|
||||
* is granted directly or by implication, estoppel or otherwise;
|
||||
*
|
||||
* The above copyright and patent license is granted only if the following
|
||||
* conditions are met:
|
||||
*
|
||||
* 3. Conditions
|
||||
*
|
||||
* 3.1. Redistribution of Source with Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification with rights to further distribute source must include
|
||||
* the above Copyright Notice, the above License, this list of Conditions,
|
||||
* and the following Disclaimer and Export Compliance provision. In addition,
|
||||
* Licensee must cause all Covered Code to which Licensee contributes to
|
||||
* contain a file documenting the changes Licensee made to create that Covered
|
||||
* Code and the date of any change. Licensee must include in that file the
|
||||
* documentation of any changes made by any predecessor Licensee. Licensee
|
||||
* must include a prominent statement that the modification is derived,
|
||||
* directly or indirectly, from Original Intel Code.
|
||||
*
|
||||
* 3.2. Redistribution of Source with no Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification without rights to further distribute source must
|
||||
* include the following Disclaimer and Export Compliance provision in the
|
||||
* documentation and/or other materials provided with distribution. In
|
||||
* addition, Licensee may not authorize further sublicense of source of any
|
||||
* portion of the Covered Code, and must include terms to the effect that the
|
||||
* license from Licensee to its licensee is limited to the intellectual
|
||||
* property embodied in the software Licensee provides to its licensee, and
|
||||
* not to intellectual property embodied in modifications its licensee may
|
||||
* make.
|
||||
*
|
||||
* 3.3. Redistribution of Executable. Redistribution in executable form of any
|
||||
* substantial portion of the Covered Code or modification must reproduce the
|
||||
* above Copyright Notice, and the following Disclaimer and Export Compliance
|
||||
* provision in the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3.4. Intel retains all right, title, and interest in and to the Original
|
||||
* Intel Code.
|
||||
*
|
||||
* 3.5. Neither the name Intel nor any other trademark owned or controlled by
|
||||
* Intel shall be used in advertising or otherwise to promote the sale, use or
|
||||
* other dealings in products derived from or relating to the Covered Code
|
||||
* without prior written authorization from Intel.
|
||||
*
|
||||
* 4. Disclaimer and Export Compliance
|
||||
*
|
||||
* 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
|
||||
* HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
|
||||
* IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
|
||||
* INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
|
||||
* UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
|
||||
* PARTICULAR PURPOSE.
|
||||
*
|
||||
* 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
|
||||
* OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
|
||||
* COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
|
||||
* SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
|
||||
* CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
|
||||
* HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
|
||||
* SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
|
||||
* LIMITED REMEDY.
|
||||
*
|
||||
* 4.3. Licensee shall not export, either directly or indirectly, any of this
|
||||
* software or system incorporating such software without first obtaining any
|
||||
* required license or other approval from the U. S. Department of Commerce or
|
||||
* any other agency or department of the United States Government. In the
|
||||
* event Licensee exports any such software from the United States or
|
||||
* re-exports any such software from a foreign destination, Licensee shall
|
||||
* ensure that the distribution and export/re-export of the software is in
|
||||
* compliance with all laws, regulations, orders, or other restrictions of the
|
||||
* U.S. Export Administration Regulations. Licensee agrees that neither it nor
|
||||
* any of its subsidiaries will export/re-export any technical data, process,
|
||||
* software, or service, directly or indirectly, to any country for which the
|
||||
* United States government or any agency thereof requires an export license,
|
||||
* other governmental approval, or letter of assurance, without first obtaining
|
||||
* such license, approval or letter.
|
||||
*
|
||||
*****************************************************************************/
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef __ACPIOSXF_H__
|
||||
#define __ACPIOSXF_H__
|
||||
@@ -159,77 +84,111 @@ typedef struct acpi_signal_fatal_info
|
||||
/*
|
||||
* OSL Initialization and shutdown primitives
|
||||
*/
|
||||
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsInitialize
|
||||
ACPI_STATUS
|
||||
AcpiOsInitialize (
|
||||
void);
|
||||
#endif
|
||||
|
||||
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsTerminate
|
||||
ACPI_STATUS
|
||||
AcpiOsTerminate (
|
||||
void);
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* ACPI Table interfaces
|
||||
*/
|
||||
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsGetRootPointer
|
||||
ACPI_PHYSICAL_ADDRESS
|
||||
AcpiOsGetRootPointer (
|
||||
void);
|
||||
#endif
|
||||
|
||||
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsPredefinedOverride
|
||||
ACPI_STATUS
|
||||
AcpiOsPredefinedOverride (
|
||||
const ACPI_PREDEFINED_NAMES *InitVal,
|
||||
ACPI_STRING *NewVal);
|
||||
#endif
|
||||
|
||||
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsTableOverride
|
||||
ACPI_STATUS
|
||||
AcpiOsTableOverride (
|
||||
ACPI_TABLE_HEADER *ExistingTable,
|
||||
ACPI_TABLE_HEADER **NewTable);
|
||||
#endif
|
||||
|
||||
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsPhysicalTableOverride
|
||||
ACPI_STATUS
|
||||
AcpiOsPhysicalTableOverride (
|
||||
ACPI_TABLE_HEADER *ExistingTable,
|
||||
ACPI_PHYSICAL_ADDRESS *NewAddress,
|
||||
UINT32 *NewTableLength);
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Spinlock primitives
|
||||
*/
|
||||
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsCreateLock
|
||||
ACPI_STATUS
|
||||
AcpiOsCreateLock (
|
||||
ACPI_SPINLOCK *OutHandle);
|
||||
#endif
|
||||
|
||||
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsDeleteLock
|
||||
void
|
||||
AcpiOsDeleteLock (
|
||||
ACPI_SPINLOCK Handle);
|
||||
#endif
|
||||
|
||||
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsAcquireLock
|
||||
ACPI_CPU_FLAGS
|
||||
AcpiOsAcquireLock (
|
||||
ACPI_SPINLOCK Handle);
|
||||
#endif
|
||||
|
||||
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsReleaseLock
|
||||
void
|
||||
AcpiOsReleaseLock (
|
||||
ACPI_SPINLOCK Handle,
|
||||
ACPI_CPU_FLAGS Flags);
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Semaphore primitives
|
||||
*/
|
||||
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsCreateSemaphore
|
||||
ACPI_STATUS
|
||||
AcpiOsCreateSemaphore (
|
||||
UINT32 MaxUnits,
|
||||
UINT32 InitialUnits,
|
||||
ACPI_SEMAPHORE *OutHandle);
|
||||
#endif
|
||||
|
||||
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsDeleteSemaphore
|
||||
ACPI_STATUS
|
||||
AcpiOsDeleteSemaphore (
|
||||
ACPI_SEMAPHORE Handle);
|
||||
#endif
|
||||
|
||||
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsWaitSemaphore
|
||||
ACPI_STATUS
|
||||
AcpiOsWaitSemaphore (
|
||||
ACPI_SEMAPHORE Handle,
|
||||
UINT32 Units,
|
||||
UINT16 Timeout);
|
||||
#endif
|
||||
|
||||
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsSignalSemaphore
|
||||
ACPI_STATUS
|
||||
AcpiOsSignalSemaphore (
|
||||
ACPI_SEMAPHORE Handle,
|
||||
UINT32 Units);
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
@@ -238,151 +197,208 @@ AcpiOsSignalSemaphore (
|
||||
*/
|
||||
#if (ACPI_MUTEX_TYPE != ACPI_BINARY_SEMAPHORE)
|
||||
|
||||
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsCreateMutex
|
||||
ACPI_STATUS
|
||||
AcpiOsCreateMutex (
|
||||
ACPI_MUTEX *OutHandle);
|
||||
#endif
|
||||
|
||||
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsDeleteMutex
|
||||
void
|
||||
AcpiOsDeleteMutex (
|
||||
ACPI_MUTEX Handle);
|
||||
#endif
|
||||
|
||||
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsAcquireMutex
|
||||
ACPI_STATUS
|
||||
AcpiOsAcquireMutex (
|
||||
ACPI_MUTEX Handle,
|
||||
UINT16 Timeout);
|
||||
#endif
|
||||
|
||||
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsReleaseMutex
|
||||
void
|
||||
AcpiOsReleaseMutex (
|
||||
ACPI_MUTEX Handle);
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Memory allocation and mapping
|
||||
*/
|
||||
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsAllocate
|
||||
void *
|
||||
AcpiOsAllocate (
|
||||
ACPI_SIZE Size);
|
||||
#endif
|
||||
|
||||
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsAllocateZeroed
|
||||
void *
|
||||
AcpiOsAllocateZeroed (
|
||||
ACPI_SIZE Size);
|
||||
#endif
|
||||
|
||||
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsFree
|
||||
void
|
||||
AcpiOsFree (
|
||||
void * Memory);
|
||||
#endif
|
||||
|
||||
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsMapMemory
|
||||
void *
|
||||
AcpiOsMapMemory (
|
||||
ACPI_PHYSICAL_ADDRESS Where,
|
||||
ACPI_SIZE Length);
|
||||
#endif
|
||||
|
||||
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsUnmapMemory
|
||||
void
|
||||
AcpiOsUnmapMemory (
|
||||
void *LogicalAddress,
|
||||
ACPI_SIZE Size);
|
||||
#endif
|
||||
|
||||
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsGetPhysicalAddress
|
||||
ACPI_STATUS
|
||||
AcpiOsGetPhysicalAddress (
|
||||
void *LogicalAddress,
|
||||
ACPI_PHYSICAL_ADDRESS *PhysicalAddress);
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Memory/Object Cache
|
||||
*/
|
||||
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsCreateCache
|
||||
ACPI_STATUS
|
||||
AcpiOsCreateCache (
|
||||
char *CacheName,
|
||||
UINT16 ObjectSize,
|
||||
UINT16 MaxDepth,
|
||||
ACPI_CACHE_T **ReturnCache);
|
||||
#endif
|
||||
|
||||
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsDeleteCache
|
||||
ACPI_STATUS
|
||||
AcpiOsDeleteCache (
|
||||
ACPI_CACHE_T *Cache);
|
||||
#endif
|
||||
|
||||
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsPurgeCache
|
||||
ACPI_STATUS
|
||||
AcpiOsPurgeCache (
|
||||
ACPI_CACHE_T *Cache);
|
||||
#endif
|
||||
|
||||
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsAcquireObject
|
||||
void *
|
||||
AcpiOsAcquireObject (
|
||||
ACPI_CACHE_T *Cache);
|
||||
#endif
|
||||
|
||||
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsReleaseObject
|
||||
ACPI_STATUS
|
||||
AcpiOsReleaseObject (
|
||||
ACPI_CACHE_T *Cache,
|
||||
void *Object);
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Interrupt handlers
|
||||
*/
|
||||
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsInstallInterruptHandler
|
||||
ACPI_STATUS
|
||||
AcpiOsInstallInterruptHandler (
|
||||
UINT32 InterruptNumber,
|
||||
ACPI_OSD_HANDLER ServiceRoutine,
|
||||
void *Context);
|
||||
#endif
|
||||
|
||||
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsRemoveInterruptHandler
|
||||
ACPI_STATUS
|
||||
AcpiOsRemoveInterruptHandler (
|
||||
UINT32 InterruptNumber,
|
||||
ACPI_OSD_HANDLER ServiceRoutine);
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Threads and Scheduling
|
||||
*/
|
||||
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsGetThreadId
|
||||
ACPI_THREAD_ID
|
||||
AcpiOsGetThreadId (
|
||||
void);
|
||||
#endif
|
||||
|
||||
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsExecute
|
||||
ACPI_STATUS
|
||||
AcpiOsExecute (
|
||||
ACPI_EXECUTE_TYPE Type,
|
||||
ACPI_OSD_EXEC_CALLBACK Function,
|
||||
void *Context);
|
||||
#endif
|
||||
|
||||
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsWaitEventsComplete
|
||||
void
|
||||
AcpiOsWaitEventsComplete (
|
||||
void *Context);
|
||||
void);
|
||||
#endif
|
||||
|
||||
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsSleep
|
||||
void
|
||||
AcpiOsSleep (
|
||||
UINT64 Milliseconds);
|
||||
#endif
|
||||
|
||||
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsStall
|
||||
void
|
||||
AcpiOsStall (
|
||||
UINT32 Microseconds);
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Platform and hardware-independent I/O interfaces
|
||||
*/
|
||||
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsReadPort
|
||||
ACPI_STATUS
|
||||
AcpiOsReadPort (
|
||||
ACPI_IO_ADDRESS Address,
|
||||
UINT32 *Value,
|
||||
UINT32 Width);
|
||||
#endif
|
||||
|
||||
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsWritePort
|
||||
ACPI_STATUS
|
||||
AcpiOsWritePort (
|
||||
ACPI_IO_ADDRESS Address,
|
||||
UINT32 Value,
|
||||
UINT32 Width);
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Platform and hardware-independent physical memory interfaces
|
||||
*/
|
||||
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsReadMemory
|
||||
ACPI_STATUS
|
||||
AcpiOsReadMemory (
|
||||
ACPI_PHYSICAL_ADDRESS Address,
|
||||
UINT32 *Value,
|
||||
UINT64 *Value,
|
||||
UINT32 Width);
|
||||
#endif
|
||||
|
||||
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsWriteMemory
|
||||
ACPI_STATUS
|
||||
AcpiOsWriteMemory (
|
||||
ACPI_PHYSICAL_ADDRESS Address,
|
||||
UINT32 Value,
|
||||
UINT64 Value,
|
||||
UINT32 Width);
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
@@ -390,92 +406,131 @@ AcpiOsWriteMemory (
|
||||
* Note: Can't use "Register" as a parameter, changed to "Reg" --
|
||||
* certain compilers complain.
|
||||
*/
|
||||
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsReadPciConfiguration
|
||||
ACPI_STATUS
|
||||
AcpiOsReadPciConfiguration (
|
||||
ACPI_PCI_ID *PciId,
|
||||
UINT32 Reg,
|
||||
void *Value,
|
||||
UINT64 *Value,
|
||||
UINT32 Width);
|
||||
#endif
|
||||
|
||||
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsWritePciConfiguration
|
||||
ACPI_STATUS
|
||||
AcpiOsWritePciConfiguration (
|
||||
ACPI_PCI_ID *PciId,
|
||||
UINT32 Reg,
|
||||
UINT64 Value,
|
||||
UINT32 Width);
|
||||
|
||||
|
||||
/*
|
||||
* Interim function needed for PCI IRQ routing
|
||||
*/
|
||||
void
|
||||
AcpiOsDerivePciId(
|
||||
ACPI_HANDLE Device,
|
||||
ACPI_HANDLE Region,
|
||||
ACPI_PCI_ID **PciId);
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Miscellaneous
|
||||
*/
|
||||
ACPI_STATUS
|
||||
AcpiOsValidateInterface (
|
||||
char *Interface);
|
||||
|
||||
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsReadable
|
||||
BOOLEAN
|
||||
AcpiOsReadable (
|
||||
void *Pointer,
|
||||
ACPI_SIZE Length);
|
||||
#endif
|
||||
|
||||
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsWritable
|
||||
BOOLEAN
|
||||
AcpiOsWritable (
|
||||
void *Pointer,
|
||||
ACPI_SIZE Length);
|
||||
#endif
|
||||
|
||||
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsGetTimer
|
||||
UINT64
|
||||
AcpiOsGetTimer (
|
||||
void);
|
||||
#endif
|
||||
|
||||
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsSignal
|
||||
ACPI_STATUS
|
||||
AcpiOsSignal (
|
||||
UINT32 Function,
|
||||
void *Info);
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Debug print routines
|
||||
*/
|
||||
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsPrintf
|
||||
void ACPI_INTERNAL_VAR_XFACE
|
||||
AcpiOsPrintf (
|
||||
const char *Format,
|
||||
...);
|
||||
#endif
|
||||
|
||||
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsVprintf
|
||||
void
|
||||
AcpiOsVprintf (
|
||||
const char *Format,
|
||||
va_list Args);
|
||||
#endif
|
||||
|
||||
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsRedirectOutput
|
||||
void
|
||||
AcpiOsRedirectOutput (
|
||||
void *Destination);
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Debug input
|
||||
*/
|
||||
UINT32
|
||||
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsGetLine
|
||||
ACPI_STATUS
|
||||
AcpiOsGetLine (
|
||||
char *Buffer);
|
||||
char *Buffer,
|
||||
UINT32 BufferLength,
|
||||
UINT32 *BytesRead);
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Obtain ACPI table(s)
|
||||
*/
|
||||
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsGetTableByName
|
||||
ACPI_STATUS
|
||||
AcpiOsGetTableByName (
|
||||
char *Signature,
|
||||
UINT32 Instance,
|
||||
ACPI_TABLE_HEADER **Table,
|
||||
ACPI_PHYSICAL_ADDRESS *Address);
|
||||
#endif
|
||||
|
||||
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsGetTableByIndex
|
||||
ACPI_STATUS
|
||||
AcpiOsGetTableByIndex (
|
||||
UINT32 Index,
|
||||
ACPI_TABLE_HEADER **Table,
|
||||
UINT32 *Instance,
|
||||
ACPI_PHYSICAL_ADDRESS *Address);
|
||||
#endif
|
||||
|
||||
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsGetTableByAddress
|
||||
ACPI_STATUS
|
||||
AcpiOsGetTableByAddress (
|
||||
ACPI_PHYSICAL_ADDRESS Address,
|
||||
ACPI_TABLE_HEADER **Table);
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Directory manipulation
|
||||
*/
|
||||
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsOpenDirectory
|
||||
void *
|
||||
AcpiOsOpenDirectory (
|
||||
char *Pathname,
|
||||
char *WildcardSpec,
|
||||
char RequestedFileType);
|
||||
#endif
|
||||
|
||||
/* RequesteFileType values */
|
||||
|
||||
@@ -483,13 +538,66 @@ AcpiOsOpenDirectory (
|
||||
#define REQUEST_DIR_ONLY 1
|
||||
|
||||
|
||||
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsGetNextFilename
|
||||
char *
|
||||
AcpiOsGetNextFilename (
|
||||
void *DirHandle);
|
||||
#endif
|
||||
|
||||
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsCloseDirectory
|
||||
void
|
||||
AcpiOsCloseDirectory (
|
||||
void *DirHandle);
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* File I/O and related support
|
||||
*/
|
||||
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsOpenFile
|
||||
ACPI_FILE
|
||||
AcpiOsOpenFile (
|
||||
const char *Path,
|
||||
UINT8 Modes);
|
||||
#endif
|
||||
|
||||
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsCloseFile
|
||||
void
|
||||
AcpiOsCloseFile (
|
||||
ACPI_FILE File);
|
||||
#endif
|
||||
|
||||
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsReadFile
|
||||
int
|
||||
AcpiOsReadFile (
|
||||
ACPI_FILE File,
|
||||
void *Buffer,
|
||||
ACPI_SIZE Size,
|
||||
ACPI_SIZE Count);
|
||||
#endif
|
||||
|
||||
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsWriteFile
|
||||
int
|
||||
AcpiOsWriteFile (
|
||||
ACPI_FILE File,
|
||||
void *Buffer,
|
||||
ACPI_SIZE Size,
|
||||
ACPI_SIZE Count);
|
||||
#endif
|
||||
|
||||
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsGetFileOffset
|
||||
long
|
||||
AcpiOsGetFileOffset (
|
||||
ACPI_FILE File);
|
||||
#endif
|
||||
|
||||
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsSetFileOffset
|
||||
ACPI_STATUS
|
||||
AcpiOsSetFileOffset (
|
||||
ACPI_FILE File,
|
||||
long Offset,
|
||||
UINT8 From);
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* __ACPIOSXF_H__ */
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -4,115 +4,42 @@
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
* 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.
|
||||
*
|
||||
* 2.1. This is your license from Intel Corp. under its intellectual property
|
||||
* rights. You may have additional license terms from the party that provided
|
||||
* you this software, covering your right to use that party's intellectual
|
||||
* property rights.
|
||||
* 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.
|
||||
*
|
||||
* 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
|
||||
* copy of the source code appearing in this file ("Covered Code") an
|
||||
* irrevocable, perpetual, worldwide license under Intel's copyrights in the
|
||||
* base code distributed originally by Intel ("Original Intel Code") to copy,
|
||||
|
||||
* make derivatives, distribute, use and display any portion of the Covered
|
||||
* Code in any form, with the right to sublicense such rights; and
|
||||
*
|
||||
* 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
|
||||
* license (with the right to sublicense), under only those claims of Intel
|
||||
* patents that are infringed by the Original Intel Code, to make, use, sell,
|
||||
* offer to sell, and import the Covered Code and derivative works thereof
|
||||
* solely to the minimum extent necessary to exercise the above copyright
|
||||
* license, and in no event shall the patent license extend to any additions
|
||||
* to or modifications of the Original Intel Code. No other license or right
|
||||
* is granted directly or by implication, estoppel or otherwise;
|
||||
*
|
||||
* The above copyright and patent license is granted only if the following
|
||||
* conditions are met:
|
||||
*
|
||||
* 3. Conditions
|
||||
*
|
||||
* 3.1. Redistribution of Source with Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification with rights to further distribute source must include
|
||||
* the above Copyright Notice, the above License, this list of Conditions,
|
||||
* and the following Disclaimer and Export Compliance provision. In addition,
|
||||
* Licensee must cause all Covered Code to which Licensee contributes to
|
||||
* contain a file documenting the changes Licensee made to create that Covered
|
||||
* Code and the date of any change. Licensee must include in that file the
|
||||
* documentation of any changes made by any predecessor Licensee. Licensee
|
||||
* must include a prominent statement that the modification is derived,
|
||||
* directly or indirectly, from Original Intel Code.
|
||||
*
|
||||
* 3.2. Redistribution of Source with no Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification without rights to further distribute source must
|
||||
* include the following Disclaimer and Export Compliance provision in the
|
||||
* documentation and/or other materials provided with distribution. In
|
||||
* addition, Licensee may not authorize further sublicense of source of any
|
||||
* portion of the Covered Code, and must include terms to the effect that the
|
||||
* license from Licensee to its licensee is limited to the intellectual
|
||||
* property embodied in the software Licensee provides to its licensee, and
|
||||
* not to intellectual property embodied in modifications its licensee may
|
||||
* make.
|
||||
*
|
||||
* 3.3. Redistribution of Executable. Redistribution in executable form of any
|
||||
* substantial portion of the Covered Code or modification must reproduce the
|
||||
* above Copyright Notice, and the following Disclaimer and Export Compliance
|
||||
* provision in the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3.4. Intel retains all right, title, and interest in and to the Original
|
||||
* Intel Code.
|
||||
*
|
||||
* 3.5. Neither the name Intel nor any other trademark owned or controlled by
|
||||
* Intel shall be used in advertising or otherwise to promote the sale, use or
|
||||
* other dealings in products derived from or relating to the Covered Code
|
||||
* without prior written authorization from Intel.
|
||||
*
|
||||
* 4. Disclaimer and Export Compliance
|
||||
*
|
||||
* 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
|
||||
* HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
|
||||
* IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
|
||||
* INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
|
||||
* UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
|
||||
* PARTICULAR PURPOSE.
|
||||
*
|
||||
* 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
|
||||
* OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
|
||||
* COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
|
||||
* SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
|
||||
* CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
|
||||
* HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
|
||||
* SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
|
||||
* LIMITED REMEDY.
|
||||
*
|
||||
* 4.3. Licensee shall not export, either directly or indirectly, any of this
|
||||
* software or system incorporating such software without first obtaining any
|
||||
* required license or other approval from the U. S. Department of Commerce or
|
||||
* any other agency or department of the United States Government. In the
|
||||
* event Licensee exports any such software from the United States or
|
||||
* re-exports any such software from a foreign destination, Licensee shall
|
||||
* ensure that the distribution and export/re-export of the software is in
|
||||
* compliance with all laws, regulations, orders, or other restrictions of the
|
||||
* U.S. Export Administration Regulations. Licensee agrees that neither it nor
|
||||
* any of its subsidiaries will export/re-export any technical data, process,
|
||||
* software, or service, directly or indirectly, to any country for which the
|
||||
* United States government or any agency thereof requires an export license,
|
||||
* other governmental approval, or letter of assurance, without first obtaining
|
||||
* such license, approval or letter.
|
||||
*
|
||||
*****************************************************************************/
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef __ACRESRC_H__
|
||||
#define __ACRESRC_H__
|
||||
@@ -148,28 +75,42 @@ typedef const struct acpi_rsconvert_info
|
||||
|
||||
/* Resource conversion opcodes */
|
||||
|
||||
#define ACPI_RSC_INITGET 0
|
||||
#define ACPI_RSC_INITSET 1
|
||||
#define ACPI_RSC_FLAGINIT 2
|
||||
#define ACPI_RSC_1BITFLAG 3
|
||||
#define ACPI_RSC_2BITFLAG 4
|
||||
#define ACPI_RSC_COUNT 5
|
||||
#define ACPI_RSC_COUNT16 6
|
||||
#define ACPI_RSC_LENGTH 7
|
||||
#define ACPI_RSC_MOVE8 8
|
||||
#define ACPI_RSC_MOVE16 9
|
||||
#define ACPI_RSC_MOVE32 10
|
||||
#define ACPI_RSC_MOVE64 11
|
||||
#define ACPI_RSC_SET8 12
|
||||
#define ACPI_RSC_DATA8 13
|
||||
#define ACPI_RSC_ADDRESS 14
|
||||
#define ACPI_RSC_SOURCE 15
|
||||
#define ACPI_RSC_SOURCEX 16
|
||||
#define ACPI_RSC_BITMASK 17
|
||||
#define ACPI_RSC_BITMASK16 18
|
||||
#define ACPI_RSC_EXIT_NE 19
|
||||
#define ACPI_RSC_EXIT_LE 20
|
||||
#define ACPI_RSC_EXIT_EQ 21
|
||||
typedef enum
|
||||
{
|
||||
ACPI_RSC_INITGET = 0,
|
||||
ACPI_RSC_INITSET,
|
||||
ACPI_RSC_FLAGINIT,
|
||||
ACPI_RSC_1BITFLAG,
|
||||
ACPI_RSC_2BITFLAG,
|
||||
ACPI_RSC_3BITFLAG,
|
||||
ACPI_RSC_ADDRESS,
|
||||
ACPI_RSC_BITMASK,
|
||||
ACPI_RSC_BITMASK16,
|
||||
ACPI_RSC_COUNT,
|
||||
ACPI_RSC_COUNT16,
|
||||
ACPI_RSC_COUNT_GPIO_PIN,
|
||||
ACPI_RSC_COUNT_GPIO_RES,
|
||||
ACPI_RSC_COUNT_GPIO_VEN,
|
||||
ACPI_RSC_COUNT_SERIAL_RES,
|
||||
ACPI_RSC_COUNT_SERIAL_VEN,
|
||||
ACPI_RSC_DATA8,
|
||||
ACPI_RSC_EXIT_EQ,
|
||||
ACPI_RSC_EXIT_LE,
|
||||
ACPI_RSC_EXIT_NE,
|
||||
ACPI_RSC_LENGTH,
|
||||
ACPI_RSC_MOVE_GPIO_PIN,
|
||||
ACPI_RSC_MOVE_GPIO_RES,
|
||||
ACPI_RSC_MOVE_SERIAL_RES,
|
||||
ACPI_RSC_MOVE_SERIAL_VEN,
|
||||
ACPI_RSC_MOVE8,
|
||||
ACPI_RSC_MOVE16,
|
||||
ACPI_RSC_MOVE32,
|
||||
ACPI_RSC_MOVE64,
|
||||
ACPI_RSC_SET8,
|
||||
ACPI_RSC_SOURCE,
|
||||
ACPI_RSC_SOURCEX
|
||||
|
||||
} ACPI_RSCONVERT_OPCODES;
|
||||
|
||||
/* Resource Conversion sub-opcodes */
|
||||
|
||||
@@ -182,6 +123,9 @@ typedef const struct acpi_rsconvert_info
|
||||
#define AML_OFFSET(f) (UINT8) ACPI_OFFSET (AML_RESOURCE,f)
|
||||
|
||||
|
||||
/*
|
||||
* Individual entry for the resource dump tables
|
||||
*/
|
||||
typedef const struct acpi_rsdump_info
|
||||
{
|
||||
UINT8 Opcode;
|
||||
@@ -193,20 +137,27 @@ typedef const struct acpi_rsdump_info
|
||||
|
||||
/* Values for the Opcode field above */
|
||||
|
||||
#define ACPI_RSD_TITLE 0
|
||||
#define ACPI_RSD_LITERAL 1
|
||||
#define ACPI_RSD_STRING 2
|
||||
#define ACPI_RSD_UINT8 3
|
||||
#define ACPI_RSD_UINT16 4
|
||||
#define ACPI_RSD_UINT32 5
|
||||
#define ACPI_RSD_UINT64 6
|
||||
#define ACPI_RSD_1BITFLAG 7
|
||||
#define ACPI_RSD_2BITFLAG 8
|
||||
#define ACPI_RSD_SHORTLIST 9
|
||||
#define ACPI_RSD_LONGLIST 10
|
||||
#define ACPI_RSD_DWORDLIST 11
|
||||
#define ACPI_RSD_ADDRESS 12
|
||||
#define ACPI_RSD_SOURCE 13
|
||||
typedef enum
|
||||
{
|
||||
ACPI_RSD_TITLE = 0,
|
||||
ACPI_RSD_1BITFLAG,
|
||||
ACPI_RSD_2BITFLAG,
|
||||
ACPI_RSD_3BITFLAG,
|
||||
ACPI_RSD_ADDRESS,
|
||||
ACPI_RSD_DWORDLIST,
|
||||
ACPI_RSD_LITERAL,
|
||||
ACPI_RSD_LONGLIST,
|
||||
ACPI_RSD_SHORTLIST,
|
||||
ACPI_RSD_SHORTLISTX,
|
||||
ACPI_RSD_SOURCE,
|
||||
ACPI_RSD_STRING,
|
||||
ACPI_RSD_UINT8,
|
||||
ACPI_RSD_UINT16,
|
||||
ACPI_RSD_UINT32,
|
||||
ACPI_RSD_UINT64,
|
||||
ACPI_RSD_WORDLIST
|
||||
|
||||
} ACPI_RSDUMP_OPCODES;
|
||||
|
||||
/* restore default alignment */
|
||||
|
||||
@@ -216,13 +167,16 @@ typedef const struct acpi_rsdump_info
|
||||
/* Resource tables indexed by internal resource type */
|
||||
|
||||
extern const UINT8 AcpiGbl_AmlResourceSizes[];
|
||||
extern const UINT8 AcpiGbl_AmlResourceSerialBusSizes[];
|
||||
extern ACPI_RSCONVERT_INFO *AcpiGbl_SetResourceDispatch[];
|
||||
|
||||
/* Resource tables indexed by raw AML resource descriptor type */
|
||||
|
||||
extern const UINT8 AcpiGbl_ResourceStructSizes[];
|
||||
extern const UINT8 AcpiGbl_ResourceStructSerialBusSizes[];
|
||||
extern ACPI_RSCONVERT_INFO *AcpiGbl_GetResourceDispatch[];
|
||||
|
||||
extern ACPI_RSCONVERT_INFO *AcpiGbl_ConvertResourceSerialBusDispatch[];
|
||||
|
||||
typedef struct acpi_vendor_walk_info
|
||||
{
|
||||
@@ -243,7 +197,7 @@ AcpiRsCreateResourceList (
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiRsCreateAmlResources (
|
||||
ACPI_RESOURCE *LinkedListBuffer,
|
||||
ACPI_BUFFER *ResourceList,
|
||||
ACPI_BUFFER *OutputBuffer);
|
||||
|
||||
ACPI_STATUS
|
||||
@@ -281,6 +235,10 @@ AcpiRsSetSrsMethodData (
|
||||
ACPI_NAMESPACE_NODE *Node,
|
||||
ACPI_BUFFER *RetBuffer);
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiRsGetAeiMethodData (
|
||||
ACPI_NAMESPACE_NODE *Node,
|
||||
ACPI_BUFFER *RetBuffer);
|
||||
|
||||
/*
|
||||
* rscalc
|
||||
@@ -293,7 +251,8 @@ AcpiRsGetListLength (
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiRsGetAmlLength (
|
||||
ACPI_RESOURCE *LinkedListBuffer,
|
||||
ACPI_RESOURCE *ResourceList,
|
||||
ACPI_SIZE ResourceListSize,
|
||||
ACPI_SIZE *SizeNeeded);
|
||||
|
||||
ACPI_STATUS
|
||||
@@ -307,7 +266,7 @@ AcpiRsConvertAmlToResources (
|
||||
UINT32 Length,
|
||||
UINT32 Offset,
|
||||
UINT8 ResourceIndex,
|
||||
void *Context);
|
||||
void **Context);
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiRsConvertResourcesToAml (
|
||||
@@ -421,6 +380,11 @@ extern ACPI_RSCONVERT_INFO AcpiRsConvertAddress16[];
|
||||
extern ACPI_RSCONVERT_INFO AcpiRsConvertExtIrq[];
|
||||
extern ACPI_RSCONVERT_INFO AcpiRsConvertAddress64[];
|
||||
extern ACPI_RSCONVERT_INFO AcpiRsConvertExtAddress64[];
|
||||
extern ACPI_RSCONVERT_INFO AcpiRsConvertGpio[];
|
||||
extern ACPI_RSCONVERT_INFO AcpiRsConvertFixedDma[];
|
||||
extern ACPI_RSCONVERT_INFO AcpiRsConvertI2cSerialBus[];
|
||||
extern ACPI_RSCONVERT_INFO AcpiRsConvertSpiSerialBus[];
|
||||
extern ACPI_RSCONVERT_INFO AcpiRsConvertUartSerialBus[];
|
||||
|
||||
/* These resources require separate get/set tables */
|
||||
|
||||
@@ -439,20 +403,24 @@ extern ACPI_RSCONVERT_INFO AcpiRsSetVendor[];
|
||||
* rsinfo
|
||||
*/
|
||||
extern ACPI_RSDUMP_INFO *AcpiGbl_DumpResourceDispatch[];
|
||||
extern ACPI_RSDUMP_INFO *AcpiGbl_DumpSerialBusDispatch[];
|
||||
|
||||
/*
|
||||
* rsdump
|
||||
* rsdumpinfo
|
||||
*/
|
||||
extern ACPI_RSDUMP_INFO AcpiRsDumpIrq[];
|
||||
extern ACPI_RSDUMP_INFO AcpiRsDumpPrt[];
|
||||
extern ACPI_RSDUMP_INFO AcpiRsDumpDma[];
|
||||
extern ACPI_RSDUMP_INFO AcpiRsDumpStartDpf[];
|
||||
extern ACPI_RSDUMP_INFO AcpiRsDumpEndDpf[];
|
||||
extern ACPI_RSDUMP_INFO AcpiRsDumpIo[];
|
||||
extern ACPI_RSDUMP_INFO AcpiRsDumpIoFlags[];
|
||||
extern ACPI_RSDUMP_INFO AcpiRsDumpFixedIo[];
|
||||
extern ACPI_RSDUMP_INFO AcpiRsDumpVendor[];
|
||||
extern ACPI_RSDUMP_INFO AcpiRsDumpEndTag[];
|
||||
extern ACPI_RSDUMP_INFO AcpiRsDumpMemory24[];
|
||||
extern ACPI_RSDUMP_INFO AcpiRsDumpMemory32[];
|
||||
extern ACPI_RSDUMP_INFO AcpiRsDumpMemoryFlags[];
|
||||
extern ACPI_RSDUMP_INFO AcpiRsDumpFixedMemory32[];
|
||||
extern ACPI_RSDUMP_INFO AcpiRsDumpAddress16[];
|
||||
extern ACPI_RSDUMP_INFO AcpiRsDumpAddress32[];
|
||||
@@ -460,6 +428,13 @@ extern ACPI_RSDUMP_INFO AcpiRsDumpAddress64[];
|
||||
extern ACPI_RSDUMP_INFO AcpiRsDumpExtAddress64[];
|
||||
extern ACPI_RSDUMP_INFO AcpiRsDumpExtIrq[];
|
||||
extern ACPI_RSDUMP_INFO AcpiRsDumpGenericReg[];
|
||||
extern ACPI_RSDUMP_INFO AcpiRsDumpGpio[];
|
||||
extern ACPI_RSDUMP_INFO AcpiRsDumpFixedDma[];
|
||||
extern ACPI_RSDUMP_INFO AcpiRsDumpCommonSerialBus[];
|
||||
extern ACPI_RSDUMP_INFO AcpiRsDumpI2cSerialBus[];
|
||||
extern ACPI_RSDUMP_INFO AcpiRsDumpSpiSerialBus[];
|
||||
extern ACPI_RSDUMP_INFO AcpiRsDumpUartSerialBus[];
|
||||
extern ACPI_RSDUMP_INFO AcpiRsDumpGeneralFlags[];
|
||||
#endif
|
||||
|
||||
#endif /* __ACRESRC_H__ */
|
||||
|
||||
@@ -4,114 +4,42 @@
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
* 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.
|
||||
*
|
||||
* 2.1. This is your license from Intel Corp. under its intellectual property
|
||||
* rights. You may have additional license terms from the party that provided
|
||||
* you this software, covering your right to use that party's intellectual
|
||||
* property rights.
|
||||
* 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.
|
||||
*
|
||||
* 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
|
||||
* copy of the source code appearing in this file ("Covered Code") an
|
||||
* irrevocable, perpetual, worldwide license under Intel's copyrights in the
|
||||
* base code distributed originally by Intel ("Original Intel Code") to copy,
|
||||
* make derivatives, distribute, use and display any portion of the Covered
|
||||
* Code in any form, with the right to sublicense such rights; and
|
||||
*
|
||||
* 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
|
||||
* license (with the right to sublicense), under only those claims of Intel
|
||||
* patents that are infringed by the Original Intel Code, to make, use, sell,
|
||||
* offer to sell, and import the Covered Code and derivative works thereof
|
||||
* solely to the minimum extent necessary to exercise the above copyright
|
||||
* license, and in no event shall the patent license extend to any additions
|
||||
* to or modifications of the Original Intel Code. No other license or right
|
||||
* is granted directly or by implication, estoppel or otherwise;
|
||||
*
|
||||
* The above copyright and patent license is granted only if the following
|
||||
* conditions are met:
|
||||
*
|
||||
* 3. Conditions
|
||||
*
|
||||
* 3.1. Redistribution of Source with Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification with rights to further distribute source must include
|
||||
* the above Copyright Notice, the above License, this list of Conditions,
|
||||
* and the following Disclaimer and Export Compliance provision. In addition,
|
||||
* Licensee must cause all Covered Code to which Licensee contributes to
|
||||
* contain a file documenting the changes Licensee made to create that Covered
|
||||
* Code and the date of any change. Licensee must include in that file the
|
||||
* documentation of any changes made by any predecessor Licensee. Licensee
|
||||
* must include a prominent statement that the modification is derived,
|
||||
* directly or indirectly, from Original Intel Code.
|
||||
*
|
||||
* 3.2. Redistribution of Source with no Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification without rights to further distribute source must
|
||||
* include the following Disclaimer and Export Compliance provision in the
|
||||
* documentation and/or other materials provided with distribution. In
|
||||
* addition, Licensee may not authorize further sublicense of source of any
|
||||
* portion of the Covered Code, and must include terms to the effect that the
|
||||
* license from Licensee to its licensee is limited to the intellectual
|
||||
* property embodied in the software Licensee provides to its licensee, and
|
||||
* not to intellectual property embodied in modifications its licensee may
|
||||
* make.
|
||||
*
|
||||
* 3.3. Redistribution of Executable. Redistribution in executable form of any
|
||||
* substantial portion of the Covered Code or modification must reproduce the
|
||||
* above Copyright Notice, and the following Disclaimer and Export Compliance
|
||||
* provision in the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3.4. Intel retains all right, title, and interest in and to the Original
|
||||
* Intel Code.
|
||||
*
|
||||
* 3.5. Neither the name Intel nor any other trademark owned or controlled by
|
||||
* Intel shall be used in advertising or otherwise to promote the sale, use or
|
||||
* other dealings in products derived from or relating to the Covered Code
|
||||
* without prior written authorization from Intel.
|
||||
*
|
||||
* 4. Disclaimer and Export Compliance
|
||||
*
|
||||
* 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
|
||||
* HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
|
||||
* IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
|
||||
* INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
|
||||
* UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
|
||||
* PARTICULAR PURPOSE.
|
||||
*
|
||||
* 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
|
||||
* OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
|
||||
* COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
|
||||
* SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
|
||||
* CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
|
||||
* HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
|
||||
* SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
|
||||
* LIMITED REMEDY.
|
||||
*
|
||||
* 4.3. Licensee shall not export, either directly or indirectly, any of this
|
||||
* software or system incorporating such software without first obtaining any
|
||||
* required license or other approval from the U. S. Department of Commerce or
|
||||
* any other agency or department of the United States Government. In the
|
||||
* event Licensee exports any such software from the United States or
|
||||
* re-exports any such software from a foreign destination, Licensee shall
|
||||
* ensure that the distribution and export/re-export of the software is in
|
||||
* compliance with all laws, regulations, orders, or other restrictions of the
|
||||
* U.S. Export Administration Regulations. Licensee agrees that neither it nor
|
||||
* any of its subsidiaries will export/re-export any technical data, process,
|
||||
* software, or service, directly or indirectly, to any country for which the
|
||||
* United States government or any agency thereof requires an export license,
|
||||
* other governmental approval, or letter of assurance, without first obtaining
|
||||
* such license, approval or letter.
|
||||
*
|
||||
*****************************************************************************/
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef __ACRESTYP_H__
|
||||
#define __ACRESTYP_H__
|
||||
@@ -134,11 +62,14 @@ typedef UINT32 ACPI_RSDESC_SIZE; /* Max Resource Descr
|
||||
#define ACPI_WRITE_COMBINING_MEMORY (UINT8) 0x02
|
||||
#define ACPI_PREFETCHABLE_MEMORY (UINT8) 0x03
|
||||
|
||||
/*! [Begin] no source code translation */
|
||||
/*
|
||||
* IO Attributes
|
||||
* The ISA IO ranges are: n000-n0FFh, n400-n4FFh, n800-n8FFh, nC00-nCFFh.
|
||||
* The non-ISA IO ranges are: n100-n3FFh, n500-n7FFh, n900-nBFFh, nCD0-nFFFh.
|
||||
*/
|
||||
/*! [End] no source code translation !*/
|
||||
|
||||
#define ACPI_NON_ISA_ONLY_RANGES (UINT8) 0x01
|
||||
#define ACPI_ISA_ONLY_RANGES (UINT8) 0x02
|
||||
#define ACPI_ENTIRE_RANGE (ACPI_NON_ISA_ONLY_RANGES | ACPI_ISA_ONLY_RANGES)
|
||||
@@ -154,17 +85,30 @@ typedef UINT32 ACPI_RSDESC_SIZE; /* Max Resource Descr
|
||||
#define ACPI_DECODE_16 (UINT8) 0x01 /* 16-bit IO address decode */
|
||||
|
||||
/*
|
||||
* IRQ Attributes
|
||||
* Interrupt attributes - used in multiple descriptors
|
||||
*/
|
||||
|
||||
/* Triggering */
|
||||
|
||||
#define ACPI_LEVEL_SENSITIVE (UINT8) 0x00
|
||||
#define ACPI_EDGE_SENSITIVE (UINT8) 0x01
|
||||
|
||||
/* Polarity */
|
||||
|
||||
#define ACPI_ACTIVE_HIGH (UINT8) 0x00
|
||||
#define ACPI_ACTIVE_LOW (UINT8) 0x01
|
||||
#define ACPI_ACTIVE_BOTH (UINT8) 0x02
|
||||
|
||||
/* Sharing */
|
||||
|
||||
#define ACPI_EXCLUSIVE (UINT8) 0x00
|
||||
#define ACPI_SHARED (UINT8) 0x01
|
||||
|
||||
/* Wake */
|
||||
|
||||
#define ACPI_NOT_WAKE_CAPABLE (UINT8) 0x00
|
||||
#define ACPI_WAKE_CAPABLE (UINT8) 0x01
|
||||
|
||||
/*
|
||||
* DMA Attributes
|
||||
*/
|
||||
@@ -200,6 +144,8 @@ typedef UINT32 ACPI_RSDESC_SIZE; /* Max Resource Descr
|
||||
#define ACPI_POS_DECODE (UINT8) 0x00
|
||||
#define ACPI_SUB_DECODE (UINT8) 0x01
|
||||
|
||||
/* Producer/Consumer */
|
||||
|
||||
#define ACPI_PRODUCER (UINT8) 0x00
|
||||
#define ACPI_CONSUMER (UINT8) 0x01
|
||||
|
||||
@@ -234,12 +180,13 @@ typedef struct acpi_resource_irq
|
||||
UINT8 Triggering;
|
||||
UINT8 Polarity;
|
||||
UINT8 Sharable;
|
||||
UINT8 WakeCapable;
|
||||
UINT8 InterruptCount;
|
||||
UINT8 Interrupts[1];
|
||||
|
||||
} ACPI_RESOURCE_IRQ;
|
||||
|
||||
typedef struct ACPI_RESOURCE_DMA
|
||||
typedef struct acpi_resource_dma
|
||||
{
|
||||
UINT8 Type;
|
||||
UINT8 BusMaster;
|
||||
@@ -281,6 +228,24 @@ typedef struct acpi_resource_fixed_io
|
||||
|
||||
} ACPI_RESOURCE_FIXED_IO;
|
||||
|
||||
typedef struct acpi_resource_fixed_dma
|
||||
{
|
||||
UINT16 RequestLines;
|
||||
UINT16 Channels;
|
||||
UINT8 Width;
|
||||
|
||||
} ACPI_RESOURCE_FIXED_DMA;
|
||||
|
||||
/* Values for Width field above */
|
||||
|
||||
#define ACPI_DMA_WIDTH8 0
|
||||
#define ACPI_DMA_WIDTH16 1
|
||||
#define ACPI_DMA_WIDTH32 2
|
||||
#define ACPI_DMA_WIDTH64 3
|
||||
#define ACPI_DMA_WIDTH128 4
|
||||
#define ACPI_DMA_WIDTH256 5
|
||||
|
||||
|
||||
typedef struct acpi_resource_vendor
|
||||
{
|
||||
UINT16 ByteLength;
|
||||
@@ -441,6 +406,7 @@ typedef struct acpi_resource_extended_irq
|
||||
UINT8 Triggering;
|
||||
UINT8 Polarity;
|
||||
UINT8 Sharable;
|
||||
UINT8 WakeCapable;
|
||||
UINT8 InterruptCount;
|
||||
ACPI_RESOURCE_SOURCE ResourceSource;
|
||||
UINT32 Interrupts[1];
|
||||
@@ -457,6 +423,185 @@ typedef struct acpi_resource_generic_register
|
||||
|
||||
} ACPI_RESOURCE_GENERIC_REGISTER;
|
||||
|
||||
typedef struct acpi_resource_gpio
|
||||
{
|
||||
UINT8 RevisionId;
|
||||
UINT8 ConnectionType;
|
||||
UINT8 ProducerConsumer; /* For values, see Producer/Consumer above */
|
||||
UINT8 PinConfig;
|
||||
UINT8 Sharable; /* For values, see Interrupt Attributes above */
|
||||
UINT8 WakeCapable; /* For values, see Interrupt Attributes above */
|
||||
UINT8 IoRestriction;
|
||||
UINT8 Triggering; /* For values, see Interrupt Attributes above */
|
||||
UINT8 Polarity; /* For values, see Interrupt Attributes above */
|
||||
UINT16 DriveStrength;
|
||||
UINT16 DebounceTimeout;
|
||||
UINT16 PinTableLength;
|
||||
UINT16 VendorLength;
|
||||
ACPI_RESOURCE_SOURCE ResourceSource;
|
||||
UINT16 *PinTable;
|
||||
UINT8 *VendorData;
|
||||
|
||||
} ACPI_RESOURCE_GPIO;
|
||||
|
||||
/* Values for GPIO ConnectionType field above */
|
||||
|
||||
#define ACPI_RESOURCE_GPIO_TYPE_INT 0
|
||||
#define ACPI_RESOURCE_GPIO_TYPE_IO 1
|
||||
|
||||
/* Values for PinConfig field above */
|
||||
|
||||
#define ACPI_PIN_CONFIG_DEFAULT 0
|
||||
#define ACPI_PIN_CONFIG_PULLUP 1
|
||||
#define ACPI_PIN_CONFIG_PULLDOWN 2
|
||||
#define ACPI_PIN_CONFIG_NOPULL 3
|
||||
|
||||
/* Values for IoRestriction field above */
|
||||
|
||||
#define ACPI_IO_RESTRICT_NONE 0
|
||||
#define ACPI_IO_RESTRICT_INPUT 1
|
||||
#define ACPI_IO_RESTRICT_OUTPUT 2
|
||||
#define ACPI_IO_RESTRICT_NONE_PRESERVE 3
|
||||
|
||||
|
||||
/* Common structure for I2C, SPI, and UART serial descriptors */
|
||||
|
||||
#define ACPI_RESOURCE_SERIAL_COMMON \
|
||||
UINT8 RevisionId; \
|
||||
UINT8 Type; \
|
||||
UINT8 ProducerConsumer; /* For values, see Producer/Consumer above */\
|
||||
UINT8 SlaveMode; \
|
||||
UINT8 TypeRevisionId; \
|
||||
UINT16 TypeDataLength; \
|
||||
UINT16 VendorLength; \
|
||||
ACPI_RESOURCE_SOURCE ResourceSource; \
|
||||
UINT8 *VendorData;
|
||||
|
||||
typedef struct acpi_resource_common_serialbus
|
||||
{
|
||||
ACPI_RESOURCE_SERIAL_COMMON
|
||||
|
||||
} ACPI_RESOURCE_COMMON_SERIALBUS;
|
||||
|
||||
/* Values for the Type field above */
|
||||
|
||||
#define ACPI_RESOURCE_SERIAL_TYPE_I2C 1
|
||||
#define ACPI_RESOURCE_SERIAL_TYPE_SPI 2
|
||||
#define ACPI_RESOURCE_SERIAL_TYPE_UART 3
|
||||
|
||||
/* Values for SlaveMode field above */
|
||||
|
||||
#define ACPI_CONTROLLER_INITIATED 0
|
||||
#define ACPI_DEVICE_INITIATED 1
|
||||
|
||||
|
||||
typedef struct acpi_resource_i2c_serialbus
|
||||
{
|
||||
ACPI_RESOURCE_SERIAL_COMMON
|
||||
UINT8 AccessMode;
|
||||
UINT16 SlaveAddress;
|
||||
UINT32 ConnectionSpeed;
|
||||
|
||||
} ACPI_RESOURCE_I2C_SERIALBUS;
|
||||
|
||||
/* Values for AccessMode field above */
|
||||
|
||||
#define ACPI_I2C_7BIT_MODE 0
|
||||
#define ACPI_I2C_10BIT_MODE 1
|
||||
|
||||
|
||||
typedef struct acpi_resource_spi_serialbus
|
||||
{
|
||||
ACPI_RESOURCE_SERIAL_COMMON
|
||||
UINT8 WireMode;
|
||||
UINT8 DevicePolarity;
|
||||
UINT8 DataBitLength;
|
||||
UINT8 ClockPhase;
|
||||
UINT8 ClockPolarity;
|
||||
UINT16 DeviceSelection;
|
||||
UINT32 ConnectionSpeed;
|
||||
|
||||
} ACPI_RESOURCE_SPI_SERIALBUS;
|
||||
|
||||
/* Values for WireMode field above */
|
||||
|
||||
#define ACPI_SPI_4WIRE_MODE 0
|
||||
#define ACPI_SPI_3WIRE_MODE 1
|
||||
|
||||
/* Values for DevicePolarity field above */
|
||||
|
||||
#define ACPI_SPI_ACTIVE_LOW 0
|
||||
#define ACPI_SPI_ACTIVE_HIGH 1
|
||||
|
||||
/* Values for ClockPhase field above */
|
||||
|
||||
#define ACPI_SPI_FIRST_PHASE 0
|
||||
#define ACPI_SPI_SECOND_PHASE 1
|
||||
|
||||
/* Values for ClockPolarity field above */
|
||||
|
||||
#define ACPI_SPI_START_LOW 0
|
||||
#define ACPI_SPI_START_HIGH 1
|
||||
|
||||
|
||||
typedef struct acpi_resource_uart_serialbus
|
||||
{
|
||||
ACPI_RESOURCE_SERIAL_COMMON
|
||||
UINT8 Endian;
|
||||
UINT8 DataBits;
|
||||
UINT8 StopBits;
|
||||
UINT8 FlowControl;
|
||||
UINT8 Parity;
|
||||
UINT8 LinesEnabled;
|
||||
UINT16 RxFifoSize;
|
||||
UINT16 TxFifoSize;
|
||||
UINT32 DefaultBaudRate;
|
||||
|
||||
} ACPI_RESOURCE_UART_SERIALBUS;
|
||||
|
||||
/* Values for Endian field above */
|
||||
|
||||
#define ACPI_UART_LITTLE_ENDIAN 0
|
||||
#define ACPI_UART_BIG_ENDIAN 1
|
||||
|
||||
/* Values for DataBits field above */
|
||||
|
||||
#define ACPI_UART_5_DATA_BITS 0
|
||||
#define ACPI_UART_6_DATA_BITS 1
|
||||
#define ACPI_UART_7_DATA_BITS 2
|
||||
#define ACPI_UART_8_DATA_BITS 3
|
||||
#define ACPI_UART_9_DATA_BITS 4
|
||||
|
||||
/* Values for StopBits field above */
|
||||
|
||||
#define ACPI_UART_NO_STOP_BITS 0
|
||||
#define ACPI_UART_1_STOP_BIT 1
|
||||
#define ACPI_UART_1P5_STOP_BITS 2
|
||||
#define ACPI_UART_2_STOP_BITS 3
|
||||
|
||||
/* Values for FlowControl field above */
|
||||
|
||||
#define ACPI_UART_FLOW_CONTROL_NONE 0
|
||||
#define ACPI_UART_FLOW_CONTROL_HW 1
|
||||
#define ACPI_UART_FLOW_CONTROL_XON_XOFF 2
|
||||
|
||||
/* Values for Parity field above */
|
||||
|
||||
#define ACPI_UART_PARITY_NONE 0
|
||||
#define ACPI_UART_PARITY_EVEN 1
|
||||
#define ACPI_UART_PARITY_ODD 2
|
||||
#define ACPI_UART_PARITY_MARK 3
|
||||
#define ACPI_UART_PARITY_SPACE 4
|
||||
|
||||
/* Values for LinesEnabled bitfield above */
|
||||
|
||||
#define ACPI_UART_CARRIER_DETECT (1<<2)
|
||||
#define ACPI_UART_RING_INDICATOR (1<<3)
|
||||
#define ACPI_UART_DATA_SET_READY (1<<4)
|
||||
#define ACPI_UART_DATA_TERMINAL_READY (1<<5)
|
||||
#define ACPI_UART_CLEAR_TO_SEND (1<<6)
|
||||
#define ACPI_UART_REQUEST_TO_SEND (1<<7)
|
||||
|
||||
|
||||
/* ACPI_RESOURCE_TYPEs */
|
||||
|
||||
@@ -477,7 +622,10 @@ typedef struct acpi_resource_generic_register
|
||||
#define ACPI_RESOURCE_TYPE_EXTENDED_ADDRESS64 14 /* ACPI 3.0 */
|
||||
#define ACPI_RESOURCE_TYPE_EXTENDED_IRQ 15
|
||||
#define ACPI_RESOURCE_TYPE_GENERIC_REGISTER 16
|
||||
#define ACPI_RESOURCE_TYPE_MAX 16
|
||||
#define ACPI_RESOURCE_TYPE_GPIO 17 /* ACPI 5.0 */
|
||||
#define ACPI_RESOURCE_TYPE_FIXED_DMA 18 /* ACPI 5.0 */
|
||||
#define ACPI_RESOURCE_TYPE_SERIAL_BUS 19 /* ACPI 5.0 */
|
||||
#define ACPI_RESOURCE_TYPE_MAX 19
|
||||
|
||||
/* Master union for resource descriptors */
|
||||
|
||||
@@ -488,6 +636,7 @@ typedef union acpi_resource_data
|
||||
ACPI_RESOURCE_START_DEPENDENT StartDpf;
|
||||
ACPI_RESOURCE_IO Io;
|
||||
ACPI_RESOURCE_FIXED_IO FixedIo;
|
||||
ACPI_RESOURCE_FIXED_DMA FixedDma;
|
||||
ACPI_RESOURCE_VENDOR Vendor;
|
||||
ACPI_RESOURCE_VENDOR_TYPED VendorTyped;
|
||||
ACPI_RESOURCE_END_TAG EndTag;
|
||||
@@ -500,6 +649,11 @@ typedef union acpi_resource_data
|
||||
ACPI_RESOURCE_EXTENDED_ADDRESS64 ExtAddress64;
|
||||
ACPI_RESOURCE_EXTENDED_IRQ ExtendedIrq;
|
||||
ACPI_RESOURCE_GENERIC_REGISTER GenericReg;
|
||||
ACPI_RESOURCE_GPIO Gpio;
|
||||
ACPI_RESOURCE_I2C_SERIALBUS I2cSerialBus;
|
||||
ACPI_RESOURCE_SPI_SERIALBUS SpiSerialBus;
|
||||
ACPI_RESOURCE_UART_SERIALBUS UartSerialBus;
|
||||
ACPI_RESOURCE_COMMON_SERIALBUS CommonSerialBus;
|
||||
|
||||
/* Common fields */
|
||||
|
||||
@@ -527,7 +681,10 @@ typedef struct acpi_resource
|
||||
#define ACPI_RS_SIZE_MIN (UINT32) ACPI_ROUND_UP_TO_NATIVE_WORD (12)
|
||||
#define ACPI_RS_SIZE(Type) (UINT32) (ACPI_RS_SIZE_NO_DATA + sizeof (Type))
|
||||
|
||||
#define ACPI_NEXT_RESOURCE(Res) (ACPI_RESOURCE *)((UINT8 *) Res + Res->Length)
|
||||
/* Macro for walking resource templates with multiple descriptors */
|
||||
|
||||
#define ACPI_NEXT_RESOURCE(Res) \
|
||||
ACPI_ADD_PTR (ACPI_RESOURCE, (Res), (Res)->Length)
|
||||
|
||||
|
||||
typedef struct acpi_pci_routing_table
|
||||
@@ -541,4 +698,3 @@ typedef struct acpi_pci_routing_table
|
||||
} ACPI_PCI_ROUTING_TABLE;
|
||||
|
||||
#endif /* __ACRESTYP_H__ */
|
||||
|
||||
|
||||
@@ -4,114 +4,42 @@
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
* 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.
|
||||
*
|
||||
* 2.1. This is your license from Intel Corp. under its intellectual property
|
||||
* rights. You may have additional license terms from the party that provided
|
||||
* you this software, covering your right to use that party's intellectual
|
||||
* property rights.
|
||||
* 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.
|
||||
*
|
||||
* 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
|
||||
* copy of the source code appearing in this file ("Covered Code") an
|
||||
* irrevocable, perpetual, worldwide license under Intel's copyrights in the
|
||||
* base code distributed originally by Intel ("Original Intel Code") to copy,
|
||||
* make derivatives, distribute, use and display any portion of the Covered
|
||||
* Code in any form, with the right to sublicense such rights; and
|
||||
*
|
||||
* 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
|
||||
* license (with the right to sublicense), under only those claims of Intel
|
||||
* patents that are infringed by the Original Intel Code, to make, use, sell,
|
||||
* offer to sell, and import the Covered Code and derivative works thereof
|
||||
* solely to the minimum extent necessary to exercise the above copyright
|
||||
* license, and in no event shall the patent license extend to any additions
|
||||
* to or modifications of the Original Intel Code. No other license or right
|
||||
* is granted directly or by implication, estoppel or otherwise;
|
||||
*
|
||||
* The above copyright and patent license is granted only if the following
|
||||
* conditions are met:
|
||||
*
|
||||
* 3. Conditions
|
||||
*
|
||||
* 3.1. Redistribution of Source with Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification with rights to further distribute source must include
|
||||
* the above Copyright Notice, the above License, this list of Conditions,
|
||||
* and the following Disclaimer and Export Compliance provision. In addition,
|
||||
* Licensee must cause all Covered Code to which Licensee contributes to
|
||||
* contain a file documenting the changes Licensee made to create that Covered
|
||||
* Code and the date of any change. Licensee must include in that file the
|
||||
* documentation of any changes made by any predecessor Licensee. Licensee
|
||||
* must include a prominent statement that the modification is derived,
|
||||
* directly or indirectly, from Original Intel Code.
|
||||
*
|
||||
* 3.2. Redistribution of Source with no Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification without rights to further distribute source must
|
||||
* include the following Disclaimer and Export Compliance provision in the
|
||||
* documentation and/or other materials provided with distribution. In
|
||||
* addition, Licensee may not authorize further sublicense of source of any
|
||||
* portion of the Covered Code, and must include terms to the effect that the
|
||||
* license from Licensee to its licensee is limited to the intellectual
|
||||
* property embodied in the software Licensee provides to its licensee, and
|
||||
* not to intellectual property embodied in modifications its licensee may
|
||||
* make.
|
||||
*
|
||||
* 3.3. Redistribution of Executable. Redistribution in executable form of any
|
||||
* substantial portion of the Covered Code or modification must reproduce the
|
||||
* above Copyright Notice, and the following Disclaimer and Export Compliance
|
||||
* provision in the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3.4. Intel retains all right, title, and interest in and to the Original
|
||||
* Intel Code.
|
||||
*
|
||||
* 3.5. Neither the name Intel nor any other trademark owned or controlled by
|
||||
* Intel shall be used in advertising or otherwise to promote the sale, use or
|
||||
* other dealings in products derived from or relating to the Covered Code
|
||||
* without prior written authorization from Intel.
|
||||
*
|
||||
* 4. Disclaimer and Export Compliance
|
||||
*
|
||||
* 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
|
||||
* HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
|
||||
* IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
|
||||
* INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
|
||||
* UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
|
||||
* PARTICULAR PURPOSE.
|
||||
*
|
||||
* 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
|
||||
* OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
|
||||
* COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
|
||||
* SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
|
||||
* CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
|
||||
* HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
|
||||
* SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
|
||||
* LIMITED REMEDY.
|
||||
*
|
||||
* 4.3. Licensee shall not export, either directly or indirectly, any of this
|
||||
* software or system incorporating such software without first obtaining any
|
||||
* required license or other approval from the U. S. Department of Commerce or
|
||||
* any other agency or department of the United States Government. In the
|
||||
* event Licensee exports any such software from the United States or
|
||||
* re-exports any such software from a foreign destination, Licensee shall
|
||||
* ensure that the distribution and export/re-export of the software is in
|
||||
* compliance with all laws, regulations, orders, or other restrictions of the
|
||||
* U.S. Export Administration Regulations. Licensee agrees that neither it nor
|
||||
* any of its subsidiaries will export/re-export any technical data, process,
|
||||
* software, or service, directly or indirectly, to any country for which the
|
||||
* United States government or any agency thereof requires an export license,
|
||||
* other governmental approval, or letter of assurance, without first obtaining
|
||||
* such license, approval or letter.
|
||||
*
|
||||
*****************************************************************************/
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef __ACSTRUCT_H__
|
||||
#define __ACSTRUCT_H__
|
||||
@@ -126,7 +54,7 @@
|
||||
|
||||
|
||||
/*
|
||||
* Walk state - current state of a parse tree walk. Used for both a leisurely
|
||||
* Walk state - current state of a parse tree walk. Used for both a leisurely
|
||||
* stroll through the tree (for whatever reason), and for control method
|
||||
* execution.
|
||||
*/
|
||||
@@ -211,6 +139,9 @@ typedef struct acpi_init_walk_info
|
||||
UINT32 TableIndex;
|
||||
UINT32 ObjectCount;
|
||||
UINT32 MethodCount;
|
||||
UINT32 SerialMethodCount;
|
||||
UINT32 NonSerialMethodCount;
|
||||
UINT32 SerializedMethodCount;
|
||||
UINT32 DeviceCount;
|
||||
UINT32 OpRegionCount;
|
||||
UINT32 FieldCount;
|
||||
@@ -267,27 +198,43 @@ typedef union acpi_aml_operands
|
||||
|
||||
|
||||
/*
|
||||
* Structure used to pass object evaluation parameters.
|
||||
* Structure used to pass object evaluation information and parameters.
|
||||
* Purpose is to reduce CPU stack use.
|
||||
*/
|
||||
typedef struct acpi_evaluate_info
|
||||
{
|
||||
ACPI_NAMESPACE_NODE *PrefixNode;
|
||||
char *Pathname;
|
||||
ACPI_OPERAND_OBJECT *ObjDesc;
|
||||
ACPI_OPERAND_OBJECT **Parameters;
|
||||
ACPI_NAMESPACE_NODE *ResolvedNode;
|
||||
ACPI_OPERAND_OBJECT *ReturnObject;
|
||||
UINT8 ParamCount;
|
||||
UINT8 PassNumber;
|
||||
UINT8 ReturnObjectType;
|
||||
UINT8 Flags;
|
||||
/* The first 3 elements are passed by the caller to AcpiNsEvaluate */
|
||||
|
||||
ACPI_NAMESPACE_NODE *PrefixNode; /* Input: starting node */
|
||||
char *RelativePathname; /* Input: path relative to PrefixNode */
|
||||
ACPI_OPERAND_OBJECT **Parameters; /* Input: argument list */
|
||||
|
||||
ACPI_NAMESPACE_NODE *Node; /* Resolved node (PrefixNode:RelativePathname) */
|
||||
ACPI_OPERAND_OBJECT *ObjDesc; /* Object attached to the resolved node */
|
||||
char *FullPathname; /* Full pathname of the resolved node */
|
||||
|
||||
const ACPI_PREDEFINED_INFO *Predefined; /* Used if Node is a predefined name */
|
||||
ACPI_OPERAND_OBJECT *ReturnObject; /* Object returned from the evaluation */
|
||||
union acpi_operand_object *ParentPackage; /* Used if return object is a Package */
|
||||
|
||||
UINT32 ReturnFlags; /* Used for return value analysis */
|
||||
UINT32 ReturnBtype; /* Bitmapped type of the returned object */
|
||||
UINT16 ParamCount; /* Count of the input argument list */
|
||||
UINT8 PassNumber; /* Parser pass number */
|
||||
UINT8 ReturnObjectType; /* Object type of the returned object */
|
||||
UINT8 NodeFlags; /* Same as Node->Flags */
|
||||
UINT8 Flags; /* General flags */
|
||||
|
||||
} ACPI_EVALUATE_INFO;
|
||||
|
||||
/* Values for Flags above */
|
||||
|
||||
#define ACPI_IGNORE_RETURN_VALUE 1
|
||||
#define ACPI_IGNORE_RETURN_VALUE 1
|
||||
|
||||
/* Defines for ReturnFlags field above */
|
||||
|
||||
#define ACPI_OBJECT_REPAIRED 1
|
||||
#define ACPI_OBJECT_WRAPPED 2
|
||||
|
||||
|
||||
/* Info used by AcpiNsInitializeDevices */
|
||||
|
||||
@@ -4,114 +4,42 @@
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
* 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.
|
||||
*
|
||||
* 2.1. This is your license from Intel Corp. under its intellectual property
|
||||
* rights. You may have additional license terms from the party that provided
|
||||
* you this software, covering your right to use that party's intellectual
|
||||
* property rights.
|
||||
* 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.
|
||||
*
|
||||
* 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
|
||||
* copy of the source code appearing in this file ("Covered Code") an
|
||||
* irrevocable, perpetual, worldwide license under Intel's copyrights in the
|
||||
* base code distributed originally by Intel ("Original Intel Code") to copy,
|
||||
* make derivatives, distribute, use and display any portion of the Covered
|
||||
* Code in any form, with the right to sublicense such rights; and
|
||||
*
|
||||
* 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
|
||||
* license (with the right to sublicense), under only those claims of Intel
|
||||
* patents that are infringed by the Original Intel Code, to make, use, sell,
|
||||
* offer to sell, and import the Covered Code and derivative works thereof
|
||||
* solely to the minimum extent necessary to exercise the above copyright
|
||||
* license, and in no event shall the patent license extend to any additions
|
||||
* to or modifications of the Original Intel Code. No other license or right
|
||||
* is granted directly or by implication, estoppel or otherwise;
|
||||
*
|
||||
* The above copyright and patent license is granted only if the following
|
||||
* conditions are met:
|
||||
*
|
||||
* 3. Conditions
|
||||
*
|
||||
* 3.1. Redistribution of Source with Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification with rights to further distribute source must include
|
||||
* the above Copyright Notice, the above License, this list of Conditions,
|
||||
* and the following Disclaimer and Export Compliance provision. In addition,
|
||||
* Licensee must cause all Covered Code to which Licensee contributes to
|
||||
* contain a file documenting the changes Licensee made to create that Covered
|
||||
* Code and the date of any change. Licensee must include in that file the
|
||||
* documentation of any changes made by any predecessor Licensee. Licensee
|
||||
* must include a prominent statement that the modification is derived,
|
||||
* directly or indirectly, from Original Intel Code.
|
||||
*
|
||||
* 3.2. Redistribution of Source with no Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification without rights to further distribute source must
|
||||
* include the following Disclaimer and Export Compliance provision in the
|
||||
* documentation and/or other materials provided with distribution. In
|
||||
* addition, Licensee may not authorize further sublicense of source of any
|
||||
* portion of the Covered Code, and must include terms to the effect that the
|
||||
* license from Licensee to its licensee is limited to the intellectual
|
||||
* property embodied in the software Licensee provides to its licensee, and
|
||||
* not to intellectual property embodied in modifications its licensee may
|
||||
* make.
|
||||
*
|
||||
* 3.3. Redistribution of Executable. Redistribution in executable form of any
|
||||
* substantial portion of the Covered Code or modification must reproduce the
|
||||
* above Copyright Notice, and the following Disclaimer and Export Compliance
|
||||
* provision in the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3.4. Intel retains all right, title, and interest in and to the Original
|
||||
* Intel Code.
|
||||
*
|
||||
* 3.5. Neither the name Intel nor any other trademark owned or controlled by
|
||||
* Intel shall be used in advertising or otherwise to promote the sale, use or
|
||||
* other dealings in products derived from or relating to the Covered Code
|
||||
* without prior written authorization from Intel.
|
||||
*
|
||||
* 4. Disclaimer and Export Compliance
|
||||
*
|
||||
* 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
|
||||
* HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
|
||||
* IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
|
||||
* INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
|
||||
* UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
|
||||
* PARTICULAR PURPOSE.
|
||||
*
|
||||
* 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
|
||||
* OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
|
||||
* COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
|
||||
* SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
|
||||
* CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
|
||||
* HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
|
||||
* SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
|
||||
* LIMITED REMEDY.
|
||||
*
|
||||
* 4.3. Licensee shall not export, either directly or indirectly, any of this
|
||||
* software or system incorporating such software without first obtaining any
|
||||
* required license or other approval from the U. S. Department of Commerce or
|
||||
* any other agency or department of the United States Government. In the
|
||||
* event Licensee exports any such software from the United States or
|
||||
* re-exports any such software from a foreign destination, Licensee shall
|
||||
* ensure that the distribution and export/re-export of the software is in
|
||||
* compliance with all laws, regulations, orders, or other restrictions of the
|
||||
* U.S. Export Administration Regulations. Licensee agrees that neither it nor
|
||||
* any of its subsidiaries will export/re-export any technical data, process,
|
||||
* software, or service, directly or indirectly, to any country for which the
|
||||
* United States government or any agency thereof requires an export license,
|
||||
* other governmental approval, or letter of assurance, without first obtaining
|
||||
* such license, approval or letter.
|
||||
*
|
||||
*****************************************************************************/
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef __ACTABLES_H__
|
||||
#define __ACTABLES_H__
|
||||
@@ -121,6 +49,66 @@ ACPI_STATUS
|
||||
AcpiAllocateRootTable (
|
||||
UINT32 InitialTableCount);
|
||||
|
||||
/*
|
||||
* tbxfroot - Root pointer utilities
|
||||
*/
|
||||
UINT32
|
||||
AcpiTbGetRsdpLength (
|
||||
ACPI_TABLE_RSDP *Rsdp);
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiTbValidateRsdp (
|
||||
ACPI_TABLE_RSDP *Rsdp);
|
||||
|
||||
UINT8 *
|
||||
AcpiTbScanMemoryForRsdp (
|
||||
UINT8 *StartAddress,
|
||||
UINT32 Length);
|
||||
|
||||
|
||||
/*
|
||||
* tbdata - table data structure management
|
||||
*/
|
||||
ACPI_STATUS
|
||||
AcpiTbGetNextRootIndex (
|
||||
UINT32 *TableIndex);
|
||||
|
||||
void
|
||||
AcpiTbInitTableDescriptor (
|
||||
ACPI_TABLE_DESC *TableDesc,
|
||||
ACPI_PHYSICAL_ADDRESS Address,
|
||||
UINT8 Flags,
|
||||
ACPI_TABLE_HEADER *Table);
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiTbAcquireTempTable (
|
||||
ACPI_TABLE_DESC *TableDesc,
|
||||
ACPI_PHYSICAL_ADDRESS Address,
|
||||
UINT8 Flags);
|
||||
|
||||
void
|
||||
AcpiTbReleaseTempTable (
|
||||
ACPI_TABLE_DESC *TableDesc);
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiTbValidateTempTable (
|
||||
ACPI_TABLE_DESC *TableDesc);
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiTbVerifyTempTable (
|
||||
ACPI_TABLE_DESC *TableDesc,
|
||||
char *Signature);
|
||||
|
||||
BOOLEAN
|
||||
AcpiTbIsTableLoaded (
|
||||
UINT32 TableIndex);
|
||||
|
||||
void
|
||||
AcpiTbSetTableLoadedFlag (
|
||||
UINT32 TableIndex,
|
||||
BOOLEAN IsLoaded);
|
||||
|
||||
|
||||
/*
|
||||
* tbfadt - FADT parse/convert/validate
|
||||
*/
|
||||
@@ -153,12 +141,36 @@ AcpiTbResizeRootTableList (
|
||||
void);
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiTbVerifyTable (
|
||||
AcpiTbValidateTable (
|
||||
ACPI_TABLE_DESC *TableDesc);
|
||||
|
||||
void
|
||||
AcpiTbInvalidateTable (
|
||||
ACPI_TABLE_DESC *TableDesc);
|
||||
|
||||
void
|
||||
AcpiTbOverrideTable (
|
||||
ACPI_TABLE_DESC *OldTableDesc);
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiTbAddTable (
|
||||
AcpiTbAcquireTable (
|
||||
ACPI_TABLE_DESC *TableDesc,
|
||||
ACPI_TABLE_HEADER **TablePtr,
|
||||
UINT32 *TableLength,
|
||||
UINT8 *TableFlags);
|
||||
|
||||
void
|
||||
AcpiTbReleaseTable (
|
||||
ACPI_TABLE_HEADER *Table,
|
||||
UINT32 TableLength,
|
||||
UINT8 TableFlags);
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiTbInstallStandardTable (
|
||||
ACPI_PHYSICAL_ADDRESS Address,
|
||||
UINT8 Flags,
|
||||
BOOLEAN Reload,
|
||||
BOOLEAN Override,
|
||||
UINT32 *TableIndex);
|
||||
|
||||
ACPI_STATUS
|
||||
@@ -170,7 +182,7 @@ AcpiTbStoreTable (
|
||||
UINT32 *TableIndex);
|
||||
|
||||
void
|
||||
AcpiTbDeleteTable (
|
||||
AcpiTbUninstallTable (
|
||||
ACPI_TABLE_DESC *TableDesc);
|
||||
|
||||
void
|
||||
@@ -194,15 +206,6 @@ AcpiTbGetOwnerId (
|
||||
UINT32 TableIndex,
|
||||
ACPI_OWNER_ID *OwnerId);
|
||||
|
||||
BOOLEAN
|
||||
AcpiTbIsTableLoaded (
|
||||
UINT32 TableIndex);
|
||||
|
||||
void
|
||||
AcpiTbSetTableLoadedFlag (
|
||||
UINT32 TableIndex,
|
||||
BOOLEAN IsLoaded);
|
||||
|
||||
|
||||
/*
|
||||
* tbutils - table manager utilities
|
||||
@@ -239,7 +242,13 @@ AcpiTbCopyDsdt (
|
||||
UINT32 TableIndex);
|
||||
|
||||
void
|
||||
AcpiTbInstallTable (
|
||||
AcpiTbInstallTableWithOverride (
|
||||
UINT32 TableIndex,
|
||||
ACPI_TABLE_DESC *NewTableDesc,
|
||||
BOOLEAN Override);
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiTbInstallFixedTable (
|
||||
ACPI_PHYSICAL_ADDRESS Address,
|
||||
char *Signature,
|
||||
UINT32 TableIndex);
|
||||
|
||||
@@ -4,114 +4,42 @@
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
* 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.
|
||||
*
|
||||
* 2.1. This is your license from Intel Corp. under its intellectual property
|
||||
* rights. You may have additional license terms from the party that provided
|
||||
* you this software, covering your right to use that party's intellectual
|
||||
* property rights.
|
||||
* 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.
|
||||
*
|
||||
* 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
|
||||
* copy of the source code appearing in this file ("Covered Code") an
|
||||
* irrevocable, perpetual, worldwide license under Intel's copyrights in the
|
||||
* base code distributed originally by Intel ("Original Intel Code") to copy,
|
||||
* make derivatives, distribute, use and display any portion of the Covered
|
||||
* Code in any form, with the right to sublicense such rights; and
|
||||
*
|
||||
* 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
|
||||
* license (with the right to sublicense), under only those claims of Intel
|
||||
* patents that are infringed by the Original Intel Code, to make, use, sell,
|
||||
* offer to sell, and import the Covered Code and derivative works thereof
|
||||
* solely to the minimum extent necessary to exercise the above copyright
|
||||
* license, and in no event shall the patent license extend to any additions
|
||||
* to or modifications of the Original Intel Code. No other license or right
|
||||
* is granted directly or by implication, estoppel or otherwise;
|
||||
*
|
||||
* The above copyright and patent license is granted only if the following
|
||||
* conditions are met:
|
||||
*
|
||||
* 3. Conditions
|
||||
*
|
||||
* 3.1. Redistribution of Source with Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification with rights to further distribute source must include
|
||||
* the above Copyright Notice, the above License, this list of Conditions,
|
||||
* and the following Disclaimer and Export Compliance provision. In addition,
|
||||
* Licensee must cause all Covered Code to which Licensee contributes to
|
||||
* contain a file documenting the changes Licensee made to create that Covered
|
||||
* Code and the date of any change. Licensee must include in that file the
|
||||
* documentation of any changes made by any predecessor Licensee. Licensee
|
||||
* must include a prominent statement that the modification is derived,
|
||||
* directly or indirectly, from Original Intel Code.
|
||||
*
|
||||
* 3.2. Redistribution of Source with no Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification without rights to further distribute source must
|
||||
* include the following Disclaimer and Export Compliance provision in the
|
||||
* documentation and/or other materials provided with distribution. In
|
||||
* addition, Licensee may not authorize further sublicense of source of any
|
||||
* portion of the Covered Code, and must include terms to the effect that the
|
||||
* license from Licensee to its licensee is limited to the intellectual
|
||||
* property embodied in the software Licensee provides to its licensee, and
|
||||
* not to intellectual property embodied in modifications its licensee may
|
||||
* make.
|
||||
*
|
||||
* 3.3. Redistribution of Executable. Redistribution in executable form of any
|
||||
* substantial portion of the Covered Code or modification must reproduce the
|
||||
* above Copyright Notice, and the following Disclaimer and Export Compliance
|
||||
* provision in the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3.4. Intel retains all right, title, and interest in and to the Original
|
||||
* Intel Code.
|
||||
*
|
||||
* 3.5. Neither the name Intel nor any other trademark owned or controlled by
|
||||
* Intel shall be used in advertising or otherwise to promote the sale, use or
|
||||
* other dealings in products derived from or relating to the Covered Code
|
||||
* without prior written authorization from Intel.
|
||||
*
|
||||
* 4. Disclaimer and Export Compliance
|
||||
*
|
||||
* 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
|
||||
* HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
|
||||
* IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
|
||||
* INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
|
||||
* UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
|
||||
* PARTICULAR PURPOSE.
|
||||
*
|
||||
* 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
|
||||
* OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
|
||||
* COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
|
||||
* SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
|
||||
* CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
|
||||
* HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
|
||||
* SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
|
||||
* LIMITED REMEDY.
|
||||
*
|
||||
* 4.3. Licensee shall not export, either directly or indirectly, any of this
|
||||
* software or system incorporating such software without first obtaining any
|
||||
* required license or other approval from the U. S. Department of Commerce or
|
||||
* any other agency or department of the United States Government. In the
|
||||
* event Licensee exports any such software from the United States or
|
||||
* re-exports any such software from a foreign destination, Licensee shall
|
||||
* ensure that the distribution and export/re-export of the software is in
|
||||
* compliance with all laws, regulations, orders, or other restrictions of the
|
||||
* U.S. Export Administration Regulations. Licensee agrees that neither it nor
|
||||
* any of its subsidiaries will export/re-export any technical data, process,
|
||||
* software, or service, directly or indirectly, to any country for which the
|
||||
* United States government or any agency thereof requires an export license,
|
||||
* other governmental approval, or letter of assurance, without first obtaining
|
||||
* such license, approval or letter.
|
||||
*
|
||||
*****************************************************************************/
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef __ACTBL_H__
|
||||
#define __ACTBL_H__
|
||||
@@ -154,9 +82,15 @@
|
||||
#pragma pack(1)
|
||||
|
||||
/*
|
||||
* Note about bitfields: The UINT8 type is used for bitfields in ACPI tables.
|
||||
* This is the only type that is even remotely portable. Anything else is not
|
||||
* portable, so do not use any other bitfield types.
|
||||
* Note: C bitfields are not used for this reason:
|
||||
*
|
||||
* "Bitfields are great and easy to read, but unfortunately the C language
|
||||
* does not specify the layout of bitfields in memory, which means they are
|
||||
* essentially useless for dealing with packed data in on-disk formats or
|
||||
* binary wire protocols." (Or ACPI tables and buffers.) "If you ask me,
|
||||
* this decision was a design error in C. Ritchie could have picked an order
|
||||
* and stuck with it." Norman Ramsey.
|
||||
* See http://stackoverflow.com/a/1053662/41661
|
||||
*/
|
||||
|
||||
|
||||
@@ -171,7 +105,7 @@ typedef struct acpi_table_header
|
||||
{
|
||||
char Signature[ACPI_NAME_SIZE]; /* ASCII table signature */
|
||||
UINT32 Length; /* Length of table in bytes, including this header */
|
||||
UINT8 Revision; /* ACPI Specification minor version # */
|
||||
UINT8 Revision; /* ACPI Specification minor version number */
|
||||
UINT8 Checksum; /* To make sum of entire table == 0 */
|
||||
char OemId[ACPI_OEM_ID_SIZE]; /* ASCII OEM identification */
|
||||
char OemTableId[ACPI_OEM_TABLE_ID_SIZE]; /* ASCII OEM table identification */
|
||||
@@ -187,7 +121,7 @@ typedef struct acpi_table_header
|
||||
* GAS - Generic Address Structure (ACPI 2.0+)
|
||||
*
|
||||
* Note: Since this structure is used in the ACPI tables, it is byte aligned.
|
||||
* If misaliged access is not supported by the hardware, accesses to the
|
||||
* If misaligned access is not supported by the hardware, accesses to the
|
||||
* 64-bit Address field must be performed with care.
|
||||
*
|
||||
******************************************************************************/
|
||||
@@ -269,6 +203,9 @@ typedef struct acpi_table_xsdt
|
||||
|
||||
} ACPI_TABLE_XSDT;
|
||||
|
||||
#define ACPI_RSDT_ENTRY_SIZE (sizeof (UINT32))
|
||||
#define ACPI_XSDT_ENTRY_SIZE (sizeof (UINT64))
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
@@ -325,18 +262,18 @@ typedef struct acpi_table_fadt
|
||||
UINT8 PreferredProfile; /* Conveys preferred power management profile to OSPM. */
|
||||
UINT16 SciInterrupt; /* System vector of SCI interrupt */
|
||||
UINT32 SmiCommand; /* 32-bit Port address of SMI command port */
|
||||
UINT8 AcpiEnable; /* Value to write to smi_cmd to enable ACPI */
|
||||
UINT8 AcpiDisable; /* Value to write to smi_cmd to disable ACPI */
|
||||
UINT8 S4BiosRequest; /* Value to write to SMI CMD to enter S4BIOS state */
|
||||
UINT8 AcpiEnable; /* Value to write to SMI_CMD to enable ACPI */
|
||||
UINT8 AcpiDisable; /* Value to write to SMI_CMD to disable ACPI */
|
||||
UINT8 S4BiosRequest; /* Value to write to SMI_CMD to enter S4BIOS state */
|
||||
UINT8 PstateControl; /* Processor performance state control*/
|
||||
UINT32 Pm1aEventBlock; /* 32-bit Port address of Power Mgt 1a Event Reg Blk */
|
||||
UINT32 Pm1bEventBlock; /* 32-bit Port address of Power Mgt 1b Event Reg Blk */
|
||||
UINT32 Pm1aControlBlock; /* 32-bit Port address of Power Mgt 1a Control Reg Blk */
|
||||
UINT32 Pm1bControlBlock; /* 32-bit Port address of Power Mgt 1b Control Reg Blk */
|
||||
UINT32 Pm2ControlBlock; /* 32-bit Port address of Power Mgt 2 Control Reg Blk */
|
||||
UINT32 PmTimerBlock; /* 32-bit Port address of Power Mgt Timer Ctrl Reg Blk */
|
||||
UINT32 Gpe0Block; /* 32-bit Port address of General Purpose Event 0 Reg Blk */
|
||||
UINT32 Gpe1Block; /* 32-bit Port address of General Purpose Event 1 Reg Blk */
|
||||
UINT32 Pm1aEventBlock; /* 32-bit port address of Power Mgt 1a Event Reg Blk */
|
||||
UINT32 Pm1bEventBlock; /* 32-bit port address of Power Mgt 1b Event Reg Blk */
|
||||
UINT32 Pm1aControlBlock; /* 32-bit port address of Power Mgt 1a Control Reg Blk */
|
||||
UINT32 Pm1bControlBlock; /* 32-bit port address of Power Mgt 1b Control Reg Blk */
|
||||
UINT32 Pm2ControlBlock; /* 32-bit port address of Power Mgt 2 Control Reg Blk */
|
||||
UINT32 PmTimerBlock; /* 32-bit port address of Power Mgt Timer Ctrl Reg Blk */
|
||||
UINT32 Gpe0Block; /* 32-bit port address of General Purpose Event 0 Reg Blk */
|
||||
UINT32 Gpe1Block; /* 32-bit port address of General Purpose Event 1 Reg Blk */
|
||||
UINT8 Pm1EventLength; /* Byte Length of ports at Pm1xEventBlock */
|
||||
UINT8 Pm1ControlLength; /* Byte Length of ports at Pm1xControlBlock */
|
||||
UINT8 Pm2ControlLength; /* Byte Length of ports at Pm2ControlBlock */
|
||||
@@ -344,12 +281,12 @@ typedef struct acpi_table_fadt
|
||||
UINT8 Gpe0BlockLength; /* Byte Length of ports at Gpe0Block */
|
||||
UINT8 Gpe1BlockLength; /* Byte Length of ports at Gpe1Block */
|
||||
UINT8 Gpe1Base; /* Offset in GPE number space where GPE1 events start */
|
||||
UINT8 CstControl; /* Support for the _CST object and C States change notification */
|
||||
UINT8 CstControl; /* Support for the _CST object and C-States change notification */
|
||||
UINT16 C2Latency; /* Worst case HW latency to enter/exit C2 state */
|
||||
UINT16 C3Latency; /* Worst case HW latency to enter/exit C3 state */
|
||||
UINT16 FlushSize; /* Processor's memory cache line width, in bytes */
|
||||
UINT16 FlushSize; /* Processor memory cache line width, in bytes */
|
||||
UINT16 FlushStride; /* Number of flush strides that need to be read */
|
||||
UINT8 DutyOffset; /* Processor duty cycle index in processor's P_CNT reg */
|
||||
UINT8 DutyOffset; /* Processor duty cycle index in processor P_CNT reg */
|
||||
UINT8 DutyWidth; /* Processor duty cycle value bit width in P_CNT register */
|
||||
UINT8 DayAlarm; /* Index to day-of-month alarm in RTC CMOS RAM */
|
||||
UINT8 MonthAlarm; /* Index to month-of-year alarm in RTC CMOS RAM */
|
||||
@@ -359,7 +296,8 @@ typedef struct acpi_table_fadt
|
||||
UINT32 Flags; /* Miscellaneous flag bits (see below for individual flags) */
|
||||
ACPI_GENERIC_ADDRESS ResetRegister; /* 64-bit address of the Reset register */
|
||||
UINT8 ResetValue; /* Value to write to the ResetRegister port to reset the system */
|
||||
UINT8 Reserved4[3]; /* Reserved, must be zero */
|
||||
UINT16 ArmBootFlags; /* ARM-Specific Boot Flags (see below for individual flags) (ACPI 5.1) */
|
||||
UINT8 MinorRevision; /* FADT Minor Revision (ACPI 5.1) */
|
||||
UINT64 XFacs; /* 64-bit physical address of FACS */
|
||||
UINT64 XDsdt; /* 64-bit physical address of DSDT */
|
||||
ACPI_GENERIC_ADDRESS XPm1aEventBlock; /* 64-bit Extended Power Mgt 1a Event Reg Blk address */
|
||||
@@ -370,27 +308,35 @@ typedef struct acpi_table_fadt
|
||||
ACPI_GENERIC_ADDRESS XPmTimerBlock; /* 64-bit Extended Power Mgt Timer Ctrl Reg Blk address */
|
||||
ACPI_GENERIC_ADDRESS XGpe0Block; /* 64-bit Extended General Purpose Event 0 Reg Blk address */
|
||||
ACPI_GENERIC_ADDRESS XGpe1Block; /* 64-bit Extended General Purpose Event 1 Reg Blk address */
|
||||
ACPI_GENERIC_ADDRESS SleepControl; /* 64-bit Sleep Control register (ACPI 5.0) */
|
||||
ACPI_GENERIC_ADDRESS SleepStatus; /* 64-bit Sleep Status register (ACPI 5.0) */
|
||||
|
||||
} ACPI_TABLE_FADT;
|
||||
|
||||
|
||||
/* Masks for FADT Boot Architecture Flags (BootFlags) */
|
||||
/* Masks for FADT IA-PC Boot Architecture Flags (boot_flags) [Vx]=Introduced in this FADT revision */
|
||||
|
||||
#define ACPI_FADT_LEGACY_DEVICES (1) /* 00: [V2] System has LPC or ISA bus devices */
|
||||
#define ACPI_FADT_8042 (1<<1) /* 01: [V3] System has an 8042 controller on port 60/64 */
|
||||
#define ACPI_FADT_NO_VGA (1<<2) /* 02: [V4] It is not safe to probe for VGA hardware */
|
||||
#define ACPI_FADT_NO_MSI (1<<3) /* 03: [V4] Message Signaled Interrupts (MSI) must not be enabled */
|
||||
#define ACPI_FADT_NO_ASPM (1<<4) /* 04: [V4] PCIe ASPM control must not be enabled */
|
||||
#define ACPI_FADT_NO_CMOS_RTC (1<<5) /* 05: [V5] No CMOS real-time clock present */
|
||||
|
||||
/* Masks for FADT ARM Boot Architecture Flags (arm_boot_flags) ACPI 5.1 */
|
||||
|
||||
#define ACPI_FADT_PSCI_COMPLIANT (1) /* 00: [V5+] PSCI 0.2+ is implemented */
|
||||
#define ACPI_FADT_PSCI_USE_HVC (1<<1) /* 01: [V5+] HVC must be used instead of SMC as the PSCI conduit */
|
||||
|
||||
/* Masks for FADT flags */
|
||||
|
||||
#define ACPI_FADT_WBINVD (1) /* 00: [V1] The wbinvd instruction works properly */
|
||||
#define ACPI_FADT_WBINVD_FLUSH (1<<1) /* 01: [V1] wbinvd flushes but does not invalidate caches */
|
||||
#define ACPI_FADT_WBINVD (1) /* 00: [V1] The WBINVD instruction works properly */
|
||||
#define ACPI_FADT_WBINVD_FLUSH (1<<1) /* 01: [V1] WBINVD flushes but does not invalidate caches */
|
||||
#define ACPI_FADT_C1_SUPPORTED (1<<2) /* 02: [V1] All processors support C1 state */
|
||||
#define ACPI_FADT_C2_MP_SUPPORTED (1<<3) /* 03: [V1] C2 state works on MP system */
|
||||
#define ACPI_FADT_POWER_BUTTON (1<<4) /* 04: [V1] Power button is handled as a control method device */
|
||||
#define ACPI_FADT_SLEEP_BUTTON (1<<5) /* 05: [V1] Sleep button is handled as a control method device */
|
||||
#define ACPI_FADT_FIXED_RTC (1<<6) /* 06: [V1] RTC wakeup status not in fixed register space */
|
||||
#define ACPI_FADT_FIXED_RTC (1<<6) /* 06: [V1] RTC wakeup status is not in fixed register space */
|
||||
#define ACPI_FADT_S4_RTC_WAKE (1<<7) /* 07: [V1] RTC alarm can wake system from S4 */
|
||||
#define ACPI_FADT_32BIT_TIMER (1<<8) /* 08: [V1] ACPI timer width is 32-bit (0=24-bit) */
|
||||
#define ACPI_FADT_DOCKING_SUPPORTED (1<<9) /* 09: [V1] Docking supported */
|
||||
@@ -404,11 +350,13 @@ typedef struct acpi_table_fadt
|
||||
#define ACPI_FADT_REMOTE_POWER_ON (1<<17) /* 17: [V4] System is compatible with remote power on (ACPI 3.0) */
|
||||
#define ACPI_FADT_APIC_CLUSTER (1<<18) /* 18: [V4] All local APICs must use cluster model (ACPI 3.0) */
|
||||
#define ACPI_FADT_APIC_PHYSICAL (1<<19) /* 19: [V4] All local xAPICs must use physical dest mode (ACPI 3.0) */
|
||||
#define ACPI_FADT_HW_REDUCED (1<<20) /* 20: [V5] ACPI hardware is not implemented (ACPI 5.0) */
|
||||
#define ACPI_FADT_LOW_POWER_S0 (1<<21) /* 21: [V5] S0 power savings are equal or better than S3 (ACPI 5.0) */
|
||||
|
||||
|
||||
/* Values for PreferredProfile (Prefered Power Management Profiles) */
|
||||
/* Values for PreferredProfile (Preferred Power Management Profiles) */
|
||||
|
||||
enum AcpiPreferedPmProfiles
|
||||
enum AcpiPreferredPmProfiles
|
||||
{
|
||||
PM_UNSPECIFIED = 0,
|
||||
PM_DESKTOP = 1,
|
||||
@@ -416,9 +364,18 @@ enum AcpiPreferedPmProfiles
|
||||
PM_WORKSTATION = 3,
|
||||
PM_ENTERPRISE_SERVER = 4,
|
||||
PM_SOHO_SERVER = 5,
|
||||
PM_APPLIANCE_PC = 6
|
||||
PM_APPLIANCE_PC = 6,
|
||||
PM_PERFORMANCE_SERVER = 7,
|
||||
PM_TABLET = 8
|
||||
};
|
||||
|
||||
/* Values for SleepStatus and SleepControl registers (V5 FADT) */
|
||||
|
||||
#define ACPI_X_WAKE_STATUS 0x80
|
||||
#define ACPI_X_SLEEP_TYPE_MASK 0x1C
|
||||
#define ACPI_X_SLEEP_TYPE_POSITION 0x02
|
||||
#define ACPI_X_SLEEP_ENABLE 0x20
|
||||
|
||||
|
||||
/* Reset to default packing */
|
||||
|
||||
@@ -442,7 +399,7 @@ typedef struct acpi_table_desc
|
||||
{
|
||||
ACPI_PHYSICAL_ADDRESS Address;
|
||||
ACPI_TABLE_HEADER *Pointer;
|
||||
UINT32 Length; /* Length fixed at 32 bits */
|
||||
UINT32 Length; /* Length fixed at 32 bits (fixed in table header) */
|
||||
ACPI_NAME_UNION Signature;
|
||||
ACPI_OWNER_ID OwnerId;
|
||||
UINT8 Flags;
|
||||
@@ -451,12 +408,11 @@ typedef struct acpi_table_desc
|
||||
|
||||
/* Masks for Flags field above */
|
||||
|
||||
#define ACPI_TABLE_ORIGIN_UNKNOWN (0)
|
||||
#define ACPI_TABLE_ORIGIN_MAPPED (1)
|
||||
#define ACPI_TABLE_ORIGIN_ALLOCATED (2)
|
||||
#define ACPI_TABLE_ORIGIN_OVERRIDE (4)
|
||||
#define ACPI_TABLE_ORIGIN_MASK (7)
|
||||
#define ACPI_TABLE_IS_LOADED (8)
|
||||
#define ACPI_TABLE_ORIGIN_EXTERNAL_VIRTUAL (0) /* Virtual address, external maintained */
|
||||
#define ACPI_TABLE_ORIGIN_INTERNAL_PHYSICAL (1) /* Physical address, internally mapped */
|
||||
#define ACPI_TABLE_ORIGIN_INTERNAL_VIRTUAL (2) /* Virtual address, internallly allocated */
|
||||
#define ACPI_TABLE_ORIGIN_MASK (3)
|
||||
#define ACPI_TABLE_IS_LOADED (8)
|
||||
|
||||
|
||||
/*
|
||||
@@ -464,9 +420,29 @@ typedef struct acpi_table_desc
|
||||
*/
|
||||
#include "actbl1.h"
|
||||
#include "actbl2.h"
|
||||
#include "actbl3.h"
|
||||
|
||||
/* Macros used to generate offsets to specific table fields */
|
||||
|
||||
#define ACPI_FADT_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_TABLE_FADT, f)
|
||||
#define ACPI_FADT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_FADT, f)
|
||||
|
||||
/*
|
||||
* Sizes of the various flavors of FADT. We need to look closely
|
||||
* at the FADT length because the version number essentially tells
|
||||
* us nothing because of many BIOS bugs where the version does not
|
||||
* match the expected length. In other words, the length of the
|
||||
* FADT is the bottom line as to what the version really is.
|
||||
*
|
||||
* For reference, the values below are as follows:
|
||||
* FADT V1 size: 0x074
|
||||
* FADT V2 size: 0x084
|
||||
* FADT V3 size: 0x0F4
|
||||
* FADT V4 size: 0x0F4
|
||||
* FADT V5 size: 0x10C
|
||||
*/
|
||||
#define ACPI_FADT_V1_SIZE (UINT32) (ACPI_FADT_OFFSET (Flags) + 4)
|
||||
#define ACPI_FADT_V2_SIZE (UINT32) (ACPI_FADT_OFFSET (MinorRevision) + 1)
|
||||
#define ACPI_FADT_V3_SIZE (UINT32) (ACPI_FADT_OFFSET (SleepControl))
|
||||
#define ACPI_FADT_V5_SIZE (UINT32) (sizeof (ACPI_TABLE_FADT))
|
||||
|
||||
#endif /* __ACTBL_H__ */
|
||||
|
||||
@@ -4,114 +4,42 @@
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
* 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.
|
||||
*
|
||||
* 2.1. This is your license from Intel Corp. under its intellectual property
|
||||
* rights. You may have additional license terms from the party that provided
|
||||
* you this software, covering your right to use that party's intellectual
|
||||
* property rights.
|
||||
* 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.
|
||||
*
|
||||
* 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
|
||||
* copy of the source code appearing in this file ("Covered Code") an
|
||||
* irrevocable, perpetual, worldwide license under Intel's copyrights in the
|
||||
* base code distributed originally by Intel ("Original Intel Code") to copy,
|
||||
* make derivatives, distribute, use and display any portion of the Covered
|
||||
* Code in any form, with the right to sublicense such rights; and
|
||||
*
|
||||
* 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
|
||||
* license (with the right to sublicense), under only those claims of Intel
|
||||
* patents that are infringed by the Original Intel Code, to make, use, sell,
|
||||
* offer to sell, and import the Covered Code and derivative works thereof
|
||||
* solely to the minimum extent necessary to exercise the above copyright
|
||||
* license, and in no event shall the patent license extend to any additions
|
||||
* to or modifications of the Original Intel Code. No other license or right
|
||||
* is granted directly or by implication, estoppel or otherwise;
|
||||
*
|
||||
* The above copyright and patent license is granted only if the following
|
||||
* conditions are met:
|
||||
*
|
||||
* 3. Conditions
|
||||
*
|
||||
* 3.1. Redistribution of Source with Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification with rights to further distribute source must include
|
||||
* the above Copyright Notice, the above License, this list of Conditions,
|
||||
* and the following Disclaimer and Export Compliance provision. In addition,
|
||||
* Licensee must cause all Covered Code to which Licensee contributes to
|
||||
* contain a file documenting the changes Licensee made to create that Covered
|
||||
* Code and the date of any change. Licensee must include in that file the
|
||||
* documentation of any changes made by any predecessor Licensee. Licensee
|
||||
* must include a prominent statement that the modification is derived,
|
||||
* directly or indirectly, from Original Intel Code.
|
||||
*
|
||||
* 3.2. Redistribution of Source with no Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification without rights to further distribute source must
|
||||
* include the following Disclaimer and Export Compliance provision in the
|
||||
* documentation and/or other materials provided with distribution. In
|
||||
* addition, Licensee may not authorize further sublicense of source of any
|
||||
* portion of the Covered Code, and must include terms to the effect that the
|
||||
* license from Licensee to its licensee is limited to the intellectual
|
||||
* property embodied in the software Licensee provides to its licensee, and
|
||||
* not to intellectual property embodied in modifications its licensee may
|
||||
* make.
|
||||
*
|
||||
* 3.3. Redistribution of Executable. Redistribution in executable form of any
|
||||
* substantial portion of the Covered Code or modification must reproduce the
|
||||
* above Copyright Notice, and the following Disclaimer and Export Compliance
|
||||
* provision in the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3.4. Intel retains all right, title, and interest in and to the Original
|
||||
* Intel Code.
|
||||
*
|
||||
* 3.5. Neither the name Intel nor any other trademark owned or controlled by
|
||||
* Intel shall be used in advertising or otherwise to promote the sale, use or
|
||||
* other dealings in products derived from or relating to the Covered Code
|
||||
* without prior written authorization from Intel.
|
||||
*
|
||||
* 4. Disclaimer and Export Compliance
|
||||
*
|
||||
* 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
|
||||
* HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
|
||||
* IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
|
||||
* INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
|
||||
* UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
|
||||
* PARTICULAR PURPOSE.
|
||||
*
|
||||
* 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
|
||||
* OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
|
||||
* COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
|
||||
* SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
|
||||
* CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
|
||||
* HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
|
||||
* SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
|
||||
* LIMITED REMEDY.
|
||||
*
|
||||
* 4.3. Licensee shall not export, either directly or indirectly, any of this
|
||||
* software or system incorporating such software without first obtaining any
|
||||
* required license or other approval from the U. S. Department of Commerce or
|
||||
* any other agency or department of the United States Government. In the
|
||||
* event Licensee exports any such software from the United States or
|
||||
* re-exports any such software from a foreign destination, Licensee shall
|
||||
* ensure that the distribution and export/re-export of the software is in
|
||||
* compliance with all laws, regulations, orders, or other restrictions of the
|
||||
* U.S. Export Administration Regulations. Licensee agrees that neither it nor
|
||||
* any of its subsidiaries will export/re-export any technical data, process,
|
||||
* software, or service, directly or indirectly, to any country for which the
|
||||
* United States government or any agency thereof requires an export license,
|
||||
* other governmental approval, or letter of assurance, without first obtaining
|
||||
* such license, approval or letter.
|
||||
*
|
||||
*****************************************************************************/
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef __ACTBL1_H__
|
||||
#define __ACTBL1_H__
|
||||
@@ -154,9 +82,15 @@
|
||||
#pragma pack(1)
|
||||
|
||||
/*
|
||||
* Note about bitfields: The UINT8 type is used for bitfields in ACPI tables.
|
||||
* This is the only type that is even remotely portable. Anything else is not
|
||||
* portable, so do not use any other bitfield types.
|
||||
* Note: C bitfields are not used for this reason:
|
||||
*
|
||||
* "Bitfields are great and easy to read, but unfortunately the C language
|
||||
* does not specify the layout of bitfields in memory, which means they are
|
||||
* essentially useless for dealing with packed data in on-disk formats or
|
||||
* binary wire protocols." (Or ACPI tables and buffers.) "If you ask me,
|
||||
* this decision was a design error in C. Ritchie could have picked an order
|
||||
* and stuck with it." Norman Ramsey.
|
||||
* See http://stackoverflow.com/a/1053662/41661
|
||||
*/
|
||||
|
||||
|
||||
@@ -202,7 +136,7 @@ typedef struct acpi_table_bert
|
||||
{
|
||||
ACPI_TABLE_HEADER Header; /* Common ACPI table header */
|
||||
UINT32 RegionLength; /* Length of the boot error region */
|
||||
UINT64 Address; /* Physical addresss of the error region */
|
||||
UINT64 Address; /* Physical address of the error region */
|
||||
|
||||
} ACPI_TABLE_BERT;
|
||||
|
||||
@@ -324,16 +258,17 @@ typedef struct acpi_einj_entry
|
||||
|
||||
enum AcpiEinjActions
|
||||
{
|
||||
ACPI_EINJ_BEGIN_OPERATION = 0,
|
||||
ACPI_EINJ_GET_TRIGGER_TABLE = 1,
|
||||
ACPI_EINJ_SET_ERROR_TYPE = 2,
|
||||
ACPI_EINJ_GET_ERROR_TYPE = 3,
|
||||
ACPI_EINJ_END_OPERATION = 4,
|
||||
ACPI_EINJ_EXECUTE_OPERATION = 5,
|
||||
ACPI_EINJ_CHECK_BUSY_STATUS = 6,
|
||||
ACPI_EINJ_GET_COMMAND_STATUS = 7,
|
||||
ACPI_EINJ_ACTION_RESERVED = 8, /* 8 and greater are reserved */
|
||||
ACPI_EINJ_TRIGGER_ERROR = 0xFF /* Except for this value */
|
||||
ACPI_EINJ_BEGIN_OPERATION = 0,
|
||||
ACPI_EINJ_GET_TRIGGER_TABLE = 1,
|
||||
ACPI_EINJ_SET_ERROR_TYPE = 2,
|
||||
ACPI_EINJ_GET_ERROR_TYPE = 3,
|
||||
ACPI_EINJ_END_OPERATION = 4,
|
||||
ACPI_EINJ_EXECUTE_OPERATION = 5,
|
||||
ACPI_EINJ_CHECK_BUSY_STATUS = 6,
|
||||
ACPI_EINJ_GET_COMMAND_STATUS = 7,
|
||||
ACPI_EINJ_SET_ERROR_TYPE_WITH_ADDRESS = 8,
|
||||
ACPI_EINJ_ACTION_RESERVED = 9, /* 9 and greater are reserved */
|
||||
ACPI_EINJ_TRIGGER_ERROR = 0xFF /* Except for this value */
|
||||
};
|
||||
|
||||
/* Values for Instruction field above */
|
||||
@@ -345,9 +280,33 @@ enum AcpiEinjInstructions
|
||||
ACPI_EINJ_WRITE_REGISTER = 2,
|
||||
ACPI_EINJ_WRITE_REGISTER_VALUE = 3,
|
||||
ACPI_EINJ_NOOP = 4,
|
||||
ACPI_EINJ_INSTRUCTION_RESERVED = 5 /* 5 and greater are reserved */
|
||||
ACPI_EINJ_FLUSH_CACHELINE = 5,
|
||||
ACPI_EINJ_INSTRUCTION_RESERVED = 6 /* 6 and greater are reserved */
|
||||
};
|
||||
|
||||
typedef struct acpi_einj_error_type_with_addr
|
||||
{
|
||||
UINT32 ErrorType;
|
||||
UINT32 VendorStructOffset;
|
||||
UINT32 Flags;
|
||||
UINT32 ApicId;
|
||||
UINT64 Address;
|
||||
UINT64 Range;
|
||||
UINT32 PcieId;
|
||||
|
||||
} ACPI_EINJ_ERROR_TYPE_WITH_ADDR;
|
||||
|
||||
typedef struct acpi_einj_vendor
|
||||
{
|
||||
UINT32 Length;
|
||||
UINT32 PcieId;
|
||||
UINT16 VendorId;
|
||||
UINT16 DeviceId;
|
||||
UINT8 RevisionId;
|
||||
UINT8 Reserved[3];
|
||||
|
||||
} ACPI_EINJ_VENDOR;
|
||||
|
||||
|
||||
/* EINJ Trigger Error Action Table */
|
||||
|
||||
@@ -385,6 +344,7 @@ enum AcpiEinjCommandStatus
|
||||
#define ACPI_EINJ_PLATFORM_CORRECTABLE (1<<9)
|
||||
#define ACPI_EINJ_PLATFORM_UNCORRECTABLE (1<<10)
|
||||
#define ACPI_EINJ_PLATFORM_FATAL (1<<11)
|
||||
#define ACPI_EINJ_VENDOR_DEFINED (1<<31)
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
@@ -564,7 +524,7 @@ typedef struct acpi_hest_aer_common
|
||||
UINT8 Enabled;
|
||||
UINT32 RecordsToPreallocate;
|
||||
UINT32 MaxSectionsPerRecord;
|
||||
UINT32 Bus;
|
||||
UINT32 Bus; /* Bus and Segment numbers */
|
||||
UINT16 Device;
|
||||
UINT16 Function;
|
||||
UINT16 DeviceControl;
|
||||
@@ -581,6 +541,14 @@ typedef struct acpi_hest_aer_common
|
||||
#define ACPI_HEST_FIRMWARE_FIRST (1)
|
||||
#define ACPI_HEST_GLOBAL (1<<1)
|
||||
|
||||
/*
|
||||
* Macros to access the bus/segment numbers in Bus field above:
|
||||
* Bus number is encoded in bits 7:0
|
||||
* Segment number is encoded in bits 23:8
|
||||
*/
|
||||
#define ACPI_HEST_BUS(Bus) ((Bus) & 0xFF)
|
||||
#define ACPI_HEST_SEGMENT(Bus) (((Bus) >> 8) & 0xFFFF)
|
||||
|
||||
|
||||
/* Hardware Error Notification */
|
||||
|
||||
@@ -607,7 +575,9 @@ enum AcpiHestNotifyTypes
|
||||
ACPI_HEST_NOTIFY_LOCAL = 2,
|
||||
ACPI_HEST_NOTIFY_SCI = 3,
|
||||
ACPI_HEST_NOTIFY_NMI = 4,
|
||||
ACPI_HEST_NOTIFY_RESERVED = 5 /* 5 and greater are reserved */
|
||||
ACPI_HEST_NOTIFY_CMCI = 5, /* ACPI 5.0 */
|
||||
ACPI_HEST_NOTIFY_MCE = 6, /* ACPI 5.0 */
|
||||
ACPI_HEST_NOTIFY_RESERVED = 7 /* 7 and greater are reserved */
|
||||
};
|
||||
|
||||
/* Values for ConfigWriteEnable bitfield above */
|
||||
@@ -792,23 +762,27 @@ typedef struct acpi_table_madt
|
||||
|
||||
enum AcpiMadtType
|
||||
{
|
||||
ACPI_MADT_TYPE_LOCAL_APIC = 0,
|
||||
ACPI_MADT_TYPE_IO_APIC = 1,
|
||||
ACPI_MADT_TYPE_INTERRUPT_OVERRIDE = 2,
|
||||
ACPI_MADT_TYPE_NMI_SOURCE = 3,
|
||||
ACPI_MADT_TYPE_LOCAL_APIC_NMI = 4,
|
||||
ACPI_MADT_TYPE_LOCAL_APIC_OVERRIDE = 5,
|
||||
ACPI_MADT_TYPE_IO_SAPIC = 6,
|
||||
ACPI_MADT_TYPE_LOCAL_SAPIC = 7,
|
||||
ACPI_MADT_TYPE_INTERRUPT_SOURCE = 8,
|
||||
ACPI_MADT_TYPE_LOCAL_X2APIC = 9,
|
||||
ACPI_MADT_TYPE_LOCAL_X2APIC_NMI = 10,
|
||||
ACPI_MADT_TYPE_RESERVED = 11 /* 11 and greater are reserved */
|
||||
ACPI_MADT_TYPE_LOCAL_APIC = 0,
|
||||
ACPI_MADT_TYPE_IO_APIC = 1,
|
||||
ACPI_MADT_TYPE_INTERRUPT_OVERRIDE = 2,
|
||||
ACPI_MADT_TYPE_NMI_SOURCE = 3,
|
||||
ACPI_MADT_TYPE_LOCAL_APIC_NMI = 4,
|
||||
ACPI_MADT_TYPE_LOCAL_APIC_OVERRIDE = 5,
|
||||
ACPI_MADT_TYPE_IO_SAPIC = 6,
|
||||
ACPI_MADT_TYPE_LOCAL_SAPIC = 7,
|
||||
ACPI_MADT_TYPE_INTERRUPT_SOURCE = 8,
|
||||
ACPI_MADT_TYPE_LOCAL_X2APIC = 9,
|
||||
ACPI_MADT_TYPE_LOCAL_X2APIC_NMI = 10,
|
||||
ACPI_MADT_TYPE_GENERIC_INTERRUPT = 11,
|
||||
ACPI_MADT_TYPE_GENERIC_DISTRIBUTOR = 12,
|
||||
ACPI_MADT_TYPE_GENERIC_MSI_FRAME = 13,
|
||||
ACPI_MADT_TYPE_GENERIC_REDISTRIBUTOR = 14,
|
||||
ACPI_MADT_TYPE_RESERVED = 15 /* 15 and greater are reserved */
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
* MADT Sub-tables, correspond to Type in ACPI_SUBTABLE_HEADER
|
||||
* MADT Subtables, correspond to Type in ACPI_SUBTABLE_HEADER
|
||||
*/
|
||||
|
||||
/* 0: Processor Local APIC */
|
||||
@@ -958,11 +932,84 @@ typedef struct acpi_madt_local_x2apic_nmi
|
||||
} ACPI_MADT_LOCAL_X2APIC_NMI;
|
||||
|
||||
|
||||
/* 11: Generic Interrupt (ACPI 5.0) */
|
||||
|
||||
typedef struct acpi_madt_generic_interrupt
|
||||
{
|
||||
ACPI_SUBTABLE_HEADER Header;
|
||||
UINT16 Reserved; /* Reserved - must be zero */
|
||||
UINT32 CpuInterfaceNumber;
|
||||
UINT32 Uid;
|
||||
UINT32 Flags;
|
||||
UINT32 ParkingVersion;
|
||||
UINT32 PerformanceInterrupt;
|
||||
UINT64 ParkedAddress;
|
||||
UINT64 BaseAddress;
|
||||
UINT64 GicvBaseAddress;
|
||||
UINT64 GichBaseAddress;
|
||||
UINT32 VgicInterrupt;
|
||||
UINT64 GicrBaseAddress;
|
||||
UINT64 ArmMpidr;
|
||||
|
||||
} ACPI_MADT_GENERIC_INTERRUPT;
|
||||
|
||||
/* Masks for Flags field above */
|
||||
|
||||
/* ACPI_MADT_ENABLED (1) Processor is usable if set */
|
||||
#define ACPI_MADT_PERFORMANCE_IRQ_MODE (1<<1) /* 01: Performance Interrupt Mode */
|
||||
#define ACPI_MADT_VGIC_IRQ_MODE (1<<2) /* 02: VGIC Maintenance Interrupt mode */
|
||||
|
||||
|
||||
/* 12: Generic Distributor (ACPI 5.0) */
|
||||
|
||||
typedef struct acpi_madt_generic_distributor
|
||||
{
|
||||
ACPI_SUBTABLE_HEADER Header;
|
||||
UINT16 Reserved; /* Reserved - must be zero */
|
||||
UINT32 GicId;
|
||||
UINT64 BaseAddress;
|
||||
UINT32 GlobalIrqBase;
|
||||
UINT32 Reserved2; /* Reserved - must be zero */
|
||||
|
||||
} ACPI_MADT_GENERIC_DISTRIBUTOR;
|
||||
|
||||
|
||||
/* 13: Generic MSI Frame (ACPI 5.1) */
|
||||
|
||||
typedef struct acpi_madt_generic_msi_frame
|
||||
{
|
||||
ACPI_SUBTABLE_HEADER Header;
|
||||
UINT16 Reserved; /* Reserved - must be zero */
|
||||
UINT32 MsiFrameId;
|
||||
UINT64 BaseAddress;
|
||||
UINT32 Flags;
|
||||
UINT16 SpiCount;
|
||||
UINT16 SpiBase;
|
||||
|
||||
} ACPI_MADT_GENERIC_MSI_FRAME;
|
||||
|
||||
/* Masks for Flags field above */
|
||||
|
||||
#define ACPI_MADT_OVERRIDE_SPI_VALUES (1)
|
||||
|
||||
|
||||
/* 14: Generic Redistributor (ACPI 5.1) */
|
||||
|
||||
typedef struct acpi_madt_generic_redistributor
|
||||
{
|
||||
ACPI_SUBTABLE_HEADER Header;
|
||||
UINT16 Reserved; /* reserved - must be zero */
|
||||
UINT64 BaseAddress;
|
||||
UINT32 Length;
|
||||
|
||||
} ACPI_MADT_GENERIC_REDISTRIBUTOR;
|
||||
|
||||
|
||||
/*
|
||||
* Common flags fields for MADT subtables
|
||||
*/
|
||||
|
||||
/* MADT Local APIC flags (LapicFlags) */
|
||||
/* MADT Local APIC flags */
|
||||
|
||||
#define ACPI_MADT_ENABLED (1) /* 00: Processor is usable if set */
|
||||
|
||||
@@ -1071,11 +1118,12 @@ enum AcpiSratType
|
||||
ACPI_SRAT_TYPE_CPU_AFFINITY = 0,
|
||||
ACPI_SRAT_TYPE_MEMORY_AFFINITY = 1,
|
||||
ACPI_SRAT_TYPE_X2APIC_CPU_AFFINITY = 2,
|
||||
ACPI_SRAT_TYPE_RESERVED = 3 /* 3 and greater are reserved */
|
||||
ACPI_SRAT_TYPE_GICC_AFFINITY = 3,
|
||||
ACPI_SRAT_TYPE_RESERVED = 4 /* 4 and greater are reserved */
|
||||
};
|
||||
|
||||
/*
|
||||
* SRAT Sub-tables, correspond to Type in ACPI_SUBTABLE_HEADER
|
||||
* SRAT Subtables, correspond to Type in ACPI_SUBTABLE_HEADER
|
||||
*/
|
||||
|
||||
/* 0: Processor Local APIC/SAPIC Affinity */
|
||||
@@ -1088,7 +1136,7 @@ typedef struct acpi_srat_cpu_affinity
|
||||
UINT32 Flags;
|
||||
UINT8 LocalSapicEid;
|
||||
UINT8 ProximityDomainHi[3];
|
||||
UINT32 Reserved; /* Reserved, must be zero */
|
||||
UINT32 ClockDomain;
|
||||
|
||||
} ACPI_SRAT_CPU_AFFINITY;
|
||||
|
||||
@@ -1138,6 +1186,22 @@ typedef struct acpi_srat_x2apic_cpu_affinity
|
||||
#define ACPI_SRAT_CPU_ENABLED (1) /* 00: Use affinity structure */
|
||||
|
||||
|
||||
/* 3: GICC Affinity (ACPI 5.1) */
|
||||
|
||||
typedef struct acpi_srat_gicc_affinity
|
||||
{
|
||||
ACPI_SUBTABLE_HEADER Header;
|
||||
UINT32 ProximityDomain;
|
||||
UINT32 AcpiProcessorUid;
|
||||
UINT32 Flags;
|
||||
UINT32 ClockDomain;
|
||||
|
||||
} ACPI_SRAT_GICC_AFFINITY;
|
||||
|
||||
/* Flags for ACPI_SRAT_GICC_AFFINITY */
|
||||
|
||||
#define ACPI_SRAT_GICC_ENABLED (1) /* 00: Use affinity structure */
|
||||
|
||||
/* Reset to default packing */
|
||||
|
||||
#pragma pack()
|
||||
|
||||
@@ -1,117 +1,45 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Name: actbl2.h - ACPI Specification Revision 2.0 Tables
|
||||
* Name: actbl2.h - ACPI Table Definitions (tables not in ACPI spec)
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
* 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.
|
||||
*
|
||||
* 2.1. This is your license from Intel Corp. under its intellectual property
|
||||
* rights. You may have additional license terms from the party that provided
|
||||
* you this software, covering your right to use that party's intellectual
|
||||
* property rights.
|
||||
* 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.
|
||||
*
|
||||
* 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
|
||||
* copy of the source code appearing in this file ("Covered Code") an
|
||||
* irrevocable, perpetual, worldwide license under Intel's copyrights in the
|
||||
* base code distributed originally by Intel ("Original Intel Code") to copy,
|
||||
* make derivatives, distribute, use and display any portion of the Covered
|
||||
* Code in any form, with the right to sublicense such rights; and
|
||||
*
|
||||
* 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
|
||||
* license (with the right to sublicense), under only those claims of Intel
|
||||
* patents that are infringed by the Original Intel Code, to make, use, sell,
|
||||
* offer to sell, and import the Covered Code and derivative works thereof
|
||||
* solely to the minimum extent necessary to exercise the above copyright
|
||||
* license, and in no event shall the patent license extend to any additions
|
||||
* to or modifications of the Original Intel Code. No other license or right
|
||||
* is granted directly or by implication, estoppel or otherwise;
|
||||
*
|
||||
* The above copyright and patent license is granted only if the following
|
||||
* conditions are met:
|
||||
*
|
||||
* 3. Conditions
|
||||
*
|
||||
* 3.1. Redistribution of Source with Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification with rights to further distribute source must include
|
||||
* the above Copyright Notice, the above License, this list of Conditions,
|
||||
* and the following Disclaimer and Export Compliance provision. In addition,
|
||||
* Licensee must cause all Covered Code to which Licensee contributes to
|
||||
* contain a file documenting the changes Licensee made to create that Covered
|
||||
* Code and the date of any change. Licensee must include in that file the
|
||||
* documentation of any changes made by any predecessor Licensee. Licensee
|
||||
* must include a prominent statement that the modification is derived,
|
||||
* directly or indirectly, from Original Intel Code.
|
||||
*
|
||||
* 3.2. Redistribution of Source with no Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification without rights to further distribute source must
|
||||
* include the following Disclaimer and Export Compliance provision in the
|
||||
* documentation and/or other materials provided with distribution. In
|
||||
* addition, Licensee may not authorize further sublicense of source of any
|
||||
* portion of the Covered Code, and must include terms to the effect that the
|
||||
* license from Licensee to its licensee is limited to the intellectual
|
||||
* property embodied in the software Licensee provides to its licensee, and
|
||||
* not to intellectual property embodied in modifications its licensee may
|
||||
* make.
|
||||
*
|
||||
* 3.3. Redistribution of Executable. Redistribution in executable form of any
|
||||
* substantial portion of the Covered Code or modification must reproduce the
|
||||
* above Copyright Notice, and the following Disclaimer and Export Compliance
|
||||
* provision in the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3.4. Intel retains all right, title, and interest in and to the Original
|
||||
* Intel Code.
|
||||
*
|
||||
* 3.5. Neither the name Intel nor any other trademark owned or controlled by
|
||||
* Intel shall be used in advertising or otherwise to promote the sale, use or
|
||||
* other dealings in products derived from or relating to the Covered Code
|
||||
* without prior written authorization from Intel.
|
||||
*
|
||||
* 4. Disclaimer and Export Compliance
|
||||
*
|
||||
* 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
|
||||
* HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
|
||||
* IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
|
||||
* INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
|
||||
* UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
|
||||
* PARTICULAR PURPOSE.
|
||||
*
|
||||
* 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
|
||||
* OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
|
||||
* COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
|
||||
* SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
|
||||
* CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
|
||||
* HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
|
||||
* SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
|
||||
* LIMITED REMEDY.
|
||||
*
|
||||
* 4.3. Licensee shall not export, either directly or indirectly, any of this
|
||||
* software or system incorporating such software without first obtaining any
|
||||
* required license or other approval from the U. S. Department of Commerce or
|
||||
* any other agency or department of the United States Government. In the
|
||||
* event Licensee exports any such software from the United States or
|
||||
* re-exports any such software from a foreign destination, Licensee shall
|
||||
* ensure that the distribution and export/re-export of the software is in
|
||||
* compliance with all laws, regulations, orders, or other restrictions of the
|
||||
* U.S. Export Administration Regulations. Licensee agrees that neither it nor
|
||||
* any of its subsidiaries will export/re-export any technical data, process,
|
||||
* software, or service, directly or indirectly, to any country for which the
|
||||
* United States government or any agency thereof requires an export license,
|
||||
* other governmental approval, or letter of assurance, without first obtaining
|
||||
* such license, approval or letter.
|
||||
*
|
||||
*****************************************************************************/
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef __ACTBL2_H__
|
||||
#define __ACTBL2_H__
|
||||
@@ -137,18 +65,23 @@
|
||||
*/
|
||||
#define ACPI_SIG_ASF "ASF!" /* Alert Standard Format table */
|
||||
#define ACPI_SIG_BOOT "BOOT" /* Simple Boot Flag Table */
|
||||
#define ACPI_SIG_CSRT "CSRT" /* Core System Resource Table */
|
||||
#define ACPI_SIG_DBG2 "DBG2" /* Debug Port table type 2 */
|
||||
#define ACPI_SIG_DBGP "DBGP" /* Debug Port table */
|
||||
#define ACPI_SIG_DMAR "DMAR" /* DMA Remapping table */
|
||||
#define ACPI_SIG_HPET "HPET" /* High Precision Event Timer table */
|
||||
#define ACPI_SIG_IBFT "IBFT" /* iSCSI Boot Firmware Table */
|
||||
#define ACPI_SIG_IVRS "IVRS" /* I/O Virtualization Reporting Structure */
|
||||
#define ACPI_SIG_LPIT "LPIT" /* Low Power Idle Table */
|
||||
#define ACPI_SIG_MCFG "MCFG" /* PCI Memory Mapped Configuration table */
|
||||
#define ACPI_SIG_MCHI "MCHI" /* Management Controller Host Interface table */
|
||||
#define ACPI_SIG_MTMR "MTMR" /* MID Timer table */
|
||||
#define ACPI_SIG_SLIC "SLIC" /* Software Licensing Description Table */
|
||||
#define ACPI_SIG_SPCR "SPCR" /* Serial Port Console Redirection table */
|
||||
#define ACPI_SIG_SPMI "SPMI" /* Server Platform Management Interface table */
|
||||
#define ACPI_SIG_TCPA "TCPA" /* Trusted Computing Platform Alliance table */
|
||||
#define ACPI_SIG_UEFI "UEFI" /* Uefi Boot Optimization Table */
|
||||
#define ACPI_SIG_VRTC "VRTC" /* Virtual Real Time Clock Table */
|
||||
#define ACPI_SIG_WAET "WAET" /* Windows ACPI Emulated devices Table */
|
||||
#define ACPI_SIG_WDAT "WDAT" /* Watchdog Action Table */
|
||||
#define ACPI_SIG_WDDT "WDDT" /* Watchdog Timer Description Table */
|
||||
@@ -170,9 +103,15 @@
|
||||
#pragma pack(1)
|
||||
|
||||
/*
|
||||
* Note about bitfields: The UINT8 type is used for bitfields in ACPI tables.
|
||||
* This is the only type that is even remotely portable. Anything else is not
|
||||
* portable, so do not use any other bitfield types.
|
||||
* Note: C bitfields are not used for this reason:
|
||||
*
|
||||
* "Bitfields are great and easy to read, but unfortunately the C language
|
||||
* does not specify the layout of bitfields in memory, which means they are
|
||||
* essentially useless for dealing with packed data in on-disk formats or
|
||||
* binary wire protocols." (Or ACPI tables and buffers.) "If you ask me,
|
||||
* this decision was a design error in C. Ritchie could have picked an order
|
||||
* and stuck with it." Norman Ramsey.
|
||||
* See http://stackoverflow.com/a/1053662/41661
|
||||
*/
|
||||
|
||||
|
||||
@@ -334,6 +273,158 @@ typedef struct acpi_table_boot
|
||||
} ACPI_TABLE_BOOT;
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* CSRT - Core System Resource Table
|
||||
* Version 0
|
||||
*
|
||||
* Conforms to the "Core System Resource Table (CSRT)", November 14, 2011
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
typedef struct acpi_table_csrt
|
||||
{
|
||||
ACPI_TABLE_HEADER Header; /* Common ACPI table header */
|
||||
|
||||
} ACPI_TABLE_CSRT;
|
||||
|
||||
|
||||
/* Resource Group subtable */
|
||||
|
||||
typedef struct acpi_csrt_group
|
||||
{
|
||||
UINT32 Length;
|
||||
UINT32 VendorId;
|
||||
UINT32 SubvendorId;
|
||||
UINT16 DeviceId;
|
||||
UINT16 SubdeviceId;
|
||||
UINT16 Revision;
|
||||
UINT16 Reserved;
|
||||
UINT32 SharedInfoLength;
|
||||
|
||||
/* Shared data immediately follows (Length = SharedInfoLength) */
|
||||
|
||||
} ACPI_CSRT_GROUP;
|
||||
|
||||
/* Shared Info subtable */
|
||||
|
||||
typedef struct acpi_csrt_shared_info
|
||||
{
|
||||
UINT16 MajorVersion;
|
||||
UINT16 MinorVersion;
|
||||
UINT32 MmioBaseLow;
|
||||
UINT32 MmioBaseHigh;
|
||||
UINT32 GsiInterrupt;
|
||||
UINT8 InterruptPolarity;
|
||||
UINT8 InterruptMode;
|
||||
UINT8 NumChannels;
|
||||
UINT8 DmaAddressWidth;
|
||||
UINT16 BaseRequestLine;
|
||||
UINT16 NumHandshakeSignals;
|
||||
UINT32 MaxBlockSize;
|
||||
|
||||
/* Resource descriptors immediately follow (Length = Group Length - SharedInfoLength) */
|
||||
|
||||
} ACPI_CSRT_SHARED_INFO;
|
||||
|
||||
/* Resource Descriptor subtable */
|
||||
|
||||
typedef struct acpi_csrt_descriptor
|
||||
{
|
||||
UINT32 Length;
|
||||
UINT16 Type;
|
||||
UINT16 Subtype;
|
||||
UINT32 Uid;
|
||||
|
||||
/* Resource-specific information immediately follows */
|
||||
|
||||
} ACPI_CSRT_DESCRIPTOR;
|
||||
|
||||
|
||||
/* Resource Types */
|
||||
|
||||
#define ACPI_CSRT_TYPE_INTERRUPT 0x0001
|
||||
#define ACPI_CSRT_TYPE_TIMER 0x0002
|
||||
#define ACPI_CSRT_TYPE_DMA 0x0003
|
||||
|
||||
/* Resource Subtypes */
|
||||
|
||||
#define ACPI_CSRT_XRUPT_LINE 0x0000
|
||||
#define ACPI_CSRT_XRUPT_CONTROLLER 0x0001
|
||||
#define ACPI_CSRT_TIMER 0x0000
|
||||
#define ACPI_CSRT_DMA_CHANNEL 0x0000
|
||||
#define ACPI_CSRT_DMA_CONTROLLER 0x0001
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* DBG2 - Debug Port Table 2
|
||||
* Version 0 (Both main table and subtables)
|
||||
*
|
||||
* Conforms to "Microsoft Debug Port Table 2 (DBG2)", May 22 2012.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
typedef struct acpi_table_dbg2
|
||||
{
|
||||
ACPI_TABLE_HEADER Header; /* Common ACPI table header */
|
||||
UINT32 InfoOffset;
|
||||
UINT32 InfoCount;
|
||||
|
||||
} ACPI_TABLE_DBG2;
|
||||
|
||||
|
||||
typedef struct acpi_dbg2_header
|
||||
{
|
||||
UINT32 InfoOffset;
|
||||
UINT32 InfoCount;
|
||||
|
||||
} ACPI_DBG2_HEADER;
|
||||
|
||||
|
||||
/* Debug Device Information Subtable */
|
||||
|
||||
typedef struct acpi_dbg2_device
|
||||
{
|
||||
UINT8 Revision;
|
||||
UINT16 Length;
|
||||
UINT8 RegisterCount; /* Number of BaseAddress registers */
|
||||
UINT16 NamepathLength;
|
||||
UINT16 NamepathOffset;
|
||||
UINT16 OemDataLength;
|
||||
UINT16 OemDataOffset;
|
||||
UINT16 PortType;
|
||||
UINT16 PortSubtype;
|
||||
UINT16 Reserved;
|
||||
UINT16 BaseAddressOffset;
|
||||
UINT16 AddressSizeOffset;
|
||||
/*
|
||||
* Data that follows:
|
||||
* BaseAddress (required) - Each in 12-byte Generic Address Structure format.
|
||||
* AddressSize (required) - Array of UINT32 sizes corresponding to each BaseAddress register.
|
||||
* Namepath (required) - Null terminated string. Single dot if not supported.
|
||||
* OemData (optional) - Length is OemDataLength.
|
||||
*/
|
||||
} ACPI_DBG2_DEVICE;
|
||||
|
||||
/* Types for PortType field above */
|
||||
|
||||
#define ACPI_DBG2_SERIAL_PORT 0x8000
|
||||
#define ACPI_DBG2_1394_PORT 0x8001
|
||||
#define ACPI_DBG2_USB_PORT 0x8002
|
||||
#define ACPI_DBG2_NET_PORT 0x8003
|
||||
|
||||
/* Subtypes for PortSubtype field above */
|
||||
|
||||
#define ACPI_DBG2_16550_COMPATIBLE 0x0000
|
||||
#define ACPI_DBG2_16550_SUBSET 0x0001
|
||||
|
||||
#define ACPI_DBG2_1394_STANDARD 0x0000
|
||||
|
||||
#define ACPI_DBG2_USB_XHCI 0x0000
|
||||
#define ACPI_DBG2_USB_EHCI 0x0001
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* DBGP - Debug Port table
|
||||
@@ -359,7 +450,7 @@ typedef struct acpi_table_dbgp
|
||||
* Version 1
|
||||
*
|
||||
* Conforms to "Intel Virtualization Technology for Directed I/O",
|
||||
* Version 1.2, Sept. 2008
|
||||
* Version 2.2, Sept. 2013
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
@@ -392,9 +483,10 @@ enum AcpiDmarType
|
||||
{
|
||||
ACPI_DMAR_TYPE_HARDWARE_UNIT = 0,
|
||||
ACPI_DMAR_TYPE_RESERVED_MEMORY = 1,
|
||||
ACPI_DMAR_TYPE_ATSR = 2,
|
||||
ACPI_DMAR_HARDWARE_AFFINITY = 3,
|
||||
ACPI_DMAR_TYPE_RESERVED = 4 /* 4 and greater are reserved */
|
||||
ACPI_DMAR_TYPE_ROOT_ATS = 2,
|
||||
ACPI_DMAR_TYPE_HARDWARE_AFFINITY = 3,
|
||||
ACPI_DMAR_TYPE_NAMESPACE = 4,
|
||||
ACPI_DMAR_TYPE_RESERVED = 5 /* 5 and greater are reserved */
|
||||
};
|
||||
|
||||
|
||||
@@ -410,7 +502,7 @@ typedef struct acpi_dmar_device_scope
|
||||
|
||||
} ACPI_DMAR_DEVICE_SCOPE;
|
||||
|
||||
/* Values for EntryType in ACPI_DMAR_DEVICE_SCOPE */
|
||||
/* Values for EntryType in ACPI_DMAR_DEVICE_SCOPE - device types */
|
||||
|
||||
enum AcpiDmarScopeType
|
||||
{
|
||||
@@ -419,7 +511,8 @@ enum AcpiDmarScopeType
|
||||
ACPI_DMAR_SCOPE_TYPE_BRIDGE = 2,
|
||||
ACPI_DMAR_SCOPE_TYPE_IOAPIC = 3,
|
||||
ACPI_DMAR_SCOPE_TYPE_HPET = 4,
|
||||
ACPI_DMAR_SCOPE_TYPE_RESERVED = 5 /* 5 and greater are reserved */
|
||||
ACPI_DMAR_SCOPE_TYPE_NAMESPACE = 5,
|
||||
ACPI_DMAR_SCOPE_TYPE_RESERVED = 6 /* 6 and greater are reserved */
|
||||
};
|
||||
|
||||
typedef struct acpi_dmar_pci_path
|
||||
@@ -431,7 +524,7 @@ typedef struct acpi_dmar_pci_path
|
||||
|
||||
|
||||
/*
|
||||
* DMAR Sub-tables, correspond to Type in ACPI_DMAR_HEADER
|
||||
* DMAR Subtables, correspond to Type in ACPI_DMAR_HEADER
|
||||
*/
|
||||
|
||||
/* 0: Hardware Unit Definition */
|
||||
@@ -496,6 +589,18 @@ typedef struct acpi_dmar_rhsa
|
||||
} ACPI_DMAR_RHSA;
|
||||
|
||||
|
||||
/* 4: ACPI Namespace Device Declaration Structure */
|
||||
|
||||
typedef struct acpi_dmar_andd
|
||||
{
|
||||
ACPI_DMAR_HEADER Header;
|
||||
UINT8 Reserved[3];
|
||||
UINT8 DeviceNumber;
|
||||
char DeviceName[1];
|
||||
|
||||
} ACPI_DMAR_ANDD;
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* HPET - High Precision Event Timer table
|
||||
@@ -844,7 +949,83 @@ typedef struct acpi_ivrs_memory
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* MCFG - PCI Memory Mapped Configuration table and sub-table
|
||||
* LPIT - Low Power Idle Table
|
||||
*
|
||||
* Conforms to "ACPI Low Power Idle Table (LPIT) and _LPD Proposal (DRAFT)"
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
typedef struct acpi_table_lpit
|
||||
{
|
||||
ACPI_TABLE_HEADER Header; /* Common ACPI table header */
|
||||
|
||||
} ACPI_TABLE_LPIT;
|
||||
|
||||
|
||||
/* LPIT subtable header */
|
||||
|
||||
typedef struct acpi_lpit_header
|
||||
{
|
||||
UINT32 Type; /* Subtable type */
|
||||
UINT32 Length; /* Subtable length */
|
||||
UINT16 UniqueId;
|
||||
UINT16 Reserved;
|
||||
UINT32 Flags;
|
||||
|
||||
} ACPI_LPIT_HEADER;
|
||||
|
||||
/* Values for subtable Type above */
|
||||
|
||||
enum AcpiLpitType
|
||||
{
|
||||
ACPI_LPIT_TYPE_NATIVE_CSTATE = 0x00,
|
||||
ACPI_LPIT_TYPE_SIMPLE_IO = 0x01
|
||||
};
|
||||
|
||||
/* Masks for Flags field above */
|
||||
|
||||
#define ACPI_LPIT_STATE_DISABLED (1)
|
||||
#define ACPI_LPIT_NO_COUNTER (1<<1)
|
||||
|
||||
/*
|
||||
* LPIT subtables, correspond to Type in ACPI_LPIT_HEADER
|
||||
*/
|
||||
|
||||
/* 0x00: Native C-state instruction based LPI structure */
|
||||
|
||||
typedef struct acpi_lpit_native
|
||||
{
|
||||
ACPI_LPIT_HEADER Header;
|
||||
ACPI_GENERIC_ADDRESS EntryTrigger;
|
||||
UINT32 Residency;
|
||||
UINT32 Latency;
|
||||
ACPI_GENERIC_ADDRESS ResidencyCounter;
|
||||
UINT64 CounterFrequency;
|
||||
|
||||
} ACPI_LPIT_NATIVE;
|
||||
|
||||
|
||||
/* 0x01: Simple I/O based LPI structure */
|
||||
|
||||
typedef struct acpi_lpit_io
|
||||
{
|
||||
ACPI_LPIT_HEADER Header;
|
||||
ACPI_GENERIC_ADDRESS EntryTrigger;
|
||||
UINT32 TriggerAction;
|
||||
UINT64 TriggerValue;
|
||||
UINT64 TriggerMask;
|
||||
ACPI_GENERIC_ADDRESS MinimumIdleState;
|
||||
UINT32 Residency;
|
||||
UINT32 Latency;
|
||||
ACPI_GENERIC_ADDRESS ResidencyCounter;
|
||||
UINT64 CounterFrequency;
|
||||
|
||||
} ACPI_LPIT_IO;
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* MCFG - PCI Memory Mapped Configuration table and subtable
|
||||
* Version 1
|
||||
*
|
||||
* Conforms to "PCI Firmware Specification", Revision 3.0, June 20, 2005
|
||||
@@ -901,6 +1082,109 @@ typedef struct acpi_table_mchi
|
||||
} ACPI_TABLE_MCHI;
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* MTMR - MID Timer Table
|
||||
* Version 1
|
||||
*
|
||||
* Conforms to "Simple Firmware Interface Specification",
|
||||
* Draft 0.8.2, Oct 19, 2010
|
||||
* NOTE: The ACPI MTMR is equivalent to the SFI MTMR table.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
typedef struct acpi_table_mtmr
|
||||
{
|
||||
ACPI_TABLE_HEADER Header; /* Common ACPI table header */
|
||||
|
||||
} ACPI_TABLE_MTMR;
|
||||
|
||||
/* MTMR entry */
|
||||
|
||||
typedef struct acpi_mtmr_entry
|
||||
{
|
||||
ACPI_GENERIC_ADDRESS PhysicalAddress;
|
||||
UINT32 Frequency;
|
||||
UINT32 Irq;
|
||||
|
||||
} ACPI_MTMR_ENTRY;
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* SLIC - Software Licensing Description Table
|
||||
* Version 1
|
||||
*
|
||||
* Conforms to "OEM Activation 2.0 for Windows Vista Operating Systems",
|
||||
* Copyright 2006
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
/* Basic SLIC table is only the common ACPI header */
|
||||
|
||||
typedef struct acpi_table_slic
|
||||
{
|
||||
ACPI_TABLE_HEADER Header; /* Common ACPI table header */
|
||||
|
||||
} ACPI_TABLE_SLIC;
|
||||
|
||||
|
||||
/* Common SLIC subtable header */
|
||||
|
||||
typedef struct acpi_slic_header
|
||||
{
|
||||
UINT32 Type;
|
||||
UINT32 Length;
|
||||
|
||||
} ACPI_SLIC_HEADER;
|
||||
|
||||
/* Values for Type field above */
|
||||
|
||||
enum AcpiSlicType
|
||||
{
|
||||
ACPI_SLIC_TYPE_PUBLIC_KEY = 0,
|
||||
ACPI_SLIC_TYPE_WINDOWS_MARKER = 1,
|
||||
ACPI_SLIC_TYPE_RESERVED = 2 /* 2 and greater are reserved */
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
* SLIC Subtables, correspond to Type in ACPI_SLIC_HEADER
|
||||
*/
|
||||
|
||||
/* 0: Public Key Structure */
|
||||
|
||||
typedef struct acpi_slic_key
|
||||
{
|
||||
ACPI_SLIC_HEADER Header;
|
||||
UINT8 KeyType;
|
||||
UINT8 Version;
|
||||
UINT16 Reserved;
|
||||
UINT32 Algorithm;
|
||||
char Magic[4];
|
||||
UINT32 BitLength;
|
||||
UINT32 Exponent;
|
||||
UINT8 Modulus[128];
|
||||
|
||||
} ACPI_SLIC_KEY;
|
||||
|
||||
|
||||
/* 1: Windows Marker Structure */
|
||||
|
||||
typedef struct acpi_slic_marker
|
||||
{
|
||||
ACPI_SLIC_HEADER Header;
|
||||
UINT32 Version;
|
||||
char OemId[ACPI_OEM_ID_SIZE]; /* ASCII OEM identification */
|
||||
char OemTableId[ACPI_OEM_TABLE_ID_SIZE]; /* ASCII OEM table identification */
|
||||
char WindowsFlag[8];
|
||||
UINT32 SlicVersion;
|
||||
UINT8 Reserved[16];
|
||||
UINT8 Signature[128];
|
||||
|
||||
} ACPI_SLIC_MARKER;
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* SPCR - Serial Port Console Redirection table
|
||||
@@ -1025,6 +1309,33 @@ typedef struct acpi_table_uefi
|
||||
} ACPI_TABLE_UEFI;
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* VRTC - Virtual Real Time Clock Table
|
||||
* Version 1
|
||||
*
|
||||
* Conforms to "Simple Firmware Interface Specification",
|
||||
* Draft 0.8.2, Oct 19, 2010
|
||||
* NOTE: The ACPI VRTC is equivalent to The SFI MRTC table.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
typedef struct acpi_table_vrtc
|
||||
{
|
||||
ACPI_TABLE_HEADER Header; /* Common ACPI table header */
|
||||
|
||||
} ACPI_TABLE_VRTC;
|
||||
|
||||
/* VRTC entry */
|
||||
|
||||
typedef struct acpi_vrtc_entry
|
||||
{
|
||||
ACPI_GENERIC_ADDRESS PhysicalAddress;
|
||||
UINT32 Irq;
|
||||
|
||||
} ACPI_VRTC_ENTRY;
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* WAET - Windows ACPI Emulated devices Table
|
||||
@@ -1201,4 +1512,3 @@ typedef struct acpi_table_wdrt
|
||||
#pragma pack()
|
||||
|
||||
#endif /* __ACTBL2_H__ */
|
||||
|
||||
|
||||
845
minix/drivers/power/acpi/include/actbl3.h
Normal file
845
minix/drivers/power/acpi/include/actbl3.h
Normal file
@@ -0,0 +1,845 @@
|
||||
/******************************************************************************
|
||||
*
|
||||
* Name: actbl3.h - ACPI Table Definitions
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, 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.
|
||||
*/
|
||||
|
||||
#ifndef __ACTBL3_H__
|
||||
#define __ACTBL3_H__
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* Additional ACPI Tables (3)
|
||||
*
|
||||
* These tables are not consumed directly by the ACPICA subsystem, but are
|
||||
* included here to support device drivers and the AML disassembler.
|
||||
*
|
||||
* The tables in this file are fully defined within the ACPI specification.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
|
||||
/*
|
||||
* Values for description table header signatures for tables defined in this
|
||||
* file. Useful because they make it more difficult to inadvertently type in
|
||||
* the wrong signature.
|
||||
*/
|
||||
#define ACPI_SIG_BGRT "BGRT" /* Boot Graphics Resource Table */
|
||||
#define ACPI_SIG_DRTM "DRTM" /* Dynamic Root of Trust for Measurement table */
|
||||
#define ACPI_SIG_FPDT "FPDT" /* Firmware Performance Data Table */
|
||||
#define ACPI_SIG_GTDT "GTDT" /* Generic Timer Description Table */
|
||||
#define ACPI_SIG_MPST "MPST" /* Memory Power State Table */
|
||||
#define ACPI_SIG_PCCT "PCCT" /* Platform Communications Channel Table */
|
||||
#define ACPI_SIG_PMTT "PMTT" /* Platform Memory Topology Table */
|
||||
#define ACPI_SIG_RASF "RASF" /* RAS Feature table */
|
||||
#define ACPI_SIG_TPM2 "TPM2" /* Trusted Platform Module 2.0 H/W interface table */
|
||||
|
||||
#define ACPI_SIG_S3PT "S3PT" /* S3 Performance (sub)Table */
|
||||
#define ACPI_SIG_PCCS "PCC" /* PCC Shared Memory Region */
|
||||
|
||||
/* Reserved table signatures */
|
||||
|
||||
#define ACPI_SIG_MATR "MATR" /* Memory Address Translation Table */
|
||||
#define ACPI_SIG_MSDM "MSDM" /* Microsoft Data Management Table */
|
||||
#define ACPI_SIG_WPBT "WPBT" /* Windows Platform Binary Table */
|
||||
|
||||
/*
|
||||
* All tables must be byte-packed to match the ACPI specification, since
|
||||
* the tables are provided by the system BIOS.
|
||||
*/
|
||||
#pragma pack(1)
|
||||
|
||||
/*
|
||||
* Note: C bitfields are not used for this reason:
|
||||
*
|
||||
* "Bitfields are great and easy to read, but unfortunately the C language
|
||||
* does not specify the layout of bitfields in memory, which means they are
|
||||
* essentially useless for dealing with packed data in on-disk formats or
|
||||
* binary wire protocols." (Or ACPI tables and buffers.) "If you ask me,
|
||||
* this decision was a design error in C. Ritchie could have picked an order
|
||||
* and stuck with it." Norman Ramsey.
|
||||
* See http://stackoverflow.com/a/1053662/41661
|
||||
*/
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* BGRT - Boot Graphics Resource Table (ACPI 5.0)
|
||||
* Version 1
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
typedef struct acpi_table_bgrt
|
||||
{
|
||||
ACPI_TABLE_HEADER Header; /* Common ACPI table header */
|
||||
UINT16 Version;
|
||||
UINT8 Status;
|
||||
UINT8 ImageType;
|
||||
UINT64 ImageAddress;
|
||||
UINT32 ImageOffsetX;
|
||||
UINT32 ImageOffsetY;
|
||||
|
||||
} ACPI_TABLE_BGRT;
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* DRTM - Dynamic Root of Trust for Measurement table
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
typedef struct acpi_table_drtm
|
||||
{
|
||||
ACPI_TABLE_HEADER Header; /* Common ACPI table header */
|
||||
UINT64 EntryBaseAddress;
|
||||
UINT64 EntryLength;
|
||||
UINT32 EntryAddress32;
|
||||
UINT64 EntryAddress64;
|
||||
UINT64 ExitAddress;
|
||||
UINT64 LogAreaAddress;
|
||||
UINT32 LogAreaLength;
|
||||
UINT64 ArchDependentAddress;
|
||||
UINT32 Flags;
|
||||
|
||||
} ACPI_TABLE_DRTM;
|
||||
|
||||
/* 1) Validated Tables List */
|
||||
|
||||
typedef struct acpi_drtm_vtl_list
|
||||
{
|
||||
UINT32 ValidatedTableListCount;
|
||||
|
||||
} ACPI_DRTM_VTL_LIST;
|
||||
|
||||
/* 2) Resources List */
|
||||
|
||||
typedef struct acpi_drtm_resource_list
|
||||
{
|
||||
UINT32 ResourceListCount;
|
||||
|
||||
} ACPI_DRTM_RESOURCE_LIST;
|
||||
|
||||
/* 3) Platform-specific Identifiers List */
|
||||
|
||||
typedef struct acpi_drtm_id_list
|
||||
{
|
||||
UINT32 IdListCount;
|
||||
|
||||
} ACPI_DRTM_ID_LIST;
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FPDT - Firmware Performance Data Table (ACPI 5.0)
|
||||
* Version 1
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
typedef struct acpi_table_fpdt
|
||||
{
|
||||
ACPI_TABLE_HEADER Header; /* Common ACPI table header */
|
||||
|
||||
} ACPI_TABLE_FPDT;
|
||||
|
||||
|
||||
/* FPDT subtable header */
|
||||
|
||||
typedef struct acpi_fpdt_header
|
||||
{
|
||||
UINT16 Type;
|
||||
UINT8 Length;
|
||||
UINT8 Revision;
|
||||
|
||||
} ACPI_FPDT_HEADER;
|
||||
|
||||
/* Values for Type field above */
|
||||
|
||||
enum AcpiFpdtType
|
||||
{
|
||||
ACPI_FPDT_TYPE_BOOT = 0,
|
||||
ACPI_FPDT_TYPE_S3PERF = 1
|
||||
};
|
||||
|
||||
|
||||
/*
|
||||
* FPDT subtables
|
||||
*/
|
||||
|
||||
/* 0: Firmware Basic Boot Performance Record */
|
||||
|
||||
typedef struct acpi_fpdt_boot
|
||||
{
|
||||
ACPI_FPDT_HEADER Header;
|
||||
UINT8 Reserved[4];
|
||||
UINT64 ResetEnd;
|
||||
UINT64 LoadStart;
|
||||
UINT64 StartupStart;
|
||||
UINT64 ExitServicesEntry;
|
||||
UINT64 ExitServicesExit;
|
||||
|
||||
} ACPI_FPDT_BOOT;
|
||||
|
||||
|
||||
/* 1: S3 Performance Table Pointer Record */
|
||||
|
||||
typedef struct acpi_fpdt_s3pt_ptr
|
||||
{
|
||||
ACPI_FPDT_HEADER Header;
|
||||
UINT8 Reserved[4];
|
||||
UINT64 Address;
|
||||
|
||||
} ACPI_FPDT_S3PT_PTR;
|
||||
|
||||
|
||||
/*
|
||||
* S3PT - S3 Performance Table. This table is pointed to by the
|
||||
* FPDT S3 Pointer Record above.
|
||||
*/
|
||||
typedef struct acpi_table_s3pt
|
||||
{
|
||||
UINT8 Signature[4]; /* "S3PT" */
|
||||
UINT32 Length;
|
||||
|
||||
} ACPI_TABLE_S3PT;
|
||||
|
||||
|
||||
/*
|
||||
* S3PT Subtables
|
||||
*/
|
||||
typedef struct acpi_s3pt_header
|
||||
{
|
||||
UINT16 Type;
|
||||
UINT8 Length;
|
||||
UINT8 Revision;
|
||||
|
||||
} ACPI_S3PT_HEADER;
|
||||
|
||||
/* Values for Type field above */
|
||||
|
||||
enum AcpiS3ptType
|
||||
{
|
||||
ACPI_S3PT_TYPE_RESUME = 0,
|
||||
ACPI_S3PT_TYPE_SUSPEND = 1
|
||||
};
|
||||
|
||||
typedef struct acpi_s3pt_resume
|
||||
{
|
||||
ACPI_S3PT_HEADER Header;
|
||||
UINT32 ResumeCount;
|
||||
UINT64 FullResume;
|
||||
UINT64 AverageResume;
|
||||
|
||||
} ACPI_S3PT_RESUME;
|
||||
|
||||
typedef struct acpi_s3pt_suspend
|
||||
{
|
||||
ACPI_S3PT_HEADER Header;
|
||||
UINT64 SuspendStart;
|
||||
UINT64 SuspendEnd;
|
||||
|
||||
} ACPI_S3PT_SUSPEND;
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* GTDT - Generic Timer Description Table (ACPI 5.1)
|
||||
* Version 2
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
typedef struct acpi_table_gtdt
|
||||
{
|
||||
ACPI_TABLE_HEADER Header; /* Common ACPI table header */
|
||||
UINT64 CounterBlockAddresss;
|
||||
UINT32 Reserved;
|
||||
UINT32 SecureEl1Interrupt;
|
||||
UINT32 SecureEl1Flags;
|
||||
UINT32 NonSecureEl1Interrupt;
|
||||
UINT32 NonSecureEl1Flags;
|
||||
UINT32 VirtualTimerInterrupt;
|
||||
UINT32 VirtualTimerFlags;
|
||||
UINT32 NonSecureEl2Interrupt;
|
||||
UINT32 NonSecureEl2Flags;
|
||||
UINT64 CounterReadBlockAddress;
|
||||
UINT32 PlatformTimerCount;
|
||||
UINT32 PlatformTimerOffset;
|
||||
|
||||
} ACPI_TABLE_GTDT;
|
||||
|
||||
/* Flag Definitions: Timer Block Physical Timers and Virtual timers */
|
||||
|
||||
#define ACPI_GTDT_INTERRUPT_MODE (1)
|
||||
#define ACPI_GTDT_INTERRUPT_POLARITY (1<<1)
|
||||
#define ACPI_GTDT_ALWAYS_ON (1<<2)
|
||||
|
||||
|
||||
/* Common GTDT subtable header */
|
||||
|
||||
typedef struct acpi_gtdt_header
|
||||
{
|
||||
UINT8 Type;
|
||||
UINT16 Length;
|
||||
|
||||
} ACPI_GTDT_HEADER;
|
||||
|
||||
/* Values for GTDT subtable type above */
|
||||
|
||||
enum AcpiGtdtType
|
||||
{
|
||||
ACPI_GTDT_TYPE_TIMER_BLOCK = 0,
|
||||
ACPI_GTDT_TYPE_WATCHDOG = 1,
|
||||
ACPI_GTDT_TYPE_RESERVED = 2 /* 2 and greater are reserved */
|
||||
};
|
||||
|
||||
|
||||
/* GTDT Subtables, correspond to Type in acpi_gtdt_header */
|
||||
|
||||
/* 0: Generic Timer Block */
|
||||
|
||||
typedef struct acpi_gtdt_timer_block
|
||||
{
|
||||
ACPI_GTDT_HEADER Header;
|
||||
UINT8 Reserved;
|
||||
UINT64 BlockAddress;
|
||||
UINT32 TimerCount;
|
||||
UINT32 TimerOffset;
|
||||
|
||||
} ACPI_GTDT_TIMER_BLOCK;
|
||||
|
||||
/* Timer Sub-Structure, one per timer */
|
||||
|
||||
typedef struct acpi_gtdt_timer_entry
|
||||
{
|
||||
UINT8 FrameNumber;
|
||||
UINT8 Reserved[3];
|
||||
UINT64 BaseAddress;
|
||||
UINT64 El0BaseAddress;
|
||||
UINT32 TimerInterrupt;
|
||||
UINT32 TimerFlags;
|
||||
UINT32 VirtualTimerInterrupt;
|
||||
UINT32 VirtualTimerFlags;
|
||||
UINT32 CommonFlags;
|
||||
|
||||
} ACPI_GTDT_TIMER_ENTRY;
|
||||
|
||||
/* Flag Definitions: TimerFlags and VirtualTimerFlags above */
|
||||
|
||||
#define ACPI_GTDT_GT_IRQ_MODE (1)
|
||||
#define ACPI_GTDT_GT_IRQ_POLARITY (1<<1)
|
||||
|
||||
/* Flag Definitions: CommonFlags above */
|
||||
|
||||
#define ACPI_GTDT_GT_IS_SECURE_TIMER (1)
|
||||
#define ACPI_GTDT_GT_ALWAYS_ON (1<<1)
|
||||
|
||||
|
||||
/* 1: SBSA Generic Watchdog Structure */
|
||||
|
||||
typedef struct acpi_gtdt_watchdog
|
||||
{
|
||||
ACPI_GTDT_HEADER Header;
|
||||
UINT8 Reserved;
|
||||
UINT64 RefreshFrameAddress;
|
||||
UINT64 ControlFrameAddress;
|
||||
UINT32 TimerInterrupt;
|
||||
UINT32 TimerFlags;
|
||||
|
||||
} ACPI_GTDT_WATCHDOG;
|
||||
|
||||
/* Flag Definitions: TimerFlags above */
|
||||
|
||||
#define ACPI_GTDT_WATCHDOG_IRQ_MODE (1)
|
||||
#define ACPI_GTDT_WATCHDOG_IRQ_POLARITY (1<<1)
|
||||
#define ACPI_GTDT_WATCHDOG_SECURE (1<<2)
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* MPST - Memory Power State Table (ACPI 5.0)
|
||||
* Version 1
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
#define ACPI_MPST_CHANNEL_INFO \
|
||||
UINT8 ChannelId; \
|
||||
UINT8 Reserved1[3]; \
|
||||
UINT16 PowerNodeCount; \
|
||||
UINT16 Reserved2;
|
||||
|
||||
/* Main table */
|
||||
|
||||
typedef struct acpi_table_mpst
|
||||
{
|
||||
ACPI_TABLE_HEADER Header; /* Common ACPI table header */
|
||||
ACPI_MPST_CHANNEL_INFO /* Platform Communication Channel */
|
||||
|
||||
} ACPI_TABLE_MPST;
|
||||
|
||||
|
||||
/* Memory Platform Communication Channel Info */
|
||||
|
||||
typedef struct acpi_mpst_channel
|
||||
{
|
||||
ACPI_MPST_CHANNEL_INFO /* Platform Communication Channel */
|
||||
|
||||
} ACPI_MPST_CHANNEL;
|
||||
|
||||
|
||||
/* Memory Power Node Structure */
|
||||
|
||||
typedef struct acpi_mpst_power_node
|
||||
{
|
||||
UINT8 Flags;
|
||||
UINT8 Reserved1;
|
||||
UINT16 NodeId;
|
||||
UINT32 Length;
|
||||
UINT64 RangeAddress;
|
||||
UINT64 RangeLength;
|
||||
UINT32 NumPowerStates;
|
||||
UINT32 NumPhysicalComponents;
|
||||
|
||||
} ACPI_MPST_POWER_NODE;
|
||||
|
||||
/* Values for Flags field above */
|
||||
|
||||
#define ACPI_MPST_ENABLED 1
|
||||
#define ACPI_MPST_POWER_MANAGED 2
|
||||
#define ACPI_MPST_HOT_PLUG_CAPABLE 4
|
||||
|
||||
|
||||
/* Memory Power State Structure (follows POWER_NODE above) */
|
||||
|
||||
typedef struct acpi_mpst_power_state
|
||||
{
|
||||
UINT8 PowerState;
|
||||
UINT8 InfoIndex;
|
||||
|
||||
} ACPI_MPST_POWER_STATE;
|
||||
|
||||
|
||||
/* Physical Component ID Structure (follows POWER_STATE above) */
|
||||
|
||||
typedef struct acpi_mpst_component
|
||||
{
|
||||
UINT16 ComponentId;
|
||||
|
||||
} ACPI_MPST_COMPONENT;
|
||||
|
||||
|
||||
/* Memory Power State Characteristics Structure (follows all POWER_NODEs) */
|
||||
|
||||
typedef struct acpi_mpst_data_hdr
|
||||
{
|
||||
UINT16 CharacteristicsCount;
|
||||
UINT16 Reserved;
|
||||
|
||||
} ACPI_MPST_DATA_HDR;
|
||||
|
||||
typedef struct acpi_mpst_power_data
|
||||
{
|
||||
UINT8 StructureId;
|
||||
UINT8 Flags;
|
||||
UINT16 Reserved1;
|
||||
UINT32 AveragePower;
|
||||
UINT32 PowerSaving;
|
||||
UINT64 ExitLatency;
|
||||
UINT64 Reserved2;
|
||||
|
||||
} ACPI_MPST_POWER_DATA;
|
||||
|
||||
/* Values for Flags field above */
|
||||
|
||||
#define ACPI_MPST_PRESERVE 1
|
||||
#define ACPI_MPST_AUTOENTRY 2
|
||||
#define ACPI_MPST_AUTOEXIT 4
|
||||
|
||||
|
||||
/* Shared Memory Region (not part of an ACPI table) */
|
||||
|
||||
typedef struct acpi_mpst_shared
|
||||
{
|
||||
UINT32 Signature;
|
||||
UINT16 PccCommand;
|
||||
UINT16 PccStatus;
|
||||
UINT32 CommandRegister;
|
||||
UINT32 StatusRegister;
|
||||
UINT32 PowerStateId;
|
||||
UINT32 PowerNodeId;
|
||||
UINT64 EnergyConsumed;
|
||||
UINT64 AveragePower;
|
||||
|
||||
} ACPI_MPST_SHARED;
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* PCCT - Platform Communications Channel Table (ACPI 5.0)
|
||||
* Version 1
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
typedef struct acpi_table_pcct
|
||||
{
|
||||
ACPI_TABLE_HEADER Header; /* Common ACPI table header */
|
||||
UINT32 Flags;
|
||||
UINT64 Reserved;
|
||||
|
||||
} ACPI_TABLE_PCCT;
|
||||
|
||||
/* Values for Flags field above */
|
||||
|
||||
#define ACPI_PCCT_DOORBELL 1
|
||||
|
||||
/* Values for subtable type in ACPI_SUBTABLE_HEADER */
|
||||
|
||||
enum AcpiPcctType
|
||||
{
|
||||
ACPI_PCCT_TYPE_GENERIC_SUBSPACE = 0,
|
||||
ACPI_PCCT_TYPE_HW_REDUCED_SUBSPACE = 1,
|
||||
ACPI_PCCT_TYPE_RESERVED = 2 /* 2 and greater are reserved */
|
||||
};
|
||||
|
||||
/*
|
||||
* PCCT Subtables, correspond to Type in ACPI_SUBTABLE_HEADER
|
||||
*/
|
||||
|
||||
/* 0: Generic Communications Subspace */
|
||||
|
||||
typedef struct acpi_pcct_subspace
|
||||
{
|
||||
ACPI_SUBTABLE_HEADER Header;
|
||||
UINT8 Reserved[6];
|
||||
UINT64 BaseAddress;
|
||||
UINT64 Length;
|
||||
ACPI_GENERIC_ADDRESS DoorbellRegister;
|
||||
UINT64 PreserveMask;
|
||||
UINT64 WriteMask;
|
||||
UINT32 Latency;
|
||||
UINT32 MaxAccessRate;
|
||||
UINT16 MinTurnaroundTime;
|
||||
|
||||
} ACPI_PCCT_SUBSPACE;
|
||||
|
||||
|
||||
/* 1: HW-reduced Communications Subspace (ACPI 5.1) */
|
||||
|
||||
typedef struct acpi_pcct_hw_reduced
|
||||
{
|
||||
ACPI_SUBTABLE_HEADER Header;
|
||||
UINT32 DoorbellInterrupt;
|
||||
UINT8 Flags;
|
||||
UINT8 Reserved;
|
||||
UINT64 BaseAddress;
|
||||
UINT64 Length;
|
||||
ACPI_GENERIC_ADDRESS DoorbellRegister;
|
||||
UINT64 PreserveMask;
|
||||
UINT64 WriteMask;
|
||||
UINT32 Latency;
|
||||
UINT32 MaxAccessRate;
|
||||
UINT16 MinTurnaroundTime;
|
||||
|
||||
} ACPI_PCCT_HW_REDUCED;
|
||||
|
||||
/* Values for doorbell flags above */
|
||||
|
||||
#define ACPI_PCCT_INTERRUPT_POLARITY (1)
|
||||
#define ACPI_PCCT_INTERRUPT_MODE (1<<1)
|
||||
|
||||
|
||||
/*
|
||||
* PCC memory structures (not part of the ACPI table)
|
||||
*/
|
||||
|
||||
/* Shared Memory Region */
|
||||
|
||||
typedef struct acpi_pcct_shared_memory
|
||||
{
|
||||
UINT32 Signature;
|
||||
UINT16 Command;
|
||||
UINT16 Status;
|
||||
|
||||
} ACPI_PCCT_SHARED_MEMORY;
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* PMTT - Platform Memory Topology Table (ACPI 5.0)
|
||||
* Version 1
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
typedef struct acpi_table_pmtt
|
||||
{
|
||||
ACPI_TABLE_HEADER Header; /* Common ACPI table header */
|
||||
UINT32 Reserved;
|
||||
|
||||
} ACPI_TABLE_PMTT;
|
||||
|
||||
|
||||
/* Common header for PMTT subtables that follow main table */
|
||||
|
||||
typedef struct acpi_pmtt_header
|
||||
{
|
||||
UINT8 Type;
|
||||
UINT8 Reserved1;
|
||||
UINT16 Length;
|
||||
UINT16 Flags;
|
||||
UINT16 Reserved2;
|
||||
|
||||
} ACPI_PMTT_HEADER;
|
||||
|
||||
/* Values for Type field above */
|
||||
|
||||
#define ACPI_PMTT_TYPE_SOCKET 0
|
||||
#define ACPI_PMTT_TYPE_CONTROLLER 1
|
||||
#define ACPI_PMTT_TYPE_DIMM 2
|
||||
#define ACPI_PMTT_TYPE_RESERVED 3 /* 0x03-0xFF are reserved */
|
||||
|
||||
/* Values for Flags field above */
|
||||
|
||||
#define ACPI_PMTT_TOP_LEVEL 0x0001
|
||||
#define ACPI_PMTT_PHYSICAL 0x0002
|
||||
#define ACPI_PMTT_MEMORY_TYPE 0x000C
|
||||
|
||||
|
||||
/*
|
||||
* PMTT subtables, correspond to Type in acpi_pmtt_header
|
||||
*/
|
||||
|
||||
|
||||
/* 0: Socket Structure */
|
||||
|
||||
typedef struct acpi_pmtt_socket
|
||||
{
|
||||
ACPI_PMTT_HEADER Header;
|
||||
UINT16 SocketId;
|
||||
UINT16 Reserved;
|
||||
|
||||
} ACPI_PMTT_SOCKET;
|
||||
|
||||
|
||||
/* 1: Memory Controller subtable */
|
||||
|
||||
typedef struct acpi_pmtt_controller
|
||||
{
|
||||
ACPI_PMTT_HEADER Header;
|
||||
UINT32 ReadLatency;
|
||||
UINT32 WriteLatency;
|
||||
UINT32 ReadBandwidth;
|
||||
UINT32 WriteBandwidth;
|
||||
UINT16 AccessWidth;
|
||||
UINT16 Alignment;
|
||||
UINT16 Reserved;
|
||||
UINT16 DomainCount;
|
||||
|
||||
} ACPI_PMTT_CONTROLLER;
|
||||
|
||||
/* 1a: Proximity Domain substructure */
|
||||
|
||||
typedef struct acpi_pmtt_domain
|
||||
{
|
||||
UINT32 ProximityDomain;
|
||||
|
||||
} ACPI_PMTT_DOMAIN;
|
||||
|
||||
|
||||
/* 2: Physical Component Identifier (DIMM) */
|
||||
|
||||
typedef struct acpi_pmtt_physical_component
|
||||
{
|
||||
ACPI_PMTT_HEADER Header;
|
||||
UINT16 ComponentId;
|
||||
UINT16 Reserved;
|
||||
UINT32 MemorySize;
|
||||
UINT32 BiosHandle;
|
||||
|
||||
} ACPI_PMTT_PHYSICAL_COMPONENT;
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* RASF - RAS Feature Table (ACPI 5.0)
|
||||
* Version 1
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
typedef struct acpi_table_rasf
|
||||
{
|
||||
ACPI_TABLE_HEADER Header; /* Common ACPI table header */
|
||||
UINT8 ChannelId[12];
|
||||
|
||||
} ACPI_TABLE_RASF;
|
||||
|
||||
/* RASF Platform Communication Channel Shared Memory Region */
|
||||
|
||||
typedef struct acpi_rasf_shared_memory
|
||||
{
|
||||
UINT32 Signature;
|
||||
UINT16 Command;
|
||||
UINT16 Status;
|
||||
UINT16 Version;
|
||||
UINT8 Capabilities[16];
|
||||
UINT8 SetCapabilities[16];
|
||||
UINT16 NumParameterBlocks;
|
||||
UINT32 SetCapabilitiesStatus;
|
||||
|
||||
} ACPI_RASF_SHARED_MEMORY;
|
||||
|
||||
/* RASF Parameter Block Structure Header */
|
||||
|
||||
typedef struct acpi_rasf_parameter_block
|
||||
{
|
||||
UINT16 Type;
|
||||
UINT16 Version;
|
||||
UINT16 Length;
|
||||
|
||||
} ACPI_RASF_PARAMETER_BLOCK;
|
||||
|
||||
/* RASF Parameter Block Structure for PATROL_SCRUB */
|
||||
|
||||
typedef struct acpi_rasf_patrol_scrub_parameter
|
||||
{
|
||||
ACPI_RASF_PARAMETER_BLOCK Header;
|
||||
UINT16 PatrolScrubCommand;
|
||||
UINT64 RequestedAddressRange[2];
|
||||
UINT64 ActualAddressRange[2];
|
||||
UINT16 Flags;
|
||||
UINT8 RequestedSpeed;
|
||||
|
||||
} ACPI_RASF_PATROL_SCRUB_PARAMETER;
|
||||
|
||||
/* Masks for Flags and Speed fields above */
|
||||
|
||||
#define ACPI_RASF_SCRUBBER_RUNNING 1
|
||||
#define ACPI_RASF_SPEED (7<<1)
|
||||
#define ACPI_RASF_SPEED_SLOW (0<<1)
|
||||
#define ACPI_RASF_SPEED_MEDIUM (4<<1)
|
||||
#define ACPI_RASF_SPEED_FAST (7<<1)
|
||||
|
||||
/* Channel Commands */
|
||||
|
||||
enum AcpiRasfCommands
|
||||
{
|
||||
ACPI_RASF_EXECUTE_RASF_COMMAND = 1
|
||||
};
|
||||
|
||||
/* Platform RAS Capabilities */
|
||||
|
||||
enum AcpiRasfCapabiliities
|
||||
{
|
||||
ACPI_HW_PATROL_SCRUB_SUPPORTED = 0,
|
||||
ACPI_SW_PATROL_SCRUB_EXPOSED = 1
|
||||
};
|
||||
|
||||
/* Patrol Scrub Commands */
|
||||
|
||||
enum AcpiRasfPatrolScrubCommands
|
||||
{
|
||||
ACPI_RASF_GET_PATROL_PARAMETERS = 1,
|
||||
ACPI_RASF_START_PATROL_SCRUBBER = 2,
|
||||
ACPI_RASF_STOP_PATROL_SCRUBBER = 3
|
||||
};
|
||||
|
||||
/* Channel Command flags */
|
||||
|
||||
#define ACPI_RASF_GENERATE_SCI (1<<15)
|
||||
|
||||
/* Status values */
|
||||
|
||||
enum AcpiRasfStatus
|
||||
{
|
||||
ACPI_RASF_SUCCESS = 0,
|
||||
ACPI_RASF_NOT_VALID = 1,
|
||||
ACPI_RASF_NOT_SUPPORTED = 2,
|
||||
ACPI_RASF_BUSY = 3,
|
||||
ACPI_RASF_FAILED = 4,
|
||||
ACPI_RASF_ABORTED = 5,
|
||||
ACPI_RASF_INVALID_DATA = 6
|
||||
};
|
||||
|
||||
/* Status flags */
|
||||
|
||||
#define ACPI_RASF_COMMAND_COMPLETE (1)
|
||||
#define ACPI_RASF_SCI_DOORBELL (1<<1)
|
||||
#define ACPI_RASF_ERROR (1<<2)
|
||||
#define ACPI_RASF_STATUS (0x1F<<3)
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* TPM2 - Trusted Platform Module (TPM) 2.0 Hardware Interface Table
|
||||
* Version 3
|
||||
*
|
||||
* Conforms to "TPM 2.0 Hardware Interface Table (TPM2)" 29 November 2011
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
typedef struct acpi_table_tpm2
|
||||
{
|
||||
ACPI_TABLE_HEADER Header; /* Common ACPI table header */
|
||||
UINT32 Flags;
|
||||
UINT64 ControlAddress;
|
||||
UINT32 StartMethod;
|
||||
|
||||
} ACPI_TABLE_TPM2;
|
||||
|
||||
/* Control area structure (not part of table, pointed to by ControlAddress) */
|
||||
|
||||
typedef struct acpi_tpm2_control
|
||||
{
|
||||
UINT32 Reserved;
|
||||
UINT32 Error;
|
||||
UINT32 Cancel;
|
||||
UINT32 Start;
|
||||
UINT64 InterruptControl;
|
||||
UINT32 CommandSize;
|
||||
UINT64 CommandAddress;
|
||||
UINT32 ResponseSize;
|
||||
UINT64 ResponseAddress;
|
||||
|
||||
} ACPI_TPM2_CONTROL;
|
||||
|
||||
|
||||
/* Reset to default packing */
|
||||
|
||||
#pragma pack()
|
||||
|
||||
#endif /* __ACTBL3_H__ */
|
||||
@@ -4,114 +4,42 @@
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
* 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.
|
||||
*
|
||||
* 2.1. This is your license from Intel Corp. under its intellectual property
|
||||
* rights. You may have additional license terms from the party that provided
|
||||
* you this software, covering your right to use that party's intellectual
|
||||
* property rights.
|
||||
* 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.
|
||||
*
|
||||
* 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
|
||||
* copy of the source code appearing in this file ("Covered Code") an
|
||||
* irrevocable, perpetual, worldwide license under Intel's copyrights in the
|
||||
* base code distributed originally by Intel ("Original Intel Code") to copy,
|
||||
* make derivatives, distribute, use and display any portion of the Covered
|
||||
* Code in any form, with the right to sublicense such rights; and
|
||||
*
|
||||
* 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
|
||||
* license (with the right to sublicense), under only those claims of Intel
|
||||
* patents that are infringed by the Original Intel Code, to make, use, sell,
|
||||
* offer to sell, and import the Covered Code and derivative works thereof
|
||||
* solely to the minimum extent necessary to exercise the above copyright
|
||||
* license, and in no event shall the patent license extend to any additions
|
||||
* to or modifications of the Original Intel Code. No other license or right
|
||||
* is granted directly or by implication, estoppel or otherwise;
|
||||
*
|
||||
* The above copyright and patent license is granted only if the following
|
||||
* conditions are met:
|
||||
*
|
||||
* 3. Conditions
|
||||
*
|
||||
* 3.1. Redistribution of Source with Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification with rights to further distribute source must include
|
||||
* the above Copyright Notice, the above License, this list of Conditions,
|
||||
* and the following Disclaimer and Export Compliance provision. In addition,
|
||||
* Licensee must cause all Covered Code to which Licensee contributes to
|
||||
* contain a file documenting the changes Licensee made to create that Covered
|
||||
* Code and the date of any change. Licensee must include in that file the
|
||||
* documentation of any changes made by any predecessor Licensee. Licensee
|
||||
* must include a prominent statement that the modification is derived,
|
||||
* directly or indirectly, from Original Intel Code.
|
||||
*
|
||||
* 3.2. Redistribution of Source with no Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification without rights to further distribute source must
|
||||
* include the following Disclaimer and Export Compliance provision in the
|
||||
* documentation and/or other materials provided with distribution. In
|
||||
* addition, Licensee may not authorize further sublicense of source of any
|
||||
* portion of the Covered Code, and must include terms to the effect that the
|
||||
* license from Licensee to its licensee is limited to the intellectual
|
||||
* property embodied in the software Licensee provides to its licensee, and
|
||||
* not to intellectual property embodied in modifications its licensee may
|
||||
* make.
|
||||
*
|
||||
* 3.3. Redistribution of Executable. Redistribution in executable form of any
|
||||
* substantial portion of the Covered Code or modification must reproduce the
|
||||
* above Copyright Notice, and the following Disclaimer and Export Compliance
|
||||
* provision in the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3.4. Intel retains all right, title, and interest in and to the Original
|
||||
* Intel Code.
|
||||
*
|
||||
* 3.5. Neither the name Intel nor any other trademark owned or controlled by
|
||||
* Intel shall be used in advertising or otherwise to promote the sale, use or
|
||||
* other dealings in products derived from or relating to the Covered Code
|
||||
* without prior written authorization from Intel.
|
||||
*
|
||||
* 4. Disclaimer and Export Compliance
|
||||
*
|
||||
* 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
|
||||
* HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
|
||||
* IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
|
||||
* INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
|
||||
* UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
|
||||
* PARTICULAR PURPOSE.
|
||||
*
|
||||
* 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
|
||||
* OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
|
||||
* COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
|
||||
* SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
|
||||
* CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
|
||||
* HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
|
||||
* SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
|
||||
* LIMITED REMEDY.
|
||||
*
|
||||
* 4.3. Licensee shall not export, either directly or indirectly, any of this
|
||||
* software or system incorporating such software without first obtaining any
|
||||
* required license or other approval from the U. S. Department of Commerce or
|
||||
* any other agency or department of the United States Government. In the
|
||||
* event Licensee exports any such software from the United States or
|
||||
* re-exports any such software from a foreign destination, Licensee shall
|
||||
* ensure that the distribution and export/re-export of the software is in
|
||||
* compliance with all laws, regulations, orders, or other restrictions of the
|
||||
* U.S. Export Administration Regulations. Licensee agrees that neither it nor
|
||||
* any of its subsidiaries will export/re-export any technical data, process,
|
||||
* software, or service, directly or indirectly, to any country for which the
|
||||
* United States government or any agency thereof requires an export license,
|
||||
* other governmental approval, or letter of assurance, without first obtaining
|
||||
* such license, approval or letter.
|
||||
*
|
||||
*****************************************************************************/
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef __ACTYPES_H__
|
||||
#define __ACTYPES_H__
|
||||
@@ -127,8 +55,6 @@
|
||||
#error ACPI_MACHINE_WIDTH not defined
|
||||
#endif
|
||||
|
||||
/*! [Begin] no source code translation */
|
||||
|
||||
/*
|
||||
* Data type ranges
|
||||
* Note: These macros are designed to be compiler independent as well as
|
||||
@@ -188,7 +114,6 @@
|
||||
*
|
||||
* ACPI_SIZE 16/32/64-bit unsigned value
|
||||
* ACPI_NATIVE_INT 16/32/64-bit signed value
|
||||
*
|
||||
*/
|
||||
|
||||
/*******************************************************************************
|
||||
@@ -197,13 +122,26 @@
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
#ifndef ACPI_USE_SYSTEM_INTTYPES
|
||||
|
||||
typedef unsigned char BOOLEAN;
|
||||
typedef unsigned char UINT8;
|
||||
typedef unsigned short UINT16;
|
||||
typedef short INT16;
|
||||
typedef COMPILER_DEPENDENT_UINT64 UINT64;
|
||||
typedef COMPILER_DEPENDENT_INT64 INT64;
|
||||
|
||||
/*! [End] no source code translation !*/
|
||||
#endif /* ACPI_USE_SYSTEM_INTTYPES */
|
||||
|
||||
/*
|
||||
* Value returned by AcpiOsGetThreadId. There is no standard "thread_id"
|
||||
* across operating systems or even the various UNIX systems. Since ACPICA
|
||||
* only needs the thread ID as a unique thread identifier, we use a UINT64
|
||||
* as the only common data type - it will accommodate any type of pointer or
|
||||
* any type of integer. It is up to the host-dependent OSL to cast the
|
||||
* native thread ID type to a UINT64 (in AcpiOsGetThreadId).
|
||||
*/
|
||||
#define ACPI_THREAD_ID UINT64
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
@@ -214,12 +152,12 @@ typedef COMPILER_DEPENDENT_INT64 INT64;
|
||||
|
||||
#if ACPI_MACHINE_WIDTH == 64
|
||||
|
||||
/*! [Begin] no source code translation (keep the typedefs as-is) */
|
||||
#ifndef ACPI_USE_SYSTEM_INTTYPES
|
||||
|
||||
typedef unsigned int UINT32;
|
||||
typedef int INT32;
|
||||
|
||||
/*! [End] no source code translation !*/
|
||||
#endif /* ACPI_USE_SYSTEM_INTTYPES */
|
||||
|
||||
|
||||
typedef INT64 ACPI_NATIVE_INT;
|
||||
@@ -253,12 +191,12 @@ typedef UINT64 ACPI_PHYSICAL_ADDRESS;
|
||||
|
||||
#elif ACPI_MACHINE_WIDTH == 32
|
||||
|
||||
/*! [Begin] no source code translation (keep the typedefs as-is) */
|
||||
#ifndef ACPI_USE_SYSTEM_INTTYPES
|
||||
|
||||
typedef unsigned int UINT32;
|
||||
typedef int INT32;
|
||||
|
||||
/*! [End] no source code translation !*/
|
||||
#endif /* ACPI_USE_SYSTEM_INTTYPES */
|
||||
|
||||
|
||||
typedef INT32 ACPI_NATIVE_INT;
|
||||
@@ -286,12 +224,6 @@ typedef UINT32 ACPI_PHYSICAL_ADDRESS;
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
/* Value returned by AcpiOsGetThreadId */
|
||||
|
||||
#ifndef ACPI_THREAD_ID
|
||||
#define ACPI_THREAD_ID ACPI_SIZE
|
||||
#endif
|
||||
|
||||
/* Flags for AcpiOsAcquireLock/AcpiOsReleaseLock */
|
||||
|
||||
#ifndef ACPI_CPU_FLAGS
|
||||
@@ -364,7 +296,7 @@ typedef UINT32 ACPI_PHYSICAL_ADDRESS;
|
||||
/*
|
||||
* Some compilers complain about unused variables. Sometimes we don't want to
|
||||
* use all the variables (for example, _AcpiModuleName). This allows us
|
||||
* to to tell the compiler in a per-variable manner that a variable
|
||||
* to tell the compiler in a per-variable manner that a variable
|
||||
* is unused
|
||||
*/
|
||||
#ifndef ACPI_UNUSED_VAR
|
||||
@@ -372,13 +304,69 @@ typedef UINT32 ACPI_PHYSICAL_ADDRESS;
|
||||
#endif
|
||||
|
||||
/*
|
||||
* All ACPICA functions that are available to the rest of the kernel are
|
||||
* tagged with this macro which can be defined as appropriate for the host.
|
||||
* All ACPICA external functions that are available to the rest of the kernel
|
||||
* are tagged with thes macros which can be defined as appropriate for the host.
|
||||
*
|
||||
* Notes:
|
||||
* ACPI_EXPORT_SYMBOL_INIT is used for initialization and termination
|
||||
* interfaces that may need special processing.
|
||||
* ACPI_EXPORT_SYMBOL is used for all other public external functions.
|
||||
*/
|
||||
#ifndef ACPI_EXPORT_SYMBOL_INIT
|
||||
#define ACPI_EXPORT_SYMBOL_INIT(Symbol)
|
||||
#endif
|
||||
|
||||
#ifndef ACPI_EXPORT_SYMBOL
|
||||
#define ACPI_EXPORT_SYMBOL(Symbol)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Compiler/Clibrary-dependent debug initialization. Used for ACPICA
|
||||
* utilities only.
|
||||
*/
|
||||
#ifndef ACPI_DEBUG_INITIALIZE
|
||||
#define ACPI_DEBUG_INITIALIZE()
|
||||
#endif
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* Configuration
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
#ifdef ACPI_NO_MEM_ALLOCATIONS
|
||||
|
||||
#define ACPI_ALLOCATE(a) NULL
|
||||
#define ACPI_ALLOCATE_ZEROED(a) NULL
|
||||
#define ACPI_FREE(a)
|
||||
#define ACPI_MEM_TRACKING(a)
|
||||
|
||||
#else /* ACPI_NO_MEM_ALLOCATIONS */
|
||||
|
||||
#ifdef ACPI_DBG_TRACK_ALLOCATIONS
|
||||
/*
|
||||
* Memory allocation tracking (used by AcpiExec to detect memory leaks)
|
||||
*/
|
||||
#define ACPI_MEM_PARAMETERS _COMPONENT, _AcpiModuleName, __LINE__
|
||||
#define ACPI_ALLOCATE(a) AcpiUtAllocateAndTrack ((ACPI_SIZE) (a), ACPI_MEM_PARAMETERS)
|
||||
#define ACPI_ALLOCATE_ZEROED(a) AcpiUtAllocateZeroedAndTrack ((ACPI_SIZE) (a), ACPI_MEM_PARAMETERS)
|
||||
#define ACPI_FREE(a) AcpiUtFreeAndTrack (a, ACPI_MEM_PARAMETERS)
|
||||
#define ACPI_MEM_TRACKING(a) a
|
||||
|
||||
#else
|
||||
/*
|
||||
* Normal memory allocation directly via the OS services layer
|
||||
*/
|
||||
#define ACPI_ALLOCATE(a) AcpiOsAllocate ((ACPI_SIZE) (a))
|
||||
#define ACPI_ALLOCATE_ZEROED(a) AcpiOsAllocateZeroed ((ACPI_SIZE) (a))
|
||||
#define ACPI_FREE(a) AcpiOsFree (a)
|
||||
#define ACPI_MEM_TRACKING(a)
|
||||
|
||||
#endif /* ACPI_DBG_TRACK_ALLOCATIONS */
|
||||
|
||||
#endif /* ACPI_NO_MEM_ALLOCATIONS */
|
||||
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
@@ -396,6 +384,7 @@ typedef UINT32 ACPI_PHYSICAL_ADDRESS;
|
||||
#define ACPI_PM1_REGISTER_WIDTH 16
|
||||
#define ACPI_PM2_REGISTER_WIDTH 8
|
||||
#define ACPI_PM_TIMER_WIDTH 32
|
||||
#define ACPI_RESET_REGISTER_WIDTH 8
|
||||
|
||||
/* Names within the namespace are 4 bytes long */
|
||||
|
||||
@@ -415,7 +404,7 @@ typedef UINT32 ACPI_PHYSICAL_ADDRESS;
|
||||
|
||||
/* PM Timer ticks per second (HZ) */
|
||||
|
||||
#define PM_TIMER_FREQUENCY 3579545
|
||||
#define ACPI_PM_TIMER_FREQUENCY 3579545
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
@@ -450,27 +439,28 @@ typedef char * ACPI_STRING; /* Null terminated ASCII
|
||||
typedef void * ACPI_HANDLE; /* Actually a ptr to a NS Node */
|
||||
|
||||
|
||||
/* Time constants for timer calculations */
|
||||
|
||||
#define ACPI_MSEC_PER_SEC 1000L
|
||||
|
||||
#define ACPI_USEC_PER_MSEC 1000L
|
||||
#define ACPI_USEC_PER_SEC 1000000L
|
||||
|
||||
#define ACPI_100NSEC_PER_USEC 10L
|
||||
#define ACPI_100NSEC_PER_MSEC 10000L
|
||||
#define ACPI_100NSEC_PER_SEC 10000000L
|
||||
|
||||
#define ACPI_NSEC_PER_USEC 1000L
|
||||
#define ACPI_NSEC_PER_MSEC 1000000L
|
||||
#define ACPI_NSEC_PER_SEC 1000000000L
|
||||
|
||||
|
||||
/* Owner IDs are used to track namespace nodes for selective deletion */
|
||||
|
||||
typedef UINT8 ACPI_OWNER_ID;
|
||||
#define ACPI_OWNER_ID_MAX 0xFF
|
||||
|
||||
|
||||
typedef struct uint64_struct
|
||||
{
|
||||
UINT32 Lo;
|
||||
UINT32 Hi;
|
||||
|
||||
} UINT64_STRUCT;
|
||||
|
||||
typedef union uint64_overlay
|
||||
{
|
||||
UINT64 Full;
|
||||
UINT64_STRUCT Part;
|
||||
|
||||
} UINT64_OVERLAY;
|
||||
|
||||
|
||||
#define ACPI_INTEGER_BIT_SIZE 64
|
||||
#define ACPI_MAX_DECIMAL_DIGITS 20 /* 2^64 = 18,446,744,073,709,551,616 */
|
||||
#define ACPI_MAX64_DECIMAL_DIGITS 20
|
||||
@@ -534,16 +524,25 @@ typedef UINT64 ACPI_INTEGER;
|
||||
|
||||
#define ACPI_TO_POINTER(i) ACPI_ADD_PTR (void, (void *) NULL,(ACPI_SIZE) i)
|
||||
#define ACPI_TO_INTEGER(p) ACPI_PTR_DIFF (p, (void *) NULL)
|
||||
#define ACPI_OFFSET(d, f) (ACPI_SIZE) ACPI_PTR_DIFF (&(((d *)0)->f), (void *) NULL)
|
||||
#define ACPI_OFFSET(d, f) ACPI_PTR_DIFF (&(((d *) 0)->f), (void *) NULL)
|
||||
#define ACPI_PHYSADDR_TO_PTR(i) ACPI_TO_POINTER(i)
|
||||
#define ACPI_PTR_TO_PHYSADDR(i) ACPI_TO_INTEGER(i)
|
||||
|
||||
/* Optimizations for 4-character (32-bit) ACPI_NAME manipulation */
|
||||
|
||||
#ifndef ACPI_MISALIGNMENT_NOT_SUPPORTED
|
||||
#define ACPI_COMPARE_NAME(a,b) (*ACPI_CAST_PTR (UINT32, (a)) == *ACPI_CAST_PTR (UINT32, (b)))
|
||||
#define ACPI_MOVE_NAME(dest,src) (*ACPI_CAST_PTR (UINT32, (dest)) = *ACPI_CAST_PTR (UINT32, (src)))
|
||||
#else
|
||||
#define ACPI_COMPARE_NAME(a,b) (!ACPI_STRNCMP (ACPI_CAST_PTR (char, (a)), ACPI_CAST_PTR (char, (b)), ACPI_NAME_SIZE))
|
||||
#define ACPI_MOVE_NAME(dest,src) (ACPI_STRNCPY (ACPI_CAST_PTR (char, (dest)), ACPI_CAST_PTR (char, (src)), ACPI_NAME_SIZE))
|
||||
#endif
|
||||
|
||||
/* Support for the special RSDP signature (8 characters) */
|
||||
|
||||
#define ACPI_VALIDATE_RSDP_SIG(a) (!ACPI_STRNCMP (ACPI_CAST_PTR (char, (a)), ACPI_SIG_RSDP, 8))
|
||||
#define ACPI_MAKE_RSDP_SIG(dest) (ACPI_MEMCPY (ACPI_CAST_PTR (char, (dest)), ACPI_SIG_RSDP, 8))
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
@@ -618,8 +617,10 @@ typedef UINT64 ACPI_INTEGER;
|
||||
#define ACPI_NOTIFY_DEVICE_PLD_CHECK (UINT8) 0x09
|
||||
#define ACPI_NOTIFY_RESERVED (UINT8) 0x0A
|
||||
#define ACPI_NOTIFY_LOCALITY_UPDATE (UINT8) 0x0B
|
||||
#define ACPI_NOTIFY_SHUTDOWN_REQUEST (UINT8) 0x0C
|
||||
#define ACPI_NOTIFY_AFFINITY_UPDATE (UINT8) 0x0D
|
||||
|
||||
#define ACPI_NOTIFY_MAX 0x0B
|
||||
#define ACPI_NOTIFY_MAX 0x0D
|
||||
|
||||
/*
|
||||
* Types associated with ACPI names and objects. The first group of
|
||||
@@ -675,7 +676,7 @@ typedef UINT32 ACPI_OBJECT_TYPE;
|
||||
|
||||
/*
|
||||
* These are special object types that never appear in
|
||||
* a Namespace node, only in an ACPI_OPERAND_OBJECT
|
||||
* a Namespace node, only in an object of ACPI_OPERAND_OBJECT
|
||||
*/
|
||||
#define ACPI_TYPE_LOCAL_EXTRA 0x1C
|
||||
#define ACPI_TYPE_LOCAL_DATA 0x1D
|
||||
@@ -719,14 +720,15 @@ typedef UINT32 ACPI_EVENT_TYPE;
|
||||
* The encoding of ACPI_EVENT_STATUS is illustrated below.
|
||||
* Note that a set bit (1) indicates the property is TRUE
|
||||
* (e.g. if bit 0 is set then the event is enabled).
|
||||
* +-------------+-+-+-+
|
||||
* | Bits 31:3 |2|1|0|
|
||||
* +-------------+-+-+-+
|
||||
* | | | |
|
||||
* | | | +- Enabled?
|
||||
* | | +--- Enabled for wake?
|
||||
* | +----- Set?
|
||||
* +----------- <Reserved>
|
||||
* +-------------+-+-+-+-+
|
||||
* | Bits 31:4 |3|2|1|0|
|
||||
* +-------------+-+-+-+-+
|
||||
* | | | | |
|
||||
* | | | | +- Enabled?
|
||||
* | | | +--- Enabled for wake?
|
||||
* | | +----- Set?
|
||||
* | +------- Has a handler?
|
||||
* +------------- <Reserved>
|
||||
*/
|
||||
typedef UINT32 ACPI_EVENT_STATUS;
|
||||
|
||||
@@ -734,13 +736,7 @@ typedef UINT32 ACPI_EVENT_STATUS;
|
||||
#define ACPI_EVENT_FLAG_ENABLED (ACPI_EVENT_STATUS) 0x01
|
||||
#define ACPI_EVENT_FLAG_WAKE_ENABLED (ACPI_EVENT_STATUS) 0x02
|
||||
#define ACPI_EVENT_FLAG_SET (ACPI_EVENT_STATUS) 0x04
|
||||
|
||||
/*
|
||||
* General Purpose Events (GPE)
|
||||
*/
|
||||
#define ACPI_GPE_INVALID 0xFF
|
||||
#define ACPI_GPE_MAX 0xFF
|
||||
#define ACPI_NUM_GPE 256
|
||||
#define ACPI_EVENT_FLAG_HAS_HANDLER (ACPI_EVENT_STATUS) 0x08
|
||||
|
||||
/* Actions for AcpiSetGpe, AcpiGpeWakeup, AcpiHwLowSetGpe */
|
||||
|
||||
@@ -750,25 +746,26 @@ typedef UINT32 ACPI_EVENT_STATUS;
|
||||
|
||||
/*
|
||||
* GPE info flags - Per GPE
|
||||
* +-------+---+-+-+
|
||||
* | 7:4 |3:2|1|0|
|
||||
* +-------+---+-+-+
|
||||
* | | | |
|
||||
* | | | +--- Interrupt type: edge or level triggered
|
||||
* | | +----- GPE can wake the system
|
||||
* | +-------- Type of dispatch:to method, handler, or none
|
||||
* +-------------- <Reserved>
|
||||
* +-------+-+-+---+
|
||||
* | 7:4 |3|2|1:0|
|
||||
* +-------+-+-+---+
|
||||
* | | | |
|
||||
* | | | +-- Type of dispatch:to method, handler, notify, or none
|
||||
* | | +----- Interrupt type: edge or level triggered
|
||||
* | +------- Is a Wake GPE
|
||||
* +------------ <Reserved>
|
||||
*/
|
||||
#define ACPI_GPE_XRUPT_TYPE_MASK (UINT8) 0x01
|
||||
#define ACPI_GPE_LEVEL_TRIGGERED (UINT8) 0x01
|
||||
#define ACPI_GPE_DISPATCH_NONE (UINT8) 0x00
|
||||
#define ACPI_GPE_DISPATCH_METHOD (UINT8) 0x01
|
||||
#define ACPI_GPE_DISPATCH_HANDLER (UINT8) 0x02
|
||||
#define ACPI_GPE_DISPATCH_NOTIFY (UINT8) 0x03
|
||||
#define ACPI_GPE_DISPATCH_MASK (UINT8) 0x03
|
||||
|
||||
#define ACPI_GPE_LEVEL_TRIGGERED (UINT8) 0x04
|
||||
#define ACPI_GPE_EDGE_TRIGGERED (UINT8) 0x00
|
||||
#define ACPI_GPE_XRUPT_TYPE_MASK (UINT8) 0x04
|
||||
|
||||
#define ACPI_GPE_CAN_WAKE (UINT8) 0x02
|
||||
|
||||
#define ACPI_GPE_DISPATCH_MASK (UINT8) 0x0C
|
||||
#define ACPI_GPE_DISPATCH_HANDLER (UINT8) 0x04
|
||||
#define ACPI_GPE_DISPATCH_METHOD (UINT8) 0x08
|
||||
#define ACPI_GPE_DISPATCH_NOT_USED (UINT8) 0x00
|
||||
#define ACPI_GPE_CAN_WAKE (UINT8) 0x08
|
||||
|
||||
/*
|
||||
* Flags for GPE and Lock interfaces
|
||||
@@ -783,8 +780,13 @@ typedef UINT32 ACPI_EVENT_STATUS;
|
||||
#define ACPI_DEVICE_NOTIFY 0x2
|
||||
#define ACPI_ALL_NOTIFY (ACPI_SYSTEM_NOTIFY | ACPI_DEVICE_NOTIFY)
|
||||
#define ACPI_MAX_NOTIFY_HANDLER_TYPE 0x3
|
||||
#define ACPI_NUM_NOTIFY_TYPES 2
|
||||
|
||||
#define ACPI_MAX_SYS_NOTIFY 0x7f
|
||||
#define ACPI_MAX_SYS_NOTIFY 0x7F
|
||||
#define ACPI_MAX_DEVICE_SPECIFIC_NOTIFY 0xBF
|
||||
|
||||
#define ACPI_SYSTEM_HANDLER_LIST 0 /* Used as index, must be SYSTEM_NOTIFY -1 */
|
||||
#define ACPI_DEVICE_HANDLER_LIST 1 /* Used as index, must be DEVICE_NOTIFY -1 */
|
||||
|
||||
|
||||
/* Address Space (Operation Region) Types */
|
||||
@@ -799,9 +801,27 @@ typedef UINT8 ACPI_ADR_SPACE_TYPE;
|
||||
#define ACPI_ADR_SPACE_CMOS (ACPI_ADR_SPACE_TYPE) 5
|
||||
#define ACPI_ADR_SPACE_PCI_BAR_TARGET (ACPI_ADR_SPACE_TYPE) 6
|
||||
#define ACPI_ADR_SPACE_IPMI (ACPI_ADR_SPACE_TYPE) 7
|
||||
#define ACPI_ADR_SPACE_DATA_TABLE (ACPI_ADR_SPACE_TYPE) 8
|
||||
#define ACPI_ADR_SPACE_FIXED_HARDWARE (ACPI_ADR_SPACE_TYPE) 127
|
||||
#define ACPI_ADR_SPACE_GPIO (ACPI_ADR_SPACE_TYPE) 8
|
||||
#define ACPI_ADR_SPACE_GSBUS (ACPI_ADR_SPACE_TYPE) 9
|
||||
#define ACPI_ADR_SPACE_PLATFORM_COMM (ACPI_ADR_SPACE_TYPE) 10
|
||||
|
||||
#define ACPI_NUM_PREDEFINED_REGIONS 11
|
||||
|
||||
/*
|
||||
* Special Address Spaces
|
||||
*
|
||||
* Note: A Data Table region is a special type of operation region
|
||||
* that has its own AML opcode. However, internally, the AML
|
||||
* interpreter simply creates an operation region with an an address
|
||||
* space type of ACPI_ADR_SPACE_DATA_TABLE.
|
||||
*/
|
||||
#define ACPI_ADR_SPACE_DATA_TABLE (ACPI_ADR_SPACE_TYPE) 0x7E /* Internal to ACPICA only */
|
||||
#define ACPI_ADR_SPACE_FIXED_HARDWARE (ACPI_ADR_SPACE_TYPE) 0x7F
|
||||
|
||||
/* Values for _REG connection code */
|
||||
|
||||
#define ACPI_REG_DISCONNECT 0
|
||||
#define ACPI_REG_CONNECT 1
|
||||
|
||||
/*
|
||||
* BitRegister IDs
|
||||
@@ -858,6 +878,19 @@ typedef UINT8 ACPI_ADR_SPACE_TYPE;
|
||||
#define ACPI_DISABLE_EVENT 0
|
||||
|
||||
|
||||
/* Sleep function dispatch */
|
||||
|
||||
typedef ACPI_STATUS (*ACPI_SLEEP_FUNCTION) (
|
||||
UINT8 SleepState);
|
||||
|
||||
typedef struct acpi_sleep_functions
|
||||
{
|
||||
ACPI_SLEEP_FUNCTION LegacyFunction;
|
||||
ACPI_SLEEP_FUNCTION ExtendedFunction;
|
||||
|
||||
} ACPI_SLEEP_FUNCTIONS;
|
||||
|
||||
|
||||
/*
|
||||
* External ACPI object definition
|
||||
*/
|
||||
@@ -936,8 +969,18 @@ typedef struct acpi_object_list
|
||||
* Miscellaneous common Data Structures used by the interfaces
|
||||
*/
|
||||
#define ACPI_NO_BUFFER 0
|
||||
#define ACPI_ALLOCATE_BUFFER (ACPI_SIZE) (-1)
|
||||
#define ACPI_ALLOCATE_LOCAL_BUFFER (ACPI_SIZE) (-2)
|
||||
|
||||
#ifdef ACPI_NO_MEM_ALLOCATIONS
|
||||
|
||||
#define ACPI_ALLOCATE_BUFFER (ACPI_SIZE) (0)
|
||||
#define ACPI_ALLOCATE_LOCAL_BUFFER (ACPI_SIZE) (0)
|
||||
|
||||
#else /* ACPI_NO_MEM_ALLOCATIONS */
|
||||
|
||||
#define ACPI_ALLOCATE_BUFFER (ACPI_SIZE) (-1) /* Let ACPICA allocate buffer */
|
||||
#define ACPI_ALLOCATE_LOCAL_BUFFER (ACPI_SIZE) (-2) /* For internal use only (enables tracking) */
|
||||
|
||||
#endif /* ACPI_NO_MEM_ALLOCATIONS */
|
||||
|
||||
typedef struct acpi_buffer
|
||||
{
|
||||
@@ -1026,10 +1069,30 @@ typedef void
|
||||
/*
|
||||
* Various handlers and callback procedures
|
||||
*/
|
||||
typedef
|
||||
UINT32 (*ACPI_SCI_HANDLER) (
|
||||
void *Context);
|
||||
|
||||
typedef
|
||||
void (*ACPI_GBL_EVENT_HANDLER) (
|
||||
UINT32 EventType,
|
||||
ACPI_HANDLE Device,
|
||||
UINT32 EventNumber,
|
||||
void *Context);
|
||||
|
||||
#define ACPI_EVENT_TYPE_GPE 0
|
||||
#define ACPI_EVENT_TYPE_FIXED 1
|
||||
|
||||
typedef
|
||||
UINT32 (*ACPI_EVENT_HANDLER) (
|
||||
void *Context);
|
||||
|
||||
typedef
|
||||
UINT32 (*ACPI_GPE_HANDLER) (
|
||||
ACPI_HANDLE GpeDevice,
|
||||
UINT32 GpeNumber,
|
||||
void *Context);
|
||||
|
||||
typedef
|
||||
void (*ACPI_NOTIFY_HANDLER) (
|
||||
ACPI_HANDLE Device,
|
||||
@@ -1082,6 +1145,17 @@ ACPI_STATUS (*ACPI_ADR_SPACE_HANDLER) (
|
||||
|
||||
#define ACPI_DEFAULT_HANDLER NULL
|
||||
|
||||
/* Special Context data for GenericSerialBus/GeneralPurposeIo (ACPI 5.0) */
|
||||
|
||||
typedef struct acpi_connection_info
|
||||
{
|
||||
UINT8 *Connection;
|
||||
UINT16 Length;
|
||||
UINT8 AccessLength;
|
||||
|
||||
} ACPI_CONNECTION_INFO;
|
||||
|
||||
|
||||
typedef
|
||||
ACPI_STATUS (*ACPI_ADR_SPACE_SETUP) (
|
||||
ACPI_HANDLE RegionHandle,
|
||||
@@ -1099,12 +1173,22 @@ ACPI_STATUS (*ACPI_WALK_CALLBACK) (
|
||||
void *Context,
|
||||
void **ReturnValue);
|
||||
|
||||
typedef
|
||||
UINT32 (*ACPI_INTERFACE_HANDLER) (
|
||||
ACPI_STRING InterfaceName,
|
||||
UINT32 Supported);
|
||||
|
||||
|
||||
/* Interrupt handler return values */
|
||||
|
||||
#define ACPI_INTERRUPT_NOT_HANDLED 0x00
|
||||
#define ACPI_INTERRUPT_HANDLED 0x01
|
||||
|
||||
/* GPE handler return values */
|
||||
|
||||
#define ACPI_REENABLE_GPE 0x80
|
||||
|
||||
|
||||
/* Length of 32-bit EISAID values when converted back to a string */
|
||||
|
||||
#define ACPI_EISAID_STRING_SIZE 8 /* Includes null terminator */
|
||||
@@ -1114,22 +1198,22 @@ ACPI_STATUS (*ACPI_WALK_CALLBACK) (
|
||||
#define ACPI_UUID_LENGTH 16
|
||||
|
||||
|
||||
/* Structures used for device/processor HID, UID, CID */
|
||||
/* Structures used for device/processor HID, UID, CID, and SUB */
|
||||
|
||||
typedef struct acpi_device_id
|
||||
typedef struct acpi_pnp_device_id
|
||||
{
|
||||
UINT32 Length; /* Length of string + null */
|
||||
char *String;
|
||||
|
||||
} ACPI_DEVICE_ID;
|
||||
} ACPI_PNP_DEVICE_ID;
|
||||
|
||||
typedef struct acpi_device_id_list
|
||||
typedef struct acpi_pnp_device_id_list
|
||||
{
|
||||
UINT32 Count; /* Number of IDs in Ids array */
|
||||
UINT32 ListSize; /* Size of list, including ID strings */
|
||||
ACPI_DEVICE_ID Ids[1]; /* ID array */
|
||||
ACPI_PNP_DEVICE_ID Ids[1]; /* ID array */
|
||||
|
||||
} ACPI_DEVICE_ID_LIST;
|
||||
} ACPI_PNP_DEVICE_ID_LIST;
|
||||
|
||||
/*
|
||||
* Structure returned from AcpiGetObjectInfo.
|
||||
@@ -1147,9 +1231,10 @@ typedef struct acpi_device_info
|
||||
UINT8 LowestDstates[5]; /* _SxW values: 0xFF indicates not valid */
|
||||
UINT32 CurrentStatus; /* _STA value */
|
||||
UINT64 Address; /* _ADR value */
|
||||
ACPI_DEVICE_ID HardwareId; /* _HID value */
|
||||
ACPI_DEVICE_ID UniqueId; /* _UID value */
|
||||
ACPI_DEVICE_ID_LIST CompatibleIdList; /* _CID list <must be last> */
|
||||
ACPI_PNP_DEVICE_ID HardwareId; /* _HID value */
|
||||
ACPI_PNP_DEVICE_ID UniqueId; /* _UID value */
|
||||
ACPI_PNP_DEVICE_ID SubsystemId; /* _SUB value */
|
||||
ACPI_PNP_DEVICE_ID_LIST CompatibleIdList; /* _CID list <must be last> */
|
||||
|
||||
} ACPI_DEVICE_INFO;
|
||||
|
||||
@@ -1163,11 +1248,12 @@ typedef struct acpi_device_info
|
||||
#define ACPI_VALID_ADR 0x02
|
||||
#define ACPI_VALID_HID 0x04
|
||||
#define ACPI_VALID_UID 0x08
|
||||
#define ACPI_VALID_CID 0x10
|
||||
#define ACPI_VALID_SXDS 0x20
|
||||
#define ACPI_VALID_SXWS 0x40
|
||||
#define ACPI_VALID_SUB 0x10
|
||||
#define ACPI_VALID_CID 0x20
|
||||
#define ACPI_VALID_SXDS 0x40
|
||||
#define ACPI_VALID_SXWS 0x80
|
||||
|
||||
/* Flags for _STA method */
|
||||
/* Flags for _STA return value (CurrentStatus above) */
|
||||
|
||||
#define ACPI_STA_DEVICE_PRESENT 0x01
|
||||
#define ACPI_STA_DEVICE_ENABLED 0x02
|
||||
@@ -1209,7 +1295,6 @@ typedef struct acpi_memory_list
|
||||
UINT16 ObjectSize;
|
||||
UINT16 MaxDepth;
|
||||
UINT16 CurrentDepth;
|
||||
UINT16 LinkOffset;
|
||||
|
||||
#ifdef ACPI_DBG_TRACK_ALLOCATIONS
|
||||
|
||||
@@ -1227,4 +1312,47 @@ typedef struct acpi_memory_list
|
||||
} ACPI_MEMORY_LIST;
|
||||
|
||||
|
||||
/* Definitions of _OSI support */
|
||||
|
||||
#define ACPI_VENDOR_STRINGS 0x01
|
||||
#define ACPI_FEATURE_STRINGS 0x02
|
||||
#define ACPI_ENABLE_INTERFACES 0x00
|
||||
#define ACPI_DISABLE_INTERFACES 0x04
|
||||
|
||||
#define ACPI_DISABLE_ALL_VENDOR_STRINGS (ACPI_DISABLE_INTERFACES | ACPI_VENDOR_STRINGS)
|
||||
#define ACPI_DISABLE_ALL_FEATURE_STRINGS (ACPI_DISABLE_INTERFACES | ACPI_FEATURE_STRINGS)
|
||||
#define ACPI_DISABLE_ALL_STRINGS (ACPI_DISABLE_INTERFACES | ACPI_VENDOR_STRINGS | ACPI_FEATURE_STRINGS)
|
||||
#define ACPI_ENABLE_ALL_VENDOR_STRINGS (ACPI_ENABLE_INTERFACES | ACPI_VENDOR_STRINGS)
|
||||
#define ACPI_ENABLE_ALL_FEATURE_STRINGS (ACPI_ENABLE_INTERFACES | ACPI_FEATURE_STRINGS)
|
||||
#define ACPI_ENABLE_ALL_STRINGS (ACPI_ENABLE_INTERFACES | ACPI_VENDOR_STRINGS | ACPI_FEATURE_STRINGS)
|
||||
|
||||
#define ACPI_OSI_WIN_2000 0x01
|
||||
#define ACPI_OSI_WIN_XP 0x02
|
||||
#define ACPI_OSI_WIN_XP_SP1 0x03
|
||||
#define ACPI_OSI_WINSRV_2003 0x04
|
||||
#define ACPI_OSI_WIN_XP_SP2 0x05
|
||||
#define ACPI_OSI_WINSRV_2003_SP1 0x06
|
||||
#define ACPI_OSI_WIN_VISTA 0x07
|
||||
#define ACPI_OSI_WINSRV_2008 0x08
|
||||
#define ACPI_OSI_WIN_VISTA_SP1 0x09
|
||||
#define ACPI_OSI_WIN_VISTA_SP2 0x0A
|
||||
#define ACPI_OSI_WIN_7 0x0B
|
||||
#define ACPI_OSI_WIN_8 0x0C
|
||||
|
||||
|
||||
/* Definitions of file IO */
|
||||
|
||||
#define ACPI_FILE_READING 0x01
|
||||
#define ACPI_FILE_WRITING 0x02
|
||||
#define ACPI_FILE_BINARY 0x04
|
||||
|
||||
#define ACPI_FILE_BEGIN 0x01
|
||||
#define ACPI_FILE_END 0x02
|
||||
|
||||
|
||||
/* Definitions of getopt */
|
||||
|
||||
#define ACPI_OPT_END -1
|
||||
|
||||
|
||||
#endif /* __ACTYPES_H__ */
|
||||
|
||||
@@ -4,124 +4,53 @@
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
* 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.
|
||||
*
|
||||
* 2.1. This is your license from Intel Corp. under its intellectual property
|
||||
* rights. You may have additional license terms from the party that provided
|
||||
* you this software, covering your right to use that party's intellectual
|
||||
* property rights.
|
||||
* 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.
|
||||
*
|
||||
* 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
|
||||
* copy of the source code appearing in this file ("Covered Code") an
|
||||
* irrevocable, perpetual, worldwide license under Intel's copyrights in the
|
||||
* base code distributed originally by Intel ("Original Intel Code") to copy,
|
||||
* make derivatives, distribute, use and display any portion of the Covered
|
||||
* Code in any form, with the right to sublicense such rights; and
|
||||
*
|
||||
* 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
|
||||
* license (with the right to sublicense), under only those claims of Intel
|
||||
* patents that are infringed by the Original Intel Code, to make, use, sell,
|
||||
* offer to sell, and import the Covered Code and derivative works thereof
|
||||
* solely to the minimum extent necessary to exercise the above copyright
|
||||
* license, and in no event shall the patent license extend to any additions
|
||||
* to or modifications of the Original Intel Code. No other license or right
|
||||
* is granted directly or by implication, estoppel or otherwise;
|
||||
*
|
||||
* The above copyright and patent license is granted only if the following
|
||||
* conditions are met:
|
||||
*
|
||||
* 3. Conditions
|
||||
*
|
||||
* 3.1. Redistribution of Source with Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification with rights to further distribute source must include
|
||||
* the above Copyright Notice, the above License, this list of Conditions,
|
||||
* and the following Disclaimer and Export Compliance provision. In addition,
|
||||
* Licensee must cause all Covered Code to which Licensee contributes to
|
||||
* contain a file documenting the changes Licensee made to create that Covered
|
||||
* Code and the date of any change. Licensee must include in that file the
|
||||
* documentation of any changes made by any predecessor Licensee. Licensee
|
||||
* must include a prominent statement that the modification is derived,
|
||||
* directly or indirectly, from Original Intel Code.
|
||||
*
|
||||
* 3.2. Redistribution of Source with no Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification without rights to further distribute source must
|
||||
* include the following Disclaimer and Export Compliance provision in the
|
||||
* documentation and/or other materials provided with distribution. In
|
||||
* addition, Licensee may not authorize further sublicense of source of any
|
||||
* portion of the Covered Code, and must include terms to the effect that the
|
||||
* license from Licensee to its licensee is limited to the intellectual
|
||||
* property embodied in the software Licensee provides to its licensee, and
|
||||
* not to intellectual property embodied in modifications its licensee may
|
||||
* make.
|
||||
*
|
||||
* 3.3. Redistribution of Executable. Redistribution in executable form of any
|
||||
* substantial portion of the Covered Code or modification must reproduce the
|
||||
* above Copyright Notice, and the following Disclaimer and Export Compliance
|
||||
* provision in the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3.4. Intel retains all right, title, and interest in and to the Original
|
||||
* Intel Code.
|
||||
*
|
||||
* 3.5. Neither the name Intel nor any other trademark owned or controlled by
|
||||
* Intel shall be used in advertising or otherwise to promote the sale, use or
|
||||
* other dealings in products derived from or relating to the Covered Code
|
||||
* without prior written authorization from Intel.
|
||||
*
|
||||
* 4. Disclaimer and Export Compliance
|
||||
*
|
||||
* 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
|
||||
* HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
|
||||
* IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
|
||||
* INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
|
||||
* UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
|
||||
* PARTICULAR PURPOSE.
|
||||
*
|
||||
* 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
|
||||
* OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
|
||||
* COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
|
||||
* SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
|
||||
* CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
|
||||
* HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
|
||||
* SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
|
||||
* LIMITED REMEDY.
|
||||
*
|
||||
* 4.3. Licensee shall not export, either directly or indirectly, any of this
|
||||
* software or system incorporating such software without first obtaining any
|
||||
* required license or other approval from the U. S. Department of Commerce or
|
||||
* any other agency or department of the United States Government. In the
|
||||
* event Licensee exports any such software from the United States or
|
||||
* re-exports any such software from a foreign destination, Licensee shall
|
||||
* ensure that the distribution and export/re-export of the software is in
|
||||
* compliance with all laws, regulations, orders, or other restrictions of the
|
||||
* U.S. Export Administration Regulations. Licensee agrees that neither it nor
|
||||
* any of its subsidiaries will export/re-export any technical data, process,
|
||||
* software, or service, directly or indirectly, to any country for which the
|
||||
* United States government or any agency thereof requires an export license,
|
||||
* other governmental approval, or letter of assurance, without first obtaining
|
||||
* such license, approval or letter.
|
||||
*
|
||||
*****************************************************************************/
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef _ACUTILS_H
|
||||
#define _ACUTILS_H
|
||||
|
||||
|
||||
extern const UINT8 AcpiGbl_ResourceAmlSizes[];
|
||||
extern const UINT8 AcpiGbl_ResourceAmlSerialBusSizes[];
|
||||
|
||||
/* Strings used by the disassembler and debugger resource dump routines */
|
||||
|
||||
#if defined(ACPI_DISASSEMBLER) || defined (ACPI_DEBUGGER)
|
||||
#if defined(ACPI_DEBUG_OUTPUT) || defined (ACPI_DISASSEMBLER) || defined (ACPI_DEBUGGER)
|
||||
|
||||
extern const char *AcpiGbl_BmDecode[];
|
||||
extern const char *AcpiGbl_ConfigDecode[];
|
||||
@@ -141,8 +70,66 @@ extern const char *AcpiGbl_SizDecode[];
|
||||
extern const char *AcpiGbl_TrsDecode[];
|
||||
extern const char *AcpiGbl_TtpDecode[];
|
||||
extern const char *AcpiGbl_TypDecode[];
|
||||
extern const char *AcpiGbl_PpcDecode[];
|
||||
extern const char *AcpiGbl_IorDecode[];
|
||||
extern const char *AcpiGbl_DtsDecode[];
|
||||
extern const char *AcpiGbl_CtDecode[];
|
||||
extern const char *AcpiGbl_SbtDecode[];
|
||||
extern const char *AcpiGbl_AmDecode[];
|
||||
extern const char *AcpiGbl_SmDecode[];
|
||||
extern const char *AcpiGbl_WmDecode[];
|
||||
extern const char *AcpiGbl_CphDecode[];
|
||||
extern const char *AcpiGbl_CpoDecode[];
|
||||
extern const char *AcpiGbl_DpDecode[];
|
||||
extern const char *AcpiGbl_EdDecode[];
|
||||
extern const char *AcpiGbl_BpbDecode[];
|
||||
extern const char *AcpiGbl_SbDecode[];
|
||||
extern const char *AcpiGbl_FcDecode[];
|
||||
extern const char *AcpiGbl_PtDecode[];
|
||||
#endif
|
||||
|
||||
/*
|
||||
* For the iASL compiler case, the output is redirected to stderr so that
|
||||
* any of the various ACPI errors and warnings do not appear in the output
|
||||
* files, for either the compiler or disassembler portions of the tool.
|
||||
*/
|
||||
#ifdef ACPI_ASL_COMPILER
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
#define ACPI_MSG_REDIRECT_BEGIN \
|
||||
FILE *OutputFile = AcpiGbl_OutputFile; \
|
||||
AcpiOsRedirectOutput (stderr);
|
||||
|
||||
#define ACPI_MSG_REDIRECT_END \
|
||||
AcpiOsRedirectOutput (OutputFile);
|
||||
|
||||
#else
|
||||
/*
|
||||
* non-iASL case - no redirection, nothing to do
|
||||
*/
|
||||
#define ACPI_MSG_REDIRECT_BEGIN
|
||||
#define ACPI_MSG_REDIRECT_END
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Common error message prefixes
|
||||
*/
|
||||
#define ACPI_MSG_ERROR "ACPI Error: "
|
||||
#define ACPI_MSG_EXCEPTION "ACPI Exception: "
|
||||
#define ACPI_MSG_WARNING "ACPI Warning: "
|
||||
#define ACPI_MSG_INFO "ACPI: "
|
||||
|
||||
#define ACPI_MSG_BIOS_ERROR "ACPI BIOS Error (bug): "
|
||||
#define ACPI_MSG_BIOS_WARNING "ACPI BIOS Warning (bug): "
|
||||
|
||||
/*
|
||||
* Common message suffix
|
||||
*/
|
||||
#define ACPI_MSG_SUFFIX \
|
||||
AcpiOsPrintf (" (%8.8X/%s-%u)\n", ACPI_CA_VERSION, ModuleName, LineNumber)
|
||||
|
||||
|
||||
/* Types for Resource descriptor entries */
|
||||
|
||||
#define ACPI_INVALID_RESOURCE 0
|
||||
@@ -156,7 +143,7 @@ ACPI_STATUS (*ACPI_WALK_AML_CALLBACK) (
|
||||
UINT32 Length,
|
||||
UINT32 Offset,
|
||||
UINT8 ResourceIndex,
|
||||
void *Context);
|
||||
void **Context);
|
||||
|
||||
typedef
|
||||
ACPI_STATUS (*ACPI_PKG_CALLBACK) (
|
||||
@@ -174,9 +161,10 @@ typedef struct acpi_pkg_info
|
||||
|
||||
} ACPI_PKG_INFO;
|
||||
|
||||
/* Object reference counts */
|
||||
|
||||
#define REF_INCREMENT (UINT16) 0
|
||||
#define REF_DECREMENT (UINT16) 1
|
||||
#define REF_FORCE_DELETE (UINT16) 2
|
||||
|
||||
/* AcpiUtDumpBuffer */
|
||||
|
||||
@@ -185,7 +173,6 @@ typedef struct acpi_pkg_info
|
||||
#define DB_DWORD_DISPLAY 4
|
||||
#define DB_QWORD_DISPLAY 8
|
||||
|
||||
|
||||
/*
|
||||
* utglobal - Global data structures and procedures
|
||||
*/
|
||||
@@ -201,8 +188,8 @@ AcpiUtGetMutexName (
|
||||
|
||||
const char *
|
||||
AcpiUtGetNotifyName (
|
||||
UINT32 NotifyValue);
|
||||
|
||||
UINT32 NotifyValue,
|
||||
ACPI_OBJECT_TYPE Type);
|
||||
#endif
|
||||
|
||||
char *
|
||||
@@ -238,6 +225,10 @@ AcpiUtHexToAsciiChar (
|
||||
UINT64 Integer,
|
||||
UINT32 Position);
|
||||
|
||||
UINT8
|
||||
AcpiUtAsciiCharToHex (
|
||||
int HexChar);
|
||||
|
||||
BOOLEAN
|
||||
AcpiUtValidObjectType (
|
||||
ACPI_OBJECT_TYPE Type);
|
||||
@@ -264,6 +255,11 @@ ACPI_SIZE
|
||||
AcpiUtStrlen (
|
||||
const char *String);
|
||||
|
||||
char *
|
||||
AcpiUtStrchr (
|
||||
const char *String,
|
||||
int ch);
|
||||
|
||||
char *
|
||||
AcpiUtStrcpy (
|
||||
char *DstString,
|
||||
@@ -352,7 +348,7 @@ extern const UINT8 _acpi_ctype[];
|
||||
#define ACPI_IS_XDIGIT(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_XD))
|
||||
#define ACPI_IS_UPPER(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_UP))
|
||||
#define ACPI_IS_LOWER(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_LO))
|
||||
#define ACPI_IS_PRINT(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_LO | _ACPI_UP | _ACPI_DI | _ACPI_SP | _ACPI_PU))
|
||||
#define ACPI_IS_PRINT(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_LO | _ACPI_UP | _ACPI_DI | _ACPI_XS | _ACPI_PU))
|
||||
#define ACPI_IS_ALPHA(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_LO | _ACPI_UP))
|
||||
|
||||
#endif /* !ACPI_USE_SYSTEM_CLIBRARY */
|
||||
@@ -480,18 +476,29 @@ AcpiUtPtrExit (
|
||||
UINT32 ComponentId,
|
||||
UINT8 *Ptr);
|
||||
|
||||
void
|
||||
AcpiUtDebugDumpBuffer (
|
||||
UINT8 *Buffer,
|
||||
UINT32 Count,
|
||||
UINT32 Display,
|
||||
UINT32 ComponentId);
|
||||
|
||||
void
|
||||
AcpiUtDumpBuffer (
|
||||
UINT8 *Buffer,
|
||||
UINT32 Count,
|
||||
UINT32 Display,
|
||||
UINT32 componentId);
|
||||
UINT32 Offset);
|
||||
|
||||
#ifdef ACPI_APPLICATION
|
||||
void
|
||||
AcpiUtDumpBuffer2 (
|
||||
AcpiUtDumpBufferToFile (
|
||||
ACPI_FILE File,
|
||||
UINT8 *Buffer,
|
||||
UINT32 Count,
|
||||
UINT32 Display);
|
||||
UINT32 Display,
|
||||
UINT32 BaseOffset);
|
||||
#endif
|
||||
|
||||
void
|
||||
AcpiUtReportError (
|
||||
@@ -536,10 +543,6 @@ AcpiUtDeleteInternalObjectList (
|
||||
* uteval - object evaluation
|
||||
*/
|
||||
ACPI_STATUS
|
||||
AcpiUtOsiImplementation (
|
||||
ACPI_WALK_STATE *WalkState);
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiUtEvaluateObject (
|
||||
ACPI_NAMESPACE_NODE *PrefixNode,
|
||||
char *Path,
|
||||
@@ -565,23 +568,39 @@ AcpiUtExecutePowerMethods (
|
||||
UINT8 *OutValues);
|
||||
|
||||
|
||||
/*
|
||||
* utfileio - file operations
|
||||
*/
|
||||
#ifdef ACPI_APPLICATION
|
||||
ACPI_STATUS
|
||||
AcpiUtReadTableFromFile (
|
||||
char *Filename,
|
||||
ACPI_TABLE_HEADER **Table);
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* utids - device ID support
|
||||
*/
|
||||
ACPI_STATUS
|
||||
AcpiUtExecute_HID (
|
||||
ACPI_NAMESPACE_NODE *DeviceNode,
|
||||
ACPI_DEVICE_ID **ReturnId);
|
||||
ACPI_PNP_DEVICE_ID **ReturnId);
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiUtExecute_UID (
|
||||
ACPI_NAMESPACE_NODE *DeviceNode,
|
||||
ACPI_DEVICE_ID **ReturnId);
|
||||
ACPI_PNP_DEVICE_ID **ReturnId);
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiUtExecute_SUB (
|
||||
ACPI_NAMESPACE_NODE *DeviceNode,
|
||||
ACPI_PNP_DEVICE_ID **ReturnId);
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiUtExecute_CID (
|
||||
ACPI_NAMESPACE_NODE *DeviceNode,
|
||||
ACPI_DEVICE_ID_LIST **ReturnCidList);
|
||||
ACPI_PNP_DEVICE_ID_LIST **ReturnCidList);
|
||||
|
||||
|
||||
/*
|
||||
@@ -661,6 +680,70 @@ AcpiUtGetObjectSize(
|
||||
ACPI_SIZE *ObjLength);
|
||||
|
||||
|
||||
/*
|
||||
* utosi - Support for the _OSI predefined control method
|
||||
*/
|
||||
ACPI_STATUS
|
||||
AcpiUtInitializeInterfaces (
|
||||
void);
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiUtInterfaceTerminate (
|
||||
void);
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiUtInstallInterface (
|
||||
ACPI_STRING InterfaceName);
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiUtRemoveInterface (
|
||||
ACPI_STRING InterfaceName);
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiUtUpdateInterfaces (
|
||||
UINT8 Action);
|
||||
|
||||
ACPI_INTERFACE_INFO *
|
||||
AcpiUtGetInterface (
|
||||
ACPI_STRING InterfaceName);
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiUtOsiImplementation (
|
||||
ACPI_WALK_STATE *WalkState);
|
||||
|
||||
|
||||
/*
|
||||
* utpredef - support for predefined names
|
||||
*/
|
||||
const ACPI_PREDEFINED_INFO *
|
||||
AcpiUtGetNextPredefinedMethod (
|
||||
const ACPI_PREDEFINED_INFO *ThisName);
|
||||
|
||||
const ACPI_PREDEFINED_INFO *
|
||||
AcpiUtMatchPredefinedMethod (
|
||||
char *Name);
|
||||
|
||||
const ACPI_PREDEFINED_INFO *
|
||||
AcpiUtMatchResourceName (
|
||||
char *Name);
|
||||
|
||||
void
|
||||
AcpiUtDisplayPredefinedMethod (
|
||||
char *Buffer,
|
||||
const ACPI_PREDEFINED_INFO *ThisName,
|
||||
BOOLEAN MultiLine);
|
||||
|
||||
void
|
||||
AcpiUtGetExpectedReturnTypes (
|
||||
char *Buffer,
|
||||
UINT32 ExpectedBtypes);
|
||||
|
||||
UINT32
|
||||
AcpiUtGetResourceBitWidth (
|
||||
char *Buffer,
|
||||
UINT16 Types);
|
||||
|
||||
|
||||
/*
|
||||
* utstate - Generic state creation/cache routines
|
||||
*/
|
||||
@@ -732,10 +815,11 @@ AcpiUtShortDivide (
|
||||
UINT64 *OutQuotient,
|
||||
UINT32 *OutRemainder);
|
||||
|
||||
|
||||
/*
|
||||
* utmisc
|
||||
*/
|
||||
const char *
|
||||
const ACPI_EXCEPTION_INFO *
|
||||
AcpiUtValidateException (
|
||||
ACPI_STATUS Status);
|
||||
|
||||
@@ -747,14 +831,6 @@ BOOLEAN
|
||||
AcpiUtIsAmlTable (
|
||||
ACPI_TABLE_HEADER *Table);
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiUtAllocateOwnerId (
|
||||
ACPI_OWNER_ID *OwnerId);
|
||||
|
||||
void
|
||||
AcpiUtReleaseOwnerId (
|
||||
ACPI_OWNER_ID *OwnerId);
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiUtWalkPackageTree (
|
||||
ACPI_OPERAND_OBJECT *SourceObject,
|
||||
@@ -762,55 +838,6 @@ AcpiUtWalkPackageTree (
|
||||
ACPI_PKG_CALLBACK WalkCallback,
|
||||
void *Context);
|
||||
|
||||
void
|
||||
AcpiUtStrupr (
|
||||
char *SrcString);
|
||||
|
||||
void
|
||||
AcpiUtStrlwr (
|
||||
char *SrcString);
|
||||
|
||||
void
|
||||
AcpiUtPrintString (
|
||||
char *String,
|
||||
UINT8 MaxLength);
|
||||
|
||||
BOOLEAN
|
||||
AcpiUtValidAcpiName (
|
||||
UINT32 Name);
|
||||
|
||||
void
|
||||
AcpiUtRepairName (
|
||||
char *Name);
|
||||
|
||||
BOOLEAN
|
||||
AcpiUtValidAcpiChar (
|
||||
char Character,
|
||||
UINT32 Position);
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiUtStrtoul64 (
|
||||
char *String,
|
||||
UINT32 Base,
|
||||
UINT64 *RetInteger);
|
||||
|
||||
void ACPI_INTERNAL_VAR_XFACE
|
||||
AcpiUtPredefinedWarning (
|
||||
const char *ModuleName,
|
||||
UINT32 LineNumber,
|
||||
char *Pathname,
|
||||
UINT8 NodeFlags,
|
||||
const char *Format,
|
||||
...);
|
||||
|
||||
void ACPI_INTERNAL_VAR_XFACE
|
||||
AcpiUtPredefinedInfo (
|
||||
const char *ModuleName,
|
||||
UINT32 LineNumber,
|
||||
char *Pathname,
|
||||
UINT8 NodeFlags,
|
||||
const char *Format,
|
||||
...);
|
||||
|
||||
/* Values for Base above (16=Hex, 10=Decimal) */
|
||||
|
||||
@@ -833,18 +860,32 @@ AcpiUtDisplayInitPathname (
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* utownerid - Support for Table/Method Owner IDs
|
||||
*/
|
||||
ACPI_STATUS
|
||||
AcpiUtAllocateOwnerId (
|
||||
ACPI_OWNER_ID *OwnerId);
|
||||
|
||||
void
|
||||
AcpiUtReleaseOwnerId (
|
||||
ACPI_OWNER_ID *OwnerId);
|
||||
|
||||
|
||||
/*
|
||||
* utresrc
|
||||
*/
|
||||
ACPI_STATUS
|
||||
AcpiUtWalkAmlResources (
|
||||
ACPI_WALK_STATE *WalkState,
|
||||
UINT8 *Aml,
|
||||
ACPI_SIZE AmlLength,
|
||||
ACPI_WALK_AML_CALLBACK UserFunction,
|
||||
void *Context);
|
||||
void **Context);
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiUtValidateResource (
|
||||
ACPI_WALK_STATE *WalkState,
|
||||
void *Aml,
|
||||
UINT8 *ReturnIndex);
|
||||
|
||||
@@ -870,6 +911,72 @@ AcpiUtGetResourceEndTag (
|
||||
UINT8 **EndTag);
|
||||
|
||||
|
||||
/*
|
||||
* utstring - String and character utilities
|
||||
*/
|
||||
void
|
||||
AcpiUtStrupr (
|
||||
char *SrcString);
|
||||
|
||||
void
|
||||
AcpiUtStrlwr (
|
||||
char *SrcString);
|
||||
|
||||
int
|
||||
AcpiUtStricmp (
|
||||
char *String1,
|
||||
char *String2);
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiUtStrtoul64 (
|
||||
char *String,
|
||||
UINT32 Base,
|
||||
UINT64 *RetInteger);
|
||||
|
||||
void
|
||||
AcpiUtPrintString (
|
||||
char *String,
|
||||
UINT16 MaxLength);
|
||||
|
||||
void
|
||||
UtConvertBackslashes (
|
||||
char *Pathname);
|
||||
|
||||
BOOLEAN
|
||||
AcpiUtValidAcpiName (
|
||||
char *Name);
|
||||
|
||||
BOOLEAN
|
||||
AcpiUtValidAcpiChar (
|
||||
char Character,
|
||||
UINT32 Position);
|
||||
|
||||
void
|
||||
AcpiUtRepairName (
|
||||
char *Name);
|
||||
|
||||
#if defined (ACPI_DEBUGGER) || defined (ACPI_APPLICATION)
|
||||
BOOLEAN
|
||||
AcpiUtSafeStrcpy (
|
||||
char *Dest,
|
||||
ACPI_SIZE DestSize,
|
||||
char *Source);
|
||||
|
||||
BOOLEAN
|
||||
AcpiUtSafeStrcat (
|
||||
char *Dest,
|
||||
ACPI_SIZE DestSize,
|
||||
char *Source);
|
||||
|
||||
BOOLEAN
|
||||
AcpiUtSafeStrncat (
|
||||
char *Dest,
|
||||
ACPI_SIZE DestSize,
|
||||
char *Source,
|
||||
ACPI_SIZE MaxTransferLength);
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* utmutex - mutex support
|
||||
*/
|
||||
@@ -910,20 +1017,6 @@ AcpiUtInitializeBuffer (
|
||||
ACPI_BUFFER *Buffer,
|
||||
ACPI_SIZE RequiredLength);
|
||||
|
||||
void *
|
||||
AcpiUtAllocate (
|
||||
ACPI_SIZE Size,
|
||||
UINT32 Component,
|
||||
const char *Module,
|
||||
UINT32 Line);
|
||||
|
||||
void *
|
||||
AcpiUtAllocateZeroed (
|
||||
ACPI_SIZE Size,
|
||||
UINT32 Component,
|
||||
const char *Module,
|
||||
UINT32 Line);
|
||||
|
||||
#ifdef ACPI_DBG_TRACK_ALLOCATIONS
|
||||
void *
|
||||
AcpiUtAllocateAndTrack (
|
||||
@@ -961,7 +1054,142 @@ AcpiUtCreateList (
|
||||
UINT16 ObjectSize,
|
||||
ACPI_MEMORY_LIST **ReturnCache);
|
||||
|
||||
#endif /* ACPI_DBG_TRACK_ALLOCATIONS */
|
||||
|
||||
/*
|
||||
* utaddress - address range check
|
||||
*/
|
||||
ACPI_STATUS
|
||||
AcpiUtAddAddressRange (
|
||||
ACPI_ADR_SPACE_TYPE SpaceId,
|
||||
ACPI_PHYSICAL_ADDRESS Address,
|
||||
UINT32 Length,
|
||||
ACPI_NAMESPACE_NODE *RegionNode);
|
||||
|
||||
void
|
||||
AcpiUtRemoveAddressRange (
|
||||
ACPI_ADR_SPACE_TYPE SpaceId,
|
||||
ACPI_NAMESPACE_NODE *RegionNode);
|
||||
|
||||
UINT32
|
||||
AcpiUtCheckAddressRange (
|
||||
ACPI_ADR_SPACE_TYPE SpaceId,
|
||||
ACPI_PHYSICAL_ADDRESS Address,
|
||||
UINT32 Length,
|
||||
BOOLEAN Warn);
|
||||
|
||||
void
|
||||
AcpiUtDeleteAddressLists (
|
||||
void);
|
||||
|
||||
/*
|
||||
* utxferror - various error/warning output functions
|
||||
*/
|
||||
void ACPI_INTERNAL_VAR_XFACE
|
||||
AcpiUtPredefinedWarning (
|
||||
const char *ModuleName,
|
||||
UINT32 LineNumber,
|
||||
char *Pathname,
|
||||
UINT8 NodeFlags,
|
||||
const char *Format,
|
||||
...);
|
||||
|
||||
void ACPI_INTERNAL_VAR_XFACE
|
||||
AcpiUtPredefinedInfo (
|
||||
const char *ModuleName,
|
||||
UINT32 LineNumber,
|
||||
char *Pathname,
|
||||
UINT8 NodeFlags,
|
||||
const char *Format,
|
||||
...);
|
||||
|
||||
void ACPI_INTERNAL_VAR_XFACE
|
||||
AcpiUtPredefinedBiosError (
|
||||
const char *ModuleName,
|
||||
UINT32 LineNumber,
|
||||
char *Pathname,
|
||||
UINT8 NodeFlags,
|
||||
const char *Format,
|
||||
...);
|
||||
|
||||
void
|
||||
AcpiUtNamespaceError (
|
||||
const char *ModuleName,
|
||||
UINT32 LineNumber,
|
||||
const char *InternalName,
|
||||
ACPI_STATUS LookupStatus);
|
||||
|
||||
void
|
||||
AcpiUtMethodError (
|
||||
const char *ModuleName,
|
||||
UINT32 LineNumber,
|
||||
const char *Message,
|
||||
ACPI_NAMESPACE_NODE *Node,
|
||||
const char *Path,
|
||||
ACPI_STATUS LookupStatus);
|
||||
|
||||
/*
|
||||
* Utility functions for ACPI names and IDs
|
||||
*/
|
||||
const AH_PREDEFINED_NAME *
|
||||
AcpiAhMatchPredefinedName (
|
||||
char *Nameseg);
|
||||
|
||||
const AH_DEVICE_ID *
|
||||
AcpiAhMatchHardwareId (
|
||||
char *Hid);
|
||||
|
||||
const char *
|
||||
AcpiAhMatchUuid (
|
||||
UINT8 *Data);
|
||||
|
||||
/*
|
||||
* utprint - printf/vprintf output functions
|
||||
*/
|
||||
const char *
|
||||
AcpiUtScanNumber (
|
||||
const char *String,
|
||||
UINT64 *NumberPtr);
|
||||
|
||||
const char *
|
||||
AcpiUtPrintNumber (
|
||||
char *String,
|
||||
UINT64 Number);
|
||||
|
||||
int
|
||||
AcpiUtVsnprintf (
|
||||
char *String,
|
||||
ACPI_SIZE Size,
|
||||
const char *Format,
|
||||
va_list Args);
|
||||
|
||||
int
|
||||
AcpiUtSnprintf (
|
||||
char *String,
|
||||
ACPI_SIZE Size,
|
||||
const char *Format,
|
||||
...);
|
||||
|
||||
#ifdef ACPI_APPLICATION
|
||||
int
|
||||
AcpiUtFileVprintf (
|
||||
ACPI_FILE File,
|
||||
const char *Format,
|
||||
va_list Args);
|
||||
|
||||
int
|
||||
AcpiUtFilePrintf (
|
||||
ACPI_FILE File,
|
||||
const char *Format,
|
||||
...);
|
||||
#endif
|
||||
|
||||
/*
|
||||
* utuuid -- UUID support functions
|
||||
*/
|
||||
void
|
||||
AcpiUtConvertStringToUuid (
|
||||
char *InString,
|
||||
UINT8 *UuidBuffer);
|
||||
|
||||
#endif /* _ACUTILS_H */
|
||||
|
||||
@@ -6,114 +6,42 @@
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
* 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.
|
||||
*
|
||||
* 2.1. This is your license from Intel Corp. under its intellectual property
|
||||
* rights. You may have additional license terms from the party that provided
|
||||
* you this software, covering your right to use that party's intellectual
|
||||
* property rights.
|
||||
* 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.
|
||||
*
|
||||
* 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
|
||||
* copy of the source code appearing in this file ("Covered Code") an
|
||||
* irrevocable, perpetual, worldwide license under Intel's copyrights in the
|
||||
* base code distributed originally by Intel ("Original Intel Code") to copy,
|
||||
* make derivatives, distribute, use and display any portion of the Covered
|
||||
* Code in any form, with the right to sublicense such rights; and
|
||||
*
|
||||
* 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
|
||||
* license (with the right to sublicense), under only those claims of Intel
|
||||
* patents that are infringed by the Original Intel Code, to make, use, sell,
|
||||
* offer to sell, and import the Covered Code and derivative works thereof
|
||||
* solely to the minimum extent necessary to exercise the above copyright
|
||||
* license, and in no event shall the patent license extend to any additions
|
||||
* to or modifications of the Original Intel Code. No other license or right
|
||||
* is granted directly or by implication, estoppel or otherwise;
|
||||
*
|
||||
* The above copyright and patent license is granted only if the following
|
||||
* conditions are met:
|
||||
*
|
||||
* 3. Conditions
|
||||
*
|
||||
* 3.1. Redistribution of Source with Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification with rights to further distribute source must include
|
||||
* the above Copyright Notice, the above License, this list of Conditions,
|
||||
* and the following Disclaimer and Export Compliance provision. In addition,
|
||||
* Licensee must cause all Covered Code to which Licensee contributes to
|
||||
* contain a file documenting the changes Licensee made to create that Covered
|
||||
* Code and the date of any change. Licensee must include in that file the
|
||||
* documentation of any changes made by any predecessor Licensee. Licensee
|
||||
* must include a prominent statement that the modification is derived,
|
||||
* directly or indirectly, from Original Intel Code.
|
||||
*
|
||||
* 3.2. Redistribution of Source with no Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification without rights to further distribute source must
|
||||
* include the following Disclaimer and Export Compliance provision in the
|
||||
* documentation and/or other materials provided with distribution. In
|
||||
* addition, Licensee may not authorize further sublicense of source of any
|
||||
* portion of the Covered Code, and must include terms to the effect that the
|
||||
* license from Licensee to its licensee is limited to the intellectual
|
||||
* property embodied in the software Licensee provides to its licensee, and
|
||||
* not to intellectual property embodied in modifications its licensee may
|
||||
* make.
|
||||
*
|
||||
* 3.3. Redistribution of Executable. Redistribution in executable form of any
|
||||
* substantial portion of the Covered Code or modification must reproduce the
|
||||
* above Copyright Notice, and the following Disclaimer and Export Compliance
|
||||
* provision in the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3.4. Intel retains all right, title, and interest in and to the Original
|
||||
* Intel Code.
|
||||
*
|
||||
* 3.5. Neither the name Intel nor any other trademark owned or controlled by
|
||||
* Intel shall be used in advertising or otherwise to promote the sale, use or
|
||||
* other dealings in products derived from or relating to the Covered Code
|
||||
* without prior written authorization from Intel.
|
||||
*
|
||||
* 4. Disclaimer and Export Compliance
|
||||
*
|
||||
* 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
|
||||
* HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
|
||||
* IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
|
||||
* INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
|
||||
* UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
|
||||
* PARTICULAR PURPOSE.
|
||||
*
|
||||
* 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
|
||||
* OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
|
||||
* COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
|
||||
* SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
|
||||
* CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
|
||||
* HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
|
||||
* SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
|
||||
* LIMITED REMEDY.
|
||||
*
|
||||
* 4.3. Licensee shall not export, either directly or indirectly, any of this
|
||||
* software or system incorporating such software without first obtaining any
|
||||
* required license or other approval from the U. S. Department of Commerce or
|
||||
* any other agency or department of the United States Government. In the
|
||||
* event Licensee exports any such software from the United States or
|
||||
* re-exports any such software from a foreign destination, Licensee shall
|
||||
* ensure that the distribution and export/re-export of the software is in
|
||||
* compliance with all laws, regulations, orders, or other restrictions of the
|
||||
* U.S. Export Administration Regulations. Licensee agrees that neither it nor
|
||||
* any of its subsidiaries will export/re-export any technical data, process,
|
||||
* software, or service, directly or indirectly, to any country for which the
|
||||
* United States government or any agency thereof requires an export license,
|
||||
* other governmental approval, or letter of assurance, without first obtaining
|
||||
* such license, approval or letter.
|
||||
*
|
||||
*****************************************************************************/
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef __AMLCODE_H__
|
||||
#define __AMLCODE_H__
|
||||
@@ -262,6 +190,15 @@
|
||||
#define AML_LNOTEQUAL_OP (UINT16) 0x9293
|
||||
|
||||
|
||||
/*
|
||||
* Opcodes for "Field" operators
|
||||
*/
|
||||
#define AML_FIELD_OFFSET_OP (UINT8) 0x00
|
||||
#define AML_FIELD_ACCESS_OP (UINT8) 0x01
|
||||
#define AML_FIELD_CONNECTION_OP (UINT8) 0x02 /* ACPI 5.0 */
|
||||
#define AML_FIELD_EXT_ACCESS_OP (UINT8) 0x03 /* ACPI 5.0 */
|
||||
|
||||
|
||||
/*
|
||||
* Internal opcodes
|
||||
* Use only "Unknown" AML opcodes, don't attempt to use
|
||||
@@ -276,7 +213,8 @@
|
||||
#define AML_INT_METHODCALL_OP (UINT16) 0x0035
|
||||
#define AML_INT_RETURN_VALUE_OP (UINT16) 0x0036
|
||||
#define AML_INT_EVAL_SUBTREE_OP (UINT16) 0x0037
|
||||
|
||||
#define AML_INT_CONNECTION_OP (UINT16) 0x0038
|
||||
#define AML_INT_EXTACCESSFIELD_OP (UINT16) 0x0039
|
||||
|
||||
#define ARG_NONE 0x0
|
||||
|
||||
@@ -474,24 +412,6 @@
|
||||
#define AML_CLASS_UNKNOWN 0x0A
|
||||
|
||||
|
||||
/* Predefined Operation Region SpaceIDs */
|
||||
|
||||
typedef enum
|
||||
{
|
||||
REGION_MEMORY = 0,
|
||||
REGION_IO,
|
||||
REGION_PCI_CONFIG,
|
||||
REGION_EC,
|
||||
REGION_SMBUS,
|
||||
REGION_CMOS,
|
||||
REGION_PCI_BAR,
|
||||
REGION_IPMI,
|
||||
REGION_DATA_TABLE, /* Internal use only */
|
||||
REGION_FIXED_HW = 0x7F
|
||||
|
||||
} AML_REGION_TYPES;
|
||||
|
||||
|
||||
/* Comparison operation codes for MatchOp operator */
|
||||
|
||||
typedef enum
|
||||
@@ -568,28 +488,25 @@ typedef enum
|
||||
*/
|
||||
typedef enum
|
||||
{
|
||||
AML_FIELD_ATTRIB_SMB_QUICK = 0x02,
|
||||
AML_FIELD_ATTRIB_SMB_SEND_RCV = 0x04,
|
||||
AML_FIELD_ATTRIB_SMB_BYTE = 0x06,
|
||||
AML_FIELD_ATTRIB_SMB_WORD = 0x08,
|
||||
AML_FIELD_ATTRIB_SMB_BLOCK = 0x0A,
|
||||
AML_FIELD_ATTRIB_SMB_WORD_CALL = 0x0C,
|
||||
AML_FIELD_ATTRIB_SMB_BLOCK_CALL = 0x0D
|
||||
AML_FIELD_ATTRIB_QUICK = 0x02,
|
||||
AML_FIELD_ATTRIB_SEND_RCV = 0x04,
|
||||
AML_FIELD_ATTRIB_BYTE = 0x06,
|
||||
AML_FIELD_ATTRIB_WORD = 0x08,
|
||||
AML_FIELD_ATTRIB_BLOCK = 0x0A,
|
||||
AML_FIELD_ATTRIB_MULTIBYTE = 0x0B,
|
||||
AML_FIELD_ATTRIB_WORD_CALL = 0x0C,
|
||||
AML_FIELD_ATTRIB_BLOCK_CALL = 0x0D,
|
||||
AML_FIELD_ATTRIB_RAW_BYTES = 0x0E,
|
||||
AML_FIELD_ATTRIB_RAW_PROCESS = 0x0F
|
||||
|
||||
} AML_ACCESS_ATTRIBUTE;
|
||||
|
||||
|
||||
/* Bit fields in MethodFlags byte */
|
||||
/* Bit fields in the AML MethodFlags byte */
|
||||
|
||||
#define AML_METHOD_ARG_COUNT 0x07
|
||||
#define AML_METHOD_SERIALIZED 0x08
|
||||
#define AML_METHOD_SYNC_LEVEL 0xF0
|
||||
|
||||
/* METHOD_FLAGS_ARG_COUNT is not used internally, define additional flags */
|
||||
|
||||
#define AML_METHOD_INTERNAL_ONLY 0x01
|
||||
#define AML_METHOD_RESERVED1 0x02
|
||||
#define AML_METHOD_RESERVED2 0x04
|
||||
|
||||
|
||||
#endif /* __AMLCODE_H__ */
|
||||
|
||||
@@ -1,118 +1,45 @@
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* Module Name: amlresrc.h - AML resource descriptors
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
|
||||
/*
|
||||
* Copyright (C) 2000 - 2014, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
* 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.
|
||||
*
|
||||
* 2.1. This is your license from Intel Corp. under its intellectual property
|
||||
* rights. You may have additional license terms from the party that provided
|
||||
* you this software, covering your right to use that party's intellectual
|
||||
* property rights.
|
||||
* 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.
|
||||
*
|
||||
* 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
|
||||
* copy of the source code appearing in this file ("Covered Code") an
|
||||
* irrevocable, perpetual, worldwide license under Intel's copyrights in the
|
||||
* base code distributed originally by Intel ("Original Intel Code") to copy,
|
||||
* make derivatives, distribute, use and display any portion of the Covered
|
||||
* Code in any form, with the right to sublicense such rights; and
|
||||
*
|
||||
* 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
|
||||
* license (with the right to sublicense), under only those claims of Intel
|
||||
* patents that are infringed by the Original Intel Code, to make, use, sell,
|
||||
* offer to sell, and import the Covered Code and derivative works thereof
|
||||
* solely to the minimum extent necessary to exercise the above copyright
|
||||
* license, and in no event shall the patent license extend to any additions
|
||||
* to or modifications of the Original Intel Code. No other license or right
|
||||
* is granted directly or by implication, estoppel or otherwise;
|
||||
*
|
||||
* The above copyright and patent license is granted only if the following
|
||||
* conditions are met:
|
||||
*
|
||||
* 3. Conditions
|
||||
*
|
||||
* 3.1. Redistribution of Source with Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification with rights to further distribute source must include
|
||||
* the above Copyright Notice, the above License, this list of Conditions,
|
||||
* and the following Disclaimer and Export Compliance provision. In addition,
|
||||
* Licensee must cause all Covered Code to which Licensee contributes to
|
||||
* contain a file documenting the changes Licensee made to create that Covered
|
||||
* Code and the date of any change. Licensee must include in that file the
|
||||
* documentation of any changes made by any predecessor Licensee. Licensee
|
||||
* must include a prominent statement that the modification is derived,
|
||||
* directly or indirectly, from Original Intel Code.
|
||||
*
|
||||
* 3.2. Redistribution of Source with no Rights to Further Distribute Source.
|
||||
* Redistribution of source code of any substantial portion of the Covered
|
||||
* Code or modification without rights to further distribute source must
|
||||
* include the following Disclaimer and Export Compliance provision in the
|
||||
* documentation and/or other materials provided with distribution. In
|
||||
* addition, Licensee may not authorize further sublicense of source of any
|
||||
* portion of the Covered Code, and must include terms to the effect that the
|
||||
* license from Licensee to its licensee is limited to the intellectual
|
||||
* property embodied in the software Licensee provides to its licensee, and
|
||||
* not to intellectual property embodied in modifications its licensee may
|
||||
* make.
|
||||
*
|
||||
* 3.3. Redistribution of Executable. Redistribution in executable form of any
|
||||
* substantial portion of the Covered Code or modification must reproduce the
|
||||
* above Copyright Notice, and the following Disclaimer and Export Compliance
|
||||
* provision in the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
*
|
||||
* 3.4. Intel retains all right, title, and interest in and to the Original
|
||||
* Intel Code.
|
||||
*
|
||||
* 3.5. Neither the name Intel nor any other trademark owned or controlled by
|
||||
* Intel shall be used in advertising or otherwise to promote the sale, use or
|
||||
* other dealings in products derived from or relating to the Covered Code
|
||||
* without prior written authorization from Intel.
|
||||
*
|
||||
* 4. Disclaimer and Export Compliance
|
||||
*
|
||||
* 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
|
||||
* HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
|
||||
* IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
|
||||
* INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
|
||||
* UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
|
||||
* IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
|
||||
* PARTICULAR PURPOSE.
|
||||
*
|
||||
* 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
|
||||
* OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
|
||||
* COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
|
||||
* SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
|
||||
* CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
|
||||
* HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
|
||||
* SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
|
||||
* LIMITED REMEDY.
|
||||
*
|
||||
* 4.3. Licensee shall not export, either directly or indirectly, any of this
|
||||
* software or system incorporating such software without first obtaining any
|
||||
* required license or other approval from the U. S. Department of Commerce or
|
||||
* any other agency or department of the United States Government. In the
|
||||
* event Licensee exports any such software from the United States or
|
||||
* re-exports any such software from a foreign destination, Licensee shall
|
||||
* ensure that the distribution and export/re-export of the software is in
|
||||
* compliance with all laws, regulations, orders, or other restrictions of the
|
||||
* U.S. Export Administration Regulations. Licensee agrees that neither it nor
|
||||
* any of its subsidiaries will export/re-export any technical data, process,
|
||||
* software, or service, directly or indirectly, to any country for which the
|
||||
* United States government or any agency thereof requires an export license,
|
||||
* other governmental approval, or letter of assurance, without first obtaining
|
||||
* such license, approval or letter.
|
||||
*
|
||||
*****************************************************************************/
|
||||
* 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.
|
||||
*/
|
||||
|
||||
/* acpisrc:StructDefs -- for acpisrc conversion */
|
||||
|
||||
@@ -131,29 +58,48 @@
|
||||
#define ACPI_RESTAG_TYPESPECIFICATTRIBUTES "_ATT"
|
||||
#define ACPI_RESTAG_BASEADDRESS "_BAS"
|
||||
#define ACPI_RESTAG_BUSMASTER "_BM_" /* Master(1), Slave(0) */
|
||||
#define ACPI_RESTAG_DEBOUNCETIME "_DBT"
|
||||
#define ACPI_RESTAG_DECODE "_DEC"
|
||||
#define ACPI_RESTAG_DEVICEPOLARITY "_DPL"
|
||||
#define ACPI_RESTAG_DMA "_DMA"
|
||||
#define ACPI_RESTAG_DMATYPE "_TYP" /* Compatible(0), A(1), B(2), F(3) */
|
||||
#define ACPI_RESTAG_DRIVESTRENGTH "_DRS"
|
||||
#define ACPI_RESTAG_ENDIANNESS "_END"
|
||||
#define ACPI_RESTAG_FLOWCONTROL "_FLC"
|
||||
#define ACPI_RESTAG_GRANULARITY "_GRA"
|
||||
#define ACPI_RESTAG_INTERRUPT "_INT"
|
||||
#define ACPI_RESTAG_INTERRUPTLEVEL "_LL_" /* ActiveLo(1), ActiveHi(0) */
|
||||
#define ACPI_RESTAG_INTERRUPTSHARE "_SHR" /* Shareable(1), NoShare(0) */
|
||||
#define ACPI_RESTAG_INTERRUPTTYPE "_HE_" /* Edge(1), Level(0) */
|
||||
#define ACPI_RESTAG_IORESTRICTION "_IOR"
|
||||
#define ACPI_RESTAG_LENGTH "_LEN"
|
||||
#define ACPI_RESTAG_LINE "_LIN"
|
||||
#define ACPI_RESTAG_MEMATTRIBUTES "_MTP" /* Memory(0), Reserved(1), ACPI(2), NVS(3) */
|
||||
#define ACPI_RESTAG_MEMTYPE "_MEM" /* NonCache(0), Cacheable(1) Cache+combine(2), Cache+prefetch(3) */
|
||||
#define ACPI_RESTAG_MAXADDR "_MAX"
|
||||
#define ACPI_RESTAG_MINADDR "_MIN"
|
||||
#define ACPI_RESTAG_MAXTYPE "_MAF"
|
||||
#define ACPI_RESTAG_MINTYPE "_MIF"
|
||||
#define ACPI_RESTAG_MODE "_MOD"
|
||||
#define ACPI_RESTAG_PARITY "_PAR"
|
||||
#define ACPI_RESTAG_PHASE "_PHA"
|
||||
#define ACPI_RESTAG_PIN "_PIN"
|
||||
#define ACPI_RESTAG_PINCONFIG "_PPI"
|
||||
#define ACPI_RESTAG_POLARITY "_POL"
|
||||
#define ACPI_RESTAG_REGISTERBITOFFSET "_RBO"
|
||||
#define ACPI_RESTAG_REGISTERBITWIDTH "_RBW"
|
||||
#define ACPI_RESTAG_RANGETYPE "_RNG"
|
||||
#define ACPI_RESTAG_READWRITETYPE "_RW_" /* ReadOnly(0), Writeable (1) */
|
||||
#define ACPI_RESTAG_LENGTH_RX "_RXL"
|
||||
#define ACPI_RESTAG_LENGTH_TX "_TXL"
|
||||
#define ACPI_RESTAG_SLAVEMODE "_SLV"
|
||||
#define ACPI_RESTAG_SPEED "_SPE"
|
||||
#define ACPI_RESTAG_STOPBITS "_STB"
|
||||
#define ACPI_RESTAG_TRANSLATION "_TRA"
|
||||
#define ACPI_RESTAG_TRANSTYPE "_TRS" /* Sparse(1), Dense(0) */
|
||||
#define ACPI_RESTAG_TYPE "_TTP" /* Translation(1), Static (0) */
|
||||
#define ACPI_RESTAG_XFERTYPE "_SIZ" /* 8(0), 8And16(1), 16(2) */
|
||||
#define ACPI_RESTAG_VENDORDATA "_VEN"
|
||||
|
||||
|
||||
/* Default sizes for "small" resource descriptors */
|
||||
@@ -164,6 +110,7 @@
|
||||
#define ASL_RDESC_END_DEPEND_SIZE 0x00
|
||||
#define ASL_RDESC_IO_SIZE 0x07
|
||||
#define ASL_RDESC_FIXED_IO_SIZE 0x03
|
||||
#define ASL_RDESC_FIXED_DMA_SIZE 0x05
|
||||
#define ASL_RDESC_END_TAG_SIZE 0x01
|
||||
|
||||
|
||||
@@ -175,6 +122,14 @@ typedef struct asl_resource_node
|
||||
|
||||
} ASL_RESOURCE_NODE;
|
||||
|
||||
typedef struct asl_resource_info
|
||||
{
|
||||
ACPI_PARSE_OBJECT *DescriptorTypeOp; /* Resource descriptor parse node */
|
||||
ACPI_PARSE_OBJECT *MappingOp; /* Used for mapfile support */
|
||||
UINT32 CurrentByteOffset; /* Offset in resource template */
|
||||
|
||||
} ASL_RESOURCE_INFO;
|
||||
|
||||
|
||||
/* Macros used to generate AML resource length fields */
|
||||
|
||||
@@ -286,6 +241,16 @@ typedef struct aml_resource_end_tag
|
||||
} AML_RESOURCE_END_TAG;
|
||||
|
||||
|
||||
typedef struct aml_resource_fixed_dma
|
||||
{
|
||||
AML_RESOURCE_SMALL_HEADER_COMMON
|
||||
UINT16 RequestLines;
|
||||
UINT16 Channels;
|
||||
UINT8 Width;
|
||||
|
||||
} AML_RESOURCE_FIXED_DMA;
|
||||
|
||||
|
||||
/*
|
||||
* LARGE descriptors
|
||||
*/
|
||||
@@ -440,6 +405,130 @@ typedef struct aml_resource_generic_register
|
||||
|
||||
} AML_RESOURCE_GENERIC_REGISTER;
|
||||
|
||||
|
||||
/* Common descriptor for GpioInt and GpioIo (ACPI 5.0) */
|
||||
|
||||
typedef struct aml_resource_gpio
|
||||
{
|
||||
AML_RESOURCE_LARGE_HEADER_COMMON
|
||||
UINT8 RevisionId;
|
||||
UINT8 ConnectionType;
|
||||
UINT16 Flags;
|
||||
UINT16 IntFlags;
|
||||
UINT8 PinConfig;
|
||||
UINT16 DriveStrength;
|
||||
UINT16 DebounceTimeout;
|
||||
UINT16 PinTableOffset;
|
||||
UINT8 ResSourceIndex;
|
||||
UINT16 ResSourceOffset;
|
||||
UINT16 VendorOffset;
|
||||
UINT16 VendorLength;
|
||||
/*
|
||||
* Optional fields follow immediately:
|
||||
* 1) PIN list (Words)
|
||||
* 2) Resource Source String
|
||||
* 3) Vendor Data bytes
|
||||
*/
|
||||
|
||||
} AML_RESOURCE_GPIO;
|
||||
|
||||
#define AML_RESOURCE_GPIO_REVISION 1 /* ACPI 5.0 */
|
||||
|
||||
/* Values for ConnectionType above */
|
||||
|
||||
#define AML_RESOURCE_GPIO_TYPE_INT 0
|
||||
#define AML_RESOURCE_GPIO_TYPE_IO 1
|
||||
#define AML_RESOURCE_MAX_GPIOTYPE 1
|
||||
|
||||
|
||||
/* Common preamble for all serial descriptors (ACPI 5.0) */
|
||||
|
||||
#define AML_RESOURCE_SERIAL_COMMON \
|
||||
UINT8 RevisionId; \
|
||||
UINT8 ResSourceIndex; \
|
||||
UINT8 Type; \
|
||||
UINT8 Flags; \
|
||||
UINT16 TypeSpecificFlags; \
|
||||
UINT8 TypeRevisionId; \
|
||||
UINT16 TypeDataLength; \
|
||||
|
||||
/* Values for the type field above */
|
||||
|
||||
#define AML_RESOURCE_I2C_SERIALBUSTYPE 1
|
||||
#define AML_RESOURCE_SPI_SERIALBUSTYPE 2
|
||||
#define AML_RESOURCE_UART_SERIALBUSTYPE 3
|
||||
#define AML_RESOURCE_MAX_SERIALBUSTYPE 3
|
||||
#define AML_RESOURCE_VENDOR_SERIALBUSTYPE 192 /* Vendor defined is 0xC0-0xFF (NOT SUPPORTED) */
|
||||
|
||||
typedef struct aml_resource_common_serialbus
|
||||
{
|
||||
AML_RESOURCE_LARGE_HEADER_COMMON
|
||||
AML_RESOURCE_SERIAL_COMMON
|
||||
|
||||
} AML_RESOURCE_COMMON_SERIALBUS;
|
||||
|
||||
typedef struct aml_resource_i2c_serialbus
|
||||
{
|
||||
AML_RESOURCE_LARGE_HEADER_COMMON
|
||||
AML_RESOURCE_SERIAL_COMMON
|
||||
UINT32 ConnectionSpeed;
|
||||
UINT16 SlaveAddress;
|
||||
/*
|
||||
* Optional fields follow immediately:
|
||||
* 1) Vendor Data bytes
|
||||
* 2) Resource Source String
|
||||
*/
|
||||
|
||||
} AML_RESOURCE_I2C_SERIALBUS;
|
||||
|
||||
#define AML_RESOURCE_I2C_REVISION 1 /* ACPI 5.0 */
|
||||
#define AML_RESOURCE_I2C_TYPE_REVISION 1 /* ACPI 5.0 */
|
||||
#define AML_RESOURCE_I2C_MIN_DATA_LEN 6
|
||||
|
||||
typedef struct aml_resource_spi_serialbus
|
||||
{
|
||||
AML_RESOURCE_LARGE_HEADER_COMMON
|
||||
AML_RESOURCE_SERIAL_COMMON
|
||||
UINT32 ConnectionSpeed;
|
||||
UINT8 DataBitLength;
|
||||
UINT8 ClockPhase;
|
||||
UINT8 ClockPolarity;
|
||||
UINT16 DeviceSelection;
|
||||
/*
|
||||
* Optional fields follow immediately:
|
||||
* 1) Vendor Data bytes
|
||||
* 2) Resource Source String
|
||||
*/
|
||||
|
||||
} AML_RESOURCE_SPI_SERIALBUS;
|
||||
|
||||
#define AML_RESOURCE_SPI_REVISION 1 /* ACPI 5.0 */
|
||||
#define AML_RESOURCE_SPI_TYPE_REVISION 1 /* ACPI 5.0 */
|
||||
#define AML_RESOURCE_SPI_MIN_DATA_LEN 9
|
||||
|
||||
|
||||
typedef struct aml_resource_uart_serialbus
|
||||
{
|
||||
AML_RESOURCE_LARGE_HEADER_COMMON
|
||||
AML_RESOURCE_SERIAL_COMMON
|
||||
UINT32 DefaultBaudRate;
|
||||
UINT16 RxFifoSize;
|
||||
UINT16 TxFifoSize;
|
||||
UINT8 Parity;
|
||||
UINT8 LinesEnabled;
|
||||
/*
|
||||
* Optional fields follow immediately:
|
||||
* 1) Vendor Data bytes
|
||||
* 2) Resource Source String
|
||||
*/
|
||||
|
||||
} AML_RESOURCE_UART_SERIALBUS;
|
||||
|
||||
#define AML_RESOURCE_UART_REVISION 1 /* ACPI 5.0 */
|
||||
#define AML_RESOURCE_UART_TYPE_REVISION 1 /* ACPI 5.0 */
|
||||
#define AML_RESOURCE_UART_MIN_DATA_LEN 10
|
||||
|
||||
|
||||
/* restore default alignment */
|
||||
|
||||
#pragma pack()
|
||||
@@ -462,6 +551,7 @@ typedef union aml_resource
|
||||
AML_RESOURCE_END_DEPENDENT EndDpf;
|
||||
AML_RESOURCE_IO Io;
|
||||
AML_RESOURCE_FIXED_IO FixedIo;
|
||||
AML_RESOURCE_FIXED_DMA FixedDma;
|
||||
AML_RESOURCE_VENDOR_SMALL VendorSmall;
|
||||
AML_RESOURCE_END_TAG EndTag;
|
||||
|
||||
@@ -477,6 +567,11 @@ typedef union aml_resource
|
||||
AML_RESOURCE_ADDRESS64 Address64;
|
||||
AML_RESOURCE_EXTENDED_ADDRESS64 ExtAddress64;
|
||||
AML_RESOURCE_EXTENDED_IRQ ExtendedIrq;
|
||||
AML_RESOURCE_GPIO Gpio;
|
||||
AML_RESOURCE_I2C_SERIALBUS I2cSerialBus;
|
||||
AML_RESOURCE_SPI_SERIALBUS SpiSerialBus;
|
||||
AML_RESOURCE_UART_SERIALBUS UartSerialBus;
|
||||
AML_RESOURCE_COMMON_SERIALBUS CommonSerialBus;
|
||||
|
||||
/* Utility overlays */
|
||||
|
||||
@@ -487,5 +582,50 @@ typedef union aml_resource
|
||||
|
||||
} AML_RESOURCE;
|
||||
|
||||
#endif
|
||||
|
||||
/* Interfaces used by both the disassembler and compiler */
|
||||
|
||||
void
|
||||
MpSaveGpioInfo (
|
||||
ACPI_PARSE_OBJECT *Op,
|
||||
AML_RESOURCE *Resource,
|
||||
UINT32 PinCount,
|
||||
UINT16 *PinList,
|
||||
char *DeviceName);
|
||||
|
||||
void
|
||||
MpSaveSerialInfo (
|
||||
ACPI_PARSE_OBJECT *Op,
|
||||
AML_RESOURCE *Resource,
|
||||
char *DeviceName);
|
||||
|
||||
char *
|
||||
MpGetHidFromParseTree (
|
||||
ACPI_NAMESPACE_NODE *HidNode);
|
||||
|
||||
char *
|
||||
MpGetHidViaNamestring (
|
||||
char *DeviceName);
|
||||
|
||||
char *
|
||||
MpGetConnectionInfo (
|
||||
ACPI_PARSE_OBJECT *Op,
|
||||
UINT32 PinIndex,
|
||||
ACPI_NAMESPACE_NODE **TargetNode,
|
||||
char **TargetName);
|
||||
|
||||
char *
|
||||
MpGetParentDeviceHid (
|
||||
ACPI_PARSE_OBJECT *Op,
|
||||
ACPI_NAMESPACE_NODE **TargetNode,
|
||||
char **ParentDeviceName);
|
||||
|
||||
char *
|
||||
MpGetDdnValue (
|
||||
char *DeviceName);
|
||||
|
||||
char *
|
||||
MpGetHidValue (
|
||||
ACPI_NAMESPACE_NODE *DeviceNode);
|
||||
|
||||
#endif
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user