mirror of
https://github.com/reactos/reactos.git
synced 2025-04-27 09:00:27 +00:00
[ACPICA]
- Update to version 20150930 CORE-10509 #resolve svn path=/trunk/; revision=69870
This commit is contained in:
parent
eb779cd089
commit
04d16609e0
137 changed files with 5482 additions and 1660 deletions
|
@ -10,6 +10,7 @@ endif()
|
|||
list(APPEND ACPICA_SOURCE
|
||||
acpica/dispatcher/dsargs.c
|
||||
acpica/dispatcher/dscontrol.c
|
||||
acpica/dispatcher/dsdebug.c
|
||||
acpica/dispatcher/dsfield.c
|
||||
acpica/dispatcher/dsinit.c
|
||||
acpica/dispatcher/dsmethod.c
|
||||
|
@ -146,6 +147,7 @@ list(APPEND ACPICA_SOURCE
|
|||
acpica/utilities/utmath.c
|
||||
acpica/utilities/utmisc.c
|
||||
acpica/utilities/utmutex.c
|
||||
acpica/utilities/utnonansi.c
|
||||
acpica/utilities/utobject.c
|
||||
acpica/utilities/utosi.c
|
||||
acpica/utilities/utownerid.c
|
||||
|
|
|
@ -166,7 +166,7 @@ AcpiDsExecuteArguments (
|
|||
|
||||
/* Allocate a new parser op to be the root of the parsed tree */
|
||||
|
||||
Op = AcpiPsAllocOp (AML_INT_EVAL_SUBTREE_OP);
|
||||
Op = AcpiPsAllocOp (AML_INT_EVAL_SUBTREE_OP, AmlStart);
|
||||
if (!Op)
|
||||
{
|
||||
return_ACPI_STATUS (AE_NO_MEMORY);
|
||||
|
@ -213,7 +213,7 @@ AcpiDsExecuteArguments (
|
|||
|
||||
/* Evaluate the deferred arguments */
|
||||
|
||||
Op = AcpiPsAllocOp (AML_INT_EVAL_SUBTREE_OP);
|
||||
Op = AcpiPsAllocOp (AML_INT_EVAL_SUBTREE_OP, AmlStart);
|
||||
if (!Op)
|
||||
{
|
||||
return_ACPI_STATUS (AE_NO_MEMORY);
|
||||
|
|
|
@ -293,7 +293,7 @@ AcpiDsExecEndControlOp (
|
|||
* loop does not implement a timeout.
|
||||
*/
|
||||
ControlState->Control.LoopCount++;
|
||||
if (ControlState->Control.LoopCount > ACPI_MAX_LOOP_ITERATIONS)
|
||||
if (ControlState->Control.LoopCount > AcpiGbl_MaxLoopIterations)
|
||||
{
|
||||
Status = AE_AML_INFINITE_LOOP;
|
||||
break;
|
||||
|
|
321
reactos/drivers/bus/acpi/acpica/dispatcher/dsdebug.c
Normal file
321
reactos/drivers/bus/acpi/acpica/dispatcher/dsdebug.c
Normal file
|
@ -0,0 +1,321 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* Module Name: dsdebug - Parser/Interpreter interface - debugging
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2015, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
#include "acpi.h"
|
||||
#include "accommon.h"
|
||||
#include "acdispat.h"
|
||||
#include "acnamesp.h"
|
||||
#include "acdisasm.h"
|
||||
#include "acinterp.h"
|
||||
|
||||
|
||||
#define _COMPONENT ACPI_DISPATCHER
|
||||
ACPI_MODULE_NAME ("dsdebug")
|
||||
|
||||
|
||||
#if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER)
|
||||
|
||||
/* Local prototypes */
|
||||
|
||||
static void
|
||||
AcpiDsPrintNodePathname (
|
||||
ACPI_NAMESPACE_NODE *Node,
|
||||
const char *Message);
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiDsPrintNodePathname
|
||||
*
|
||||
* PARAMETERS: Node - Object
|
||||
* Message - Prefix message
|
||||
*
|
||||
* DESCRIPTION: Print an object's full namespace pathname
|
||||
* Manages allocation/freeing of a pathname buffer
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
static void
|
||||
AcpiDsPrintNodePathname (
|
||||
ACPI_NAMESPACE_NODE *Node,
|
||||
const char *Message)
|
||||
{
|
||||
ACPI_BUFFER Buffer;
|
||||
ACPI_STATUS Status;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE (DsPrintNodePathname);
|
||||
|
||||
if (!Node)
|
||||
{
|
||||
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_DISPATCH, "[NULL NAME]"));
|
||||
return_VOID;
|
||||
}
|
||||
|
||||
/* Convert handle to full pathname and print it (with supplied message) */
|
||||
|
||||
Buffer.Length = ACPI_ALLOCATE_LOCAL_BUFFER;
|
||||
|
||||
Status = AcpiNsHandleToPathname (Node, &Buffer, TRUE);
|
||||
if (ACPI_SUCCESS (Status))
|
||||
{
|
||||
if (Message)
|
||||
{
|
||||
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_DISPATCH, "%s ", Message));
|
||||
}
|
||||
|
||||
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_DISPATCH, "[%s] (Node %p)",
|
||||
(char *) Buffer.Pointer, Node));
|
||||
ACPI_FREE (Buffer.Pointer);
|
||||
}
|
||||
|
||||
return_VOID;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiDsDumpMethodStack
|
||||
*
|
||||
* PARAMETERS: Status - Method execution status
|
||||
* WalkState - Current state of the parse tree walk
|
||||
* Op - Executing parse op
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Called when a method has been aborted because of an error.
|
||||
* Dumps the method execution stack.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
void
|
||||
AcpiDsDumpMethodStack (
|
||||
ACPI_STATUS Status,
|
||||
ACPI_WALK_STATE *WalkState,
|
||||
ACPI_PARSE_OBJECT *Op)
|
||||
{
|
||||
ACPI_PARSE_OBJECT *Next;
|
||||
ACPI_THREAD_STATE *Thread;
|
||||
ACPI_WALK_STATE *NextWalkState;
|
||||
ACPI_NAMESPACE_NODE *PreviousMethod = NULL;
|
||||
ACPI_OPERAND_OBJECT *MethodDesc;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE (DsDumpMethodStack);
|
||||
|
||||
/* Ignore control codes, they are not errors */
|
||||
|
||||
if ((Status & AE_CODE_MASK) == AE_CODE_CONTROL)
|
||||
{
|
||||
return_VOID;
|
||||
}
|
||||
|
||||
/* We may be executing a deferred opcode */
|
||||
|
||||
if (WalkState->DeferredNode)
|
||||
{
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
|
||||
"Executing subtree for Buffer/Package/Region\n"));
|
||||
return_VOID;
|
||||
}
|
||||
|
||||
/*
|
||||
* If there is no Thread, we are not actually executing a method.
|
||||
* This can happen when the iASL compiler calls the interpreter
|
||||
* to perform constant folding.
|
||||
*/
|
||||
Thread = WalkState->Thread;
|
||||
if (!Thread)
|
||||
{
|
||||
return_VOID;
|
||||
}
|
||||
|
||||
/* Display exception and method name */
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
|
||||
"\n**** Exception %s during execution of method ",
|
||||
AcpiFormatException (Status)));
|
||||
AcpiDsPrintNodePathname (WalkState->MethodNode, NULL);
|
||||
|
||||
/* Display stack of executing methods */
|
||||
|
||||
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_DISPATCH,
|
||||
"\n\nMethod Execution Stack:\n"));
|
||||
NextWalkState = Thread->WalkStateList;
|
||||
|
||||
/* Walk list of linked walk states */
|
||||
|
||||
while (NextWalkState)
|
||||
{
|
||||
MethodDesc = NextWalkState->MethodDesc;
|
||||
if (MethodDesc)
|
||||
{
|
||||
AcpiExStopTraceMethod (
|
||||
(ACPI_NAMESPACE_NODE *) MethodDesc->Method.Node,
|
||||
MethodDesc, WalkState);
|
||||
}
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH,
|
||||
" Method [%4.4s] executing: ",
|
||||
AcpiUtGetNodeName (NextWalkState->MethodNode)));
|
||||
|
||||
/* First method is the currently executing method */
|
||||
|
||||
if (NextWalkState == WalkState)
|
||||
{
|
||||
if (Op)
|
||||
{
|
||||
/* Display currently executing ASL statement */
|
||||
|
||||
Next = Op->Common.Next;
|
||||
Op->Common.Next = NULL;
|
||||
|
||||
#ifdef ACPI_DISASSEMBLER
|
||||
AcpiDmDisassemble (NextWalkState, Op, ACPI_UINT32_MAX);
|
||||
#endif
|
||||
Op->Common.Next = Next;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
/*
|
||||
* This method has called another method
|
||||
* NOTE: the method call parse subtree is already deleted at this
|
||||
* point, so we cannot disassemble the method invocation.
|
||||
*/
|
||||
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_DISPATCH, "Call to method "));
|
||||
AcpiDsPrintNodePathname (PreviousMethod, NULL);
|
||||
}
|
||||
|
||||
PreviousMethod = NextWalkState->MethodNode;
|
||||
NextWalkState = NextWalkState->Next;
|
||||
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_DISPATCH, "\n"));
|
||||
}
|
||||
|
||||
return_VOID;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
void
|
||||
AcpiDsDumpMethodStack (
|
||||
ACPI_STATUS Status,
|
||||
ACPI_WALK_STATE *WalkState,
|
||||
ACPI_PARSE_OBJECT *Op)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
#endif
|
|
@ -602,7 +602,7 @@ AcpiDsCreateField (
|
|||
}
|
||||
}
|
||||
|
||||
ACPI_MEMSET (&Info, 0, sizeof (ACPI_CREATE_FIELD_INFO));
|
||||
memset (&Info, 0, sizeof (ACPI_CREATE_FIELD_INFO));
|
||||
|
||||
/* Second arg is the field flags */
|
||||
|
||||
|
|
|
@ -296,7 +296,7 @@ AcpiDsInitializeObjects (
|
|||
|
||||
/* Set all init info to zero */
|
||||
|
||||
ACPI_MEMSET (&Info, 0, sizeof (ACPI_INIT_WALK_INFO));
|
||||
memset (&Info, 0, sizeof (ACPI_INIT_WALK_INFO));
|
||||
|
||||
Info.OwnerId = OwnerId;
|
||||
Info.TableIndex = TableIndex;
|
||||
|
@ -327,10 +327,19 @@ AcpiDsInitializeObjects (
|
|||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
/* DSDT is always the first AML table */
|
||||
|
||||
if (ACPI_COMPARE_NAME (Table->Signature, ACPI_SIG_DSDT))
|
||||
{
|
||||
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INIT, "\nInitializing Namespace objects:\n"));
|
||||
}
|
||||
|
||||
/* Summary of objects initialized */
|
||||
|
||||
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_INIT,
|
||||
"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,
|
||||
"Table [%4.4s:%8.8s] (id %.2X) - %4u Objects with %3u Devices, "
|
||||
"%3u Regions, %4u Methods (%u/%u/%u Serial/Non/Cvt)\n",
|
||||
Table->Signature, Table->OemTableId, OwnerId, Info.ObjectCount, Info.DeviceCount,
|
||||
Info.OpRegionCount, Info.MethodCount, Info.SerialMethodCount,
|
||||
Info.NonSerialMethodCount, Info.SerializedMethodCount));
|
||||
|
||||
|
|
|
@ -118,9 +118,9 @@
|
|||
#include "acdispat.h"
|
||||
#include "acinterp.h"
|
||||
#include "acnamesp.h"
|
||||
#include "acdisasm.h"
|
||||
#include "acparser.h"
|
||||
#include "amlcode.h"
|
||||
#include "acdebug.h"
|
||||
|
||||
|
||||
#define _COMPONENT ACPI_DISPATCHER
|
||||
|
@ -181,7 +181,7 @@ AcpiDsAutoSerializeMethod (
|
|||
|
||||
/* Create/Init a root op for the method parse tree */
|
||||
|
||||
Op = AcpiPsAllocOp (AML_METHOD_OP);
|
||||
Op = AcpiPsAllocOp (AML_METHOD_OP, ObjDesc->Method.AmlStart);
|
||||
if (!Op)
|
||||
{
|
||||
return_ACPI_STATUS (AE_NO_MEMORY);
|
||||
|
@ -195,6 +195,7 @@ AcpiDsAutoSerializeMethod (
|
|||
WalkState = AcpiDsCreateWalkState (Node->OwnerId, NULL, NULL, NULL);
|
||||
if (!WalkState)
|
||||
{
|
||||
AcpiPsFreeOp (Op);
|
||||
return_ACPI_STATUS (AE_NO_MEMORY);
|
||||
}
|
||||
|
||||
|
@ -203,6 +204,7 @@ AcpiDsAutoSerializeMethod (
|
|||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
AcpiDsDeleteWalkState (WalkState);
|
||||
AcpiPsFreeOp (Op);
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
|
@ -211,10 +213,6 @@ AcpiDsAutoSerializeMethod (
|
|||
/* 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);
|
||||
|
@ -287,7 +285,7 @@ AcpiDsDetectNamedOpcodes (
|
|||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Called on method error. Invoke the global exception handler if
|
||||
* present, dump the method data if the disassembler is configured
|
||||
* present, dump the method data if the debugger is configured
|
||||
*
|
||||
* Note: Allows the exception handler to change the status code
|
||||
*
|
||||
|
@ -298,6 +296,9 @@ AcpiDsMethodError (
|
|||
ACPI_STATUS Status,
|
||||
ACPI_WALK_STATE *WalkState)
|
||||
{
|
||||
UINT32 AmlOffset;
|
||||
|
||||
|
||||
ACPI_FUNCTION_ENTRY ();
|
||||
|
||||
|
||||
|
@ -321,23 +322,28 @@ AcpiDsMethodError (
|
|||
* Handler can map the exception code to anything it wants, including
|
||||
* AE_OK, in which case the executing method will not be aborted.
|
||||
*/
|
||||
AmlOffset = (UINT32) ACPI_PTR_DIFF (WalkState->Aml,
|
||||
WalkState->ParserState.AmlStart);
|
||||
|
||||
Status = AcpiGbl_ExceptionHandler (Status,
|
||||
WalkState->MethodNode ?
|
||||
WalkState->MethodNode->Name.Integer : 0,
|
||||
WalkState->Opcode, WalkState->AmlOffset, NULL);
|
||||
WalkState->Opcode, AmlOffset, NULL);
|
||||
AcpiExEnterInterpreter ();
|
||||
}
|
||||
|
||||
AcpiDsClearImplicitReturn (WalkState);
|
||||
|
||||
#ifdef ACPI_DISASSEMBLER
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
/* Display method locals/args if disassembler is present */
|
||||
AcpiDsDumpMethodStack (Status, WalkState, WalkState->Op);
|
||||
|
||||
AcpiDmDumpMethodInfo (Status, WalkState, WalkState->Op);
|
||||
}
|
||||
/* Display method locals/args if debugger is present */
|
||||
|
||||
#ifdef ACPI_DEBUGGER
|
||||
AcpiDbDumpMethodInfo (Status, WalkState);
|
||||
#endif
|
||||
}
|
||||
|
||||
return (Status);
|
||||
}
|
||||
|
@ -423,6 +429,8 @@ AcpiDsBeginMethodExecution (
|
|||
return_ACPI_STATUS (AE_NULL_ENTRY);
|
||||
}
|
||||
|
||||
AcpiExStartTraceMethod (MethodNode, ObjDesc, WalkState);
|
||||
|
||||
/* Prevent wraparound of thread count */
|
||||
|
||||
if (ObjDesc->Method.ThreadCount == ACPI_UINT8_MAX)
|
||||
|
@ -684,10 +692,7 @@ Cleanup:
|
|||
/* On error, we must terminate the method properly */
|
||||
|
||||
AcpiDsTerminateControlMethod (ObjDesc, NextWalkState);
|
||||
if (NextWalkState)
|
||||
{
|
||||
AcpiDsDeleteWalkState (NextWalkState);
|
||||
}
|
||||
AcpiDsDeleteWalkState (NextWalkState);
|
||||
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
@ -944,5 +949,8 @@ AcpiDsTerminateControlMethod (
|
|||
}
|
||||
}
|
||||
|
||||
AcpiExStopTraceMethod ((ACPI_NAMESPACE_NODE *) MethodDesc->Method.Node,
|
||||
MethodDesc, WalkState);
|
||||
|
||||
return_VOID;
|
||||
}
|
||||
|
|
|
@ -420,7 +420,7 @@ AcpiDsBuildInternalBufferObj (
|
|||
|
||||
if (ByteList)
|
||||
{
|
||||
ACPI_MEMCPY (ObjDesc->Buffer.Pointer, ByteList->Named.Data,
|
||||
memcpy (ObjDesc->Buffer.Pointer, ByteList->Named.Data,
|
||||
ByteListLength);
|
||||
}
|
||||
}
|
||||
|
@ -847,7 +847,7 @@ AcpiDsInitObjectFromOp (
|
|||
case ACPI_TYPE_STRING:
|
||||
|
||||
ObjDesc->String.Pointer = Op->Common.Value.String;
|
||||
ObjDesc->String.Length = (UINT32) ACPI_STRLEN (Op->Common.Value.String);
|
||||
ObjDesc->String.Length = (UINT32) strlen (Op->Common.Value.String);
|
||||
|
||||
/*
|
||||
* The string is contained in the ACPI table, don't ever try
|
||||
|
|
|
@ -585,8 +585,8 @@ AcpiDsEvalTableRegionOperands (
|
|||
ACPI_OPERAND_OBJECT **Operand;
|
||||
ACPI_NAMESPACE_NODE *Node;
|
||||
ACPI_PARSE_OBJECT *NextOp;
|
||||
UINT32 TableIndex;
|
||||
ACPI_TABLE_HEADER *Table;
|
||||
UINT32 TableIndex;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE_PTR (DsEvalTableRegionOperands, Op);
|
||||
|
@ -612,6 +612,8 @@ AcpiDsEvalTableRegionOperands (
|
|||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
Operand = &WalkState->Operands[0];
|
||||
|
||||
/*
|
||||
* Resolve the Signature string, OemId string,
|
||||
* and OemTableId string operands
|
||||
|
@ -620,49 +622,57 @@ AcpiDsEvalTableRegionOperands (
|
|||
ACPI_WALK_OPERANDS, WalkState);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return_ACPI_STATUS (Status);
|
||||
goto Cleanup;
|
||||
}
|
||||
|
||||
Operand = &WalkState->Operands[0];
|
||||
|
||||
/* Find the ACPI table */
|
||||
|
||||
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))
|
||||
{
|
||||
return_ACPI_STATUS (Status);
|
||||
if (Status == AE_NOT_FOUND)
|
||||
{
|
||||
ACPI_ERROR ((AE_INFO,
|
||||
"ACPI Table [%4.4s] OEM:(%s, %s) not found in RSDT/XSDT",
|
||||
Operand[0]->String.Pointer,
|
||||
Operand[1]->String.Pointer,
|
||||
Operand[2]->String.Pointer));
|
||||
}
|
||||
goto Cleanup;
|
||||
}
|
||||
|
||||
AcpiUtRemoveReference (Operand[0]);
|
||||
AcpiUtRemoveReference (Operand[1]);
|
||||
AcpiUtRemoveReference (Operand[2]);
|
||||
|
||||
Status = AcpiGetTableByIndex (TableIndex, &Table);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return_ACPI_STATUS (Status);
|
||||
goto Cleanup;
|
||||
}
|
||||
|
||||
ObjDesc = AcpiNsGetAttachedObject (Node);
|
||||
if (!ObjDesc)
|
||||
{
|
||||
return_ACPI_STATUS (AE_NOT_EXIST);
|
||||
Status = AE_NOT_EXIST;
|
||||
goto Cleanup;
|
||||
}
|
||||
|
||||
ObjDesc->Region.Address = ACPI_PTR_TO_PHYSADDR (Table);
|
||||
ObjDesc->Region.Length = Table->Length;
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "RgnObj %p Addr %8.8X%8.8X Len %X\n",
|
||||
ObjDesc,
|
||||
ACPI_FORMAT_UINT64 (ObjDesc->Region.Address),
|
||||
ObjDesc, ACPI_FORMAT_UINT64 (ObjDesc->Region.Address),
|
||||
ObjDesc->Region.Length));
|
||||
|
||||
/* Now the address and length are valid for this opregion */
|
||||
|
||||
ObjDesc->Region.Flags |= AOPOBJ_DATA_VALID;
|
||||
|
||||
Cleanup:
|
||||
AcpiUtRemoveReference (Operand[0]);
|
||||
AcpiUtRemoveReference (Operand[1]);
|
||||
AcpiUtRemoveReference (Operand[2]);
|
||||
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
|
|
|
@ -677,7 +677,7 @@ AcpiDsCreateOperand (
|
|||
|
||||
ObjDesc = AcpiUtCreateStringObject ((ACPI_SIZE) NameLength);
|
||||
|
||||
ACPI_STRNCPY (ObjDesc->String.Pointer, NameString, NameLength);
|
||||
strncpy (ObjDesc->String.Pointer, NameString, NameLength);
|
||||
Status = AE_OK;
|
||||
}
|
||||
else
|
||||
|
|
|
@ -397,9 +397,18 @@ AcpiDsLoad1BeginOp (
|
|||
if ((WalkState->Opcode != AML_SCOPE_OP) &&
|
||||
(!(WalkState->ParseFlags & ACPI_PARSE_DEFERRED_OP)))
|
||||
{
|
||||
Flags |= ACPI_NS_ERROR_IF_FOUND;
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "[%s] Cannot already exist\n",
|
||||
AcpiUtGetTypeName (ObjectType)));
|
||||
if (WalkState->NamespaceOverride)
|
||||
{
|
||||
Flags |= ACPI_NS_OVERRIDE_IF_FOUND;
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "[%s] Override allowed\n",
|
||||
AcpiUtGetTypeName (ObjectType)));
|
||||
}
|
||||
else
|
||||
{
|
||||
Flags |= ACPI_NS_ERROR_IF_FOUND;
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_DISPATCH, "[%s] Cannot already exist\n",
|
||||
AcpiUtGetTypeName (ObjectType)));
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -461,7 +470,7 @@ AcpiDsLoad1BeginOp (
|
|||
{
|
||||
/* Create a new op */
|
||||
|
||||
Op = AcpiPsAllocOp (WalkState->Opcode);
|
||||
Op = AcpiPsAllocOp (WalkState->Opcode, WalkState->Aml);
|
||||
if (!Op)
|
||||
{
|
||||
return_ACPI_STATUS (AE_NO_MEMORY);
|
||||
|
|
|
@ -416,7 +416,7 @@ AcpiDsLoad2BeginOp (
|
|||
{
|
||||
/* Create a new op */
|
||||
|
||||
Op = AcpiPsAllocOp (WalkState->Opcode);
|
||||
Op = AcpiPsAllocOp (WalkState->Opcode, WalkState->Aml);
|
||||
if (!Op)
|
||||
{
|
||||
return_ACPI_STATUS (AE_NO_MEMORY);
|
||||
|
|
|
@ -176,6 +176,7 @@ AcpiEvUpdateGpeEnableMask (
|
|||
{
|
||||
ACPI_SET_BIT (GpeRegisterInfo->EnableForRun, (UINT8) RegisterBit);
|
||||
}
|
||||
GpeRegisterInfo->EnableMask = GpeRegisterInfo->EnableForRun;
|
||||
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
}
|
||||
|
@ -213,7 +214,7 @@ AcpiEvEnableGpe (
|
|||
|
||||
/* Enable the requested GPE */
|
||||
|
||||
Status = AcpiHwLowSetGpe (GpeEventInfo, ACPI_GPE_ENABLE_SAVE);
|
||||
Status = AcpiHwLowSetGpe (GpeEventInfo, ACPI_GPE_ENABLE);
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
|
@ -303,7 +304,7 @@ AcpiEvRemoveGpeReference (
|
|||
Status = AcpiEvUpdateGpeEnableMask (GpeEventInfo);
|
||||
if (ACPI_SUCCESS (Status))
|
||||
{
|
||||
Status = AcpiHwLowSetGpe (GpeEventInfo, ACPI_GPE_DISABLE_SAVE);
|
||||
Status = AcpiHwLowSetGpe (GpeEventInfo, ACPI_GPE_DISABLE);
|
||||
}
|
||||
|
||||
if (ACPI_FAILURE (Status))
|
||||
|
|
|
@ -467,7 +467,7 @@ AcpiEvMatchGpeMethod (
|
|||
|
||||
/* 4) The last two characters of the name are the hex GPE Number */
|
||||
|
||||
GpeNumber = ACPI_STRTOUL (&Name[2], NULL, 16);
|
||||
GpeNumber = strtoul (&Name[2], NULL, 16);
|
||||
if (GpeNumber == ACPI_UINT32_MAX)
|
||||
{
|
||||
/* Conversion failed; invalid method, just ignore it */
|
||||
|
|
|
@ -732,10 +732,17 @@ AcpiEvExecuteRegMethods (
|
|||
ACPI_ADR_SPACE_TYPE SpaceId)
|
||||
{
|
||||
ACPI_STATUS Status;
|
||||
ACPI_REG_WALK_INFO Info;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE (EvExecuteRegMethods);
|
||||
|
||||
Info.SpaceId = SpaceId;
|
||||
Info.RegRunCount = 0;
|
||||
|
||||
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_NAMES,
|
||||
" Running _REG methods for SpaceId %s\n",
|
||||
AcpiUtGetRegionName (Info.SpaceId)));
|
||||
|
||||
/*
|
||||
* Run all _REG methods for all Operation Regions for this space ID. This
|
||||
|
@ -744,8 +751,7 @@ AcpiEvExecuteRegMethods (
|
|||
* regions of this Space ID before we can run any _REG methods)
|
||||
*/
|
||||
Status = AcpiNsWalkNamespace (ACPI_TYPE_ANY, Node, ACPI_UINT32_MAX,
|
||||
ACPI_NS_WALK_UNLOCK, AcpiEvRegRun, NULL,
|
||||
&SpaceId, NULL);
|
||||
ACPI_NS_WALK_UNLOCK, AcpiEvRegRun, NULL, &Info, NULL);
|
||||
|
||||
/* Special case for EC: handle "orphan" _REG methods with no region */
|
||||
|
||||
|
@ -754,6 +760,10 @@ AcpiEvExecuteRegMethods (
|
|||
AcpiEvOrphanEcRegMethod (Node);
|
||||
}
|
||||
|
||||
ACPI_DEBUG_PRINT_RAW ((ACPI_DB_NAMES,
|
||||
" Executed %u _REG methods for SpaceId %s\n",
|
||||
Info.RegRunCount, AcpiUtGetRegionName (Info.SpaceId)));
|
||||
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
|
@ -777,11 +787,11 @@ AcpiEvRegRun (
|
|||
{
|
||||
ACPI_OPERAND_OBJECT *ObjDesc;
|
||||
ACPI_NAMESPACE_NODE *Node;
|
||||
ACPI_ADR_SPACE_TYPE SpaceId;
|
||||
ACPI_STATUS Status;
|
||||
ACPI_REG_WALK_INFO *Info;
|
||||
|
||||
|
||||
SpaceId = *ACPI_CAST_PTR (ACPI_ADR_SPACE_TYPE, Context);
|
||||
Info = ACPI_CAST_PTR (ACPI_REG_WALK_INFO, Context);
|
||||
|
||||
/* Convert and validate the device handle */
|
||||
|
||||
|
@ -813,13 +823,14 @@ AcpiEvRegRun (
|
|||
|
||||
/* Object is a Region */
|
||||
|
||||
if (ObjDesc->Region.SpaceId != SpaceId)
|
||||
if (ObjDesc->Region.SpaceId != Info->SpaceId)
|
||||
{
|
||||
/* This region is for a different address space, just ignore it */
|
||||
|
||||
return (AE_OK);
|
||||
}
|
||||
|
||||
Info->RegRunCount++;
|
||||
Status = AcpiEvExecuteRegMethod (ObjDesc, ACPI_REG_CONNECT);
|
||||
return (Status);
|
||||
}
|
||||
|
|
|
@ -251,15 +251,6 @@ AcpiExLoadTableOp (
|
|||
ACPI_FUNCTION_TRACE (ExLoadTableOp);
|
||||
|
||||
|
||||
/* 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_AML_STRING_LIMIT);
|
||||
}
|
||||
|
||||
/* Find the ACPI table in the RSDT/XSDT */
|
||||
|
||||
Status = AcpiTbFindTable (
|
||||
|
@ -588,7 +579,7 @@ AcpiExLoadOp (
|
|||
return_ACPI_STATUS (AE_NO_MEMORY);
|
||||
}
|
||||
|
||||
ACPI_MEMCPY (Table, TableHeader, Length);
|
||||
memcpy (Table, TableHeader, Length);
|
||||
break;
|
||||
|
||||
default:
|
||||
|
|
|
@ -323,7 +323,7 @@ AcpiExConvertToBuffer (
|
|||
/* Copy the integer to the buffer, LSB first */
|
||||
|
||||
NewBuf = ReturnDesc->Buffer.Pointer;
|
||||
ACPI_MEMCPY (NewBuf,
|
||||
memcpy (NewBuf,
|
||||
&ObjDesc->Integer.Value,
|
||||
AcpiGbl_IntegerByteWidth);
|
||||
break;
|
||||
|
@ -348,7 +348,7 @@ AcpiExConvertToBuffer (
|
|||
/* Copy the string to the buffer */
|
||||
|
||||
NewBuf = ReturnDesc->Buffer.Pointer;
|
||||
ACPI_STRNCPY ((char *) NewBuf, (char *) ObjDesc->String.Pointer,
|
||||
strncpy ((char *) NewBuf, (char *) ObjDesc->String.Pointer,
|
||||
ObjDesc->String.Length);
|
||||
break;
|
||||
|
||||
|
@ -745,6 +745,7 @@ AcpiExConvertToTargetType (
|
|||
break;
|
||||
|
||||
case ARGI_TARGETREF:
|
||||
case ARGI_STORE_TARGET:
|
||||
|
||||
switch (DestinationType)
|
||||
{
|
||||
|
|
|
@ -599,6 +599,7 @@ AcpiExCreateMethod (
|
|||
|
||||
ObjDesc->Method.AmlStart = AmlStart;
|
||||
ObjDesc->Method.AmlLength = AmlLength;
|
||||
ObjDesc->Method.Node = Operand[0];
|
||||
|
||||
/*
|
||||
* Disassemble the method flags. Split off the ArgCount, Serialized
|
||||
|
|
|
@ -115,13 +115,26 @@
|
|||
|
||||
#include "acpi.h"
|
||||
#include "accommon.h"
|
||||
#include "acnamesp.h"
|
||||
#include "acinterp.h"
|
||||
#include "acparser.h"
|
||||
|
||||
|
||||
#define _COMPONENT ACPI_EXECUTER
|
||||
ACPI_MODULE_NAME ("exdebug")
|
||||
|
||||
|
||||
static ACPI_OPERAND_OBJECT *AcpiGbl_TraceMethodObject = NULL;
|
||||
|
||||
/* Local prototypes */
|
||||
|
||||
#ifdef ACPI_DEBUG_OUTPUT
|
||||
static const char *
|
||||
AcpiExGetTraceEventName (
|
||||
ACPI_TRACE_EVENT_TYPE Type);
|
||||
#endif
|
||||
|
||||
|
||||
#ifndef ACPI_NO_ERROR_MESSAGES
|
||||
/*******************************************************************************
|
||||
*
|
||||
|
@ -153,6 +166,8 @@ AcpiExDoDebugObject (
|
|||
{
|
||||
UINT32 i;
|
||||
UINT32 Timer;
|
||||
ACPI_OPERAND_OBJECT *ObjectDesc;
|
||||
UINT32 Value;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE_PTR (ExDoDebugObject, SourceDesc);
|
||||
|
@ -339,8 +354,37 @@ AcpiExDoDebugObject (
|
|||
}
|
||||
else
|
||||
{
|
||||
AcpiExDoDebugObject (SourceDesc->Reference.Object,
|
||||
Level+4, 0);
|
||||
ObjectDesc = SourceDesc->Reference.Object;
|
||||
Value = SourceDesc->Reference.Value;
|
||||
|
||||
switch (ObjectDesc->Common.Type)
|
||||
{
|
||||
case ACPI_TYPE_BUFFER:
|
||||
|
||||
AcpiOsPrintf ("Buffer[%u] = 0x%2.2X\n",
|
||||
Value, *SourceDesc->Reference.IndexPointer);
|
||||
break;
|
||||
|
||||
case ACPI_TYPE_STRING:
|
||||
|
||||
AcpiOsPrintf ("String[%u] = \"%c\" (0x%2.2X)\n",
|
||||
Value, *SourceDesc->Reference.IndexPointer,
|
||||
*SourceDesc->Reference.IndexPointer);
|
||||
break;
|
||||
|
||||
case ACPI_TYPE_PACKAGE:
|
||||
|
||||
AcpiOsPrintf ("Package[%u] = ", Value);
|
||||
AcpiExDoDebugObject (*SourceDesc->Reference.Where,
|
||||
Level+4, 0);
|
||||
break;
|
||||
|
||||
default:
|
||||
|
||||
AcpiOsPrintf ("Unknown Reference object type %X\n",
|
||||
ObjectDesc->Common.Type);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
@ -355,3 +399,362 @@ AcpiExDoDebugObject (
|
|||
return_VOID;
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiExInterpreterTraceEnabled
|
||||
*
|
||||
* PARAMETERS: Name - Whether method name should be matched,
|
||||
* this should be checked before starting
|
||||
* the tracer
|
||||
*
|
||||
* RETURN: TRUE if interpreter trace is enabled.
|
||||
*
|
||||
* DESCRIPTION: Check whether interpreter trace is enabled
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
static BOOLEAN
|
||||
AcpiExInterpreterTraceEnabled (
|
||||
char *Name)
|
||||
{
|
||||
|
||||
/* Check if tracing is enabled */
|
||||
|
||||
if (!(AcpiGbl_TraceFlags & ACPI_TRACE_ENABLED))
|
||||
{
|
||||
return (FALSE);
|
||||
}
|
||||
|
||||
/*
|
||||
* Check if tracing is filtered:
|
||||
*
|
||||
* 1. If the tracer is started, AcpiGbl_TraceMethodObject should have
|
||||
* been filled by the trace starter
|
||||
* 2. If the tracer is not started, AcpiGbl_TraceMethodName should be
|
||||
* matched if it is specified
|
||||
* 3. If the tracer is oneshot style, AcpiGbl_TraceMethodName should
|
||||
* not be cleared by the trace stopper during the first match
|
||||
*/
|
||||
if (AcpiGbl_TraceMethodObject)
|
||||
{
|
||||
return (TRUE);
|
||||
}
|
||||
if (Name &&
|
||||
(AcpiGbl_TraceMethodName &&
|
||||
strcmp (AcpiGbl_TraceMethodName, Name)))
|
||||
{
|
||||
return (FALSE);
|
||||
}
|
||||
if ((AcpiGbl_TraceFlags & ACPI_TRACE_ONESHOT) &&
|
||||
!AcpiGbl_TraceMethodName)
|
||||
{
|
||||
return (FALSE);
|
||||
}
|
||||
|
||||
return (TRUE);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiExGetTraceEventName
|
||||
*
|
||||
* PARAMETERS: Type - Trace event type
|
||||
*
|
||||
* RETURN: Trace event name.
|
||||
*
|
||||
* DESCRIPTION: Used to obtain the full trace event name.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
#ifdef ACPI_DEBUG_OUTPUT
|
||||
|
||||
static const char *
|
||||
AcpiExGetTraceEventName (
|
||||
ACPI_TRACE_EVENT_TYPE Type)
|
||||
{
|
||||
switch (Type)
|
||||
{
|
||||
case ACPI_TRACE_AML_METHOD:
|
||||
|
||||
return "Method";
|
||||
|
||||
case ACPI_TRACE_AML_OPCODE:
|
||||
|
||||
return "Opcode";
|
||||
|
||||
case ACPI_TRACE_AML_REGION:
|
||||
|
||||
return "Region";
|
||||
|
||||
default:
|
||||
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiExTracePoint
|
||||
*
|
||||
* PARAMETERS: Type - Trace event type
|
||||
* Begin - TRUE if before execution
|
||||
* Aml - Executed AML address
|
||||
* Pathname - Object path
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Internal interpreter execution trace.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
void
|
||||
AcpiExTracePoint (
|
||||
ACPI_TRACE_EVENT_TYPE Type,
|
||||
BOOLEAN Begin,
|
||||
UINT8 *Aml,
|
||||
char *Pathname)
|
||||
{
|
||||
|
||||
ACPI_FUNCTION_NAME (ExTracePoint);
|
||||
|
||||
|
||||
if (Pathname)
|
||||
{
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_TRACE_POINT,
|
||||
"%s %s [0x%p:%s] execution.\n",
|
||||
AcpiExGetTraceEventName (Type), Begin ? "Begin" : "End",
|
||||
Aml, Pathname));
|
||||
}
|
||||
else
|
||||
{
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_TRACE_POINT,
|
||||
"%s %s [0x%p] execution.\n",
|
||||
AcpiExGetTraceEventName (Type), Begin ? "Begin" : "End",
|
||||
Aml));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiExStartTraceMethod
|
||||
*
|
||||
* PARAMETERS: MethodNode - Node of the method
|
||||
* ObjDesc - The method object
|
||||
* WalkState - current state, NULL if not yet executing
|
||||
* a method.
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Start control method execution trace
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
void
|
||||
AcpiExStartTraceMethod (
|
||||
ACPI_NAMESPACE_NODE *MethodNode,
|
||||
ACPI_OPERAND_OBJECT *ObjDesc,
|
||||
ACPI_WALK_STATE *WalkState)
|
||||
{
|
||||
ACPI_STATUS Status;
|
||||
char *Pathname = NULL;
|
||||
BOOLEAN Enabled = FALSE;
|
||||
|
||||
|
||||
ACPI_FUNCTION_NAME (ExStartTraceMethod);
|
||||
|
||||
|
||||
if (MethodNode)
|
||||
{
|
||||
Pathname = AcpiNsGetNormalizedPathname (MethodNode, TRUE);
|
||||
}
|
||||
|
||||
Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
goto Exit;
|
||||
}
|
||||
|
||||
Enabled = AcpiExInterpreterTraceEnabled (Pathname);
|
||||
if (Enabled && !AcpiGbl_TraceMethodObject)
|
||||
{
|
||||
AcpiGbl_TraceMethodObject = ObjDesc;
|
||||
AcpiGbl_OriginalDbgLevel = AcpiDbgLevel;
|
||||
AcpiGbl_OriginalDbgLayer = AcpiDbgLayer;
|
||||
AcpiDbgLevel = ACPI_TRACE_LEVEL_ALL;
|
||||
AcpiDbgLayer = ACPI_TRACE_LAYER_ALL;
|
||||
|
||||
if (AcpiGbl_TraceDbgLevel)
|
||||
{
|
||||
AcpiDbgLevel = AcpiGbl_TraceDbgLevel;
|
||||
}
|
||||
if (AcpiGbl_TraceDbgLayer)
|
||||
{
|
||||
AcpiDbgLayer = AcpiGbl_TraceDbgLayer;
|
||||
}
|
||||
}
|
||||
(void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
|
||||
|
||||
Exit:
|
||||
if (Enabled)
|
||||
{
|
||||
ACPI_TRACE_POINT (ACPI_TRACE_AML_METHOD, TRUE,
|
||||
ObjDesc ? ObjDesc->Method.AmlStart : NULL, Pathname);
|
||||
}
|
||||
if (Pathname)
|
||||
{
|
||||
ACPI_FREE (Pathname);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiExStopTraceMethod
|
||||
*
|
||||
* PARAMETERS: MethodNode - Node of the method
|
||||
* ObjDesc - The method object
|
||||
* WalkState - current state, NULL if not yet executing
|
||||
* a method.
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Stop control method execution trace
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
void
|
||||
AcpiExStopTraceMethod (
|
||||
ACPI_NAMESPACE_NODE *MethodNode,
|
||||
ACPI_OPERAND_OBJECT *ObjDesc,
|
||||
ACPI_WALK_STATE *WalkState)
|
||||
{
|
||||
ACPI_STATUS Status;
|
||||
char *Pathname = NULL;
|
||||
BOOLEAN Enabled;
|
||||
|
||||
|
||||
ACPI_FUNCTION_NAME (ExStopTraceMethod);
|
||||
|
||||
|
||||
if (MethodNode)
|
||||
{
|
||||
Pathname = AcpiNsGetNormalizedPathname (MethodNode, TRUE);
|
||||
}
|
||||
|
||||
Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
goto ExitPath;
|
||||
}
|
||||
|
||||
Enabled = AcpiExInterpreterTraceEnabled (NULL);
|
||||
|
||||
(void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
|
||||
|
||||
if (Enabled)
|
||||
{
|
||||
ACPI_TRACE_POINT (ACPI_TRACE_AML_METHOD, FALSE,
|
||||
ObjDesc ? ObjDesc->Method.AmlStart : NULL, Pathname);
|
||||
}
|
||||
|
||||
Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
goto ExitPath;
|
||||
}
|
||||
|
||||
/* Check whether the tracer should be stopped */
|
||||
|
||||
if (AcpiGbl_TraceMethodObject == ObjDesc)
|
||||
{
|
||||
/* Disable further tracing if type is one-shot */
|
||||
|
||||
if (AcpiGbl_TraceFlags & ACPI_TRACE_ONESHOT)
|
||||
{
|
||||
AcpiGbl_TraceMethodName = NULL;
|
||||
}
|
||||
|
||||
AcpiDbgLevel = AcpiGbl_OriginalDbgLevel;
|
||||
AcpiDbgLayer = AcpiGbl_OriginalDbgLayer;
|
||||
AcpiGbl_TraceMethodObject = NULL;
|
||||
}
|
||||
|
||||
(void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
|
||||
|
||||
ExitPath:
|
||||
if (Pathname)
|
||||
{
|
||||
ACPI_FREE (Pathname);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiExStartTraceOpcode
|
||||
*
|
||||
* PARAMETERS: Op - The parser opcode object
|
||||
* WalkState - current state, NULL if not yet executing
|
||||
* a method.
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Start opcode execution trace
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
void
|
||||
AcpiExStartTraceOpcode (
|
||||
ACPI_PARSE_OBJECT *Op,
|
||||
ACPI_WALK_STATE *WalkState)
|
||||
{
|
||||
|
||||
ACPI_FUNCTION_NAME (ExStartTraceOpcode);
|
||||
|
||||
|
||||
if (AcpiExInterpreterTraceEnabled (NULL) &&
|
||||
(AcpiGbl_TraceFlags & ACPI_TRACE_OPCODE))
|
||||
{
|
||||
ACPI_TRACE_POINT (ACPI_TRACE_AML_OPCODE, TRUE,
|
||||
Op->Common.Aml, Op->Common.AmlOpName);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiExStopTraceOpcode
|
||||
*
|
||||
* PARAMETERS: Op - The parser opcode object
|
||||
* WalkState - current state, NULL if not yet executing
|
||||
* a method.
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Stop opcode execution trace
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
void
|
||||
AcpiExStopTraceOpcode (
|
||||
ACPI_PARSE_OBJECT *Op,
|
||||
ACPI_WALK_STATE *WalkState)
|
||||
{
|
||||
|
||||
ACPI_FUNCTION_NAME (ExStopTraceOpcode);
|
||||
|
||||
|
||||
if (AcpiExInterpreterTraceEnabled (NULL) &&
|
||||
(AcpiGbl_TraceFlags & ACPI_TRACE_OPCODE))
|
||||
{
|
||||
ACPI_TRACE_POINT (ACPI_TRACE_AML_OPCODE, FALSE,
|
||||
Op->Common.Aml, Op->Common.AmlOpName);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -310,7 +310,7 @@ static ACPI_EXDUMP_INFO AcpiExDumpIndexField[5] =
|
|||
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (IndexField.DataObj), "Data Object"}
|
||||
};
|
||||
|
||||
static ACPI_EXDUMP_INFO AcpiExDumpReference[8] =
|
||||
static ACPI_EXDUMP_INFO AcpiExDumpReference[9] =
|
||||
{
|
||||
{ACPI_EXD_INIT, ACPI_EXD_TABLE_SIZE (AcpiExDumpReference), NULL},
|
||||
{ACPI_EXD_UINT8, ACPI_EXD_OFFSET (Reference.Class), "Class"},
|
||||
|
@ -319,6 +319,7 @@ static ACPI_EXDUMP_INFO AcpiExDumpReference[8] =
|
|||
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Reference.Object), "Object Desc"},
|
||||
{ACPI_EXD_NODE, ACPI_EXD_OFFSET (Reference.Node), "Node"},
|
||||
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Reference.Where), "Where"},
|
||||
{ACPI_EXD_POINTER, ACPI_EXD_OFFSET (Reference.IndexPointer), "Index Pointer"},
|
||||
{ACPI_EXD_REFERENCE,0, NULL}
|
||||
};
|
||||
|
||||
|
@ -1110,7 +1111,8 @@ AcpiExDumpReferenceObj (
|
|||
{
|
||||
AcpiOsPrintf (" %p ", ObjDesc->Reference.Node);
|
||||
|
||||
Status = AcpiNsHandleToPathname (ObjDesc->Reference.Node, &RetBuf);
|
||||
Status = AcpiNsHandleToPathname (ObjDesc->Reference.Node,
|
||||
&RetBuf, TRUE);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
AcpiOsPrintf (" Could not convert name to pathname\n");
|
||||
|
@ -1125,16 +1127,18 @@ AcpiExDumpReferenceObj (
|
|||
{
|
||||
if (ACPI_GET_DESCRIPTOR_TYPE (ObjDesc) == ACPI_DESC_TYPE_OPERAND)
|
||||
{
|
||||
AcpiOsPrintf (" Target: %p", ObjDesc->Reference.Object);
|
||||
AcpiOsPrintf ("%22s %p", "Target :",
|
||||
ObjDesc->Reference.Object);
|
||||
if (ObjDesc->Reference.Class == ACPI_REFCLASS_TABLE)
|
||||
{
|
||||
AcpiOsPrintf (" Table Index: %X\n", ObjDesc->Reference.Value);
|
||||
AcpiOsPrintf (" Table Index: %X\n",
|
||||
ObjDesc->Reference.Value);
|
||||
}
|
||||
else
|
||||
{
|
||||
AcpiOsPrintf (" Target: %p [%s]\n", ObjDesc->Reference.Object,
|
||||
AcpiOsPrintf (" [%s]\n",
|
||||
AcpiUtGetTypeName (((ACPI_OPERAND_OBJECT *)
|
||||
ObjDesc->Reference.Object)->Common.Type));
|
||||
ObjDesc->Reference.Object)->Common.Type));
|
||||
}
|
||||
}
|
||||
else
|
||||
|
|
|
@ -532,7 +532,7 @@ AcpiExWriteDataToField (
|
|||
}
|
||||
|
||||
Buffer = BufferDesc->Buffer.Pointer;
|
||||
ACPI_MEMCPY (Buffer, SourceDesc->Buffer.Pointer, Length);
|
||||
memcpy (Buffer, SourceDesc->Buffer.Pointer, Length);
|
||||
|
||||
/* Lock entire transaction if requested */
|
||||
|
||||
|
|
|
@ -528,7 +528,7 @@ AcpiExFieldDatumIo (
|
|||
* Copy the data from the source buffer.
|
||||
* Length is the field width in bytes.
|
||||
*/
|
||||
ACPI_MEMCPY (Value,
|
||||
memcpy (Value,
|
||||
(ObjDesc->BufferField.BufferObj)->Buffer.Pointer +
|
||||
ObjDesc->BufferField.BaseByteOffset +
|
||||
FieldDatumByteOffset,
|
||||
|
@ -540,7 +540,7 @@ AcpiExFieldDatumIo (
|
|||
* Copy the data to the target buffer.
|
||||
* Length is the field width in bytes.
|
||||
*/
|
||||
ACPI_MEMCPY ((ObjDesc->BufferField.BufferObj)->Buffer.Pointer +
|
||||
memcpy ((ObjDesc->BufferField.BufferObj)->Buffer.Pointer +
|
||||
ObjDesc->BufferField.BaseByteOffset +
|
||||
FieldDatumByteOffset,
|
||||
Value, ObjDesc->CommonField.AccessByteWidth);
|
||||
|
@ -820,7 +820,7 @@ AcpiExExtractFromField (
|
|||
return_ACPI_STATUS (AE_BUFFER_OVERFLOW);
|
||||
}
|
||||
|
||||
ACPI_MEMSET (Buffer, 0, BufferLength);
|
||||
memset (Buffer, 0, BufferLength);
|
||||
AccessBitWidth = ACPI_MUL_8 (ObjDesc->CommonField.AccessByteWidth);
|
||||
|
||||
/* Handle the simple case here */
|
||||
|
@ -837,7 +837,7 @@ AcpiExExtractFromField (
|
|||
/* Use RawDatum (UINT64) to handle buffers < 64 bits */
|
||||
|
||||
Status = AcpiExFieldDatumIo (ObjDesc, 0, &RawDatum, ACPI_READ);
|
||||
ACPI_MEMCPY (Buffer, &RawDatum, BufferLength);
|
||||
memcpy (Buffer, &RawDatum, BufferLength);
|
||||
}
|
||||
|
||||
return_ACPI_STATUS (Status);
|
||||
|
@ -907,7 +907,7 @@ AcpiExExtractFromField (
|
|||
|
||||
/* Write merged datum to target buffer */
|
||||
|
||||
ACPI_MEMCPY (((char *) Buffer) + BufferOffset, &MergedDatum,
|
||||
memcpy (((char *) Buffer) + BufferOffset, &MergedDatum,
|
||||
ACPI_MIN(ObjDesc->CommonField.AccessByteWidth,
|
||||
BufferLength - BufferOffset));
|
||||
|
||||
|
@ -925,7 +925,7 @@ AcpiExExtractFromField (
|
|||
|
||||
/* Write the last datum to the buffer */
|
||||
|
||||
ACPI_MEMCPY (((char *) Buffer) + BufferOffset, &MergedDatum,
|
||||
memcpy (((char *) Buffer) + BufferOffset, &MergedDatum,
|
||||
ACPI_MIN(ObjDesc->CommonField.AccessByteWidth,
|
||||
BufferLength - BufferOffset));
|
||||
|
||||
|
@ -998,7 +998,7 @@ AcpiExInsertIntoField (
|
|||
* at Byte zero. All unused (upper) bytes of the
|
||||
* buffer will be 0.
|
||||
*/
|
||||
ACPI_MEMCPY ((char *) NewBuffer, (char *) Buffer, BufferLength);
|
||||
memcpy ((char *) NewBuffer, (char *) Buffer, BufferLength);
|
||||
Buffer = NewBuffer;
|
||||
BufferLength = RequiredLength;
|
||||
}
|
||||
|
@ -1041,7 +1041,7 @@ AcpiExInsertIntoField (
|
|||
|
||||
/* Get initial Datum from the input buffer */
|
||||
|
||||
ACPI_MEMCPY (&RawDatum, Buffer,
|
||||
memcpy (&RawDatum, Buffer,
|
||||
ACPI_MIN(ObjDesc->CommonField.AccessByteWidth,
|
||||
BufferLength - BufferOffset));
|
||||
|
||||
|
@ -1093,7 +1093,7 @@ AcpiExInsertIntoField (
|
|||
/* Get the next input datum from the buffer */
|
||||
|
||||
BufferOffset += ObjDesc->CommonField.AccessByteWidth;
|
||||
ACPI_MEMCPY (&RawDatum, ((char *) Buffer) + BufferOffset,
|
||||
memcpy (&RawDatum, ((char *) Buffer) + BufferOffset,
|
||||
ACPI_MIN(ObjDesc->CommonField.AccessByteWidth,
|
||||
BufferLength - BufferOffset));
|
||||
|
||||
|
|
|
@ -298,8 +298,8 @@ AcpiExConcatTemplate (
|
|||
* EndTag descriptor is copied from Operand1.
|
||||
*/
|
||||
NewBuf = ReturnDesc->Buffer.Pointer;
|
||||
ACPI_MEMCPY (NewBuf, Operand0->Buffer.Pointer, Length0);
|
||||
ACPI_MEMCPY (NewBuf + Length0, Operand1->Buffer.Pointer, Length1);
|
||||
memcpy (NewBuf, Operand0->Buffer.Pointer, Length0);
|
||||
memcpy (NewBuf + Length0, Operand1->Buffer.Pointer, Length1);
|
||||
|
||||
/* Insert EndTag and set the checksum to zero, means "ignore checksum" */
|
||||
|
||||
|
@ -413,12 +413,12 @@ AcpiExDoConcatenate (
|
|||
|
||||
/* Copy the first integer, LSB first */
|
||||
|
||||
ACPI_MEMCPY (NewBuf, &Operand0->Integer.Value,
|
||||
memcpy (NewBuf, &Operand0->Integer.Value,
|
||||
AcpiGbl_IntegerByteWidth);
|
||||
|
||||
/* Copy the second integer (LSB first) after the first */
|
||||
|
||||
ACPI_MEMCPY (NewBuf + AcpiGbl_IntegerByteWidth,
|
||||
memcpy (NewBuf + AcpiGbl_IntegerByteWidth,
|
||||
&LocalOperand1->Integer.Value,
|
||||
AcpiGbl_IntegerByteWidth);
|
||||
break;
|
||||
|
@ -440,8 +440,8 @@ AcpiExDoConcatenate (
|
|||
|
||||
/* Concatenate the strings */
|
||||
|
||||
ACPI_STRCPY (NewBuf, Operand0->String.Pointer);
|
||||
ACPI_STRCPY (NewBuf + Operand0->String.Length,
|
||||
strcpy (NewBuf, Operand0->String.Pointer);
|
||||
strcpy (NewBuf + Operand0->String.Length,
|
||||
LocalOperand1->String.Pointer);
|
||||
break;
|
||||
|
||||
|
@ -462,9 +462,9 @@ AcpiExDoConcatenate (
|
|||
|
||||
/* Concatenate the buffers */
|
||||
|
||||
ACPI_MEMCPY (NewBuf, Operand0->Buffer.Pointer,
|
||||
memcpy (NewBuf, Operand0->Buffer.Pointer,
|
||||
Operand0->Buffer.Length);
|
||||
ACPI_MEMCPY (NewBuf + Operand0->Buffer.Length,
|
||||
memcpy (NewBuf + Operand0->Buffer.Length,
|
||||
LocalOperand1->Buffer.Pointer,
|
||||
LocalOperand1->Buffer.Length);
|
||||
break;
|
||||
|
@ -785,7 +785,7 @@ AcpiExDoLogicalOp (
|
|||
|
||||
/* Lexicographic compare: compare the data bytes */
|
||||
|
||||
Compare = ACPI_MEMCMP (Operand0->Buffer.Pointer,
|
||||
Compare = memcmp (Operand0->Buffer.Pointer,
|
||||
LocalOperand1->Buffer.Pointer,
|
||||
(Length0 > Length1) ? Length1 : Length0);
|
||||
|
||||
|
|
|
@ -293,7 +293,7 @@ AcpiExNameSegment (
|
|||
|
||||
if (NameString)
|
||||
{
|
||||
ACPI_STRCAT (NameString, CharBuf);
|
||||
strcat (NameString, CharBuf);
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_NAMES,
|
||||
"Appended to - %s\n", NameString));
|
||||
}
|
||||
|
|
|
@ -440,7 +440,7 @@ AcpiExOpcode_2A_1T_1R (
|
|||
* Copy the raw buffer data with no transform.
|
||||
* (NULL terminated already)
|
||||
*/
|
||||
ACPI_MEMCPY (ReturnDesc->String.Pointer,
|
||||
memcpy (ReturnDesc->String.Pointer,
|
||||
Operand[0]->Buffer.Pointer, Length);
|
||||
break;
|
||||
|
||||
|
@ -484,6 +484,8 @@ AcpiExOpcode_2A_1T_1R (
|
|||
}
|
||||
|
||||
ReturnDesc->Reference.TargetType = ACPI_TYPE_BUFFER_FIELD;
|
||||
ReturnDesc->Reference.IndexPointer =
|
||||
&(Operand[0]->Buffer.Pointer [Index]);
|
||||
break;
|
||||
|
||||
case ACPI_TYPE_BUFFER:
|
||||
|
@ -495,6 +497,8 @@ AcpiExOpcode_2A_1T_1R (
|
|||
}
|
||||
|
||||
ReturnDesc->Reference.TargetType = ACPI_TYPE_BUFFER_FIELD;
|
||||
ReturnDesc->Reference.IndexPointer =
|
||||
&(Operand[0]->Buffer.Pointer [Index]);
|
||||
break;
|
||||
|
||||
case ACPI_TYPE_PACKAGE:
|
||||
|
@ -506,7 +510,8 @@ AcpiExOpcode_2A_1T_1R (
|
|||
}
|
||||
|
||||
ReturnDesc->Reference.TargetType = ACPI_TYPE_PACKAGE;
|
||||
ReturnDesc->Reference.Where = &Operand[0]->Package.Elements [Index];
|
||||
ReturnDesc->Reference.Where =
|
||||
&Operand[0]->Package.Elements [Index];
|
||||
break;
|
||||
|
||||
default:
|
||||
|
|
|
@ -334,7 +334,7 @@ AcpiExOpcode_3A_1T_1R (
|
|||
{
|
||||
/* We have a buffer, copy the portion requested */
|
||||
|
||||
ACPI_MEMCPY (Buffer, Operand[0]->String.Pointer + Index,
|
||||
memcpy (Buffer, Operand[0]->String.Pointer + Index,
|
||||
Length);
|
||||
}
|
||||
|
||||
|
|
|
@ -630,13 +630,13 @@ AcpiExDataTableSpaceHandler (
|
|||
{
|
||||
case ACPI_READ:
|
||||
|
||||
ACPI_MEMCPY (ACPI_CAST_PTR (char, Value), ACPI_PHYSADDR_TO_PTR (Address),
|
||||
memcpy (ACPI_CAST_PTR (char, Value), ACPI_PHYSADDR_TO_PTR (Address),
|
||||
ACPI_DIV_8 (BitWidth));
|
||||
break;
|
||||
|
||||
case ACPI_WRITE:
|
||||
|
||||
ACPI_MEMCPY (ACPI_PHYSADDR_TO_PTR (Address), ACPI_CAST_PTR (char, Value),
|
||||
memcpy (ACPI_PHYSADDR_TO_PTR (Address), ACPI_CAST_PTR (char, Value),
|
||||
ACPI_DIV_8 (BitWidth));
|
||||
break;
|
||||
|
||||
|
|
|
@ -206,7 +206,7 @@ AcpiExResolveNodeToValue (
|
|||
{
|
||||
ACPI_ERROR ((AE_INFO, "No object attached to node [%4.4s] %p",
|
||||
Node->Name.Ascii, Node));
|
||||
return_ACPI_STATUS (AE_AML_NO_OPERAND);
|
||||
return_ACPI_STATUS (AE_AML_UNINITIALIZED_NODE);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
|
@ -297,7 +297,6 @@ AcpiExResolveObjectToValue (
|
|||
* (i.e., dereference the package index)
|
||||
* Delete the ref object, increment the returned object
|
||||
*/
|
||||
AcpiUtRemoveReference (StackDesc);
|
||||
AcpiUtAddReference (ObjDesc);
|
||||
*StackPtr = ObjDesc;
|
||||
}
|
||||
|
@ -423,8 +422,8 @@ AcpiExResolveMultiple (
|
|||
ACPI_OBJECT_TYPE *ReturnType,
|
||||
ACPI_OPERAND_OBJECT **ReturnDesc)
|
||||
{
|
||||
ACPI_OPERAND_OBJECT *ObjDesc = (void *) Operand;
|
||||
ACPI_NAMESPACE_NODE *Node;
|
||||
ACPI_OPERAND_OBJECT *ObjDesc = ACPI_CAST_PTR (void, Operand);
|
||||
ACPI_NAMESPACE_NODE *Node = ACPI_CAST_PTR (ACPI_NAMESPACE_NODE, Operand);
|
||||
ACPI_OBJECT_TYPE Type;
|
||||
ACPI_STATUS Status;
|
||||
|
||||
|
@ -444,7 +443,7 @@ AcpiExResolveMultiple (
|
|||
case ACPI_DESC_TYPE_NAMED:
|
||||
|
||||
Type = ((ACPI_NAMESPACE_NODE *) ObjDesc)->Type;
|
||||
ObjDesc = AcpiNsGetAttachedObject ((ACPI_NAMESPACE_NODE *) ObjDesc);
|
||||
ObjDesc = AcpiNsGetAttachedObject (Node);
|
||||
|
||||
/* If we had an Alias node, use the attached object for type info */
|
||||
|
||||
|
@ -453,6 +452,14 @@ AcpiExResolveMultiple (
|
|||
Type = ((ACPI_NAMESPACE_NODE *) ObjDesc)->Type;
|
||||
ObjDesc = AcpiNsGetAttachedObject ((ACPI_NAMESPACE_NODE *) ObjDesc);
|
||||
}
|
||||
|
||||
if (!ObjDesc)
|
||||
{
|
||||
ACPI_ERROR ((AE_INFO,
|
||||
"[%4.4s] Node is unresolved or uninitialized",
|
||||
AcpiUtGetNodeName (Node)));
|
||||
return_ACPI_STATUS (AE_AML_UNINITIALIZED_NODE);
|
||||
}
|
||||
break;
|
||||
|
||||
default:
|
||||
|
|
|
@ -392,6 +392,8 @@ 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 */
|
||||
case ARGI_STORE_TARGET:
|
||||
|
||||
/*
|
||||
* Need an operand of type ACPI_TYPE_LOCAL_REFERENCE
|
||||
* A Namespace Node is OK as-is
|
||||
|
|
|
@ -219,7 +219,7 @@ AcpiExStore (
|
|||
/* Destination is not a Reference object */
|
||||
|
||||
ACPI_ERROR ((AE_INFO,
|
||||
"Target is not a Reference or Constant object - %s [%p]",
|
||||
"Target is not a Reference or Constant object - [%s] %p",
|
||||
AcpiUtGetObjectTypeName (DestDesc), DestDesc));
|
||||
|
||||
return_ACPI_STATUS (AE_AML_OPERAND_TYPE);
|
||||
|
@ -266,7 +266,7 @@ AcpiExStore (
|
|||
* displayed and otherwise has no effect -- see ACPI Specification
|
||||
*/
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
|
||||
"**** Write to Debug Object: Object %p %s ****:\n\n",
|
||||
"**** Write to Debug Object: Object %p [%s] ****:\n\n",
|
||||
SourceDesc, AcpiUtGetObjectTypeName (SourceDesc)));
|
||||
|
||||
ACPI_DEBUG_OBJECT (SourceDesc, 0, 0);
|
||||
|
@ -428,7 +428,7 @@ AcpiExStoreObjectToIndex (
|
|||
/* All other types are invalid */
|
||||
|
||||
ACPI_ERROR ((AE_INFO,
|
||||
"Source must be Integer/Buffer/String type, not %s",
|
||||
"Source must be type [Integer/Buffer/String], found [%s]",
|
||||
AcpiUtGetObjectTypeName (SourceDesc)));
|
||||
return_ACPI_STATUS (AE_AML_OPERAND_TYPE);
|
||||
}
|
||||
|
@ -440,8 +440,8 @@ AcpiExStoreObjectToIndex (
|
|||
|
||||
default:
|
||||
ACPI_ERROR ((AE_INFO,
|
||||
"Target is not a Package or BufferField"));
|
||||
Status = AE_AML_OPERAND_TYPE;
|
||||
"Target is not of type [Package/BufferField]"));
|
||||
Status = AE_AML_TARGET_TYPE;
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -462,20 +462,20 @@ AcpiExStoreObjectToIndex (
|
|||
*
|
||||
* DESCRIPTION: Store the object to the named object.
|
||||
*
|
||||
* The Assignment of an object to a named object is handled here
|
||||
* The value passed in will replace the current value (if any)
|
||||
* with the input value.
|
||||
* The assignment of an object to a named object is handled here.
|
||||
* The value passed in will replace the current value (if any)
|
||||
* 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
|
||||
* that the target object type (for an initialized target) will
|
||||
* not be changed by a store operation. A CopyObject can change
|
||||
* the target type, however.
|
||||
* When storing into an object the data is converted to the
|
||||
* 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. 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.
|
||||
* 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.
|
||||
* Assumes parameters are already validated.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
|
@ -500,9 +500,74 @@ AcpiExStoreObjectToNode (
|
|||
TargetType = AcpiNsGetType (Node);
|
||||
TargetDesc = AcpiNsGetAttachedObject (Node);
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Storing %p (%s) to node %p (%s)\n",
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC, "Storing %p [%s] to node %p [%s]\n",
|
||||
SourceDesc, AcpiUtGetObjectTypeName (SourceDesc),
|
||||
Node, AcpiUtGetTypeName (TargetType)));
|
||||
Node, AcpiUtGetTypeName (TargetType)));
|
||||
|
||||
/* Only limited target types possible for everything except CopyObject */
|
||||
|
||||
if (WalkState->Opcode != AML_COPY_OP)
|
||||
{
|
||||
/*
|
||||
* Only CopyObject allows all object types to be overwritten. For
|
||||
* TargetRef(s), there are restrictions on the object types that
|
||||
* are allowed.
|
||||
*
|
||||
* Allowable operations/typing for Store:
|
||||
*
|
||||
* 1) Simple Store
|
||||
* Integer --> Integer (Named/Local/Arg)
|
||||
* String --> String (Named/Local/Arg)
|
||||
* Buffer --> Buffer (Named/Local/Arg)
|
||||
* Package --> Package (Named/Local/Arg)
|
||||
*
|
||||
* 2) Store with implicit conversion
|
||||
* Integer --> String or Buffer (Named)
|
||||
* String --> Integer or Buffer (Named)
|
||||
* Buffer --> Integer or String (Named)
|
||||
*/
|
||||
switch (TargetType)
|
||||
{
|
||||
case ACPI_TYPE_PACKAGE:
|
||||
/*
|
||||
* Here, can only store a package to an existing package.
|
||||
* Storing a package to a Local/Arg is OK, and handled
|
||||
* elsewhere.
|
||||
*/
|
||||
if (WalkState->Opcode == AML_STORE_OP)
|
||||
{
|
||||
if (SourceDesc->Common.Type != ACPI_TYPE_PACKAGE)
|
||||
{
|
||||
ACPI_ERROR ((AE_INFO,
|
||||
"Cannot assign type [%s] to [Package] "
|
||||
"(source must be type Pkg)",
|
||||
AcpiUtGetObjectTypeName (SourceDesc)));
|
||||
|
||||
return_ACPI_STATUS (AE_AML_TARGET_TYPE);
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
/* Fallthrough */
|
||||
|
||||
case ACPI_TYPE_DEVICE:
|
||||
case ACPI_TYPE_EVENT:
|
||||
case ACPI_TYPE_MUTEX:
|
||||
case ACPI_TYPE_REGION:
|
||||
case ACPI_TYPE_POWER:
|
||||
case ACPI_TYPE_PROCESSOR:
|
||||
case ACPI_TYPE_THERMAL:
|
||||
|
||||
ACPI_ERROR ((AE_INFO,
|
||||
"Target must be [Buffer/Integer/String/Reference], found [%s] (%4.4s)",
|
||||
AcpiUtGetTypeName (Node->Type), Node->Name.Ascii));
|
||||
|
||||
return_ACPI_STATUS (AE_AML_TARGET_TYPE);
|
||||
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Resolve the source object to an actual value
|
||||
|
@ -518,13 +583,13 @@ AcpiExStoreObjectToNode (
|
|||
|
||||
switch (TargetType)
|
||||
{
|
||||
case ACPI_TYPE_INTEGER:
|
||||
case ACPI_TYPE_STRING:
|
||||
case ACPI_TYPE_BUFFER:
|
||||
/*
|
||||
* The simple data types all support implicit source operand
|
||||
* conversion before the store.
|
||||
*/
|
||||
case ACPI_TYPE_INTEGER:
|
||||
case ACPI_TYPE_STRING:
|
||||
case ACPI_TYPE_BUFFER:
|
||||
|
||||
if ((WalkState->Opcode == AML_COPY_OP) ||
|
||||
!ImplicitConversion)
|
||||
|
@ -563,7 +628,7 @@ AcpiExStoreObjectToNode (
|
|||
NewDesc->Common.Type);
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_EXEC,
|
||||
"Store %s into %s via Convert/Attach\n",
|
||||
"Store type [%s] into [%s] via Convert/Attach\n",
|
||||
AcpiUtGetObjectTypeName (SourceDesc),
|
||||
AcpiUtGetObjectTypeName (NewDesc)));
|
||||
}
|
||||
|
@ -585,15 +650,12 @@ AcpiExStoreObjectToNode (
|
|||
|
||||
default:
|
||||
/*
|
||||
* 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.
|
||||
* CopyObject operator: No conversions for all other types.
|
||||
* Instead, directly store a copy of the source object.
|
||||
*
|
||||
* 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".
|
||||
* This is the ACPI spec-defined behavior for the CopyObject
|
||||
* operator. (Note, for this default case, all normal
|
||||
* Store/Target operations exited above with an error).
|
||||
*/
|
||||
Status = AcpiExStoreDirectToNode (SourceDesc, Node,
|
||||
WalkState);
|
||||
|
|
|
@ -201,9 +201,10 @@ AcpiExResolveObject (
|
|||
/* Conversion successful but still not a valid type */
|
||||
|
||||
ACPI_ERROR ((AE_INFO,
|
||||
"Cannot assign type %s to %s (must be type Int/Str/Buf)",
|
||||
"Cannot assign type [%s] to [%s] (must be type Int/Str/Buf)",
|
||||
AcpiUtGetObjectTypeName (SourceDesc),
|
||||
AcpiUtGetTypeName (TargetType)));
|
||||
|
||||
Status = AE_AML_OPERAND_TYPE;
|
||||
}
|
||||
break;
|
||||
|
@ -356,7 +357,7 @@ AcpiExStoreObjectToObject (
|
|||
/*
|
||||
* All other types come here.
|
||||
*/
|
||||
ACPI_WARNING ((AE_INFO, "Store into type %s not implemented",
|
||||
ACPI_WARNING ((AE_INFO, "Store into type [%s] not implemented",
|
||||
AcpiUtGetObjectTypeName (DestDesc)));
|
||||
|
||||
Status = AE_NOT_IMPLEMENTED;
|
||||
|
|
|
@ -181,8 +181,8 @@ AcpiExStoreBufferToBuffer (
|
|||
{
|
||||
/* Clear existing buffer and copy in the new one */
|
||||
|
||||
ACPI_MEMSET (TargetDesc->Buffer.Pointer, 0, TargetDesc->Buffer.Length);
|
||||
ACPI_MEMCPY (TargetDesc->Buffer.Pointer, Buffer, Length);
|
||||
memset (TargetDesc->Buffer.Pointer, 0, TargetDesc->Buffer.Length);
|
||||
memcpy (TargetDesc->Buffer.Pointer, Buffer, Length);
|
||||
|
||||
#ifdef ACPI_OBSOLETE_BEHAVIOR
|
||||
/*
|
||||
|
@ -211,7 +211,7 @@ AcpiExStoreBufferToBuffer (
|
|||
{
|
||||
/* Truncate the source, copy only what will fit */
|
||||
|
||||
ACPI_MEMCPY (TargetDesc->Buffer.Pointer, Buffer,
|
||||
memcpy (TargetDesc->Buffer.Pointer, Buffer,
|
||||
TargetDesc->Buffer.Length);
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_INFO,
|
||||
|
@ -275,9 +275,9 @@ AcpiExStoreStringToString (
|
|||
* String will fit in existing non-static buffer.
|
||||
* Clear old string and copy in the new one
|
||||
*/
|
||||
ACPI_MEMSET (TargetDesc->String.Pointer, 0,
|
||||
memset (TargetDesc->String.Pointer, 0,
|
||||
(ACPI_SIZE) TargetDesc->String.Length + 1);
|
||||
ACPI_MEMCPY (TargetDesc->String.Pointer, Buffer, Length);
|
||||
memcpy (TargetDesc->String.Pointer, Buffer, Length);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -301,7 +301,7 @@ AcpiExStoreStringToString (
|
|||
}
|
||||
|
||||
TargetDesc->Common.Flags &= ~AOPOBJ_STATIC_POINTER;
|
||||
ACPI_MEMCPY (TargetDesc->String.Pointer, Buffer, Length);
|
||||
memcpy (TargetDesc->String.Pointer, Buffer, Length);
|
||||
}
|
||||
|
||||
/* Set the new target length */
|
||||
|
|
|
@ -503,6 +503,43 @@ AcpiExIntegerToString (
|
|||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiExPciClsToString
|
||||
*
|
||||
* PARAMETERS: OutString - Where to put the converted string (7 bytes)
|
||||
* PARAMETERS: ClassCode - PCI class code to be converted (3 bytes)
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Convert 3-bytes PCI class code to string representation.
|
||||
* Return buffer must be large enough to hold the string. The
|
||||
* string returned is always exactly of length
|
||||
* ACPI_PCICLS_STRING_SIZE (includes null terminator).
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
void
|
||||
AcpiExPciClsToString (
|
||||
char *OutString,
|
||||
UINT8 ClassCode[3])
|
||||
{
|
||||
|
||||
ACPI_FUNCTION_ENTRY ();
|
||||
|
||||
|
||||
/* All 3 bytes are hexadecimal */
|
||||
|
||||
OutString[0] = AcpiUtHexToAsciiChar ((UINT64) ClassCode[0], 4);
|
||||
OutString[1] = AcpiUtHexToAsciiChar ((UINT64) ClassCode[0], 0);
|
||||
OutString[2] = AcpiUtHexToAsciiChar ((UINT64) ClassCode[1], 4);
|
||||
OutString[3] = AcpiUtHexToAsciiChar ((UINT64) ClassCode[1], 0);
|
||||
OutString[4] = AcpiUtHexToAsciiChar ((UINT64) ClassCode[2], 4);
|
||||
OutString[5] = AcpiUtHexToAsciiChar ((UINT64) ClassCode[2], 0);
|
||||
OutString[6] = 0;
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiIsValidSpaceId
|
||||
|
|
|
@ -169,6 +169,8 @@ AcpiHwGetGpeRegisterBit (
|
|||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Enable or disable a single GPE in the parent enable register.
|
||||
* The EnableMask field of the involved GPE register must be
|
||||
* updated by the caller if necessary.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
|
@ -205,7 +207,7 @@ AcpiHwLowSetGpe (
|
|||
/* Set or clear just the bit that corresponds to this GPE */
|
||||
|
||||
RegisterBit = AcpiHwGetGpeRegisterBit (GpeEventInfo);
|
||||
switch (Action & ~ACPI_GPE_SAVE_MASK)
|
||||
switch (Action)
|
||||
{
|
||||
case ACPI_GPE_CONDITIONAL_ENABLE:
|
||||
|
||||
|
@ -237,10 +239,6 @@ AcpiHwLowSetGpe (
|
|||
/* Write the updated enable mask */
|
||||
|
||||
Status = AcpiHwWrite (EnableMask, &GpeRegisterInfo->EnableAddress);
|
||||
if (ACPI_SUCCESS (Status) && (Action & ACPI_GPE_SAVE_MASK))
|
||||
{
|
||||
GpeRegisterInfo->EnableMask = (UINT8) EnableMask;
|
||||
}
|
||||
return (Status);
|
||||
}
|
||||
|
||||
|
@ -406,11 +404,8 @@ AcpiHwGpeEnableWrite (
|
|||
ACPI_STATUS Status;
|
||||
|
||||
|
||||
GpeRegisterInfo->EnableMask = EnableMask;
|
||||
Status = AcpiHwWrite (EnableMask, &GpeRegisterInfo->EnableAddress);
|
||||
if (ACPI_SUCCESS (Status))
|
||||
{
|
||||
GpeRegisterInfo->EnableMask = EnableMask;
|
||||
}
|
||||
|
||||
return (Status);
|
||||
}
|
||||
|
|
|
@ -212,7 +212,7 @@ AcpiHwDerivePciId (
|
|||
ACPI_HANDLE PciRegion)
|
||||
{
|
||||
ACPI_STATUS Status;
|
||||
ACPI_PCI_DEVICE *ListHead = NULL;
|
||||
ACPI_PCI_DEVICE *ListHead;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE (HwDerivePciId);
|
||||
|
@ -270,7 +270,6 @@ AcpiHwBuildPciList (
|
|||
ACPI_HANDLE ParentDevice;
|
||||
ACPI_STATUS Status;
|
||||
ACPI_PCI_DEVICE *ListElement;
|
||||
ACPI_PCI_DEVICE *ListHead = NULL;
|
||||
|
||||
|
||||
/*
|
||||
|
@ -278,6 +277,7 @@ AcpiHwBuildPciList (
|
|||
* a list of device nodes. Loop will exit when either the PCI device is
|
||||
* found, or the root of the namespace is reached.
|
||||
*/
|
||||
*ReturnListHead = NULL;
|
||||
CurrentDevice = PciRegion;
|
||||
while (1)
|
||||
{
|
||||
|
@ -294,7 +294,6 @@ AcpiHwBuildPciList (
|
|||
|
||||
if (ParentDevice == RootPciDevice)
|
||||
{
|
||||
*ReturnListHead = ListHead;
|
||||
return (AE_OK);
|
||||
}
|
||||
|
||||
|
@ -309,9 +308,9 @@ AcpiHwBuildPciList (
|
|||
|
||||
/* Put new element at the head of the list */
|
||||
|
||||
ListElement->Next = ListHead;
|
||||
ListElement->Next = *ReturnListHead;
|
||||
ListElement->Device = ParentDevice;
|
||||
ListHead = ListElement;
|
||||
*ReturnListHead = ListElement;
|
||||
|
||||
CurrentDevice = ParentDevice;
|
||||
}
|
||||
|
|
|
@ -123,6 +123,14 @@
|
|||
|
||||
/* Local prototypes */
|
||||
|
||||
#if (!ACPI_REDUCED_HARDWARE)
|
||||
static ACPI_STATUS
|
||||
AcpiHwSetFirmwareWakingVector (
|
||||
ACPI_TABLE_FACS *Facs,
|
||||
ACPI_PHYSICAL_ADDRESS PhysicalAddress,
|
||||
ACPI_PHYSICAL_ADDRESS PhysicalAddress64);
|
||||
#endif
|
||||
|
||||
static ACPI_STATUS
|
||||
AcpiHwSleepDispatch (
|
||||
UINT8 SleepState,
|
||||
|
@ -149,29 +157,33 @@ static ACPI_SLEEP_FUNCTIONS AcpiSleepDispatch[] =
|
|||
/*
|
||||
* These functions are removed for the ACPI_REDUCED_HARDWARE case:
|
||||
* AcpiSetFirmwareWakingVector
|
||||
* AcpiSetFirmwareWakingVector64
|
||||
* AcpiEnterSleepStateS4bios
|
||||
*/
|
||||
|
||||
#if (!ACPI_REDUCED_HARDWARE)
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiSetFirmwareWakingVector
|
||||
* FUNCTION: AcpiHwSetFirmwareWakingVector
|
||||
*
|
||||
* PARAMETERS: PhysicalAddress - 32-bit physical address of ACPI real mode
|
||||
* entry point.
|
||||
* PARAMETERS: Facs - Pointer to FACS table
|
||||
* PhysicalAddress - 32-bit physical address of ACPI real mode
|
||||
* entry point
|
||||
* PhysicalAddress64 - 64-bit physical address of ACPI protected
|
||||
* entry point
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Sets the 32-bit FirmwareWakingVector field of the FACS
|
||||
* DESCRIPTION: Sets the FirmwareWakingVector fields of the FACS
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiSetFirmwareWakingVector (
|
||||
UINT32 PhysicalAddress)
|
||||
static ACPI_STATUS
|
||||
AcpiHwSetFirmwareWakingVector (
|
||||
ACPI_TABLE_FACS *Facs,
|
||||
ACPI_PHYSICAL_ADDRESS PhysicalAddress,
|
||||
ACPI_PHYSICAL_ADDRESS PhysicalAddress64)
|
||||
{
|
||||
ACPI_FUNCTION_TRACE (AcpiSetFirmwareWakingVector);
|
||||
ACPI_FUNCTION_TRACE (AcpiHwSetFirmwareWakingVector);
|
||||
|
||||
|
||||
/*
|
||||
|
@ -184,13 +196,55 @@ AcpiSetFirmwareWakingVector (
|
|||
|
||||
/* Set the 32-bit vector */
|
||||
|
||||
AcpiGbl_FACS->FirmwareWakingVector = PhysicalAddress;
|
||||
Facs->FirmwareWakingVector = (UINT32) PhysicalAddress;
|
||||
|
||||
/* Clear the 64-bit vector if it exists */
|
||||
|
||||
if ((AcpiGbl_FACS->Length > 32) && (AcpiGbl_FACS->Version >= 1))
|
||||
if (Facs->Length > 32)
|
||||
{
|
||||
AcpiGbl_FACS->XFirmwareWakingVector = 0;
|
||||
if (Facs->Version >= 1)
|
||||
{
|
||||
/* Set the 64-bit vector */
|
||||
|
||||
Facs->XFirmwareWakingVector = PhysicalAddress64;
|
||||
}
|
||||
else
|
||||
{
|
||||
/* Clear the 64-bit vector if it exists */
|
||||
|
||||
Facs->XFirmwareWakingVector = 0;
|
||||
}
|
||||
}
|
||||
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiSetFirmwareWakingVector
|
||||
*
|
||||
* PARAMETERS: PhysicalAddress - 32-bit physical address of ACPI real mode
|
||||
* entry point
|
||||
* PhysicalAddress64 - 64-bit physical address of ACPI protected
|
||||
* entry point
|
||||
*
|
||||
* RETURN: Status
|
||||
*
|
||||
* DESCRIPTION: Sets the FirmwareWakingVector fields of the FACS
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiSetFirmwareWakingVector (
|
||||
ACPI_PHYSICAL_ADDRESS PhysicalAddress,
|
||||
ACPI_PHYSICAL_ADDRESS PhysicalAddress64)
|
||||
{
|
||||
|
||||
ACPI_FUNCTION_TRACE (AcpiSetFirmwareWakingVector);
|
||||
|
||||
if (AcpiGbl_FACS)
|
||||
{
|
||||
(void) AcpiHwSetFirmwareWakingVector (AcpiGbl_FACS,
|
||||
PhysicalAddress, PhysicalAddress64);
|
||||
}
|
||||
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
|
@ -199,47 +253,6 @@ AcpiSetFirmwareWakingVector (
|
|||
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
|
||||
|
|
|
@ -166,7 +166,7 @@
|
|||
|
||||
|
||||
#define FILE_SUFFIX_DISASSEMBLY "dsl"
|
||||
#define ACPI_TABLE_FILE_SUFFIX ".dat"
|
||||
#define FILE_SUFFIX_BINARY_TABLE ".dat" /* Needs the dot */
|
||||
|
||||
|
||||
/*
|
||||
|
|
|
@ -229,6 +229,7 @@ typedef struct acpi_pld_info
|
|||
* (Intended for BIOS use only)
|
||||
*/
|
||||
#define ACPI_PLD_REV1_BUFFER_SIZE 16 /* For Revision 1 of the buffer (From ACPI spec) */
|
||||
#define ACPI_PLD_REV2_BUFFER_SIZE 20 /* For Revision 2 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 */
|
||||
|
|
254
reactos/drivers/bus/acpi/acpica/include/acclib.h
Normal file
254
reactos/drivers/bus/acpi/acpica/include/acclib.h
Normal file
|
@ -0,0 +1,254 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* Name: acclib.h -- C library support. Prototypes for the (optional) local
|
||||
* implementations of required C library functions.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2015, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
#ifndef _ACCLIB_H
|
||||
#define _ACCLIB_H
|
||||
|
||||
|
||||
/*
|
||||
* Prototypes and macros for local implementations of C library functions
|
||||
*/
|
||||
|
||||
/* is* functions. The AcpiGbl_Ctypes array is defined in utclib.c */
|
||||
|
||||
extern const UINT8 AcpiGbl_Ctypes[];
|
||||
|
||||
#define _ACPI_XA 0x00 /* extra alphabetic - not supported */
|
||||
#define _ACPI_XS 0x40 /* extra space */
|
||||
#define _ACPI_BB 0x00 /* BEL, BS, etc. - not supported */
|
||||
#define _ACPI_CN 0x20 /* CR, FF, HT, NL, VT */
|
||||
#define _ACPI_DI 0x04 /* '0'-'9' */
|
||||
#define _ACPI_LO 0x02 /* 'a'-'z' */
|
||||
#define _ACPI_PU 0x10 /* punctuation */
|
||||
#define _ACPI_SP 0x08 /* space, tab, CR, LF, VT, FF */
|
||||
#define _ACPI_UP 0x01 /* 'A'-'Z' */
|
||||
#define _ACPI_XD 0x80 /* '0'-'9', 'A'-'F', 'a'-'f' */
|
||||
|
||||
#define isdigit(c) (AcpiGbl_Ctypes[(unsigned char)(c)] & (_ACPI_DI))
|
||||
#define isspace(c) (AcpiGbl_Ctypes[(unsigned char)(c)] & (_ACPI_SP))
|
||||
#define isxdigit(c) (AcpiGbl_Ctypes[(unsigned char)(c)] & (_ACPI_XD))
|
||||
#define isupper(c) (AcpiGbl_Ctypes[(unsigned char)(c)] & (_ACPI_UP))
|
||||
#define islower(c) (AcpiGbl_Ctypes[(unsigned char)(c)] & (_ACPI_LO))
|
||||
#define isprint(c) (AcpiGbl_Ctypes[(unsigned char)(c)] & (_ACPI_LO | _ACPI_UP | _ACPI_DI | _ACPI_XS | _ACPI_PU))
|
||||
#define isalpha(c) (AcpiGbl_Ctypes[(unsigned char)(c)] & (_ACPI_LO | _ACPI_UP))
|
||||
|
||||
|
||||
/* Strings */
|
||||
|
||||
char *
|
||||
strcat (
|
||||
char *DstString,
|
||||
const char *SrcString);
|
||||
|
||||
char *
|
||||
strchr (
|
||||
const char *String,
|
||||
int ch);
|
||||
|
||||
char *
|
||||
strcpy (
|
||||
char *DstString,
|
||||
const char *SrcString);
|
||||
|
||||
int
|
||||
strcmp (
|
||||
const char *String1,
|
||||
const char *String2);
|
||||
|
||||
ACPI_SIZE
|
||||
strlen (
|
||||
const char *String);
|
||||
|
||||
char *
|
||||
strncat (
|
||||
char *DstString,
|
||||
const char *SrcString,
|
||||
ACPI_SIZE Count);
|
||||
|
||||
int
|
||||
strncmp (
|
||||
const char *String1,
|
||||
const char *String2,
|
||||
ACPI_SIZE Count);
|
||||
|
||||
char *
|
||||
strncpy (
|
||||
char *DstString,
|
||||
const char *SrcString,
|
||||
ACPI_SIZE Count);
|
||||
|
||||
#ifdef __REACTOS__
|
||||
char *
|
||||
strstr (
|
||||
const char *String1,
|
||||
const char *String2);
|
||||
#else /* __REACTOS__ */
|
||||
char *
|
||||
strstr (
|
||||
char *String1,
|
||||
char *String2);
|
||||
#endif /* __REACTOS__ */
|
||||
|
||||
|
||||
/* Conversion */
|
||||
|
||||
UINT32
|
||||
strtoul (
|
||||
const char *String,
|
||||
char **Terminator,
|
||||
UINT32 Base);
|
||||
|
||||
|
||||
/* Memory */
|
||||
|
||||
#ifdef __REACTOS__
|
||||
int
|
||||
memcmp (
|
||||
const void *Buffer1,
|
||||
const void *Buffer2,
|
||||
ACPI_SIZE Count);
|
||||
#else /* __REACTOS__ */
|
||||
int
|
||||
memcmp (
|
||||
void *Buffer1,
|
||||
void *Buffer2,
|
||||
ACPI_SIZE Count);
|
||||
#endif /* __REACTOS__ */
|
||||
|
||||
void *
|
||||
memcpy (
|
||||
void *Dest,
|
||||
const void *Src,
|
||||
ACPI_SIZE Count);
|
||||
|
||||
void *
|
||||
memset (
|
||||
void *Dest,
|
||||
int Value,
|
||||
ACPI_SIZE Count);
|
||||
|
||||
|
||||
/* upper/lower case */
|
||||
|
||||
int
|
||||
tolower (
|
||||
int c);
|
||||
|
||||
int
|
||||
toupper (
|
||||
int c);
|
||||
|
||||
#endif /* _ACCLIB_H */
|
|
@ -131,6 +131,9 @@
|
|||
#include "acglobal.h" /* All global variables */
|
||||
#include "achware.h" /* Hardware defines and interfaces */
|
||||
#include "acutils.h" /* Utility interfaces */
|
||||
#ifndef ACPI_USE_SYSTEM_CLIBRARY
|
||||
#include "acclib.h" /* C library interfaces */
|
||||
#endif /* !ACPI_USE_SYSTEM_CLIBRARY */
|
||||
|
||||
|
||||
#endif /* __ACCOMMON_H__ */
|
||||
|
|
|
@ -210,10 +210,6 @@
|
|||
|
||||
#define ACPI_ROOT_TABLE_SIZE_INCREMENT 4
|
||||
|
||||
/* Maximum number of While() loop iterations before forced abort */
|
||||
|
||||
#define ACPI_MAX_LOOP_ITERATIONS 0xFFFF
|
||||
|
||||
/* Maximum sleep allowed via Sleep() operator */
|
||||
|
||||
#define ACPI_MAX_SLEEP 2000 /* 2000 millisec == two seconds */
|
||||
|
|
|
@ -116,6 +116,12 @@
|
|||
#ifndef __ACDEBUG_H__
|
||||
#define __ACDEBUG_H__
|
||||
|
||||
/* The debugger is used in conjunction with the disassembler most of time */
|
||||
|
||||
#ifdef ACPI_DISASSEMBLER
|
||||
#include "acdisasm.h"
|
||||
#endif
|
||||
|
||||
|
||||
#define ACPI_DEBUG_BUFFER_SIZE 0x4000 /* 16K buffer for return objects */
|
||||
|
||||
|
@ -149,9 +155,6 @@ typedef struct acpi_db_execute_walk
|
|||
|
||||
|
||||
#define PARAM_LIST(pl) pl
|
||||
#define DBTEST_OUTPUT_LEVEL(lvl) if (AcpiGbl_DbOpt_Verbose)
|
||||
#define VERBOSE_PRINT(fp) DBTEST_OUTPUT_LEVEL(lvl) {\
|
||||
AcpiOsPrintf PARAM_LIST(fp);}
|
||||
|
||||
#define EX_NO_SINGLE_STEP 1
|
||||
#define EX_SINGLE_STEP 2
|
||||
|
@ -161,14 +164,6 @@ typedef struct acpi_db_execute_walk
|
|||
* dbxface - external debugger interfaces
|
||||
*/
|
||||
ACPI_STATUS
|
||||
AcpiDbInitialize (
|
||||
void);
|
||||
|
||||
void
|
||||
AcpiDbTerminate (
|
||||
void);
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiDbSingleStep (
|
||||
ACPI_WALK_STATE *WalkState,
|
||||
ACPI_PARSE_OBJECT *Op,
|
||||
|
@ -208,6 +203,12 @@ ACPI_STATUS
|
|||
AcpiDbSleep (
|
||||
char *ObjectArg);
|
||||
|
||||
void
|
||||
AcpiDbTrace (
|
||||
char *EnableArg,
|
||||
char *MethodArg,
|
||||
char *OnceArg);
|
||||
|
||||
void
|
||||
AcpiDbDisplayLocks (
|
||||
void);
|
||||
|
@ -447,7 +448,8 @@ AcpiDbLoadAcpiTable (
|
|||
ACPI_STATUS
|
||||
AcpiDbGetTableFromFile (
|
||||
char *Filename,
|
||||
ACPI_TABLE_HEADER **Table);
|
||||
ACPI_TABLE_HEADER **Table,
|
||||
BOOLEAN MustBeAmlTable);
|
||||
|
||||
|
||||
/*
|
||||
|
@ -495,6 +497,32 @@ AcpiDbGetNextToken (
|
|||
ACPI_OBJECT_TYPE *ReturnType);
|
||||
|
||||
|
||||
/*
|
||||
* dbobject
|
||||
*/
|
||||
void
|
||||
AcpiDbDecodeInternalObject (
|
||||
ACPI_OPERAND_OBJECT *ObjDesc);
|
||||
|
||||
void
|
||||
AcpiDbDisplayInternalObject (
|
||||
ACPI_OPERAND_OBJECT *ObjDesc,
|
||||
ACPI_WALK_STATE *WalkState);
|
||||
|
||||
void
|
||||
AcpiDbDecodeArguments (
|
||||
ACPI_WALK_STATE *WalkState);
|
||||
|
||||
void
|
||||
AcpiDbDecodeLocals (
|
||||
ACPI_WALK_STATE *WalkState);
|
||||
|
||||
void
|
||||
AcpiDbDumpMethodInfo (
|
||||
ACPI_STATUS Status,
|
||||
ACPI_WALK_STATE *WalkState);
|
||||
|
||||
|
||||
/*
|
||||
* dbstats - Generation and display of ACPI table statistics
|
||||
*/
|
||||
|
|
|
@ -132,7 +132,7 @@
|
|||
#define ACPI_RAW_TABLE_DATA_HEADER "Raw Table Data"
|
||||
|
||||
|
||||
typedef const struct acpi_dmtable_info
|
||||
typedef struct acpi_dmtable_info
|
||||
{
|
||||
UINT8 Opcode;
|
||||
UINT16 Offset;
|
||||
|
@ -220,9 +220,11 @@ typedef enum
|
|||
ACPI_DMT_HEST,
|
||||
ACPI_DMT_HESTNTFY,
|
||||
ACPI_DMT_HESTNTYP,
|
||||
ACPI_DMT_IORTMEM,
|
||||
ACPI_DMT_IVRS,
|
||||
ACPI_DMT_LPIT,
|
||||
ACPI_DMT_MADT,
|
||||
ACPI_DMT_NFIT,
|
||||
ACPI_DMT_PCCT,
|
||||
ACPI_DMT_PMTT,
|
||||
ACPI_DMT_SLIC,
|
||||
|
@ -250,20 +252,22 @@ typedef struct acpi_dmtable_data
|
|||
ACPI_DMTABLE_HANDLER TableHandler;
|
||||
ACPI_CMTABLE_HANDLER CmTableHandler;
|
||||
const unsigned char *Template;
|
||||
char *Name;
|
||||
|
||||
} ACPI_DMTABLE_DATA;
|
||||
|
||||
|
||||
typedef struct acpi_op_walk_info
|
||||
{
|
||||
ACPI_WALK_STATE *WalkState;
|
||||
ACPI_PARSE_OBJECT *MappingOp;
|
||||
UINT8 *PreviousAml;
|
||||
UINT8 *StartAml;
|
||||
UINT32 Level;
|
||||
UINT32 LastLevel;
|
||||
UINT32 Count;
|
||||
UINT32 BitOffset;
|
||||
UINT32 Flags;
|
||||
ACPI_WALK_STATE *WalkState;
|
||||
ACPI_PARSE_OBJECT *MappingOp;
|
||||
UINT32 AmlOffset;
|
||||
|
||||
} ACPI_OP_WALK_INFO;
|
||||
|
||||
|
@ -318,6 +322,7 @@ extern ACPI_DMTABLE_INFO AcpiDmTableInfoCpep0[];
|
|||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoCsrt0[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoCsrt1[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoCsrt2[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoCsrt2a[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoDbg2[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoDbg2Device[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoDbg2Addr[];
|
||||
|
@ -334,6 +339,11 @@ extern ACPI_DMTABLE_INFO AcpiDmTableInfoDmar2[];
|
|||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoDmar3[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoDmar4[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoDrtm[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoDrtm0[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoDrtm0a[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoDrtm1[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoDrtm1a[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoDrtm2[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoEcdt[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoEinj[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoEinj0[];
|
||||
|
@ -344,6 +354,7 @@ extern ACPI_DMTABLE_INFO AcpiDmTableInfoFadt1[];
|
|||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoFadt2[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoFadt3[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoFadt5[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoFadt6[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoFpdt[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoFpdtHdr[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoFpdt0[];
|
||||
|
@ -369,6 +380,20 @@ extern ACPI_DMTABLE_INFO AcpiDmTableInfoHpet[];
|
|||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoLpitHdr[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoLpit0[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoLpit1[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoIort[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoIort0[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoIort0a[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoIort1[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoIort1a[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoIort2[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoIort3[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoIort3a[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoIort3b[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoIort3c[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoIortAcc[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoIortHdr[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoIortMap[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoIortPad[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoIvrs[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoIvrs0[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoIvrs1[];
|
||||
|
@ -393,6 +418,7 @@ extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadt11[];
|
|||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadt12[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadt13[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadt14[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadt15[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoMadtHdr[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoMcfg[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoMcfg0[];
|
||||
|
@ -407,6 +433,18 @@ extern ACPI_DMTABLE_INFO AcpiDmTableInfoMsct[];
|
|||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoMsct0[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoMtmr[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoMtmr0[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoNfit[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoNfitHdr[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoNfit0[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoNfit1[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoNfit2[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoNfit2a[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoNfit3[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoNfit3a[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoNfit4[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoNfit5[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoNfit6[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoNfit6a[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoPmtt[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoPmtt0[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoPmtt1[];
|
||||
|
@ -434,7 +472,11 @@ 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 AcpiDmTableInfoStao[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoStaoStr[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoTcpaHdr[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoTcpaClient[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoTcpaServer[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoTpm2[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoUefi[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoVrtc[];
|
||||
|
@ -444,14 +486,17 @@ extern ACPI_DMTABLE_INFO AcpiDmTableInfoWdat[];
|
|||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoWdat0[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoWddt[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoWdrt[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoWpbt[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoWpbt0[];
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoXenv[];
|
||||
|
||||
extern ACPI_DMTABLE_INFO AcpiDmTableInfoGeneric[][2];
|
||||
|
||||
|
||||
/*
|
||||
* dmtable
|
||||
* dmtable and ahtable
|
||||
*/
|
||||
extern ACPI_DMTABLE_DATA AcpiDmTableData[];
|
||||
extern const ACPI_DMTABLE_DATA AcpiDmTableData[];
|
||||
extern const AH_TABLE AcpiSupportedTables[];
|
||||
|
||||
UINT8
|
||||
AcpiDmGenerateChecksum (
|
||||
|
@ -459,7 +504,7 @@ AcpiDmGenerateChecksum (
|
|||
UINT32 Length,
|
||||
UINT8 OriginalChecksum);
|
||||
|
||||
ACPI_DMTABLE_DATA *
|
||||
const ACPI_DMTABLE_DATA *
|
||||
AcpiDmGetTableData (
|
||||
char *Signature);
|
||||
|
||||
|
@ -498,8 +543,13 @@ AcpiDmDumpBuffer (
|
|||
UINT32 BufferOffset,
|
||||
UINT32 Length,
|
||||
UINT32 AbsoluteOffset,
|
||||
char *Header,
|
||||
BOOLEAN MultiLine);
|
||||
char *Header);
|
||||
|
||||
void
|
||||
AcpiDmDumpUnicode (
|
||||
void *Table,
|
||||
UINT32 BufferOffset,
|
||||
UINT32 ByteLength);
|
||||
|
||||
void
|
||||
AcpiDmDumpAsf (
|
||||
|
@ -521,6 +571,10 @@ void
|
|||
AcpiDmDumpDmar (
|
||||
ACPI_TABLE_HEADER *Table);
|
||||
|
||||
void
|
||||
AcpiDmDumpDrtm (
|
||||
ACPI_TABLE_HEADER *Table);
|
||||
|
||||
void
|
||||
AcpiDmDumpEinj (
|
||||
ACPI_TABLE_HEADER *Table);
|
||||
|
@ -545,6 +599,10 @@ void
|
|||
AcpiDmDumpHest (
|
||||
ACPI_TABLE_HEADER *Table);
|
||||
|
||||
void
|
||||
AcpiDmDumpIort (
|
||||
ACPI_TABLE_HEADER *Table);
|
||||
|
||||
void
|
||||
AcpiDmDumpIvrs (
|
||||
ACPI_TABLE_HEADER *Table);
|
||||
|
@ -573,6 +631,10 @@ void
|
|||
AcpiDmDumpMtmr (
|
||||
ACPI_TABLE_HEADER *Table);
|
||||
|
||||
void
|
||||
AcpiDmDumpNfit (
|
||||
ACPI_TABLE_HEADER *Table);
|
||||
|
||||
void
|
||||
AcpiDmDumpPcct (
|
||||
ACPI_TABLE_HEADER *Table);
|
||||
|
@ -605,6 +667,14 @@ void
|
|||
AcpiDmDumpSrat (
|
||||
ACPI_TABLE_HEADER *Table);
|
||||
|
||||
void
|
||||
AcpiDmDumpStao (
|
||||
ACPI_TABLE_HEADER *Table);
|
||||
|
||||
void
|
||||
AcpiDmDumpTcpa (
|
||||
ACPI_TABLE_HEADER *Table);
|
||||
|
||||
void
|
||||
AcpiDmDumpVrtc (
|
||||
ACPI_TABLE_HEADER *Table);
|
||||
|
@ -613,6 +683,10 @@ void
|
|||
AcpiDmDumpWdat (
|
||||
ACPI_TABLE_HEADER *Table);
|
||||
|
||||
void
|
||||
AcpiDmDumpWpbt (
|
||||
ACPI_TABLE_HEADER *Table);
|
||||
|
||||
void
|
||||
AcpiDmDumpXsdt (
|
||||
ACPI_TABLE_HEADER *Table);
|
||||
|
@ -644,10 +718,6 @@ AcpiDmDisassembleOneOp (
|
|||
ACPI_OP_WALK_INFO *Info,
|
||||
ACPI_PARSE_OBJECT *Op);
|
||||
|
||||
void
|
||||
AcpiDmDecodeInternalObject (
|
||||
ACPI_OPERAND_OBJECT *ObjDesc);
|
||||
|
||||
UINT32
|
||||
AcpiDmListType (
|
||||
ACPI_PARSE_OBJECT *Op);
|
||||
|
@ -706,29 +776,6 @@ AcpiDmNamestring (
|
|||
char *Name);
|
||||
|
||||
|
||||
/*
|
||||
* dmobject
|
||||
*/
|
||||
void
|
||||
AcpiDmDisplayInternalObject (
|
||||
ACPI_OPERAND_OBJECT *ObjDesc,
|
||||
ACPI_WALK_STATE *WalkState);
|
||||
|
||||
void
|
||||
AcpiDmDisplayArguments (
|
||||
ACPI_WALK_STATE *WalkState);
|
||||
|
||||
void
|
||||
AcpiDmDisplayLocals (
|
||||
ACPI_WALK_STATE *WalkState);
|
||||
|
||||
void
|
||||
AcpiDmDumpMethodInfo (
|
||||
ACPI_STATUS Status,
|
||||
ACPI_WALK_STATE *WalkState,
|
||||
ACPI_PARSE_OBJECT *Op);
|
||||
|
||||
|
||||
/*
|
||||
* dmbuffer
|
||||
*/
|
||||
|
|
|
@ -533,4 +533,14 @@ AcpiDsResultPush (
|
|||
ACPI_OPERAND_OBJECT *Object,
|
||||
ACPI_WALK_STATE *WalkState);
|
||||
|
||||
|
||||
/*
|
||||
* dsdebug - parser debugging routines
|
||||
*/
|
||||
void
|
||||
AcpiDsDumpMethodStack (
|
||||
ACPI_STATUS Status,
|
||||
ACPI_WALK_STATE *WalkState,
|
||||
ACPI_PARSE_OBJECT *Op);
|
||||
|
||||
#endif /* _ACDISPAT_H_ */
|
||||
|
|
|
@ -269,8 +269,10 @@ typedef struct acpi_exception_info
|
|||
#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_AML_UNINITIALIZED_NODE EXCEP_AML (0x0022)
|
||||
#define AE_AML_TARGET_TYPE EXCEP_AML (0x0023)
|
||||
|
||||
#define AE_CODE_AML_MAX 0x0021
|
||||
#define AE_CODE_AML_MAX 0x0023
|
||||
|
||||
|
||||
/*
|
||||
|
@ -394,7 +396,9 @@ static const ACPI_EXCEPTION_INFO AcpiGbl_ExceptionNames_Aml[] =
|
|||
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")
|
||||
EXCEP_TXT ("AE_AML_INFINITE_LOOP", "An apparent infinite AML While loop, method was aborted"),
|
||||
EXCEP_TXT ("AE_AML_UNINITIALIZED_NODE", "A namespace node is uninitialized or unresolved"),
|
||||
EXCEP_TXT ("AE_AML_TARGET_TYPE", "A target operand of an incorrect type was encountered")
|
||||
};
|
||||
|
||||
static const ACPI_EXCEPTION_INFO AcpiGbl_ExceptionNames_Ctrl[] =
|
||||
|
|
|
@ -131,6 +131,9 @@ ACPI_GLOBAL (ACPI_TABLE_LIST, AcpiGbl_RootTableList);
|
|||
|
||||
ACPI_GLOBAL (ACPI_TABLE_HEADER *, AcpiGbl_DSDT);
|
||||
ACPI_GLOBAL (ACPI_TABLE_HEADER, AcpiGbl_OriginalDsdtHeader);
|
||||
ACPI_INIT_GLOBAL (UINT32, AcpiGbl_DsdtIndex, ACPI_INVALID_TABLE_INDEX);
|
||||
ACPI_INIT_GLOBAL (UINT32, AcpiGbl_FacsIndex, ACPI_INVALID_TABLE_INDEX);
|
||||
ACPI_INIT_GLOBAL (UINT32, AcpiGbl_XFacsIndex, ACPI_INVALID_TABLE_INDEX);
|
||||
|
||||
#if (!ACPI_REDUCED_HARDWARE)
|
||||
ACPI_GLOBAL (ACPI_TABLE_FACS *, AcpiGbl_FACS);
|
||||
|
@ -310,6 +313,10 @@ ACPI_INIT_GLOBAL (UINT32, AcpiGbl_NestingLevel, 0);
|
|||
|
||||
ACPI_GLOBAL (ACPI_THREAD_STATE *, AcpiGbl_CurrentWalkList);
|
||||
|
||||
/* Maximum number of While() loop iterations before forced abort */
|
||||
|
||||
ACPI_GLOBAL (UINT16, AcpiGbl_MaxLoopIterations);
|
||||
|
||||
/* Control method single step flag */
|
||||
|
||||
ACPI_GLOBAL (UINT8, AcpiGbl_CmSingleStep);
|
||||
|
@ -363,8 +370,6 @@ ACPI_GLOBAL (UINT32, AcpiFixedEventCount[ACPI_NUM_FIXED_EVENT
|
|||
|
||||
ACPI_GLOBAL (UINT32, AcpiGbl_OriginalDbgLevel);
|
||||
ACPI_GLOBAL (UINT32, AcpiGbl_OriginalDbgLayer);
|
||||
ACPI_GLOBAL (UINT32, AcpiGbl_TraceDbgLevel);
|
||||
ACPI_GLOBAL (UINT32, AcpiGbl_TraceDbgLayer);
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
|
@ -383,9 +388,10 @@ ACPI_INIT_GLOBAL (UINT8, AcpiGbl_NoResourceDisassembly, FALSE);
|
|||
ACPI_INIT_GLOBAL (BOOLEAN, AcpiGbl_IgnoreNoopOperator, FALSE);
|
||||
ACPI_INIT_GLOBAL (BOOLEAN, AcpiGbl_CstyleDisassembly, TRUE);
|
||||
ACPI_INIT_GLOBAL (BOOLEAN, AcpiGbl_ForceAmlDisassembly, FALSE);
|
||||
ACPI_INIT_GLOBAL (BOOLEAN, AcpiGbl_DmOpt_Verbose, TRUE);
|
||||
|
||||
ACPI_GLOBAL (BOOLEAN, AcpiGbl_DbOpt_Disasm);
|
||||
ACPI_GLOBAL (BOOLEAN, AcpiGbl_DbOpt_Verbose);
|
||||
ACPI_GLOBAL (BOOLEAN, AcpiGbl_DmOpt_Disasm);
|
||||
ACPI_GLOBAL (BOOLEAN, AcpiGbl_DmOpt_Listing);
|
||||
ACPI_GLOBAL (BOOLEAN, AcpiGbl_NumExternalMethods);
|
||||
ACPI_GLOBAL (UINT32, AcpiGbl_ResolvedExternalMethods);
|
||||
ACPI_GLOBAL (ACPI_EXTERNAL_LIST *, AcpiGbl_ExternalList);
|
||||
|
@ -420,13 +426,16 @@ ACPI_GLOBAL (char, AcpiGbl_DbDebugFilename[ACPI_DB_LINE_BUF
|
|||
/*
|
||||
* Statistic globals
|
||||
*/
|
||||
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_ObjTypeCount[ACPI_TOTAL_TYPES]);
|
||||
ACPI_GLOBAL (UINT16, AcpiGbl_NodeTypeCount[ACPI_TOTAL_TYPES]);
|
||||
ACPI_GLOBAL (UINT16, AcpiGbl_ObjTypeCountMisc);
|
||||
ACPI_GLOBAL (UINT16, AcpiGbl_NodeTypeCountMisc);
|
||||
ACPI_GLOBAL (UINT32, AcpiGbl_NumNodes);
|
||||
ACPI_GLOBAL (UINT32, AcpiGbl_NumObjects);
|
||||
|
||||
ACPI_GLOBAL (ACPI_MUTEX, AcpiGbl_DbCommandReady);
|
||||
ACPI_GLOBAL (ACPI_MUTEX, AcpiGbl_DbCommandComplete);
|
||||
|
||||
#endif /* ACPI_DEBUGGER */
|
||||
|
||||
|
||||
|
|
|
@ -215,6 +215,35 @@ AcpiExDoDebugObject (
|
|||
UINT32 Level,
|
||||
UINT32 Index);
|
||||
|
||||
void
|
||||
AcpiExStartTraceMethod (
|
||||
ACPI_NAMESPACE_NODE *MethodNode,
|
||||
ACPI_OPERAND_OBJECT *ObjDesc,
|
||||
ACPI_WALK_STATE *WalkState);
|
||||
|
||||
void
|
||||
AcpiExStopTraceMethod (
|
||||
ACPI_NAMESPACE_NODE *MethodNode,
|
||||
ACPI_OPERAND_OBJECT *ObjDesc,
|
||||
ACPI_WALK_STATE *WalkState);
|
||||
|
||||
void
|
||||
AcpiExStartTraceOpcode (
|
||||
ACPI_PARSE_OBJECT *Op,
|
||||
ACPI_WALK_STATE *WalkState);
|
||||
|
||||
void
|
||||
AcpiExStopTraceOpcode (
|
||||
ACPI_PARSE_OBJECT *Op,
|
||||
ACPI_WALK_STATE *WalkState);
|
||||
|
||||
void
|
||||
AcpiExTracePoint (
|
||||
ACPI_TRACE_EVENT_TYPE Type,
|
||||
BOOLEAN Begin,
|
||||
UINT8 *Aml,
|
||||
char *Pathname);
|
||||
|
||||
|
||||
/*
|
||||
* exfield - ACPI AML (p-code) execution - field manipulation
|
||||
|
@ -710,6 +739,11 @@ AcpiExIntegerToString (
|
|||
char *Dest,
|
||||
UINT64 Value);
|
||||
|
||||
void
|
||||
AcpiExPciClsToString (
|
||||
char *Dest,
|
||||
UINT8 ClassCode[3]);
|
||||
|
||||
BOOLEAN
|
||||
AcpiIsValidSpaceId (
|
||||
UINT8 SpaceId);
|
||||
|
|
|
@ -159,10 +159,8 @@ union acpi_parse_object;
|
|||
#define ACPI_MTX_EVENTS 3 /* Data for ACPI events */
|
||||
#define ACPI_MTX_CACHES 4 /* Internal caches, general purposes */
|
||||
#define ACPI_MTX_MEMORY 5 /* Debug memory tracking lists */
|
||||
#define ACPI_MTX_DEBUG_CMD_COMPLETE 6 /* AML debugger */
|
||||
#define ACPI_MTX_DEBUG_CMD_READY 7 /* AML debugger */
|
||||
|
||||
#define ACPI_MAX_MUTEX 7
|
||||
#define ACPI_MAX_MUTEX 5
|
||||
#define ACPI_NUM_MUTEX ACPI_MAX_MUTEX+1
|
||||
|
||||
|
||||
|
@ -265,8 +263,12 @@ typedef struct acpi_namespace_node
|
|||
*/
|
||||
#ifdef ACPI_LARGE_NAMESPACE_NODE
|
||||
union acpi_parse_object *Op;
|
||||
void *MethodLocals;
|
||||
void *MethodArgs;
|
||||
UINT32 Value;
|
||||
UINT32 Length;
|
||||
UINT8 ArgCount;
|
||||
|
||||
#endif
|
||||
|
||||
} ACPI_NAMESPACE_NODE;
|
||||
|
@ -306,10 +308,9 @@ typedef struct acpi_table_list
|
|||
#define ACPI_ROOT_ALLOW_RESIZE (2)
|
||||
|
||||
|
||||
/* Predefined (fixed) table indexes */
|
||||
/* Predefined table indexes */
|
||||
|
||||
#define ACPI_TABLE_INDEX_DSDT (0)
|
||||
#define ACPI_TABLE_INDEX_FACS (1)
|
||||
#define ACPI_INVALID_TABLE_INDEX (0xFFFFFFFF)
|
||||
|
||||
|
||||
typedef struct acpi_find_context
|
||||
|
@ -397,13 +398,17 @@ ACPI_STATUS (*ACPI_INTERNAL_METHOD) (
|
|||
#define ACPI_BTYPE_BUFFER_FIELD 0x00002000
|
||||
#define ACPI_BTYPE_DDB_HANDLE 0x00004000
|
||||
#define ACPI_BTYPE_DEBUG_OBJECT 0x00008000
|
||||
#define ACPI_BTYPE_REFERENCE 0x00010000
|
||||
#define ACPI_BTYPE_REFERENCE_OBJECT 0x00010000 /* From Index(), RefOf(), etc (Type6Opcodes) */
|
||||
#define ACPI_BTYPE_RESOURCE 0x00020000
|
||||
#define ACPI_BTYPE_NAMED_REFERENCE 0x00040000 /* Generic unresolved Name or Namepath */
|
||||
|
||||
#define ACPI_BTYPE_COMPUTE_DATA (ACPI_BTYPE_INTEGER | ACPI_BTYPE_STRING | ACPI_BTYPE_BUFFER)
|
||||
|
||||
#define ACPI_BTYPE_DATA (ACPI_BTYPE_COMPUTE_DATA | ACPI_BTYPE_PACKAGE)
|
||||
#define ACPI_BTYPE_DATA_REFERENCE (ACPI_BTYPE_DATA | ACPI_BTYPE_REFERENCE | ACPI_BTYPE_DDB_HANDLE)
|
||||
|
||||
/* Used by Copy, DeRefOf, Store, Printf, Fprintf */
|
||||
|
||||
#define ACPI_BTYPE_DATA_REFERENCE (ACPI_BTYPE_DATA | ACPI_BTYPE_REFERENCE_OBJECT | ACPI_BTYPE_DDB_HANDLE)
|
||||
#define ACPI_BTYPE_DEVICE_OBJECTS (ACPI_BTYPE_DEVICE | ACPI_BTYPE_THERMAL | ACPI_BTYPE_PROCESSOR)
|
||||
#define ACPI_BTYPE_OBJECTS_AND_REFS 0x0001FFFF /* ARG or LOCAL */
|
||||
#define ACPI_BTYPE_ALL_OBJECTS 0x0000FFFF
|
||||
|
@ -473,12 +478,24 @@ typedef struct acpi_package_info3
|
|||
|
||||
} ACPI_PACKAGE_INFO3;
|
||||
|
||||
typedef struct acpi_package_info4
|
||||
{
|
||||
UINT8 Type;
|
||||
UINT8 ObjectType1;
|
||||
UINT8 Count1;
|
||||
UINT8 SubObjectTypes;
|
||||
UINT8 PkgCount;
|
||||
UINT16 Reserved;
|
||||
|
||||
} ACPI_PACKAGE_INFO4;
|
||||
|
||||
typedef union acpi_predefined_info
|
||||
{
|
||||
ACPI_NAME_INFO Info;
|
||||
ACPI_PACKAGE_INFO RetInfo;
|
||||
ACPI_PACKAGE_INFO2 RetInfo2;
|
||||
ACPI_PACKAGE_INFO3 RetInfo3;
|
||||
ACPI_PACKAGE_INFO4 RetInfo4;
|
||||
|
||||
} ACPI_PREDEFINED_INFO;
|
||||
|
||||
|
@ -520,6 +537,16 @@ typedef struct acpi_simple_repair_info
|
|||
#define ACPI_NUM_RTYPES 5 /* Number of actual object types */
|
||||
|
||||
|
||||
/* Info for running the _REG methods */
|
||||
|
||||
typedef struct acpi_reg_walk_info
|
||||
{
|
||||
ACPI_ADR_SPACE_TYPE SpaceId;
|
||||
UINT32 RegRunCount;
|
||||
|
||||
} ACPI_REG_WALK_INFO;
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
*
|
||||
* Event typedefs and structs
|
||||
|
@ -923,7 +950,7 @@ typedef union acpi_parse_value
|
|||
} ACPI_PARSE_VALUE;
|
||||
|
||||
|
||||
#ifdef ACPI_DISASSEMBLER
|
||||
#if defined(ACPI_DISASSEMBLER) || defined(ACPI_DEBUG_OUTPUT)
|
||||
#define ACPI_DISASM_ONLY_MEMBERS(a) a;
|
||||
#else
|
||||
#define ACPI_DISASM_ONLY_MEMBERS(a)
|
||||
|
@ -934,7 +961,7 @@ typedef union acpi_parse_value
|
|||
UINT8 DescriptorType; /* To differentiate various internal objs */\
|
||||
UINT8 Flags; /* Type of Op */\
|
||||
UINT16 AmlOpcode; /* AML opcode */\
|
||||
UINT32 AmlOffset; /* Offset of declaration in AML */\
|
||||
UINT8 *Aml; /* Address of declaration in AML */\
|
||||
union acpi_parse_object *Next; /* Next op */\
|
||||
ACPI_NAMESPACE_NODE *Node; /* For use by interpreter */\
|
||||
ACPI_PARSE_VALUE Value; /* Value or args associated with the opcode */\
|
||||
|
@ -1064,7 +1091,7 @@ typedef struct acpi_parse_state
|
|||
#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_CLOSING_PAREN 0x10
|
||||
#define ACPI_PARSEOP_COMPOUND 0x20
|
||||
#define ACPI_PARSEOP_ASSIGNMENT 0x40
|
||||
|
||||
|
@ -1350,7 +1377,9 @@ typedef struct acpi_db_method_info
|
|||
* Index of current thread inside all them created.
|
||||
*/
|
||||
char InitArgs;
|
||||
#ifdef ACPI_DEBUGGER
|
||||
ACPI_OBJECT_TYPE ArgTypes[4];
|
||||
#endif
|
||||
char *Arguments[4];
|
||||
char NumThreadsStr[11];
|
||||
char IdOfThreadStr[11];
|
||||
|
@ -1372,6 +1401,13 @@ typedef struct acpi_integrity_info
|
|||
#define ACPI_DB_DUPLICATE_OUTPUT 0x03
|
||||
|
||||
|
||||
typedef struct acpi_object_info
|
||||
{
|
||||
UINT32 Types[ACPI_TOTAL_TYPES];
|
||||
|
||||
} ACPI_OBJECT_INFO;
|
||||
|
||||
|
||||
/*****************************************************************************
|
||||
*
|
||||
* Debug
|
||||
|
@ -1443,4 +1479,11 @@ typedef struct ah_uuid
|
|||
|
||||
} AH_UUID;
|
||||
|
||||
typedef struct ah_table
|
||||
{
|
||||
char *Signature;
|
||||
char *Description;
|
||||
|
||||
} AH_TABLE;
|
||||
|
||||
#endif /* __ACLOCAL_H__ */
|
||||
|
|
|
@ -295,6 +295,16 @@
|
|||
#define ACPI_MUL_32(a) _ACPI_MUL(a, 5)
|
||||
#define ACPI_MOD_32(a) _ACPI_MOD(a, 32)
|
||||
|
||||
/* Test for ASCII character */
|
||||
|
||||
#define ACPI_IS_ASCII(c) ((c) < 0x80)
|
||||
|
||||
/* Signed integers */
|
||||
|
||||
#define ACPI_SIGN_POSITIVE 0
|
||||
#define ACPI_SIGN_NEGATIVE 1
|
||||
|
||||
|
||||
/*
|
||||
* Rounding macros (Power of two boundaries only)
|
||||
*/
|
||||
|
|
|
@ -123,6 +123,7 @@
|
|||
#define METHOD_NAME__BBN "_BBN"
|
||||
#define METHOD_NAME__CBA "_CBA"
|
||||
#define METHOD_NAME__CID "_CID"
|
||||
#define METHOD_NAME__CLS "_CLS"
|
||||
#define METHOD_NAME__CRS "_CRS"
|
||||
#define METHOD_NAME__DDN "_DDN"
|
||||
#define METHOD_NAME__HID "_HID"
|
||||
|
|
|
@ -139,6 +139,7 @@
|
|||
#define ACPI_NS_PREFIX_IS_SCOPE 0x10
|
||||
#define ACPI_NS_EXTERNAL 0x20
|
||||
#define ACPI_NS_TEMPORARY 0x40
|
||||
#define ACPI_NS_OVERRIDE_IF_FOUND 0x80
|
||||
|
||||
/* Flags for AcpiNsWalkNamespace */
|
||||
|
||||
|
@ -421,16 +422,22 @@ UINT32
|
|||
AcpiNsOpensScope (
|
||||
ACPI_OBJECT_TYPE Type);
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiNsBuildExternalPath (
|
||||
ACPI_NAMESPACE_NODE *Node,
|
||||
ACPI_SIZE Size,
|
||||
char *NameBuffer);
|
||||
|
||||
char *
|
||||
AcpiNsGetExternalPathname (
|
||||
ACPI_NAMESPACE_NODE *Node);
|
||||
|
||||
UINT32
|
||||
AcpiNsBuildNormalizedPath (
|
||||
ACPI_NAMESPACE_NODE *Node,
|
||||
char *FullPath,
|
||||
UINT32 PathSize,
|
||||
BOOLEAN NoTrailing);
|
||||
|
||||
char *
|
||||
AcpiNsGetNormalizedPathname (
|
||||
ACPI_NAMESPACE_NODE *Node,
|
||||
BOOLEAN NoTrailing);
|
||||
|
||||
char *
|
||||
AcpiNsNameOfCurrentScope (
|
||||
ACPI_WALK_STATE *WalkState);
|
||||
|
@ -438,7 +445,8 @@ AcpiNsNameOfCurrentScope (
|
|||
ACPI_STATUS
|
||||
AcpiNsHandleToPathname (
|
||||
ACPI_HANDLE TargetHandle,
|
||||
ACPI_BUFFER *Buffer);
|
||||
ACPI_BUFFER *Buffer,
|
||||
BOOLEAN NoTrailing);
|
||||
|
||||
BOOLEAN
|
||||
AcpiNsPatternMatch (
|
||||
|
|
|
@ -285,6 +285,7 @@ typedef struct acpi_object_method
|
|||
UINT8 ParamCount;
|
||||
UINT8 SyncLevel;
|
||||
union acpi_operand_object *Mutex;
|
||||
union acpi_operand_object *Node;
|
||||
UINT8 *AmlStart;
|
||||
union
|
||||
{
|
||||
|
@ -502,13 +503,14 @@ typedef struct acpi_object_addr_handler
|
|||
typedef struct acpi_object_reference
|
||||
{
|
||||
ACPI_OBJECT_COMMON_HEADER
|
||||
UINT8 Class; /* Reference Class */
|
||||
UINT8 TargetType; /* Used for Index Op */
|
||||
UINT8 Reserved;
|
||||
void *Object; /* NameOp=>HANDLE to obj, IndexOp=>ACPI_OPERAND_OBJECT */
|
||||
ACPI_NAMESPACE_NODE *Node; /* RefOf or Namepath */
|
||||
union acpi_operand_object **Where; /* Target of Index */
|
||||
UINT32 Value; /* Used for Local/Arg/Index/DdbHandle */
|
||||
UINT8 Class; /* Reference Class */
|
||||
UINT8 TargetType; /* Used for Index Op */
|
||||
UINT8 Reserved;
|
||||
void *Object; /* NameOp=>HANDLE to obj, IndexOp=>ACPI_OPERAND_OBJECT */
|
||||
ACPI_NAMESPACE_NODE *Node; /* RefOf or Namepath */
|
||||
union acpi_operand_object **Where; /* Target of Index */
|
||||
UINT8 *IndexPointer; /* Used for Buffers and Strings */
|
||||
UINT32 Value; /* Used for Local/Arg/Index/DdbHandle */
|
||||
|
||||
} ACPI_OBJECT_REFERENCE;
|
||||
|
||||
|
|
|
@ -285,7 +285,7 @@
|
|||
#define ARGI_ARG4 ARG_NONE
|
||||
#define ARGI_ARG5 ARG_NONE
|
||||
#define ARGI_ARG6 ARG_NONE
|
||||
#define ARGI_BANK_FIELD_OP ARGI_INVALID_OPCODE
|
||||
#define ARGI_BANK_FIELD_OP ARGI_LIST1 (ARGI_INTEGER)
|
||||
#define ARGI_BIT_AND_OP ARGI_LIST3 (ARGI_INTEGER, ARGI_INTEGER, ARGI_TARGETREF)
|
||||
#define ARGI_BIT_NAND_OP ARGI_LIST3 (ARGI_INTEGER, ARGI_INTEGER, ARGI_TARGETREF)
|
||||
#define ARGI_BIT_NOR_OP ARGI_LIST3 (ARGI_INTEGER, ARGI_INTEGER, ARGI_TARGETREF)
|
||||
|
@ -381,7 +381,7 @@
|
|||
#define ARGI_SLEEP_OP ARGI_LIST1 (ARGI_INTEGER)
|
||||
#define ARGI_STALL_OP ARGI_LIST1 (ARGI_INTEGER)
|
||||
#define ARGI_STATICSTRING_OP ARGI_INVALID_OPCODE
|
||||
#define ARGI_STORE_OP ARGI_LIST2 (ARGI_DATAREFOBJ, ARGI_TARGETREF)
|
||||
#define ARGI_STORE_OP ARGI_LIST2 (ARGI_DATAREFOBJ, ARGI_STORE_TARGET)
|
||||
#define ARGI_STRING_OP ARGI_INVALID_OPCODE
|
||||
#define ARGI_SUBTRACT_OP ARGI_LIST3 (ARGI_INTEGER, ARGI_INTEGER, ARGI_TARGETREF)
|
||||
#define ARGI_THERMAL_ZONE_OP ARGI_INVALID_OPCODE
|
||||
|
|
|
@ -161,7 +161,8 @@
|
|||
#define ACPI_LV_DEBUG_OBJECT 0x00000002
|
||||
#define ACPI_LV_INFO 0x00000004
|
||||
#define ACPI_LV_REPAIR 0x00000008
|
||||
#define ACPI_LV_ALL_EXCEPTIONS 0x0000000F
|
||||
#define ACPI_LV_TRACE_POINT 0x00000010
|
||||
#define ACPI_LV_ALL_EXCEPTIONS 0x0000001F
|
||||
|
||||
/* Trace verbosity level 1 [Standard Trace Level] */
|
||||
|
||||
|
@ -221,6 +222,7 @@
|
|||
#define ACPI_DB_DEBUG_OBJECT ACPI_DEBUG_LEVEL (ACPI_LV_DEBUG_OBJECT)
|
||||
#define ACPI_DB_INFO ACPI_DEBUG_LEVEL (ACPI_LV_INFO)
|
||||
#define ACPI_DB_REPAIR ACPI_DEBUG_LEVEL (ACPI_LV_REPAIR)
|
||||
#define ACPI_DB_TRACE_POINT ACPI_DEBUG_LEVEL (ACPI_LV_TRACE_POINT)
|
||||
#define ACPI_DB_ALL_EXCEPTIONS ACPI_DEBUG_LEVEL (ACPI_LV_ALL_EXCEPTIONS)
|
||||
|
||||
/* Trace level -- also used in the global "DebugLevel" */
|
||||
|
@ -257,6 +259,21 @@
|
|||
#define ACPI_DEBUG_ALL (ACPI_LV_AML_DISASSEMBLE | ACPI_LV_ALL_EXCEPTIONS | ACPI_LV_ALL)
|
||||
|
||||
|
||||
/*
|
||||
* Global trace flags
|
||||
*/
|
||||
#define ACPI_TRACE_ENABLED ((UINT32) 4)
|
||||
#define ACPI_TRACE_ONESHOT ((UINT32) 2)
|
||||
#define ACPI_TRACE_OPCODE ((UINT32) 1)
|
||||
|
||||
/* Defaults for trace debugging level/layer */
|
||||
|
||||
#define ACPI_TRACE_LEVEL_ALL ACPI_LV_ALL
|
||||
#define ACPI_TRACE_LAYER_ALL 0x000001FF
|
||||
#define ACPI_TRACE_LEVEL_DEFAULT ACPI_LV_TRACE_POINT
|
||||
#define ACPI_TRACE_LAYER_DEFAULT ACPI_EXECUTER
|
||||
|
||||
|
||||
#if defined (ACPI_DEBUG_OUTPUT) || !defined (ACPI_NO_ERROR_MESSAGES)
|
||||
/*
|
||||
* The module name is used primarily for error and debug messages.
|
||||
|
@ -370,8 +387,12 @@
|
|||
|
||||
/* DEBUG_PRINT functions */
|
||||
|
||||
#define ACPI_DEBUG_PRINT(plist) ACPI_ACTUAL_DEBUG plist
|
||||
#define ACPI_DEBUG_PRINT_RAW(plist) ACPI_ACTUAL_DEBUG_RAW plist
|
||||
#ifndef COMPILER_VA_MACRO
|
||||
|
||||
#define ACPI_DEBUG_PRINT(plist) AcpiDebugPrint plist
|
||||
#define ACPI_DEBUG_PRINT_RAW(plist) AcpiDebugPrintRaw plist
|
||||
|
||||
#else
|
||||
|
||||
/* Helper macros for DEBUG_PRINT */
|
||||
|
||||
|
@ -391,6 +412,11 @@
|
|||
ACPI_DO_DEBUG_PRINT (AcpiDebugPrintRaw, Level, Line, \
|
||||
Filename, Modulename, Component, __VA_ARGS__)
|
||||
|
||||
#define ACPI_DEBUG_PRINT(plist) ACPI_ACTUAL_DEBUG plist
|
||||
#define ACPI_DEBUG_PRINT_RAW(plist) ACPI_ACTUAL_DEBUG_RAW plist
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Function entry tracing
|
||||
|
@ -502,6 +528,8 @@
|
|||
#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)
|
||||
|
||||
#define ACPI_TRACE_POINT(a, b, c, d) AcpiTracePoint (a, b, c, d)
|
||||
|
||||
#else /* ACPI_DEBUG_OUTPUT */
|
||||
/*
|
||||
* This is the non-debug case -- make everything go away,
|
||||
|
@ -523,6 +551,7 @@
|
|||
#define ACPI_DUMP_PATHNAME(a, b, c, d)
|
||||
#define ACPI_DUMP_BUFFER(a, b)
|
||||
#define ACPI_IS_DEBUG_ENABLED(Level, Component) 0
|
||||
#define ACPI_TRACE_POINT(a, b, c, d)
|
||||
|
||||
/* Return macros must have a return statement at the minimum */
|
||||
|
||||
|
|
|
@ -144,6 +144,9 @@
|
|||
*
|
||||
*****************************************************************************/
|
||||
|
||||
extern const UINT8 AcpiGbl_ShortOpIndex[];
|
||||
extern const UINT8 AcpiGbl_LongOpIndex[];
|
||||
|
||||
|
||||
/*
|
||||
* psxface - Parser external interfaces
|
||||
|
@ -375,7 +378,7 @@ AcpiPsDeleteParseTree (
|
|||
*/
|
||||
ACPI_PARSE_OBJECT *
|
||||
AcpiPsCreateScopeOp (
|
||||
void);
|
||||
UINT8 *Aml);
|
||||
|
||||
void
|
||||
AcpiPsInitOp (
|
||||
|
@ -384,7 +387,8 @@ AcpiPsInitOp (
|
|||
|
||||
ACPI_PARSE_OBJECT *
|
||||
AcpiPsAllocOp (
|
||||
UINT16 opcode);
|
||||
UINT16 Opcode,
|
||||
UINT8 *Aml);
|
||||
|
||||
void
|
||||
AcpiPsFreeOp (
|
||||
|
|
|
@ -671,5 +671,14 @@ AcpiOsSetFileOffset (
|
|||
UINT8 From);
|
||||
#endif
|
||||
|
||||
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsTracePoint
|
||||
void
|
||||
AcpiOsTracePoint (
|
||||
ACPI_TRACE_EVENT_TYPE Type,
|
||||
BOOLEAN Begin,
|
||||
UINT8 *Aml,
|
||||
char *Pathname);
|
||||
#endif
|
||||
|
||||
|
||||
#endif /* __ACPIOSXF_H__ */
|
||||
|
|
|
@ -118,7 +118,7 @@
|
|||
|
||||
/* Current ACPICA subsystem version in YYYYMMDD format */
|
||||
|
||||
#define ACPI_CA_VERSION 0x20150410
|
||||
#define ACPI_CA_VERSION 0x20150930
|
||||
|
||||
#include "acconfig.h"
|
||||
#include "actypes.h"
|
||||
|
@ -273,6 +273,15 @@ ACPI_INIT_GLOBAL (UINT8, AcpiGbl_DoNotUseXsdt, FALSE);
|
|||
*/
|
||||
ACPI_INIT_GLOBAL (UINT8, AcpiGbl_Use32BitFadtAddresses, FALSE);
|
||||
|
||||
/*
|
||||
* Optionally use 32-bit FACS table addresses.
|
||||
* It is reported that some platforms fail to resume from system suspending
|
||||
* if 64-bit FACS table address is selected:
|
||||
* https://bugzilla.kernel.org/show_bug.cgi?id=74021
|
||||
* Default is TRUE, favor the 32-bit addresses.
|
||||
*/
|
||||
ACPI_INIT_GLOBAL (UINT8, AcpiGbl_Use32BitFacsAddresses, TRUE);
|
||||
|
||||
/*
|
||||
* Optionally truncate I/O addresses to 16 bits. Provides compatibility
|
||||
* with other ACPI implementations. NOTE: During ACPICA initialization,
|
||||
|
@ -293,6 +302,11 @@ ACPI_INIT_GLOBAL (UINT8, AcpiGbl_DisableAutoRepair, FALSE);
|
|||
*/
|
||||
ACPI_INIT_GLOBAL (UINT8, AcpiGbl_DisableSsdtTableInstall, FALSE);
|
||||
|
||||
/*
|
||||
* Optionally enable runtime namespace override.
|
||||
*/
|
||||
ACPI_INIT_GLOBAL (UINT8, AcpiGbl_RuntimeNamespaceOverride, TRUE);
|
||||
|
||||
/*
|
||||
* We keep track of the latest version of Windows that has been requested by
|
||||
* the BIOS. ACPI 5.0.
|
||||
|
@ -311,7 +325,9 @@ ACPI_INIT_GLOBAL (BOOLEAN, AcpiGbl_ReducedHardware, FALSE);
|
|||
* traced each time it is executed.
|
||||
*/
|
||||
ACPI_INIT_GLOBAL (UINT32, AcpiGbl_TraceFlags, 0);
|
||||
ACPI_INIT_GLOBAL (ACPI_NAME, AcpiGbl_TraceMethodName, 0);
|
||||
ACPI_INIT_GLOBAL (const char *, AcpiGbl_TraceMethodName, NULL);
|
||||
ACPI_INIT_GLOBAL (UINT32, AcpiGbl_TraceDbgLevel, ACPI_TRACE_LEVEL_DEFAULT);
|
||||
ACPI_INIT_GLOBAL (UINT32, AcpiGbl_TraceDbgLayer, ACPI_TRACE_LAYER_DEFAULT);
|
||||
|
||||
/*
|
||||
* Runtime configuration of debug output control masks. We want the debug
|
||||
|
@ -668,7 +684,7 @@ AcpiGetData (
|
|||
ACPI_EXTERNAL_RETURN_STATUS (
|
||||
ACPI_STATUS
|
||||
AcpiDebugTrace (
|
||||
char *Name,
|
||||
const char *Name,
|
||||
UINT32 DebugLevel,
|
||||
UINT32 DebugLayer,
|
||||
UINT32 Flags))
|
||||
|
@ -1138,14 +1154,8 @@ AcpiLeaveSleepState (
|
|||
ACPI_HW_DEPENDENT_RETURN_STATUS (
|
||||
ACPI_STATUS
|
||||
AcpiSetFirmwareWakingVector (
|
||||
UINT32 PhysicalAddress))
|
||||
|
||||
#if ACPI_MACHINE_WIDTH == 64
|
||||
ACPI_HW_DEPENDENT_RETURN_STATUS (
|
||||
ACPI_STATUS
|
||||
AcpiSetFirmwareWakingVector64 (
|
||||
UINT64 PhysicalAddress))
|
||||
#endif
|
||||
ACPI_PHYSICAL_ADDRESS PhysicalAddress,
|
||||
ACPI_PHYSICAL_ADDRESS PhysicalAddress64))
|
||||
|
||||
|
||||
/*
|
||||
|
@ -1255,6 +1265,14 @@ AcpiDebugPrintRaw (
|
|||
const char *Format,
|
||||
...))
|
||||
|
||||
ACPI_DBG_DEPENDENT_RETURN_VOID (
|
||||
void
|
||||
AcpiTracePoint (
|
||||
ACPI_TRACE_EVENT_TYPE Type,
|
||||
BOOLEAN Begin,
|
||||
UINT8 *Aml,
|
||||
char *Pathname))
|
||||
|
||||
ACPI_APP_DEPENDENT_RETURN_VOID (
|
||||
ACPI_PRINTF_LIKE(1)
|
||||
void ACPI_INTERNAL_VAR_XFACE
|
||||
|
@ -1262,4 +1280,12 @@ AcpiLogError (
|
|||
const char *Format,
|
||||
...))
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiInitializeDebugger (
|
||||
void);
|
||||
|
||||
void
|
||||
AcpiTerminateDebugger (
|
||||
void);
|
||||
|
||||
#endif /* __ACXFACE_H__ */
|
||||
|
|
|
@ -178,6 +178,11 @@
|
|||
* count = 0 (optional)
|
||||
* (Used for _DLM)
|
||||
*
|
||||
* ACPI_PTYPE2_VAR_VAR: Variable number of subpackages, each of either a
|
||||
* constant or variable length. The subpackages are preceded by a
|
||||
* constant number of objects.
|
||||
* (Used for _LPI, _RDI)
|
||||
*
|
||||
* ACPI_PTYPE2_UUID_PAIR: Each subpackage is preceded by a UUID Buffer. The UUID
|
||||
* defines the format of the package. Zero-length parent package is
|
||||
* allowed.
|
||||
|
@ -197,7 +202,8 @@ enum AcpiReturnPackageTypes
|
|||
ACPI_PTYPE2_MIN = 8,
|
||||
ACPI_PTYPE2_REV_FIXED = 9,
|
||||
ACPI_PTYPE2_FIX_VAR = 10,
|
||||
ACPI_PTYPE2_UUID_PAIR = 11
|
||||
ACPI_PTYPE2_VAR_VAR = 11,
|
||||
ACPI_PTYPE2_UUID_PAIR = 12
|
||||
};
|
||||
|
||||
|
||||
|
@ -249,7 +255,7 @@ enum AcpiReturnPackageTypes
|
|||
* These are the names that can actually be evaluated via AcpiEvaluateObject.
|
||||
* Not present in this table are the following:
|
||||
*
|
||||
* 1) Predefined/Reserved names that are never evaluated via
|
||||
* 1) Predefined/Reserved names that are not usually evaluated via
|
||||
* AcpiEvaluateObject:
|
||||
* _Lxx and _Exx GPE methods
|
||||
* _Qxx EC methods
|
||||
|
@ -435,6 +441,9 @@ const ACPI_PREDEFINED_INFO AcpiGbl_PredefinedMethods[] =
|
|||
METHOD_RETURNS (ACPI_RTYPE_PACKAGE)}}, /* Fixed-length (4 Int) */
|
||||
PACKAGE_INFO (ACPI_PTYPE1_FIXED, ACPI_RTYPE_INTEGER, 4,0,0,0),
|
||||
|
||||
{{"_BTH", METHOD_1ARGS (ACPI_TYPE_INTEGER), /* ACPI 6.0 */
|
||||
METHOD_NO_RETURN_VALUE}},
|
||||
|
||||
{{"_BTM", METHOD_1ARGS (ACPI_TYPE_INTEGER),
|
||||
METHOD_RETURNS (ACPI_RTYPE_INTEGER)}},
|
||||
|
||||
|
@ -462,6 +471,9 @@ const ACPI_PREDEFINED_INFO AcpiGbl_PredefinedMethods[] =
|
|||
METHOD_RETURNS (ACPI_RTYPE_PACKAGE)}}, /* Variable-length (Ints/Bufs) */
|
||||
PACKAGE_INFO (ACPI_PTYPE1_VAR, ACPI_RTYPE_INTEGER | ACPI_RTYPE_BUFFER, 0,0,0,0),
|
||||
|
||||
{{"_CR3", METHOD_0ARGS, /* ACPI 6.0 */
|
||||
METHOD_RETURNS (ACPI_RTYPE_INTEGER)}},
|
||||
|
||||
{{"_CRS", METHOD_0ARGS,
|
||||
METHOD_RETURNS (ACPI_RTYPE_BUFFER)}},
|
||||
|
||||
|
@ -515,7 +527,7 @@ const ACPI_PREDEFINED_INFO AcpiGbl_PredefinedMethods[] =
|
|||
{{"_DOS", METHOD_1ARGS (ACPI_TYPE_INTEGER),
|
||||
METHOD_NO_RETURN_VALUE}},
|
||||
|
||||
{{"_DSD", METHOD_0ARGS,
|
||||
{{"_DSD", METHOD_0ARGS, /* ACPI 6.0 */
|
||||
METHOD_RETURNS (ACPI_RTYPE_PACKAGE)}}, /* Variable-length (Pkgs) each: 1 Buf, 1 Pkg */
|
||||
PACKAGE_INFO (ACPI_PTYPE2_UUID_PAIR, ACPI_RTYPE_BUFFER, 1, ACPI_RTYPE_PACKAGE, 1,0),
|
||||
|
||||
|
@ -669,6 +681,11 @@ const ACPI_PREDEFINED_INFO AcpiGbl_PredefinedMethods[] =
|
|||
METHOD_RETURNS (ACPI_RTYPE_PACKAGE)}}, /* Variable-length (1 Int(rev), n Pkg (2 Int) */
|
||||
PACKAGE_INFO (ACPI_PTYPE2_REV_FIXED, ACPI_RTYPE_INTEGER, 2,0,0,0),
|
||||
|
||||
{{"_LPI", METHOD_0ARGS, /* ACPI 6.0 */
|
||||
METHOD_RETURNS (ACPI_RTYPE_PACKAGE)}}, /* Variable-length (3 Int, n Pkg (10 Int/Buf) */
|
||||
PACKAGE_INFO (ACPI_PTYPE2_VAR_VAR, ACPI_RTYPE_INTEGER, 3,
|
||||
ACPI_RTYPE_INTEGER | ACPI_RTYPE_BUFFER | ACPI_RTYPE_STRING, 10,0),
|
||||
|
||||
{{"_MAT", METHOD_0ARGS,
|
||||
METHOD_RETURNS (ACPI_RTYPE_BUFFER)}},
|
||||
|
||||
|
@ -686,6 +703,9 @@ const ACPI_PREDEFINED_INFO AcpiGbl_PredefinedMethods[] =
|
|||
{{"_MSM", METHOD_4ARGS (ACPI_TYPE_INTEGER, ACPI_TYPE_INTEGER, ACPI_TYPE_INTEGER, ACPI_TYPE_INTEGER),
|
||||
METHOD_RETURNS (ACPI_RTYPE_INTEGER)}},
|
||||
|
||||
{{"_MTL", METHOD_0ARGS, /* ACPI 6.0 */
|
||||
METHOD_RETURNS (ACPI_RTYPE_INTEGER)}},
|
||||
|
||||
{{"_NTT", METHOD_0ARGS,
|
||||
METHOD_RETURNS (ACPI_RTYPE_INTEGER)}},
|
||||
|
||||
|
@ -773,6 +793,10 @@ const ACPI_PREDEFINED_INFO AcpiGbl_PredefinedMethods[] =
|
|||
METHOD_RETURNS (ACPI_RTYPE_PACKAGE)}}, /* Variable-length (Refs) */
|
||||
PACKAGE_INFO (ACPI_PTYPE1_VAR, ACPI_RTYPE_REFERENCE, 0,0,0,0),
|
||||
|
||||
{{"_PRR", METHOD_0ARGS, /* ACPI 6.0 */
|
||||
METHOD_RETURNS (ACPI_RTYPE_PACKAGE)}}, /* Fixed-length (1 Ref) */
|
||||
PACKAGE_INFO (ACPI_PTYPE1_FIXED, ACPI_RTYPE_REFERENCE, 1,0,0,0),
|
||||
|
||||
{{"_PRS", METHOD_0ARGS,
|
||||
METHOD_RETURNS (ACPI_RTYPE_BUFFER)}},
|
||||
|
||||
|
@ -850,6 +874,11 @@ const ACPI_PREDEFINED_INFO AcpiGbl_PredefinedMethods[] =
|
|||
{{"_PXM", METHOD_0ARGS,
|
||||
METHOD_RETURNS (ACPI_RTYPE_INTEGER)}},
|
||||
|
||||
{{"_RDI", METHOD_0ARGS, /* ACPI 6.0 */
|
||||
METHOD_RETURNS (ACPI_RTYPE_PACKAGE)}}, /* Variable-length (1 Int, n Pkg (m Ref)) */
|
||||
PACKAGE_INFO (ACPI_PTYPE2_VAR_VAR, ACPI_RTYPE_INTEGER, 1,
|
||||
ACPI_RTYPE_REFERENCE,0,0),
|
||||
|
||||
{{"_REG", METHOD_2ARGS (ACPI_TYPE_INTEGER, ACPI_TYPE_INTEGER),
|
||||
METHOD_NO_RETURN_VALUE}},
|
||||
|
||||
|
@ -862,6 +891,9 @@ const ACPI_PREDEFINED_INFO AcpiGbl_PredefinedMethods[] =
|
|||
{{"_ROM", METHOD_2ARGS (ACPI_TYPE_INTEGER, ACPI_TYPE_INTEGER),
|
||||
METHOD_RETURNS (ACPI_RTYPE_BUFFER)}},
|
||||
|
||||
{{"_RST", METHOD_0ARGS, /* ACPI 6.0 */
|
||||
METHOD_NO_RETURN_VALUE}},
|
||||
|
||||
{{"_RTV", METHOD_0ARGS,
|
||||
METHOD_RETURNS (ACPI_RTYPE_INTEGER)}},
|
||||
|
||||
|
@ -988,6 +1020,9 @@ const ACPI_PREDEFINED_INFO AcpiGbl_PredefinedMethods[] =
|
|||
{{"_TDL", METHOD_0ARGS,
|
||||
METHOD_RETURNS (ACPI_RTYPE_INTEGER)}},
|
||||
|
||||
{{"_TFP", METHOD_0ARGS, /* ACPI 6.0 */
|
||||
METHOD_RETURNS (ACPI_RTYPE_INTEGER)}},
|
||||
|
||||
{{"_TIP", METHOD_1ARGS (ACPI_TYPE_INTEGER),
|
||||
METHOD_RETURNS (ACPI_RTYPE_INTEGER)}},
|
||||
|
||||
|
@ -1011,6 +1046,9 @@ const ACPI_PREDEFINED_INFO AcpiGbl_PredefinedMethods[] =
|
|||
METHOD_RETURNS (ACPI_RTYPE_PACKAGE)}}, /* Variable-length (Pkgs) each 5 Int with count */
|
||||
PACKAGE_INFO (ACPI_PTYPE2_COUNT,ACPI_RTYPE_INTEGER, 5,0,0,0),
|
||||
|
||||
{{"_TSN", METHOD_0ARGS, /* ACPI 6.0 */
|
||||
METHOD_RETURNS (ACPI_RTYPE_REFERENCE)}},
|
||||
|
||||
{{"_TSP", METHOD_0ARGS,
|
||||
METHOD_RETURNS (ACPI_RTYPE_INTEGER)}},
|
||||
|
||||
|
|
|
@ -157,9 +157,10 @@ typedef struct acpi_walk_state
|
|||
UINT8 ReturnUsed;
|
||||
UINT8 ScopeDepth;
|
||||
UINT8 PassNumber; /* Parse pass during table load */
|
||||
BOOLEAN NamespaceOverride; /* Override existing objects */
|
||||
UINT8 ResultSize; /* Total elements for the result stack */
|
||||
UINT8 ResultCount; /* Current number of occupied elements of result stack */
|
||||
UINT32 AmlOffset;
|
||||
UINT8 *Aml;
|
||||
UINT32 ArgTypes;
|
||||
UINT32 MethodBreakpoint; /* For single stepping */
|
||||
UINT32 UserBreakpoint; /* User AML breakpoint */
|
||||
|
|
|
@ -308,18 +308,30 @@ AcpiTbCopyDsdt (
|
|||
|
||||
void
|
||||
AcpiTbInstallTableWithOverride (
|
||||
UINT32 TableIndex,
|
||||
ACPI_TABLE_DESC *NewTableDesc,
|
||||
BOOLEAN Override);
|
||||
BOOLEAN Override,
|
||||
UINT32 *TableIndex);
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiTbInstallFixedTable (
|
||||
ACPI_PHYSICAL_ADDRESS Address,
|
||||
char *Signature,
|
||||
UINT32 TableIndex);
|
||||
UINT32 *TableIndex);
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiTbParseRootTable (
|
||||
ACPI_PHYSICAL_ADDRESS RsdpAddress);
|
||||
|
||||
BOOLEAN
|
||||
AcpiIsValidSignature (
|
||||
char *Signature);
|
||||
|
||||
|
||||
/*
|
||||
* tbxfload
|
||||
*/
|
||||
ACPI_STATUS
|
||||
AcpiTbLoadNamespace (
|
||||
void);
|
||||
|
||||
#endif /* __ACTABLES_H__ */
|
||||
|
|
|
@ -139,6 +139,7 @@
|
|||
#define ACPI_SIG_DSDT "DSDT" /* Differentiated System Description Table */
|
||||
#define ACPI_SIG_FADT "FACP" /* Fixed ACPI Description Table */
|
||||
#define ACPI_SIG_FACS "FACS" /* Firmware ACPI Control Structure */
|
||||
#define ACPI_SIG_OSDT "OSDT" /* Override System Description Table */
|
||||
#define ACPI_SIG_PSDT "PSDT" /* Persistent System Description Table */
|
||||
#define ACPI_SIG_RSDP "RSD PTR " /* Root System Description Pointer */
|
||||
#define ACPI_SIG_RSDT "RSDT" /* Root System Description Table */
|
||||
|
@ -382,6 +383,7 @@ typedef struct acpi_table_fadt
|
|||
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) */
|
||||
UINT64 HypervisorId; /* Hypervisor Vendor ID (ACPI 6.0) */
|
||||
|
||||
} ACPI_TABLE_FADT;
|
||||
|
||||
|
@ -441,7 +443,7 @@ enum AcpiPreferredPmProfiles
|
|||
PM_TABLET = 8
|
||||
};
|
||||
|
||||
/* Values for SleepStatus and SleepControl registers (V5 FADT) */
|
||||
/* Values for SleepStatus and SleepControl registers (V5+ FADT) */
|
||||
|
||||
#define ACPI_X_WAKE_STATUS 0x80
|
||||
#define ACPI_X_SLEEP_TYPE_MASK 0x1C
|
||||
|
@ -506,15 +508,17 @@ typedef struct acpi_table_desc
|
|||
* 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
|
||||
* FADT V1 size: 0x074
|
||||
* FADT V2 size: 0x084
|
||||
* FADT V3 size: 0x0F4
|
||||
* FADT V4 size: 0x0F4
|
||||
* FADT V5 size: 0x10C
|
||||
* FADT V6 size: 0x114
|
||||
*/
|
||||
#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))
|
||||
#define ACPI_FADT_V5_SIZE (UINT32) (ACPI_FADT_OFFSET (HypervisorId))
|
||||
#define ACPI_FADT_V6_SIZE (UINT32) (sizeof (ACPI_TABLE_FADT))
|
||||
|
||||
#endif /* __ACTBL_H__ */
|
||||
|
|
|
@ -145,6 +145,7 @@
|
|||
#define ACPI_SIG_SBST "SBST" /* Smart Battery Specification Table */
|
||||
#define ACPI_SIG_SLIT "SLIT" /* System Locality Distance Information Table */
|
||||
#define ACPI_SIG_SRAT "SRAT" /* System Resource Affinity Table */
|
||||
#define ACPI_SIG_NFIT "NFIT" /* NVDIMM Firmware Interface Table */
|
||||
|
||||
|
||||
/*
|
||||
|
@ -849,7 +850,8 @@ enum AcpiMadtType
|
|||
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 */
|
||||
ACPI_MADT_TYPE_GENERIC_TRANSLATOR = 15,
|
||||
ACPI_MADT_TYPE_RESERVED = 16 /* 16 and greater are reserved */
|
||||
};
|
||||
|
||||
|
||||
|
@ -1004,7 +1006,7 @@ typedef struct acpi_madt_local_x2apic_nmi
|
|||
} ACPI_MADT_LOCAL_X2APIC_NMI;
|
||||
|
||||
|
||||
/* 11: Generic Interrupt (ACPI 5.0) */
|
||||
/* 11: Generic Interrupt (ACPI 5.0 + ACPI 6.0 changes) */
|
||||
|
||||
typedef struct acpi_madt_generic_interrupt
|
||||
{
|
||||
|
@ -1022,6 +1024,8 @@ typedef struct acpi_madt_generic_interrupt
|
|||
UINT32 VgicInterrupt;
|
||||
UINT64 GicrBaseAddress;
|
||||
UINT64 ArmMpidr;
|
||||
UINT8 EfficiencyClass;
|
||||
UINT8 Reserved2[3];
|
||||
|
||||
} ACPI_MADT_GENERIC_INTERRUPT;
|
||||
|
||||
|
@ -1032,7 +1036,7 @@ typedef struct acpi_madt_generic_interrupt
|
|||
#define ACPI_MADT_VGIC_IRQ_MODE (1<<2) /* 02: VGIC Maintenance Interrupt mode */
|
||||
|
||||
|
||||
/* 12: Generic Distributor (ACPI 5.0) */
|
||||
/* 12: Generic Distributor (ACPI 5.0 + ACPI 6.0 changes) */
|
||||
|
||||
typedef struct acpi_madt_generic_distributor
|
||||
{
|
||||
|
@ -1041,10 +1045,23 @@ typedef struct acpi_madt_generic_distributor
|
|||
UINT32 GicId;
|
||||
UINT64 BaseAddress;
|
||||
UINT32 GlobalIrqBase;
|
||||
UINT32 Reserved2; /* Reserved - must be zero */
|
||||
UINT8 Version;
|
||||
UINT8 Reserved2[3]; /* Reserved - must be zero */
|
||||
|
||||
} ACPI_MADT_GENERIC_DISTRIBUTOR;
|
||||
|
||||
/* Values for Version field above */
|
||||
|
||||
enum AcpiMadtGicVersion
|
||||
{
|
||||
ACPI_MADT_GIC_VERSION_NONE = 0,
|
||||
ACPI_MADT_GIC_VERSION_V1 = 1,
|
||||
ACPI_MADT_GIC_VERSION_V2 = 2,
|
||||
ACPI_MADT_GIC_VERSION_V3 = 3,
|
||||
ACPI_MADT_GIC_VERSION_V4 = 4,
|
||||
ACPI_MADT_GIC_VERSION_RESERVED = 5 /* 5 and greater are reserved */
|
||||
};
|
||||
|
||||
|
||||
/* 13: Generic MSI Frame (ACPI 5.1) */
|
||||
|
||||
|
@ -1077,6 +1094,19 @@ typedef struct acpi_madt_generic_redistributor
|
|||
} ACPI_MADT_GENERIC_REDISTRIBUTOR;
|
||||
|
||||
|
||||
/* 15: Generic Translator (ACPI 6.0) */
|
||||
|
||||
typedef struct acpi_madt_generic_translator
|
||||
{
|
||||
ACPI_SUBTABLE_HEADER Header;
|
||||
UINT16 Reserved; /* reserved - must be zero */
|
||||
UINT32 TranslationId;
|
||||
UINT64 BaseAddress;
|
||||
UINT32 Reserved2;
|
||||
|
||||
} ACPI_MADT_GENERIC_TRANSLATOR;
|
||||
|
||||
|
||||
/*
|
||||
* Common flags fields for MADT subtables
|
||||
*/
|
||||
|
@ -1135,6 +1165,186 @@ typedef struct acpi_msct_proximity
|
|||
} ACPI_MSCT_PROXIMITY;
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* NFIT - NVDIMM Interface Table (ACPI 6.0)
|
||||
* Version 1
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
typedef struct acpi_table_nfit
|
||||
{
|
||||
ACPI_TABLE_HEADER Header; /* Common ACPI table header */
|
||||
UINT32 Reserved; /* Reserved, must be zero */
|
||||
|
||||
} ACPI_TABLE_NFIT;
|
||||
|
||||
/* Subtable header for NFIT */
|
||||
|
||||
typedef struct acpi_nfit_header
|
||||
{
|
||||
UINT16 Type;
|
||||
UINT16 Length;
|
||||
|
||||
} ACPI_NFIT_HEADER;
|
||||
|
||||
|
||||
/* Values for subtable type in ACPI_NFIT_HEADER */
|
||||
|
||||
enum AcpiNfitType
|
||||
{
|
||||
ACPI_NFIT_TYPE_SYSTEM_ADDRESS = 0,
|
||||
ACPI_NFIT_TYPE_MEMORY_MAP = 1,
|
||||
ACPI_NFIT_TYPE_INTERLEAVE = 2,
|
||||
ACPI_NFIT_TYPE_SMBIOS = 3,
|
||||
ACPI_NFIT_TYPE_CONTROL_REGION = 4,
|
||||
ACPI_NFIT_TYPE_DATA_REGION = 5,
|
||||
ACPI_NFIT_TYPE_FLUSH_ADDRESS = 6,
|
||||
ACPI_NFIT_TYPE_RESERVED = 7 /* 7 and greater are reserved */
|
||||
};
|
||||
|
||||
/*
|
||||
* NFIT Subtables
|
||||
*/
|
||||
|
||||
/* 0: System Physical Address Range Structure */
|
||||
|
||||
typedef struct acpi_nfit_system_address
|
||||
{
|
||||
ACPI_NFIT_HEADER Header;
|
||||
UINT16 RangeIndex;
|
||||
UINT16 Flags;
|
||||
UINT32 Reserved; /* Reseved, must be zero */
|
||||
UINT32 ProximityDomain;
|
||||
UINT8 RangeGuid[16];
|
||||
UINT64 Address;
|
||||
UINT64 Length;
|
||||
UINT64 MemoryMapping;
|
||||
|
||||
} ACPI_NFIT_SYSTEM_ADDRESS;
|
||||
|
||||
/* Flags */
|
||||
|
||||
#define ACPI_NFIT_ADD_ONLINE_ONLY (1) /* 00: Add/Online Operation Only */
|
||||
#define ACPI_NFIT_PROXIMITY_VALID (1<<1) /* 01: Proximity Domain Valid */
|
||||
|
||||
/* Range Type GUIDs appear in the include/acuuid.h file */
|
||||
|
||||
|
||||
/* 1: Memory Device to System Address Range Map Structure */
|
||||
|
||||
typedef struct acpi_nfit_memory_map
|
||||
{
|
||||
ACPI_NFIT_HEADER Header;
|
||||
UINT32 DeviceHandle;
|
||||
UINT16 PhysicalId;
|
||||
UINT16 RegionId;
|
||||
UINT16 RangeIndex;
|
||||
UINT16 RegionIndex;
|
||||
UINT64 RegionSize;
|
||||
UINT64 RegionOffset;
|
||||
UINT64 Address;
|
||||
UINT16 InterleaveIndex;
|
||||
UINT16 InterleaveWays;
|
||||
UINT16 Flags;
|
||||
UINT16 Reserved; /* Reserved, must be zero */
|
||||
|
||||
} ACPI_NFIT_MEMORY_MAP;
|
||||
|
||||
/* Flags */
|
||||
|
||||
#define ACPI_NFIT_MEM_SAVE_FAILED (1) /* 00: Last SAVE to Memory Device failed */
|
||||
#define ACPI_NFIT_MEM_RESTORE_FAILED (1<<1) /* 01: Last RESTORE from Memory Device failed */
|
||||
#define ACPI_NFIT_MEM_FLUSH_FAILED (1<<2) /* 02: Platform flush failed */
|
||||
#define ACPI_NFIT_MEM_NOT_ARMED (1<<3) /* 03: Memory Device is not armed */
|
||||
#define ACPI_NFIT_MEM_HEALTH_OBSERVED (1<<4) /* 04: Memory Device observed SMART/health events */
|
||||
#define ACPI_NFIT_MEM_HEALTH_ENABLED (1<<5) /* 05: SMART/health events enabled */
|
||||
|
||||
|
||||
/* 2: Interleave Structure */
|
||||
|
||||
typedef struct acpi_nfit_interleave
|
||||
{
|
||||
ACPI_NFIT_HEADER Header;
|
||||
UINT16 InterleaveIndex;
|
||||
UINT16 Reserved; /* Reserved, must be zero */
|
||||
UINT32 LineCount;
|
||||
UINT32 LineSize;
|
||||
UINT32 LineOffset[1]; /* Variable length */
|
||||
|
||||
} ACPI_NFIT_INTERLEAVE;
|
||||
|
||||
|
||||
/* 3: SMBIOS Management Information Structure */
|
||||
|
||||
typedef struct acpi_nfit_smbios
|
||||
{
|
||||
ACPI_NFIT_HEADER Header;
|
||||
UINT32 Reserved; /* Reserved, must be zero */
|
||||
UINT8 Data[1]; /* Variable length */
|
||||
|
||||
} ACPI_NFIT_SMBIOS;
|
||||
|
||||
|
||||
/* 4: NVDIMM Control Region Structure */
|
||||
|
||||
typedef struct acpi_nfit_control_region
|
||||
{
|
||||
ACPI_NFIT_HEADER Header;
|
||||
UINT16 RegionIndex;
|
||||
UINT16 VendorId;
|
||||
UINT16 DeviceId;
|
||||
UINT16 RevisionId;
|
||||
UINT16 SubsystemVendorId;
|
||||
UINT16 SubsystemDeviceId;
|
||||
UINT16 SubsystemRevisionId;
|
||||
UINT8 Reserved[6]; /* Reserved, must be zero */
|
||||
UINT32 SerialNumber;
|
||||
UINT16 Code;
|
||||
UINT16 Windows;
|
||||
UINT64 WindowSize;
|
||||
UINT64 CommandOffset;
|
||||
UINT64 CommandSize;
|
||||
UINT64 StatusOffset;
|
||||
UINT64 StatusSize;
|
||||
UINT16 Flags;
|
||||
UINT8 Reserved1[6]; /* Reserved, must be zero */
|
||||
|
||||
} ACPI_NFIT_CONTROL_REGION;
|
||||
|
||||
/* Flags */
|
||||
|
||||
#define ACPI_NFIT_CONTROL_BUFFERED (1) /* Block Data Windows implementation is buffered */
|
||||
|
||||
|
||||
/* 5: NVDIMM Block Data Window Region Structure */
|
||||
|
||||
typedef struct acpi_nfit_data_region
|
||||
{
|
||||
ACPI_NFIT_HEADER Header;
|
||||
UINT16 RegionIndex;
|
||||
UINT16 Windows;
|
||||
UINT64 Offset;
|
||||
UINT64 Size;
|
||||
UINT64 Capacity;
|
||||
UINT64 StartAddress;
|
||||
|
||||
} ACPI_NFIT_DATA_REGION;
|
||||
|
||||
|
||||
/* 6: Flush Hint Address Structure */
|
||||
|
||||
typedef struct acpi_nfit_flush_address
|
||||
{
|
||||
ACPI_NFIT_HEADER Header;
|
||||
UINT32 DeviceHandle;
|
||||
UINT16 HintCount;
|
||||
UINT8 Reserved[6]; /* Reserved, must be zero */
|
||||
UINT64 HintAddress[1]; /* Variable length */
|
||||
|
||||
} ACPI_NFIT_FLUSH_ADDRESS;
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* SBST - Smart Battery Specification Table
|
||||
|
@ -1274,6 +1484,7 @@ typedef struct acpi_srat_gicc_affinity
|
|||
|
||||
#define ACPI_SRAT_GICC_ENABLED (1) /* 00: Use affinity structure */
|
||||
|
||||
|
||||
/* Reset to default packing */
|
||||
|
||||
#pragma pack()
|
||||
|
|
|
@ -124,8 +124,8 @@
|
|||
* 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 defined by third-party specifications, and are
|
||||
* not defined directly by the ACPI specification itself.
|
||||
* Generally, the tables in this file are defined by third-party specifications,
|
||||
* and are not defined directly by the ACPI specification itself.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
|
@ -143,6 +143,7 @@
|
|||
#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_IORT "IORT" /* IO Remapping 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 */
|
||||
|
@ -153,6 +154,7 @@
|
|||
#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_TPM2 "TPM2" /* Trusted Platform Module 2.0 H/W interface 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 */
|
||||
|
@ -822,6 +824,156 @@ typedef struct acpi_ibft_target
|
|||
} ACPI_IBFT_TARGET;
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* IORT - IO Remapping Table
|
||||
*
|
||||
* Conforms to "IO Remapping Table System Software on ARM Platforms",
|
||||
* Document number: ARM DEN 0049A, 2015
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
typedef struct acpi_table_iort
|
||||
{
|
||||
ACPI_TABLE_HEADER Header;
|
||||
UINT32 NodeCount;
|
||||
UINT32 NodeOffset;
|
||||
UINT32 Reserved;
|
||||
|
||||
} ACPI_TABLE_IORT;
|
||||
|
||||
|
||||
/*
|
||||
* IORT subtables
|
||||
*/
|
||||
typedef struct acpi_iort_node
|
||||
{
|
||||
UINT8 Type;
|
||||
UINT16 Length;
|
||||
UINT8 Revision;
|
||||
UINT32 Reserved;
|
||||
UINT32 MappingCount;
|
||||
UINT32 MappingOffset;
|
||||
char NodeData[1];
|
||||
|
||||
} ACPI_IORT_NODE;
|
||||
|
||||
/* Values for subtable Type above */
|
||||
|
||||
enum AcpiIortNodeType
|
||||
{
|
||||
ACPI_IORT_NODE_ITS_GROUP = 0x00,
|
||||
ACPI_IORT_NODE_NAMED_COMPONENT = 0x01,
|
||||
ACPI_IORT_NODE_PCI_ROOT_COMPLEX = 0x02,
|
||||
ACPI_IORT_NODE_SMMU = 0x03
|
||||
};
|
||||
|
||||
|
||||
typedef struct acpi_iort_id_mapping
|
||||
{
|
||||
UINT32 InputBase; /* Lowest value in input range */
|
||||
UINT32 IdCount; /* Number of IDs */
|
||||
UINT32 OutputBase; /* Lowest value in output range */
|
||||
UINT32 OutputReference; /* A reference to the output node */
|
||||
UINT32 Flags;
|
||||
|
||||
} ACPI_IORT_ID_MAPPING;
|
||||
|
||||
/* Masks for Flags field above for IORT subtable */
|
||||
|
||||
#define ACPI_IORT_ID_SINGLE_MAPPING (1)
|
||||
|
||||
|
||||
typedef struct acpi_iort_memory_access
|
||||
{
|
||||
UINT32 CacheCoherency;
|
||||
UINT8 Hints;
|
||||
UINT16 Reserved;
|
||||
UINT8 MemoryFlags;
|
||||
|
||||
} ACPI_IORT_MEMORY_ACCESS;
|
||||
|
||||
/* Values for CacheCoherency field above */
|
||||
|
||||
#define ACPI_IORT_NODE_COHERENT 0x00000001 /* The device node is fully coherent */
|
||||
#define ACPI_IORT_NODE_NOT_COHERENT 0x00000000 /* The device node is not coherent */
|
||||
|
||||
/* Masks for Hints field above */
|
||||
|
||||
#define ACPI_IORT_HT_TRANSIENT (1)
|
||||
#define ACPI_IORT_HT_WRITE (1<<1)
|
||||
#define ACPI_IORT_HT_READ (1<<2)
|
||||
#define ACPI_IORT_HT_OVERRIDE (1<<3)
|
||||
|
||||
/* Masks for MemoryFlags field above */
|
||||
|
||||
#define ACPI_IORT_MF_COHERENCY (1)
|
||||
#define ACPI_IORT_MF_ATTRIBUTES (1<<1)
|
||||
|
||||
|
||||
/*
|
||||
* IORT node specific subtables
|
||||
*/
|
||||
typedef struct acpi_iort_its_group
|
||||
{
|
||||
UINT32 ItsCount;
|
||||
UINT32 Identifiers[1]; /* GIC ITS identifier arrary */
|
||||
|
||||
} ACPI_IORT_ITS_GROUP;
|
||||
|
||||
|
||||
typedef struct acpi_iort_named_component
|
||||
{
|
||||
UINT32 NodeFlags;
|
||||
UINT64 MemoryProperties; /* Memory access properties */
|
||||
UINT8 MemoryAddressLimit; /* Memory address size limit */
|
||||
char DeviceName[1]; /* Path of namespace object */
|
||||
|
||||
} ACPI_IORT_NAMED_COMPONENT;
|
||||
|
||||
|
||||
typedef struct acpi_iort_root_complex
|
||||
{
|
||||
UINT64 MemoryProperties; /* Memory access properties */
|
||||
UINT32 AtsAttribute;
|
||||
UINT32 PciSegmentNumber;
|
||||
|
||||
} ACPI_IORT_ROOT_COMPLEX;
|
||||
|
||||
/* Values for AtsAttribute field above */
|
||||
|
||||
#define ACPI_IORT_ATS_SUPPORTED 0x00000001 /* The root complex supports ATS */
|
||||
#define ACPI_IORT_ATS_UNSUPPORTED 0x00000000 /* The root complex doesn't support ATS */
|
||||
|
||||
|
||||
typedef struct acpi_iort_smmu
|
||||
{
|
||||
UINT64 BaseAddress; /* SMMU base address */
|
||||
UINT64 Span; /* Length of memory range */
|
||||
UINT32 Model;
|
||||
UINT32 Flags;
|
||||
UINT32 GlobalInterruptOffset;
|
||||
UINT32 ContextInterruptCount;
|
||||
UINT32 ContextInterruptOffset;
|
||||
UINT32 PmuInterruptCount;
|
||||
UINT32 PmuInterruptOffset;
|
||||
UINT64 Interrupts[1]; /* Interrupt array */
|
||||
|
||||
} ACPI_IORT_SMMU;
|
||||
|
||||
/* Values for Model field above */
|
||||
|
||||
#define ACPI_IORT_SMMU_V1 0x00000000 /* Generic SMMUv1 */
|
||||
#define ACPI_IORT_SMMU_V2 0x00000001 /* Generic SMMUv2 */
|
||||
#define ACPI_IORT_SMMU_CORELINK_MMU400 0x00000002 /* ARM Corelink MMU-400 */
|
||||
#define ACPI_IORT_SMMU_CORELINK_MMU500 0x00000003 /* ARM Corelink MMU-500 */
|
||||
|
||||
/* Masks for Flags field above */
|
||||
|
||||
#define ACPI_IORT_SMMU_DVM_SUPPORTED (1)
|
||||
#define ACPI_IORT_SMMU_COHERENT_WALK (1<<1)
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* IVRS - I/O Virtualization Reporting Structure
|
||||
|
@ -1024,7 +1176,7 @@ typedef struct acpi_ivrs_memory
|
|||
*
|
||||
* LPIT - Low Power Idle Table
|
||||
*
|
||||
* Conforms to "ACPI Low Power Idle Table (LPIT) and _LPD Proposal (DRAFT)"
|
||||
* Conforms to "ACPI Low Power Idle Table (LPIT)" July 2014.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
|
@ -1052,8 +1204,7 @@ typedef struct acpi_lpit_header
|
|||
enum AcpiLpitType
|
||||
{
|
||||
ACPI_LPIT_TYPE_NATIVE_CSTATE = 0x00,
|
||||
ACPI_LPIT_TYPE_SIMPLE_IO = 0x01,
|
||||
ACPI_LPIT_TYPE_RESERVED = 0x02 /* 2 and above are reserved */
|
||||
ACPI_LPIT_TYPE_RESERVED = 0x01 /* 1 and above are reserved */
|
||||
};
|
||||
|
||||
/* Masks for Flags field above */
|
||||
|
@ -1079,24 +1230,6 @@ typedef struct acpi_lpit_native
|
|||
} 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
|
||||
|
@ -1308,21 +1441,103 @@ enum AcpiSpmiInterfaceTypes
|
|||
/*******************************************************************************
|
||||
*
|
||||
* TCPA - Trusted Computing Platform Alliance table
|
||||
* Version 1
|
||||
* Version 2
|
||||
*
|
||||
* Conforms to "TCG PC Specific Implementation Specification",
|
||||
* Version 1.1, August 18, 2003
|
||||
* Conforms to "TCG ACPI Specification, Family 1.2 and 2.0",
|
||||
* December 19, 2014
|
||||
*
|
||||
* NOTE: There are two versions of the table with the same signature --
|
||||
* the client version and the server version. The common PlatformClass
|
||||
* field is used to differentiate the two types of tables.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
typedef struct acpi_table_tcpa
|
||||
typedef struct acpi_table_tcpa_hdr
|
||||
{
|
||||
ACPI_TABLE_HEADER Header; /* Common ACPI table header */
|
||||
UINT16 Reserved;
|
||||
UINT32 MaxLogLength; /* Maximum length for the event log area */
|
||||
UINT16 PlatformClass;
|
||||
|
||||
} ACPI_TABLE_TCPA_HDR;
|
||||
|
||||
/*
|
||||
* Values for PlatformClass above.
|
||||
* This is how the client and server subtables are differentiated
|
||||
*/
|
||||
#define ACPI_TCPA_CLIENT_TABLE 0
|
||||
#define ACPI_TCPA_SERVER_TABLE 1
|
||||
|
||||
|
||||
typedef struct acpi_table_tcpa_client
|
||||
{
|
||||
UINT32 MinimumLogLength; /* Minimum length for the event log area */
|
||||
UINT64 LogAddress; /* Address of the event log area */
|
||||
|
||||
} ACPI_TABLE_TCPA;
|
||||
} ACPI_TABLE_TCPA_CLIENT;
|
||||
|
||||
typedef struct acpi_table_tcpa_server
|
||||
{
|
||||
UINT16 Reserved;
|
||||
UINT64 MinimumLogLength; /* Minimum length for the event log area */
|
||||
UINT64 LogAddress; /* Address of the event log area */
|
||||
UINT16 SpecRevision;
|
||||
UINT8 DeviceFlags;
|
||||
UINT8 InterruptFlags;
|
||||
UINT8 GpeNumber;
|
||||
UINT8 Reserved2[3];
|
||||
UINT32 GlobalInterrupt;
|
||||
ACPI_GENERIC_ADDRESS Address;
|
||||
UINT32 Reserved3;
|
||||
ACPI_GENERIC_ADDRESS ConfigAddress;
|
||||
UINT8 Group;
|
||||
UINT8 Bus; /* PCI Bus/Segment/Function numbers */
|
||||
UINT8 Device;
|
||||
UINT8 Function;
|
||||
|
||||
} ACPI_TABLE_TCPA_SERVER;
|
||||
|
||||
/* Values for DeviceFlags above */
|
||||
|
||||
#define ACPI_TCPA_PCI_DEVICE (1)
|
||||
#define ACPI_TCPA_BUS_PNP (1<<1)
|
||||
#define ACPI_TCPA_ADDRESS_VALID (1<<2)
|
||||
|
||||
/* Values for InterruptFlags above */
|
||||
|
||||
#define ACPI_TCPA_INTERRUPT_MODE (1)
|
||||
#define ACPI_TCPA_INTERRUPT_POLARITY (1<<1)
|
||||
#define ACPI_TCPA_SCI_VIA_GPE (1<<2)
|
||||
#define ACPI_TCPA_GLOBAL_INTERRUPT (1<<3)
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* TPM2 - Trusted Platform Module (TPM) 2.0 Hardware Interface Table
|
||||
* Version 4
|
||||
*
|
||||
* Conforms to "TCG ACPI Specification, Family 1.2 and 2.0",
|
||||
* December 19, 2014
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
typedef struct acpi_table_tpm2
|
||||
{
|
||||
ACPI_TABLE_HEADER Header; /* Common ACPI table header */
|
||||
UINT16 PlatformClass;
|
||||
UINT16 Reserved;
|
||||
UINT64 ControlAddress;
|
||||
UINT32 StartMethod;
|
||||
|
||||
/* Platform-specific data follows */
|
||||
|
||||
} ACPI_TABLE_TPM2;
|
||||
|
||||
/* Values for StartMethod above */
|
||||
|
||||
#define ACPI_TPM2_NOT_ALLOWED 0
|
||||
#define ACPI_TPM2_START_METHOD 2
|
||||
#define ACPI_TPM2_MEMORY_MAPPED 6
|
||||
#define ACPI_TPM2_COMMAND_BUFFER 7
|
||||
#define ACPI_TPM2_COMMAND_BUFFER_WITH_START_METHOD 8
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
|
|
|
@ -124,7 +124,8 @@
|
|||
* 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.
|
||||
* In general, the tables in this file are fully defined within the ACPI
|
||||
* specification.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
|
@ -142,7 +143,9 @@
|
|||
#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_STAO "STAO" /* Status Override table */
|
||||
#define ACPI_SIG_WPBT "WPBT" /* Windows Platform Binary Table */
|
||||
#define ACPI_SIG_XENV "XENV" /* Xen Environment table */
|
||||
|
||||
#define ACPI_SIG_S3PT "S3PT" /* S3 Performance (sub)Table */
|
||||
#define ACPI_SIG_PCCS "PCC" /* PCC Shared Memory Region */
|
||||
|
@ -151,7 +154,6 @@
|
|||
|
||||
#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
|
||||
|
@ -195,6 +197,8 @@ typedef struct acpi_table_bgrt
|
|||
/*******************************************************************************
|
||||
*
|
||||
* DRTM - Dynamic Root of Trust for Measurement table
|
||||
* Conforms to "TCG D-RTM Architecture" June 17 2013, Version 1.0.0
|
||||
* Table version 1
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
|
@ -213,29 +217,50 @@ typedef struct acpi_table_drtm
|
|||
|
||||
} ACPI_TABLE_DRTM;
|
||||
|
||||
/* 1) Validated Tables List */
|
||||
/* Flag Definitions for above */
|
||||
|
||||
typedef struct acpi_drtm_vtl_list
|
||||
#define ACPI_DRTM_ACCESS_ALLOWED (1)
|
||||
#define ACPI_DRTM_ENABLE_GAP_CODE (1<<1)
|
||||
#define ACPI_DRTM_INCOMPLETE_MEASUREMENTS (1<<2)
|
||||
#define ACPI_DRTM_AUTHORITY_ORDER (1<<3)
|
||||
|
||||
|
||||
/* 1) Validated Tables List (64-bit addresses) */
|
||||
|
||||
typedef struct acpi_drtm_vtable_list
|
||||
{
|
||||
UINT32 ValidatedTableListCount;
|
||||
UINT32 ValidatedTableCount;
|
||||
UINT64 ValidatedTables[1];
|
||||
|
||||
} ACPI_DRTM_VTL_LIST;
|
||||
} ACPI_DRTM_VTABLE_LIST;
|
||||
|
||||
/* 2) Resources List */
|
||||
/* 2) Resources List (of Resource Descriptors) */
|
||||
|
||||
/* Resource Descriptor */
|
||||
|
||||
typedef struct acpi_drtm_resource
|
||||
{
|
||||
UINT8 Size[7];
|
||||
UINT8 Type;
|
||||
UINT64 Address;
|
||||
|
||||
} ACPI_DRTM_RESOURCE;
|
||||
|
||||
typedef struct acpi_drtm_resource_list
|
||||
{
|
||||
UINT32 ResourceListCount;
|
||||
UINT32 ResourceCount;
|
||||
ACPI_DRTM_RESOURCE Resources[1];
|
||||
|
||||
} ACPI_DRTM_RESOURCE_LIST;
|
||||
|
||||
/* 3) Platform-specific Identifiers List */
|
||||
|
||||
typedef struct acpi_drtm_id_list
|
||||
typedef struct acpi_drtm_dps_id
|
||||
{
|
||||
UINT32 IdListCount;
|
||||
UINT32 DpsIdLength;
|
||||
UINT8 DpsId[16];
|
||||
|
||||
} ACPI_DRTM_ID_LIST;
|
||||
} ACPI_DRTM_DPS_ID;
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
|
@ -877,37 +902,61 @@ enum AcpiRasfStatus
|
|||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* TPM2 - Trusted Platform Module (TPM) 2.0 Hardware Interface Table
|
||||
* Version 3
|
||||
* STAO - Status Override Table (_STA override) - ACPI 6.0
|
||||
* Version 1
|
||||
*
|
||||
* Conforms to "TPM 2.0 Hardware Interface Table (TPM2)" 29 November 2011
|
||||
* Conforms to "ACPI Specification for Status Override Table"
|
||||
* 6 January 2015
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
typedef struct acpi_table_tpm2
|
||||
typedef struct acpi_table_stao
|
||||
{
|
||||
ACPI_TABLE_HEADER Header; /* Common ACPI table header */
|
||||
UINT32 Flags;
|
||||
UINT64 ControlAddress;
|
||||
UINT32 StartMethod;
|
||||
UINT8 IgnoreUart;
|
||||
|
||||
} ACPI_TABLE_TPM2;
|
||||
} ACPI_TABLE_STAO;
|
||||
|
||||
/* Control area structure (not part of table, pointed to by ControlAddress) */
|
||||
|
||||
typedef struct acpi_tpm2_control
|
||||
/*******************************************************************************
|
||||
*
|
||||
* WPBT - Windows Platform Environment Table (ACPI 6.0)
|
||||
* Version 1
|
||||
*
|
||||
* Conforms to "Windows Platform Binary Table (WPBT)" 29 November 2011
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
typedef struct acpi_table_wpbt
|
||||
{
|
||||
UINT32 Reserved;
|
||||
UINT32 Error;
|
||||
UINT32 Cancel;
|
||||
UINT32 Start;
|
||||
UINT64 InterruptControl;
|
||||
UINT32 CommandSize;
|
||||
UINT64 CommandAddress;
|
||||
UINT32 ResponseSize;
|
||||
UINT64 ResponseAddress;
|
||||
ACPI_TABLE_HEADER Header; /* Common ACPI table header */
|
||||
UINT32 HandoffSize;
|
||||
UINT64 HandoffAddress;
|
||||
UINT8 Layout;
|
||||
UINT8 Type;
|
||||
UINT16 ArgumentsLength;
|
||||
|
||||
} ACPI_TPM2_CONTROL;
|
||||
} ACPI_TABLE_WPBT;
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* XENV - Xen Environment Table (ACPI 6.0)
|
||||
* Version 1
|
||||
*
|
||||
* Conforms to "ACPI Specification for Xen Environment Table" 4 January 2015
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
typedef struct acpi_table_xenv
|
||||
{
|
||||
ACPI_TABLE_HEADER Header; /* Common ACPI table header */
|
||||
UINT64 GrantTableAddress;
|
||||
UINT64 GrantTableSize;
|
||||
UINT32 EventInterrupt;
|
||||
UINT8 EventFlags;
|
||||
|
||||
} ACPI_TABLE_XENV;
|
||||
|
||||
|
||||
/* Reset to default packing */
|
||||
|
|
|
@ -610,6 +610,7 @@ typedef UINT64 ACPI_INTEGER;
|
|||
#define ACPI_CAST_PTR(t, p) ((t *) (ACPI_UINTPTR_T) (p))
|
||||
#define ACPI_CAST_INDIRECT_PTR(t, p) ((t **) (ACPI_UINTPTR_T) (p))
|
||||
#define ACPI_ADD_PTR(t, a, b) ACPI_CAST_PTR (t, (ACPI_CAST_PTR (UINT8, (a)) + (ACPI_SIZE)(b)))
|
||||
#define ACPI_SUB_PTR(t, a, b) ACPI_CAST_PTR (t, (ACPI_CAST_PTR (UINT8, (a)) - (ACPI_SIZE)(b)))
|
||||
#define ACPI_PTR_DIFF(a, b) (ACPI_SIZE) (ACPI_CAST_PTR (UINT8, (a)) - ACPI_CAST_PTR (UINT8, (b)))
|
||||
|
||||
/* Pointer/Integer type conversions */
|
||||
|
@ -626,14 +627,14 @@ typedef UINT64 ACPI_INTEGER;
|
|||
#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))
|
||||
#define ACPI_COMPARE_NAME(a,b) (!strncmp (ACPI_CAST_PTR (char, (a)), ACPI_CAST_PTR (char, (b)), ACPI_NAME_SIZE))
|
||||
#define ACPI_MOVE_NAME(dest,src) (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))
|
||||
#define ACPI_VALIDATE_RSDP_SIG(a) (!strncmp (ACPI_CAST_PTR (char, (a)), ACPI_SIG_RSDP, 8))
|
||||
#define ACPI_MAKE_RSDP_SIG(dest) (memcpy (ACPI_CAST_PTR (char, (dest)), ACPI_SIG_RSDP, 8))
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
|
@ -653,6 +654,7 @@ typedef UINT64 ACPI_INTEGER;
|
|||
#define ACPI_NO_ACPI_ENABLE 0x10
|
||||
#define ACPI_NO_DEVICE_INIT 0x20
|
||||
#define ACPI_NO_OBJECT_INIT 0x40
|
||||
#define ACPI_NO_FACS_INIT 0x80
|
||||
|
||||
/*
|
||||
* Initialization state
|
||||
|
@ -744,6 +746,7 @@ typedef UINT32 ACPI_OBJECT_TYPE;
|
|||
#define ACPI_TYPE_DEBUG_OBJECT 0x10
|
||||
|
||||
#define ACPI_TYPE_EXTERNAL_MAX 0x10
|
||||
#define ACPI_NUM_TYPES (ACPI_TYPE_EXTERNAL_MAX + 1)
|
||||
|
||||
/*
|
||||
* These are object types that do not map directly to the ACPI
|
||||
|
@ -765,6 +768,7 @@ typedef UINT32 ACPI_OBJECT_TYPE;
|
|||
#define ACPI_TYPE_LOCAL_SCOPE 0x1B /* 1 Name, multiple ObjectList Nodes */
|
||||
|
||||
#define ACPI_TYPE_NS_NODE_MAX 0x1B /* Last typecode used within a NS Node */
|
||||
#define ACPI_TOTAL_TYPES (ACPI_TYPE_NS_NODE_MAX + 1)
|
||||
|
||||
/*
|
||||
* These are special object types that never appear in
|
||||
|
@ -838,10 +842,6 @@ typedef UINT32 ACPI_EVENT_STATUS;
|
|||
#define ACPI_GPE_ENABLE 0
|
||||
#define ACPI_GPE_DISABLE 1
|
||||
#define ACPI_GPE_CONDITIONAL_ENABLE 2
|
||||
#define ACPI_GPE_SAVE_MASK 4
|
||||
|
||||
#define ACPI_GPE_ENABLE_SAVE (ACPI_GPE_ENABLE | ACPI_GPE_SAVE_MASK)
|
||||
#define ACPI_GPE_DISABLE_SAVE (ACPI_GPE_DISABLE | ACPI_GPE_SAVE_MASK)
|
||||
|
||||
/*
|
||||
* GPE info flags - Per GPE
|
||||
|
@ -1096,7 +1096,8 @@ typedef struct acpi_buffer
|
|||
*/
|
||||
#define ACPI_FULL_PATHNAME 0
|
||||
#define ACPI_SINGLE_NAME 1
|
||||
#define ACPI_NAME_TYPE_MAX 1
|
||||
#define ACPI_FULL_PATHNAME_NO_TRAILING 2
|
||||
#define ACPI_NAME_TYPE_MAX 2
|
||||
|
||||
|
||||
/*
|
||||
|
@ -1298,6 +1299,10 @@ UINT32 (*ACPI_INTERFACE_HANDLER) (
|
|||
|
||||
#define ACPI_UUID_LENGTH 16
|
||||
|
||||
/* Length of 3-byte PCI class code values when converted back to a string */
|
||||
|
||||
#define ACPI_PCICLS_STRING_SIZE 7 /* Includes null terminator */
|
||||
|
||||
|
||||
/* Structures used for device/processor HID, UID, CID, and SUB */
|
||||
|
||||
|
@ -1326,7 +1331,7 @@ typedef struct acpi_device_info
|
|||
UINT32 Name; /* ACPI object Name */
|
||||
ACPI_OBJECT_TYPE Type; /* ACPI object Type */
|
||||
UINT8 ParamCount; /* If a method, required parameter count */
|
||||
UINT8 Valid; /* Indicates which optional fields are valid */
|
||||
UINT16 Valid; /* Indicates which optional fields are valid */
|
||||
UINT8 Flags; /* Miscellaneous info */
|
||||
UINT8 HighestDstates[4]; /* _SxD values: 0xFF indicates not valid */
|
||||
UINT8 LowestDstates[5]; /* _SxW values: 0xFF indicates not valid */
|
||||
|
@ -1335,6 +1340,7 @@ typedef struct acpi_device_info
|
|||
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 ClassCode; /* _CLS value */
|
||||
ACPI_PNP_DEVICE_ID_LIST CompatibleIdList; /* _CID list <must be last> */
|
||||
|
||||
} ACPI_DEVICE_INFO;
|
||||
|
@ -1345,14 +1351,15 @@ typedef struct acpi_device_info
|
|||
|
||||
/* Flags for Valid field above (AcpiGetObjectInfo) */
|
||||
|
||||
#define ACPI_VALID_STA 0x01
|
||||
#define ACPI_VALID_ADR 0x02
|
||||
#define ACPI_VALID_HID 0x04
|
||||
#define ACPI_VALID_UID 0x08
|
||||
#define ACPI_VALID_SUB 0x10
|
||||
#define ACPI_VALID_CID 0x20
|
||||
#define ACPI_VALID_SXDS 0x40
|
||||
#define ACPI_VALID_SXWS 0x80
|
||||
#define ACPI_VALID_STA 0x0001
|
||||
#define ACPI_VALID_ADR 0x0002
|
||||
#define ACPI_VALID_HID 0x0004
|
||||
#define ACPI_VALID_UID 0x0008
|
||||
#define ACPI_VALID_SUB 0x0010
|
||||
#define ACPI_VALID_CID 0x0020
|
||||
#define ACPI_VALID_CLS 0x0040
|
||||
#define ACPI_VALID_SXDS 0x0100
|
||||
#define ACPI_VALID_SXWS 0x0200
|
||||
|
||||
/* Flags for _STA return value (CurrentStatus above) */
|
||||
|
||||
|
@ -1413,6 +1420,17 @@ typedef struct acpi_memory_list
|
|||
} ACPI_MEMORY_LIST;
|
||||
|
||||
|
||||
/* Definitions of trace event types */
|
||||
|
||||
typedef enum
|
||||
{
|
||||
ACPI_TRACE_AML_METHOD,
|
||||
ACPI_TRACE_AML_OPCODE,
|
||||
ACPI_TRACE_AML_REGION
|
||||
|
||||
} ACPI_TRACE_EVENT_TYPE;
|
||||
|
||||
|
||||
/* Definitions of _OSI support */
|
||||
|
||||
#define ACPI_VENDOR_STRINGS 0x01
|
||||
|
|
|
@ -245,6 +245,30 @@ typedef struct acpi_pkg_info
|
|||
#define DB_DWORD_DISPLAY 4
|
||||
#define DB_QWORD_DISPLAY 8
|
||||
|
||||
|
||||
/*
|
||||
* utnonansi - Non-ANSI C library functions
|
||||
*/
|
||||
void
|
||||
AcpiUtStrupr (
|
||||
char *SrcString);
|
||||
|
||||
void
|
||||
AcpiUtStrlwr (
|
||||
char *SrcString);
|
||||
|
||||
int
|
||||
AcpiUtStricmp (
|
||||
char *String1,
|
||||
char *String2);
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiUtStrtoul64 (
|
||||
char *String,
|
||||
UINT32 Base,
|
||||
UINT64 *RetInteger);
|
||||
|
||||
|
||||
/*
|
||||
* utglobal - Global data structures and procedures
|
||||
*/
|
||||
|
@ -318,116 +342,6 @@ AcpiUtSubsystemShutdown (
|
|||
void);
|
||||
|
||||
|
||||
/*
|
||||
* utclib - Local implementations of C library functions
|
||||
*/
|
||||
#ifndef ACPI_USE_SYSTEM_CLIBRARY
|
||||
|
||||
ACPI_SIZE
|
||||
AcpiUtStrlen (
|
||||
const char *String);
|
||||
|
||||
char *
|
||||
AcpiUtStrchr (
|
||||
const char *String,
|
||||
int ch);
|
||||
|
||||
char *
|
||||
AcpiUtStrcpy (
|
||||
char *DstString,
|
||||
const char *SrcString);
|
||||
|
||||
char *
|
||||
AcpiUtStrncpy (
|
||||
char *DstString,
|
||||
const char *SrcString,
|
||||
ACPI_SIZE Count);
|
||||
|
||||
int
|
||||
AcpiUtMemcmp (
|
||||
const char *Buffer1,
|
||||
const char *Buffer2,
|
||||
ACPI_SIZE Count);
|
||||
|
||||
int
|
||||
AcpiUtStrncmp (
|
||||
const char *String1,
|
||||
const char *String2,
|
||||
ACPI_SIZE Count);
|
||||
|
||||
int
|
||||
AcpiUtStrcmp (
|
||||
const char *String1,
|
||||
const char *String2);
|
||||
|
||||
char *
|
||||
AcpiUtStrcat (
|
||||
char *DstString,
|
||||
const char *SrcString);
|
||||
|
||||
char *
|
||||
AcpiUtStrncat (
|
||||
char *DstString,
|
||||
const char *SrcString,
|
||||
ACPI_SIZE Count);
|
||||
|
||||
UINT32
|
||||
AcpiUtStrtoul (
|
||||
const char *String,
|
||||
char **Terminator,
|
||||
UINT32 Base);
|
||||
|
||||
char *
|
||||
AcpiUtStrstr (
|
||||
char *String1,
|
||||
char *String2);
|
||||
|
||||
void *
|
||||
AcpiUtMemcpy (
|
||||
void *Dest,
|
||||
const void *Src,
|
||||
ACPI_SIZE Count);
|
||||
|
||||
void *
|
||||
AcpiUtMemset (
|
||||
void *Dest,
|
||||
UINT8 Value,
|
||||
ACPI_SIZE Count);
|
||||
|
||||
int
|
||||
AcpiUtToUpper (
|
||||
int c);
|
||||
|
||||
int
|
||||
AcpiUtToLower (
|
||||
int c);
|
||||
|
||||
extern const UINT8 _acpi_ctype[];
|
||||
|
||||
#define _ACPI_XA 0x00 /* extra alphabetic - not supported */
|
||||
#define _ACPI_XS 0x40 /* extra space */
|
||||
#define _ACPI_BB 0x00 /* BEL, BS, etc. - not supported */
|
||||
#define _ACPI_CN 0x20 /* CR, FF, HT, NL, VT */
|
||||
#define _ACPI_DI 0x04 /* '0'-'9' */
|
||||
#define _ACPI_LO 0x02 /* 'a'-'z' */
|
||||
#define _ACPI_PU 0x10 /* punctuation */
|
||||
#define _ACPI_SP 0x08 /* space */
|
||||
#define _ACPI_UP 0x01 /* 'A'-'Z' */
|
||||
#define _ACPI_XD 0x80 /* '0'-'9', 'A'-'F', 'a'-'f' */
|
||||
|
||||
#define ACPI_IS_DIGIT(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_DI))
|
||||
#define ACPI_IS_SPACE(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_SP))
|
||||
#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_XS | _ACPI_PU))
|
||||
#define ACPI_IS_ALPHA(c) (_acpi_ctype[(unsigned char)(c)] & (_ACPI_LO | _ACPI_UP))
|
||||
|
||||
#endif /* !ACPI_USE_SYSTEM_CLIBRARY */
|
||||
|
||||
#define ACPI_IS_ASCII(c) ((c) < 0x80)
|
||||
|
||||
|
||||
/*
|
||||
* utcopy - Object construction and conversion interfaces
|
||||
*/
|
||||
|
@ -587,6 +501,7 @@ AcpiUtReportWarning (
|
|||
char *ModuleName,
|
||||
UINT32 LineNumber);
|
||||
|
||||
|
||||
/*
|
||||
* utdelete - Object deletion and reference counts
|
||||
*/
|
||||
|
@ -674,6 +589,11 @@ AcpiUtExecute_CID (
|
|||
ACPI_NAMESPACE_NODE *DeviceNode,
|
||||
ACPI_PNP_DEVICE_ID_LIST **ReturnCidList);
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiUtExecute_CLS (
|
||||
ACPI_NAMESPACE_NODE *DeviceNode,
|
||||
ACPI_PNP_DEVICE_ID **ReturnId);
|
||||
|
||||
|
||||
/*
|
||||
* utlock - reader/writer locks
|
||||
|
@ -894,7 +814,7 @@ BOOLEAN
|
|||
AcpiUtIsPciRootBridge (
|
||||
char *Id);
|
||||
|
||||
#if (defined ACPI_ASL_COMPILER || defined ACPI_EXEC_APP)
|
||||
#if (defined ACPI_ASL_COMPILER || defined ACPI_EXEC_APP || defined ACPI_NAMES_APP)
|
||||
BOOLEAN
|
||||
AcpiUtIsAmlTable (
|
||||
ACPI_TABLE_HEADER *Table);
|
||||
|
@ -907,11 +827,11 @@ AcpiUtWalkPackageTree (
|
|||
ACPI_PKG_CALLBACK WalkCallback,
|
||||
void *Context);
|
||||
|
||||
|
||||
/* Values for Base above (16=Hex, 10=Decimal) */
|
||||
|
||||
#define ACPI_ANY_BASE 0
|
||||
|
||||
|
||||
UINT32
|
||||
AcpiUtDwordByteSwap (
|
||||
UINT32 Value);
|
||||
|
@ -984,27 +904,6 @@ AcpiUtGetResourceEndTag (
|
|||
* utstring - String and character utilities
|
||||
*/
|
||||
void
|
||||
AcpiUtStrupr (
|
||||
char *SrcString);
|
||||
|
||||
#ifdef ACPI_ASL_COMPILER
|
||||
void
|
||||
AcpiUtStrlwr (
|
||||
char *SrcString);
|
||||
|
||||
int
|
||||
AcpiUtStricmp (
|
||||
char *String1,
|
||||
char *String2);
|
||||
#endif
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiUtStrtoul64 (
|
||||
char *String,
|
||||
UINT32 Base,
|
||||
UINT64 *RetInteger);
|
||||
|
||||
void
|
||||
AcpiUtPrintString (
|
||||
char *String,
|
||||
UINT16 MaxLength);
|
||||
|
@ -1129,6 +1028,7 @@ AcpiUtCreateList (
|
|||
|
||||
#endif /* ACPI_DBG_TRACK_ALLOCATIONS */
|
||||
|
||||
|
||||
/*
|
||||
* utaddress - address range check
|
||||
*/
|
||||
|
@ -1155,6 +1055,7 @@ void
|
|||
AcpiUtDeleteAddressLists (
|
||||
void);
|
||||
|
||||
|
||||
/*
|
||||
* utxferror - various error/warning output functions
|
||||
*/
|
||||
|
@ -1201,6 +1102,7 @@ AcpiUtMethodError (
|
|||
const char *Path,
|
||||
ACPI_STATUS LookupStatus);
|
||||
|
||||
|
||||
/*
|
||||
* Utility functions for ACPI names and IDs
|
||||
*/
|
||||
|
@ -1216,6 +1118,7 @@ const char *
|
|||
AcpiAhMatchUuid (
|
||||
UINT8 *Data);
|
||||
|
||||
|
||||
/*
|
||||
* utprint - printf/vprintf output functions
|
||||
*/
|
||||
|
@ -1257,6 +1160,7 @@ AcpiUtFilePrintf (
|
|||
...);
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* utuuid -- UUID support functions
|
||||
*/
|
||||
|
|
162
reactos/drivers/bus/acpi/acpica/include/acuuid.h
Normal file
162
reactos/drivers/bus/acpi/acpica/include/acuuid.h
Normal file
|
@ -0,0 +1,162 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* Name: acuuid.h - ACPI-related UUID/GUID definitions
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2015, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
#ifndef __ACUUID_H__
|
||||
#define __ACUUID_H__
|
||||
|
||||
/*
|
||||
* Note1: UUIDs and GUIDs are defined to be identical in ACPI.
|
||||
*
|
||||
* Note2: This file is standalone and should remain that way.
|
||||
*/
|
||||
|
||||
/* Controllers */
|
||||
|
||||
#define UUID_GPIO_CONTROLLER "4f248f40-d5e2-499f-834c-27758ea1cd3f"
|
||||
#define UUID_USB_CONTROLLER "ce2ee385-00e6-48cb-9f05-2edb927c4899"
|
||||
#define UUID_SATA_CONTROLLER "e4db149b-fcfe-425b-a6d8-92357d78fc7f"
|
||||
|
||||
/* Devices */
|
||||
|
||||
#define UUID_PCI_HOST_BRIDGE "33db4d5b-1ff7-401c-9657-7441c03dd766"
|
||||
#define UUID_I2C_DEVICE "3cdff6f7-4267-4555-ad05-b30a3d8938de"
|
||||
#define UUID_POWER_BUTTON "dfbcf3c5-e7a5-44e6-9c1f-29c76f6e059c"
|
||||
|
||||
/* Interfaces */
|
||||
|
||||
#define UUID_DEVICE_LABELING "e5c937d0-3553-4d7a-9117-ea4d19c3434d"
|
||||
#define UUID_PHYSICAL_PRESENCE "3dddfaa6-361b-4eb4-a424-8d10089d1653"
|
||||
|
||||
/* NVDIMM - NFIT table */
|
||||
|
||||
#define UUID_VOLATILE_MEMORY "7305944f-fdda-44e3-b16c-3f22d252e5d0"
|
||||
#define UUID_PERSISTENT_MEMORY "66f0d379-b4f3-4074-ac43-0d3318b78cdb"
|
||||
#define UUID_CONTROL_REGION "92f701f6-13b4-405d-910b-299367e8234c"
|
||||
#define UUID_DATA_REGION "91af0530-5d86-470e-a6b0-0a2db9408249"
|
||||
#define UUID_VOLATILE_VIRTUAL_DISK "77ab535a-45fc-624b-5560-f7b281d1f96e"
|
||||
#define UUID_VOLATILE_VIRTUAL_CD "3d5abd30-4175-87ce-6d64-d2ade523c4bb"
|
||||
#define UUID_PERSISTENT_VIRTUAL_DISK "5cea02c9-4d07-69d3-269f-4496fbe096f9"
|
||||
#define UUID_PERSISTENT_VIRTUAL_CD "08018188-42cd-bb48-100f-5387d53ded3d"
|
||||
|
||||
/* Miscellaneous */
|
||||
|
||||
#define UUID_PLATFORM_CAPABILITIES "0811b06e-4a27-44f9-8d60-3cbbc22e7b48"
|
||||
#define UUID_DYNAMIC_ENUMERATION "d8c1a3a6-be9b-4c9b-91bf-c3cb81fc5daf"
|
||||
#define UUID_BATTERY_THERMAL_LIMIT "4c2067e3-887d-475c-9720-4af1d3ed602e"
|
||||
#define UUID_THERMAL_EXTENSIONS "14d399cd-7a27-4b18-8fb4-7cb7b9f4e500"
|
||||
#define UUID_DEVICE_PROPERTIES "daffd814-6eba-4d8c-8a91-bc9bbf4aa301"
|
||||
|
||||
|
||||
#endif /* __AUUID_H__ */
|
|
@ -352,14 +352,15 @@
|
|||
#define ARGI_TARGETREF 0x0F /* Target, subject to implicit conversion */
|
||||
#define ARGI_FIXED_TARGET 0x10 /* Target, no implicit conversion */
|
||||
#define ARGI_SIMPLE_TARGET 0x11 /* Name, Local, Arg -- no implicit conversion */
|
||||
#define ARGI_STORE_TARGET 0x12 /* Target for store is TARGETREF + package objects */
|
||||
|
||||
/* Multiple/complex types */
|
||||
|
||||
#define ARGI_DATAOBJECT 0x12 /* Buffer, String, package or reference to a Node - Used only by SizeOf operator*/
|
||||
#define ARGI_COMPLEXOBJ 0x13 /* Buffer, String, or package (Used by INDEX op only) */
|
||||
#define ARGI_REF_OR_STRING 0x14 /* Reference or String (Used by DEREFOF op only) */
|
||||
#define ARGI_REGION_OR_BUFFER 0x15 /* Used by LOAD op only */
|
||||
#define ARGI_DATAREFOBJ 0x16
|
||||
#define ARGI_DATAOBJECT 0x13 /* Buffer, String, package or reference to a Node - Used only by SizeOf operator*/
|
||||
#define ARGI_COMPLEXOBJ 0x14 /* Buffer, String, or package (Used by INDEX op only) */
|
||||
#define ARGI_REF_OR_STRING 0x15 /* Reference or String (Used by DEREFOF op only) */
|
||||
#define ARGI_REGION_OR_BUFFER 0x16 /* Used by LOAD op only */
|
||||
#define ARGI_DATAREFOBJ 0x17
|
||||
|
||||
/* Note: types above can expand to 0x1F maximum */
|
||||
|
||||
|
|
|
@ -121,10 +121,153 @@
|
|||
#include <stdint.h>
|
||||
#include <unistd.h>
|
||||
#endif
|
||||
#include <efi.h>
|
||||
#include <efistdarg.h>
|
||||
#include <efilib.h>
|
||||
|
||||
#if defined(__x86_64__)
|
||||
#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 7))
|
||||
#define USE_MS_ABI 1
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef _MSC_EXTENSIONS
|
||||
#define EFIAPI __cdecl
|
||||
#elif USE_MS_ABI
|
||||
#define EFIAPI __attribute__((ms_abi))
|
||||
#else
|
||||
#define EFIAPI
|
||||
#endif
|
||||
|
||||
typedef uint8_t UINT8;
|
||||
typedef uint16_t UINT16;
|
||||
typedef int16_t INT16;
|
||||
typedef uint32_t UINT32;
|
||||
typedef int32_t INT32;
|
||||
typedef uint64_t UINT64;
|
||||
typedef int64_t INT64;
|
||||
typedef uint8_t BOOLEAN;
|
||||
typedef uint16_t CHAR16;
|
||||
|
||||
#define VOID void
|
||||
|
||||
#if defined(__ia64__) || defined(__x86_64__)
|
||||
|
||||
#define ACPI_MACHINE_WIDTH 64
|
||||
|
||||
#if defined(__x86_64__)
|
||||
|
||||
/* for x86_64, EFI_FUNCTION_WRAPPER must be defined */
|
||||
|
||||
#ifndef USE_MS_ABI
|
||||
#define USE_EFI_FUNCTION_WRAPPER
|
||||
#endif
|
||||
|
||||
#ifdef _MSC_EXTENSIONS
|
||||
#pragma warning ( disable : 4731 ) /* Suppress warnings about modification of EBP */
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
typedef uint64_t UINTN;
|
||||
typedef int64_t INTN;
|
||||
|
||||
#define EFIERR(a) (0x8000000000000000 | a)
|
||||
|
||||
#else
|
||||
|
||||
#define ACPI_MACHINE_WIDTH 32
|
||||
#define ACPI_USE_NATIVE_DIVIDE
|
||||
|
||||
typedef uint32_t UINTN;
|
||||
typedef int32_t INTN;
|
||||
|
||||
#define EFIERR(a) (0x80000000 | a)
|
||||
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef USE_EFI_FUNCTION_WRAPPER
|
||||
#define __VA_NARG__(...) \
|
||||
__VA_NARG_(_0, ## __VA_ARGS__, __RSEQ_N())
|
||||
#define __VA_NARG_(...) \
|
||||
__VA_ARG_N(__VA_ARGS__)
|
||||
#define __VA_ARG_N( \
|
||||
_0,_1,_2,_3,_4,_5,_6,_7,_8,_9,_10,N,...) N
|
||||
#define __RSEQ_N() \
|
||||
10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0
|
||||
|
||||
#define __VA_ARG_NSUFFIX__(prefix,...) \
|
||||
__VA_ARG_NSUFFIX_N(prefix, __VA_NARG__(__VA_ARGS__))
|
||||
#define __VA_ARG_NSUFFIX_N(prefix,nargs) \
|
||||
__VA_ARG_NSUFFIX_N_(prefix, nargs)
|
||||
#define __VA_ARG_NSUFFIX_N_(prefix,nargs) \
|
||||
prefix ## nargs
|
||||
|
||||
/* Prototypes of EFI cdecl -> stdcall trampolines */
|
||||
|
||||
UINT64 efi_call0(void *func);
|
||||
UINT64 efi_call1(void *func, UINT64 arg1);
|
||||
UINT64 efi_call2(void *func, UINT64 arg1, UINT64 arg2);
|
||||
UINT64 efi_call3(void *func, UINT64 arg1, UINT64 arg2, UINT64 arg3);
|
||||
UINT64 efi_call4(void *func, UINT64 arg1, UINT64 arg2, UINT64 arg3,
|
||||
UINT64 arg4);
|
||||
UINT64 efi_call5(void *func, UINT64 arg1, UINT64 arg2, UINT64 arg3,
|
||||
UINT64 arg4, UINT64 arg5);
|
||||
UINT64 efi_call6(void *func, UINT64 arg1, UINT64 arg2, UINT64 arg3,
|
||||
UINT64 arg4, UINT64 arg5, UINT64 arg6);
|
||||
UINT64 efi_call7(void *func, UINT64 arg1, UINT64 arg2, UINT64 arg3,
|
||||
UINT64 arg4, UINT64 arg5, UINT64 arg6, UINT64 arg7);
|
||||
UINT64 efi_call8(void *func, UINT64 arg1, UINT64 arg2, UINT64 arg3,
|
||||
UINT64 arg4, UINT64 arg5, UINT64 arg6, UINT64 arg7,
|
||||
UINT64 arg8);
|
||||
UINT64 efi_call9(void *func, UINT64 arg1, UINT64 arg2, UINT64 arg3,
|
||||
UINT64 arg4, UINT64 arg5, UINT64 arg6, UINT64 arg7,
|
||||
UINT64 arg8, UINT64 arg9);
|
||||
UINT64 efi_call10(void *func, UINT64 arg1, UINT64 arg2, UINT64 arg3,
|
||||
UINT64 arg4, UINT64 arg5, UINT64 arg6, UINT64 arg7,
|
||||
UINT64 arg8, UINT64 arg9, UINT64 arg10);
|
||||
|
||||
/* Front-ends to efi_callX to avoid compiler warnings */
|
||||
|
||||
#define _cast64_efi_call0(f) \
|
||||
efi_call0(f)
|
||||
#define _cast64_efi_call1(f,a1) \
|
||||
efi_call1(f, (UINT64)(a1))
|
||||
#define _cast64_efi_call2(f,a1,a2) \
|
||||
efi_call2(f, (UINT64)(a1), (UINT64)(a2))
|
||||
#define _cast64_efi_call3(f,a1,a2,a3) \
|
||||
efi_call3(f, (UINT64)(a1), (UINT64)(a2), (UINT64)(a3))
|
||||
#define _cast64_efi_call4(f,a1,a2,a3,a4) \
|
||||
efi_call4(f, (UINT64)(a1), (UINT64)(a2), (UINT64)(a3), (UINT64)(a4))
|
||||
#define _cast64_efi_call5(f,a1,a2,a3,a4,a5) \
|
||||
efi_call5(f, (UINT64)(a1), (UINT64)(a2), (UINT64)(a3), (UINT64)(a4), \
|
||||
(UINT64)(a5))
|
||||
#define _cast64_efi_call6(f,a1,a2,a3,a4,a5,a6) \
|
||||
efi_call6(f, (UINT64)(a1), (UINT64)(a2), (UINT64)(a3), (UINT64)(a4), \
|
||||
(UINT64)(a5), (UINT64)(a6))
|
||||
#define _cast64_efi_call7(f,a1,a2,a3,a4,a5,a6,a7) \
|
||||
efi_call7(f, (UINT64)(a1), (UINT64)(a2), (UINT64)(a3), (UINT64)(a4), \
|
||||
(UINT64)(a5), (UINT64)(a6), (UINT64)(a7))
|
||||
#define _cast64_efi_call8(f,a1,a2,a3,a4,a5,a6,a7,a8) \
|
||||
efi_call8(f, (UINT64)(a1), (UINT64)(a2), (UINT64)(a3), (UINT64)(a4), \
|
||||
(UINT64)(a5), (UINT64)(a6), (UINT64)(a7), (UINT64)(a8))
|
||||
#define _cast64_efi_call9(f,a1,a2,a3,a4,a5,a6,a7,a8,a9) \
|
||||
efi_call9(f, (UINT64)(a1), (UINT64)(a2), (UINT64)(a3), (UINT64)(a4), \
|
||||
(UINT64)(a5), (UINT64)(a6), (UINT64)(a7), (UINT64)(a8), \
|
||||
(UINT64)(a9))
|
||||
#define _cast64_efi_call10(f,a1,a2,a3,a4,a5,a6,a7,a8,a9,a10) \
|
||||
efi_call10(f, (UINT64)(a1), (UINT64)(a2), (UINT64)(a3), (UINT64)(a4), \
|
||||
(UINT64)(a5), (UINT64)(a6), (UINT64)(a7), (UINT64)(a8), \
|
||||
(UINT64)(a9), (UINT64)(a10))
|
||||
|
||||
/* main wrapper (va_num ignored) */
|
||||
|
||||
#define uefi_call_wrapper(func,va_num,...) \
|
||||
__VA_ARG_NSUFFIX__(_cast64_efi_call, __VA_ARGS__) (func , ##__VA_ARGS__)
|
||||
|
||||
#else
|
||||
|
||||
#define uefi_call_wrapper(func, va_num, ...) func(__VA_ARGS__)
|
||||
|
||||
#endif
|
||||
|
||||
/* AED EFI definitions */
|
||||
|
||||
|
@ -168,10 +311,6 @@
|
|||
#undef ACPI_USE_NATIVE_DIVIDE
|
||||
#define ACPI_USE_SYSTEM_INTTYPES
|
||||
|
||||
#define ACPI_FILE SIMPLE_TEXT_OUTPUT_INTERFACE *
|
||||
#define ACPI_FILE_OUT ST->ConOut
|
||||
#define ACPI_FILE_ERR ST->ConOut
|
||||
|
||||
/*
|
||||
* Math helpers
|
||||
*/
|
||||
|
@ -188,21 +327,21 @@
|
|||
(n_hi) >>= 1; \
|
||||
} while (0)
|
||||
|
||||
/*
|
||||
* EFI specific prototypes
|
||||
*/
|
||||
EFI_STATUS
|
||||
efi_main (
|
||||
EFI_HANDLE Image,
|
||||
EFI_SYSTEM_TABLE *SystemTab);
|
||||
|
||||
int
|
||||
acpi_main (
|
||||
int argc,
|
||||
char *argv[]);
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
struct _SIMPLE_TEXT_OUTPUT_INTERFACE;
|
||||
struct _SIMPLE_INPUT_INTERFACE;
|
||||
struct _EFI_FILE_IO_INTERFACE;
|
||||
struct _EFI_FILE_HANDLE;
|
||||
struct _EFI_BOOT_SERVICES;
|
||||
struct _EFI_SYSTEM_TABLE;
|
||||
|
||||
extern struct _EFI_SYSTEM_TABLE *ST;
|
||||
extern struct _EFI_BOOT_SERVICES *BS;
|
||||
|
||||
#define ACPI_FILE struct _SIMPLE_TEXT_OUTPUT_INTERFACE *
|
||||
#define ACPI_FILE_OUT ST->ConOut
|
||||
#define ACPI_FILE_ERR ST->ConOut
|
||||
|
||||
#endif /* __ACEFI_H__ */
|
||||
|
|
927
reactos/drivers/bus/acpi/acpica/include/platform/acefiex.h
Normal file
927
reactos/drivers/bus/acpi/acpica/include/platform/acefiex.h
Normal file
|
@ -0,0 +1,927 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* Name: acefiex.h - Extra OS specific defines, etc. for EFI
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2015, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
#ifndef __ACEFIEX_H__
|
||||
#define __ACEFIEX_H__
|
||||
|
||||
|
||||
#define EFI_ERROR(a) (((INTN) a) < 0)
|
||||
#define EFI_SUCCESS 0
|
||||
#define EFI_LOAD_ERROR EFIERR(1)
|
||||
#define EFI_INVALID_PARAMETER EFIERR(2)
|
||||
#define EFI_UNSUPPORTED EFIERR(3)
|
||||
#define EFI_BAD_BUFFER_SIZE EFIERR(4)
|
||||
#define EFI_BUFFER_TOO_SMALL EFIERR(5)
|
||||
#define EFI_NOT_READY EFIERR(6)
|
||||
#define EFI_DEVICE_ERROR EFIERR(7)
|
||||
#define EFI_WRITE_PROTECTED EFIERR(8)
|
||||
#define EFI_OUT_OF_RESOURCES EFIERR(9)
|
||||
#define EFI_VOLUME_CORRUPTED EFIERR(10)
|
||||
#define EFI_VOLUME_FULL EFIERR(11)
|
||||
#define EFI_NO_MEDIA EFIERR(12)
|
||||
#define EFI_MEDIA_CHANGED EFIERR(13)
|
||||
#define EFI_NOT_FOUND EFIERR(14)
|
||||
#define EFI_ACCESS_DENIED EFIERR(15)
|
||||
#define EFI_NO_RESPONSE EFIERR(16)
|
||||
#define EFI_NO_MAPPING EFIERR(17)
|
||||
#define EFI_TIMEOUT EFIERR(18)
|
||||
#define EFI_NOT_STARTED EFIERR(19)
|
||||
#define EFI_ALREADY_STARTED EFIERR(20)
|
||||
#define EFI_ABORTED EFIERR(21)
|
||||
#define EFI_PROTOCOL_ERROR EFIERR(24)
|
||||
|
||||
|
||||
typedef UINTN EFI_STATUS;
|
||||
typedef VOID *EFI_HANDLE;
|
||||
typedef VOID *EFI_EVENT;
|
||||
|
||||
typedef struct {
|
||||
UINT32 Data1;
|
||||
UINT16 Data2;
|
||||
UINT16 Data3;
|
||||
UINT8 Data4[8];
|
||||
} EFI_GUID;
|
||||
|
||||
typedef struct _EFI_DEVICE_PATH {
|
||||
UINT8 Type;
|
||||
UINT8 SubType;
|
||||
UINT8 Length[2];
|
||||
} EFI_DEVICE_PATH;
|
||||
|
||||
typedef UINT64 EFI_PHYSICAL_ADDRESS;
|
||||
typedef UINT64 EFI_VIRTUAL_ADDRESS;
|
||||
|
||||
typedef enum {
|
||||
AllocateAnyPages,
|
||||
AllocateMaxAddress,
|
||||
AllocateAddress,
|
||||
MaxAllocateType
|
||||
} EFI_ALLOCATE_TYPE;
|
||||
|
||||
typedef enum {
|
||||
EfiReservedMemoryType,
|
||||
EfiLoaderCode,
|
||||
EfiLoaderData,
|
||||
EfiBootServicesCode,
|
||||
EfiBootServicesData,
|
||||
EfiRuntimeServicesCode,
|
||||
EfiRuntimeServicesData,
|
||||
EfiConventionalMemory,
|
||||
EfiUnusableMemory,
|
||||
EfiACPIReclaimMemory,
|
||||
EfiACPIMemoryNVS,
|
||||
EfiMemoryMappedIO,
|
||||
EfiMemoryMappedIOPortSpace,
|
||||
EfiPalCode,
|
||||
EfiMaxMemoryType
|
||||
} EFI_MEMORY_TYPE;
|
||||
|
||||
/* possible caching types for the memory range */
|
||||
#define EFI_MEMORY_UC 0x0000000000000001
|
||||
#define EFI_MEMORY_WC 0x0000000000000002
|
||||
#define EFI_MEMORY_WT 0x0000000000000004
|
||||
#define EFI_MEMORY_WB 0x0000000000000008
|
||||
#define EFI_MEMORY_UCE 0x0000000000000010
|
||||
|
||||
/* physical memory protection on range */
|
||||
#define EFI_MEMORY_WP 0x0000000000001000
|
||||
#define EFI_MEMORY_RP 0x0000000000002000
|
||||
#define EFI_MEMORY_XP 0x0000000000004000
|
||||
|
||||
/* range requires a runtime mapping */
|
||||
#define EFI_MEMORY_RUNTIME 0x8000000000000000
|
||||
|
||||
#define EFI_MEMORY_DESCRIPTOR_VERSION 1
|
||||
typedef struct {
|
||||
UINT32 Type;
|
||||
UINT32 Pad;
|
||||
EFI_PHYSICAL_ADDRESS PhysicalStart;
|
||||
EFI_VIRTUAL_ADDRESS VirtualStart;
|
||||
UINT64 NumberOfPages;
|
||||
UINT64 Attribute;
|
||||
} EFI_MEMORY_DESCRIPTOR;
|
||||
|
||||
typedef struct _EFI_TABLE_HEARDER {
|
||||
UINT64 Signature;
|
||||
UINT32 Revision;
|
||||
UINT32 HeaderSize;
|
||||
UINT32 CRC32;
|
||||
UINT32 Reserved;
|
||||
} EFI_TABLE_HEADER;
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_UNKNOWN_INTERFACE) (
|
||||
void);
|
||||
|
||||
|
||||
/*
|
||||
* Text output protocol
|
||||
*/
|
||||
#define SIMPLE_TEXT_OUTPUT_PROTOCOL \
|
||||
{ 0x387477c2, 0x69c7, 0x11d2, {0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b} }
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_TEXT_RESET) (
|
||||
struct _SIMPLE_TEXT_OUTPUT_INTERFACE *This,
|
||||
BOOLEAN ExtendedVerification);
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_TEXT_OUTPUT_STRING) (
|
||||
struct _SIMPLE_TEXT_OUTPUT_INTERFACE *This,
|
||||
CHAR16 *String);
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_TEXT_TEST_STRING) (
|
||||
struct _SIMPLE_TEXT_OUTPUT_INTERFACE *This,
|
||||
CHAR16 *String);
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_TEXT_QUERY_MODE) (
|
||||
struct _SIMPLE_TEXT_OUTPUT_INTERFACE *This,
|
||||
UINTN ModeNumber,
|
||||
UINTN *Columns,
|
||||
UINTN *Rows);
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_TEXT_SET_MODE) (
|
||||
struct _SIMPLE_TEXT_OUTPUT_INTERFACE *This,
|
||||
UINTN ModeNumber);
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_TEXT_SET_ATTRIBUTE) (
|
||||
struct _SIMPLE_TEXT_OUTPUT_INTERFACE *This,
|
||||
UINTN Attribute);
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_TEXT_CLEAR_SCREEN) (
|
||||
struct _SIMPLE_TEXT_OUTPUT_INTERFACE *This);
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_TEXT_SET_CURSOR_POSITION) (
|
||||
struct _SIMPLE_TEXT_OUTPUT_INTERFACE *This,
|
||||
UINTN Column,
|
||||
UINTN Row);
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_TEXT_ENABLE_CURSOR) (
|
||||
struct _SIMPLE_TEXT_OUTPUT_INTERFACE *This,
|
||||
BOOLEAN Enable);
|
||||
|
||||
typedef struct {
|
||||
INT32 MaxMode;
|
||||
INT32 Mode;
|
||||
INT32 Attribute;
|
||||
INT32 CursorColumn;
|
||||
INT32 CursorRow;
|
||||
BOOLEAN CursorVisible;
|
||||
} SIMPLE_TEXT_OUTPUT_MODE;
|
||||
|
||||
typedef struct _SIMPLE_TEXT_OUTPUT_INTERFACE {
|
||||
EFI_TEXT_RESET Reset;
|
||||
|
||||
EFI_TEXT_OUTPUT_STRING OutputString;
|
||||
EFI_TEXT_TEST_STRING TestString;
|
||||
|
||||
EFI_TEXT_QUERY_MODE QueryMode;
|
||||
EFI_TEXT_SET_MODE SetMode;
|
||||
EFI_TEXT_SET_ATTRIBUTE SetAttribute;
|
||||
|
||||
EFI_TEXT_CLEAR_SCREEN ClearScreen;
|
||||
EFI_TEXT_SET_CURSOR_POSITION SetCursorPosition;
|
||||
EFI_TEXT_ENABLE_CURSOR EnableCursor;
|
||||
|
||||
SIMPLE_TEXT_OUTPUT_MODE *Mode;
|
||||
} SIMPLE_TEXT_OUTPUT_INTERFACE;
|
||||
|
||||
/*
|
||||
* Text input protocol
|
||||
*/
|
||||
#define SIMPLE_TEXT_INPUT_PROTOCOL \
|
||||
{ 0x387477c1, 0x69c7, 0x11d2, {0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b} }
|
||||
|
||||
typedef struct {
|
||||
UINT16 ScanCode;
|
||||
CHAR16 UnicodeChar;
|
||||
} EFI_INPUT_KEY;
|
||||
|
||||
/*
|
||||
* Baseline unicode control chars
|
||||
*/
|
||||
#define CHAR_NULL 0x0000
|
||||
#define CHAR_BACKSPACE 0x0008
|
||||
#define CHAR_TAB 0x0009
|
||||
#define CHAR_LINEFEED 0x000A
|
||||
#define CHAR_CARRIAGE_RETURN 0x000D
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_INPUT_RESET) (
|
||||
struct _SIMPLE_INPUT_INTERFACE *This,
|
||||
BOOLEAN ExtendedVerification);
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_INPUT_READ_KEY) (
|
||||
struct _SIMPLE_INPUT_INTERFACE *This,
|
||||
EFI_INPUT_KEY *Key);
|
||||
|
||||
typedef struct _SIMPLE_INPUT_INTERFACE {
|
||||
EFI_INPUT_RESET Reset;
|
||||
EFI_INPUT_READ_KEY ReadKeyStroke;
|
||||
EFI_EVENT WaitForKey;
|
||||
} SIMPLE_INPUT_INTERFACE;
|
||||
|
||||
|
||||
/*
|
||||
* Simple file system protocol
|
||||
*/
|
||||
#define SIMPLE_FILE_SYSTEM_PROTOCOL \
|
||||
{ 0x964e5b22, 0x6459, 0x11d2, {0x8e, 0x39, 0x0, 0xa0, 0xc9, 0x69, 0x72, 0x3b} }
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_VOLUME_OPEN) (
|
||||
struct _EFI_FILE_IO_INTERFACE *This,
|
||||
struct _EFI_FILE_HANDLE **Root);
|
||||
|
||||
#define EFI_FILE_IO_INTERFACE_REVISION 0x00010000
|
||||
|
||||
typedef struct _EFI_FILE_IO_INTERFACE {
|
||||
UINT64 Revision;
|
||||
EFI_VOLUME_OPEN OpenVolume;
|
||||
} EFI_FILE_IO_INTERFACE;
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_FILE_OPEN) (
|
||||
struct _EFI_FILE_HANDLE *File,
|
||||
struct _EFI_FILE_HANDLE **NewHandle,
|
||||
CHAR16 *FileName,
|
||||
UINT64 OpenMode,
|
||||
UINT64 Attributes);
|
||||
|
||||
/* Values for OpenMode used above */
|
||||
|
||||
#define EFI_FILE_MODE_READ 0x0000000000000001
|
||||
#define EFI_FILE_MODE_WRITE 0x0000000000000002
|
||||
#define EFI_FILE_MODE_CREATE 0x8000000000000000
|
||||
|
||||
/* Values for Attribute used above */
|
||||
|
||||
#define EFI_FILE_READ_ONLY 0x0000000000000001
|
||||
#define EFI_FILE_HIDDEN 0x0000000000000002
|
||||
#define EFI_FILE_SYSTEM 0x0000000000000004
|
||||
#define EFI_FILE_RESERVIED 0x0000000000000008
|
||||
#define EFI_FILE_DIRECTORY 0x0000000000000010
|
||||
#define EFI_FILE_ARCHIVE 0x0000000000000020
|
||||
#define EFI_FILE_VALID_ATTR 0x0000000000000037
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_FILE_CLOSE) (
|
||||
struct _EFI_FILE_HANDLE *File);
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_FILE_DELETE) (
|
||||
struct _EFI_FILE_HANDLE *File);
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_FILE_READ) (
|
||||
struct _EFI_FILE_HANDLE *File,
|
||||
UINTN *BufferSize,
|
||||
VOID *Buffer);
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_FILE_WRITE) (
|
||||
struct _EFI_FILE_HANDLE *File,
|
||||
UINTN *BufferSize,
|
||||
VOID *Buffer);
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_FILE_SET_POSITION) (
|
||||
struct _EFI_FILE_HANDLE *File,
|
||||
UINT64 Position);
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_FILE_GET_POSITION) (
|
||||
struct _EFI_FILE_HANDLE *File,
|
||||
UINT64 *Position);
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_FILE_GET_INFO) (
|
||||
struct _EFI_FILE_HANDLE *File,
|
||||
EFI_GUID *InformationType,
|
||||
UINTN *BufferSize,
|
||||
VOID *Buffer);
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_FILE_SET_INFO) (
|
||||
struct _EFI_FILE_HANDLE *File,
|
||||
EFI_GUID *InformationType,
|
||||
UINTN BufferSize,
|
||||
VOID *Buffer);
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_FILE_FLUSH) (
|
||||
struct _EFI_FILE_HANDLE *File);
|
||||
|
||||
|
||||
#define EFI_FILE_HANDLE_REVISION 0x00010000
|
||||
|
||||
typedef struct _EFI_FILE_HANDLE {
|
||||
UINT64 Revision;
|
||||
EFI_FILE_OPEN Open;
|
||||
EFI_FILE_CLOSE Close;
|
||||
EFI_FILE_DELETE Delete;
|
||||
EFI_FILE_READ Read;
|
||||
EFI_FILE_WRITE Write;
|
||||
EFI_FILE_GET_POSITION GetPosition;
|
||||
EFI_FILE_SET_POSITION SetPosition;
|
||||
EFI_FILE_GET_INFO GetInfo;
|
||||
EFI_FILE_SET_INFO SetInfo;
|
||||
EFI_FILE_FLUSH Flush;
|
||||
} EFI_FILE, *EFI_FILE_HANDLE;
|
||||
|
||||
|
||||
/*
|
||||
* Loaded image protocol
|
||||
*/
|
||||
#define LOADED_IMAGE_PROTOCOL \
|
||||
{ 0x5B1B31A1, 0x9562, 0x11d2, {0x8E, 0x3F, 0x00, 0xA0, 0xC9, 0x69, 0x72, 0x3B} }
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_IMAGE_ENTRY_POINT) (
|
||||
EFI_HANDLE ImageHandle,
|
||||
struct _EFI_SYSTEM_TABLE *SystemTable);
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_IMAGE_LOAD) (
|
||||
BOOLEAN BootPolicy,
|
||||
EFI_HANDLE ParentImageHandle,
|
||||
EFI_DEVICE_PATH *FilePath,
|
||||
VOID *SourceBuffer,
|
||||
UINTN SourceSize,
|
||||
EFI_HANDLE *ImageHandle);
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_IMAGE_START) (
|
||||
EFI_HANDLE ImageHandle,
|
||||
UINTN *ExitDataSize,
|
||||
CHAR16 **ExitData);
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_EXIT) (
|
||||
EFI_HANDLE ImageHandle,
|
||||
EFI_STATUS ExitStatus,
|
||||
UINTN ExitDataSize,
|
||||
CHAR16 *ExitData);
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_IMAGE_UNLOAD) (
|
||||
EFI_HANDLE ImageHandle);
|
||||
|
||||
|
||||
#define EFI_IMAGE_INFORMATION_REVISION 0x1000
|
||||
typedef struct {
|
||||
UINT32 Revision;
|
||||
EFI_HANDLE ParentHandle;
|
||||
struct _EFI_SYSTEM_TABLE *SystemTable;
|
||||
EFI_HANDLE DeviceHandle;
|
||||
EFI_DEVICE_PATH *FilePath;
|
||||
VOID *Reserved;
|
||||
UINT32 LoadOptionsSize;
|
||||
VOID *LoadOptions;
|
||||
VOID *ImageBase;
|
||||
UINT64 ImageSize;
|
||||
EFI_MEMORY_TYPE ImageCodeType;
|
||||
EFI_MEMORY_TYPE ImageDataType;
|
||||
EFI_IMAGE_UNLOAD Unload;
|
||||
|
||||
} EFI_LOADED_IMAGE;
|
||||
|
||||
|
||||
/*
|
||||
* EFI Memory
|
||||
*/
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_ALLOCATE_PAGES) (
|
||||
EFI_ALLOCATE_TYPE Type,
|
||||
EFI_MEMORY_TYPE MemoryType,
|
||||
UINTN NoPages,
|
||||
EFI_PHYSICAL_ADDRESS *Memory);
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_FREE_PAGES) (
|
||||
EFI_PHYSICAL_ADDRESS Memory,
|
||||
UINTN NoPages);
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_GET_MEMORY_MAP) (
|
||||
UINTN *MemoryMapSize,
|
||||
EFI_MEMORY_DESCRIPTOR *MemoryMap,
|
||||
UINTN *MapKey,
|
||||
UINTN *DescriptorSize,
|
||||
UINT32 *DescriptorVersion);
|
||||
|
||||
#define NextMemoryDescriptor(Ptr,Size) ((EFI_MEMORY_DESCRIPTOR *) (((UINT8 *) Ptr) + Size))
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_ALLOCATE_POOL) (
|
||||
EFI_MEMORY_TYPE PoolType,
|
||||
UINTN Size,
|
||||
VOID **Buffer);
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_FREE_POOL) (
|
||||
VOID *Buffer);
|
||||
|
||||
|
||||
/*
|
||||
* Protocol handler functions
|
||||
*/
|
||||
typedef enum {
|
||||
EFI_NATIVE_INTERFACE,
|
||||
EFI_PCODE_INTERFACE
|
||||
} EFI_INTERFACE_TYPE;
|
||||
|
||||
typedef enum {
|
||||
AllHandles,
|
||||
ByRegisterNotify,
|
||||
ByProtocol
|
||||
} EFI_LOCATE_SEARCH_TYPE;
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_INSTALL_PROTOCOL_INTERFACE) (
|
||||
EFI_HANDLE *Handle,
|
||||
EFI_GUID *Protocol,
|
||||
EFI_INTERFACE_TYPE InterfaceType,
|
||||
VOID *Interface);
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_REINSTALL_PROTOCOL_INTERFACE) (
|
||||
EFI_HANDLE Handle,
|
||||
EFI_GUID *Protocol,
|
||||
VOID *OldInterface,
|
||||
VOID *NewInterface);
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_UNINSTALL_PROTOCOL_INTERFACE) (
|
||||
EFI_HANDLE Handle,
|
||||
EFI_GUID *Protocol,
|
||||
VOID *Interface);
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_HANDLE_PROTOCOL) (
|
||||
EFI_HANDLE Handle,
|
||||
EFI_GUID *Protocol,
|
||||
VOID **Interface);
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_REGISTER_PROTOCOL_NOTIFY) (
|
||||
EFI_GUID *Protocol,
|
||||
EFI_EVENT Event,
|
||||
VOID **Registration);
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_LOCATE_HANDLE) (
|
||||
EFI_LOCATE_SEARCH_TYPE SearchType,
|
||||
EFI_GUID *Protocol,
|
||||
VOID *SearchKey,
|
||||
UINTN *BufferSize,
|
||||
EFI_HANDLE *Buffer);
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_LOCATE_DEVICE_PATH) (
|
||||
EFI_GUID *Protocol,
|
||||
EFI_DEVICE_PATH **DevicePath,
|
||||
EFI_HANDLE *Device);
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_INSTALL_CONFIGURATION_TABLE) (
|
||||
EFI_GUID *Guid,
|
||||
VOID *Table);
|
||||
|
||||
#define EFI_OPEN_PROTOCOL_BY_HANDLE_PROTOCOL 0x00000001
|
||||
#define EFI_OPEN_PROTOCOL_GET_PROTOCOL 0x00000002
|
||||
#define EFI_OPEN_PROTOCOL_TEST_PROTOCOL 0x00000004
|
||||
#define EFI_OPEN_PROTOCOL_BY_CHILD_CONTROLLER 0x00000008
|
||||
#define EFI_OPEN_PROTOCOL_BY_DRIVER 0x00000010
|
||||
#define EFI_OPEN_PROTOCOL_EXCLUSIVE 0x00000020
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_OPEN_PROTOCOL) (
|
||||
EFI_HANDLE Handle,
|
||||
EFI_GUID *Protocol,
|
||||
VOID **Interface,
|
||||
EFI_HANDLE AgentHandle,
|
||||
EFI_HANDLE ControllerHandle,
|
||||
UINT32 Attributes);
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_CLOSE_PROTOCOL) (
|
||||
EFI_HANDLE Handle,
|
||||
EFI_GUID *Protocol,
|
||||
EFI_HANDLE AgentHandle,
|
||||
EFI_HANDLE ControllerHandle);
|
||||
|
||||
typedef struct {
|
||||
EFI_HANDLE AgentHandle;
|
||||
EFI_HANDLE ControllerHandle;
|
||||
UINT32 Attributes;
|
||||
UINT32 OpenCount;
|
||||
} EFI_OPEN_PROTOCOL_INFORMATION_ENTRY;
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_OPEN_PROTOCOL_INFORMATION) (
|
||||
EFI_HANDLE Handle,
|
||||
EFI_GUID *Protocol,
|
||||
EFI_OPEN_PROTOCOL_INFORMATION_ENTRY **EntryBuffer,
|
||||
UINTN *EntryCount);
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_PROTOCOLS_PER_HANDLE) (
|
||||
EFI_HANDLE Handle,
|
||||
EFI_GUID ***ProtocolBuffer,
|
||||
UINTN *ProtocolBufferCount);
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_LOCATE_HANDLE_BUFFER) (
|
||||
EFI_LOCATE_SEARCH_TYPE SearchType,
|
||||
EFI_GUID *Protocol,
|
||||
VOID *SearchKey,
|
||||
UINTN *NoHandles,
|
||||
EFI_HANDLE **Buffer);
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_LOCATE_PROTOCOL) (
|
||||
EFI_GUID *Protocol,
|
||||
VOID *Registration,
|
||||
VOID **Interface);
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_INSTALL_MULTIPLE_PROTOCOL_INTERFACES) (
|
||||
EFI_HANDLE *Handle,
|
||||
...);
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_UNINSTALL_MULTIPLE_PROTOCOL_INTERFACES) (
|
||||
EFI_HANDLE Handle,
|
||||
...);
|
||||
|
||||
typedef
|
||||
EFI_STATUS
|
||||
(EFIAPI *EFI_CALCULATE_CRC32) (
|
||||
VOID *Data,
|
||||
UINTN DataSize,
|
||||
UINT32 *Crc32);
|
||||
|
||||
typedef
|
||||
VOID
|
||||
(EFIAPI *EFI_COPY_MEM) (
|
||||
VOID *Destination,
|
||||
VOID *Source,
|
||||
UINTN Length);
|
||||
|
||||
typedef
|
||||
VOID
|
||||
(EFIAPI *EFI_SET_MEM) (
|
||||
VOID *Buffer,
|
||||
UINTN Size,
|
||||
UINT8 Value);
|
||||
|
||||
/*
|
||||
* EFI Boot Services Table
|
||||
*/
|
||||
#define EFI_BOOT_SERVICES_SIGNATURE 0x56524553544f4f42
|
||||
#define EFI_BOOT_SERVICES_REVISION (EFI_SPECIFICATION_MAJOR_REVISION<<16) | (EFI_SPECIFICATION_MINOR_REVISION)
|
||||
|
||||
typedef struct _EFI_BOOT_SERVICES {
|
||||
EFI_TABLE_HEADER Hdr;
|
||||
|
||||
#if 0
|
||||
EFI_RAISE_TPL RaiseTPL;
|
||||
EFI_RESTORE_TPL RestoreTPL;
|
||||
#else
|
||||
EFI_UNKNOWN_INTERFACE RaiseTPL;
|
||||
EFI_UNKNOWN_INTERFACE RestoreTPL;
|
||||
#endif
|
||||
|
||||
EFI_ALLOCATE_PAGES AllocatePages;
|
||||
EFI_FREE_PAGES FreePages;
|
||||
EFI_GET_MEMORY_MAP GetMemoryMap;
|
||||
EFI_ALLOCATE_POOL AllocatePool;
|
||||
EFI_FREE_POOL FreePool;
|
||||
|
||||
#if 0
|
||||
EFI_CREATE_EVENT CreateEvent;
|
||||
EFI_SET_TIMER SetTimer;
|
||||
EFI_WAIT_FOR_EVENT WaitForEvent;
|
||||
EFI_SIGNAL_EVENT SignalEvent;
|
||||
EFI_CLOSE_EVENT CloseEvent;
|
||||
EFI_CHECK_EVENT CheckEvent;
|
||||
#else
|
||||
EFI_UNKNOWN_INTERFACE CreateEvent;
|
||||
EFI_UNKNOWN_INTERFACE SetTimer;
|
||||
EFI_UNKNOWN_INTERFACE WaitForEvent;
|
||||
EFI_UNKNOWN_INTERFACE SignalEvent;
|
||||
EFI_UNKNOWN_INTERFACE CloseEvent;
|
||||
EFI_UNKNOWN_INTERFACE CheckEvent;
|
||||
#endif
|
||||
|
||||
EFI_INSTALL_PROTOCOL_INTERFACE InstallProtocolInterface;
|
||||
EFI_REINSTALL_PROTOCOL_INTERFACE ReinstallProtocolInterface;
|
||||
EFI_UNINSTALL_PROTOCOL_INTERFACE UninstallProtocolInterface;
|
||||
EFI_HANDLE_PROTOCOL HandleProtocol;
|
||||
EFI_HANDLE_PROTOCOL PCHandleProtocol;
|
||||
EFI_REGISTER_PROTOCOL_NOTIFY RegisterProtocolNotify;
|
||||
EFI_LOCATE_HANDLE LocateHandle;
|
||||
EFI_LOCATE_DEVICE_PATH LocateDevicePath;
|
||||
EFI_INSTALL_CONFIGURATION_TABLE InstallConfigurationTable;
|
||||
|
||||
EFI_IMAGE_LOAD LoadImage;
|
||||
EFI_IMAGE_START StartImage;
|
||||
EFI_EXIT Exit;
|
||||
EFI_IMAGE_UNLOAD UnloadImage;
|
||||
|
||||
#if 0
|
||||
EFI_EXIT_BOOT_SERVICES ExitBootServices;
|
||||
EFI_GET_NEXT_MONOTONIC_COUNT GetNextMonotonicCount;
|
||||
EFI_STALL Stall;
|
||||
EFI_SET_WATCHDOG_TIMER SetWatchdogTimer;
|
||||
#else
|
||||
EFI_UNKNOWN_INTERFACE ExitBootServices;
|
||||
EFI_UNKNOWN_INTERFACE GetNextMonotonicCount;
|
||||
EFI_UNKNOWN_INTERFACE Stall;
|
||||
EFI_UNKNOWN_INTERFACE SetWatchdogTimer;
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
EFI_CONNECT_CONTROLLER ConnectController;
|
||||
EFI_DISCONNECT_CONTROLLER DisconnectController;
|
||||
#else
|
||||
EFI_UNKNOWN_INTERFACE ConnectController;
|
||||
EFI_UNKNOWN_INTERFACE DisconnectController;
|
||||
#endif
|
||||
|
||||
EFI_OPEN_PROTOCOL OpenProtocol;
|
||||
EFI_CLOSE_PROTOCOL CloseProtocol;
|
||||
EFI_OPEN_PROTOCOL_INFORMATION OpenProtocolInformation;
|
||||
EFI_PROTOCOLS_PER_HANDLE ProtocolsPerHandle;
|
||||
EFI_LOCATE_HANDLE_BUFFER LocateHandleBuffer;
|
||||
EFI_LOCATE_PROTOCOL LocateProtocol;
|
||||
EFI_INSTALL_MULTIPLE_PROTOCOL_INTERFACES InstallMultipleProtocolInterfaces;
|
||||
EFI_UNINSTALL_MULTIPLE_PROTOCOL_INTERFACES UninstallMultipleProtocolInterfaces;
|
||||
|
||||
EFI_CALCULATE_CRC32 CalculateCrc32;
|
||||
|
||||
EFI_COPY_MEM CopyMem;
|
||||
EFI_SET_MEM SetMem;
|
||||
|
||||
#if 0
|
||||
EFI_CREATE_EVENT_EX CreateEventEx;
|
||||
#else
|
||||
EFI_UNKNOWN_INTERFACE CreateEventEx;
|
||||
#endif
|
||||
} EFI_BOOT_SERVICES;
|
||||
|
||||
|
||||
/*
|
||||
* EFI System Table
|
||||
*/
|
||||
|
||||
/*
|
||||
* EFI Configuration Table and GUID definitions
|
||||
*/
|
||||
#define ACPI_TABLE_GUID \
|
||||
{ 0xeb9d2d30, 0x2d88, 0x11d3, {0x9a, 0x16, 0x0, 0x90, 0x27, 0x3f, 0xc1, 0x4d} }
|
||||
#define ACPI_20_TABLE_GUID \
|
||||
{ 0x8868e871, 0xe4f1, 0x11d3, {0xbc, 0x22, 0x0, 0x80, 0xc7, 0x3c, 0x88, 0x81} }
|
||||
|
||||
typedef struct _EFI_CONFIGURATION_TABLE {
|
||||
EFI_GUID VendorGuid;
|
||||
VOID *VendorTable;
|
||||
} EFI_CONFIGURATION_TABLE;
|
||||
|
||||
|
||||
#define EFI_SYSTEM_TABLE_SIGNATURE 0x5453595320494249
|
||||
#define EFI_SYSTEM_TABLE_REVISION (EFI_SPECIFICATION_MAJOR_REVISION<<16) | (EFI_SPECIFICATION_MINOR_REVISION)
|
||||
|
||||
typedef struct _EFI_SYSTEM_TABLE {
|
||||
EFI_TABLE_HEADER Hdr;
|
||||
|
||||
CHAR16 *FirmwareVendor;
|
||||
UINT32 FirmwareRevision;
|
||||
|
||||
EFI_HANDLE ConsoleInHandle;
|
||||
SIMPLE_INPUT_INTERFACE *ConIn;
|
||||
|
||||
EFI_HANDLE ConsoleOutHandle;
|
||||
SIMPLE_TEXT_OUTPUT_INTERFACE *ConOut;
|
||||
|
||||
EFI_HANDLE StandardErrorHandle;
|
||||
SIMPLE_TEXT_OUTPUT_INTERFACE *StdErr;
|
||||
|
||||
#if 0
|
||||
EFI_RUNTIME_SERVICES *RuntimeServices;
|
||||
#else
|
||||
EFI_HANDLE *RuntimeServices;
|
||||
#endif
|
||||
EFI_BOOT_SERVICES *BootServices;
|
||||
|
||||
UINTN NumberOfTableEntries;
|
||||
EFI_CONFIGURATION_TABLE *ConfigurationTable;
|
||||
|
||||
} EFI_SYSTEM_TABLE;
|
||||
|
||||
|
||||
/* GNU EFI definitions */
|
||||
|
||||
#if defined(_GNU_EFI)
|
||||
|
||||
/*
|
||||
* This is needed to hide platform specific code from ACPICA
|
||||
*/
|
||||
UINT64
|
||||
DivU64x32 (
|
||||
UINT64 Dividend,
|
||||
UINTN Divisor,
|
||||
UINTN *Remainder);
|
||||
|
||||
/*
|
||||
* EFI specific prototypes
|
||||
*/
|
||||
EFI_STATUS
|
||||
efi_main (
|
||||
EFI_HANDLE Image,
|
||||
EFI_SYSTEM_TABLE *SystemTab);
|
||||
|
||||
int
|
||||
acpi_main (
|
||||
int argc,
|
||||
char *argv[]);
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
extern EFI_GUID AcpiGbl_LoadedImageProtocol;
|
||||
extern EFI_GUID AcpiGbl_TextInProtocol;
|
||||
extern EFI_GUID AcpiGbl_TextOutProtocol;
|
||||
extern EFI_GUID AcpiGbl_FileSystemProtocol;
|
||||
|
||||
#endif /* __ACEFIEX_H__ */
|
|
@ -143,13 +143,14 @@
|
|||
|
||||
#ifdef ACPI_ASL_COMPILER
|
||||
#define ACPI_APPLICATION
|
||||
#define ACPI_DISASSEMBLER
|
||||
#define ACPI_DEBUG_OUTPUT
|
||||
#define ACPI_CONSTANT_EVAL_ONLY
|
||||
#define ACPI_LARGE_NAMESPACE_NODE
|
||||
#define ACPI_DATA_TABLE_DISASSEMBLY
|
||||
#define ACPI_SINGLE_THREADED
|
||||
#define ACPI_32BIT_PHYSICAL_ADDRESS
|
||||
|
||||
#define ACPI_DISASSEMBLER 1
|
||||
#endif
|
||||
|
||||
/* AcpiExec configuration. Multithreaded with full AML debugger */
|
||||
|
@ -162,8 +163,8 @@
|
|||
#endif
|
||||
|
||||
/*
|
||||
* AcpiBin/AcpiDump/AcpiHelp/AcpiNames/AcpiSrc/AcpiXtract/Example configuration.
|
||||
* All single threaded.
|
||||
* AcpiBin/AcpiDump/AcpiHelp/AcpiNames/AcpiSrc/AcpiXtract/Example
|
||||
* configuration. All single threaded.
|
||||
*/
|
||||
#if (defined ACPI_BIN_APP) || \
|
||||
(defined ACPI_DUMP_APP) || \
|
||||
|
@ -196,7 +197,7 @@
|
|||
#define ACPI_USE_NATIVE_RSDP_POINTER
|
||||
#endif
|
||||
|
||||
/* AcpiDump configuration. Native mapping used if provied by OSPMs */
|
||||
/* AcpiDump configuration. Native mapping used if provided by the host */
|
||||
|
||||
#ifdef ACPI_DUMP_APP
|
||||
#define ACPI_USE_NATIVE_MEMORY_MAPPING
|
||||
|
@ -214,6 +215,7 @@
|
|||
|
||||
#ifdef ACPI_LIBRARY
|
||||
#define ACPI_USE_LOCAL_CACHE
|
||||
#define ACPI_FULL_DEBUG
|
||||
#endif
|
||||
|
||||
/* Common for all ACPICA applications */
|
||||
|
@ -223,15 +225,14 @@
|
|||
#define ACPI_USE_LOCAL_CACHE
|
||||
#endif
|
||||
|
||||
/* Common debug support */
|
||||
/* Common debug/disassembler support */
|
||||
|
||||
#ifdef ACPI_FULL_DEBUG
|
||||
#define ACPI_DEBUGGER
|
||||
#define ACPI_DEBUG_OUTPUT
|
||||
#define ACPI_DISASSEMBLER
|
||||
#define ACPI_DEBUGGER 1
|
||||
#define ACPI_DISASSEMBLER 1
|
||||
#endif
|
||||
|
||||
|
||||
/*! [Begin] no source code translation */
|
||||
|
||||
/******************************************************************************
|
||||
|
@ -247,6 +248,9 @@
|
|||
#elif defined(_APPLE) || defined(__APPLE__)
|
||||
#include "acmacosx.h"
|
||||
|
||||
#elif defined(__DragonFly__)
|
||||
#include "acdragonfly.h"
|
||||
|
||||
#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
|
||||
#include "acfreebsd.h"
|
||||
|
||||
|
@ -369,6 +373,7 @@
|
|||
#define ACPI_INTERNAL_VAR_XFACE
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
* Debugger threading model
|
||||
* Use single threaded if the entire subsystem is contained in an application
|
||||
|
@ -378,11 +383,11 @@
|
|||
* multi-threaded if ACPI_APPLICATION is not set.
|
||||
*/
|
||||
#ifndef DEBUGGER_THREADING
|
||||
#ifdef ACPI_APPLICATION
|
||||
#define DEBUGGER_THREADING DEBUGGER_SINGLE_THREADED
|
||||
#if !defined (ACPI_APPLICATION) || defined (ACPI_EXEC_APP)
|
||||
#define DEBUGGER_THREADING DEBUGGER_MULTI_THREADED
|
||||
|
||||
#else
|
||||
#define DEBUGGER_THREADING DEBUGGER_MULTI_THREADED
|
||||
#define DEBUGGER_THREADING DEBUGGER_SINGLE_THREADED
|
||||
#endif
|
||||
#endif /* !DEBUGGER_THREADING */
|
||||
|
||||
|
@ -399,8 +404,8 @@
|
|||
* ACPI_USE_STANDARD_HEADERS - Define this if linking to a C library and
|
||||
* the standard header files may be used.
|
||||
*
|
||||
* The ACPICA subsystem only uses low level C library functions that do not call
|
||||
* operating system services and may therefore be inlined in the code.
|
||||
* The ACPICA subsystem only uses low level C library functions that do not
|
||||
* call operating system services and may therefore be inlined in the code.
|
||||
*
|
||||
* It may be necessary to tailor these include files to the target
|
||||
* generation environment.
|
||||
|
@ -422,28 +427,6 @@
|
|||
|
||||
/* We will be linking to the standard Clib functions */
|
||||
|
||||
#define ACPI_STRSTR(s1,s2) strstr((s1), (s2))
|
||||
#define ACPI_STRCHR(s1,c) strchr((s1), (c))
|
||||
#define ACPI_STRLEN(s) (ACPI_SIZE) strlen((s))
|
||||
#define ACPI_STRCPY(d,s) (void) strcpy((d), (s))
|
||||
#define ACPI_STRNCPY(d,s,n) (void) strncpy((d), (s), (ACPI_SIZE)(n))
|
||||
#define ACPI_STRNCMP(d,s,n) strncmp((d), (s), (ACPI_SIZE)(n))
|
||||
#define ACPI_STRCMP(d,s) strcmp((d), (s))
|
||||
#define ACPI_STRCAT(d,s) (void) strcat((d), (s))
|
||||
#define ACPI_STRNCAT(d,s,n) strncat((d), (s), (ACPI_SIZE)(n))
|
||||
#define ACPI_STRTOUL(d,s,n) strtoul((d), (s), (ACPI_SIZE)(n))
|
||||
#define ACPI_MEMCMP(s1,s2,n) memcmp((const char *)(s1), (const char *)(s2), (ACPI_SIZE)(n))
|
||||
#define ACPI_MEMCPY(d,s,n) (void) memcpy((d), (s), (ACPI_SIZE)(n))
|
||||
#define ACPI_MEMSET(d,s,n) (void) memset((d), (s), (ACPI_SIZE)(n))
|
||||
#define ACPI_TOUPPER(i) toupper((int) (i))
|
||||
#define ACPI_TOLOWER(i) tolower((int) (i))
|
||||
#define ACPI_IS_XDIGIT(i) isxdigit((int) (i))
|
||||
#define ACPI_IS_DIGIT(i) isdigit((int) (i))
|
||||
#define ACPI_IS_SPACE(i) isspace((int) (i))
|
||||
#define ACPI_IS_UPPER(i) isupper((int) (i))
|
||||
#define ACPI_IS_PRINT(i) isprint((int) (i))
|
||||
#define ACPI_IS_ALPHA(i) isalpha((int) (i))
|
||||
|
||||
#else
|
||||
|
||||
/******************************************************************************
|
||||
|
@ -481,22 +464,6 @@ typedef char *va_list;
|
|||
|
||||
/* Use the local (ACPICA) definitions of the clib functions */
|
||||
|
||||
#define ACPI_STRSTR(s1,s2) AcpiUtStrstr ((s1), (s2))
|
||||
#define ACPI_STRCHR(s1,c) AcpiUtStrchr ((s1), (c))
|
||||
#define ACPI_STRLEN(s) (ACPI_SIZE) AcpiUtStrlen ((s))
|
||||
#define ACPI_STRCPY(d,s) (void) AcpiUtStrcpy ((d), (s))
|
||||
#define ACPI_STRNCPY(d,s,n) (void) AcpiUtStrncpy ((d), (s), (ACPI_SIZE)(n))
|
||||
#define ACPI_STRNCMP(d,s,n) AcpiUtStrncmp ((d), (s), (ACPI_SIZE)(n))
|
||||
#define ACPI_STRCMP(d,s) AcpiUtStrcmp ((d), (s))
|
||||
#define ACPI_STRCAT(d,s) (void) AcpiUtStrcat ((d), (s))
|
||||
#define ACPI_STRNCAT(d,s,n) AcpiUtStrncat ((d), (s), (ACPI_SIZE)(n))
|
||||
#define ACPI_STRTOUL(d,s,n) AcpiUtStrtoul ((d), (s), (ACPI_SIZE)(n))
|
||||
#define ACPI_MEMCMP(s1,s2,n) AcpiUtMemcmp((const char *)(s1), (const char *)(s2), (ACPI_SIZE)(n))
|
||||
#define ACPI_MEMCPY(d,s,n) (void) AcpiUtMemcpy ((d), (s), (ACPI_SIZE)(n))
|
||||
#define ACPI_MEMSET(d,v,n) (void) AcpiUtMemset ((d), (v), (ACPI_SIZE)(n))
|
||||
#define ACPI_TOUPPER(c) AcpiUtToUpper ((int) (c))
|
||||
#define ACPI_TOLOWER(c) AcpiUtToLower ((int) (c))
|
||||
|
||||
#endif /* ACPI_USE_SYSTEM_CLIBRARY */
|
||||
|
||||
#ifndef ACPI_FILE
|
||||
|
|
|
@ -128,6 +128,18 @@
|
|||
#if defined(_LINUX) || defined(__linux__)
|
||||
#include "aclinuxex.h"
|
||||
|
||||
#elif defined(WIN32)
|
||||
#include "acwinex.h"
|
||||
|
||||
#elif defined(_AED_EFI)
|
||||
#include "acefiex.h"
|
||||
|
||||
#elif defined(_GNU_EFI)
|
||||
#include "acefiex.h"
|
||||
|
||||
#elif defined(__DragonFly__)
|
||||
#include "acdragonflyex.h"
|
||||
|
||||
#endif
|
||||
|
||||
/*! [End] no source code translation !*/
|
||||
|
|
|
@ -147,6 +147,11 @@
|
|||
#undef strchr
|
||||
#endif
|
||||
|
||||
/* GCC supports __VA_ARGS__ in macros */
|
||||
|
||||
#define COMPILER_VA_MACRO 1
|
||||
|
||||
|
||||
#ifdef __REACTOS__
|
||||
/* Flush CPU cache - used when going to sleep. Wbinvd or similar. */
|
||||
|
||||
|
|
|
@ -116,6 +116,14 @@
|
|||
#ifndef __ACMSVC_H__
|
||||
#define __ACMSVC_H__
|
||||
|
||||
/* Note: do not include any C library headers here */
|
||||
|
||||
/*
|
||||
* Note: MSVC project files should define ACPI_DEBUGGER and ACPI_DISASSEMBLER
|
||||
* as appropriate to enable editor functions like "Find all references".
|
||||
* The editor isn't smart enough to dig through the include files to find
|
||||
* out if these are actually defined.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Map low I/O functions for MS. This allows us to disable MS language
|
||||
|
@ -128,7 +136,6 @@
|
|||
#define stat _stat
|
||||
#define fstat _fstat
|
||||
#define mkdir _mkdir
|
||||
#define strlwr _strlwr
|
||||
#define O_RDONLY _O_RDONLY
|
||||
#define O_BINARY _O_BINARY
|
||||
#define O_CREAT _O_CREAT
|
||||
|
@ -282,14 +289,9 @@
|
|||
#endif
|
||||
|
||||
|
||||
/* Debug support. Must be last in this file, do not move. */
|
||||
/* Debug support. */
|
||||
|
||||
#ifdef _DEBUG
|
||||
#define _CRTDBG_MAP_ALLOC /* Enables specific file/lineno for leaks */
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <malloc.h>
|
||||
#include <crtdbg.h>
|
||||
|
||||
/*
|
||||
* Debugging memory corruption issues with windows:
|
||||
|
@ -320,4 +322,9 @@ _CrtSetBreakAlloc (937);
|
|||
|
||||
#endif
|
||||
|
||||
#if _MSC_VER > 1200 /* Versions above VC++ 6 */
|
||||
#define COMPILER_VA_MACRO 1
|
||||
#else
|
||||
#endif
|
||||
|
||||
#endif /* __ACMSVC_H__ */
|
||||
|
|
126
reactos/drivers/bus/acpi/acpica/include/platform/acmsvcex.h
Normal file
126
reactos/drivers/bus/acpi/acpica/include/platform/acmsvcex.h
Normal file
|
@ -0,0 +1,126 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* Name: acmsvcex.h - Extra VC specific defines, etc.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2015, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
#ifndef __ACMSVCEX_H__
|
||||
#define __ACMSVCEX_H__
|
||||
|
||||
/* Debug support. */
|
||||
|
||||
#ifdef _DEBUG
|
||||
#define _CRTDBG_MAP_ALLOC /* Enables specific file/lineno for leaks */
|
||||
#include <crtdbg.h>
|
||||
#endif
|
||||
|
||||
#endif /* __ACMSVCEX_H__ */
|
124
reactos/drivers/bus/acpi/acpica/include/platform/acwinex.h
Normal file
124
reactos/drivers/bus/acpi/acpica/include/platform/acwinex.h
Normal file
|
@ -0,0 +1,124 @@
|
|||
/******************************************************************************
|
||||
*
|
||||
* Name: acwinex.h - Extra OS specific defines, etc.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
/******************************************************************************
|
||||
*
|
||||
* 1. Copyright Notice
|
||||
*
|
||||
* Some or all of this work - Copyright (c) 1999 - 2015, Intel Corp.
|
||||
* All rights reserved.
|
||||
*
|
||||
* 2. License
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
#ifndef __ACWINEX_H__
|
||||
#define __ACWINEX_H__
|
||||
|
||||
/* Windows uses VC */
|
||||
#ifdef _MSC_VER
|
||||
#include "acmsvcex.h"
|
||||
#endif
|
||||
|
||||
#endif /* __ACWINEX_H__ */
|
|
@ -183,7 +183,7 @@ AcpiNsRootInitialize (
|
|||
{
|
||||
/* _OSI is optional for now, will be permanent later */
|
||||
|
||||
if (!ACPI_STRCMP (InitVal->Name, "_OSI") && !AcpiGbl_CreateOsiMethod)
|
||||
if (!strcmp (InitVal->Name, "_OSI") && !AcpiGbl_CreateOsiMethod)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
@ -263,7 +263,7 @@ AcpiNsRootInitialize (
|
|||
|
||||
/* Build an object around the static string */
|
||||
|
||||
ObjDesc->String.Length = (UINT32) ACPI_STRLEN (Val);
|
||||
ObjDesc->String.Length = (UINT32) strlen (Val);
|
||||
ObjDesc->String.Pointer = Val;
|
||||
ObjDesc->Common.Flags |= AOPOBJ_STATIC_POINTER;
|
||||
break;
|
||||
|
@ -284,7 +284,7 @@ AcpiNsRootInitialize (
|
|||
|
||||
/* Special case for ACPI Global Lock */
|
||||
|
||||
if (ACPI_STRCMP (InitVal->Name, "_GL_") == 0)
|
||||
if (strcmp (InitVal->Name, "_GL_") == 0)
|
||||
{
|
||||
AcpiGbl_GlobalLockMutex = ObjDesc;
|
||||
|
||||
|
@ -391,7 +391,9 @@ AcpiNsLookup (
|
|||
return_ACPI_STATUS (AE_BAD_PARAMETER);
|
||||
}
|
||||
|
||||
LocalFlags = Flags & ~(ACPI_NS_ERROR_IF_FOUND | ACPI_NS_SEARCH_PARENT);
|
||||
LocalFlags = Flags &
|
||||
~(ACPI_NS_ERROR_IF_FOUND | ACPI_NS_OVERRIDE_IF_FOUND |
|
||||
ACPI_NS_SEARCH_PARENT);
|
||||
*ReturnNode = ACPI_ENTRY_NOT_FOUND;
|
||||
AcpiGbl_NsLookupCount++;
|
||||
|
||||
|
@ -643,6 +645,13 @@ AcpiNsLookup (
|
|||
{
|
||||
LocalFlags |= ACPI_NS_ERROR_IF_FOUND;
|
||||
}
|
||||
|
||||
/* Set override flag according to caller */
|
||||
|
||||
if (Flags & ACPI_NS_OVERRIDE_IF_FOUND)
|
||||
{
|
||||
LocalFlags |= ACPI_NS_OVERRIDE_IF_FOUND;
|
||||
}
|
||||
}
|
||||
|
||||
/* Extract one ACPI name from the front of the pathname */
|
||||
|
|
|
@ -274,7 +274,7 @@ AcpiNsConvertToString (
|
|||
* Copy the raw buffer data with no transform. String is already NULL
|
||||
* terminated at Length+1.
|
||||
*/
|
||||
ACPI_MEMCPY (NewObject->String.Pointer,
|
||||
memcpy (NewObject->String.Pointer,
|
||||
OriginalObject->Buffer.Pointer, Length);
|
||||
break;
|
||||
|
||||
|
@ -341,7 +341,7 @@ AcpiNsConvertToBuffer (
|
|||
return (AE_NO_MEMORY);
|
||||
}
|
||||
|
||||
ACPI_MEMCPY (NewObject->Buffer.Pointer,
|
||||
memcpy (NewObject->Buffer.Pointer,
|
||||
OriginalObject->String.Pointer, OriginalObject->String.Length);
|
||||
break;
|
||||
|
||||
|
|
|
@ -195,7 +195,7 @@ AcpiNsPrintPathname (
|
|||
{
|
||||
for (i = 0; i < 4; i++)
|
||||
{
|
||||
ACPI_IS_PRINT (Pathname[i]) ?
|
||||
isprint ((int) Pathname[i]) ?
|
||||
AcpiOsPrintf ("%c", Pathname[i]) :
|
||||
AcpiOsPrintf ("?");
|
||||
}
|
||||
|
|
|
@ -136,15 +136,14 @@ AcpiNsExecModuleCode (
|
|||
*
|
||||
* FUNCTION: AcpiNsEvaluate
|
||||
*
|
||||
* PARAMETERS: Info - Evaluation info block, contains:
|
||||
* PARAMETERS: Info - Evaluation info block, contains these fields
|
||||
* and more:
|
||||
* PrefixNode - Prefix or Method/Object Node to execute
|
||||
* RelativePath - Name of method to execute, If NULL, the
|
||||
* Node is the object to execute
|
||||
* Parameters - List of parameters to pass to the method,
|
||||
* terminated by NULL. Params itself may be
|
||||
* NULL if no parameters are being passed.
|
||||
* ReturnObject - Where to put method's return value (if
|
||||
* any). If NULL, no value is returned.
|
||||
* ParameterType - Type of Parameter list
|
||||
* ReturnObject - Where to put method's return value (if
|
||||
* any). If NULL, no value is returned.
|
||||
|
@ -358,6 +357,7 @@ AcpiNsEvaluate (
|
|||
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
Info->ReturnObject = NULL;
|
||||
goto Cleanup;
|
||||
}
|
||||
|
||||
|
@ -536,7 +536,7 @@ AcpiNsExecModuleCode (
|
|||
|
||||
/* Initialize the evaluation information block */
|
||||
|
||||
ACPI_MEMSET (Info, 0, sizeof (ACPI_EVALUATE_INFO));
|
||||
memset (Info, 0, sizeof (ACPI_EVALUATE_INFO));
|
||||
Info->PrefixNode = ParentNode;
|
||||
|
||||
/*
|
||||
|
@ -563,7 +563,8 @@ AcpiNsExecModuleCode (
|
|||
|
||||
Status = AcpiNsEvaluate (Info);
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_INIT, "Executed module-level code at %p\n",
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_INIT_NAMES,
|
||||
"Executed module-level code at %p\n",
|
||||
MethodObj->Method.AmlStart));
|
||||
|
||||
/* Delete a possible implicit return value (in slack mode) */
|
||||
|
|
|
@ -177,7 +177,7 @@ AcpiNsInitializeObjects (
|
|||
|
||||
/* Set all init info to zero */
|
||||
|
||||
ACPI_MEMSET (&Info, 0, sizeof (ACPI_INIT_WALK_INFO));
|
||||
memset (&Info, 0, sizeof (ACPI_INIT_WALK_INFO));
|
||||
|
||||
/* Walk entire namespace from the supplied root */
|
||||
|
||||
|
@ -686,7 +686,7 @@ AcpiNsInitOneDevice (
|
|||
ACPI_DEBUG_EXEC (AcpiUtDisplayInitPathname (
|
||||
ACPI_TYPE_METHOD, DeviceNode, METHOD_NAME__INI));
|
||||
|
||||
ACPI_MEMSET (Info, 0, sizeof (ACPI_EVALUATE_INFO));
|
||||
memset (Info, 0, sizeof (ACPI_EVALUATE_INFO));
|
||||
Info->PrefixNode = DeviceNode;
|
||||
Info->RelativePathname = METHOD_NAME__INI;
|
||||
Info->Parameters = NULL;
|
||||
|
|
|
@ -200,7 +200,21 @@ AcpiNsLoadTable (
|
|||
}
|
||||
else
|
||||
{
|
||||
(void) AcpiTbReleaseOwnerId (TableIndex);
|
||||
/*
|
||||
* On error, delete any namespace objects created by this table.
|
||||
* We cannot initialize these objects, so delete them. There are
|
||||
* a couple of expecially bad cases:
|
||||
* AE_ALREADY_EXISTS - namespace collision.
|
||||
* AE_NOT_FOUND - the target of a Scope operator does not
|
||||
* exist. This target of Scope must already exist in the
|
||||
* namespace, as per the ACPI specification.
|
||||
*/
|
||||
(void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
|
||||
AcpiNsDeleteNamespaceByOwner (
|
||||
AcpiGbl_RootTableList.Tables[TableIndex].OwnerId);
|
||||
AcpiTbReleaseOwnerId (TableIndex);
|
||||
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
Unlock:
|
||||
|
|
|
@ -123,82 +123,6 @@
|
|||
ACPI_MODULE_NAME ("nsnames")
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiNsBuildExternalPath
|
||||
*
|
||||
* PARAMETERS: Node - NS node whose pathname is needed
|
||||
* Size - Size of the pathname
|
||||
* *NameBuffer - Where to return the pathname
|
||||
*
|
||||
* RETURN: Status
|
||||
* Places the pathname into the NameBuffer, in external format
|
||||
* (name segments separated by path separators)
|
||||
*
|
||||
* DESCRIPTION: Generate a full pathaname
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
ACPI_STATUS
|
||||
AcpiNsBuildExternalPath (
|
||||
ACPI_NAMESPACE_NODE *Node,
|
||||
ACPI_SIZE Size,
|
||||
char *NameBuffer)
|
||||
{
|
||||
ACPI_SIZE Index;
|
||||
ACPI_NAMESPACE_NODE *ParentNode;
|
||||
|
||||
|
||||
ACPI_FUNCTION_ENTRY ();
|
||||
|
||||
|
||||
/* Special case for root */
|
||||
|
||||
Index = Size - 1;
|
||||
if (Index < ACPI_NAME_SIZE)
|
||||
{
|
||||
NameBuffer[0] = AML_ROOT_PREFIX;
|
||||
NameBuffer[1] = 0;
|
||||
return (AE_OK);
|
||||
}
|
||||
|
||||
/* Store terminator byte, then build name backwards */
|
||||
|
||||
ParentNode = Node;
|
||||
NameBuffer[Index] = 0;
|
||||
|
||||
while ((Index > ACPI_NAME_SIZE) && (ParentNode != AcpiGbl_RootNode))
|
||||
{
|
||||
Index -= ACPI_NAME_SIZE;
|
||||
|
||||
/* Put the name into the buffer */
|
||||
|
||||
ACPI_MOVE_32_TO_32 ((NameBuffer + Index), &ParentNode->Name);
|
||||
ParentNode = ParentNode->Parent;
|
||||
|
||||
/* Prefix name with the path separator */
|
||||
|
||||
Index--;
|
||||
NameBuffer[Index] = ACPI_PATH_SEPARATOR;
|
||||
}
|
||||
|
||||
/* Overwrite final separator with the root prefix character */
|
||||
|
||||
NameBuffer[Index] = AML_ROOT_PREFIX;
|
||||
|
||||
if (Index != 0)
|
||||
{
|
||||
ACPI_ERROR ((AE_INFO,
|
||||
"Could not construct external pathname; index=%u, size=%u, Path=%s",
|
||||
(UINT32) Index, (UINT32) Size, &NameBuffer[Size]));
|
||||
|
||||
return (AE_BAD_PARAMETER);
|
||||
}
|
||||
|
||||
return (AE_OK);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiNsGetExternalPathname
|
||||
|
@ -218,39 +142,13 @@ char *
|
|||
AcpiNsGetExternalPathname (
|
||||
ACPI_NAMESPACE_NODE *Node)
|
||||
{
|
||||
ACPI_STATUS Status;
|
||||
char *NameBuffer;
|
||||
ACPI_SIZE Size;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE_PTR (NsGetExternalPathname, Node);
|
||||
|
||||
|
||||
/* Calculate required buffer size based on depth below root */
|
||||
|
||||
Size = AcpiNsGetPathnameLength (Node);
|
||||
if (!Size)
|
||||
{
|
||||
return_PTR (NULL);
|
||||
}
|
||||
|
||||
/* Allocate a buffer to be returned to caller */
|
||||
|
||||
NameBuffer = ACPI_ALLOCATE_ZEROED (Size);
|
||||
if (!NameBuffer)
|
||||
{
|
||||
ACPI_ERROR ((AE_INFO, "Could not allocate %u bytes", (UINT32) Size));
|
||||
return_PTR (NULL);
|
||||
}
|
||||
|
||||
/* Build the path in the allocated buffer */
|
||||
|
||||
Status = AcpiNsBuildExternalPath (Node, Size, NameBuffer);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
ACPI_FREE (NameBuffer);
|
||||
return_PTR (NULL);
|
||||
}
|
||||
NameBuffer = AcpiNsGetNormalizedPathname (Node, FALSE);
|
||||
|
||||
return_PTR (NameBuffer);
|
||||
}
|
||||
|
@ -273,38 +171,14 @@ AcpiNsGetPathnameLength (
|
|||
ACPI_NAMESPACE_NODE *Node)
|
||||
{
|
||||
ACPI_SIZE Size;
|
||||
ACPI_NAMESPACE_NODE *NextNode;
|
||||
|
||||
|
||||
ACPI_FUNCTION_ENTRY ();
|
||||
|
||||
|
||||
/*
|
||||
* Compute length of pathname as 5 * number of name segments.
|
||||
* Go back up the parent tree to the root
|
||||
*/
|
||||
Size = 0;
|
||||
NextNode = Node;
|
||||
Size = AcpiNsBuildNormalizedPath (Node, NULL, 0, FALSE);
|
||||
|
||||
while (NextNode && (NextNode != AcpiGbl_RootNode))
|
||||
{
|
||||
if (ACPI_GET_DESCRIPTOR_TYPE (NextNode) != ACPI_DESC_TYPE_NAMED)
|
||||
{
|
||||
ACPI_ERROR ((AE_INFO,
|
||||
"Invalid Namespace Node (%p) while traversing namespace",
|
||||
NextNode));
|
||||
return (0);
|
||||
}
|
||||
Size += ACPI_PATH_SEGMENT_LENGTH;
|
||||
NextNode = NextNode->Parent;
|
||||
}
|
||||
|
||||
if (!Size)
|
||||
{
|
||||
Size = 1; /* Root node case */
|
||||
}
|
||||
|
||||
return (Size + 1); /* +1 for null string terminator */
|
||||
return (Size);
|
||||
}
|
||||
|
||||
|
||||
|
@ -315,6 +189,8 @@ AcpiNsGetPathnameLength (
|
|||
* PARAMETERS: TargetHandle - Handle of named object whose name is
|
||||
* to be found
|
||||
* Buffer - Where the pathname is returned
|
||||
* NoTrailing - Remove trailing '_' for each name
|
||||
* segment
|
||||
*
|
||||
* RETURN: Status, Buffer is filled with pathname if status is AE_OK
|
||||
*
|
||||
|
@ -325,7 +201,8 @@ AcpiNsGetPathnameLength (
|
|||
ACPI_STATUS
|
||||
AcpiNsHandleToPathname (
|
||||
ACPI_HANDLE TargetHandle,
|
||||
ACPI_BUFFER *Buffer)
|
||||
ACPI_BUFFER *Buffer,
|
||||
BOOLEAN NoTrailing)
|
||||
{
|
||||
ACPI_STATUS Status;
|
||||
ACPI_NAMESPACE_NODE *Node;
|
||||
|
@ -343,7 +220,7 @@ AcpiNsHandleToPathname (
|
|||
|
||||
/* Determine size required for the caller buffer */
|
||||
|
||||
RequiredSize = AcpiNsGetPathnameLength (Node);
|
||||
RequiredSize = AcpiNsBuildNormalizedPath (Node, NULL, 0, NoTrailing);
|
||||
if (!RequiredSize)
|
||||
{
|
||||
return_ACPI_STATUS (AE_BAD_PARAMETER);
|
||||
|
@ -359,7 +236,8 @@ AcpiNsHandleToPathname (
|
|||
|
||||
/* Build the path in the caller buffer */
|
||||
|
||||
Status = AcpiNsBuildExternalPath (Node, RequiredSize, Buffer->Pointer);
|
||||
(void) AcpiNsBuildNormalizedPath (Node, Buffer->Pointer,
|
||||
RequiredSize, NoTrailing);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return_ACPI_STATUS (Status);
|
||||
|
@ -369,3 +247,169 @@ AcpiNsHandleToPathname (
|
|||
(char *) Buffer->Pointer, (UINT32) RequiredSize));
|
||||
return_ACPI_STATUS (AE_OK);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiNsBuildNormalizedPath
|
||||
*
|
||||
* PARAMETERS: Node - Namespace node
|
||||
* FullPath - Where the path name is returned
|
||||
* PathSize - Size of returned path name buffer
|
||||
* NoTrailing - Remove trailing '_' from each name segment
|
||||
*
|
||||
* RETURN: Return 1 if the AML path is empty, otherwise returning (length
|
||||
* of pathname + 1) which means the 'FullPath' contains a trailing
|
||||
* null.
|
||||
*
|
||||
* DESCRIPTION: Build and return a full namespace pathname.
|
||||
* Note that if the size of 'FullPath' isn't large enough to
|
||||
* contain the namespace node's path name, the actual required
|
||||
* buffer length is returned, and it should be greater than
|
||||
* 'PathSize'. So callers are able to check the returning value
|
||||
* to determine the buffer size of 'FullPath'.
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
UINT32
|
||||
AcpiNsBuildNormalizedPath (
|
||||
ACPI_NAMESPACE_NODE *Node,
|
||||
char *FullPath,
|
||||
UINT32 PathSize,
|
||||
BOOLEAN NoTrailing)
|
||||
{
|
||||
UINT32 Length = 0, i;
|
||||
char Name[ACPI_NAME_SIZE];
|
||||
BOOLEAN DoNoTrailing;
|
||||
char c, *Left, *Right;
|
||||
ACPI_NAMESPACE_NODE *NextNode;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE_PTR (NsBuildNormalizedPath, Node);
|
||||
|
||||
|
||||
#define ACPI_PATH_PUT8(Path, Size, Byte, Length) \
|
||||
do { \
|
||||
if ((Length) < (Size)) \
|
||||
{ \
|
||||
(Path)[(Length)] = (Byte); \
|
||||
} \
|
||||
(Length)++; \
|
||||
} while (0)
|
||||
|
||||
/*
|
||||
* Make sure the PathSize is correct, so that we don't need to
|
||||
* validate both FullPath and PathSize.
|
||||
*/
|
||||
if (!FullPath)
|
||||
{
|
||||
PathSize = 0;
|
||||
}
|
||||
|
||||
if (!Node)
|
||||
{
|
||||
goto BuildTrailingNull;
|
||||
}
|
||||
|
||||
NextNode = Node;
|
||||
while (NextNode && NextNode != AcpiGbl_RootNode)
|
||||
{
|
||||
if (NextNode != Node)
|
||||
{
|
||||
ACPI_PATH_PUT8(FullPath, PathSize, AML_DUAL_NAME_PREFIX, Length);
|
||||
}
|
||||
ACPI_MOVE_32_TO_32 (Name, &NextNode->Name);
|
||||
DoNoTrailing = NoTrailing;
|
||||
for (i = 0; i < 4; i++)
|
||||
{
|
||||
c = Name[4-i-1];
|
||||
if (DoNoTrailing && c != '_')
|
||||
{
|
||||
DoNoTrailing = FALSE;
|
||||
}
|
||||
if (!DoNoTrailing)
|
||||
{
|
||||
ACPI_PATH_PUT8(FullPath, PathSize, c, Length);
|
||||
}
|
||||
}
|
||||
NextNode = NextNode->Parent;
|
||||
}
|
||||
ACPI_PATH_PUT8(FullPath, PathSize, AML_ROOT_PREFIX, Length);
|
||||
|
||||
/* Reverse the path string */
|
||||
|
||||
if (Length <= PathSize)
|
||||
{
|
||||
Left = FullPath;
|
||||
Right = FullPath+Length-1;
|
||||
while (Left < Right)
|
||||
{
|
||||
c = *Left;
|
||||
*Left++ = *Right;
|
||||
*Right-- = c;
|
||||
}
|
||||
}
|
||||
|
||||
/* Append the trailing null */
|
||||
|
||||
BuildTrailingNull:
|
||||
ACPI_PATH_PUT8(FullPath, PathSize, '\0', Length);
|
||||
|
||||
#undef ACPI_PATH_PUT8
|
||||
|
||||
return_UINT32 (Length);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiNsGetNormalizedPathname
|
||||
*
|
||||
* PARAMETERS: Node - Namespace node whose pathname is needed
|
||||
* NoTrailing - Remove trailing '_' from each name segment
|
||||
*
|
||||
* RETURN: Pointer to storage containing the fully qualified name of
|
||||
* the node, In external format (name segments separated by path
|
||||
* separators.)
|
||||
*
|
||||
* DESCRIPTION: Used to obtain the full pathname to a namespace node, usually
|
||||
* for error and debug statements. All trailing '_' will be
|
||||
* removed from the full pathname if 'NoTrailing' is specified..
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
char *
|
||||
AcpiNsGetNormalizedPathname (
|
||||
ACPI_NAMESPACE_NODE *Node,
|
||||
BOOLEAN NoTrailing)
|
||||
{
|
||||
char *NameBuffer;
|
||||
ACPI_SIZE Size;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE_PTR (NsGetNormalizedPathname, Node);
|
||||
|
||||
|
||||
/* Calculate required buffer size based on depth below root */
|
||||
|
||||
Size = AcpiNsBuildNormalizedPath (Node, NULL, 0, NoTrailing);
|
||||
if (!Size)
|
||||
{
|
||||
return_PTR (NULL);
|
||||
}
|
||||
|
||||
/* Allocate a buffer to be returned to caller */
|
||||
|
||||
NameBuffer = ACPI_ALLOCATE_ZEROED (Size);
|
||||
if (!NameBuffer)
|
||||
{
|
||||
ACPI_ERROR ((AE_INFO, "Could not allocate %u bytes", (UINT32) Size));
|
||||
return_PTR (NULL);
|
||||
}
|
||||
|
||||
/* Build the path in the allocated buffer */
|
||||
|
||||
(void) AcpiNsBuildNormalizedPath (Node, NameBuffer, Size, NoTrailing);
|
||||
|
||||
return_PTR (NameBuffer);
|
||||
}
|
||||
|
|
|
@ -156,6 +156,22 @@ AcpiNsOneCompleteParse (
|
|||
ACPI_FUNCTION_TRACE (NsOneCompleteParse);
|
||||
|
||||
|
||||
Status = AcpiGetTableByIndex (TableIndex, &Table);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
/* Table must consist of at least a complete header */
|
||||
|
||||
if (Table->Length < sizeof (ACPI_TABLE_HEADER))
|
||||
{
|
||||
return_ACPI_STATUS (AE_BAD_HEADER);
|
||||
}
|
||||
|
||||
AmlStart = (UINT8 *) Table + sizeof (ACPI_TABLE_HEADER);
|
||||
AmlLength = Table->Length - sizeof (ACPI_TABLE_HEADER);
|
||||
|
||||
Status = AcpiTbGetOwnerId (TableIndex, &OwnerId);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
|
@ -164,7 +180,7 @@ AcpiNsOneCompleteParse (
|
|||
|
||||
/* Create and init a Root Node */
|
||||
|
||||
ParseRoot = AcpiPsCreateScopeOp ();
|
||||
ParseRoot = AcpiPsCreateScopeOp (AmlStart);
|
||||
if (!ParseRoot)
|
||||
{
|
||||
return_ACPI_STATUS (AE_NO_MEMORY);
|
||||
|
@ -179,34 +195,22 @@ AcpiNsOneCompleteParse (
|
|||
return_ACPI_STATUS (AE_NO_MEMORY);
|
||||
}
|
||||
|
||||
Status = AcpiGetTableByIndex (TableIndex, &Table);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
AcpiDsDeleteWalkState (WalkState);
|
||||
AcpiPsFreeOp (ParseRoot);
|
||||
return_ACPI_STATUS (Status);
|
||||
}
|
||||
|
||||
/* Table must consist of at least a complete header */
|
||||
|
||||
if (Table->Length < sizeof (ACPI_TABLE_HEADER))
|
||||
{
|
||||
Status = AE_BAD_HEADER;
|
||||
}
|
||||
else
|
||||
{
|
||||
AmlStart = (UINT8 *) Table + sizeof (ACPI_TABLE_HEADER);
|
||||
AmlLength = Table->Length - sizeof (ACPI_TABLE_HEADER);
|
||||
Status = AcpiDsInitAmlWalk (WalkState, ParseRoot, NULL,
|
||||
AmlStart, AmlLength, NULL, (UINT8) PassNumber);
|
||||
}
|
||||
|
||||
Status = AcpiDsInitAmlWalk (WalkState, ParseRoot, NULL,
|
||||
AmlStart, AmlLength, NULL, (UINT8) PassNumber);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
AcpiDsDeleteWalkState (WalkState);
|
||||
goto Cleanup;
|
||||
}
|
||||
|
||||
/* Found OSDT table, enable the namespace override feature */
|
||||
|
||||
if (ACPI_COMPARE_NAME(Table->Signature, ACPI_SIG_OSDT) &&
|
||||
PassNumber == ACPI_IMODE_LOAD_PASS1)
|
||||
{
|
||||
WalkState->NamespaceOverride = TRUE;
|
||||
}
|
||||
|
||||
/* StartNode is the default location to load the table */
|
||||
|
||||
if (StartNode && StartNode != AcpiGbl_RootNode)
|
||||
|
|
|
@ -321,7 +321,7 @@ AcpiNsCheckObjectType (
|
|||
{
|
||||
ACPI_OPERAND_OBJECT *ReturnObject = *ReturnObjectPtr;
|
||||
ACPI_STATUS Status = AE_OK;
|
||||
char TypeBuffer[48]; /* Room for 5 types */
|
||||
char TypeBuffer[96]; /* Room for 10 types */
|
||||
|
||||
|
||||
/* A Namespace node should not get here, but make sure */
|
||||
|
|
|
@ -393,6 +393,13 @@ AcpiNsCheckPackage (
|
|||
Status = AcpiNsCheckPackageList (Info, Package, Elements, Count);
|
||||
break;
|
||||
|
||||
case ACPI_PTYPE2_VAR_VAR:
|
||||
/*
|
||||
* Returns a variable list of packages, each with a variable list
|
||||
* of objects.
|
||||
*/
|
||||
break;
|
||||
|
||||
case ACPI_PTYPE2_UUID_PAIR:
|
||||
|
||||
/* The package must contain pairs of (UUID + type) */
|
||||
|
@ -562,6 +569,12 @@ AcpiNsCheckPackageList (
|
|||
}
|
||||
break;
|
||||
|
||||
case ACPI_PTYPE2_VAR_VAR:
|
||||
/*
|
||||
* Each subpackage has a fixed or variable number of elements
|
||||
*/
|
||||
break;
|
||||
|
||||
case ACPI_PTYPE2_FIXED:
|
||||
|
||||
/* Each subpackage has a fixed length */
|
||||
|
|
|
@ -595,10 +595,10 @@ AcpiNsRemoveNullElements (
|
|||
case ACPI_PTYPE2_MIN:
|
||||
case ACPI_PTYPE2_REV_FIXED:
|
||||
case ACPI_PTYPE2_FIX_VAR:
|
||||
|
||||
break;
|
||||
|
||||
default:
|
||||
case ACPI_PTYPE2_VAR_VAR:
|
||||
case ACPI_PTYPE1_FIXED:
|
||||
case ACPI_PTYPE1_OPTION:
|
||||
return;
|
||||
|
|
|
@ -709,7 +709,7 @@ AcpiNsRepair_HID (
|
|||
*/
|
||||
for (Dest = NewString->String.Pointer; *Source; Dest++, Source++)
|
||||
{
|
||||
*Dest = (char) ACPI_TOUPPER (*Source);
|
||||
*Dest = (char) toupper ((int) *Source);
|
||||
}
|
||||
|
||||
AcpiUtRemoveReference (ReturnObject);
|
||||
|
|
|
@ -410,10 +410,42 @@ AcpiNsSearchAndEnter (
|
|||
* If we found it AND the request specifies that a find is an error,
|
||||
* return the error
|
||||
*/
|
||||
if ((Status == AE_OK) &&
|
||||
(Flags & ACPI_NS_ERROR_IF_FOUND))
|
||||
if (Status == AE_OK)
|
||||
{
|
||||
Status = AE_ALREADY_EXISTS;
|
||||
/* The node was found in the namespace */
|
||||
|
||||
/*
|
||||
* If the namespace override feature is enabled for this node,
|
||||
* delete any existing attached sub-object and make the node
|
||||
* look like a new node that is owned by the override table.
|
||||
*/
|
||||
if (Flags & ACPI_NS_OVERRIDE_IF_FOUND)
|
||||
{
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_NAMES,
|
||||
"Namespace override: %4.4s pass %u type %X Owner %X\n",
|
||||
ACPI_CAST_PTR(char, &TargetName), InterpreterMode,
|
||||
(*ReturnNode)->Type, WalkState->OwnerId));
|
||||
|
||||
AcpiNsDeleteChildren (*ReturnNode);
|
||||
if (AcpiGbl_RuntimeNamespaceOverride)
|
||||
{
|
||||
AcpiUtRemoveReference ((*ReturnNode)->Object);
|
||||
(*ReturnNode)->Object = NULL;
|
||||
(*ReturnNode)->OwnerId = WalkState->OwnerId;
|
||||
}
|
||||
else
|
||||
{
|
||||
AcpiNsRemoveNode (*ReturnNode);
|
||||
*ReturnNode = ACPI_ENTRY_NOT_FOUND;
|
||||
}
|
||||
}
|
||||
|
||||
/* Return an error if we don't expect to find the object */
|
||||
|
||||
else if (Flags & ACPI_NS_ERROR_IF_FOUND)
|
||||
{
|
||||
Status = AE_ALREADY_EXISTS;
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef ACPI_ASL_COMPILER
|
||||
|
|
|
@ -162,7 +162,7 @@ AcpiNsPrintNodePathname (
|
|||
|
||||
Buffer.Length = ACPI_ALLOCATE_LOCAL_BUFFER;
|
||||
|
||||
Status = AcpiNsHandleToPathname (Node, &Buffer);
|
||||
Status = AcpiNsHandleToPathname (Node, &Buffer, TRUE);
|
||||
if (ACPI_SUCCESS (Status))
|
||||
{
|
||||
if (Message)
|
||||
|
@ -419,7 +419,7 @@ AcpiNsBuildInternalName (
|
|||
{
|
||||
/* Convert the character to uppercase and save it */
|
||||
|
||||
Result[i] = (char) ACPI_TOUPPER ((int) *ExternalName);
|
||||
Result[i] = (char) toupper ((int) *ExternalName);
|
||||
ExternalName++;
|
||||
}
|
||||
}
|
||||
|
@ -769,6 +769,24 @@ AcpiNsTerminate (
|
|||
ACPI_FUNCTION_TRACE (NsTerminate);
|
||||
|
||||
|
||||
#ifdef ACPI_EXEC_APP
|
||||
{
|
||||
ACPI_OPERAND_OBJECT *Prev;
|
||||
ACPI_OPERAND_OBJECT *Next;
|
||||
|
||||
/* Delete any module-level code blocks */
|
||||
|
||||
Next = AcpiGbl_ModuleCodeList;
|
||||
while (Next)
|
||||
{
|
||||
Prev = Next;
|
||||
Next = Next->Method.Mutex;
|
||||
Prev->Method.Mutex = NULL; /* Clear the Mutex (cheated) field */
|
||||
AcpiUtRemoveReference (Prev);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Free the entire namespace -- all nodes and all objects
|
||||
* attached to the nodes
|
||||
|
|
|
@ -830,7 +830,7 @@ AcpiNsGetDeviceCallback (
|
|||
return (AE_CTRL_DEPTH);
|
||||
}
|
||||
|
||||
NoMatch = ACPI_STRCMP (Hid->String, Info->Hid);
|
||||
NoMatch = strcmp (Hid->String, Info->Hid);
|
||||
ACPI_FREE (Hid);
|
||||
|
||||
if (NoMatch)
|
||||
|
@ -854,7 +854,7 @@ AcpiNsGetDeviceCallback (
|
|||
Found = FALSE;
|
||||
for (i = 0; i < Cid->Count; i++)
|
||||
{
|
||||
if (ACPI_STRCMP (Cid->Ids[i].String, Info->Hid) == 0)
|
||||
if (strcmp (Cid->Ids[i].String, Info->Hid) == 0)
|
||||
{
|
||||
/* Found a matching CID */
|
||||
|
||||
|
|
|
@ -198,7 +198,7 @@ AcpiGetHandle (
|
|||
|
||||
/* Special case for root-only, since we can't search for it */
|
||||
|
||||
if (!ACPI_STRCMP (Pathname, ACPI_NS_ROOT_PATH))
|
||||
if (!strcmp (Pathname, ACPI_NS_ROOT_PATH))
|
||||
{
|
||||
*RetHandle = ACPI_CAST_PTR (ACPI_HANDLE, AcpiGbl_RootNode);
|
||||
return (AE_OK);
|
||||
|
@ -265,11 +265,13 @@ AcpiGetName (
|
|||
return (Status);
|
||||
}
|
||||
|
||||
if (NameType == ACPI_FULL_PATHNAME)
|
||||
if (NameType == ACPI_FULL_PATHNAME ||
|
||||
NameType == ACPI_FULL_PATHNAME_NO_TRAILING)
|
||||
{
|
||||
/* Get the full pathname (From the namespace root) */
|
||||
|
||||
Status = AcpiNsHandleToPathname (Handle, Buffer);
|
||||
Status = AcpiNsHandleToPathname (Handle, Buffer,
|
||||
NameType == ACPI_FULL_PATHNAME ? FALSE : TRUE);
|
||||
return (Status);
|
||||
}
|
||||
|
||||
|
@ -343,7 +345,7 @@ AcpiNsCopyDeviceId (
|
|||
|
||||
/* Copy actual string and return a pointer to the next string area */
|
||||
|
||||
ACPI_MEMCPY (StringArea, Source->String, Source->Length);
|
||||
memcpy (StringArea, Source->String, Source->Length);
|
||||
return (StringArea + Source->Length);
|
||||
}
|
||||
|
||||
|
@ -362,7 +364,7 @@ AcpiNsCopyDeviceId (
|
|||
* control methods (Such as in the case of a device.)
|
||||
*
|
||||
* For Device and Processor objects, run the Device _HID, _UID, _CID, _SUB,
|
||||
* _STA, _ADR, _SxW, and _SxD methods.
|
||||
* _CLS, _STA, _ADR, _SxW, and _SxD methods.
|
||||
*
|
||||
* Note: Allocates the return buffer, must be freed by the caller.
|
||||
*
|
||||
|
@ -379,11 +381,12 @@ AcpiGetObjectInfo (
|
|||
ACPI_PNP_DEVICE_ID *Hid = NULL;
|
||||
ACPI_PNP_DEVICE_ID *Uid = NULL;
|
||||
ACPI_PNP_DEVICE_ID *Sub = NULL;
|
||||
ACPI_PNP_DEVICE_ID *Cls = NULL;
|
||||
char *NextIdString;
|
||||
ACPI_OBJECT_TYPE Type;
|
||||
ACPI_NAME Name;
|
||||
UINT8 ParamCount= 0;
|
||||
UINT8 Valid = 0;
|
||||
UINT16 Valid = 0;
|
||||
UINT32 InfoSize;
|
||||
UINT32 i;
|
||||
ACPI_STATUS Status;
|
||||
|
@ -431,7 +434,7 @@ AcpiGetObjectInfo (
|
|||
{
|
||||
/*
|
||||
* Get extra info for ACPI Device/Processor objects only:
|
||||
* Run the Device _HID, _UID, _SUB, and _CID methods.
|
||||
* Run the Device _HID, _UID, _SUB, _CID, and _CLS methods.
|
||||
*
|
||||
* Note: none of these methods are required, so they may or may
|
||||
* not be present for this device. The Info->Valid bitfield is used
|
||||
|
@ -475,6 +478,15 @@ AcpiGetObjectInfo (
|
|||
InfoSize += (CidList->ListSize - sizeof (ACPI_PNP_DEVICE_ID_LIST));
|
||||
Valid |= ACPI_VALID_CID;
|
||||
}
|
||||
|
||||
/* Execute the Device._CLS method */
|
||||
|
||||
Status = AcpiUtExecute_CLS (Node, &Cls);
|
||||
if (ACPI_SUCCESS (Status))
|
||||
{
|
||||
InfoSize += Cls->Length;
|
||||
Valid |= ACPI_VALID_CLS;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
|
@ -606,6 +618,12 @@ AcpiGetObjectInfo (
|
|||
}
|
||||
}
|
||||
|
||||
if (Cls)
|
||||
{
|
||||
NextIdString = AcpiNsCopyDeviceId (&Info->ClassCode,
|
||||
Cls, NextIdString);
|
||||
}
|
||||
|
||||
/* Copy the fixed-length data */
|
||||
|
||||
Info->InfoSize = InfoSize;
|
||||
|
@ -635,6 +653,10 @@ Cleanup:
|
|||
{
|
||||
ACPI_FREE (CidList);
|
||||
}
|
||||
if (Cls)
|
||||
{
|
||||
ACPI_FREE (Cls);
|
||||
}
|
||||
return (Status);
|
||||
}
|
||||
|
||||
|
@ -756,7 +778,7 @@ AcpiInstallMethod (
|
|||
|
||||
/* Copy the method AML to the local buffer */
|
||||
|
||||
ACPI_MEMCPY (AmlBuffer, AmlStart, AmlLength);
|
||||
memcpy (AmlBuffer, AmlStart, AmlLength);
|
||||
|
||||
/* Initialize the method object with the new method's information */
|
||||
|
||||
|
|
|
@ -388,7 +388,7 @@ AcpiPsGetNextNamepath (
|
|||
ACPI_DEBUG_PRINT ((ACPI_DB_PARSE,
|
||||
"Control Method - %p Desc %p Path=%p\n", Node, MethodDesc, Path));
|
||||
|
||||
NameOp = AcpiPsAllocOp (AML_INT_NAMEPATH_OP);
|
||||
NameOp = AcpiPsAllocOp (AML_INT_NAMEPATH_OP, Start);
|
||||
if (!NameOp)
|
||||
{
|
||||
return_ACPI_STATUS (AE_NO_MEMORY);
|
||||
|
@ -596,7 +596,7 @@ static ACPI_PARSE_OBJECT *
|
|||
AcpiPsGetNextField (
|
||||
ACPI_PARSE_STATE *ParserState)
|
||||
{
|
||||
UINT32 AmlOffset;
|
||||
UINT8 *Aml;
|
||||
ACPI_PARSE_OBJECT *Field;
|
||||
ACPI_PARSE_OBJECT *Arg = NULL;
|
||||
UINT16 Opcode;
|
||||
|
@ -612,8 +612,7 @@ AcpiPsGetNextField (
|
|||
ACPI_FUNCTION_TRACE (PsGetNextField);
|
||||
|
||||
|
||||
AmlOffset = (UINT32) ACPI_PTR_DIFF (
|
||||
ParserState->Aml, ParserState->AmlStart);
|
||||
Aml = ParserState->Aml;
|
||||
|
||||
/* Determine field type */
|
||||
|
||||
|
@ -651,14 +650,12 @@ AcpiPsGetNextField (
|
|||
|
||||
/* Allocate a new field op */
|
||||
|
||||
Field = AcpiPsAllocOp (Opcode);
|
||||
Field = AcpiPsAllocOp (Opcode, Aml);
|
||||
if (!Field)
|
||||
{
|
||||
return_PTR (NULL);
|
||||
}
|
||||
|
||||
Field->Common.AmlOffset = AmlOffset;
|
||||
|
||||
/* Decode the field type */
|
||||
|
||||
switch (Opcode)
|
||||
|
@ -722,6 +719,7 @@ AcpiPsGetNextField (
|
|||
* Argument for Connection operator can be either a Buffer
|
||||
* (resource descriptor), or a NameString.
|
||||
*/
|
||||
Aml = ParserState->Aml;
|
||||
if (ACPI_GET8 (ParserState->Aml) == AML_BUFFER_OP)
|
||||
{
|
||||
ParserState->Aml++;
|
||||
|
@ -734,7 +732,7 @@ AcpiPsGetNextField (
|
|||
{
|
||||
/* Non-empty list */
|
||||
|
||||
Arg = AcpiPsAllocOp (AML_INT_BYTELIST_OP);
|
||||
Arg = AcpiPsAllocOp (AML_INT_BYTELIST_OP, Aml);
|
||||
if (!Arg)
|
||||
{
|
||||
AcpiPsFreeOp (Field);
|
||||
|
@ -784,7 +782,7 @@ AcpiPsGetNextField (
|
|||
}
|
||||
else
|
||||
{
|
||||
Arg = AcpiPsAllocOp (AML_INT_NAMEPATH_OP);
|
||||
Arg = AcpiPsAllocOp (AML_INT_NAMEPATH_OP, Aml);
|
||||
if (!Arg)
|
||||
{
|
||||
AcpiPsFreeOp (Field);
|
||||
|
@ -856,7 +854,7 @@ AcpiPsGetNextArg (
|
|||
|
||||
/* Constants, strings, and namestrings are all the same size */
|
||||
|
||||
Arg = AcpiPsAllocOp (AML_BYTE_OP);
|
||||
Arg = AcpiPsAllocOp (AML_BYTE_OP, ParserState->Aml);
|
||||
if (!Arg)
|
||||
{
|
||||
return_ACPI_STATUS (AE_NO_MEMORY);
|
||||
|
@ -908,7 +906,8 @@ AcpiPsGetNextArg (
|
|||
{
|
||||
/* Non-empty list */
|
||||
|
||||
Arg = AcpiPsAllocOp (AML_INT_BYTELIST_OP);
|
||||
Arg = AcpiPsAllocOp (AML_INT_BYTELIST_OP,
|
||||
ParserState->Aml);
|
||||
if (!Arg)
|
||||
{
|
||||
return_ACPI_STATUS (AE_NO_MEMORY);
|
||||
|
@ -938,7 +937,7 @@ AcpiPsGetNextArg (
|
|||
{
|
||||
/* NullName or NameString */
|
||||
|
||||
Arg = AcpiPsAllocOp (AML_INT_NAMEPATH_OP);
|
||||
Arg = AcpiPsAllocOp (AML_INT_NAMEPATH_OP, ParserState->Aml);
|
||||
if (!Arg)
|
||||
{
|
||||
return_ACPI_STATUS (AE_NO_MEMORY);
|
||||
|
|
|
@ -123,6 +123,7 @@
|
|||
|
||||
#include "acpi.h"
|
||||
#include "accommon.h"
|
||||
#include "acinterp.h"
|
||||
#include "acparser.h"
|
||||
#include "acdispat.h"
|
||||
#include "amlcode.h"
|
||||
|
@ -206,8 +207,7 @@ AcpiPsGetArguments (
|
|||
*/
|
||||
while (GET_CURRENT_ARG_TYPE (WalkState->ArgTypes) && !WalkState->ArgCount)
|
||||
{
|
||||
WalkState->AmlOffset = (UINT32) ACPI_PTR_DIFF (WalkState->ParserState.Aml,
|
||||
WalkState->ParserState.AmlStart);
|
||||
WalkState->Aml = WalkState->ParserState.Aml;
|
||||
|
||||
Status = AcpiPsGetNextArg (WalkState, &(WalkState->ParserState),
|
||||
GET_CURRENT_ARG_TYPE (WalkState->ArgTypes), &Arg);
|
||||
|
@ -218,7 +218,6 @@ AcpiPsGetArguments (
|
|||
|
||||
if (Arg)
|
||||
{
|
||||
Arg->Common.AmlOffset = WalkState->AmlOffset;
|
||||
AcpiPsAppendArg (Op, Arg);
|
||||
}
|
||||
|
||||
|
@ -391,6 +390,9 @@ AcpiPsLinkModuleCode (
|
|||
ACPI_NAMESPACE_NODE *ParentNode;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE (PsLinkModuleCode);
|
||||
|
||||
|
||||
/* Get the tail of the list */
|
||||
|
||||
Prev = Next = AcpiGbl_ModuleCodeList;
|
||||
|
@ -412,9 +414,12 @@ AcpiPsLinkModuleCode (
|
|||
MethodObj = AcpiUtCreateInternalObject (ACPI_TYPE_METHOD);
|
||||
if (!MethodObj)
|
||||
{
|
||||
return;
|
||||
return_VOID;
|
||||
}
|
||||
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_PARSE,
|
||||
"Create/Link new code block: %p\n", MethodObj));
|
||||
|
||||
if (ParentOp->Common.Node)
|
||||
{
|
||||
ParentNode = ParentOp->Common.Node;
|
||||
|
@ -447,8 +452,13 @@ AcpiPsLinkModuleCode (
|
|||
}
|
||||
else
|
||||
{
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_PARSE,
|
||||
"Appending to existing code block: %p\n", Prev));
|
||||
|
||||
Prev->Method.AmlLength += AmlLength;
|
||||
}
|
||||
|
||||
return_VOID;
|
||||
}
|
||||
|
||||
/*******************************************************************************
|
||||
|
@ -574,15 +584,7 @@ AcpiPsParseLoop (
|
|||
continue;
|
||||
}
|
||||
|
||||
Op->Common.AmlOffset = WalkState->AmlOffset;
|
||||
|
||||
if (WalkState->OpInfo)
|
||||
{
|
||||
ACPI_DEBUG_PRINT ((ACPI_DB_PARSE,
|
||||
"Opcode %4.4X [%s] Op %p Aml %p AmlOffset %5.5X\n",
|
||||
(UINT32) Op->Common.AmlOpcode, WalkState->OpInfo->Name,
|
||||
Op, ParserState->Aml, Op->Common.AmlOffset));
|
||||
}
|
||||
AcpiExStartTraceOpcode (Op, WalkState);
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -145,12 +145,13 @@ static ACPI_STATUS
|
|||
AcpiPsGetAmlOpcode (
|
||||
ACPI_WALK_STATE *WalkState)
|
||||
{
|
||||
UINT32 AmlOffset;
|
||||
|
||||
|
||||
ACPI_FUNCTION_TRACE_PTR (PsGetAmlOpcode, WalkState);
|
||||
|
||||
|
||||
WalkState->AmlOffset = (UINT32) ACPI_PTR_DIFF (WalkState->ParserState.Aml,
|
||||
WalkState->ParserState.AmlStart);
|
||||
WalkState->Aml = WalkState->ParserState.Aml;
|
||||
WalkState->Opcode = AcpiPsPeekOpcode (&(WalkState->ParserState));
|
||||
|
||||
/*
|
||||
|
@ -179,10 +180,13 @@ AcpiPsGetAmlOpcode (
|
|||
|
||||
if (WalkState->PassNumber == 2)
|
||||
{
|
||||
AmlOffset = (UINT32) ACPI_PTR_DIFF (WalkState->Aml,
|
||||
WalkState->ParserState.AmlStart);
|
||||
|
||||
ACPI_ERROR ((AE_INFO,
|
||||
"Unknown opcode 0x%.2X at table offset 0x%.4X, ignoring",
|
||||
WalkState->Opcode,
|
||||
(UINT32) (WalkState->AmlOffset + sizeof (ACPI_TABLE_HEADER))));
|
||||
(UINT32) (AmlOffset + sizeof (ACPI_TABLE_HEADER))));
|
||||
|
||||
ACPI_DUMP_BUFFER ((WalkState->ParserState.Aml - 16), 48);
|
||||
|
||||
|
@ -194,13 +198,13 @@ AcpiPsGetAmlOpcode (
|
|||
AcpiOsPrintf (
|
||||
"/*\nError: Unknown opcode 0x%.2X at table offset 0x%.4X, context:\n",
|
||||
WalkState->Opcode,
|
||||
(UINT32) (WalkState->AmlOffset + sizeof (ACPI_TABLE_HEADER)));
|
||||
(UINT32) (AmlOffset + sizeof (ACPI_TABLE_HEADER)));
|
||||
|
||||
/* Dump the context surrounding the invalid opcode */
|
||||
|
||||
AcpiUtDumpBuffer (((UINT8 *) WalkState->ParserState.Aml - 16),
|
||||
48, DB_BYTE_DISPLAY,
|
||||
(WalkState->AmlOffset + sizeof (ACPI_TABLE_HEADER) - 16));
|
||||
(AmlOffset + sizeof (ACPI_TABLE_HEADER) - 16));
|
||||
AcpiOsPrintf (" */\n");
|
||||
#endif
|
||||
}
|
||||
|
@ -385,7 +389,7 @@ AcpiPsCreateOp (
|
|||
/* Create Op structure and append to parent's argument list */
|
||||
|
||||
WalkState->OpInfo = AcpiPsGetOpcodeInfo (WalkState->Opcode);
|
||||
Op = AcpiPsAllocOp (WalkState->Opcode);
|
||||
Op = AcpiPsAllocOp (WalkState->Opcode, AmlOpStart);
|
||||
if (!Op)
|
||||
{
|
||||
return_ACPI_STATUS (AE_NO_MEMORY);
|
||||
|
|
|
@ -124,9 +124,6 @@
|
|||
ACPI_MODULE_NAME ("psopinfo")
|
||||
|
||||
|
||||
extern const UINT8 AcpiGbl_ShortOpIndex[];
|
||||
extern const UINT8 AcpiGbl_LongOpIndex[];
|
||||
|
||||
static const UINT8 AcpiGbl_ArgumentCount[] = {0,1,1,1,1,2,2,2,2,3,3,6};
|
||||
|
||||
|
||||
|
|
|
@ -233,6 +233,8 @@ AcpiPsCompleteThisOp (
|
|||
return_ACPI_STATUS (AE_OK); /* OK for now */
|
||||
}
|
||||
|
||||
AcpiExStopTraceOpcode (Op, WalkState);
|
||||
|
||||
/* Delete this op and the subtree below it if asked to */
|
||||
|
||||
if (((WalkState->ParseFlags & ACPI_PARSE_TREE_MASK) != ACPI_PARSE_DELETE_TREE) ||
|
||||
|
@ -270,7 +272,8 @@ AcpiPsCompleteThisOp (
|
|||
* These opcodes contain TermArg operands. The current
|
||||
* op must be replaced by a placeholder return op
|
||||
*/
|
||||
ReplacementOp = AcpiPsAllocOp (AML_INT_RETURN_VALUE_OP);
|
||||
ReplacementOp = AcpiPsAllocOp (AML_INT_RETURN_VALUE_OP,
|
||||
Op->Common.Aml);
|
||||
if (!ReplacementOp)
|
||||
{
|
||||
Status = AE_NO_MEMORY;
|
||||
|
@ -289,7 +292,8 @@ AcpiPsCompleteThisOp (
|
|||
(Op->Common.Parent->Common.AmlOpcode == AML_BANK_FIELD_OP) ||
|
||||
(Op->Common.Parent->Common.AmlOpcode == AML_VAR_PACKAGE_OP))
|
||||
{
|
||||
ReplacementOp = AcpiPsAllocOp (AML_INT_RETURN_VALUE_OP);
|
||||
ReplacementOp = AcpiPsAllocOp (AML_INT_RETURN_VALUE_OP,
|
||||
Op->Common.Aml);
|
||||
if (!ReplacementOp)
|
||||
{
|
||||
Status = AE_NO_MEMORY;
|
||||
|
@ -302,7 +306,8 @@ AcpiPsCompleteThisOp (
|
|||
(Op->Common.AmlOpcode == AML_PACKAGE_OP) ||
|
||||
(Op->Common.AmlOpcode == AML_VAR_PACKAGE_OP))
|
||||
{
|
||||
ReplacementOp = AcpiPsAllocOp (Op->Common.AmlOpcode);
|
||||
ReplacementOp = AcpiPsAllocOp (Op->Common.AmlOpcode,
|
||||
Op->Common.Aml);
|
||||
if (!ReplacementOp)
|
||||
{
|
||||
Status = AE_NO_MEMORY;
|
||||
|
@ -318,7 +323,8 @@ AcpiPsCompleteThisOp (
|
|||
|
||||
default:
|
||||
|
||||
ReplacementOp = AcpiPsAllocOp (AML_INT_RETURN_VALUE_OP);
|
||||
ReplacementOp = AcpiPsAllocOp (AML_INT_RETURN_VALUE_OP,
|
||||
Op->Common.Aml);
|
||||
if (!ReplacementOp)
|
||||
{
|
||||
Status = AE_NO_MEMORY;
|
||||
|
|
|
@ -136,12 +136,12 @@
|
|||
|
||||
ACPI_PARSE_OBJECT *
|
||||
AcpiPsCreateScopeOp (
|
||||
void)
|
||||
UINT8 *Aml)
|
||||
{
|
||||
ACPI_PARSE_OBJECT *ScopeOp;
|
||||
|
||||
|
||||
ScopeOp = AcpiPsAllocOp (AML_SCOPE_OP);
|
||||
ScopeOp = AcpiPsAllocOp (AML_SCOPE_OP, Aml);
|
||||
if (!ScopeOp)
|
||||
{
|
||||
return (NULL);
|
||||
|
@ -176,7 +176,7 @@ AcpiPsInitOp (
|
|||
Op->Common.DescriptorType = ACPI_DESC_TYPE_PARSER;
|
||||
Op->Common.AmlOpcode = Opcode;
|
||||
|
||||
ACPI_DISASM_ONLY_MEMBERS (ACPI_STRNCPY (Op->Common.AmlOpName,
|
||||
ACPI_DISASM_ONLY_MEMBERS (strncpy (Op->Common.AmlOpName,
|
||||
(AcpiPsGetOpcodeInfo (Opcode))->Name,
|
||||
sizeof (Op->Common.AmlOpName)));
|
||||
}
|
||||
|
@ -187,6 +187,7 @@ AcpiPsInitOp (
|
|||
* FUNCTION: AcpiPsAllocOp
|
||||
*
|
||||
* PARAMETERS: Opcode - Opcode that will be stored in the new Op
|
||||
* Aml - Address of the opcode
|
||||
*
|
||||
* RETURN: Pointer to the new Op, null on failure
|
||||
*
|
||||
|
@ -198,7 +199,8 @@ AcpiPsInitOp (
|
|||
|
||||
ACPI_PARSE_OBJECT*
|
||||
AcpiPsAllocOp (
|
||||
UINT16 Opcode)
|
||||
UINT16 Opcode,
|
||||
UINT8 *Aml)
|
||||
{
|
||||
ACPI_PARSE_OBJECT *Op;
|
||||
const ACPI_OPCODE_INFO *OpInfo;
|
||||
|
@ -245,6 +247,7 @@ AcpiPsAllocOp (
|
|||
if (Op)
|
||||
{
|
||||
AcpiPsInitOp (Op, Opcode);
|
||||
Op->Common.Aml = Aml;
|
||||
Op->Common.Flags = Flags;
|
||||
}
|
||||
|
||||
|
|
|
@ -119,6 +119,7 @@
|
|||
#include "acdispat.h"
|
||||
#include "acinterp.h"
|
||||
#include "actables.h"
|
||||
#include "acnamesp.h"
|
||||
|
||||
|
||||
#define _COMPONENT ACPI_PARSER
|
||||
|
@ -126,14 +127,6 @@
|
|||
|
||||
/* Local Prototypes */
|
||||
|
||||
static void
|
||||
AcpiPsStartTrace (
|
||||
ACPI_EVALUATE_INFO *Info);
|
||||
|
||||
static void
|
||||
AcpiPsStopTrace (
|
||||
ACPI_EVALUATE_INFO *Info);
|
||||
|
||||
static void
|
||||
AcpiPsUpdateParameterList (
|
||||
ACPI_EVALUATE_INFO *Info,
|
||||
|
@ -158,7 +151,7 @@ AcpiPsUpdateParameterList (
|
|||
|
||||
ACPI_STATUS
|
||||
AcpiDebugTrace (
|
||||
char *Name,
|
||||
const char *Name,
|
||||
UINT32 DebugLevel,
|
||||
UINT32 DebugLayer,
|
||||
UINT32 Flags)
|
||||
|
@ -172,128 +165,14 @@ AcpiDebugTrace (
|
|||
return (Status);
|
||||
}
|
||||
|
||||
/* TBDs: Validate name, allow full path or just nameseg */
|
||||
|
||||
AcpiGbl_TraceMethodName = *ACPI_CAST_PTR (UINT32, Name);
|
||||
AcpiGbl_TraceMethodName = Name;
|
||||
AcpiGbl_TraceFlags = Flags;
|
||||
|
||||
if (DebugLevel)
|
||||
{
|
||||
AcpiGbl_TraceDbgLevel = DebugLevel;
|
||||
}
|
||||
if (DebugLayer)
|
||||
{
|
||||
AcpiGbl_TraceDbgLayer = DebugLayer;
|
||||
}
|
||||
AcpiGbl_TraceDbgLevel = DebugLevel;
|
||||
AcpiGbl_TraceDbgLayer = DebugLayer;
|
||||
Status = AE_OK;
|
||||
|
||||
(void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
|
||||
return (AE_OK);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiPsStartTrace
|
||||
*
|
||||
* PARAMETERS: Info - Method info struct
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Start control method execution trace
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
static void
|
||||
AcpiPsStartTrace (
|
||||
ACPI_EVALUATE_INFO *Info)
|
||||
{
|
||||
ACPI_STATUS Status;
|
||||
|
||||
|
||||
ACPI_FUNCTION_ENTRY ();
|
||||
|
||||
|
||||
Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if ((!AcpiGbl_TraceMethodName) ||
|
||||
(AcpiGbl_TraceMethodName != Info->Node->Name.Integer))
|
||||
{
|
||||
goto Exit;
|
||||
}
|
||||
|
||||
AcpiGbl_OriginalDbgLevel = AcpiDbgLevel;
|
||||
AcpiGbl_OriginalDbgLayer = AcpiDbgLayer;
|
||||
|
||||
AcpiDbgLevel = 0x00FFFFFF;
|
||||
AcpiDbgLayer = ACPI_UINT32_MAX;
|
||||
|
||||
if (AcpiGbl_TraceDbgLevel)
|
||||
{
|
||||
AcpiDbgLevel = AcpiGbl_TraceDbgLevel;
|
||||
}
|
||||
if (AcpiGbl_TraceDbgLayer)
|
||||
{
|
||||
AcpiDbgLayer = AcpiGbl_TraceDbgLayer;
|
||||
}
|
||||
|
||||
|
||||
Exit:
|
||||
(void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
|
||||
}
|
||||
|
||||
|
||||
/*******************************************************************************
|
||||
*
|
||||
* FUNCTION: AcpiPsStopTrace
|
||||
*
|
||||
* PARAMETERS: Info - Method info struct
|
||||
*
|
||||
* RETURN: None
|
||||
*
|
||||
* DESCRIPTION: Stop control method execution trace
|
||||
*
|
||||
******************************************************************************/
|
||||
|
||||
static void
|
||||
AcpiPsStopTrace (
|
||||
ACPI_EVALUATE_INFO *Info)
|
||||
{
|
||||
ACPI_STATUS Status;
|
||||
|
||||
|
||||
ACPI_FUNCTION_ENTRY ();
|
||||
|
||||
|
||||
Status = AcpiUtAcquireMutex (ACPI_MTX_NAMESPACE);
|
||||
if (ACPI_FAILURE (Status))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if ((!AcpiGbl_TraceMethodName) ||
|
||||
(AcpiGbl_TraceMethodName != Info->Node->Name.Integer))
|
||||
{
|
||||
goto Exit;
|
||||
}
|
||||
|
||||
/* Disable further tracing if type is one-shot */
|
||||
|
||||
if (AcpiGbl_TraceFlags & 1)
|
||||
{
|
||||
AcpiGbl_TraceMethodName = 0;
|
||||
AcpiGbl_TraceDbgLevel = 0;
|
||||
AcpiGbl_TraceDbgLayer = 0;
|
||||
}
|
||||
|
||||
AcpiDbgLevel = AcpiGbl_OriginalDbgLevel;
|
||||
AcpiDbgLayer = AcpiGbl_OriginalDbgLayer;
|
||||
|
||||
Exit:
|
||||
(void) AcpiUtReleaseMutex (ACPI_MTX_NAMESPACE);
|
||||
return (Status);
|
||||
}
|
||||
|
||||
|
||||
|
@ -356,10 +235,6 @@ AcpiPsExecuteMethod (
|
|||
*/
|
||||
AcpiPsUpdateParameterList (Info, REF_INCREMENT);
|
||||
|
||||
/* Begin tracing if requested */
|
||||
|
||||
AcpiPsStartTrace (Info);
|
||||
|
||||
/*
|
||||
* Execute the method. Performs parse simultaneously
|
||||
*/
|
||||
|
@ -369,7 +244,7 @@ AcpiPsExecuteMethod (
|
|||
|
||||
/* Create and init a Root Node */
|
||||
|
||||
Op = AcpiPsCreateScopeOp ();
|
||||
Op = AcpiPsCreateScopeOp (Info->ObjDesc->Method.AmlStart);
|
||||
if (!Op)
|
||||
{
|
||||
Status = AE_NO_MEMORY;
|
||||
|
@ -442,10 +317,6 @@ AcpiPsExecuteMethod (
|
|||
Cleanup:
|
||||
AcpiPsDeleteParseTree (Op);
|
||||
|
||||
/* End optional tracing */
|
||||
|
||||
AcpiPsStopTrace (Info);
|
||||
|
||||
/* Take away the extra reference that we gave the parameters above */
|
||||
|
||||
AcpiPsUpdateParameterList (Info, REF_DECREMENT);
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue