Change project structure

This commit is contained in:
Mark
2020-02-04 12:45:15 +02:00
parent b60ae9eebd
commit d9595c7f62
380 changed files with 434 additions and 411 deletions
-343
View File
@@ -1,343 +0,0 @@
/******************************************************************************
*
* Module Name: acapps - common include for ACPI applications/tools
*
*****************************************************************************/
/******************************************************************************
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2019, 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.
*
*****************************************************************************
*
* Alternatively, you may choose to be licensed under the terms of the
* following license:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Alternatively, you may choose to be licensed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
*****************************************************************************/
#ifndef _ACAPPS
#define _ACAPPS
#ifdef ACPI_USE_STANDARD_HEADERS
#include <sys/stat.h>
#endif /* ACPI_USE_STANDARD_HEADERS */
/* Common info for tool signons */
#define ACPICA_NAME "Intel ACPI Component Architecture"
#define ACPICA_COPYRIGHT "Copyright (c) 2000 - 2019 Intel Corporation"
#if ACPI_MACHINE_WIDTH == 64
#define ACPI_WIDTH " (64-bit version)"
#elif ACPI_MACHINE_WIDTH == 32
#define ACPI_WIDTH " (32-bit version)"
#else
#error unknown ACPI_MACHINE_WIDTH
#define ACPI_WIDTH " (unknown bit width, not 32 or 64)"
#endif
/* Macros for signons and file headers */
#define ACPI_COMMON_SIGNON(UtilityName) \
"\n%s\n%s version %08x\n%s\n\n", \
ACPICA_NAME, \
UtilityName, ((UINT32) ACPI_CA_VERSION), \
ACPICA_COPYRIGHT
#define ACPI_COMMON_HEADER(UtilityName, Prefix) \
"%s%s\n%s%s version %08x%s\n%s%s\n%s\n", \
Prefix, ACPICA_NAME, \
Prefix, UtilityName, ((UINT32) ACPI_CA_VERSION), ACPI_WIDTH, \
Prefix, ACPICA_COPYRIGHT, \
Prefix
#define ACPI_COMMON_BUILD_TIME \
"Build date/time: %s %s\n", __DATE__, __TIME__
/* Macros for usage messages */
#define ACPI_USAGE_HEADER(Usage) \
printf ("Usage: %s\nOptions:\n", Usage);
#define ACPI_USAGE_TEXT(Description) \
printf (Description);
#define ACPI_OPTION(Name, Description) \
printf (" %20s%s\n", Name, Description);
/* Check for unexpected exceptions */
#define ACPI_CHECK_STATUS(Name, Status, Expected) \
if (Status != Expected) \
{ \
AcpiOsPrintf ("Unexpected %s from %s (%s-%d)\n", \
AcpiFormatException (Status), #Name, _AcpiModuleName, __LINE__); \
}
/* Check for unexpected non-AE_OK errors */
#define ACPI_CHECK_OK(Name, Status) ACPI_CHECK_STATUS (Name, Status, AE_OK);
#define FILE_SUFFIX_DISASSEMBLY "dsl"
#define FILE_SUFFIX_BINARY_TABLE ".dat" /* Needs the dot */
/* acfileio */
ACPI_STATUS
AcGetAllTablesFromFile (
char *Filename,
UINT8 GetOnlyAmlTables,
ACPI_NEW_TABLE_DESC **ReturnListHead);
void
AcDeleteTableList (
ACPI_NEW_TABLE_DESC *ListHead);
BOOLEAN
AcIsFileBinary (
FILE *File);
ACPI_STATUS
AcValidateTableHeader (
FILE *File,
long TableOffset);
/* Values for GetOnlyAmlTables */
#define ACPI_GET_ONLY_AML_TABLES TRUE
#define ACPI_GET_ALL_TABLES FALSE
/*
* getopt
*/
int
AcpiGetopt(
int argc,
char **argv,
char *opts);
int
AcpiGetoptArgument (
int argc,
char **argv);
extern int AcpiGbl_Optind;
extern int AcpiGbl_Opterr;
extern int AcpiGbl_SubOptChar;
extern char *AcpiGbl_Optarg;
/*
* cmfsize - Common get file size function
*/
UINT32
CmGetFileSize (
ACPI_FILE File);
/*
* adwalk
*/
void
AcpiDmCrossReferenceNamespace (
ACPI_PARSE_OBJECT *ParseTreeRoot,
ACPI_NAMESPACE_NODE *NamespaceRoot,
ACPI_OWNER_ID OwnerId);
void
AcpiDmDumpTree (
ACPI_PARSE_OBJECT *Origin);
void
AcpiDmFindOrphanMethods (
ACPI_PARSE_OBJECT *Origin);
void
AcpiDmFinishNamespaceLoad (
ACPI_PARSE_OBJECT *ParseTreeRoot,
ACPI_NAMESPACE_NODE *NamespaceRoot,
ACPI_OWNER_ID OwnerId);
void
AcpiDmConvertParseObjects (
ACPI_PARSE_OBJECT *ParseTreeRoot,
ACPI_NAMESPACE_NODE *NamespaceRoot);
/*
* adfile
*/
ACPI_STATUS
AdInitialize (
void);
char *
FlGenerateFilename (
char *InputFilename,
char *Suffix);
ACPI_STATUS
FlSplitInputPathname (
char *InputPath,
char **OutDirectoryPath,
char **OutFilename);
char *
FlGetFileBasename (
char *FilePathname);
char *
AdGenerateFilename (
char *Prefix,
char *TableId);
void
AdWriteTable (
ACPI_TABLE_HEADER *Table,
UINT32 Length,
char *TableName,
char *OemTableId);
#endif /* _ACAPPS */
-363
View File
@@ -1,363 +0,0 @@
/******************************************************************************
*
* Name: acbuffer.h - Support for buffers returned by ACPI predefined names
*
*****************************************************************************/
/******************************************************************************
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2019, 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.
*
*****************************************************************************
*
* Alternatively, you may choose to be licensed under the terms of the
* following license:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Alternatively, you may choose to be licensed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
*****************************************************************************/
#ifndef __ACBUFFER_H__
#define __ACBUFFER_H__
/*
* Contains buffer structures for these predefined names:
* _FDE, _GRT, _GTM, _PLD, _SRT
*/
/*
* Note: C bitfields are not used for this reason:
*
* "Bitfields are great and easy to read, but unfortunately the C language
* does not specify the layout of bitfields in memory, which means they are
* essentially useless for dealing with packed data in on-disk formats or
* binary wire protocols." (Or ACPI tables and buffers.) "If you ask me,
* this decision was a design error in C. Ritchie could have picked an order
* and stuck with it." Norman Ramsey.
* See http://stackoverflow.com/a/1053662/41661
*/
/* _FDE return value */
typedef struct acpi_fde_info
{
UINT32 Floppy0;
UINT32 Floppy1;
UINT32 Floppy2;
UINT32 Floppy3;
UINT32 Tape;
} ACPI_FDE_INFO;
/*
* _GRT return value
* _SRT input value
*/
typedef struct acpi_grt_info
{
UINT16 Year;
UINT8 Month;
UINT8 Day;
UINT8 Hour;
UINT8 Minute;
UINT8 Second;
UINT8 Valid;
UINT16 Milliseconds;
UINT16 Timezone;
UINT8 Daylight;
UINT8 Reserved[3];
} ACPI_GRT_INFO;
/* _GTM return value */
typedef struct acpi_gtm_info
{
UINT32 PioSpeed0;
UINT32 DmaSpeed0;
UINT32 PioSpeed1;
UINT32 DmaSpeed1;
UINT32 Flags;
} ACPI_GTM_INFO;
/*
* Formatted _PLD return value. The minimum size is a package containing
* one buffer.
* Revision 1: Buffer is 16 bytes (128 bits)
* Revision 2: Buffer is 20 bytes (160 bits)
*
* Note: This structure is returned from the AcpiDecodePldBuffer
* interface.
*/
typedef struct acpi_pld_info
{
UINT8 Revision;
UINT8 IgnoreColor;
UINT8 Red;
UINT8 Green;
UINT8 Blue;
UINT16 Width;
UINT16 Height;
UINT8 UserVisible;
UINT8 Dock;
UINT8 Lid;
UINT8 Panel;
UINT8 VerticalPosition;
UINT8 HorizontalPosition;
UINT8 Shape;
UINT8 GroupOrientation;
UINT8 GroupToken;
UINT8 GroupPosition;
UINT8 Bay;
UINT8 Ejectable;
UINT8 OspmEjectRequired;
UINT8 CabinetNumber;
UINT8 CardCageNumber;
UINT8 Reference;
UINT8 Rotation;
UINT8 Order;
UINT8 Reserved;
UINT16 VerticalOffset;
UINT16 HorizontalOffset;
} ACPI_PLD_INFO;
/*
* Macros to:
* 1) Convert a _PLD buffer to internal ACPI_PLD_INFO format - ACPI_PLD_GET*
* (Used by AcpiDecodePldBuffer)
* 2) Construct a _PLD buffer - ACPI_PLD_SET*
* (Intended for BIOS use only)
*/
#define ACPI_PLD_REV1_BUFFER_SIZE 16 /* For Revision 1 of the buffer (From ACPI spec) */
#define ACPI_PLD_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 */
#define ACPI_PLD_GET_REVISION(dword) ACPI_GET_BITS (dword, 0, ACPI_7BIT_MASK)
#define ACPI_PLD_SET_REVISION(dword,value) ACPI_SET_BITS (dword, 0, ACPI_7BIT_MASK, value) /* Offset 0, Len 7 */
#define ACPI_PLD_GET_IGNORE_COLOR(dword) ACPI_GET_BITS (dword, 7, ACPI_1BIT_MASK)
#define ACPI_PLD_SET_IGNORE_COLOR(dword,value) ACPI_SET_BITS (dword, 7, ACPI_1BIT_MASK, value) /* Offset 7, Len 1 */
#define ACPI_PLD_GET_RED(dword) ACPI_GET_BITS (dword, 8, ACPI_8BIT_MASK)
#define ACPI_PLD_SET_RED(dword,value) ACPI_SET_BITS (dword, 8, ACPI_8BIT_MASK, value) /* Offset 8, Len 8 */
#define ACPI_PLD_GET_GREEN(dword) ACPI_GET_BITS (dword, 16, ACPI_8BIT_MASK)
#define ACPI_PLD_SET_GREEN(dword,value) ACPI_SET_BITS (dword, 16, ACPI_8BIT_MASK, value) /* Offset 16, Len 8 */
#define ACPI_PLD_GET_BLUE(dword) ACPI_GET_BITS (dword, 24, ACPI_8BIT_MASK)
#define ACPI_PLD_SET_BLUE(dword,value) ACPI_SET_BITS (dword, 24, ACPI_8BIT_MASK, value) /* Offset 24, Len 8 */
/* Second 32-bit dword, bits 33:63 */
#define ACPI_PLD_GET_WIDTH(dword) ACPI_GET_BITS (dword, 0, ACPI_16BIT_MASK)
#define ACPI_PLD_SET_WIDTH(dword,value) ACPI_SET_BITS (dword, 0, ACPI_16BIT_MASK, value) /* Offset 32+0=32, Len 16 */
#define ACPI_PLD_GET_HEIGHT(dword) ACPI_GET_BITS (dword, 16, ACPI_16BIT_MASK)
#define ACPI_PLD_SET_HEIGHT(dword,value) ACPI_SET_BITS (dword, 16, ACPI_16BIT_MASK, value) /* Offset 32+16=48, Len 16 */
/* Third 32-bit dword, bits 64:95 */
#define ACPI_PLD_GET_USER_VISIBLE(dword) ACPI_GET_BITS (dword, 0, ACPI_1BIT_MASK)
#define ACPI_PLD_SET_USER_VISIBLE(dword,value) ACPI_SET_BITS (dword, 0, ACPI_1BIT_MASK, value) /* Offset 64+0=64, Len 1 */
#define ACPI_PLD_GET_DOCK(dword) ACPI_GET_BITS (dword, 1, ACPI_1BIT_MASK)
#define ACPI_PLD_SET_DOCK(dword,value) ACPI_SET_BITS (dword, 1, ACPI_1BIT_MASK, value) /* Offset 64+1=65, Len 1 */
#define ACPI_PLD_GET_LID(dword) ACPI_GET_BITS (dword, 2, ACPI_1BIT_MASK)
#define ACPI_PLD_SET_LID(dword,value) ACPI_SET_BITS (dword, 2, ACPI_1BIT_MASK, value) /* Offset 64+2=66, Len 1 */
#define ACPI_PLD_GET_PANEL(dword) ACPI_GET_BITS (dword, 3, ACPI_3BIT_MASK)
#define ACPI_PLD_SET_PANEL(dword,value) ACPI_SET_BITS (dword, 3, ACPI_3BIT_MASK, value) /* Offset 64+3=67, Len 3 */
#define ACPI_PLD_GET_VERTICAL(dword) ACPI_GET_BITS (dword, 6, ACPI_2BIT_MASK)
#define ACPI_PLD_SET_VERTICAL(dword,value) ACPI_SET_BITS (dword, 6, ACPI_2BIT_MASK, value) /* Offset 64+6=70, Len 2 */
#define ACPI_PLD_GET_HORIZONTAL(dword) ACPI_GET_BITS (dword, 8, ACPI_2BIT_MASK)
#define ACPI_PLD_SET_HORIZONTAL(dword,value) ACPI_SET_BITS (dword, 8, ACPI_2BIT_MASK, value) /* Offset 64+8=72, Len 2 */
#define ACPI_PLD_GET_SHAPE(dword) ACPI_GET_BITS (dword, 10, ACPI_4BIT_MASK)
#define ACPI_PLD_SET_SHAPE(dword,value) ACPI_SET_BITS (dword, 10, ACPI_4BIT_MASK, value) /* Offset 64+10=74, Len 4 */
#define ACPI_PLD_GET_ORIENTATION(dword) ACPI_GET_BITS (dword, 14, ACPI_1BIT_MASK)
#define ACPI_PLD_SET_ORIENTATION(dword,value) ACPI_SET_BITS (dword, 14, ACPI_1BIT_MASK, value) /* Offset 64+14=78, Len 1 */
#define ACPI_PLD_GET_TOKEN(dword) ACPI_GET_BITS (dword, 15, ACPI_8BIT_MASK)
#define ACPI_PLD_SET_TOKEN(dword,value) ACPI_SET_BITS (dword, 15, ACPI_8BIT_MASK, value) /* Offset 64+15=79, Len 8 */
#define ACPI_PLD_GET_POSITION(dword) ACPI_GET_BITS (dword, 23, ACPI_8BIT_MASK)
#define ACPI_PLD_SET_POSITION(dword,value) ACPI_SET_BITS (dword, 23, ACPI_8BIT_MASK, value) /* Offset 64+23=87, Len 8 */
#define ACPI_PLD_GET_BAY(dword) ACPI_GET_BITS (dword, 31, ACPI_1BIT_MASK)
#define ACPI_PLD_SET_BAY(dword,value) ACPI_SET_BITS (dword, 31, ACPI_1BIT_MASK, value) /* Offset 64+31=95, Len 1 */
/* Fourth 32-bit dword, bits 96:127 */
#define ACPI_PLD_GET_EJECTABLE(dword) ACPI_GET_BITS (dword, 0, ACPI_1BIT_MASK)
#define ACPI_PLD_SET_EJECTABLE(dword,value) ACPI_SET_BITS (dword, 0, ACPI_1BIT_MASK, value) /* Offset 96+0=96, Len 1 */
#define ACPI_PLD_GET_OSPM_EJECT(dword) ACPI_GET_BITS (dword, 1, ACPI_1BIT_MASK)
#define ACPI_PLD_SET_OSPM_EJECT(dword,value) ACPI_SET_BITS (dword, 1, ACPI_1BIT_MASK, value) /* Offset 96+1=97, Len 1 */
#define ACPI_PLD_GET_CABINET(dword) ACPI_GET_BITS (dword, 2, ACPI_8BIT_MASK)
#define ACPI_PLD_SET_CABINET(dword,value) ACPI_SET_BITS (dword, 2, ACPI_8BIT_MASK, value) /* Offset 96+2=98, Len 8 */
#define ACPI_PLD_GET_CARD_CAGE(dword) ACPI_GET_BITS (dword, 10, ACPI_8BIT_MASK)
#define ACPI_PLD_SET_CARD_CAGE(dword,value) ACPI_SET_BITS (dword, 10, ACPI_8BIT_MASK, value) /* Offset 96+10=106, Len 8 */
#define ACPI_PLD_GET_REFERENCE(dword) ACPI_GET_BITS (dword, 18, ACPI_1BIT_MASK)
#define ACPI_PLD_SET_REFERENCE(dword,value) ACPI_SET_BITS (dword, 18, ACPI_1BIT_MASK, value) /* Offset 96+18=114, Len 1 */
#define ACPI_PLD_GET_ROTATION(dword) ACPI_GET_BITS (dword, 19, ACPI_4BIT_MASK)
#define ACPI_PLD_SET_ROTATION(dword,value) ACPI_SET_BITS (dword, 19, ACPI_4BIT_MASK, value) /* Offset 96+19=115, Len 4 */
#define ACPI_PLD_GET_ORDER(dword) ACPI_GET_BITS (dword, 23, ACPI_5BIT_MASK)
#define ACPI_PLD_SET_ORDER(dword,value) ACPI_SET_BITS (dword, 23, ACPI_5BIT_MASK, value) /* Offset 96+23=119, Len 5 */
/* Fifth 32-bit dword, bits 128:159 (Revision 2 of _PLD only) */
#define ACPI_PLD_GET_VERT_OFFSET(dword) ACPI_GET_BITS (dword, 0, ACPI_16BIT_MASK)
#define ACPI_PLD_SET_VERT_OFFSET(dword,value) ACPI_SET_BITS (dword, 0, ACPI_16BIT_MASK, value) /* Offset 128+0=128, Len 16 */
#define ACPI_PLD_GET_HORIZ_OFFSET(dword) ACPI_GET_BITS (dword, 16, ACPI_16BIT_MASK)
#define ACPI_PLD_SET_HORIZ_OFFSET(dword,value) ACPI_SET_BITS (dword, 16, ACPI_16BIT_MASK, value) /* Offset 128+16=144, Len 16 */
#endif /* ACBUFFER_H */
-431
View File
@@ -1,431 +0,0 @@
/******************************************************************************
*
* 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 - 2019, 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.
*
*****************************************************************************
*
* Alternatively, you may choose to be licensed under the terms of the
* following license:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Alternatively, you may choose to be licensed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
*****************************************************************************/
#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))
/* Error code */
#define EPERM 1 /* Operation not permitted */
#define ENOENT 2 /* No such file or directory */
#define EINTR 4 /* Interrupted system call */
#define EIO 5 /* I/O error */
#define EBADF 9 /* Bad file number */
#define EAGAIN 11 /* Try again */
#define ENOMEM 12 /* Out of memory */
#define EACCES 13 /* Permission denied */
#define EFAULT 14 /* Bad address */
#define EBUSY 16 /* Device or resource busy */
#define EEXIST 17 /* File exists */
#define ENODEV 19 /* No such device */
#define EINVAL 22 /* Invalid argument */
#define EPIPE 32 /* Broken pipe */
#define ERANGE 34 /* Math result not representable */
/* Strings */
char *
strcat (
char *DstString,
const char *SrcString);
char *
strchr (
const char *String,
int ch);
char *
strpbrk (
const char *String,
const char *Delimiters);
char *
strtok (
char *String,
const char *Delimiters);
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);
char *
strstr (
char *String1,
char *String2);
/* Conversion */
UINT32
strtoul (
const char *String,
char **Terminator,
UINT32 Base);
/* Memory */
int
memcmp (
void *Buffer1,
void *Buffer2,
ACPI_SIZE Count);
void *
memcpy (
void *Dest,
const void *Src,
ACPI_SIZE Count);
void *
memmove (
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);
/*
* utprint - printf/vprintf output functions
*/
const char *
AcpiUtScanNumber (
const char *String,
UINT64 *NumberPtr);
const char *
AcpiUtPrintNumber (
char *String,
UINT64 Number);
int
vsnprintf (
char *String,
ACPI_SIZE Size,
const char *Format,
va_list Args);
int
snprintf (
char *String,
ACPI_SIZE Size,
const char *Format,
...);
int
sprintf (
char *String,
const char *Format,
...);
#ifdef ACPI_APPLICATION
#define SEEK_SET 0
#define SEEK_CUR 1
#define SEEK_END 2
/*
* NOTE: Currently we only need to update errno for file IOs. Other
* Clibrary invocations in ACPICA do not make decisions according to
* the errno.
*/
extern int errno;
#ifndef EOF
#define EOF (-1)
#endif
#define putchar(c) fputc(stdout, c)
#define getchar(c) fgetc(stdin)
int
vprintf (
const char *Format,
va_list Args);
int
printf (
const char *Format,
...);
int
vfprintf (
FILE *File,
const char *Format,
va_list Args);
int
fprintf (
FILE *File,
const char *Format,
...);
FILE *
fopen (
const char *Path,
const char *Modes);
void
fclose (
FILE *File);
int
fread (
void *Buffer,
ACPI_SIZE Size,
ACPI_SIZE Count,
FILE *File);
int
fwrite (
void *Buffer,
ACPI_SIZE Size,
ACPI_SIZE Count,
FILE *File);
int
fseek (
FILE *File,
long Offset,
int From);
long
ftell (
FILE *File);
int
fgetc (
FILE *File);
int
fputc (
FILE *File,
char c);
char *
fgets (
char *s,
ACPI_SIZE Size,
FILE *File);
#endif
#endif /* _ACCLIB_H */
-175
View File
@@ -1,175 +0,0 @@
/******************************************************************************
*
* Name: accommon.h - Common include files for generation of ACPICA source
*
*****************************************************************************/
/******************************************************************************
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2019, 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.
*
*****************************************************************************
*
* Alternatively, you may choose to be licensed under the terms of the
* following license:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Alternatively, you may choose to be licensed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
*****************************************************************************/
#ifndef __ACCOMMON_H__
#define __ACCOMMON_H__
/*
* Common set of includes for all ACPICA source files.
* We put them here because we don't want to duplicate them
* in the the source code again and again.
*
* Note: The order of these include files is important.
*/
#include "acconfig.h" /* Global configuration constants */
#include "acmacros.h" /* C macros */
#include "aclocal.h" /* Internal data types */
#include "acobject.h" /* ACPI internal object */
#include "acstruct.h" /* Common structures */
#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__ */
-375
View File
@@ -1,375 +0,0 @@
/******************************************************************************
*
* Name: acconfig.h - Global configuration constants
*
*****************************************************************************/
/******************************************************************************
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2019, 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.
*
*****************************************************************************
*
* Alternatively, you may choose to be licensed under the terms of the
* following license:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Alternatively, you may choose to be licensed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
*****************************************************************************/
#ifndef _ACCONFIG_H
#define _ACCONFIG_H
/******************************************************************************
*
* Configuration options
*
*****************************************************************************/
/*
* ACPI_DEBUG_OUTPUT - This switch enables all the debug facilities of the
* ACPI subsystem. This includes the DEBUG_PRINT output
* statements. When disabled, all DEBUG_PRINT
* statements are compiled out.
*
* ACPI_APPLICATION - Use this switch if the subsystem is going to be run
* at the application level.
*
*/
/*
* OS name, used for the _OS object. The _OS object is essentially obsolete,
* but there is a large base of ASL/AML code in existing machines that check
* for the string below. The use of this string usually guarantees that
* the ASL will execute down the most tested code path. Also, there is some
* code that will not execute the _OSI method unless _OS matches the string
* below. Therefore, change this string at your own risk.
*/
#define ACPI_OS_NAME "Microsoft Windows NT"
/* Maximum objects in the various object caches */
#define ACPI_MAX_STATE_CACHE_DEPTH 96 /* State objects */
#define ACPI_MAX_PARSE_CACHE_DEPTH 96 /* Parse tree objects */
#define ACPI_MAX_EXTPARSE_CACHE_DEPTH 96 /* Parse tree objects */
#define ACPI_MAX_OBJECT_CACHE_DEPTH 96 /* Interpreter operand objects */
#define ACPI_MAX_NAMESPACE_CACHE_DEPTH 96 /* Namespace objects */
#define ACPI_MAX_COMMENT_CACHE_DEPTH 96 /* Comments for the -ca option */
/*
* Should the subsystem abort the loading of an ACPI table if the
* table checksum is incorrect?
*/
#ifndef ACPI_CHECKSUM_ABORT
#define ACPI_CHECKSUM_ABORT FALSE
#endif
/*
* Generate a version of ACPICA that only supports "reduced hardware"
* platforms (as defined in ACPI 5.0). Set to TRUE to generate a specialized
* version of ACPICA that ONLY supports the ACPI 5.0 "reduced hardware"
* model. In other words, no ACPI hardware is supported.
*
* If TRUE, this means no support for the following:
* PM Event and Control registers
* SCI interrupt (and handler)
* Fixed Events
* General Purpose Events (GPEs)
* Global Lock
* ACPI PM timer
* FACS table (Waking vectors and Global Lock)
*/
#ifndef ACPI_REDUCED_HARDWARE
#define ACPI_REDUCED_HARDWARE FALSE
#endif
/******************************************************************************
*
* Subsystem Constants
*
*****************************************************************************/
/* Version of ACPI supported */
#define ACPI_CA_SUPPORT_LEVEL 5
/* Maximum count for a semaphore object */
#define ACPI_MAX_SEMAPHORE_COUNT 256
/* Maximum object reference count (detects object deletion issues) */
#define ACPI_MAX_REFERENCE_COUNT 0x4000
/* Default page size for use in mapping memory for operation regions */
#define ACPI_DEFAULT_PAGE_SIZE 4096 /* Must be power of 2 */
/* OwnerId tracking. 128 entries allows for 4095 OwnerIds */
#define ACPI_NUM_OWNERID_MASKS 128
/* Size of the root table array is increased by this increment */
#define ACPI_ROOT_TABLE_SIZE_INCREMENT 4
/* Maximum sleep allowed via Sleep() operator */
#define ACPI_MAX_SLEEP 2000 /* 2000 millisec == two seconds */
/* Address Range lists are per-SpaceId (Memory and I/O only) */
#define ACPI_ADDRESS_RANGE_MAX 2
/* Maximum time (default 30s) of While() loops before abort */
#define ACPI_MAX_LOOP_TIMEOUT 30
/******************************************************************************
*
* ACPI Specification constants (Do not change unless the specification changes)
*
*****************************************************************************/
/* Method info (in WALK_STATE), containing local variables and argumetns */
#define ACPI_METHOD_NUM_LOCALS 8
#define ACPI_METHOD_MAX_LOCAL 7
#define ACPI_METHOD_NUM_ARGS 7
#define ACPI_METHOD_MAX_ARG 6
/*
* Operand Stack (in WALK_STATE), Must be large enough to contain METHOD_MAX_ARG
*/
#define ACPI_OBJ_NUM_OPERANDS 8
#define ACPI_OBJ_MAX_OPERAND 7
/* Number of elements in the Result Stack frame, can be an arbitrary value */
#define ACPI_RESULTS_FRAME_OBJ_NUM 8
/*
* Maximal number of elements the Result Stack can contain,
* it may be an arbitrary value not exceeding the types of
* ResultSize and ResultCount (now UINT8).
*/
#define ACPI_RESULTS_OBJ_NUM_MAX 255
/* Constants used in searching for the RSDP in low memory */
#define ACPI_EBDA_PTR_LOCATION 0x0000040E /* Physical Address */
#define ACPI_EBDA_PTR_LENGTH 2
#define ACPI_EBDA_WINDOW_SIZE 1024
#define ACPI_HI_RSDP_WINDOW_BASE 0x000E0000 /* Physical Address */
#define ACPI_HI_RSDP_WINDOW_SIZE 0x00020000
#define ACPI_RSDP_SCAN_STEP 16
/* Operation regions */
#define ACPI_USER_REGION_BEGIN 0x80
/* Maximum SpaceIds for Operation Regions */
#define ACPI_MAX_ADDRESS_SPACE 255
#define ACPI_NUM_DEFAULT_SPACES 4
/* Array sizes. Used for range checking also */
#define ACPI_MAX_MATCH_OPCODE 5
/* RSDP checksums */
#define ACPI_RSDP_CHECKSUM_LENGTH 20
#define ACPI_RSDP_XCHECKSUM_LENGTH 36
/*
* SMBus, GSBus and IPMI buffer sizes. All have a 2-byte header,
* containing both Status and Length.
*/
#define ACPI_SERIAL_HEADER_SIZE 2 /* Common for below. Status and Length fields */
#define ACPI_SMBUS_DATA_SIZE 32
#define ACPI_SMBUS_BUFFER_SIZE ACPI_SERIAL_HEADER_SIZE + ACPI_SMBUS_DATA_SIZE
#define ACPI_IPMI_DATA_SIZE 64
#define ACPI_IPMI_BUFFER_SIZE ACPI_SERIAL_HEADER_SIZE + ACPI_IPMI_DATA_SIZE
#define ACPI_MAX_GSBUS_DATA_SIZE 255
#define ACPI_MAX_GSBUS_BUFFER_SIZE ACPI_SERIAL_HEADER_SIZE + ACPI_MAX_GSBUS_DATA_SIZE
/* _SxD and _SxW control methods */
#define ACPI_NUM_SxD_METHODS 4
#define ACPI_NUM_SxW_METHODS 5
/******************************************************************************
*
* Miscellaneous constants
*
*****************************************************************************/
/* UUID constants */
#define UUID_BUFFER_LENGTH 16 /* Length of UUID in memory */
#define UUID_STRING_LENGTH 36 /* Total length of a UUID string */
/* Positions for required hyphens (dashes) in UUID strings */
#define UUID_HYPHEN1_OFFSET 8
#define UUID_HYPHEN2_OFFSET 13
#define UUID_HYPHEN3_OFFSET 18
#define UUID_HYPHEN4_OFFSET 23
/******************************************************************************
*
* ACPI AML Debugger
*
*****************************************************************************/
#define ACPI_DEBUGGER_MAX_ARGS ACPI_METHOD_NUM_ARGS + 4 /* Max command line arguments */
#define ACPI_DB_LINE_BUFFER_SIZE 512
#define ACPI_DEBUGGER_COMMAND_PROMPT '-'
#define ACPI_DEBUGGER_EXECUTE_PROMPT '%'
#endif /* _ACCONFIG_H */
-312
View File
@@ -1,312 +0,0 @@
/******************************************************************************
*
* Module Name: acapps - common include for ACPI applications/tools
*
*****************************************************************************/
/******************************************************************************
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2019, 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.
*
*****************************************************************************
*
* Alternatively, you may choose to be licensed under the terms of the
* following license:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Alternatively, you may choose to be licensed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
*****************************************************************************/
#ifndef _ACCONVERT
#define _ACCONVERT
/* Definitions for comment state */
#define ASL_COMMENT_STANDARD 1
#define ASLCOMMENT_INLINE 2
#define ASL_COMMENT_OPEN_PAREN 3
#define ASL_COMMENT_CLOSE_PAREN 4
#define ASL_COMMENT_CLOSE_BRACE 5
/* Definitions for comment print function*/
#define AML_COMMENT_STANDARD 1
#define AMLCOMMENT_INLINE 2
#define AML_COMMENT_END_NODE 3
#define AML_NAMECOMMENT 4
#define AML_COMMENT_CLOSE_BRACE 5
#define AML_COMMENT_ENDBLK 6
#define AML_COMMENT_INCLUDE 7
#ifdef ACPI_ASL_COMPILER
/*
* cvcompiler
*/
void
CvProcessComment (
ASL_COMMENT_STATE CurrentState,
char *StringBuffer,
int c1);
void
CvProcessCommentType2 (
ASL_COMMENT_STATE CurrentState,
char *StringBuffer);
UINT32
CvCalculateCommentLengths(
ACPI_PARSE_OBJECT *Op);
void
CvProcessCommentState (
char input);
char*
CvAppendInlineComment (
char *InlineComment,
char *ToAdd);
void
CvAddToCommentList (
char* ToAdd);
void
CvPlaceComment (
UINT8 Type,
char *CommentString);
UINT32
CvParseOpBlockType (
ACPI_PARSE_OBJECT *Op);
ACPI_COMMENT_NODE*
CvCommentNodeCalloc (
void);
void
CgWriteAmlDefBlockComment (
ACPI_PARSE_OBJECT *Op);
void
CgWriteOneAmlComment (
ACPI_PARSE_OBJECT *Op,
char* CommentToPrint,
UINT8 InputOption);
void
CgWriteAmlComment (
ACPI_PARSE_OBJECT *Op);
/*
* cvparser
*/
void
CvInitFileTree (
ACPI_TABLE_HEADER *Table,
UINT8 *AmlStart,
UINT32 AmlLength);
void
CvClearOpComments (
ACPI_PARSE_OBJECT *Op);
ACPI_FILE_NODE*
CvFilenameExists (
char *Filename,
ACPI_FILE_NODE *Head);
void
CvLabelFileNode (
ACPI_PARSE_OBJECT *Op);
void
CvCaptureListComments (
ACPI_PARSE_STATE *ParserState,
ACPI_COMMENT_NODE *ListHead,
ACPI_COMMENT_NODE *ListTail);
void
CvCaptureCommentsOnly (
ACPI_PARSE_STATE *ParserState);
void
CvCaptureComments (
ACPI_WALK_STATE *WalkState);
void
CvTransferComments (
ACPI_PARSE_OBJECT *Op);
/*
* cvdisasm
*/
void
CvSwitchFiles (
UINT32 level,
ACPI_PARSE_OBJECT *op);
BOOLEAN
CvFileHasSwitched (
ACPI_PARSE_OBJECT *Op);
void
CvCloseParenWriteComment (
ACPI_PARSE_OBJECT *Op,
UINT32 Level);
void
CvCloseBraceWriteComment (
ACPI_PARSE_OBJECT *Op,
UINT32 Level);
void
CvPrintOneCommentList (
ACPI_COMMENT_NODE *CommentList,
UINT32 Level);
void
CvPrintOneCommentType (
ACPI_PARSE_OBJECT *Op,
UINT8 CommentType,
char* EndStr,
UINT32 Level);
#endif
#endif /* _ACCONVERT */
-616
View File
@@ -1,616 +0,0 @@
/******************************************************************************
*
* Name: acdebug.h - ACPI/AML debugger
*
*****************************************************************************/
/******************************************************************************
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2019, 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.
*
*****************************************************************************
*
* Alternatively, you may choose to be licensed under the terms of the
* following license:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Alternatively, you may choose to be licensed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
*****************************************************************************/
#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 */
#define ACPI_DEBUG_LENGTH_FORMAT " (%04x bits, %03x bytes)"
typedef struct acpi_db_command_info
{
const char *Name; /* Command Name */
UINT8 MinArgs; /* Minimum arguments required */
} ACPI_DB_COMMAND_INFO;
typedef struct acpi_db_command_help
{
UINT8 LineCount; /* Number of help lines */
char *Invocation; /* Command Invocation */
char *Description; /* Command Description */
} ACPI_DB_COMMAND_HELP;
typedef struct acpi_db_argument_info
{
const char *Name; /* Argument Name */
} ACPI_DB_ARGUMENT_INFO;
typedef struct acpi_db_execute_walk
{
UINT32 Count;
UINT32 MaxCount;
} ACPI_DB_EXECUTE_WALK;
#define PARAM_LIST(pl) pl
#define EX_NO_SINGLE_STEP 1
#define EX_SINGLE_STEP 2
/*
* dbxface - external debugger interfaces
*/
ACPI_DBR_DEPENDENT_RETURN_OK (
ACPI_STATUS
AcpiDbSingleStep (
ACPI_WALK_STATE *WalkState,
ACPI_PARSE_OBJECT *Op,
UINT32 OpType))
ACPI_DBR_DEPENDENT_RETURN_VOID (
void
AcpiDbSignalBreakPoint (
ACPI_WALK_STATE *WalkState))
/*
* dbcmds - debug commands and output routines
*/
ACPI_NAMESPACE_NODE *
AcpiDbConvertToNode (
char *InString);
void
AcpiDbDisplayTableInfo (
char *TableArg);
void
AcpiDbDisplayTemplate (
char *BufferArg);
void
AcpiDbUnloadAcpiTable (
char *Name);
void
AcpiDbSendNotify (
char *Name,
UINT32 Value);
void
AcpiDbDisplayInterfaces (
char *ActionArg,
char *InterfaceNameArg);
ACPI_STATUS
AcpiDbSleep (
char *ObjectArg);
void
AcpiDbTrace (
char *EnableArg,
char *MethodArg,
char *OnceArg);
void
AcpiDbDisplayLocks (
void);
void
AcpiDbDisplayResources (
char *ObjectArg);
ACPI_HW_DEPENDENT_RETURN_VOID (
void
AcpiDbDisplayGpes (
void))
void
AcpiDbDisplayHandlers (
void);
ACPI_HW_DEPENDENT_RETURN_VOID (
void
AcpiDbGenerateGpe (
char *GpeArg,
char *BlockArg))
ACPI_HW_DEPENDENT_RETURN_VOID (
void
AcpiDbGenerateSci (
void))
void
AcpiDbExecuteTest (
char *TypeArg);
/*
* dbconvert - miscellaneous conversion routines
*/
ACPI_STATUS
AcpiDbHexCharToValue (
int HexChar,
UINT8 *ReturnValue);
ACPI_STATUS
AcpiDbConvertToPackage (
char *String,
ACPI_OBJECT *Object);
ACPI_STATUS
AcpiDbConvertToObject (
ACPI_OBJECT_TYPE Type,
char *String,
ACPI_OBJECT *Object);
UINT8 *
AcpiDbEncodePldBuffer (
ACPI_PLD_INFO *PldInfo);
void
AcpiDbDumpPldBuffer (
ACPI_OBJECT *ObjDesc);
/*
* dbmethod - control method commands
*/
void
AcpiDbSetMethodBreakpoint (
char *Location,
ACPI_WALK_STATE *WalkState,
ACPI_PARSE_OBJECT *Op);
void
AcpiDbSetMethodCallBreakpoint (
ACPI_PARSE_OBJECT *Op);
void
AcpiDbSetMethodData (
char *TypeArg,
char *IndexArg,
char *ValueArg);
ACPI_STATUS
AcpiDbDisassembleMethod (
char *Name);
void
AcpiDbDisassembleAml (
char *Statements,
ACPI_PARSE_OBJECT *Op);
void
AcpiDbEvaluatePredefinedNames (
void);
/*
* dbnames - namespace commands
*/
void
AcpiDbSetScope (
char *Name);
void
AcpiDbDumpNamespace (
char *StartArg,
char *DepthArg);
void
AcpiDbDumpNamespacePaths (
void);
void
AcpiDbDumpNamespaceByOwner (
char *OwnerArg,
char *DepthArg);
ACPI_STATUS
AcpiDbFindNameInNamespace (
char *NameArg);
void
AcpiDbCheckPredefinedNames (
void);
ACPI_STATUS
AcpiDbDisplayObjects (
char *ObjTypeArg,
char *DisplayCountArg);
void
AcpiDbCheckIntegrity (
void);
void
AcpiDbFindReferences (
char *ObjectArg);
void
AcpiDbGetBusInfo (
void);
ACPI_STATUS
AcpiDbDisplayFields (
UINT32 AddressSpaceId);
/*
* dbdisply - debug display commands
*/
void
AcpiDbDisplayMethodInfo (
ACPI_PARSE_OBJECT *Op);
void
AcpiDbDecodeAndDisplayObject (
char *Target,
char *OutputType);
ACPI_DBR_DEPENDENT_RETURN_VOID (
void
AcpiDbDisplayResultObject (
ACPI_OPERAND_OBJECT *ObjDesc,
ACPI_WALK_STATE *WalkState))
ACPI_STATUS
AcpiDbDisplayAllMethods (
char *DisplayCountArg);
void
AcpiDbDisplayArguments (
void);
void
AcpiDbDisplayLocals (
void);
void
AcpiDbDisplayResults (
void);
void
AcpiDbDisplayCallingTree (
void);
void
AcpiDbDisplayObjectType (
char *ObjectArg);
ACPI_DBR_DEPENDENT_RETURN_VOID (
void
AcpiDbDisplayArgumentObject (
ACPI_OPERAND_OBJECT *ObjDesc,
ACPI_WALK_STATE *WalkState))
/*
* dbexec - debugger control method execution
*/
void
AcpiDbExecute (
char *Name,
char **Args,
ACPI_OBJECT_TYPE *Types,
UINT32 Flags);
void
AcpiDbCreateExecutionThread (
char *MethodNameArg,
char **Arguments,
ACPI_OBJECT_TYPE *Types);
void
AcpiDbCreateExecutionThreads (
char *NumThreadsArg,
char *NumLoopsArg,
char *MethodNameArg);
void
AcpiDbDeleteObjects (
UINT32 Count,
ACPI_OBJECT *Objects);
#ifdef ACPI_DBG_TRACK_ALLOCATIONS
UINT32
AcpiDbGetCacheInfo (
ACPI_MEMORY_LIST *Cache);
#endif
/*
* dbfileio - Debugger file I/O commands
*/
ACPI_OBJECT_TYPE
AcpiDbMatchArgument (
char *UserArgument,
ACPI_DB_ARGUMENT_INFO *Arguments);
void
AcpiDbCloseDebugFile (
void);
void
AcpiDbOpenDebugFile (
char *Name);
ACPI_STATUS
AcpiDbLoadAcpiTable (
char *Filename);
ACPI_STATUS
AcpiDbLoadTables (
ACPI_NEW_TABLE_DESC *ListHead);
/*
* dbhistry - debugger HISTORY command
*/
void
AcpiDbAddToHistory (
char *CommandLine);
void
AcpiDbDisplayHistory (
void);
char *
AcpiDbGetFromHistory (
char *CommandNumArg);
char *
AcpiDbGetHistoryByIndex (
UINT32 CommanddNum);
/*
* dbinput - user front-end to the AML debugger
*/
ACPI_STATUS
AcpiDbCommandDispatch (
char *InputBuffer,
ACPI_WALK_STATE *WalkState,
ACPI_PARSE_OBJECT *Op);
void ACPI_SYSTEM_XFACE
AcpiDbExecuteThread (
void *Context);
ACPI_STATUS
AcpiDbUserCommands (
void);
char *
AcpiDbGetNextToken (
char *String,
char **Next,
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
*/
void
AcpiDbGenerateStatistics (
ACPI_PARSE_OBJECT *Root,
BOOLEAN IsMethod);
ACPI_STATUS
AcpiDbDisplayStatistics (
char *TypeArg);
/*
* dbutils - AML debugger utilities
*/
void
AcpiDbSetOutputDestination (
UINT32 Where);
void
AcpiDbDumpExternalObject (
ACPI_OBJECT *ObjDesc,
UINT32 Level);
void
AcpiDbPrepNamestring (
char *Name);
ACPI_NAMESPACE_NODE *
AcpiDbLocalNsLookup (
char *Name);
void
AcpiDbUint32ToHexString (
UINT32 Value,
char *Buffer);
#endif /* __ACDEBUG_H__ */
File diff suppressed because it is too large Load Diff
-599
View File
@@ -1,599 +0,0 @@
/******************************************************************************
*
* Name: acdispat.h - dispatcher (parser to interpreter interface)
*
*****************************************************************************/
/******************************************************************************
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2019, 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.
*
*****************************************************************************
*
* Alternatively, you may choose to be licensed under the terms of the
* following license:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Alternatively, you may choose to be licensed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
*****************************************************************************/
#ifndef _ACDISPAT_H_
#define _ACDISPAT_H_
#define NAMEOF_LOCAL_NTE "__L0"
#define NAMEOF_ARG_NTE "__A0"
/*
* dsargs - execution of dynamic arguments for static objects
*/
ACPI_STATUS
AcpiDsGetBufferFieldArguments (
ACPI_OPERAND_OBJECT *ObjDesc);
ACPI_STATUS
AcpiDsGetBankFieldArguments (
ACPI_OPERAND_OBJECT *ObjDesc);
ACPI_STATUS
AcpiDsGetRegionArguments (
ACPI_OPERAND_OBJECT *RgnDesc);
ACPI_STATUS
AcpiDsGetBufferArguments (
ACPI_OPERAND_OBJECT *ObjDesc);
ACPI_STATUS
AcpiDsGetPackageArguments (
ACPI_OPERAND_OBJECT *ObjDesc);
/*
* dscontrol - support for execution control opcodes
*/
ACPI_STATUS
AcpiDsExecBeginControlOp (
ACPI_WALK_STATE *WalkState,
ACPI_PARSE_OBJECT *Op);
ACPI_STATUS
AcpiDsExecEndControlOp (
ACPI_WALK_STATE *WalkState,
ACPI_PARSE_OBJECT *Op);
/*
* dsopcode - support for late operand evaluation
*/
ACPI_STATUS
AcpiDsEvalBufferFieldOperands (
ACPI_WALK_STATE *WalkState,
ACPI_PARSE_OBJECT *Op);
ACPI_STATUS
AcpiDsEvalRegionOperands (
ACPI_WALK_STATE *WalkState,
ACPI_PARSE_OBJECT *Op);
ACPI_STATUS
AcpiDsEvalTableRegionOperands (
ACPI_WALK_STATE *WalkState,
ACPI_PARSE_OBJECT *Op);
ACPI_STATUS
AcpiDsEvalDataObjectOperands (
ACPI_WALK_STATE *WalkState,
ACPI_PARSE_OBJECT *Op,
ACPI_OPERAND_OBJECT *ObjDesc);
ACPI_STATUS
AcpiDsEvalBankFieldOperands (
ACPI_WALK_STATE *WalkState,
ACPI_PARSE_OBJECT *Op);
ACPI_STATUS
AcpiDsInitializeRegion (
ACPI_HANDLE ObjHandle);
/*
* dsexec - Parser/Interpreter interface, method execution callbacks
*/
ACPI_STATUS
AcpiDsGetPredicateValue (
ACPI_WALK_STATE *WalkState,
ACPI_OPERAND_OBJECT *ResultObj);
ACPI_STATUS
AcpiDsExecBeginOp (
ACPI_WALK_STATE *WalkState,
ACPI_PARSE_OBJECT **OutOp);
ACPI_STATUS
AcpiDsExecEndOp (
ACPI_WALK_STATE *State);
/*
* dsfield - Parser/Interpreter interface for AML fields
*/
ACPI_STATUS
AcpiDsCreateField (
ACPI_PARSE_OBJECT *Op,
ACPI_NAMESPACE_NODE *RegionNode,
ACPI_WALK_STATE *WalkState);
ACPI_STATUS
AcpiDsCreateBankField (
ACPI_PARSE_OBJECT *Op,
ACPI_NAMESPACE_NODE *RegionNode,
ACPI_WALK_STATE *WalkState);
ACPI_STATUS
AcpiDsCreateIndexField (
ACPI_PARSE_OBJECT *Op,
ACPI_NAMESPACE_NODE *RegionNode,
ACPI_WALK_STATE *WalkState);
ACPI_STATUS
AcpiDsCreateBufferField (
ACPI_PARSE_OBJECT *Op,
ACPI_WALK_STATE *WalkState);
ACPI_STATUS
AcpiDsInitFieldObjects (
ACPI_PARSE_OBJECT *Op,
ACPI_WALK_STATE *WalkState);
/*
* dsload - Parser/Interpreter interface
*/
ACPI_STATUS
AcpiDsInitCallbacks (
ACPI_WALK_STATE *WalkState,
UINT32 PassNumber);
/* dsload - pass 1 namespace load callbacks */
ACPI_STATUS
AcpiDsLoad1BeginOp (
ACPI_WALK_STATE *WalkState,
ACPI_PARSE_OBJECT **OutOp);
ACPI_STATUS
AcpiDsLoad1EndOp (
ACPI_WALK_STATE *WalkState);
/* dsload - pass 2 namespace load callbacks */
ACPI_STATUS
AcpiDsLoad2BeginOp (
ACPI_WALK_STATE *WalkState,
ACPI_PARSE_OBJECT **OutOp);
ACPI_STATUS
AcpiDsLoad2EndOp (
ACPI_WALK_STATE *WalkState);
/*
* dsmthdat - method data (locals/args)
*/
ACPI_STATUS
AcpiDsStoreObjectToLocal (
UINT8 Type,
UINT32 Index,
ACPI_OPERAND_OBJECT *SrcDesc,
ACPI_WALK_STATE *WalkState);
ACPI_STATUS
AcpiDsMethodDataGetEntry (
UINT16 Opcode,
UINT32 Index,
ACPI_WALK_STATE *WalkState,
ACPI_OPERAND_OBJECT ***Node);
void
AcpiDsMethodDataDeleteAll (
ACPI_WALK_STATE *WalkState);
BOOLEAN
AcpiDsIsMethodValue (
ACPI_OPERAND_OBJECT *ObjDesc);
ACPI_STATUS
AcpiDsMethodDataGetValue (
UINT8 Type,
UINT32 Index,
ACPI_WALK_STATE *WalkState,
ACPI_OPERAND_OBJECT **DestDesc);
ACPI_STATUS
AcpiDsMethodDataInitArgs (
ACPI_OPERAND_OBJECT **Params,
UINT32 MaxParamCount,
ACPI_WALK_STATE *WalkState);
ACPI_STATUS
AcpiDsMethodDataGetNode (
UINT8 Type,
UINT32 Index,
ACPI_WALK_STATE *WalkState,
ACPI_NAMESPACE_NODE **Node);
void
AcpiDsMethodDataInit (
ACPI_WALK_STATE *WalkState);
/*
* dsmethod - Parser/Interpreter interface - control method parsing
*/
ACPI_STATUS
AcpiDsAutoSerializeMethod (
ACPI_NAMESPACE_NODE *Node,
ACPI_OPERAND_OBJECT *ObjDesc);
ACPI_STATUS
AcpiDsCallControlMethod (
ACPI_THREAD_STATE *Thread,
ACPI_WALK_STATE *WalkState,
ACPI_PARSE_OBJECT *Op);
ACPI_STATUS
AcpiDsRestartControlMethod (
ACPI_WALK_STATE *WalkState,
ACPI_OPERAND_OBJECT *ReturnDesc);
void
AcpiDsTerminateControlMethod (
ACPI_OPERAND_OBJECT *MethodDesc,
ACPI_WALK_STATE *WalkState);
ACPI_STATUS
AcpiDsBeginMethodExecution (
ACPI_NAMESPACE_NODE *MethodNode,
ACPI_OPERAND_OBJECT *ObjDesc,
ACPI_WALK_STATE *WalkState);
ACPI_STATUS
AcpiDsMethodError (
ACPI_STATUS Status,
ACPI_WALK_STATE *WalkState);
/*
* dsinit
*/
ACPI_STATUS
AcpiDsInitializeObjects (
UINT32 TableIndex,
ACPI_NAMESPACE_NODE *StartNode);
/*
* dsobject - Parser/Interpreter interface - object initialization and conversion
*/
ACPI_STATUS
AcpiDsBuildInternalObject (
ACPI_WALK_STATE *WalkState,
ACPI_PARSE_OBJECT *Op,
ACPI_OPERAND_OBJECT **ObjDescPtr);
ACPI_STATUS
AcpiDsBuildInternalBufferObj (
ACPI_WALK_STATE *WalkState,
ACPI_PARSE_OBJECT *Op,
UINT32 BufferLength,
ACPI_OPERAND_OBJECT **ObjDescPtr);
ACPI_STATUS
AcpiDsBuildInternalPackageObj (
ACPI_WALK_STATE *WalkState,
ACPI_PARSE_OBJECT *op,
UINT32 PackageLength,
ACPI_OPERAND_OBJECT **ObjDesc);
ACPI_STATUS
AcpiDsInitObjectFromOp (
ACPI_WALK_STATE *WalkState,
ACPI_PARSE_OBJECT *Op,
UINT16 Opcode,
ACPI_OPERAND_OBJECT **ObjDesc);
ACPI_STATUS
AcpiDsCreateNode (
ACPI_WALK_STATE *WalkState,
ACPI_NAMESPACE_NODE *Node,
ACPI_PARSE_OBJECT *Op);
/*
* dspkginit - Package object initialization
*/
ACPI_STATUS
AcpiDsInitPackageElement (
UINT8 ObjectType,
ACPI_OPERAND_OBJECT *SourceObject,
ACPI_GENERIC_STATE *State,
void *Context);
/*
* dsutils - Parser/Interpreter interface utility routines
*/
void
AcpiDsClearImplicitReturn (
ACPI_WALK_STATE *WalkState);
BOOLEAN
AcpiDsDoImplicitReturn (
ACPI_OPERAND_OBJECT *ReturnDesc,
ACPI_WALK_STATE *WalkState,
BOOLEAN AddReference);
BOOLEAN
AcpiDsIsResultUsed (
ACPI_PARSE_OBJECT *Op,
ACPI_WALK_STATE *WalkState);
void
AcpiDsDeleteResultIfNotUsed (
ACPI_PARSE_OBJECT *Op,
ACPI_OPERAND_OBJECT *ResultObj,
ACPI_WALK_STATE *WalkState);
ACPI_STATUS
AcpiDsCreateOperand (
ACPI_WALK_STATE *WalkState,
ACPI_PARSE_OBJECT *Arg,
UINT32 ArgsRemaining);
ACPI_STATUS
AcpiDsCreateOperands (
ACPI_WALK_STATE *WalkState,
ACPI_PARSE_OBJECT *FirstArg);
ACPI_STATUS
AcpiDsResolveOperands (
ACPI_WALK_STATE *WalkState);
void
AcpiDsClearOperands (
ACPI_WALK_STATE *WalkState);
ACPI_STATUS
AcpiDsEvaluateNamePath (
ACPI_WALK_STATE *WalkState);
/*
* dswscope - Scope Stack manipulation
*/
ACPI_STATUS
AcpiDsScopeStackPush (
ACPI_NAMESPACE_NODE *Node,
ACPI_OBJECT_TYPE Type,
ACPI_WALK_STATE *WalkState);
ACPI_STATUS
AcpiDsScopeStackPop (
ACPI_WALK_STATE *WalkState);
void
AcpiDsScopeStackClear (
ACPI_WALK_STATE *WalkState);
/*
* dswstate - parser WALK_STATE management routines
*/
ACPI_STATUS
AcpiDsObjStackPush (
void *Object,
ACPI_WALK_STATE *WalkState);
ACPI_STATUS
AcpiDsObjStackPop (
UINT32 PopCount,
ACPI_WALK_STATE *WalkState);
ACPI_WALK_STATE *
AcpiDsCreateWalkState (
ACPI_OWNER_ID OwnerId,
ACPI_PARSE_OBJECT *Origin,
ACPI_OPERAND_OBJECT *MthDesc,
ACPI_THREAD_STATE *Thread);
ACPI_STATUS
AcpiDsInitAmlWalk (
ACPI_WALK_STATE *WalkState,
ACPI_PARSE_OBJECT *Op,
ACPI_NAMESPACE_NODE *MethodNode,
UINT8 *AmlStart,
UINT32 AmlLength,
ACPI_EVALUATE_INFO *Info,
UINT8 PassNumber);
void
AcpiDsObjStackPopAndDelete (
UINT32 PopCount,
ACPI_WALK_STATE *WalkState);
void
AcpiDsDeleteWalkState (
ACPI_WALK_STATE *WalkState);
ACPI_WALK_STATE *
AcpiDsPopWalkState (
ACPI_THREAD_STATE *Thread);
void
AcpiDsPushWalkState (
ACPI_WALK_STATE *WalkState,
ACPI_THREAD_STATE *Thread);
ACPI_STATUS
AcpiDsResultStackClear (
ACPI_WALK_STATE *WalkState);
ACPI_WALK_STATE *
AcpiDsGetCurrentWalkState (
ACPI_THREAD_STATE *Thread);
ACPI_STATUS
AcpiDsResultPop (
ACPI_OPERAND_OBJECT **Object,
ACPI_WALK_STATE *WalkState);
ACPI_STATUS
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_ */
-500
View File
@@ -1,500 +0,0 @@
/******************************************************************************
*
* Name: acevents.h - Event subcomponent prototypes and defines
*
*****************************************************************************/
/******************************************************************************
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2019, 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.
*
*****************************************************************************
*
* Alternatively, you may choose to be licensed under the terms of the
* following license:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Alternatively, you may choose to be licensed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
*****************************************************************************/
#ifndef __ACEVENTS_H__
#define __ACEVENTS_H__
/*
* Conditions to trigger post enabling GPE polling:
* It is not sufficient to trigger edge-triggered GPE with specific GPE
* chips, software need to poll once after enabling.
*/
#ifdef ACPI_USE_GPE_POLLING
#define ACPI_GPE_IS_POLLING_NEEDED(__gpe__) \
((__gpe__)->RuntimeCount == 1 && \
(__gpe__)->Flags & ACPI_GPE_INITIALIZED && \
((__gpe__)->Flags & ACPI_GPE_XRUPT_TYPE_MASK) == ACPI_GPE_EDGE_TRIGGERED)
#else
#define ACPI_GPE_IS_POLLING_NEEDED(__gpe__) FALSE
#endif
/*
* evevent
*/
ACPI_STATUS
AcpiEvInitializeEvents (
void);
ACPI_STATUS
AcpiEvInstallXruptHandlers (
void);
UINT32
AcpiEvFixedEventDetect (
void);
/*
* evmisc
*/
BOOLEAN
AcpiEvIsNotifyObject (
ACPI_NAMESPACE_NODE *Node);
UINT32
AcpiEvGetGpeNumberIndex (
UINT32 GpeNumber);
ACPI_STATUS
AcpiEvQueueNotifyRequest (
ACPI_NAMESPACE_NODE *Node,
UINT32 NotifyValue);
/*
* evglock - Global Lock support
*/
ACPI_STATUS
AcpiEvInitGlobalLockHandler (
void);
ACPI_HW_DEPENDENT_RETURN_OK (
ACPI_STATUS
AcpiEvAcquireGlobalLock(
UINT16 Timeout))
ACPI_HW_DEPENDENT_RETURN_OK (
ACPI_STATUS
AcpiEvReleaseGlobalLock(
void))
ACPI_STATUS
AcpiEvRemoveGlobalLockHandler (
void);
/*
* evgpe - Low-level GPE support
*/
UINT32
AcpiEvGpeDetect (
ACPI_GPE_XRUPT_INFO *GpeXruptList);
ACPI_STATUS
AcpiEvUpdateGpeEnableMask (
ACPI_GPE_EVENT_INFO *GpeEventInfo);
ACPI_STATUS
AcpiEvEnableGpe (
ACPI_GPE_EVENT_INFO *GpeEventInfo);
ACPI_STATUS
AcpiEvMaskGpe (
ACPI_GPE_EVENT_INFO *GpeEventInfo,
BOOLEAN IsMasked);
ACPI_STATUS
AcpiEvAddGpeReference (
ACPI_GPE_EVENT_INFO *GpeEventInfo,
BOOLEAN ClearOnEnable);
ACPI_STATUS
AcpiEvRemoveGpeReference (
ACPI_GPE_EVENT_INFO *GpeEventInfo);
ACPI_GPE_EVENT_INFO *
AcpiEvGetGpeEventInfo (
ACPI_HANDLE GpeDevice,
UINT32 GpeNumber);
ACPI_GPE_EVENT_INFO *
AcpiEvLowGetGpeInfo (
UINT32 GpeNumber,
ACPI_GPE_BLOCK_INFO *GpeBlock);
ACPI_STATUS
AcpiEvFinishGpe (
ACPI_GPE_EVENT_INFO *GpeEventInfo);
UINT32
AcpiEvDetectGpe (
ACPI_NAMESPACE_NODE *GpeDevice,
ACPI_GPE_EVENT_INFO *GpeEventInfo,
UINT32 GpeNumber);
/*
* evgpeblk - Upper-level GPE block support
*/
ACPI_STATUS
AcpiEvCreateGpeBlock (
ACPI_NAMESPACE_NODE *GpeDevice,
UINT64 Address,
UINT8 SpaceId,
UINT32 RegisterCount,
UINT16 GpeBlockBaseNumber,
UINT32 InterruptNumber,
ACPI_GPE_BLOCK_INFO **ReturnGpeBlock);
ACPI_STATUS
AcpiEvInitializeGpeBlock (
ACPI_GPE_XRUPT_INFO *GpeXruptInfo,
ACPI_GPE_BLOCK_INFO *GpeBlock,
void *Context);
ACPI_HW_DEPENDENT_RETURN_OK (
ACPI_STATUS
AcpiEvDeleteGpeBlock (
ACPI_GPE_BLOCK_INFO *GpeBlock))
UINT32
AcpiEvGpeDispatch (
ACPI_NAMESPACE_NODE *GpeDevice,
ACPI_GPE_EVENT_INFO *GpeEventInfo,
UINT32 GpeNumber);
/*
* evgpeinit - GPE initialization and update
*/
ACPI_STATUS
AcpiEvGpeInitialize (
void);
ACPI_HW_DEPENDENT_RETURN_VOID (
void
AcpiEvUpdateGpes (
ACPI_OWNER_ID TableOwnerId))
ACPI_STATUS
AcpiEvMatchGpeMethod (
ACPI_HANDLE ObjHandle,
UINT32 Level,
void *Context,
void **ReturnValue);
/*
* evgpeutil - GPE utilities
*/
ACPI_STATUS
AcpiEvWalkGpeList (
ACPI_GPE_CALLBACK GpeWalkCallback,
void *Context);
ACPI_STATUS
AcpiEvGetGpeDevice (
ACPI_GPE_XRUPT_INFO *GpeXruptInfo,
ACPI_GPE_BLOCK_INFO *GpeBlock,
void *Context);
ACPI_STATUS
AcpiEvGetGpeXruptBlock (
UINT32 InterruptNumber,
ACPI_GPE_XRUPT_INFO **GpeXruptBlock);
ACPI_STATUS
AcpiEvDeleteGpeXrupt (
ACPI_GPE_XRUPT_INFO *GpeXrupt);
ACPI_STATUS
AcpiEvDeleteGpeHandlers (
ACPI_GPE_XRUPT_INFO *GpeXruptInfo,
ACPI_GPE_BLOCK_INFO *GpeBlock,
void *Context);
/*
* evhandler - Address space handling
*/
ACPI_OPERAND_OBJECT *
AcpiEvFindRegionHandler (
ACPI_ADR_SPACE_TYPE SpaceId,
ACPI_OPERAND_OBJECT *HandlerObj);
BOOLEAN
AcpiEvHasDefaultHandler (
ACPI_NAMESPACE_NODE *Node,
ACPI_ADR_SPACE_TYPE SpaceId);
ACPI_STATUS
AcpiEvInstallRegionHandlers (
void);
ACPI_STATUS
AcpiEvInstallSpaceHandler (
ACPI_NAMESPACE_NODE *Node,
ACPI_ADR_SPACE_TYPE SpaceId,
ACPI_ADR_SPACE_HANDLER Handler,
ACPI_ADR_SPACE_SETUP Setup,
void *Context);
/*
* evregion - Operation region support
*/
ACPI_STATUS
AcpiEvInitializeOpRegions (
void);
ACPI_STATUS
AcpiEvAddressSpaceDispatch (
ACPI_OPERAND_OBJECT *RegionObj,
ACPI_OPERAND_OBJECT *FieldObj,
UINT32 Function,
UINT32 RegionOffset,
UINT32 BitWidth,
UINT64 *Value);
ACPI_STATUS
AcpiEvAttachRegion (
ACPI_OPERAND_OBJECT *HandlerObj,
ACPI_OPERAND_OBJECT *RegionObj,
BOOLEAN AcpiNsIsLocked);
void
AcpiEvDetachRegion (
ACPI_OPERAND_OBJECT *RegionObj,
BOOLEAN AcpiNsIsLocked);
void
AcpiEvExecuteRegMethods (
ACPI_NAMESPACE_NODE *Node,
ACPI_ADR_SPACE_TYPE SpaceId,
UINT32 Function);
ACPI_STATUS
AcpiEvExecuteRegMethod (
ACPI_OPERAND_OBJECT *RegionObj,
UINT32 Function);
/*
* evregini - Region initialization and setup
*/
ACPI_STATUS
AcpiEvSystemMemoryRegionSetup (
ACPI_HANDLE Handle,
UINT32 Function,
void *HandlerContext,
void **RegionContext);
ACPI_STATUS
AcpiEvIoSpaceRegionSetup (
ACPI_HANDLE Handle,
UINT32 Function,
void *HandlerContext,
void **RegionContext);
ACPI_STATUS
AcpiEvPciConfigRegionSetup (
ACPI_HANDLE Handle,
UINT32 Function,
void *HandlerContext,
void **RegionContext);
ACPI_STATUS
AcpiEvCmosRegionSetup (
ACPI_HANDLE Handle,
UINT32 Function,
void *HandlerContext,
void **RegionContext);
ACPI_STATUS
AcpiEvPciBarRegionSetup (
ACPI_HANDLE Handle,
UINT32 Function,
void *HandlerContext,
void **RegionContext);
ACPI_STATUS
AcpiEvDefaultRegionSetup (
ACPI_HANDLE Handle,
UINT32 Function,
void *HandlerContext,
void **RegionContext);
ACPI_STATUS
AcpiEvInitializeRegion (
ACPI_OPERAND_OBJECT *RegionObj);
BOOLEAN
AcpiEvIsPciRootBridge (
ACPI_NAMESPACE_NODE *Node);
/*
* evsci - SCI (System Control Interrupt) handling/dispatch
*/
UINT32 ACPI_SYSTEM_XFACE
AcpiEvGpeXruptHandler (
void *Context);
UINT32
AcpiEvSciDispatch (
void);
UINT32
AcpiEvInstallSciHandler (
void);
ACPI_STATUS
AcpiEvRemoveAllSciHandlers (
void);
ACPI_HW_DEPENDENT_RETURN_VOID (
void
AcpiEvTerminate (
void))
#endif /* __ACEVENTS_H__ */
-481
View File
@@ -1,481 +0,0 @@
/******************************************************************************
*
* Name: acexcep.h - Exception codes returned by the ACPI subsystem
*
*****************************************************************************/
/******************************************************************************
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2019, 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.
*
*****************************************************************************
*
* Alternatively, you may choose to be licensed under the terms of the
* following license:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Alternatively, you may choose to be licensed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
*****************************************************************************/
#ifndef __ACEXCEP_H__
#define __ACEXCEP_H__
/* This module contains all possible exception codes for ACPI_STATUS */
/*
* Exception code classes
*/
#define AE_CODE_ENVIRONMENTAL 0x0000 /* General ACPICA environment */
#define AE_CODE_PROGRAMMER 0x1000 /* External ACPICA interface caller */
#define AE_CODE_ACPI_TABLES 0x2000 /* ACPI tables */
#define AE_CODE_AML 0x3000 /* From executing AML code */
#define AE_CODE_CONTROL 0x4000 /* Internal control codes */
#define AE_CODE_MAX 0x4000
#define AE_CODE_MASK 0xF000
/*
* Macros to insert the exception code classes
*/
#define EXCEP_ENV(code) ((ACPI_STATUS) (code | AE_CODE_ENVIRONMENTAL))
#define EXCEP_PGM(code) ((ACPI_STATUS) (code | AE_CODE_PROGRAMMER))
#define EXCEP_TBL(code) ((ACPI_STATUS) (code | AE_CODE_ACPI_TABLES))
#define EXCEP_AML(code) ((ACPI_STATUS) (code | AE_CODE_AML))
#define EXCEP_CTL(code) ((ACPI_STATUS) (code | AE_CODE_CONTROL))
/*
* Exception info table. The "Description" field is used only by the
* ACPICA help application (acpihelp).
*/
typedef struct acpi_exception_info
{
char *Name;
#ifdef ACPI_HELP_APP
char *Description;
#endif
} ACPI_EXCEPTION_INFO;
#ifdef ACPI_HELP_APP
#define EXCEP_TXT(Name,Description) {Name, Description}
#else
#define EXCEP_TXT(Name,Description) {Name}
#endif
/*
* Success is always zero, failure is non-zero
*/
#define ACPI_SUCCESS(a) (!(a))
#define ACPI_FAILURE(a) (a)
#define AE_OK (ACPI_STATUS) 0x0000
#define ACPI_ENV_EXCEPTION(Status) (Status & AE_CODE_ENVIRONMENTAL)
#define ACPI_AML_EXCEPTION(Status) (Status & AE_CODE_AML)
#define ACPI_PROG_EXCEPTION(Status) (Status & AE_CODE_PROGRAMMER)
#define ACPI_TABLE_EXCEPTION(Status) (Status & AE_CODE_ACPI_TABLES)
#define ACPI_CNTL_EXCEPTION(Status) (Status & AE_CODE_CONTROL)
/*
* Environmental exceptions
*/
#define AE_ERROR EXCEP_ENV (0x0001)
#define AE_NO_ACPI_TABLES EXCEP_ENV (0x0002)
#define AE_NO_NAMESPACE EXCEP_ENV (0x0003)
#define AE_NO_MEMORY EXCEP_ENV (0x0004)
#define AE_NOT_FOUND EXCEP_ENV (0x0005)
#define AE_NOT_EXIST EXCEP_ENV (0x0006)
#define AE_ALREADY_EXISTS EXCEP_ENV (0x0007)
#define AE_TYPE EXCEP_ENV (0x0008)
#define AE_NULL_OBJECT EXCEP_ENV (0x0009)
#define AE_NULL_ENTRY EXCEP_ENV (0x000A)
#define AE_BUFFER_OVERFLOW EXCEP_ENV (0x000B)
#define AE_STACK_OVERFLOW EXCEP_ENV (0x000C)
#define AE_STACK_UNDERFLOW EXCEP_ENV (0x000D)
#define AE_NOT_IMPLEMENTED EXCEP_ENV (0x000E)
#define AE_SUPPORT EXCEP_ENV (0x000F)
#define AE_LIMIT EXCEP_ENV (0x0010)
#define AE_TIME EXCEP_ENV (0x0011)
#define AE_ACQUIRE_DEADLOCK EXCEP_ENV (0x0012)
#define AE_RELEASE_DEADLOCK EXCEP_ENV (0x0013)
#define AE_NOT_ACQUIRED EXCEP_ENV (0x0014)
#define AE_ALREADY_ACQUIRED EXCEP_ENV (0x0015)
#define AE_NO_HARDWARE_RESPONSE EXCEP_ENV (0x0016)
#define AE_NO_GLOBAL_LOCK EXCEP_ENV (0x0017)
#define AE_ABORT_METHOD EXCEP_ENV (0x0018)
#define AE_SAME_HANDLER EXCEP_ENV (0x0019)
#define AE_NO_HANDLER EXCEP_ENV (0x001A)
#define AE_OWNER_ID_LIMIT EXCEP_ENV (0x001B)
#define AE_NOT_CONFIGURED EXCEP_ENV (0x001C)
#define AE_ACCESS EXCEP_ENV (0x001D)
#define AE_IO_ERROR EXCEP_ENV (0x001E)
#define AE_NUMERIC_OVERFLOW EXCEP_ENV (0x001F)
#define AE_HEX_OVERFLOW EXCEP_ENV (0x0020)
#define AE_DECIMAL_OVERFLOW EXCEP_ENV (0x0021)
#define AE_OCTAL_OVERFLOW EXCEP_ENV (0x0022)
#define AE_END_OF_TABLE EXCEP_ENV (0x0023)
#define AE_CODE_ENV_MAX 0x0023
/*
* Programmer exceptions
*/
#define AE_BAD_PARAMETER EXCEP_PGM (0x0001)
#define AE_BAD_CHARACTER EXCEP_PGM (0x0002)
#define AE_BAD_PATHNAME EXCEP_PGM (0x0003)
#define AE_BAD_DATA EXCEP_PGM (0x0004)
#define AE_BAD_HEX_CONSTANT EXCEP_PGM (0x0005)
#define AE_BAD_OCTAL_CONSTANT EXCEP_PGM (0x0006)
#define AE_BAD_DECIMAL_CONSTANT EXCEP_PGM (0x0007)
#define AE_MISSING_ARGUMENTS EXCEP_PGM (0x0008)
#define AE_BAD_ADDRESS EXCEP_PGM (0x0009)
#define AE_CODE_PGM_MAX 0x0009
/*
* Acpi table exceptions
*/
#define AE_BAD_SIGNATURE EXCEP_TBL (0x0001)
#define AE_BAD_HEADER EXCEP_TBL (0x0002)
#define AE_BAD_CHECKSUM EXCEP_TBL (0x0003)
#define AE_BAD_VALUE EXCEP_TBL (0x0004)
#define AE_INVALID_TABLE_LENGTH EXCEP_TBL (0x0005)
#define AE_CODE_TBL_MAX 0x0005
/*
* AML exceptions. These are caused by problems with
* the actual AML byte stream
*/
#define AE_AML_BAD_OPCODE EXCEP_AML (0x0001)
#define AE_AML_NO_OPERAND EXCEP_AML (0x0002)
#define AE_AML_OPERAND_TYPE EXCEP_AML (0x0003)
#define AE_AML_OPERAND_VALUE EXCEP_AML (0x0004)
#define AE_AML_UNINITIALIZED_LOCAL EXCEP_AML (0x0005)
#define AE_AML_UNINITIALIZED_ARG EXCEP_AML (0x0006)
#define AE_AML_UNINITIALIZED_ELEMENT EXCEP_AML (0x0007)
#define AE_AML_NUMERIC_OVERFLOW EXCEP_AML (0x0008)
#define AE_AML_REGION_LIMIT EXCEP_AML (0x0009)
#define AE_AML_BUFFER_LIMIT EXCEP_AML (0x000A)
#define AE_AML_PACKAGE_LIMIT EXCEP_AML (0x000B)
#define AE_AML_DIVIDE_BY_ZERO EXCEP_AML (0x000C)
#define AE_AML_BAD_NAME EXCEP_AML (0x000D)
#define AE_AML_NAME_NOT_FOUND EXCEP_AML (0x000E)
#define AE_AML_INTERNAL EXCEP_AML (0x000F)
#define AE_AML_INVALID_SPACE_ID EXCEP_AML (0x0010)
#define AE_AML_STRING_LIMIT EXCEP_AML (0x0011)
#define AE_AML_NO_RETURN_VALUE EXCEP_AML (0x0012)
#define AE_AML_METHOD_LIMIT EXCEP_AML (0x0013)
#define AE_AML_NOT_OWNER EXCEP_AML (0x0014)
#define AE_AML_MUTEX_ORDER EXCEP_AML (0x0015)
#define AE_AML_MUTEX_NOT_ACQUIRED EXCEP_AML (0x0016)
#define AE_AML_INVALID_RESOURCE_TYPE EXCEP_AML (0x0017)
#define AE_AML_INVALID_INDEX EXCEP_AML (0x0018)
#define AE_AML_REGISTER_LIMIT EXCEP_AML (0x0019)
#define AE_AML_NO_WHILE EXCEP_AML (0x001A)
#define AE_AML_ALIGNMENT EXCEP_AML (0x001B)
#define AE_AML_NO_RESOURCE_END_TAG EXCEP_AML (0x001C)
#define AE_AML_BAD_RESOURCE_VALUE EXCEP_AML (0x001D)
#define AE_AML_CIRCULAR_REFERENCE EXCEP_AML (0x001E)
#define AE_AML_BAD_RESOURCE_LENGTH EXCEP_AML (0x001F)
#define AE_AML_ILLEGAL_ADDRESS EXCEP_AML (0x0020)
#define AE_AML_LOOP_TIMEOUT EXCEP_AML (0x0021)
#define AE_AML_UNINITIALIZED_NODE EXCEP_AML (0x0022)
#define AE_AML_TARGET_TYPE EXCEP_AML (0x0023)
#define AE_AML_PROTOCOL EXCEP_AML (0x0024)
#define AE_AML_BUFFER_LENGTH EXCEP_AML (0x0025)
#define AE_CODE_AML_MAX 0x0025
/*
* Internal exceptions used for control
*/
#define AE_CTRL_RETURN_VALUE EXCEP_CTL (0x0001)
#define AE_CTRL_PENDING EXCEP_CTL (0x0002)
#define AE_CTRL_TERMINATE EXCEP_CTL (0x0003)
#define AE_CTRL_TRUE EXCEP_CTL (0x0004)
#define AE_CTRL_FALSE EXCEP_CTL (0x0005)
#define AE_CTRL_DEPTH EXCEP_CTL (0x0006)
#define AE_CTRL_END EXCEP_CTL (0x0007)
#define AE_CTRL_TRANSFER EXCEP_CTL (0x0008)
#define AE_CTRL_BREAK EXCEP_CTL (0x0009)
#define AE_CTRL_CONTINUE EXCEP_CTL (0x000A)
#define AE_CTRL_PARSE_CONTINUE EXCEP_CTL (0x000B)
#define AE_CTRL_PARSE_PENDING EXCEP_CTL (0x000C)
#define AE_CODE_CTRL_MAX 0x000C
/* Exception strings for AcpiFormatException */
#ifdef ACPI_DEFINE_EXCEPTION_TABLE
/*
* String versions of the exception codes above
* These strings must match the corresponding defines exactly
*/
static const ACPI_EXCEPTION_INFO AcpiGbl_ExceptionNames_Env[] =
{
EXCEP_TXT ("AE_OK", "No error"),
EXCEP_TXT ("AE_ERROR", "Unspecified error"),
EXCEP_TXT ("AE_NO_ACPI_TABLES", "ACPI tables could not be found"),
EXCEP_TXT ("AE_NO_NAMESPACE", "A namespace has not been loaded"),
EXCEP_TXT ("AE_NO_MEMORY", "Insufficient dynamic memory"),
EXCEP_TXT ("AE_NOT_FOUND", "A requested entity is not found"),
EXCEP_TXT ("AE_NOT_EXIST", "A required entity does not exist"),
EXCEP_TXT ("AE_ALREADY_EXISTS", "An entity already exists"),
EXCEP_TXT ("AE_TYPE", "The object type is incorrect"),
EXCEP_TXT ("AE_NULL_OBJECT", "A required object was missing"),
EXCEP_TXT ("AE_NULL_ENTRY", "The requested object does not exist"),
EXCEP_TXT ("AE_BUFFER_OVERFLOW", "The buffer provided is too small"),
EXCEP_TXT ("AE_STACK_OVERFLOW", "An internal stack overflowed"),
EXCEP_TXT ("AE_STACK_UNDERFLOW", "An internal stack underflowed"),
EXCEP_TXT ("AE_NOT_IMPLEMENTED", "The feature is not implemented"),
EXCEP_TXT ("AE_SUPPORT", "The feature is not supported"),
EXCEP_TXT ("AE_LIMIT", "A predefined limit was exceeded"),
EXCEP_TXT ("AE_TIME", "A time limit or timeout expired"),
EXCEP_TXT ("AE_ACQUIRE_DEADLOCK", "Internal error, attempt was made to acquire a mutex in improper order"),
EXCEP_TXT ("AE_RELEASE_DEADLOCK", "Internal error, attempt was made to release a mutex in improper order"),
EXCEP_TXT ("AE_NOT_ACQUIRED", "An attempt to release a mutex or Global Lock without a previous acquire"),
EXCEP_TXT ("AE_ALREADY_ACQUIRED", "Internal error, attempt was made to acquire a mutex twice"),
EXCEP_TXT ("AE_NO_HARDWARE_RESPONSE", "Hardware did not respond after an I/O operation"),
EXCEP_TXT ("AE_NO_GLOBAL_LOCK", "There is no FACS Global Lock"),
EXCEP_TXT ("AE_ABORT_METHOD", "A control method was aborted"),
EXCEP_TXT ("AE_SAME_HANDLER", "Attempt was made to install the same handler that is already installed"),
EXCEP_TXT ("AE_NO_HANDLER", "A handler for the operation is not installed"),
EXCEP_TXT ("AE_OWNER_ID_LIMIT", "There are no more Owner IDs available for ACPI tables or control methods"),
EXCEP_TXT ("AE_NOT_CONFIGURED", "The interface is not part of the current subsystem configuration"),
EXCEP_TXT ("AE_ACCESS", "Permission denied for the requested operation"),
EXCEP_TXT ("AE_IO_ERROR", "An I/O error occurred"),
EXCEP_TXT ("AE_NUMERIC_OVERFLOW", "Overflow during string-to-integer conversion"),
EXCEP_TXT ("AE_HEX_OVERFLOW", "Overflow during ASCII hex-to-binary conversion"),
EXCEP_TXT ("AE_DECIMAL_OVERFLOW", "Overflow during ASCII decimal-to-binary conversion"),
EXCEP_TXT ("AE_OCTAL_OVERFLOW", "Overflow during ASCII octal-to-binary conversion"),
EXCEP_TXT ("AE_END_OF_TABLE", "Reached the end of table")
};
static const ACPI_EXCEPTION_INFO AcpiGbl_ExceptionNames_Pgm[] =
{
EXCEP_TXT (NULL, NULL),
EXCEP_TXT ("AE_BAD_PARAMETER", "A parameter is out of range or invalid"),
EXCEP_TXT ("AE_BAD_CHARACTER", "An invalid character was found in a name"),
EXCEP_TXT ("AE_BAD_PATHNAME", "An invalid character was found in a pathname"),
EXCEP_TXT ("AE_BAD_DATA", "A package or buffer contained incorrect data"),
EXCEP_TXT ("AE_BAD_HEX_CONSTANT", "Invalid character in a Hex constant"),
EXCEP_TXT ("AE_BAD_OCTAL_CONSTANT", "Invalid character in an Octal constant"),
EXCEP_TXT ("AE_BAD_DECIMAL_CONSTANT", "Invalid character in a Decimal constant"),
EXCEP_TXT ("AE_MISSING_ARGUMENTS", "Too few arguments were passed to a control method"),
EXCEP_TXT ("AE_BAD_ADDRESS", "An illegal null I/O address")
};
static const ACPI_EXCEPTION_INFO AcpiGbl_ExceptionNames_Tbl[] =
{
EXCEP_TXT (NULL, NULL),
EXCEP_TXT ("AE_BAD_SIGNATURE", "An ACPI table has an invalid signature"),
EXCEP_TXT ("AE_BAD_HEADER", "Invalid field in an ACPI table header"),
EXCEP_TXT ("AE_BAD_CHECKSUM", "An ACPI table checksum is not correct"),
EXCEP_TXT ("AE_BAD_VALUE", "An invalid value was found in a table"),
EXCEP_TXT ("AE_INVALID_TABLE_LENGTH", "The FADT or FACS has improper length")
};
static const ACPI_EXCEPTION_INFO AcpiGbl_ExceptionNames_Aml[] =
{
EXCEP_TXT (NULL, NULL),
EXCEP_TXT ("AE_AML_BAD_OPCODE", "Invalid AML opcode encountered"),
EXCEP_TXT ("AE_AML_NO_OPERAND", "A required operand is missing"),
EXCEP_TXT ("AE_AML_OPERAND_TYPE", "An operand of an incorrect type was encountered"),
EXCEP_TXT ("AE_AML_OPERAND_VALUE", "The operand had an inappropriate or invalid value"),
EXCEP_TXT ("AE_AML_UNINITIALIZED_LOCAL", "Method tried to use an uninitialized local variable"),
EXCEP_TXT ("AE_AML_UNINITIALIZED_ARG", "Method tried to use an uninitialized argument"),
EXCEP_TXT ("AE_AML_UNINITIALIZED_ELEMENT", "Method tried to use an empty package element"),
EXCEP_TXT ("AE_AML_NUMERIC_OVERFLOW", "Overflow during BCD conversion or other"),
EXCEP_TXT ("AE_AML_REGION_LIMIT", "Tried to access beyond the end of an Operation Region"),
EXCEP_TXT ("AE_AML_BUFFER_LIMIT", "Tried to access beyond the end of a buffer"),
EXCEP_TXT ("AE_AML_PACKAGE_LIMIT", "Tried to access beyond the end of a package"),
EXCEP_TXT ("AE_AML_DIVIDE_BY_ZERO", "During execution of AML Divide operator"),
EXCEP_TXT ("AE_AML_BAD_NAME", "An ACPI name contains invalid character(s)"),
EXCEP_TXT ("AE_AML_NAME_NOT_FOUND", "Could not resolve a named reference"),
EXCEP_TXT ("AE_AML_INTERNAL", "An internal error within the interpreter"),
EXCEP_TXT ("AE_AML_INVALID_SPACE_ID", "An Operation Region SpaceID is invalid"),
EXCEP_TXT ("AE_AML_STRING_LIMIT", "String is longer than 200 characters"),
EXCEP_TXT ("AE_AML_NO_RETURN_VALUE", "A method did not return a required value"),
EXCEP_TXT ("AE_AML_METHOD_LIMIT", "A control method reached the maximum reentrancy limit of 255"),
EXCEP_TXT ("AE_AML_NOT_OWNER", "A thread tried to release a mutex that it does not own"),
EXCEP_TXT ("AE_AML_MUTEX_ORDER", "Mutex SyncLevel release mismatch"),
EXCEP_TXT ("AE_AML_MUTEX_NOT_ACQUIRED", "Attempt to release a mutex that was not previously acquired"),
EXCEP_TXT ("AE_AML_INVALID_RESOURCE_TYPE", "Invalid resource type in resource list"),
EXCEP_TXT ("AE_AML_INVALID_INDEX", "Invalid Argx or Localx (x too large)"),
EXCEP_TXT ("AE_AML_REGISTER_LIMIT", "Bank value or Index value beyond range of register"),
EXCEP_TXT ("AE_AML_NO_WHILE", "Break or Continue without a While"),
EXCEP_TXT ("AE_AML_ALIGNMENT", "Non-aligned memory transfer on platform that does not support this"),
EXCEP_TXT ("AE_AML_NO_RESOURCE_END_TAG", "No End Tag in a resource list"),
EXCEP_TXT ("AE_AML_BAD_RESOURCE_VALUE", "Invalid value of a resource element"),
EXCEP_TXT ("AE_AML_CIRCULAR_REFERENCE", "Two references refer to each other"),
EXCEP_TXT ("AE_AML_BAD_RESOURCE_LENGTH", "The length of a Resource Descriptor in the AML is incorrect"),
EXCEP_TXT ("AE_AML_ILLEGAL_ADDRESS", "A memory, I/O, or PCI configuration address is invalid"),
EXCEP_TXT ("AE_AML_LOOP_TIMEOUT", "An AML While loop exceeded the maximum execution time"),
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"),
EXCEP_TXT ("AE_AML_PROTOCOL", "Violation of a fixed ACPI protocol"),
EXCEP_TXT ("AE_AML_BUFFER_LENGTH", "The length of the buffer is invalid/incorrect")
};
static const ACPI_EXCEPTION_INFO AcpiGbl_ExceptionNames_Ctrl[] =
{
EXCEP_TXT (NULL, NULL),
EXCEP_TXT ("AE_CTRL_RETURN_VALUE", "A Method returned a value"),
EXCEP_TXT ("AE_CTRL_PENDING", "Method is calling another method"),
EXCEP_TXT ("AE_CTRL_TERMINATE", "Terminate the executing method"),
EXCEP_TXT ("AE_CTRL_TRUE", "An If or While predicate result"),
EXCEP_TXT ("AE_CTRL_FALSE", "An If or While predicate result"),
EXCEP_TXT ("AE_CTRL_DEPTH", "Maximum search depth has been reached"),
EXCEP_TXT ("AE_CTRL_END", "An If or While predicate is false"),
EXCEP_TXT ("AE_CTRL_TRANSFER", "Transfer control to called method"),
EXCEP_TXT ("AE_CTRL_BREAK", "A Break has been executed"),
EXCEP_TXT ("AE_CTRL_CONTINUE", "A Continue has been executed"),
EXCEP_TXT ("AE_CTRL_PARSE_CONTINUE", "Used to skip over bad opcodes"),
EXCEP_TXT ("AE_CTRL_PARSE_PENDING", "Used to implement AML While loops")
};
#endif /* EXCEPTION_TABLE */
#endif /* __ACEXCEP_H__ */
-529
View File
@@ -1,529 +0,0 @@
/******************************************************************************
*
* Name: acglobal.h - Declarations for global variables
*
*****************************************************************************/
/******************************************************************************
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2019, 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.
*
*****************************************************************************
*
* Alternatively, you may choose to be licensed under the terms of the
* following license:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Alternatively, you may choose to be licensed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
*****************************************************************************/
#ifndef __ACGLOBAL_H__
#define __ACGLOBAL_H__
/*****************************************************************************
*
* Globals related to the incoming ACPI tables
*
****************************************************************************/
/* Master list of all ACPI tables that were found in the RSDT/XSDT */
ACPI_GLOBAL (ACPI_TABLE_LIST, AcpiGbl_RootTableList);
/* DSDT information. Used to check for DSDT corruption */
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);
ACPI_INIT_GLOBAL (UINT32, AcpiGbl_FadtIndex, ACPI_INVALID_TABLE_INDEX);
#if (!ACPI_REDUCED_HARDWARE)
ACPI_GLOBAL (ACPI_TABLE_FACS *, AcpiGbl_FACS);
#endif /* !ACPI_REDUCED_HARDWARE */
/* These addresses are calculated from the FADT Event Block addresses */
ACPI_GLOBAL (ACPI_GENERIC_ADDRESS, AcpiGbl_XPm1aStatus);
ACPI_GLOBAL (ACPI_GENERIC_ADDRESS, AcpiGbl_XPm1aEnable);
ACPI_GLOBAL (ACPI_GENERIC_ADDRESS, AcpiGbl_XPm1bStatus);
ACPI_GLOBAL (ACPI_GENERIC_ADDRESS, AcpiGbl_XPm1bEnable);
/*
* Handle both ACPI 1.0 and ACPI 2.0+ Integer widths. The integer width is
* determined by the revision of the DSDT: If the DSDT revision is less than
* 2, use only the lower 32 bits of the internal 64-bit Integer.
*/
ACPI_GLOBAL (UINT8, AcpiGbl_IntegerBitWidth);
ACPI_GLOBAL (UINT8, AcpiGbl_IntegerByteWidth);
ACPI_GLOBAL (UINT8, AcpiGbl_IntegerNybbleWidth);
/*****************************************************************************
*
* Mutual exclusion within the ACPICA subsystem
*
****************************************************************************/
/*
* Predefined mutex objects. This array contains the
* actual OS mutex handles, indexed by the local ACPI_MUTEX_HANDLEs.
* (The table maps local handles to the real OS handles)
*/
ACPI_GLOBAL (ACPI_MUTEX_INFO, AcpiGbl_MutexInfo[ACPI_NUM_MUTEX]);
/*
* Global lock mutex is an actual AML mutex object
* Global lock semaphore works in conjunction with the actual global lock
* Global lock spinlock is used for "pending" handshake
*/
ACPI_GLOBAL (ACPI_OPERAND_OBJECT *, AcpiGbl_GlobalLockMutex);
ACPI_GLOBAL (ACPI_SEMAPHORE, AcpiGbl_GlobalLockSemaphore);
ACPI_GLOBAL (ACPI_SPINLOCK, AcpiGbl_GlobalLockPendingLock);
ACPI_GLOBAL (UINT16, AcpiGbl_GlobalLockHandle);
ACPI_GLOBAL (BOOLEAN, AcpiGbl_GlobalLockAcquired);
ACPI_GLOBAL (BOOLEAN, AcpiGbl_GlobalLockPresent);
ACPI_GLOBAL (BOOLEAN, AcpiGbl_GlobalLockPending);
/*
* Spinlocks are used for interfaces that can be possibly called at
* interrupt level
*/
ACPI_GLOBAL (ACPI_SPINLOCK, AcpiGbl_GpeLock); /* For GPE data structs and registers */
ACPI_GLOBAL (ACPI_SPINLOCK, AcpiGbl_HardwareLock); /* For ACPI H/W except GPE registers */
ACPI_GLOBAL (ACPI_SPINLOCK, AcpiGbl_ReferenceCountLock);
/* Mutex for _OSI support */
ACPI_GLOBAL (ACPI_MUTEX, AcpiGbl_OsiMutex);
/* Reader/Writer lock is used for namespace walk and dynamic table unload */
ACPI_GLOBAL (ACPI_RW_LOCK, AcpiGbl_NamespaceRwLock);
/*****************************************************************************
*
* Miscellaneous globals
*
****************************************************************************/
/* Object caches */
ACPI_GLOBAL (ACPI_CACHE_T *, AcpiGbl_NamespaceCache);
ACPI_GLOBAL (ACPI_CACHE_T *, AcpiGbl_StateCache);
ACPI_GLOBAL (ACPI_CACHE_T *, AcpiGbl_PsNodeCache);
ACPI_GLOBAL (ACPI_CACHE_T *, AcpiGbl_PsNodeExtCache);
ACPI_GLOBAL (ACPI_CACHE_T *, AcpiGbl_OperandCache);
/* System */
ACPI_INIT_GLOBAL (UINT32, AcpiGbl_StartupFlags, 0);
ACPI_INIT_GLOBAL (BOOLEAN, AcpiGbl_Shutdown, TRUE);
ACPI_INIT_GLOBAL (BOOLEAN, AcpiGbl_EarlyInitialization, TRUE);
/* Global handlers */
ACPI_GLOBAL (ACPI_GLOBAL_NOTIFY_HANDLER,AcpiGbl_GlobalNotify[2]);
ACPI_GLOBAL (ACPI_EXCEPTION_HANDLER, AcpiGbl_ExceptionHandler);
ACPI_GLOBAL (ACPI_INIT_HANDLER, AcpiGbl_InitHandler);
ACPI_GLOBAL (ACPI_TABLE_HANDLER, AcpiGbl_TableHandler);
ACPI_GLOBAL (void *, AcpiGbl_TableHandlerContext);
ACPI_GLOBAL (ACPI_INTERFACE_HANDLER, AcpiGbl_InterfaceHandler);
ACPI_GLOBAL (ACPI_SCI_HANDLER_INFO *, AcpiGbl_SciHandlerList);
/* Owner ID support */
ACPI_GLOBAL (UINT32, AcpiGbl_OwnerIdMask[ACPI_NUM_OWNERID_MASKS]);
ACPI_GLOBAL (UINT8, AcpiGbl_LastOwnerIdIndex);
ACPI_GLOBAL (UINT8, AcpiGbl_NextOwnerIdOffset);
/* Initialization sequencing */
ACPI_INIT_GLOBAL (BOOLEAN, AcpiGbl_NamespaceInitialized, FALSE);
/* Miscellaneous */
ACPI_GLOBAL (UINT32, AcpiGbl_OriginalMode);
ACPI_GLOBAL (UINT32, AcpiGbl_NsLookupCount);
ACPI_GLOBAL (UINT32, AcpiGbl_PsFindCount);
ACPI_GLOBAL (UINT16, AcpiGbl_Pm1EnableRegisterSave);
ACPI_GLOBAL (UINT8, AcpiGbl_DebuggerConfiguration);
ACPI_GLOBAL (BOOLEAN, AcpiGbl_StepToNextCall);
ACPI_GLOBAL (BOOLEAN, AcpiGbl_AcpiHardwarePresent);
ACPI_GLOBAL (BOOLEAN, AcpiGbl_EventsInitialized);
ACPI_GLOBAL (ACPI_INTERFACE_INFO *, AcpiGbl_SupportedInterfaces);
ACPI_GLOBAL (ACPI_ADDRESS_RANGE *, AcpiGbl_AddressRangeList[ACPI_ADDRESS_RANGE_MAX]);
/* Other miscellaneous, declared and initialized in utglobal */
extern const char *AcpiGbl_SleepStateNames[ACPI_S_STATE_COUNT];
extern const char *AcpiGbl_LowestDstateNames[ACPI_NUM_SxW_METHODS];
extern const char *AcpiGbl_HighestDstateNames[ACPI_NUM_SxD_METHODS];
extern const char *AcpiGbl_RegionTypes[ACPI_NUM_PREDEFINED_REGIONS];
extern const char AcpiGbl_LowerHexDigits[];
extern const char AcpiGbl_UpperHexDigits[];
extern const ACPI_OPCODE_INFO AcpiGbl_AmlOpInfo[AML_NUM_OPCODES];
/* Lists for tracking memory allocations (debug only) */
#ifdef ACPI_DBG_TRACK_ALLOCATIONS
ACPI_GLOBAL (ACPI_MEMORY_LIST *, AcpiGbl_GlobalList);
ACPI_GLOBAL (ACPI_MEMORY_LIST *, AcpiGbl_NsNodeList);
ACPI_GLOBAL (BOOLEAN, AcpiGbl_DisplayFinalMemStats);
ACPI_GLOBAL (BOOLEAN, AcpiGbl_DisableMemTracking);
ACPI_GLOBAL (BOOLEAN, AcpiGbl_VerboseLeakDump);
#endif
/*****************************************************************************
*
* ACPI Namespace
*
****************************************************************************/
#define NUM_PREDEFINED_NAMES 10
ACPI_GLOBAL (ACPI_NAMESPACE_NODE, AcpiGbl_RootNodeStruct);
ACPI_GLOBAL (ACPI_NAMESPACE_NODE *, AcpiGbl_RootNode);
ACPI_GLOBAL (ACPI_NAMESPACE_NODE *, AcpiGbl_FadtGpeDevice);
extern const UINT8 AcpiGbl_NsProperties [ACPI_NUM_NS_TYPES];
extern const ACPI_PREDEFINED_NAMES AcpiGbl_PreDefinedNames [NUM_PREDEFINED_NAMES];
#ifdef ACPI_DEBUG_OUTPUT
ACPI_GLOBAL (UINT32, AcpiGbl_CurrentNodeCount);
ACPI_GLOBAL (UINT32, AcpiGbl_CurrentNodeSize);
ACPI_GLOBAL (UINT32, AcpiGbl_MaxConcurrentNodeCount);
ACPI_GLOBAL (ACPI_SIZE *, AcpiGbl_EntryStackPointer);
ACPI_GLOBAL (ACPI_SIZE *, AcpiGbl_LowestStackPointer);
ACPI_GLOBAL (UINT32, AcpiGbl_DeepestNesting);
ACPI_INIT_GLOBAL (UINT32, AcpiGbl_NestingLevel, 0);
#endif
/*****************************************************************************
*
* Interpreter/Parser globals
*
****************************************************************************/
/* Control method single step flag */
ACPI_GLOBAL (UINT8, AcpiGbl_CmSingleStep);
ACPI_GLOBAL (ACPI_THREAD_STATE *, AcpiGbl_CurrentWalkList);
ACPI_INIT_GLOBAL (ACPI_PARSE_OBJECT, *AcpiGbl_CurrentScope, NULL);
/* ASL/ASL+ converter */
ACPI_INIT_GLOBAL (BOOLEAN, AcpiGbl_CaptureComments, FALSE);
ACPI_INIT_GLOBAL (ACPI_COMMENT_NODE, *AcpiGbl_LastListHead, NULL);
/*****************************************************************************
*
* Hardware globals
*
****************************************************************************/
extern ACPI_BIT_REGISTER_INFO AcpiGbl_BitRegisterInfo[ACPI_NUM_BITREG];
ACPI_GLOBAL (UINT8, AcpiGbl_SleepTypeA);
ACPI_GLOBAL (UINT8, AcpiGbl_SleepTypeB);
/*****************************************************************************
*
* Event and GPE globals
*
****************************************************************************/
#if (!ACPI_REDUCED_HARDWARE)
ACPI_GLOBAL (UINT8, AcpiGbl_AllGpesInitialized);
ACPI_GLOBAL (ACPI_GPE_XRUPT_INFO *, AcpiGbl_GpeXruptListHead);
ACPI_GLOBAL (ACPI_GPE_BLOCK_INFO *, AcpiGbl_GpeFadtBlocks[ACPI_MAX_GPE_BLOCKS]);
ACPI_GLOBAL (ACPI_GBL_EVENT_HANDLER, AcpiGbl_GlobalEventHandler);
ACPI_GLOBAL (void *, AcpiGbl_GlobalEventHandlerContext);
ACPI_GLOBAL (ACPI_FIXED_EVENT_HANDLER, AcpiGbl_FixedEventHandlers[ACPI_NUM_FIXED_EVENTS]);
extern ACPI_FIXED_EVENT_INFO AcpiGbl_FixedEventInfo[ACPI_NUM_FIXED_EVENTS];
#endif /* !ACPI_REDUCED_HARDWARE */
/*****************************************************************************
*
* Debug support
*
****************************************************************************/
/* Event counters */
ACPI_GLOBAL (UINT32, AcpiMethodCount);
ACPI_GLOBAL (UINT32, AcpiGpeCount);
ACPI_GLOBAL (UINT32, AcpiSciCount);
ACPI_GLOBAL (UINT32, AcpiFixedEventCount[ACPI_NUM_FIXED_EVENTS]);
/* Dynamic control method tracing mechanism */
ACPI_GLOBAL (UINT32, AcpiGbl_OriginalDbgLevel);
ACPI_GLOBAL (UINT32, AcpiGbl_OriginalDbgLayer);
/*****************************************************************************
*
* Debugger and Disassembler
*
****************************************************************************/
ACPI_INIT_GLOBAL (UINT8, AcpiGbl_DbOutputFlags, ACPI_DB_CONSOLE_OUTPUT);
#ifdef ACPI_DISASSEMBLER
/* Do not disassemble buffers to resource descriptors */
ACPI_INIT_GLOBAL (UINT8, AcpiGbl_NoResourceDisassembly, FALSE);
ACPI_INIT_GLOBAL (BOOLEAN, AcpiGbl_IgnoreNoopOperator, FALSE);
ACPI_INIT_GLOBAL (BOOLEAN, AcpiGbl_CstyleDisassembly, TRUE);
ACPI_INIT_GLOBAL (BOOLEAN, AcpiGbl_ForceAmlDisassembly, FALSE);
ACPI_INIT_GLOBAL (BOOLEAN, AcpiGbl_DmOpt_Verbose, TRUE);
ACPI_INIT_GLOBAL (BOOLEAN, AcpiGbl_DmEmitExternalOpcodes, FALSE);
ACPI_INIT_GLOBAL (BOOLEAN, AcpiGbl_DoDisassemblerOptimizations, TRUE);
ACPI_INIT_GLOBAL (ACPI_PARSE_OBJECT_LIST, *AcpiGbl_TempListHead, NULL);
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);
ACPI_GLOBAL (ACPI_EXTERNAL_FILE *, AcpiGbl_ExternalFileList);
#endif
#ifdef ACPI_DEBUGGER
ACPI_INIT_GLOBAL (BOOLEAN, AcpiGbl_AbortMethod, FALSE);
ACPI_INIT_GLOBAL (ACPI_THREAD_ID, AcpiGbl_DbThreadId, ACPI_INVALID_THREAD_ID);
ACPI_GLOBAL (BOOLEAN, AcpiGbl_DbOpt_NoIniMethods);
ACPI_GLOBAL (BOOLEAN, AcpiGbl_DbOpt_NoRegionSupport);
ACPI_GLOBAL (BOOLEAN, AcpiGbl_DbOutputToFile);
ACPI_GLOBAL (char *, AcpiGbl_DbBuffer);
ACPI_GLOBAL (char *, AcpiGbl_DbFilename);
ACPI_GLOBAL (UINT32, AcpiGbl_DbDebugLevel);
ACPI_GLOBAL (UINT32, AcpiGbl_DbConsoleDebugLevel);
ACPI_GLOBAL (ACPI_NAMESPACE_NODE *, AcpiGbl_DbScopeNode);
ACPI_GLOBAL (BOOLEAN, AcpiGbl_DbTerminateLoop);
ACPI_GLOBAL (BOOLEAN, AcpiGbl_DbThreadsTerminated);
ACPI_GLOBAL (char *, AcpiGbl_DbArgs[ACPI_DEBUGGER_MAX_ARGS]);
ACPI_GLOBAL (ACPI_OBJECT_TYPE, AcpiGbl_DbArgTypes[ACPI_DEBUGGER_MAX_ARGS]);
/* These buffers should all be the same size */
ACPI_GLOBAL (char, AcpiGbl_DbParsedBuf[ACPI_DB_LINE_BUFFER_SIZE]);
ACPI_GLOBAL (char, AcpiGbl_DbScopeBuf[ACPI_DB_LINE_BUFFER_SIZE]);
ACPI_GLOBAL (char, AcpiGbl_DbDebugFilename[ACPI_DB_LINE_BUFFER_SIZE]);
/* Statistics globals */
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);
#endif /* ACPI_DEBUGGER */
#if defined (ACPI_DISASSEMBLER) || defined (ACPI_ASL_COMPILER)
ACPI_GLOBAL (const char, *AcpiGbl_PldPanelList[]);
ACPI_GLOBAL (const char, *AcpiGbl_PldVerticalPositionList[]);
ACPI_GLOBAL (const char, *AcpiGbl_PldHorizontalPositionList[]);
ACPI_GLOBAL (const char, *AcpiGbl_PldShapeList[]);
ACPI_INIT_GLOBAL (BOOLEAN, AcpiGbl_DisasmFlag, FALSE);
#endif
/*****************************************************************************
*
* ACPICA application-specific globals
*
****************************************************************************/
/* ASL-to-ASL+ conversion utility (implemented within the iASL compiler) */
#ifdef ACPI_ASL_COMPILER
ACPI_INIT_GLOBAL (char *, AcpiGbl_CurrentInlineComment, NULL);
ACPI_INIT_GLOBAL (char *, AcpiGbl_CurrentEndNodeComment, NULL);
ACPI_INIT_GLOBAL (char *, AcpiGbl_CurrentOpenBraceComment, NULL);
ACPI_INIT_GLOBAL (char *, AcpiGbl_CurrentCloseBraceComment, NULL);
ACPI_INIT_GLOBAL (char *, AcpiGbl_RootFilename, NULL);
ACPI_INIT_GLOBAL (char *, AcpiGbl_CurrentFilename, NULL);
ACPI_INIT_GLOBAL (char *, AcpiGbl_CurrentParentFilename, NULL);
ACPI_INIT_GLOBAL (char *, AcpiGbl_CurrentIncludeFilename, NULL);
ACPI_INIT_GLOBAL (ACPI_COMMENT_NODE, *AcpiGbl_DefBlkCommentListHead, NULL);
ACPI_INIT_GLOBAL (ACPI_COMMENT_NODE, *AcpiGbl_DefBlkCommentListTail, NULL);
ACPI_INIT_GLOBAL (ACPI_COMMENT_NODE, *AcpiGbl_RegCommentListHead, NULL);
ACPI_INIT_GLOBAL (ACPI_COMMENT_NODE, *AcpiGbl_RegCommentListTail, NULL);
ACPI_INIT_GLOBAL (ACPI_COMMENT_NODE, *AcpiGbl_IncCommentListHead, NULL);
ACPI_INIT_GLOBAL (ACPI_COMMENT_NODE, *AcpiGbl_IncCommentListTail, NULL);
ACPI_INIT_GLOBAL (ACPI_COMMENT_NODE, *AcpiGbl_EndBlkCommentListHead, NULL);
ACPI_INIT_GLOBAL (ACPI_COMMENT_NODE, *AcpiGbl_EndBlkCommentListTail, NULL);
ACPI_INIT_GLOBAL (ACPI_COMMENT_ADDR_NODE, *AcpiGbl_CommentAddrListHead, NULL);
ACPI_INIT_GLOBAL (ACPI_FILE_NODE, *AcpiGbl_FileTreeRoot, NULL);
ACPI_GLOBAL (ACPI_CACHE_T *, AcpiGbl_RegCommentCache);
ACPI_GLOBAL (ACPI_CACHE_T *, AcpiGbl_CommentAddrCache);
ACPI_GLOBAL (ACPI_CACHE_T *, AcpiGbl_FileCache);
ACPI_INIT_GLOBAL (BOOLEAN, AcpiGbl_DebugAslConversion, FALSE);
ACPI_INIT_GLOBAL (ACPI_FILE, AcpiGbl_ConvDebugFile, NULL);
ACPI_GLOBAL (char, AcpiGbl_TableSig[4]);
#endif
#ifdef ACPI_APPLICATION
ACPI_INIT_GLOBAL (ACPI_FILE, AcpiGbl_DebugFile, NULL);
ACPI_INIT_GLOBAL (ACPI_FILE, AcpiGbl_OutputFile, NULL);
ACPI_INIT_GLOBAL (BOOLEAN, AcpiGbl_DebugTimeout, FALSE);
/* Print buffer */
ACPI_GLOBAL (ACPI_SPINLOCK, AcpiGbl_PrintLock); /* For print buffer */
ACPI_GLOBAL (char, AcpiGbl_PrintBuffer[1024]);
#endif /* ACPI_APPLICATION */
#endif /* __ACGLOBAL_H__ */
-335
View File
@@ -1,335 +0,0 @@
/******************************************************************************
*
* Name: achware.h -- hardware specific interfaces
*
*****************************************************************************/
/******************************************************************************
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2019, 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.
*
*****************************************************************************
*
* Alternatively, you may choose to be licensed under the terms of the
* following license:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Alternatively, you may choose to be licensed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
*****************************************************************************/
#ifndef __ACHWARE_H__
#define __ACHWARE_H__
/* Values for the _SST predefined method */
#define ACPI_SST_INDICATOR_OFF 0
#define ACPI_SST_WORKING 1
#define ACPI_SST_WAKING 2
#define ACPI_SST_SLEEPING 3
#define ACPI_SST_SLEEP_CONTEXT 4
/*
* hwacpi - high level functions
*/
ACPI_STATUS
AcpiHwSetMode (
UINT32 Mode);
UINT32
AcpiHwGetMode (
void);
/*
* hwregs - ACPI Register I/O
*/
ACPI_STATUS
AcpiHwValidateRegister (
ACPI_GENERIC_ADDRESS *Reg,
UINT8 MaxBitWidth,
UINT64 *Address);
ACPI_STATUS
AcpiHwRead (
UINT64 *Value,
ACPI_GENERIC_ADDRESS *Reg);
ACPI_STATUS
AcpiHwWrite (
UINT64 Value,
ACPI_GENERIC_ADDRESS *Reg);
ACPI_BIT_REGISTER_INFO *
AcpiHwGetBitRegisterInfo (
UINT32 RegisterId);
ACPI_STATUS
AcpiHwWritePm1Control (
UINT32 Pm1aControl,
UINT32 Pm1bControl);
ACPI_STATUS
AcpiHwRegisterRead (
UINT32 RegisterId,
UINT32 *ReturnValue);
ACPI_STATUS
AcpiHwRegisterWrite (
UINT32 RegisterId,
UINT32 Value);
ACPI_STATUS
AcpiHwClearAcpiStatus (
void);
/*
* hwsleep - sleep/wake support (Legacy sleep registers)
*/
ACPI_STATUS
AcpiHwLegacySleep (
UINT8 SleepState);
ACPI_STATUS
AcpiHwLegacyWakePrep (
UINT8 SleepState);
ACPI_STATUS
AcpiHwLegacyWake (
UINT8 SleepState);
/*
* hwesleep - sleep/wake support (Extended FADT-V5 sleep registers)
*/
void
AcpiHwExecuteSleepMethod (
char *MethodName,
UINT32 IntegerArgument);
ACPI_STATUS
AcpiHwExtendedSleep (
UINT8 SleepState);
ACPI_STATUS
AcpiHwExtendedWakePrep (
UINT8 SleepState);
ACPI_STATUS
AcpiHwExtendedWake (
UINT8 SleepState);
/*
* hwvalid - Port I/O with validation
*/
ACPI_STATUS
AcpiHwReadPort (
ACPI_IO_ADDRESS Address,
UINT32 *Value,
UINT32 Width);
ACPI_STATUS
AcpiHwWritePort (
ACPI_IO_ADDRESS Address,
UINT32 Value,
UINT32 Width);
/*
* hwgpe - GPE support
*/
UINT32
AcpiHwGetGpeRegisterBit (
ACPI_GPE_EVENT_INFO *GpeEventInfo);
ACPI_STATUS
AcpiHwLowSetGpe (
ACPI_GPE_EVENT_INFO *GpeEventInfo,
UINT32 Action);
ACPI_STATUS
AcpiHwDisableGpeBlock (
ACPI_GPE_XRUPT_INFO *GpeXruptInfo,
ACPI_GPE_BLOCK_INFO *GpeBlock,
void *Context);
ACPI_STATUS
AcpiHwClearGpe (
ACPI_GPE_EVENT_INFO *GpeEventInfo);
ACPI_STATUS
AcpiHwClearGpeBlock (
ACPI_GPE_XRUPT_INFO *GpeXruptInfo,
ACPI_GPE_BLOCK_INFO *GpeBlock,
void *Context);
ACPI_STATUS
AcpiHwGetGpeStatus (
ACPI_GPE_EVENT_INFO *GpeEventInfo,
ACPI_EVENT_STATUS *EventStatus);
ACPI_STATUS
AcpiHwDisableAllGpes (
void);
ACPI_STATUS
AcpiHwEnableAllRuntimeGpes (
void);
ACPI_STATUS
AcpiHwEnableAllWakeupGpes (
void);
ACPI_STATUS
AcpiHwEnableRuntimeGpeBlock (
ACPI_GPE_XRUPT_INFO *GpeXruptInfo,
ACPI_GPE_BLOCK_INFO *GpeBlock,
void *Context);
/*
* hwpci - PCI configuration support
*/
ACPI_STATUS
AcpiHwDerivePciId (
ACPI_PCI_ID *PciId,
ACPI_HANDLE RootPciDevice,
ACPI_HANDLE PciRegion);
#endif /* __ACHWARE_H__ */
-892
View File
@@ -1,892 +0,0 @@
/******************************************************************************
*
* Name: acinterp.h - Interpreter subcomponent prototypes and defines
*
*****************************************************************************/
/******************************************************************************
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2019, 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.
*
*****************************************************************************
*
* Alternatively, you may choose to be licensed under the terms of the
* following license:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Alternatively, you may choose to be licensed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
*****************************************************************************/
#ifndef __ACINTERP_H__
#define __ACINTERP_H__
#define ACPI_WALK_OPERANDS (&(WalkState->Operands [WalkState->NumOperands -1]))
/* Macros for tables used for debug output */
#define ACPI_EXD_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_OPERAND_OBJECT,f)
#define ACPI_EXD_NSOFFSET(f) (UINT8) ACPI_OFFSET (ACPI_NAMESPACE_NODE,f)
#define ACPI_EXD_TABLE_SIZE(name) (sizeof(name) / sizeof (ACPI_EXDUMP_INFO))
/*
* If possible, pack the following structures to byte alignment, since we
* don't care about performance for debug output. Two cases where we cannot
* pack the structures:
*
* 1) Hardware does not support misaligned memory transfers
* 2) Compiler does not support pointers within packed structures
*/
#if (!defined(ACPI_MISALIGNMENT_NOT_SUPPORTED) && !defined(ACPI_PACKED_POINTERS_NOT_SUPPORTED))
#pragma pack(1)
#endif
typedef const struct acpi_exdump_info
{
UINT8 Opcode;
UINT8 Offset;
const char *Name;
} ACPI_EXDUMP_INFO;
/* Values for the Opcode field above */
#define ACPI_EXD_INIT 0
#define ACPI_EXD_TYPE 1
#define ACPI_EXD_UINT8 2
#define ACPI_EXD_UINT16 3
#define ACPI_EXD_UINT32 4
#define ACPI_EXD_UINT64 5
#define ACPI_EXD_LITERAL 6
#define ACPI_EXD_POINTER 7
#define ACPI_EXD_ADDRESS 8
#define ACPI_EXD_STRING 9
#define ACPI_EXD_BUFFER 10
#define ACPI_EXD_PACKAGE 11
#define ACPI_EXD_FIELD 12
#define ACPI_EXD_REFERENCE 13
#define ACPI_EXD_LIST 14 /* Operand object list */
#define ACPI_EXD_HDLR_LIST 15 /* Address Handler list */
#define ACPI_EXD_RGN_LIST 16 /* Region list */
#define ACPI_EXD_NODE 17 /* Namespace Node */
/* restore default alignment */
#pragma pack()
/*
* exconvrt - object conversion
*/
ACPI_STATUS
AcpiExConvertToInteger (
ACPI_OPERAND_OBJECT *ObjDesc,
ACPI_OPERAND_OBJECT **ResultDesc,
UINT32 ImplicitConversion);
ACPI_STATUS
AcpiExConvertToBuffer (
ACPI_OPERAND_OBJECT *ObjDesc,
ACPI_OPERAND_OBJECT **ResultDesc);
ACPI_STATUS
AcpiExConvertToString (
ACPI_OPERAND_OBJECT *ObjDesc,
ACPI_OPERAND_OBJECT **ResultDesc,
UINT32 Type);
/* Types for ->String conversion */
#define ACPI_EXPLICIT_BYTE_COPY 0x00000000
#define ACPI_EXPLICIT_CONVERT_HEX 0x00000001
#define ACPI_IMPLICIT_CONVERT_HEX 0x00000002
#define ACPI_EXPLICIT_CONVERT_DECIMAL 0x00000003
ACPI_STATUS
AcpiExConvertToTargetType (
ACPI_OBJECT_TYPE DestinationType,
ACPI_OPERAND_OBJECT *SourceDesc,
ACPI_OPERAND_OBJECT **ResultDesc,
ACPI_WALK_STATE *WalkState);
/*
* exdebug - AML debug object
*/
void
AcpiExDoDebugObject (
ACPI_OPERAND_OBJECT *SourceDesc,
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
*/
ACPI_STATUS
AcpiExGetProtocolBufferLength (
UINT32 ProtocolId,
UINT32 *ReturnLength);
ACPI_STATUS
AcpiExCommonBufferSetup (
ACPI_OPERAND_OBJECT *ObjDesc,
UINT32 BufferLength,
UINT32 *DatumCount);
ACPI_STATUS
AcpiExWriteWithUpdateRule (
ACPI_OPERAND_OBJECT *ObjDesc,
UINT64 Mask,
UINT64 FieldValue,
UINT32 FieldDatumByteOffset);
void
AcpiExGetBufferDatum(
UINT64 *Datum,
void *Buffer,
UINT32 BufferLength,
UINT32 ByteGranularity,
UINT32 BufferOffset);
void
AcpiExSetBufferDatum (
UINT64 MergedDatum,
void *Buffer,
UINT32 BufferLength,
UINT32 ByteGranularity,
UINT32 BufferOffset);
ACPI_STATUS
AcpiExReadDataFromField (
ACPI_WALK_STATE *WalkState,
ACPI_OPERAND_OBJECT *ObjDesc,
ACPI_OPERAND_OBJECT **RetBufferDesc);
ACPI_STATUS
AcpiExWriteDataToField (
ACPI_OPERAND_OBJECT *SourceDesc,
ACPI_OPERAND_OBJECT *ObjDesc,
ACPI_OPERAND_OBJECT **ResultDesc);
/*
* exfldio - low level field I/O
*/
ACPI_STATUS
AcpiExExtractFromField (
ACPI_OPERAND_OBJECT *ObjDesc,
void *Buffer,
UINT32 BufferLength);
ACPI_STATUS
AcpiExInsertIntoField (
ACPI_OPERAND_OBJECT *ObjDesc,
void *Buffer,
UINT32 BufferLength);
ACPI_STATUS
AcpiExAccessRegion (
ACPI_OPERAND_OBJECT *ObjDesc,
UINT32 FieldDatumByteOffset,
UINT64 *Value,
UINT32 ReadWrite);
/*
* exmisc - misc support routines
*/
ACPI_STATUS
AcpiExGetObjectReference (
ACPI_OPERAND_OBJECT *ObjDesc,
ACPI_OPERAND_OBJECT **ReturnDesc,
ACPI_WALK_STATE *WalkState);
ACPI_STATUS
AcpiExConcatTemplate (
ACPI_OPERAND_OBJECT *ObjDesc,
ACPI_OPERAND_OBJECT *ObjDesc2,
ACPI_OPERAND_OBJECT **ActualReturnDesc,
ACPI_WALK_STATE *WalkState);
ACPI_STATUS
AcpiExDoConcatenate (
ACPI_OPERAND_OBJECT *ObjDesc,
ACPI_OPERAND_OBJECT *ObjDesc2,
ACPI_OPERAND_OBJECT **ActualReturnDesc,
ACPI_WALK_STATE *WalkState);
ACPI_STATUS
AcpiExDoLogicalNumericOp (
UINT16 Opcode,
UINT64 Integer0,
UINT64 Integer1,
BOOLEAN *LogicalResult);
ACPI_STATUS
AcpiExDoLogicalOp (
UINT16 Opcode,
ACPI_OPERAND_OBJECT *Operand0,
ACPI_OPERAND_OBJECT *Operand1,
BOOLEAN *LogicalResult);
UINT64
AcpiExDoMathOp (
UINT16 Opcode,
UINT64 Operand0,
UINT64 Operand1);
ACPI_STATUS
AcpiExCreateMutex (
ACPI_WALK_STATE *WalkState);
ACPI_STATUS
AcpiExCreateProcessor (
ACPI_WALK_STATE *WalkState);
ACPI_STATUS
AcpiExCreatePowerResource (
ACPI_WALK_STATE *WalkState);
ACPI_STATUS
AcpiExCreateRegion (
UINT8 *AmlStart,
UINT32 AmlLength,
UINT8 RegionSpace,
ACPI_WALK_STATE *WalkState);
ACPI_STATUS
AcpiExCreateEvent (
ACPI_WALK_STATE *WalkState);
ACPI_STATUS
AcpiExCreateAlias (
ACPI_WALK_STATE *WalkState);
ACPI_STATUS
AcpiExCreateMethod (
UINT8 *AmlStart,
UINT32 AmlLength,
ACPI_WALK_STATE *WalkState);
/*
* exconfig - dynamic table load/unload
*/
ACPI_STATUS
AcpiExLoadOp (
ACPI_OPERAND_OBJECT *ObjDesc,
ACPI_OPERAND_OBJECT *Target,
ACPI_WALK_STATE *WalkState);
ACPI_STATUS
AcpiExLoadTableOp (
ACPI_WALK_STATE *WalkState,
ACPI_OPERAND_OBJECT **ReturnDesc);
ACPI_STATUS
AcpiExUnloadTable (
ACPI_OPERAND_OBJECT *DdbHandle);
/*
* exmutex - mutex support
*/
ACPI_STATUS
AcpiExAcquireMutex (
ACPI_OPERAND_OBJECT *TimeDesc,
ACPI_OPERAND_OBJECT *ObjDesc,
ACPI_WALK_STATE *WalkState);
ACPI_STATUS
AcpiExAcquireMutexObject (
UINT16 Timeout,
ACPI_OPERAND_OBJECT *ObjDesc,
ACPI_THREAD_ID ThreadId);
ACPI_STATUS
AcpiExReleaseMutex (
ACPI_OPERAND_OBJECT *ObjDesc,
ACPI_WALK_STATE *WalkState);
ACPI_STATUS
AcpiExReleaseMutexObject (
ACPI_OPERAND_OBJECT *ObjDesc);
void
AcpiExReleaseAllMutexes (
ACPI_THREAD_STATE *Thread);
void
AcpiExUnlinkMutex (
ACPI_OPERAND_OBJECT *ObjDesc);
/*
* exprep - ACPI AML execution - prep utilities
*/
ACPI_STATUS
AcpiExPrepCommonFieldObject (
ACPI_OPERAND_OBJECT *ObjDesc,
UINT8 FieldFlags,
UINT8 FieldAttribute,
UINT32 FieldBitPosition,
UINT32 FieldBitLength);
ACPI_STATUS
AcpiExPrepFieldValue (
ACPI_CREATE_FIELD_INFO *Info);
/*
* exserial - FieldUnit support for serial address spaces
*/
ACPI_STATUS
AcpiExReadSerialBus (
ACPI_OPERAND_OBJECT *ObjDesc,
ACPI_OPERAND_OBJECT **ReturnBuffer);
ACPI_STATUS
AcpiExWriteSerialBus (
ACPI_OPERAND_OBJECT *SourceDesc,
ACPI_OPERAND_OBJECT *ObjDesc,
ACPI_OPERAND_OBJECT **ReturnBuffer);
ACPI_STATUS
AcpiExReadGpio (
ACPI_OPERAND_OBJECT *ObjDesc,
void *Buffer);
ACPI_STATUS
AcpiExWriteGpio (
ACPI_OPERAND_OBJECT *SourceDesc,
ACPI_OPERAND_OBJECT *ObjDesc,
ACPI_OPERAND_OBJECT **ReturnBuffer);
/*
* exsystem - Interface to OS services
*/
ACPI_STATUS
AcpiExSystemDoNotifyOp (
ACPI_OPERAND_OBJECT *Value,
ACPI_OPERAND_OBJECT *ObjDesc);
ACPI_STATUS
AcpiExSystemDoSleep(
UINT64 Time);
ACPI_STATUS
AcpiExSystemDoStall (
UINT32 Time);
ACPI_STATUS
AcpiExSystemSignalEvent(
ACPI_OPERAND_OBJECT *ObjDesc);
ACPI_STATUS
AcpiExSystemWaitEvent(
ACPI_OPERAND_OBJECT *Time,
ACPI_OPERAND_OBJECT *ObjDesc);
ACPI_STATUS
AcpiExSystemResetEvent(
ACPI_OPERAND_OBJECT *ObjDesc);
ACPI_STATUS
AcpiExSystemWaitSemaphore (
ACPI_SEMAPHORE Semaphore,
UINT16 Timeout);
ACPI_STATUS
AcpiExSystemWaitMutex (
ACPI_MUTEX Mutex,
UINT16 Timeout);
/*
* exoparg1 - ACPI AML execution, 1 operand
*/
ACPI_STATUS
AcpiExOpcode_0A_0T_1R (
ACPI_WALK_STATE *WalkState);
ACPI_STATUS
AcpiExOpcode_1A_0T_0R (
ACPI_WALK_STATE *WalkState);
ACPI_STATUS
AcpiExOpcode_1A_0T_1R (
ACPI_WALK_STATE *WalkState);
ACPI_STATUS
AcpiExOpcode_1A_1T_1R (
ACPI_WALK_STATE *WalkState);
ACPI_STATUS
AcpiExOpcode_1A_1T_0R (
ACPI_WALK_STATE *WalkState);
/*
* exoparg2 - ACPI AML execution, 2 operands
*/
ACPI_STATUS
AcpiExOpcode_2A_0T_0R (
ACPI_WALK_STATE *WalkState);
ACPI_STATUS
AcpiExOpcode_2A_0T_1R (
ACPI_WALK_STATE *WalkState);
ACPI_STATUS
AcpiExOpcode_2A_1T_1R (
ACPI_WALK_STATE *WalkState);
ACPI_STATUS
AcpiExOpcode_2A_2T_1R (
ACPI_WALK_STATE *WalkState);
/*
* exoparg3 - ACPI AML execution, 3 operands
*/
ACPI_STATUS
AcpiExOpcode_3A_0T_0R (
ACPI_WALK_STATE *WalkState);
ACPI_STATUS
AcpiExOpcode_3A_1T_1R (
ACPI_WALK_STATE *WalkState);
/*
* exoparg6 - ACPI AML execution, 6 operands
*/
ACPI_STATUS
AcpiExOpcode_6A_0T_1R (
ACPI_WALK_STATE *WalkState);
/*
* exresolv - Object resolution and get value functions
*/
ACPI_STATUS
AcpiExResolveToValue (
ACPI_OPERAND_OBJECT **StackPtr,
ACPI_WALK_STATE *WalkState);
ACPI_STATUS
AcpiExResolveMultiple (
ACPI_WALK_STATE *WalkState,
ACPI_OPERAND_OBJECT *Operand,
ACPI_OBJECT_TYPE *ReturnType,
ACPI_OPERAND_OBJECT **ReturnDesc);
/*
* exresnte - resolve namespace node
*/
ACPI_STATUS
AcpiExResolveNodeToValue (
ACPI_NAMESPACE_NODE **StackPtr,
ACPI_WALK_STATE *WalkState);
/*
* exresop - resolve operand to value
*/
ACPI_STATUS
AcpiExResolveOperands (
UINT16 Opcode,
ACPI_OPERAND_OBJECT **StackPtr,
ACPI_WALK_STATE *WalkState);
/*
* exdump - Interpreter debug output routines
*/
void
AcpiExDumpOperand (
ACPI_OPERAND_OBJECT *ObjDesc,
UINT32 Depth);
void
AcpiExDumpOperands (
ACPI_OPERAND_OBJECT **Operands,
const char *OpcodeName,
UINT32 NumOpcodes);
void
AcpiExDumpObjectDescriptor (
ACPI_OPERAND_OBJECT *Object,
UINT32 Flags);
void
AcpiExDumpNamespaceNode (
ACPI_NAMESPACE_NODE *Node,
UINT32 Flags);
/*
* exnames - AML namestring support
*/
ACPI_STATUS
AcpiExGetNameString (
ACPI_OBJECT_TYPE DataType,
UINT8 *InAmlAddress,
char **OutNameString,
UINT32 *OutNameLength);
/*
* exstore - Object store support
*/
ACPI_STATUS
AcpiExStore (
ACPI_OPERAND_OBJECT *ValDesc,
ACPI_OPERAND_OBJECT *DestDesc,
ACPI_WALK_STATE *WalkState);
ACPI_STATUS
AcpiExStoreObjectToNode (
ACPI_OPERAND_OBJECT *SourceDesc,
ACPI_NAMESPACE_NODE *Node,
ACPI_WALK_STATE *WalkState,
UINT8 ImplicitConversion);
/*
* exstoren - resolve/store object
*/
ACPI_STATUS
AcpiExResolveObject (
ACPI_OPERAND_OBJECT **SourceDescPtr,
ACPI_OBJECT_TYPE TargetType,
ACPI_WALK_STATE *WalkState);
ACPI_STATUS
AcpiExStoreObjectToObject (
ACPI_OPERAND_OBJECT *SourceDesc,
ACPI_OPERAND_OBJECT *DestDesc,
ACPI_OPERAND_OBJECT **NewDesc,
ACPI_WALK_STATE *WalkState);
/*
* exstorob - store object - buffer/string
*/
ACPI_STATUS
AcpiExStoreBufferToBuffer (
ACPI_OPERAND_OBJECT *SourceDesc,
ACPI_OPERAND_OBJECT *TargetDesc);
ACPI_STATUS
AcpiExStoreStringToString (
ACPI_OPERAND_OBJECT *SourceDesc,
ACPI_OPERAND_OBJECT *TargetDesc);
/*
* excopy - object copy
*/
ACPI_STATUS
AcpiExCopyIntegerToIndexField (
ACPI_OPERAND_OBJECT *SourceDesc,
ACPI_OPERAND_OBJECT *TargetDesc);
ACPI_STATUS
AcpiExCopyIntegerToBankField (
ACPI_OPERAND_OBJECT *SourceDesc,
ACPI_OPERAND_OBJECT *TargetDesc);
ACPI_STATUS
AcpiExCopyDataToNamedField (
ACPI_OPERAND_OBJECT *SourceDesc,
ACPI_NAMESPACE_NODE *Node);
ACPI_STATUS
AcpiExCopyIntegerToBufferField (
ACPI_OPERAND_OBJECT *SourceDesc,
ACPI_OPERAND_OBJECT *TargetDesc);
/*
* exutils - interpreter/scanner utilities
*/
void
AcpiExEnterInterpreter (
void);
void
AcpiExExitInterpreter (
void);
BOOLEAN
AcpiExTruncateFor32bitTable (
ACPI_OPERAND_OBJECT *ObjDesc);
void
AcpiExAcquireGlobalLock (
UINT32 Rule);
void
AcpiExReleaseGlobalLock (
UINT32 Rule);
void
AcpiExEisaIdToString (
char *Dest,
UINT64 CompressedId);
void
AcpiExIntegerToString (
char *Dest,
UINT64 Value);
void
AcpiExPciClsToString (
char *Dest,
UINT8 ClassCode[3]);
BOOLEAN
AcpiIsValidSpaceId (
UINT8 SpaceId);
/*
* exregion - default OpRegion handlers
*/
ACPI_STATUS
AcpiExSystemMemorySpaceHandler (
UINT32 Function,
ACPI_PHYSICAL_ADDRESS Address,
UINT32 BitWidth,
UINT64 *Value,
void *HandlerContext,
void *RegionContext);
ACPI_STATUS
AcpiExSystemIoSpaceHandler (
UINT32 Function,
ACPI_PHYSICAL_ADDRESS Address,
UINT32 BitWidth,
UINT64 *Value,
void *HandlerContext,
void *RegionContext);
ACPI_STATUS
AcpiExPciConfigSpaceHandler (
UINT32 Function,
ACPI_PHYSICAL_ADDRESS Address,
UINT32 BitWidth,
UINT64 *Value,
void *HandlerContext,
void *RegionContext);
ACPI_STATUS
AcpiExCmosSpaceHandler (
UINT32 Function,
ACPI_PHYSICAL_ADDRESS Address,
UINT32 BitWidth,
UINT64 *Value,
void *HandlerContext,
void *RegionContext);
ACPI_STATUS
AcpiExPciBarSpaceHandler (
UINT32 Function,
ACPI_PHYSICAL_ADDRESS Address,
UINT32 BitWidth,
UINT64 *Value,
void *HandlerContext,
void *RegionContext);
ACPI_STATUS
AcpiExEmbeddedControllerSpaceHandler (
UINT32 Function,
ACPI_PHYSICAL_ADDRESS Address,
UINT32 BitWidth,
UINT64 *Value,
void *HandlerContext,
void *RegionContext);
ACPI_STATUS
AcpiExSmBusSpaceHandler (
UINT32 Function,
ACPI_PHYSICAL_ADDRESS Address,
UINT32 BitWidth,
UINT64 *Value,
void *HandlerContext,
void *RegionContext);
ACPI_STATUS
AcpiExDataTableSpaceHandler (
UINT32 Function,
ACPI_PHYSICAL_ADDRESS Address,
UINT32 BitWidth,
UINT64 *Value,
void *HandlerContext,
void *RegionContext);
#endif /* __INTERP_H__ */
File diff suppressed because it is too large Load Diff
-647
View File
@@ -1,647 +0,0 @@
/******************************************************************************
*
* Name: acmacros.h - C macros for the entire subsystem.
*
*****************************************************************************/
/******************************************************************************
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2019, 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.
*
*****************************************************************************
*
* Alternatively, you may choose to be licensed under the terms of the
* following license:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Alternatively, you may choose to be licensed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
*****************************************************************************/
#ifndef __ACMACROS_H__
#define __ACMACROS_H__
/*
* Extract data using a pointer. Any more than a byte and we
* get into potential alignment issues -- see the STORE macros below.
* Use with care.
*/
#define ACPI_CAST8(ptr) ACPI_CAST_PTR (UINT8, (ptr))
#define ACPI_CAST16(ptr) ACPI_CAST_PTR (UINT16, (ptr))
#define ACPI_CAST32(ptr) ACPI_CAST_PTR (UINT32, (ptr))
#define ACPI_CAST64(ptr) ACPI_CAST_PTR (UINT64, (ptr))
#define ACPI_GET8(ptr) (*ACPI_CAST8 (ptr))
#define ACPI_GET16(ptr) (*ACPI_CAST16 (ptr))
#define ACPI_GET32(ptr) (*ACPI_CAST32 (ptr))
#define ACPI_GET64(ptr) (*ACPI_CAST64 (ptr))
#define ACPI_SET8(ptr, val) (*ACPI_CAST8 (ptr) = (UINT8) (val))
#define ACPI_SET16(ptr, val) (*ACPI_CAST16 (ptr) = (UINT16) (val))
#define ACPI_SET32(ptr, val) (*ACPI_CAST32 (ptr) = (UINT32) (val))
#define ACPI_SET64(ptr, val) (*ACPI_CAST64 (ptr) = (UINT64) (val))
/*
* printf() format helper. This macro is a workaround for the difficulties
* with emitting 64-bit integers and 64-bit pointers with the same code
* for both 32-bit and 64-bit hosts.
*/
//#define ACPI_FORMAT_UINT64(i) ACPI_HIDWORD(i), ACPI_LODWORD(i)
/*
* Macros for moving data around to/from buffers that are possibly unaligned.
* If the hardware supports the transfer of unaligned data, just do the store.
* Otherwise, we have to move one byte at a time.
*/
#ifdef ACPI_BIG_ENDIAN
/*
* Macros for big-endian machines
*/
/* These macros reverse the bytes during the move, converting little-endian to big endian */
/* Big Endian <== Little Endian */
/* Hi...Lo Lo...Hi */
/* 16-bit source, 16/32/64 destination */
#define ACPI_MOVE_16_TO_16(d, s) {(( UINT8 *)(void *)(d))[0] = ((UINT8 *)(void *)(s))[1];\
(( UINT8 *)(void *)(d))[1] = ((UINT8 *)(void *)(s))[0];}
#define ACPI_MOVE_16_TO_32(d, s) {(*(UINT32 *)(void *)(d))=0;\
((UINT8 *)(void *)(d))[2] = ((UINT8 *)(void *)(s))[1];\
((UINT8 *)(void *)(d))[3] = ((UINT8 *)(void *)(s))[0];}
#define ACPI_MOVE_16_TO_64(d, s) {(*(UINT64 *)(void *)(d))=0;\
((UINT8 *)(void *)(d))[6] = ((UINT8 *)(void *)(s))[1];\
((UINT8 *)(void *)(d))[7] = ((UINT8 *)(void *)(s))[0];}
/* 32-bit source, 16/32/64 destination */
#define ACPI_MOVE_32_TO_16(d, s) ACPI_MOVE_16_TO_16(d, s) /* Truncate to 16 */
#define ACPI_MOVE_32_TO_32(d, s) {(( UINT8 *)(void *)(d))[0] = ((UINT8 *)(void *)(s))[3];\
(( UINT8 *)(void *)(d))[1] = ((UINT8 *)(void *)(s))[2];\
(( UINT8 *)(void *)(d))[2] = ((UINT8 *)(void *)(s))[1];\
(( UINT8 *)(void *)(d))[3] = ((UINT8 *)(void *)(s))[0];}
#define ACPI_MOVE_32_TO_64(d, s) {(*(UINT64 *)(void *)(d))=0;\
((UINT8 *)(void *)(d))[4] = ((UINT8 *)(void *)(s))[3];\
((UINT8 *)(void *)(d))[5] = ((UINT8 *)(void *)(s))[2];\
((UINT8 *)(void *)(d))[6] = ((UINT8 *)(void *)(s))[1];\
((UINT8 *)(void *)(d))[7] = ((UINT8 *)(void *)(s))[0];}
/* 64-bit source, 16/32/64 destination */
#define ACPI_MOVE_64_TO_16(d, s) ACPI_MOVE_16_TO_16(d, s) /* Truncate to 16 */
#define ACPI_MOVE_64_TO_32(d, s) ACPI_MOVE_32_TO_32(d, s) /* Truncate to 32 */
#define ACPI_MOVE_64_TO_64(d, s) {(( UINT8 *)(void *)(d))[0] = ((UINT8 *)(void *)(s))[7];\
(( UINT8 *)(void *)(d))[1] = ((UINT8 *)(void *)(s))[6];\
(( UINT8 *)(void *)(d))[2] = ((UINT8 *)(void *)(s))[5];\
(( UINT8 *)(void *)(d))[3] = ((UINT8 *)(void *)(s))[4];\
(( UINT8 *)(void *)(d))[4] = ((UINT8 *)(void *)(s))[3];\
(( UINT8 *)(void *)(d))[5] = ((UINT8 *)(void *)(s))[2];\
(( UINT8 *)(void *)(d))[6] = ((UINT8 *)(void *)(s))[1];\
(( UINT8 *)(void *)(d))[7] = ((UINT8 *)(void *)(s))[0];}
#else
/*
* Macros for little-endian machines
*/
#ifndef ACPI_MISALIGNMENT_NOT_SUPPORTED
/* The hardware supports unaligned transfers, just do the little-endian move */
/* 16-bit source, 16/32/64 destination */
#define ACPI_MOVE_16_TO_16(d, s) *(UINT16 *)(void *)(d) = *(UINT16 *)(void *)(s)
#define ACPI_MOVE_16_TO_32(d, s) *(UINT32 *)(void *)(d) = *(UINT16 *)(void *)(s)
#define ACPI_MOVE_16_TO_64(d, s) *(UINT64 *)(void *)(d) = *(UINT16 *)(void *)(s)
/* 32-bit source, 16/32/64 destination */
#define ACPI_MOVE_32_TO_16(d, s) ACPI_MOVE_16_TO_16(d, s) /* Truncate to 16 */
#define ACPI_MOVE_32_TO_32(d, s) *(UINT32 *)(void *)(d) = *(UINT32 *)(void *)(s)
#define ACPI_MOVE_32_TO_64(d, s) *(UINT64 *)(void *)(d) = *(UINT32 *)(void *)(s)
/* 64-bit source, 16/32/64 destination */
#define ACPI_MOVE_64_TO_16(d, s) ACPI_MOVE_16_TO_16(d, s) /* Truncate to 16 */
#define ACPI_MOVE_64_TO_32(d, s) ACPI_MOVE_32_TO_32(d, s) /* Truncate to 32 */
#define ACPI_MOVE_64_TO_64(d, s) *(UINT64 *)(void *)(d) = *(UINT64 *)(void *)(s)
#else
/*
* The hardware does not support unaligned transfers. We must move the
* data one byte at a time. These macros work whether the source or
* the destination (or both) is/are unaligned. (Little-endian move)
*/
/* 16-bit source, 16/32/64 destination */
#define ACPI_MOVE_16_TO_16(d, s) {(( UINT8 *)(void *)(d))[0] = ((UINT8 *)(void *)(s))[0];\
(( UINT8 *)(void *)(d))[1] = ((UINT8 *)(void *)(s))[1];}
#define ACPI_MOVE_16_TO_32(d, s) {(*(UINT32 *)(void *)(d)) = 0; ACPI_MOVE_16_TO_16(d, s);}
#define ACPI_MOVE_16_TO_64(d, s) {(*(UINT64 *)(void *)(d)) = 0; ACPI_MOVE_16_TO_16(d, s);}
/* 32-bit source, 16/32/64 destination */
#define ACPI_MOVE_32_TO_16(d, s) ACPI_MOVE_16_TO_16(d, s) /* Truncate to 16 */
#define ACPI_MOVE_32_TO_32(d, s) {(( UINT8 *)(void *)(d))[0] = ((UINT8 *)(void *)(s))[0];\
(( UINT8 *)(void *)(d))[1] = ((UINT8 *)(void *)(s))[1];\
(( UINT8 *)(void *)(d))[2] = ((UINT8 *)(void *)(s))[2];\
(( UINT8 *)(void *)(d))[3] = ((UINT8 *)(void *)(s))[3];}
#define ACPI_MOVE_32_TO_64(d, s) {(*(UINT64 *)(void *)(d)) = 0; ACPI_MOVE_32_TO_32(d, s);}
/* 64-bit source, 16/32/64 destination */
#define ACPI_MOVE_64_TO_16(d, s) ACPI_MOVE_16_TO_16(d, s) /* Truncate to 16 */
#define ACPI_MOVE_64_TO_32(d, s) ACPI_MOVE_32_TO_32(d, s) /* Truncate to 32 */
#define ACPI_MOVE_64_TO_64(d, s) {(( UINT8 *)(void *)(d))[0] = ((UINT8 *)(void *)(s))[0];\
(( UINT8 *)(void *)(d))[1] = ((UINT8 *)(void *)(s))[1];\
(( UINT8 *)(void *)(d))[2] = ((UINT8 *)(void *)(s))[2];\
(( UINT8 *)(void *)(d))[3] = ((UINT8 *)(void *)(s))[3];\
(( UINT8 *)(void *)(d))[4] = ((UINT8 *)(void *)(s))[4];\
(( UINT8 *)(void *)(d))[5] = ((UINT8 *)(void *)(s))[5];\
(( UINT8 *)(void *)(d))[6] = ((UINT8 *)(void *)(s))[6];\
(( UINT8 *)(void *)(d))[7] = ((UINT8 *)(void *)(s))[7];}
#endif
#endif
/*
* Fast power-of-two math macros for non-optimized compilers
*/
#define _ACPI_DIV(value, PowerOf2) ((UINT32) ((value) >> (PowerOf2)))
#define _ACPI_MUL(value, PowerOf2) ((UINT32) ((value) << (PowerOf2)))
#define _ACPI_MOD(value, Divisor) ((UINT32) ((value) & ((Divisor) -1)))
#define ACPI_DIV_2(a) _ACPI_DIV(a, 1)
#define ACPI_MUL_2(a) _ACPI_MUL(a, 1)
#define ACPI_MOD_2(a) _ACPI_MOD(a, 2)
#define ACPI_DIV_4(a) _ACPI_DIV(a, 2)
#define ACPI_MUL_4(a) _ACPI_MUL(a, 2)
#define ACPI_MOD_4(a) _ACPI_MOD(a, 4)
#define ACPI_DIV_8(a) _ACPI_DIV(a, 3)
#define ACPI_MUL_8(a) _ACPI_MUL(a, 3)
#define ACPI_MOD_8(a) _ACPI_MOD(a, 8)
#define ACPI_DIV_16(a) _ACPI_DIV(a, 4)
#define ACPI_MUL_16(a) _ACPI_MUL(a, 4)
#define ACPI_MOD_16(a) _ACPI_MOD(a, 16)
#define ACPI_DIV_32(a) _ACPI_DIV(a, 5)
#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)
*/
#define ACPI_ROUND_DOWN(value, boundary) (((ACPI_SIZE)(value)) & \
(~(((ACPI_SIZE) boundary)-1)))
#define ACPI_ROUND_UP(value, boundary) ((((ACPI_SIZE)(value)) + \
(((ACPI_SIZE) boundary)-1)) & \
(~(((ACPI_SIZE) boundary)-1)))
/* Note: sizeof(ACPI_SIZE) evaluates to either 4 or 8 (32- vs 64-bit mode) */
#define ACPI_ROUND_DOWN_TO_32BIT(a) ACPI_ROUND_DOWN(a, 4)
#define ACPI_ROUND_DOWN_TO_64BIT(a) ACPI_ROUND_DOWN(a, 8)
#define ACPI_ROUND_DOWN_TO_NATIVE_WORD(a) ACPI_ROUND_DOWN(a, sizeof(ACPI_SIZE))
#define ACPI_ROUND_UP_TO_32BIT(a) ACPI_ROUND_UP(a, 4)
#define ACPI_ROUND_UP_TO_64BIT(a) ACPI_ROUND_UP(a, 8)
#define ACPI_ROUND_UP_TO_NATIVE_WORD(a) ACPI_ROUND_UP(a, sizeof(ACPI_SIZE))
#define ACPI_ROUND_BITS_UP_TO_BYTES(a) ACPI_DIV_8((a) + 7)
#define ACPI_ROUND_BITS_DOWN_TO_BYTES(a) ACPI_DIV_8((a))
#define ACPI_ROUND_UP_TO_1K(a) (((a) + 1023) >> 10)
/* Generic (non-power-of-two) rounding */
#define ACPI_ROUND_UP_TO(value, boundary) (((value) + ((boundary)-1)) / (boundary))
#define ACPI_IS_MISALIGNED(value) (((ACPI_SIZE) value) & (sizeof(ACPI_SIZE)-1))
/* Generic bit manipulation */
#ifndef ACPI_USE_NATIVE_BIT_FINDER
#define __ACPI_FIND_LAST_BIT_2(a, r) ((((UINT8) (a)) & 0x02) ? (r)+1 : (r))
#define __ACPI_FIND_LAST_BIT_4(a, r) ((((UINT8) (a)) & 0x0C) ? \
__ACPI_FIND_LAST_BIT_2 ((a)>>2, (r)+2) : \
__ACPI_FIND_LAST_BIT_2 ((a), (r)))
#define __ACPI_FIND_LAST_BIT_8(a, r) ((((UINT8) (a)) & 0xF0) ? \
__ACPI_FIND_LAST_BIT_4 ((a)>>4, (r)+4) : \
__ACPI_FIND_LAST_BIT_4 ((a), (r)))
#define __ACPI_FIND_LAST_BIT_16(a, r) ((((UINT16) (a)) & 0xFF00) ? \
__ACPI_FIND_LAST_BIT_8 ((a)>>8, (r)+8) : \
__ACPI_FIND_LAST_BIT_8 ((a), (r)))
#define __ACPI_FIND_LAST_BIT_32(a, r) ((((UINT32) (a)) & 0xFFFF0000) ? \
__ACPI_FIND_LAST_BIT_16 ((a)>>16, (r)+16) : \
__ACPI_FIND_LAST_BIT_16 ((a), (r)))
#define __ACPI_FIND_LAST_BIT_64(a, r) ((((UINT64) (a)) & 0xFFFFFFFF00000000) ? \
__ACPI_FIND_LAST_BIT_32 ((a)>>32, (r)+32) : \
__ACPI_FIND_LAST_BIT_32 ((a), (r)))
#define ACPI_FIND_LAST_BIT_8(a) ((a) ? __ACPI_FIND_LAST_BIT_8 (a, 1) : 0)
#define ACPI_FIND_LAST_BIT_16(a) ((a) ? __ACPI_FIND_LAST_BIT_16 (a, 1) : 0)
#define ACPI_FIND_LAST_BIT_32(a) ((a) ? __ACPI_FIND_LAST_BIT_32 (a, 1) : 0)
#define ACPI_FIND_LAST_BIT_64(a) ((a) ? __ACPI_FIND_LAST_BIT_64 (a, 1) : 0)
#define __ACPI_FIND_FIRST_BIT_2(a, r) ((((UINT8) (a)) & 0x01) ? (r) : (r)+1)
#define __ACPI_FIND_FIRST_BIT_4(a, r) ((((UINT8) (a)) & 0x03) ? \
__ACPI_FIND_FIRST_BIT_2 ((a), (r)) : \
__ACPI_FIND_FIRST_BIT_2 ((a)>>2, (r)+2))
#define __ACPI_FIND_FIRST_BIT_8(a, r) ((((UINT8) (a)) & 0x0F) ? \
__ACPI_FIND_FIRST_BIT_4 ((a), (r)) : \
__ACPI_FIND_FIRST_BIT_4 ((a)>>4, (r)+4))
#define __ACPI_FIND_FIRST_BIT_16(a, r) ((((UINT16) (a)) & 0x00FF) ? \
__ACPI_FIND_FIRST_BIT_8 ((a), (r)) : \
__ACPI_FIND_FIRST_BIT_8 ((a)>>8, (r)+8))
#define __ACPI_FIND_FIRST_BIT_32(a, r) ((((UINT32) (a)) & 0x0000FFFF) ? \
__ACPI_FIND_FIRST_BIT_16 ((a), (r)) : \
__ACPI_FIND_FIRST_BIT_16 ((a)>>16, (r)+16))
#define __ACPI_FIND_FIRST_BIT_64(a, r) ((((UINT64) (a)) & 0x00000000FFFFFFFF) ? \
__ACPI_FIND_FIRST_BIT_32 ((a), (r)) : \
__ACPI_FIND_FIRST_BIT_32 ((a)>>32, (r)+32))
#define ACPI_FIND_FIRST_BIT_8(a) ((a) ? __ACPI_FIND_FIRST_BIT_8 (a, 1) : 0)
#define ACPI_FIND_FIRST_BIT_16(a) ((a) ? __ACPI_FIND_FIRST_BIT_16 (a, 1) : 0)
#define ACPI_FIND_FIRST_BIT_32(a) ((a) ? __ACPI_FIND_FIRST_BIT_32 (a, 1) : 0)
#define ACPI_FIND_FIRST_BIT_64(a) ((a) ? __ACPI_FIND_FIRST_BIT_64 (a, 1) : 0)
#endif /* ACPI_USE_NATIVE_BIT_FINDER */
/* Generic (power-of-two) rounding */
#define ACPI_ROUND_UP_POWER_OF_TWO_8(a) ((UINT8) \
(((UINT16) 1) << ACPI_FIND_LAST_BIT_8 ((a) - 1)))
#define ACPI_ROUND_DOWN_POWER_OF_TWO_8(a) ((UINT8) \
(((UINT16) 1) << (ACPI_FIND_LAST_BIT_8 ((a)) - 1)))
#define ACPI_ROUND_UP_POWER_OF_TWO_16(a) ((UINT16) \
(((UINT32) 1) << ACPI_FIND_LAST_BIT_16 ((a) - 1)))
#define ACPI_ROUND_DOWN_POWER_OF_TWO_16(a) ((UINT16) \
(((UINT32) 1) << (ACPI_FIND_LAST_BIT_16 ((a)) - 1)))
#define ACPI_ROUND_UP_POWER_OF_TWO_32(a) ((UINT32) \
(((UINT64) 1) << ACPI_FIND_LAST_BIT_32 ((a) - 1)))
#define ACPI_ROUND_DOWN_POWER_OF_TWO_32(a) ((UINT32) \
(((UINT64) 1) << (ACPI_FIND_LAST_BIT_32 ((a)) - 1)))
#define ACPI_IS_ALIGNED(a, s) (((a) & ((s) - 1)) == 0)
#define ACPI_IS_POWER_OF_TWO(a) ACPI_IS_ALIGNED(a, a)
/*
* Bitmask creation
* Bit positions start at zero.
* MASK_BITS_ABOVE creates a mask starting AT the position and above
* MASK_BITS_BELOW creates a mask starting one bit BELOW the position
* MASK_BITS_ABOVE/BELOW accepts a bit offset to create a mask
* MASK_BITS_ABOVE/BELOW_32/64 accepts a bit width to create a mask
* Note: The ACPI_INTEGER_BIT_SIZE check is used to bypass compiler
* differences with the shift operator
*/
#define ACPI_MASK_BITS_ABOVE(position) (~((ACPI_UINT64_MAX) << ((UINT32) (position))))
#define ACPI_MASK_BITS_BELOW(position) ((ACPI_UINT64_MAX) << ((UINT32) (position)))
#define ACPI_MASK_BITS_ABOVE_32(width) ((UINT32) ACPI_MASK_BITS_ABOVE(width))
#define ACPI_MASK_BITS_BELOW_32(width) ((UINT32) ACPI_MASK_BITS_BELOW(width))
#define ACPI_MASK_BITS_ABOVE_64(width) ((width) == ACPI_INTEGER_BIT_SIZE ? \
ACPI_UINT64_MAX : \
ACPI_MASK_BITS_ABOVE(width))
#define ACPI_MASK_BITS_BELOW_64(width) ((width) == ACPI_INTEGER_BIT_SIZE ? \
(UINT64) 0 : \
ACPI_MASK_BITS_BELOW(width))
/* Bitfields within ACPI registers */
#define ACPI_REGISTER_PREPARE_BITS(Val, Pos, Mask) \
((Val << Pos) & Mask)
#define ACPI_REGISTER_INSERT_VALUE(Reg, Pos, Mask, Val) \
Reg = (Reg & (~(Mask))) | ACPI_REGISTER_PREPARE_BITS(Val, Pos, Mask)
#define ACPI_INSERT_BITS(Target, Mask, Source) \
Target = ((Target & (~(Mask))) | (Source & Mask))
/* Generic bitfield macros and masks */
#define ACPI_GET_BITS(SourcePtr, Position, Mask) \
((*(SourcePtr) >> (Position)) & (Mask))
#define ACPI_SET_BITS(TargetPtr, Position, Mask, Value) \
(*(TargetPtr) |= (((Value) & (Mask)) << (Position)))
#define ACPI_1BIT_MASK 0x00000001
#define ACPI_2BIT_MASK 0x00000003
#define ACPI_3BIT_MASK 0x00000007
#define ACPI_4BIT_MASK 0x0000000F
#define ACPI_5BIT_MASK 0x0000001F
#define ACPI_6BIT_MASK 0x0000003F
#define ACPI_7BIT_MASK 0x0000007F
#define ACPI_8BIT_MASK 0x000000FF
#define ACPI_16BIT_MASK 0x0000FFFF
#define ACPI_24BIT_MASK 0x00FFFFFF
/* Macros to extract flag bits from position zero */
#define ACPI_GET_1BIT_FLAG(Value) ((Value) & ACPI_1BIT_MASK)
#define ACPI_GET_2BIT_FLAG(Value) ((Value) & ACPI_2BIT_MASK)
#define ACPI_GET_3BIT_FLAG(Value) ((Value) & ACPI_3BIT_MASK)
#define ACPI_GET_4BIT_FLAG(Value) ((Value) & ACPI_4BIT_MASK)
/* Macros to extract flag bits from position one and above */
#define ACPI_EXTRACT_1BIT_FLAG(Field, Position) (ACPI_GET_1BIT_FLAG ((Field) >> Position))
#define ACPI_EXTRACT_2BIT_FLAG(Field, Position) (ACPI_GET_2BIT_FLAG ((Field) >> Position))
#define ACPI_EXTRACT_3BIT_FLAG(Field, Position) (ACPI_GET_3BIT_FLAG ((Field) >> Position))
#define ACPI_EXTRACT_4BIT_FLAG(Field, Position) (ACPI_GET_4BIT_FLAG ((Field) >> Position))
/* ACPI Pathname helpers */
#define ACPI_IS_ROOT_PREFIX(c) ((c) == (UINT8) 0x5C) /* Backslash */
#define ACPI_IS_PARENT_PREFIX(c) ((c) == (UINT8) 0x5E) /* Carat */
#define ACPI_IS_PATH_SEPARATOR(c) ((c) == (UINT8) 0x2E) /* Period (dot) */
/*
* An object of type ACPI_NAMESPACE_NODE can appear in some contexts
* where a pointer to an object of type ACPI_OPERAND_OBJECT can also
* appear. This macro is used to distinguish them.
*
* The "DescriptorType" field is the second field in both structures.
*/
#define ACPI_GET_DESCRIPTOR_PTR(d) (((ACPI_DESCRIPTOR *)(void *)(d))->Common.CommonPointer)
#define ACPI_SET_DESCRIPTOR_PTR(d, p) (((ACPI_DESCRIPTOR *)(void *)(d))->Common.CommonPointer = (p))
#define ACPI_GET_DESCRIPTOR_TYPE(d) (((ACPI_DESCRIPTOR *)(void *)(d))->Common.DescriptorType)
#define ACPI_SET_DESCRIPTOR_TYPE(d, t) (((ACPI_DESCRIPTOR *)(void *)(d))->Common.DescriptorType = (t))
/*
* Macros for the master AML opcode table
*/
#if defined (ACPI_DISASSEMBLER) || defined (ACPI_DEBUG_OUTPUT)
#define ACPI_OP(Name, PArgs, IArgs, ObjType, Class, Type, Flags) \
{Name, (UINT32)(PArgs), (UINT32)(IArgs), (UINT32)(Flags), ObjType, Class, Type}
#else
#define ACPI_OP(Name, PArgs, IArgs, ObjType, Class, Type, Flags) \
{(UINT32)(PArgs), (UINT32)(IArgs), (UINT32)(Flags), ObjType, Class, Type}
#endif
#define ARG_TYPE_WIDTH 5
#define ARG_1(x) ((UINT32)(x))
#define ARG_2(x) ((UINT32)(x) << (1 * ARG_TYPE_WIDTH))
#define ARG_3(x) ((UINT32)(x) << (2 * ARG_TYPE_WIDTH))
#define ARG_4(x) ((UINT32)(x) << (3 * ARG_TYPE_WIDTH))
#define ARG_5(x) ((UINT32)(x) << (4 * ARG_TYPE_WIDTH))
#define ARG_6(x) ((UINT32)(x) << (5 * ARG_TYPE_WIDTH))
#define ARGI_LIST1(a) (ARG_1(a))
#define ARGI_LIST2(a, b) (ARG_1(b)|ARG_2(a))
#define ARGI_LIST3(a, b, c) (ARG_1(c)|ARG_2(b)|ARG_3(a))
#define ARGI_LIST4(a, b, c, d) (ARG_1(d)|ARG_2(c)|ARG_3(b)|ARG_4(a))
#define ARGI_LIST5(a, b, c, d, e) (ARG_1(e)|ARG_2(d)|ARG_3(c)|ARG_4(b)|ARG_5(a))
#define ARGI_LIST6(a, b, c, d, e, f) (ARG_1(f)|ARG_2(e)|ARG_3(d)|ARG_4(c)|ARG_5(b)|ARG_6(a))
#define ARGP_LIST1(a) (ARG_1(a))
#define ARGP_LIST2(a, b) (ARG_1(a)|ARG_2(b))
#define ARGP_LIST3(a, b, c) (ARG_1(a)|ARG_2(b)|ARG_3(c))
#define ARGP_LIST4(a, b, c, d) (ARG_1(a)|ARG_2(b)|ARG_3(c)|ARG_4(d))
#define ARGP_LIST5(a, b, c, d, e) (ARG_1(a)|ARG_2(b)|ARG_3(c)|ARG_4(d)|ARG_5(e))
#define ARGP_LIST6(a, b, c, d, e, f) (ARG_1(a)|ARG_2(b)|ARG_3(c)|ARG_4(d)|ARG_5(e)|ARG_6(f))
#define GET_CURRENT_ARG_TYPE(List) (List & ((UINT32) 0x1F))
#define INCREMENT_ARG_LIST(List) (List >>= ((UINT32) ARG_TYPE_WIDTH))
/*
* Ascii error messages can be configured out
*/
#ifndef ACPI_NO_ERROR_MESSAGES
/*
* Error reporting. The callers module and line number are inserted by AE_INFO,
* the plist contains a set of parens to allow variable-length lists.
* These macros are used for both the debug and non-debug versions of the code.
*/
#define ACPI_ERROR_NAMESPACE(s, p, e) AcpiUtPrefixedNamespaceError (AE_INFO, s, p, e);
#define ACPI_ERROR_METHOD(s, n, p, e) AcpiUtMethodError (AE_INFO, s, n, p, e);
#define ACPI_WARN_PREDEFINED(plist) AcpiUtPredefinedWarning plist
#define ACPI_INFO_PREDEFINED(plist) AcpiUtPredefinedInfo plist
#define ACPI_BIOS_ERROR_PREDEFINED(plist) AcpiUtPredefinedBiosError plist
#define ACPI_ERROR_ONLY(s) s
#else
/* No error messages */
#define ACPI_ERROR_NAMESPACE(s, p, e)
#define ACPI_ERROR_METHOD(s, n, p, e)
#define ACPI_WARN_PREDEFINED(plist)
#define ACPI_INFO_PREDEFINED(plist)
#define ACPI_BIOS_ERROR_PREDEFINED(plist)
#define ACPI_ERROR_ONLY(s)
#endif /* ACPI_NO_ERROR_MESSAGES */
#if (!ACPI_REDUCED_HARDWARE)
#define ACPI_HW_OPTIONAL_FUNCTION(addr) addr
#else
#define ACPI_HW_OPTIONAL_FUNCTION(addr) NULL
#endif
/*
* Macros used for ACPICA utilities only
*/
/* Generate a UUID */
#define ACPI_INIT_UUID(a, b, c, d0, d1, d2, d3, d4, d5, d6, d7) \
(a) & 0xFF, ((a) >> 8) & 0xFF, ((a) >> 16) & 0xFF, ((a) >> 24) & 0xFF, \
(b) & 0xFF, ((b) >> 8) & 0xFF, \
(c) & 0xFF, ((c) >> 8) & 0xFF, \
(d0), (d1), (d2), (d3), (d4), (d5), (d6), (d7)
#define ACPI_IS_OCTAL_DIGIT(d) (((char)(d) >= '0') && ((char)(d) <= '7'))
/*
* Macros used for the ASL-/ASL+ converter utility
*/
#ifdef ACPI_ASL_COMPILER
#define ASL_CV_LABEL_FILENODE(a) CvLabelFileNode(a);
#define ASL_CV_CAPTURE_COMMENTS_ONLY(a) CvCaptureCommentsOnly (a);
#define ASL_CV_CAPTURE_COMMENTS(a) CvCaptureComments (a);
#define ASL_CV_TRANSFER_COMMENTS(a) CvTransferComments (a);
#define ASL_CV_CLOSE_PAREN(a,b) CvCloseParenWriteComment(a,b);
#define ASL_CV_CLOSE_BRACE(a,b) CvCloseBraceWriteComment(a,b);
#define ASL_CV_SWITCH_FILES(a,b) CvSwitchFiles(a,b);
#define ASL_CV_CLEAR_OP_COMMENTS(a) CvClearOpComments(a);
#define ASL_CV_PRINT_ONE_COMMENT(a,b,c,d) CvPrintOneCommentType (a,b,c,d);
#define ASL_CV_PRINT_ONE_COMMENT_LIST(a,b) CvPrintOneCommentList (a,b);
#define ASL_CV_FILE_HAS_SWITCHED(a) CvFileHasSwitched(a)
#define ASL_CV_INIT_FILETREE(a,b,c) CvInitFileTree(a,b,c);
#else
#define ASL_CV_LABEL_FILENODE(a)
#define ASL_CV_CAPTURE_COMMENTS_ONLY(a)
#define ASL_CV_CAPTURE_COMMENTS(a)
#define ASL_CV_TRANSFER_COMMENTS(a)
#define ASL_CV_CLOSE_PAREN(a,b) AcpiOsPrintf (")");
#define ASL_CV_CLOSE_BRACE(a,b) AcpiOsPrintf ("}");
#define ASL_CV_SWITCH_FILES(a,b)
#define ASL_CV_CLEAR_OP_COMMENTS(a)
#define ASL_CV_PRINT_ONE_COMMENT(a,b,c,d)
#define ASL_CV_PRINT_ONE_COMMENT_LIST(a,b)
#define ASL_CV_FILE_HAS_SWITCHED(a) 0
#define ASL_CV_INIT_FILETREE(a,b,c)
#endif
#endif /* ACMACROS_H */
-204
View File
@@ -1,204 +0,0 @@
/******************************************************************************
*
* Name: acnames.h - Global names and strings
*
*****************************************************************************/
/******************************************************************************
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2019, 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.
*
*****************************************************************************
*
* Alternatively, you may choose to be licensed under the terms of the
* following license:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Alternatively, you may choose to be licensed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
*****************************************************************************/
#ifndef __ACNAMES_H__
#define __ACNAMES_H__
/* Method names - these methods can appear anywhere in the namespace */
#define METHOD_NAME__ADR "_ADR"
#define METHOD_NAME__AEI "_AEI"
#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__DMA "_DMA"
#define METHOD_NAME__HID "_HID"
#define METHOD_NAME__INI "_INI"
#define METHOD_NAME__PLD "_PLD"
#define METHOD_NAME__DSD "_DSD"
#define METHOD_NAME__PRS "_PRS"
#define METHOD_NAME__PRT "_PRT"
#define METHOD_NAME__PRW "_PRW"
#define METHOD_NAME__PS0 "_PS0"
#define METHOD_NAME__PS1 "_PS1"
#define METHOD_NAME__PS2 "_PS2"
#define METHOD_NAME__PS3 "_PS3"
#define METHOD_NAME__REG "_REG"
#define METHOD_NAME__SB_ "_SB_"
#define METHOD_NAME__SEG "_SEG"
#define METHOD_NAME__SRS "_SRS"
#define METHOD_NAME__STA "_STA"
#define METHOD_NAME__SUB "_SUB"
#define METHOD_NAME__UID "_UID"
/* Method names - these methods must appear at the namespace root */
#define METHOD_PATHNAME__PTS "\\_PTS"
#define METHOD_PATHNAME__SST "\\_SI._SST"
#define METHOD_PATHNAME__WAK "\\_WAK"
/* Definitions of the predefined namespace names */
#define ACPI_UNKNOWN_NAME (UINT32) 0x3F3F3F3F /* Unknown name is "????" */
#define ACPI_PREFIX_MIXED (UINT32) 0x69706341 /* "Acpi" */
#define ACPI_PREFIX_LOWER (UINT32) 0x69706361 /* "acpi" */
/* Root name stuff */
#define ACPI_ROOT_NAME (UINT32) 0x5F5F5F5C /* Root name is "\___" */
#define ACPI_ROOT_PATHNAME "\\___"
#define ACPI_NAMESPACE_ROOT "Namespace Root"
#define ACPI_NS_ROOT_PATH "\\"
#endif /* __ACNAMES_H__ */
-689
View File
@@ -1,689 +0,0 @@
/******************************************************************************
*
* Name: acnamesp.h - Namespace subcomponent prototypes and defines
*
*****************************************************************************/
/******************************************************************************
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2019, 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.
*
*****************************************************************************
*
* Alternatively, you may choose to be licensed under the terms of the
* following license:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Alternatively, you may choose to be licensed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
*****************************************************************************/
#ifndef __ACNAMESP_H__
#define __ACNAMESP_H__
/* To search the entire name space, pass this as SearchBase */
#define ACPI_NS_ALL ((ACPI_HANDLE)0)
/*
* Elements of AcpiNsProperties are bit significant
* and should be one-to-one with values of ACPI_OBJECT_TYPE
*/
#define ACPI_NS_NORMAL 0
#define ACPI_NS_NEWSCOPE 1 /* a definition of this type opens a name scope */
#define ACPI_NS_LOCAL 2 /* suppress search of enclosing scopes */
/* Flags for AcpiNsLookup, AcpiNsSearchAndEnter */
#define ACPI_NS_NO_UPSEARCH 0
#define ACPI_NS_SEARCH_PARENT 0x0001
#define ACPI_NS_DONT_OPEN_SCOPE 0x0002
#define ACPI_NS_NO_PEER_SEARCH 0x0004
#define ACPI_NS_ERROR_IF_FOUND 0x0008
#define ACPI_NS_PREFIX_IS_SCOPE 0x0010
#define ACPI_NS_EXTERNAL 0x0020
#define ACPI_NS_TEMPORARY 0x0040
#define ACPI_NS_OVERRIDE_IF_FOUND 0x0080
#define ACPI_NS_EARLY_INIT 0x0100
#define ACPI_NS_PREFIX_MUST_EXIST 0x0200
/* Flags for AcpiNsWalkNamespace */
#define ACPI_NS_WALK_NO_UNLOCK 0
#define ACPI_NS_WALK_UNLOCK 0x01
#define ACPI_NS_WALK_TEMP_NODES 0x02
/* Object is not a package element */
#define ACPI_NOT_PACKAGE_ELEMENT ACPI_UINT32_MAX
#define ACPI_ALL_PACKAGE_ELEMENTS (ACPI_UINT32_MAX-1)
/* Always emit warning message, not dependent on node flags */
#define ACPI_WARN_ALWAYS 0
/*
* nsinit - Namespace initialization
*/
ACPI_STATUS
AcpiNsInitializeObjects (
void);
ACPI_STATUS
AcpiNsInitializeDevices (
UINT32 Flags);
ACPI_STATUS
AcpiNsInitOnePackage (
ACPI_HANDLE ObjHandle,
UINT32 Level,
void *Context,
void **ReturnValue);
/*
* nsload - Namespace loading
*/
ACPI_STATUS
AcpiNsLoadNamespace (
void);
ACPI_STATUS
AcpiNsLoadTable (
UINT32 TableIndex,
ACPI_NAMESPACE_NODE *Node);
/*
* nswalk - walk the namespace
*/
ACPI_STATUS
AcpiNsWalkNamespace (
ACPI_OBJECT_TYPE Type,
ACPI_HANDLE StartObject,
UINT32 MaxDepth,
UINT32 Flags,
ACPI_WALK_CALLBACK DescendingCallback,
ACPI_WALK_CALLBACK AscendingCallback,
void *Context,
void **ReturnValue);
ACPI_NAMESPACE_NODE *
AcpiNsGetNextNode (
ACPI_NAMESPACE_NODE *Parent,
ACPI_NAMESPACE_NODE *Child);
ACPI_NAMESPACE_NODE *
AcpiNsGetNextNodeTyped (
ACPI_OBJECT_TYPE Type,
ACPI_NAMESPACE_NODE *Parent,
ACPI_NAMESPACE_NODE *Child);
/*
* nsparse - table parsing
*/
ACPI_STATUS
AcpiNsParseTable (
UINT32 TableIndex,
ACPI_NAMESPACE_NODE *StartNode);
ACPI_STATUS
AcpiNsExecuteTable (
UINT32 TableIndex,
ACPI_NAMESPACE_NODE *StartNode);
ACPI_STATUS
AcpiNsOneCompleteParse (
UINT32 PassNumber,
UINT32 TableIndex,
ACPI_NAMESPACE_NODE *StartNode);
/*
* nsaccess - Top-level namespace access
*/
ACPI_STATUS
AcpiNsRootInitialize (
void);
ACPI_STATUS
AcpiNsLookup (
ACPI_GENERIC_STATE *ScopeInfo,
char *Name,
ACPI_OBJECT_TYPE Type,
ACPI_INTERPRETER_MODE InterpreterMode,
UINT32 Flags,
ACPI_WALK_STATE *WalkState,
ACPI_NAMESPACE_NODE **RetNode);
/*
* nsalloc - Named object allocation/deallocation
*/
ACPI_NAMESPACE_NODE *
AcpiNsCreateNode (
UINT32 Name);
void
AcpiNsDeleteNode (
ACPI_NAMESPACE_NODE *Node);
void
AcpiNsRemoveNode (
ACPI_NAMESPACE_NODE *Node);
void
AcpiNsDeleteNamespaceSubtree (
ACPI_NAMESPACE_NODE *ParentHandle);
void
AcpiNsDeleteNamespaceByOwner (
ACPI_OWNER_ID OwnerId);
void
AcpiNsDetachObject (
ACPI_NAMESPACE_NODE *Node);
void
AcpiNsDeleteChildren (
ACPI_NAMESPACE_NODE *Parent);
int
AcpiNsCompareNames (
char *Name1,
char *Name2);
/*
* nsconvert - Dynamic object conversion routines
*/
ACPI_STATUS
AcpiNsConvertToInteger (
ACPI_OPERAND_OBJECT *OriginalObject,
ACPI_OPERAND_OBJECT **ReturnObject);
ACPI_STATUS
AcpiNsConvertToString (
ACPI_OPERAND_OBJECT *OriginalObject,
ACPI_OPERAND_OBJECT **ReturnObject);
ACPI_STATUS
AcpiNsConvertToBuffer (
ACPI_OPERAND_OBJECT *OriginalObject,
ACPI_OPERAND_OBJECT **ReturnObject);
ACPI_STATUS
AcpiNsConvertToUnicode (
ACPI_NAMESPACE_NODE *Scope,
ACPI_OPERAND_OBJECT *OriginalObject,
ACPI_OPERAND_OBJECT **ReturnObject);
ACPI_STATUS
AcpiNsConvertToResource (
ACPI_NAMESPACE_NODE *Scope,
ACPI_OPERAND_OBJECT *OriginalObject,
ACPI_OPERAND_OBJECT **ReturnObject);
ACPI_STATUS
AcpiNsConvertToReference (
ACPI_NAMESPACE_NODE *Scope,
ACPI_OPERAND_OBJECT *OriginalObject,
ACPI_OPERAND_OBJECT **ReturnObject);
/*
* nsdump - Namespace dump/print utilities
*/
void
AcpiNsDumpTables (
ACPI_HANDLE SearchBase,
UINT32 MaxDepth);
void
AcpiNsDumpEntry (
ACPI_HANDLE Handle,
UINT32 DebugLevel);
void
AcpiNsDumpPathname (
ACPI_HANDLE Handle,
const char *Msg,
UINT32 Level,
UINT32 Component);
void
AcpiNsPrintPathname (
UINT32 NumSegments,
const char *Pathname);
ACPI_STATUS
AcpiNsDumpOneObject (
ACPI_HANDLE ObjHandle,
UINT32 Level,
void *Context,
void **ReturnValue);
void
AcpiNsDumpObjects (
ACPI_OBJECT_TYPE Type,
UINT8 DisplayType,
UINT32 MaxDepth,
ACPI_OWNER_ID OwnerId,
ACPI_HANDLE StartHandle);
void
AcpiNsDumpObjectPaths (
ACPI_OBJECT_TYPE Type,
UINT8 DisplayType,
UINT32 MaxDepth,
ACPI_OWNER_ID OwnerId,
ACPI_HANDLE StartHandle);
/*
* nseval - Namespace evaluation functions
*/
ACPI_STATUS
AcpiNsEvaluate (
ACPI_EVALUATE_INFO *Info);
/*
* nsarguments - Argument count/type checking for predefined/reserved names
*/
void
AcpiNsCheckArgumentCount (
char *Pathname,
ACPI_NAMESPACE_NODE *Node,
UINT32 UserParamCount,
const ACPI_PREDEFINED_INFO *Info);
void
AcpiNsCheckAcpiCompliance (
char *Pathname,
ACPI_NAMESPACE_NODE *Node,
const ACPI_PREDEFINED_INFO *Predefined);
void
AcpiNsCheckArgumentTypes (
ACPI_EVALUATE_INFO *Info);
/*
* nspredef - Return value checking for predefined/reserved names
*/
ACPI_STATUS
AcpiNsCheckReturnValue (
ACPI_NAMESPACE_NODE *Node,
ACPI_EVALUATE_INFO *Info,
UINT32 UserParamCount,
ACPI_STATUS ReturnStatus,
ACPI_OPERAND_OBJECT **ReturnObject);
ACPI_STATUS
AcpiNsCheckObjectType (
ACPI_EVALUATE_INFO *Info,
ACPI_OPERAND_OBJECT **ReturnObjectPtr,
UINT32 ExpectedBtypes,
UINT32 PackageIndex);
/*
* nsprepkg - Validation of predefined name packages
*/
ACPI_STATUS
AcpiNsCheckPackage (
ACPI_EVALUATE_INFO *Info,
ACPI_OPERAND_OBJECT **ReturnObjectPtr);
/*
* nsnames - Name and Scope manipulation
*/
UINT32
AcpiNsOpensScope (
ACPI_OBJECT_TYPE Type);
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 *
AcpiNsBuildPrefixedPathname (
ACPI_GENERIC_STATE *PrefixScope,
const char *InternalPath);
char *
AcpiNsNameOfCurrentScope (
ACPI_WALK_STATE *WalkState);
ACPI_STATUS
AcpiNsHandleToName (
ACPI_HANDLE TargetHandle,
ACPI_BUFFER *Buffer);
ACPI_STATUS
AcpiNsHandleToPathname (
ACPI_HANDLE TargetHandle,
ACPI_BUFFER *Buffer,
BOOLEAN NoTrailing);
BOOLEAN
AcpiNsPatternMatch (
ACPI_NAMESPACE_NODE *ObjNode,
char *SearchFor);
ACPI_STATUS
AcpiNsGetNodeUnlocked (
ACPI_NAMESPACE_NODE *PrefixNode,
const char *ExternalPathname,
UINT32 Flags,
ACPI_NAMESPACE_NODE **OutNode);
ACPI_STATUS
AcpiNsGetNode (
ACPI_NAMESPACE_NODE *PrefixNode,
const char *ExternalPathname,
UINT32 Flags,
ACPI_NAMESPACE_NODE **OutNode);
ACPI_SIZE
AcpiNsGetPathnameLength (
ACPI_NAMESPACE_NODE *Node);
/*
* nsobject - Object management for namespace nodes
*/
ACPI_STATUS
AcpiNsAttachObject (
ACPI_NAMESPACE_NODE *Node,
ACPI_OPERAND_OBJECT *Object,
ACPI_OBJECT_TYPE Type);
ACPI_OPERAND_OBJECT *
AcpiNsGetAttachedObject (
ACPI_NAMESPACE_NODE *Node);
ACPI_OPERAND_OBJECT *
AcpiNsGetSecondaryObject (
ACPI_OPERAND_OBJECT *ObjDesc);
ACPI_STATUS
AcpiNsAttachData (
ACPI_NAMESPACE_NODE *Node,
ACPI_OBJECT_HANDLER Handler,
void *Data);
ACPI_STATUS
AcpiNsDetachData (
ACPI_NAMESPACE_NODE *Node,
ACPI_OBJECT_HANDLER Handler);
ACPI_STATUS
AcpiNsGetAttachedData (
ACPI_NAMESPACE_NODE *Node,
ACPI_OBJECT_HANDLER Handler,
void **Data);
/*
* nsrepair - General return object repair for all
* predefined methods/objects
*/
ACPI_STATUS
AcpiNsSimpleRepair (
ACPI_EVALUATE_INFO *Info,
UINT32 ExpectedBtypes,
UINT32 PackageIndex,
ACPI_OPERAND_OBJECT **ReturnObjectPtr);
ACPI_STATUS
AcpiNsWrapWithPackage (
ACPI_EVALUATE_INFO *Info,
ACPI_OPERAND_OBJECT *OriginalObject,
ACPI_OPERAND_OBJECT **ObjDescPtr);
ACPI_STATUS
AcpiNsRepairNullElement (
ACPI_EVALUATE_INFO *Info,
UINT32 ExpectedBtypes,
UINT32 PackageIndex,
ACPI_OPERAND_OBJECT **ReturnObjectPtr);
void
AcpiNsRemoveNullElements (
ACPI_EVALUATE_INFO *Info,
UINT8 PackageType,
ACPI_OPERAND_OBJECT *ObjDesc);
/*
* nsrepair2 - Return object repair for specific
* predefined methods/objects
*/
ACPI_STATUS
AcpiNsComplexRepairs (
ACPI_EVALUATE_INFO *Info,
ACPI_NAMESPACE_NODE *Node,
ACPI_STATUS ValidateStatus,
ACPI_OPERAND_OBJECT **ReturnObjectPtr);
/*
* nssearch - Namespace searching and entry
*/
ACPI_STATUS
AcpiNsSearchAndEnter (
UINT32 EntryName,
ACPI_WALK_STATE *WalkState,
ACPI_NAMESPACE_NODE *Node,
ACPI_INTERPRETER_MODE InterpreterMode,
ACPI_OBJECT_TYPE Type,
UINT32 Flags,
ACPI_NAMESPACE_NODE **RetNode);
ACPI_STATUS
AcpiNsSearchOneScope (
UINT32 EntryName,
ACPI_NAMESPACE_NODE *Node,
ACPI_OBJECT_TYPE Type,
ACPI_NAMESPACE_NODE **RetNode);
void
AcpiNsInstallNode (
ACPI_WALK_STATE *WalkState,
ACPI_NAMESPACE_NODE *ParentNode,
ACPI_NAMESPACE_NODE *Node,
ACPI_OBJECT_TYPE Type);
/*
* nsutils - Utility functions
*/
ACPI_OBJECT_TYPE
AcpiNsGetType (
ACPI_NAMESPACE_NODE *Node);
UINT32
AcpiNsLocal (
ACPI_OBJECT_TYPE Type);
void
AcpiNsPrintNodePathname (
ACPI_NAMESPACE_NODE *Node,
const char *Msg);
ACPI_STATUS
AcpiNsBuildInternalName (
ACPI_NAMESTRING_INFO *Info);
void
AcpiNsGetInternalNameLength (
ACPI_NAMESTRING_INFO *Info);
ACPI_STATUS
AcpiNsInternalizeName (
const char *DottedName,
char **ConvertedName);
ACPI_STATUS
AcpiNsExternalizeName (
UINT32 InternalNameLength,
const char *InternalName,
UINT32 *ConvertedNameLength,
char **ConvertedName);
ACPI_NAMESPACE_NODE *
AcpiNsValidateHandle (
ACPI_HANDLE Handle);
void
AcpiNsTerminate (
void);
#endif /* __ACNAMESP_H__ */
-704
View File
@@ -1,704 +0,0 @@
/******************************************************************************
*
* Name: acobject.h - Definition of ACPI_OPERAND_OBJECT (Internal object only)
*
*****************************************************************************/
/******************************************************************************
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2019, 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.
*
*****************************************************************************
*
* Alternatively, you may choose to be licensed under the terms of the
* following license:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Alternatively, you may choose to be licensed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
*****************************************************************************/
#ifndef _ACOBJECT_H
#define _ACOBJECT_H
/* acpisrc:StructDefs -- for acpisrc conversion */
/*
* The ACPI_OPERAND_OBJECT is used to pass AML operands from the dispatcher
* to the interpreter, and to keep track of the various handlers such as
* address space handlers and notify handlers. The object is a constant
* size in order to allow it to be cached and reused.
*
* Note: The object is optimized to be aligned and will not work if it is
* byte-packed.
*/
#if ACPI_MACHINE_WIDTH == 64
#pragma pack(8)
#else
#pragma pack(4)
#endif
/*******************************************************************************
*
* Common Descriptors
*
******************************************************************************/
/*
* Common area for all objects.
*
* DescriptorType is used to differentiate between internal descriptors, and
* must be in the same place across all descriptors
*
* Note: The DescriptorType and Type fields must appear in the identical
* position in both the ACPI_NAMESPACE_NODE and ACPI_OPERAND_OBJECT
* structures.
*/
#define ACPI_OBJECT_COMMON_HEADER \
union acpi_operand_object *NextObject; /* Objects linked to parent NS node */\
UINT8 DescriptorType; /* To differentiate various internal objs */\
UINT8 Type; /* ACPI_OBJECT_TYPE */\
UINT16 ReferenceCount; /* For object deletion management */\
UINT8 Flags;
/*
* Note: There are 3 bytes available here before the
* next natural alignment boundary (for both 32/64 cases)
*/
/* Values for Flag byte above */
#define AOPOBJ_AML_CONSTANT 0x01 /* Integer is an AML constant */
#define AOPOBJ_STATIC_POINTER 0x02 /* Data is part of an ACPI table, don't delete */
#define AOPOBJ_DATA_VALID 0x04 /* Object is initialized and data is valid */
#define AOPOBJ_OBJECT_INITIALIZED 0x08 /* Region is initialized */
#define AOPOBJ_REG_CONNECTED 0x10 /* _REG was run */
#define AOPOBJ_SETUP_COMPLETE 0x20 /* Region setup is complete */
#define AOPOBJ_INVALID 0x40 /* Host OS won't allow a Region address */
/******************************************************************************
*
* Basic data types
*
*****************************************************************************/
typedef struct acpi_object_common
{
ACPI_OBJECT_COMMON_HEADER
} ACPI_OBJECT_COMMON;
typedef struct acpi_object_integer
{
ACPI_OBJECT_COMMON_HEADER
UINT8 Fill[3]; /* Prevent warning on some compilers */
UINT64 Value;
} ACPI_OBJECT_INTEGER;
/*
* Note: The String and Buffer object must be identical through the
* pointer and length elements. There is code that depends on this.
*
* Fields common to both Strings and Buffers
*/
#define ACPI_COMMON_BUFFER_INFO(_Type) \
_Type *Pointer; \
UINT32 Length;
/* Null terminated, ASCII characters only */
typedef struct acpi_object_string
{
ACPI_OBJECT_COMMON_HEADER
ACPI_COMMON_BUFFER_INFO (char) /* String in AML stream or allocated string */
} ACPI_OBJECT_STRING;
typedef struct acpi_object_buffer
{
ACPI_OBJECT_COMMON_HEADER
ACPI_COMMON_BUFFER_INFO (UINT8) /* Buffer in AML stream or allocated buffer */
UINT32 AmlLength;
UINT8 *AmlStart;
ACPI_NAMESPACE_NODE *Node; /* Link back to parent node */
} ACPI_OBJECT_BUFFER;
typedef struct acpi_object_package
{
ACPI_OBJECT_COMMON_HEADER
ACPI_NAMESPACE_NODE *Node; /* Link back to parent node */
union acpi_operand_object **Elements; /* Array of pointers to AcpiObjects */
UINT8 *AmlStart;
UINT32 AmlLength;
UINT32 Count; /* # of elements in package */
} ACPI_OBJECT_PACKAGE;
/******************************************************************************
*
* Complex data types
*
*****************************************************************************/
typedef struct acpi_object_event
{
ACPI_OBJECT_COMMON_HEADER
ACPI_SEMAPHORE OsSemaphore; /* Actual OS synchronization object */
} ACPI_OBJECT_EVENT;
typedef struct acpi_object_mutex
{
ACPI_OBJECT_COMMON_HEADER
UINT8 SyncLevel; /* 0-15, specified in Mutex() call */
UINT16 AcquisitionDepth; /* Allow multiple Acquires, same thread */
ACPI_MUTEX OsMutex; /* Actual OS synchronization object */
ACPI_THREAD_ID ThreadId; /* Current owner of the mutex */
struct acpi_thread_state *OwnerThread; /* Current owner of the mutex */
union acpi_operand_object *Prev; /* Link for list of acquired mutexes */
union acpi_operand_object *Next; /* Link for list of acquired mutexes */
ACPI_NAMESPACE_NODE *Node; /* Containing namespace node */
UINT8 OriginalSyncLevel; /* Owner's original sync level (0-15) */
} ACPI_OBJECT_MUTEX;
typedef struct acpi_object_region
{
ACPI_OBJECT_COMMON_HEADER
UINT8 SpaceId;
ACPI_NAMESPACE_NODE *Node; /* Containing namespace node */
union acpi_operand_object *Handler; /* Handler for region access */
union acpi_operand_object *Next;
ACPI_PHYSICAL_ADDRESS Address;
UINT32 Length;
} ACPI_OBJECT_REGION;
typedef struct acpi_object_method
{
ACPI_OBJECT_COMMON_HEADER
UINT8 InfoFlags;
UINT8 ParamCount;
UINT8 SyncLevel;
union acpi_operand_object *Mutex;
union acpi_operand_object *Node;
UINT8 *AmlStart;
union
{
ACPI_INTERNAL_METHOD Implementation;
union acpi_operand_object *Handler;
} Dispatch;
UINT32 AmlLength;
ACPI_OWNER_ID OwnerId;
UINT8 ThreadCount;
} ACPI_OBJECT_METHOD;
/* Flags for InfoFlags field above */
#define ACPI_METHOD_MODULE_LEVEL 0x01 /* Method is actually module-level code */
#define ACPI_METHOD_INTERNAL_ONLY 0x02 /* Method is implemented internally (_OSI) */
#define ACPI_METHOD_SERIALIZED 0x04 /* Method is serialized */
#define ACPI_METHOD_SERIALIZED_PENDING 0x08 /* Method is to be marked serialized */
#define ACPI_METHOD_IGNORE_SYNC_LEVEL 0x10 /* Method was auto-serialized at table load time */
#define ACPI_METHOD_MODIFIED_NAMESPACE 0x20 /* Method modified the namespace */
/******************************************************************************
*
* Objects that can be notified. All share a common NotifyInfo area.
*
*****************************************************************************/
/*
* Common fields for objects that support ASL notifications
*/
#define ACPI_COMMON_NOTIFY_INFO \
union acpi_operand_object *NotifyList[2]; /* Handlers for system/device notifies */\
union acpi_operand_object *Handler; /* Handler for Address space */
/* COMMON NOTIFY for POWER, PROCESSOR, DEVICE, and THERMAL */
typedef struct acpi_object_notify_common
{
ACPI_OBJECT_COMMON_HEADER
ACPI_COMMON_NOTIFY_INFO
} ACPI_OBJECT_NOTIFY_COMMON;
typedef struct acpi_object_device
{
ACPI_OBJECT_COMMON_HEADER
ACPI_COMMON_NOTIFY_INFO
ACPI_GPE_BLOCK_INFO *GpeBlock;
} ACPI_OBJECT_DEVICE;
typedef struct acpi_object_power_resource
{
ACPI_OBJECT_COMMON_HEADER
ACPI_COMMON_NOTIFY_INFO
UINT32 SystemLevel;
UINT32 ResourceOrder;
} ACPI_OBJECT_POWER_RESOURCE;
typedef struct acpi_object_processor
{
ACPI_OBJECT_COMMON_HEADER
/* The next two fields take advantage of the 3-byte space before NOTIFY_INFO */
UINT8 ProcId;
UINT8 Length;
ACPI_COMMON_NOTIFY_INFO
ACPI_IO_ADDRESS Address;
} ACPI_OBJECT_PROCESSOR;
typedef struct acpi_object_thermal_zone
{
ACPI_OBJECT_COMMON_HEADER
ACPI_COMMON_NOTIFY_INFO
} ACPI_OBJECT_THERMAL_ZONE;
/******************************************************************************
*
* Fields. All share a common header/info field.
*
*****************************************************************************/
/*
* Common bitfield for the field objects
* "Field Datum" -- a datum from the actual field object
* "Buffer Datum" -- a datum from a user buffer, read from or to be written to the field
*/
#define ACPI_COMMON_FIELD_INFO \
UINT8 FieldFlags; /* Access, update, and lock bits */\
UINT8 Attribute; /* From AccessAs keyword */\
UINT8 AccessByteWidth; /* Read/Write size in bytes */\
ACPI_NAMESPACE_NODE *Node; /* Link back to parent node */\
UINT32 BitLength; /* Length of field in bits */\
UINT32 BaseByteOffset; /* Byte offset within containing object */\
UINT32 Value; /* Value to store into the Bank or Index register */\
UINT8 StartFieldBitOffset;/* Bit offset within first field datum (0-63) */\
UINT8 AccessLength; /* For serial regions/fields */
/* COMMON FIELD (for BUFFER, REGION, BANK, and INDEX fields) */
typedef struct acpi_object_field_common
{
ACPI_OBJECT_COMMON_HEADER
ACPI_COMMON_FIELD_INFO
union acpi_operand_object *RegionObj; /* Parent Operation Region object (REGION/BANK fields only) */
} ACPI_OBJECT_FIELD_COMMON;
typedef struct acpi_object_region_field
{
ACPI_OBJECT_COMMON_HEADER
ACPI_COMMON_FIELD_INFO
UINT16 ResourceLength;
union acpi_operand_object *RegionObj; /* Containing OpRegion object */
UINT8 *ResourceBuffer; /* ResourceTemplate for serial regions/fields */
UINT16 PinNumberIndex; /* Index relative to previous Connection/Template */
UINT8 *InternalPccBuffer; /* Internal buffer for fields associated with PCC */
} ACPI_OBJECT_REGION_FIELD;
typedef struct acpi_object_bank_field
{
ACPI_OBJECT_COMMON_HEADER
ACPI_COMMON_FIELD_INFO
union acpi_operand_object *RegionObj; /* Containing OpRegion object */
union acpi_operand_object *BankObj; /* BankSelect Register object */
} ACPI_OBJECT_BANK_FIELD;
typedef struct acpi_object_index_field
{
ACPI_OBJECT_COMMON_HEADER
ACPI_COMMON_FIELD_INFO
/*
* No "RegionObj" pointer needed since the Index and Data registers
* are each field definitions unto themselves.
*/
union acpi_operand_object *IndexObj; /* Index register */
union acpi_operand_object *DataObj; /* Data register */
} ACPI_OBJECT_INDEX_FIELD;
/* The BufferField is different in that it is part of a Buffer, not an OpRegion */
typedef struct acpi_object_buffer_field
{
ACPI_OBJECT_COMMON_HEADER
ACPI_COMMON_FIELD_INFO
union acpi_operand_object *BufferObj; /* Containing Buffer object */
} ACPI_OBJECT_BUFFER_FIELD;
/******************************************************************************
*
* Objects for handlers
*
*****************************************************************************/
typedef struct acpi_object_notify_handler
{
ACPI_OBJECT_COMMON_HEADER
ACPI_NAMESPACE_NODE *Node; /* Parent device */
UINT32 HandlerType; /* Type: Device/System/Both */
ACPI_NOTIFY_HANDLER Handler; /* Handler address */
void *Context;
union acpi_operand_object *Next[2]; /* Device and System handler lists */
} ACPI_OBJECT_NOTIFY_HANDLER;
typedef struct acpi_object_addr_handler
{
ACPI_OBJECT_COMMON_HEADER
UINT8 SpaceId;
UINT8 HandlerFlags;
ACPI_ADR_SPACE_HANDLER Handler;
ACPI_NAMESPACE_NODE *Node; /* Parent device */
void *Context;
ACPI_ADR_SPACE_SETUP Setup;
union acpi_operand_object *RegionList; /* Regions using this handler */
union acpi_operand_object *Next;
} ACPI_OBJECT_ADDR_HANDLER;
/* Flags for address handler (HandlerFlags) */
#define ACPI_ADDR_HANDLER_DEFAULT_INSTALLED 0x01
/******************************************************************************
*
* Special internal objects
*
*****************************************************************************/
/*
* The Reference object is used for these opcodes:
* Arg[0-6], Local[0-7], IndexOp, NameOp, RefOfOp, LoadOp, LoadTableOp, DebugOp
* The Reference.Class differentiates these types.
*/
typedef struct acpi_object_reference
{
ACPI_OBJECT_COMMON_HEADER
UINT8 Class; /* Reference Class */
UINT8 TargetType; /* Used for Index Op */
UINT8 Resolved; /* Reference has been resolved to a value */
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 */
UINT8 *Aml; /* Used for deferred resolution of the ref */
UINT32 Value; /* Used for Local/Arg/Index/DdbHandle */
} ACPI_OBJECT_REFERENCE;
/* Values for Reference.Class above */
typedef enum
{
ACPI_REFCLASS_LOCAL = 0, /* Method local */
ACPI_REFCLASS_ARG = 1, /* Method argument */
ACPI_REFCLASS_REFOF = 2, /* Result of RefOf() TBD: Split to Ref/Node and Ref/OperandObj? */
ACPI_REFCLASS_INDEX = 3, /* Result of Index() */
ACPI_REFCLASS_TABLE = 4, /* DdbHandle - Load(), LoadTable() */
ACPI_REFCLASS_NAME = 5, /* Reference to a named object */
ACPI_REFCLASS_DEBUG = 6, /* Debug object */
ACPI_REFCLASS_MAX = 6
} ACPI_REFERENCE_CLASSES;
/*
* Extra object is used as additional storage for types that
* have AML code in their declarations (TermArgs) that must be
* evaluated at run time.
*
* Currently: Region and FieldUnit types
*/
typedef struct acpi_object_extra
{
ACPI_OBJECT_COMMON_HEADER
ACPI_NAMESPACE_NODE *Method_REG; /* _REG method for this region (if any) */
ACPI_NAMESPACE_NODE *ScopeNode;
void *RegionContext; /* Region-specific data */
UINT8 *AmlStart;
UINT32 AmlLength;
} ACPI_OBJECT_EXTRA;
/* Additional data that can be attached to namespace nodes */
typedef struct acpi_object_data
{
ACPI_OBJECT_COMMON_HEADER
ACPI_OBJECT_HANDLER Handler;
void *Pointer;
} ACPI_OBJECT_DATA;
/* Structure used when objects are cached for reuse */
typedef struct acpi_object_cache_list
{
ACPI_OBJECT_COMMON_HEADER
union acpi_operand_object *Next; /* Link for object cache and internal lists*/
} ACPI_OBJECT_CACHE_LIST;
/******************************************************************************
*
* ACPI_OPERAND_OBJECT Descriptor - a giant union of all of the above
*
*****************************************************************************/
typedef union acpi_operand_object
{
ACPI_OBJECT_COMMON Common;
ACPI_OBJECT_INTEGER Integer;
ACPI_OBJECT_STRING String;
ACPI_OBJECT_BUFFER Buffer;
ACPI_OBJECT_PACKAGE Package;
ACPI_OBJECT_EVENT Event;
ACPI_OBJECT_METHOD Method;
ACPI_OBJECT_MUTEX Mutex;
ACPI_OBJECT_REGION Region;
ACPI_OBJECT_NOTIFY_COMMON CommonNotify;
ACPI_OBJECT_DEVICE Device;
ACPI_OBJECT_POWER_RESOURCE PowerResource;
ACPI_OBJECT_PROCESSOR Processor;
ACPI_OBJECT_THERMAL_ZONE ThermalZone;
ACPI_OBJECT_FIELD_COMMON CommonField;
ACPI_OBJECT_REGION_FIELD Field;
ACPI_OBJECT_BUFFER_FIELD BufferField;
ACPI_OBJECT_BANK_FIELD BankField;
ACPI_OBJECT_INDEX_FIELD IndexField;
ACPI_OBJECT_NOTIFY_HANDLER Notify;
ACPI_OBJECT_ADDR_HANDLER AddressSpace;
ACPI_OBJECT_REFERENCE Reference;
ACPI_OBJECT_EXTRA Extra;
ACPI_OBJECT_DATA Data;
ACPI_OBJECT_CACHE_LIST Cache;
/*
* Add namespace node to union in order to simplify code that accepts both
* ACPI_OPERAND_OBJECTs and ACPI_NAMESPACE_NODEs. The structures share
* a common DescriptorType field in order to differentiate them.
*/
ACPI_NAMESPACE_NODE Node;
} ACPI_OPERAND_OBJECT;
/******************************************************************************
*
* ACPI_DESCRIPTOR - objects that share a common descriptor identifier
*
*****************************************************************************/
/* Object descriptor types */
#define ACPI_DESC_TYPE_CACHED 0x01 /* Used only when object is cached */
#define ACPI_DESC_TYPE_STATE 0x02
#define ACPI_DESC_TYPE_STATE_UPDATE 0x03
#define ACPI_DESC_TYPE_STATE_PACKAGE 0x04
#define ACPI_DESC_TYPE_STATE_CONTROL 0x05
#define ACPI_DESC_TYPE_STATE_RPSCOPE 0x06
#define ACPI_DESC_TYPE_STATE_PSCOPE 0x07
#define ACPI_DESC_TYPE_STATE_WSCOPE 0x08
#define ACPI_DESC_TYPE_STATE_RESULT 0x09
#define ACPI_DESC_TYPE_STATE_NOTIFY 0x0A
#define ACPI_DESC_TYPE_STATE_THREAD 0x0B
#define ACPI_DESC_TYPE_WALK 0x0C
#define ACPI_DESC_TYPE_PARSER 0x0D
#define ACPI_DESC_TYPE_OPERAND 0x0E
#define ACPI_DESC_TYPE_NAMED 0x0F
#define ACPI_DESC_TYPE_MAX 0x0F
typedef struct acpi_common_descriptor
{
void *CommonPointer;
UINT8 DescriptorType; /* To differentiate various internal objs */
} ACPI_COMMON_DESCRIPTOR;
typedef union acpi_descriptor
{
ACPI_COMMON_DESCRIPTOR Common;
ACPI_OPERAND_OBJECT Object;
ACPI_NAMESPACE_NODE Node;
ACPI_PARSE_OBJECT Op;
} ACPI_DESCRIPTOR;
#pragma pack()
#endif /* _ACOBJECT_H */
-441
View File
@@ -1,441 +0,0 @@
/******************************************************************************
*
* Name: acopcode.h - AML opcode information for the AML parser and interpreter
*
*****************************************************************************/
/******************************************************************************
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2019, 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.
*
*****************************************************************************
*
* Alternatively, you may choose to be licensed under the terms of the
* following license:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Alternatively, you may choose to be licensed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
*****************************************************************************/
#ifndef __ACOPCODE_H__
#define __ACOPCODE_H__
#define MAX_EXTENDED_OPCODE 0x88
#define NUM_EXTENDED_OPCODE (MAX_EXTENDED_OPCODE + 1)
#define MAX_INTERNAL_OPCODE
#define NUM_INTERNAL_OPCODE (MAX_INTERNAL_OPCODE + 1)
/* Used for non-assigned opcodes */
#define _UNK 0x6B
/*
* Reserved ASCII characters. Do not use any of these for
* internal opcodes, since they are used to differentiate
* name strings from AML opcodes
*/
#define _ASC 0x6C
#define _NAM 0x6C
#define _PFX 0x6D
/*
* All AML opcodes and the parse-time arguments for each. Used by the AML
* parser Each list is compressed into a 32-bit number and stored in the
* master opcode table (in psopcode.c).
*/
#define ARGP_ACCESSFIELD_OP ARGP_LIST1 (ARGP_NAMESTRING)
#define ARGP_ACQUIRE_OP ARGP_LIST2 (ARGP_SUPERNAME, ARGP_WORDDATA)
#define ARGP_ADD_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_TARGET)
#define ARGP_ALIAS_OP ARGP_LIST2 (ARGP_NAMESTRING, ARGP_NAME)
#define ARGP_ARG0 ARG_NONE
#define ARGP_ARG1 ARG_NONE
#define ARGP_ARG2 ARG_NONE
#define ARGP_ARG3 ARG_NONE
#define ARGP_ARG4 ARG_NONE
#define ARGP_ARG5 ARG_NONE
#define ARGP_ARG6 ARG_NONE
#define ARGP_BANK_FIELD_OP ARGP_LIST6 (ARGP_PKGLENGTH, ARGP_NAMESTRING, ARGP_NAMESTRING,ARGP_TERMARG, ARGP_BYTEDATA, ARGP_FIELDLIST)
#define ARGP_BIT_AND_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_TARGET)
#define ARGP_BIT_NAND_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_TARGET)
#define ARGP_BIT_NOR_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_TARGET)
#define ARGP_BIT_NOT_OP ARGP_LIST2 (ARGP_TERMARG, ARGP_TARGET)
#define ARGP_BIT_OR_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_TARGET)
#define ARGP_BIT_XOR_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_TARGET)
#define ARGP_BREAK_OP ARG_NONE
#define ARGP_BREAK_POINT_OP ARG_NONE
#define ARGP_BUFFER_OP ARGP_LIST3 (ARGP_PKGLENGTH, ARGP_TERMARG, ARGP_BYTELIST)
#define ARGP_BYTE_OP ARGP_LIST1 (ARGP_BYTEDATA)
#define ARGP_BYTELIST_OP ARGP_LIST1 (ARGP_NAMESTRING)
#define ARGP_COMMENT_OP ARGP_LIST2 (ARGP_BYTEDATA, ARGP_COMMENT)
#define ARGP_CONCAT_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_TARGET)
#define ARGP_CONCAT_RES_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_TARGET)
#define ARGP_COND_REF_OF_OP ARGP_LIST2 (ARGP_SIMPLENAME, ARGP_TARGET)
#define ARGP_CONNECTFIELD_OP ARGP_LIST1 (ARGP_NAMESTRING)
#define ARGP_CONTINUE_OP ARG_NONE
#define ARGP_COPY_OP ARGP_LIST2 (ARGP_TERMARG, ARGP_SIMPLENAME)
#define ARGP_CREATE_BIT_FIELD_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_NAME)
#define ARGP_CREATE_BYTE_FIELD_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_NAME)
#define ARGP_CREATE_DWORD_FIELD_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_NAME)
#define ARGP_CREATE_FIELD_OP ARGP_LIST4 (ARGP_TERMARG, ARGP_TERMARG, ARGP_TERMARG, ARGP_NAME)
#define ARGP_CREATE_QWORD_FIELD_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_NAME)
#define ARGP_CREATE_WORD_FIELD_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_NAME)
#define ARGP_DATA_REGION_OP ARGP_LIST4 (ARGP_NAME, ARGP_TERMARG, ARGP_TERMARG, ARGP_TERMARG)
#define ARGP_DEBUG_OP ARG_NONE
#define ARGP_DECREMENT_OP ARGP_LIST1 (ARGP_SUPERNAME)
#define ARGP_DEREF_OF_OP ARGP_LIST1 (ARGP_SUPERNAME)
#define ARGP_DEVICE_OP ARGP_LIST3 (ARGP_PKGLENGTH, ARGP_NAME, ARGP_OBJLIST)
#define ARGP_DIVIDE_OP ARGP_LIST4 (ARGP_TERMARG, ARGP_TERMARG, ARGP_TARGET, ARGP_TARGET)
#define ARGP_DWORD_OP ARGP_LIST1 (ARGP_DWORDDATA)
#define ARGP_ELSE_OP ARGP_LIST2 (ARGP_PKGLENGTH, ARGP_TERMLIST)
#define ARGP_EVENT_OP ARGP_LIST1 (ARGP_NAME)
#define ARGP_EXTERNAL_OP ARGP_LIST3 (ARGP_NAME, ARGP_BYTEDATA, ARGP_BYTEDATA)
#define ARGP_FATAL_OP ARGP_LIST3 (ARGP_BYTEDATA, ARGP_DWORDDATA, ARGP_TERMARG)
#define ARGP_FIELD_OP ARGP_LIST4 (ARGP_PKGLENGTH, ARGP_NAMESTRING, ARGP_BYTEDATA, ARGP_FIELDLIST)
#define ARGP_FIND_SET_LEFT_BIT_OP ARGP_LIST2 (ARGP_TERMARG, ARGP_TARGET)
#define ARGP_FIND_SET_RIGHT_BIT_OP ARGP_LIST2 (ARGP_TERMARG, ARGP_TARGET)
#define ARGP_FROM_BCD_OP ARGP_LIST2 (ARGP_TERMARG, ARGP_TARGET)
#define ARGP_IF_OP ARGP_LIST3 (ARGP_PKGLENGTH, ARGP_TERMARG, ARGP_TERMLIST)
#define ARGP_INCREMENT_OP ARGP_LIST1 (ARGP_SUPERNAME)
#define ARGP_INDEX_FIELD_OP ARGP_LIST5 (ARGP_PKGLENGTH, ARGP_NAMESTRING, ARGP_NAMESTRING,ARGP_BYTEDATA, ARGP_FIELDLIST)
#define ARGP_INDEX_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_TARGET)
#define ARGP_LAND_OP ARGP_LIST2 (ARGP_TERMARG, ARGP_TERMARG)
#define ARGP_LEQUAL_OP ARGP_LIST2 (ARGP_TERMARG, ARGP_TERMARG)
#define ARGP_LGREATER_OP ARGP_LIST2 (ARGP_TERMARG, ARGP_TERMARG)
#define ARGP_LGREATEREQUAL_OP ARGP_LIST2 (ARGP_TERMARG, ARGP_TERMARG)
#define ARGP_LLESS_OP ARGP_LIST2 (ARGP_TERMARG, ARGP_TERMARG)
#define ARGP_LLESSEQUAL_OP ARGP_LIST2 (ARGP_TERMARG, ARGP_TERMARG)
#define ARGP_LNOT_OP ARGP_LIST1 (ARGP_TERMARG)
#define ARGP_LNOTEQUAL_OP ARGP_LIST2 (ARGP_TERMARG, ARGP_TERMARG)
#define ARGP_LOAD_OP ARGP_LIST2 (ARGP_NAMESTRING, ARGP_SUPERNAME)
#define ARGP_LOAD_TABLE_OP ARGP_LIST6 (ARGP_TERMARG, ARGP_TERMARG, ARGP_TERMARG, ARGP_TERMARG, ARGP_TERMARG, ARGP_TERMARG)
#define ARGP_LOCAL0 ARG_NONE
#define ARGP_LOCAL1 ARG_NONE
#define ARGP_LOCAL2 ARG_NONE
#define ARGP_LOCAL3 ARG_NONE
#define ARGP_LOCAL4 ARG_NONE
#define ARGP_LOCAL5 ARG_NONE
#define ARGP_LOCAL6 ARG_NONE
#define ARGP_LOCAL7 ARG_NONE
#define ARGP_LOR_OP ARGP_LIST2 (ARGP_TERMARG, ARGP_TERMARG)
#define ARGP_MATCH_OP ARGP_LIST6 (ARGP_TERMARG, ARGP_BYTEDATA, ARGP_TERMARG, ARGP_BYTEDATA, ARGP_TERMARG, ARGP_TERMARG)
#define ARGP_METHOD_OP ARGP_LIST4 (ARGP_PKGLENGTH, ARGP_NAME, ARGP_BYTEDATA, ARGP_TERMLIST)
#define ARGP_METHODCALL_OP ARGP_LIST1 (ARGP_NAMESTRING)
#define ARGP_MID_OP ARGP_LIST4 (ARGP_TERMARG, ARGP_TERMARG, ARGP_TERMARG, ARGP_TARGET)
#define ARGP_MOD_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_TARGET)
#define ARGP_MULTIPLY_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_TARGET)
#define ARGP_MUTEX_OP ARGP_LIST2 (ARGP_NAME, ARGP_BYTEDATA)
#define ARGP_NAME_OP ARGP_LIST2 (ARGP_NAME, ARGP_DATAOBJ)
#define ARGP_NAMEDFIELD_OP ARGP_LIST1 (ARGP_NAMESTRING)
#define ARGP_NAMEPATH_OP ARGP_LIST1 (ARGP_NAMESTRING)
#define ARGP_NOOP_OP ARG_NONE
#define ARGP_NOTIFY_OP ARGP_LIST2 (ARGP_SUPERNAME, ARGP_TERMARG)
#define ARGP_OBJECT_TYPE_OP ARGP_LIST1 (ARGP_SIMPLENAME)
#define ARGP_ONE_OP ARG_NONE
#define ARGP_ONES_OP ARG_NONE
#define ARGP_PACKAGE_OP ARGP_LIST3 (ARGP_PKGLENGTH, ARGP_BYTEDATA, ARGP_DATAOBJLIST)
#define ARGP_POWER_RES_OP ARGP_LIST5 (ARGP_PKGLENGTH, ARGP_NAME, ARGP_BYTEDATA, ARGP_WORDDATA, ARGP_OBJLIST)
#define ARGP_PROCESSOR_OP ARGP_LIST6 (ARGP_PKGLENGTH, ARGP_NAME, ARGP_BYTEDATA, ARGP_DWORDDATA, ARGP_BYTEDATA, ARGP_OBJLIST)
#define ARGP_QWORD_OP ARGP_LIST1 (ARGP_QWORDDATA)
#define ARGP_REF_OF_OP ARGP_LIST1 (ARGP_SIMPLENAME)
#define ARGP_REGION_OP ARGP_LIST4 (ARGP_NAME, ARGP_BYTEDATA, ARGP_TERMARG, ARGP_TERMARG)
#define ARGP_RELEASE_OP ARGP_LIST1 (ARGP_SUPERNAME)
#define ARGP_RESERVEDFIELD_OP ARGP_LIST1 (ARGP_NAMESTRING)
#define ARGP_RESET_OP ARGP_LIST1 (ARGP_SUPERNAME)
#define ARGP_RETURN_OP ARGP_LIST1 (ARGP_TERMARG)
#define ARGP_REVISION_OP ARG_NONE
#define ARGP_SCOPE_OP ARGP_LIST3 (ARGP_PKGLENGTH, ARGP_NAME, ARGP_TERMLIST)
#define ARGP_SERIALFIELD_OP ARGP_LIST1 (ARGP_NAMESTRING)
#define ARGP_SHIFT_LEFT_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_TARGET)
#define ARGP_SHIFT_RIGHT_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_TARGET)
#define ARGP_SIGNAL_OP ARGP_LIST1 (ARGP_SUPERNAME)
#define ARGP_SIZE_OF_OP ARGP_LIST1 (ARGP_SUPERNAME)
#define ARGP_SLEEP_OP ARGP_LIST1 (ARGP_TERMARG)
#define ARGP_STALL_OP ARGP_LIST1 (ARGP_TERMARG)
#define ARGP_STATICSTRING_OP ARGP_LIST1 (ARGP_NAMESTRING)
#define ARGP_STORE_OP ARGP_LIST2 (ARGP_TERMARG, ARGP_SUPERNAME)
#define ARGP_STRING_OP ARGP_LIST1 (ARGP_CHARLIST)
#define ARGP_SUBTRACT_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_TARGET)
#define ARGP_THERMAL_ZONE_OP ARGP_LIST3 (ARGP_PKGLENGTH, ARGP_NAME, ARGP_OBJLIST)
#define ARGP_TIMER_OP ARG_NONE
#define ARGP_TO_BCD_OP ARGP_LIST2 (ARGP_TERMARG, ARGP_TARGET)
#define ARGP_TO_BUFFER_OP ARGP_LIST2 (ARGP_TERMARG, ARGP_TARGET)
#define ARGP_TO_DEC_STR_OP ARGP_LIST2 (ARGP_TERMARG, ARGP_TARGET)
#define ARGP_TO_HEX_STR_OP ARGP_LIST2 (ARGP_TERMARG, ARGP_TARGET)
#define ARGP_TO_INTEGER_OP ARGP_LIST2 (ARGP_TERMARG, ARGP_TARGET)
#define ARGP_TO_STRING_OP ARGP_LIST3 (ARGP_TERMARG, ARGP_TERMARG, ARGP_TARGET)
#define ARGP_UNLOAD_OP ARGP_LIST1 (ARGP_SUPERNAME)
#define ARGP_VAR_PACKAGE_OP ARGP_LIST3 (ARGP_PKGLENGTH, ARGP_TERMARG, ARGP_DATAOBJLIST)
#define ARGP_WAIT_OP ARGP_LIST2 (ARGP_SUPERNAME, ARGP_TERMARG)
#define ARGP_WHILE_OP ARGP_LIST3 (ARGP_PKGLENGTH, ARGP_TERMARG, ARGP_TERMLIST)
#define ARGP_WORD_OP ARGP_LIST1 (ARGP_WORDDATA)
#define ARGP_ZERO_OP ARG_NONE
/*
* All AML opcodes and the runtime arguments for each. Used by the AML
* interpreter Each list is compressed into a 32-bit number and stored
* in the master opcode table (in psopcode.c).
*
* (Used by PrepOperands procedure and the ASL Compiler)
*/
#define ARGI_ACCESSFIELD_OP ARGI_INVALID_OPCODE
#define ARGI_ACQUIRE_OP ARGI_LIST2 (ARGI_MUTEX, ARGI_INTEGER)
#define ARGI_ADD_OP ARGI_LIST3 (ARGI_INTEGER, ARGI_INTEGER, ARGI_TARGETREF)
#define ARGI_ALIAS_OP ARGI_INVALID_OPCODE
#define ARGI_ARG0 ARG_NONE
#define ARGI_ARG1 ARG_NONE
#define ARGI_ARG2 ARG_NONE
#define ARGI_ARG3 ARG_NONE
#define ARGI_ARG4 ARG_NONE
#define ARGI_ARG5 ARG_NONE
#define ARGI_ARG6 ARG_NONE
#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)
#define ARGI_BIT_NOT_OP ARGI_LIST2 (ARGI_INTEGER, ARGI_TARGETREF)
#define ARGI_BIT_OR_OP ARGI_LIST3 (ARGI_INTEGER, ARGI_INTEGER, ARGI_TARGETREF)
#define ARGI_BIT_XOR_OP ARGI_LIST3 (ARGI_INTEGER, ARGI_INTEGER, ARGI_TARGETREF)
#define ARGI_BREAK_OP ARG_NONE
#define ARGI_BREAK_POINT_OP ARG_NONE
#define ARGI_BUFFER_OP ARGI_LIST1 (ARGI_INTEGER)
#define ARGI_BYTE_OP ARGI_INVALID_OPCODE
#define ARGI_BYTELIST_OP ARGI_INVALID_OPCODE
#define ARGI_COMMENT_OP ARGI_INVALID_OPCODE
#define ARGI_CONCAT_OP ARGI_LIST3 (ARGI_ANYTYPE, ARGI_ANYTYPE, ARGI_TARGETREF)
#define ARGI_CONCAT_RES_OP ARGI_LIST3 (ARGI_BUFFER, ARGI_BUFFER, ARGI_TARGETREF)
#define ARGI_COND_REF_OF_OP ARGI_LIST2 (ARGI_OBJECT_REF, ARGI_TARGETREF)
#define ARGI_CONNECTFIELD_OP ARGI_INVALID_OPCODE
#define ARGI_CONTINUE_OP ARGI_INVALID_OPCODE
#define ARGI_COPY_OP ARGI_LIST2 (ARGI_ANYTYPE, ARGI_SIMPLE_TARGET)
#define ARGI_CREATE_BIT_FIELD_OP ARGI_LIST3 (ARGI_BUFFER, ARGI_INTEGER, ARGI_REFERENCE)
#define ARGI_CREATE_BYTE_FIELD_OP ARGI_LIST3 (ARGI_BUFFER, ARGI_INTEGER, ARGI_REFERENCE)
#define ARGI_CREATE_DWORD_FIELD_OP ARGI_LIST3 (ARGI_BUFFER, ARGI_INTEGER, ARGI_REFERENCE)
#define ARGI_CREATE_FIELD_OP ARGI_LIST4 (ARGI_BUFFER, ARGI_INTEGER, ARGI_INTEGER, ARGI_REFERENCE)
#define ARGI_CREATE_QWORD_FIELD_OP ARGI_LIST3 (ARGI_BUFFER, ARGI_INTEGER, ARGI_REFERENCE)
#define ARGI_CREATE_WORD_FIELD_OP ARGI_LIST3 (ARGI_BUFFER, ARGI_INTEGER, ARGI_REFERENCE)
#define ARGI_DATA_REGION_OP ARGI_LIST3 (ARGI_STRING, ARGI_STRING, ARGI_STRING)
#define ARGI_DEBUG_OP ARG_NONE
#define ARGI_DECREMENT_OP ARGI_LIST1 (ARGI_TARGETREF)
#define ARGI_DEREF_OF_OP ARGI_LIST1 (ARGI_REF_OR_STRING)
#define ARGI_DEVICE_OP ARGI_INVALID_OPCODE
#define ARGI_DIVIDE_OP ARGI_LIST4 (ARGI_INTEGER, ARGI_INTEGER, ARGI_TARGETREF, ARGI_TARGETREF)
#define ARGI_DWORD_OP ARGI_INVALID_OPCODE
#define ARGI_ELSE_OP ARGI_INVALID_OPCODE
#define ARGI_EVENT_OP ARGI_INVALID_OPCODE
#define ARGI_EXTERNAL_OP ARGI_LIST3 (ARGI_STRING, ARGI_INTEGER, ARGI_INTEGER)
#define ARGI_FATAL_OP ARGI_LIST3 (ARGI_INTEGER, ARGI_INTEGER, ARGI_INTEGER)
#define ARGI_FIELD_OP ARGI_INVALID_OPCODE
#define ARGI_FIND_SET_LEFT_BIT_OP ARGI_LIST2 (ARGI_INTEGER, ARGI_TARGETREF)
#define ARGI_FIND_SET_RIGHT_BIT_OP ARGI_LIST2 (ARGI_INTEGER, ARGI_TARGETREF)
#define ARGI_FROM_BCD_OP ARGI_LIST2 (ARGI_INTEGER, ARGI_FIXED_TARGET)
#define ARGI_IF_OP ARGI_INVALID_OPCODE
#define ARGI_INCREMENT_OP ARGI_LIST1 (ARGI_TARGETREF)
#define ARGI_INDEX_FIELD_OP ARGI_INVALID_OPCODE
#define ARGI_INDEX_OP ARGI_LIST3 (ARGI_COMPLEXOBJ, ARGI_INTEGER, ARGI_TARGETREF)
#define ARGI_LAND_OP ARGI_LIST2 (ARGI_INTEGER, ARGI_INTEGER)
#define ARGI_LEQUAL_OP ARGI_LIST2 (ARGI_COMPUTEDATA,ARGI_COMPUTEDATA)
#define ARGI_LGREATER_OP ARGI_LIST2 (ARGI_COMPUTEDATA,ARGI_COMPUTEDATA)
#define ARGI_LGREATEREQUAL_OP ARGI_INVALID_OPCODE
#define ARGI_LLESS_OP ARGI_LIST2 (ARGI_COMPUTEDATA,ARGI_COMPUTEDATA)
#define ARGI_LLESSEQUAL_OP ARGI_INVALID_OPCODE
#define ARGI_LNOT_OP ARGI_LIST1 (ARGI_INTEGER)
#define ARGI_LNOTEQUAL_OP ARGI_INVALID_OPCODE
#define ARGI_LOAD_OP ARGI_LIST2 (ARGI_REGION_OR_BUFFER,ARGI_TARGETREF)
#define ARGI_LOAD_TABLE_OP ARGI_LIST6 (ARGI_STRING, ARGI_STRING, ARGI_STRING, ARGI_STRING, ARGI_STRING, ARGI_ANYTYPE)
#define ARGI_LOCAL0 ARG_NONE
#define ARGI_LOCAL1 ARG_NONE
#define ARGI_LOCAL2 ARG_NONE
#define ARGI_LOCAL3 ARG_NONE
#define ARGI_LOCAL4 ARG_NONE
#define ARGI_LOCAL5 ARG_NONE
#define ARGI_LOCAL6 ARG_NONE
#define ARGI_LOCAL7 ARG_NONE
#define ARGI_LOR_OP ARGI_LIST2 (ARGI_INTEGER, ARGI_INTEGER)
#define ARGI_MATCH_OP ARGI_LIST6 (ARGI_PACKAGE, ARGI_INTEGER, ARGI_COMPUTEDATA, ARGI_INTEGER,ARGI_COMPUTEDATA,ARGI_INTEGER)
#define ARGI_METHOD_OP ARGI_INVALID_OPCODE
#define ARGI_METHODCALL_OP ARGI_INVALID_OPCODE
#define ARGI_MID_OP ARGI_LIST4 (ARGI_BUFFER_OR_STRING,ARGI_INTEGER, ARGI_INTEGER, ARGI_TARGETREF)
#define ARGI_MOD_OP ARGI_LIST3 (ARGI_INTEGER, ARGI_INTEGER, ARGI_TARGETREF)
#define ARGI_MULTIPLY_OP ARGI_LIST3 (ARGI_INTEGER, ARGI_INTEGER, ARGI_TARGETREF)
#define ARGI_MUTEX_OP ARGI_INVALID_OPCODE
#define ARGI_NAME_OP ARGI_INVALID_OPCODE
#define ARGI_NAMEDFIELD_OP ARGI_INVALID_OPCODE
#define ARGI_NAMEPATH_OP ARGI_INVALID_OPCODE
#define ARGI_NOOP_OP ARG_NONE
#define ARGI_NOTIFY_OP ARGI_LIST2 (ARGI_DEVICE_REF, ARGI_INTEGER)
#define ARGI_OBJECT_TYPE_OP ARGI_LIST1 (ARGI_ANYTYPE)
#define ARGI_ONE_OP ARG_NONE
#define ARGI_ONES_OP ARG_NONE
#define ARGI_PACKAGE_OP ARGI_LIST1 (ARGI_INTEGER)
#define ARGI_POWER_RES_OP ARGI_INVALID_OPCODE
#define ARGI_PROCESSOR_OP ARGI_INVALID_OPCODE
#define ARGI_QWORD_OP ARGI_INVALID_OPCODE
#define ARGI_REF_OF_OP ARGI_LIST1 (ARGI_OBJECT_REF)
#define ARGI_REGION_OP ARGI_LIST2 (ARGI_INTEGER, ARGI_INTEGER)
#define ARGI_RELEASE_OP ARGI_LIST1 (ARGI_MUTEX)
#define ARGI_RESERVEDFIELD_OP ARGI_INVALID_OPCODE
#define ARGI_RESET_OP ARGI_LIST1 (ARGI_EVENT)
#define ARGI_RETURN_OP ARGI_INVALID_OPCODE
#define ARGI_REVISION_OP ARG_NONE
#define ARGI_SCOPE_OP ARGI_INVALID_OPCODE
#define ARGI_SERIALFIELD_OP ARGI_INVALID_OPCODE
#define ARGI_SHIFT_LEFT_OP ARGI_LIST3 (ARGI_INTEGER, ARGI_INTEGER, ARGI_TARGETREF)
#define ARGI_SHIFT_RIGHT_OP ARGI_LIST3 (ARGI_INTEGER, ARGI_INTEGER, ARGI_TARGETREF)
#define ARGI_SIGNAL_OP ARGI_LIST1 (ARGI_EVENT)
#define ARGI_SIZE_OF_OP ARGI_LIST1 (ARGI_DATAOBJECT)
#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_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
#define ARGI_TIMER_OP ARG_NONE
#define ARGI_TO_BCD_OP ARGI_LIST2 (ARGI_INTEGER, ARGI_FIXED_TARGET)
#define ARGI_TO_BUFFER_OP ARGI_LIST2 (ARGI_COMPUTEDATA,ARGI_FIXED_TARGET)
#define ARGI_TO_DEC_STR_OP ARGI_LIST2 (ARGI_COMPUTEDATA,ARGI_FIXED_TARGET)
#define ARGI_TO_HEX_STR_OP ARGI_LIST2 (ARGI_COMPUTEDATA,ARGI_FIXED_TARGET)
#define ARGI_TO_INTEGER_OP ARGI_LIST2 (ARGI_COMPUTEDATA,ARGI_FIXED_TARGET)
#define ARGI_TO_STRING_OP ARGI_LIST3 (ARGI_BUFFER, ARGI_INTEGER, ARGI_FIXED_TARGET)
#define ARGI_UNLOAD_OP ARGI_LIST1 (ARGI_DDBHANDLE)
#define ARGI_VAR_PACKAGE_OP ARGI_LIST1 (ARGI_INTEGER)
#define ARGI_WAIT_OP ARGI_LIST2 (ARGI_EVENT, ARGI_INTEGER)
#define ARGI_WHILE_OP ARGI_INVALID_OPCODE
#define ARGI_WORD_OP ARGI_INVALID_OPCODE
#define ARGI_ZERO_OP ARG_NONE
#endif /* __ACOPCODE_H__ */
-614
View File
@@ -1,614 +0,0 @@
/******************************************************************************
*
* Name: acoutput.h -- debug output
*
*****************************************************************************/
/******************************************************************************
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2019, 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.
*
*****************************************************************************
*
* Alternatively, you may choose to be licensed under the terms of the
* following license:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Alternatively, you may choose to be licensed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
*****************************************************************************/
#ifndef __ACOUTPUT_H__
#define __ACOUTPUT_H__
/*
* Debug levels and component IDs. These are used to control the
* granularity of the output of the ACPI_DEBUG_PRINT macro -- on a
* per-component basis and a per-exception-type basis.
*/
/* Component IDs are used in the global "DebugLayer" */
#define ACPI_UTILITIES 0x00000001
#define ACPI_HARDWARE 0x00000002
#define ACPI_EVENTS 0x00000004
#define ACPI_TABLES 0x00000008
#define ACPI_NAMESPACE 0x00000010
#define ACPI_PARSER 0x00000020
#define ACPI_DISPATCHER 0x00000040
#define ACPI_EXECUTER 0x00000080
#define ACPI_RESOURCES 0x00000100
#define ACPI_CA_DEBUGGER 0x00000200
#define ACPI_OS_SERVICES 0x00000400
#define ACPI_CA_DISASSEMBLER 0x00000800
/* Component IDs for ACPI tools and utilities */
#define ACPI_COMPILER 0x00001000
#define ACPI_TOOLS 0x00002000
#define ACPI_EXAMPLE 0x00004000
#define ACPI_DRIVER 0x00008000
#define DT_COMPILER 0x00010000
#define ASL_PREPROCESSOR 0x00020000
#define ACPI_ALL_COMPONENTS 0x0001FFFF
#define ACPI_COMPONENT_DEFAULT (ACPI_ALL_COMPONENTS)
/* Component IDs reserved for ACPI drivers */
#define ACPI_ALL_DRIVERS 0xFFFF0000
/*
* Raw debug output levels, do not use these in the ACPI_DEBUG_PRINT macros
*/
#define ACPI_LV_INIT 0x00000001
#define ACPI_LV_DEBUG_OBJECT 0x00000002
#define ACPI_LV_INFO 0x00000004
#define ACPI_LV_REPAIR 0x00000008
#define ACPI_LV_TRACE_POINT 0x00000010
#define ACPI_LV_ALL_EXCEPTIONS 0x0000001F
/* Trace verbosity level 1 [Standard Trace Level] */
#define ACPI_LV_INIT_NAMES 0x00000020
#define ACPI_LV_PARSE 0x00000040
#define ACPI_LV_LOAD 0x00000080
#define ACPI_LV_DISPATCH 0x00000100
#define ACPI_LV_EXEC 0x00000200
#define ACPI_LV_NAMES 0x00000400
#define ACPI_LV_OPREGION 0x00000800
#define ACPI_LV_BFIELD 0x00001000
#define ACPI_LV_TABLES 0x00002000
#define ACPI_LV_VALUES 0x00004000
#define ACPI_LV_OBJECTS 0x00008000
#define ACPI_LV_RESOURCES 0x00010000
#define ACPI_LV_USER_REQUESTS 0x00020000
#define ACPI_LV_PACKAGE 0x00040000
#define ACPI_LV_EVALUATION 0x00080000
#define ACPI_LV_VERBOSITY1 0x000FFF40 | ACPI_LV_ALL_EXCEPTIONS
/* Trace verbosity level 2 [Function tracing and memory allocation] */
#define ACPI_LV_ALLOCATIONS 0x00100000
#define ACPI_LV_FUNCTIONS 0x00200000
#define ACPI_LV_OPTIMIZATIONS 0x00400000
#define ACPI_LV_PARSE_TREES 0x00800000
#define ACPI_LV_VERBOSITY2 0x00F00000 | ACPI_LV_VERBOSITY1
#define ACPI_LV_ALL ACPI_LV_VERBOSITY2
/* Trace verbosity level 3 [Threading, I/O, and Interrupts] */
#define ACPI_LV_MUTEX 0x01000000
#define ACPI_LV_THREADS 0x02000000
#define ACPI_LV_IO 0x04000000
#define ACPI_LV_INTERRUPTS 0x08000000
#define ACPI_LV_VERBOSITY3 0x0F000000 | ACPI_LV_VERBOSITY2
/* Exceptionally verbose output -- also used in the global "DebugLevel" */
#define ACPI_LV_AML_DISASSEMBLE 0x10000000
#define ACPI_LV_VERBOSE_INFO 0x20000000
#define ACPI_LV_FULL_TABLES 0x40000000
#define ACPI_LV_EVENTS 0x80000000
#define ACPI_LV_VERBOSE 0xF0000000
/*
* Debug level macros that are used in the DEBUG_PRINT macros
*/
#define ACPI_DEBUG_LEVEL(dl) (UINT32) dl,ACPI_DEBUG_PARAMETERS
/*
* Exception level -- used in the global "DebugLevel"
*
* Note: For errors, use the ACPI_ERROR or ACPI_EXCEPTION interfaces.
* For warnings, use ACPI_WARNING.
*/
#define ACPI_DB_INIT ACPI_DEBUG_LEVEL (ACPI_LV_INIT)
#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" */
#define ACPI_DB_INIT_NAMES ACPI_DEBUG_LEVEL (ACPI_LV_INIT_NAMES)
#define ACPI_DB_THREADS ACPI_DEBUG_LEVEL (ACPI_LV_THREADS)
#define ACPI_DB_PARSE ACPI_DEBUG_LEVEL (ACPI_LV_PARSE)
#define ACPI_DB_DISPATCH ACPI_DEBUG_LEVEL (ACPI_LV_DISPATCH)
#define ACPI_DB_LOAD ACPI_DEBUG_LEVEL (ACPI_LV_LOAD)
#define ACPI_DB_EXEC ACPI_DEBUG_LEVEL (ACPI_LV_EXEC)
#define ACPI_DB_NAMES ACPI_DEBUG_LEVEL (ACPI_LV_NAMES)
#define ACPI_DB_OPREGION ACPI_DEBUG_LEVEL (ACPI_LV_OPREGION)
#define ACPI_DB_BFIELD ACPI_DEBUG_LEVEL (ACPI_LV_BFIELD)
#define ACPI_DB_TABLES ACPI_DEBUG_LEVEL (ACPI_LV_TABLES)
#define ACPI_DB_FUNCTIONS ACPI_DEBUG_LEVEL (ACPI_LV_FUNCTIONS)
#define ACPI_DB_OPTIMIZATIONS ACPI_DEBUG_LEVEL (ACPI_LV_OPTIMIZATIONS)
#define ACPI_DB_PARSE_TREES ACPI_DEBUG_LEVEL (ACPI_LV_PARSE_TREES)
#define ACPI_DB_VALUES ACPI_DEBUG_LEVEL (ACPI_LV_VALUES)
#define ACPI_DB_OBJECTS ACPI_DEBUG_LEVEL (ACPI_LV_OBJECTS)
#define ACPI_DB_ALLOCATIONS ACPI_DEBUG_LEVEL (ACPI_LV_ALLOCATIONS)
#define ACPI_DB_RESOURCES ACPI_DEBUG_LEVEL (ACPI_LV_RESOURCES)
#define ACPI_DB_IO ACPI_DEBUG_LEVEL (ACPI_LV_IO)
#define ACPI_DB_INTERRUPTS ACPI_DEBUG_LEVEL (ACPI_LV_INTERRUPTS)
#define ACPI_DB_USER_REQUESTS ACPI_DEBUG_LEVEL (ACPI_LV_USER_REQUESTS)
#define ACPI_DB_PACKAGE ACPI_DEBUG_LEVEL (ACPI_LV_PACKAGE)
#define ACPI_DB_EVALUATION ACPI_DEBUG_LEVEL (ACPI_LV_EVALUATION)
#define ACPI_DB_MUTEX ACPI_DEBUG_LEVEL (ACPI_LV_MUTEX)
#define ACPI_DB_EVENTS ACPI_DEBUG_LEVEL (ACPI_LV_EVENTS)
#define ACPI_DB_ALL ACPI_DEBUG_LEVEL (ACPI_LV_ALL)
/* Defaults for DebugLevel, debug and normal */
#define ACPI_DEBUG_DEFAULT (ACPI_LV_INIT | ACPI_LV_DEBUG_OBJECT | ACPI_LV_EVALUATION | ACPI_LV_REPAIR)
#define ACPI_NORMAL_DEFAULT (ACPI_LV_INIT | ACPI_LV_DEBUG_OBJECT | ACPI_LV_REPAIR)
#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.
* The __FILE__ macro is not very useful for this, because it
* usually includes the entire pathname to the module making the
* debug output difficult to read.
*/
#define ACPI_MODULE_NAME(Name) static const char ACPI_UNUSED_VAR _AcpiModuleName[] = Name;
#else
/*
* For the no-debug and no-error-msg cases, we must at least define
* a null module name.
*/
#define ACPI_MODULE_NAME(Name)
#define _AcpiModuleName ""
#endif
/*
* Ascii error messages can be configured out
*/
#ifndef ACPI_NO_ERROR_MESSAGES
#define AE_INFO _AcpiModuleName, __LINE__
/*
* Error reporting. Callers module and line number are inserted by AE_INFO,
* the plist contains a set of parens to allow variable-length lists.
* These macros are used for both the debug and non-debug versions of the code.
*/
#define ACPI_INFO(plist) AcpiInfo plist
#define ACPI_WARNING(plist) AcpiWarning plist
#define ACPI_EXCEPTION(plist) AcpiException plist
#define ACPI_ERROR(plist) AcpiError plist
#define ACPI_BIOS_WARNING(plist) AcpiBiosWarning plist
#define ACPI_BIOS_EXCEPTION(plist) AcpiBiosException plist
#define ACPI_BIOS_ERROR(plist) AcpiBiosError plist
#define ACPI_DEBUG_OBJECT(obj,l,i) AcpiExDoDebugObject(obj,l,i)
#else
/* No error messages */
#define ACPI_INFO(plist)
#define ACPI_WARNING(plist)
#define ACPI_EXCEPTION(plist)
#define ACPI_ERROR(plist)
#define ACPI_BIOS_WARNING(plist)
#define ACPI_BIOS_EXCEPTION(plist)
#define ACPI_BIOS_ERROR(plist)
#define ACPI_DEBUG_OBJECT(obj,l,i)
#endif /* ACPI_NO_ERROR_MESSAGES */
/*
* Debug macros that are conditionally compiled
*/
#ifdef ACPI_DEBUG_OUTPUT
/*
* If ACPI_GET_FUNCTION_NAME was not defined in the compiler-dependent header,
* define it now. This is the case where there the compiler does not support
* a __FUNCTION__ macro or equivalent.
*/
#ifndef ACPI_GET_FUNCTION_NAME
#define ACPI_GET_FUNCTION_NAME _AcpiFunctionName
/*
* The Name parameter should be the procedure name as a non-quoted string.
* The function name is also used by the function exit macros below.
* Note: (const char) is used to be compatible with the debug interfaces
* and macros such as __FUNCTION__.
*/
#define ACPI_FUNCTION_NAME(Name) static const char _AcpiFunctionName[] = #Name;
#else
/* Compiler supports __FUNCTION__ (or equivalent) -- Ignore this macro */
#define ACPI_FUNCTION_NAME(Name)
#endif /* ACPI_GET_FUNCTION_NAME */
/*
* Common parameters used for debug output functions:
* line number, function name, module(file) name, component ID
*/
#define ACPI_DEBUG_PARAMETERS \
__LINE__, ACPI_GET_FUNCTION_NAME, _AcpiModuleName, _COMPONENT
/* Check if debug output is currently dynamically enabled */
#define ACPI_IS_DEBUG_ENABLED(Level, Component) \
((Level & AcpiDbgLevel) && (Component & AcpiDbgLayer))
/*
* Master debug print macros
* Print message if and only if:
* 1) Debug print for the current component is enabled
* 2) Debug error level or trace level for the print statement is enabled
*
* November 2012: Moved the runtime check for whether to actually emit the
* debug message outside of the print function itself. This improves overall
* performance at a relatively small code cost. Implementation involves the
* use of variadic macros supported by C99.
*
* Note: the ACPI_DO_WHILE0 macro is used to prevent some compilers from
* complaining about these constructs. On other compilers the do...while
* adds some extra code, so this feature is optional.
*/
#ifdef ACPI_USE_DO_WHILE_0
#define ACPI_DO_WHILE0(a) do a while(0)
#else
#define ACPI_DO_WHILE0(a) a
#endif
/* DEBUG_PRINT functions */
#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 */
#define ACPI_DO_DEBUG_PRINT(Function, Level, Line, Filename, Modulename, Component, ...) \
ACPI_DO_WHILE0 ({ \
if (ACPI_IS_DEBUG_ENABLED (Level, Component)) \
{ \
Function (Level, Line, Filename, Modulename, Component, __VA_ARGS__); \
} \
})
#define ACPI_ACTUAL_DEBUG(Level, Line, Filename, Modulename, Component, ...) \
ACPI_DO_DEBUG_PRINT (AcpiDebugPrint, Level, Line, \
Filename, Modulename, Component, __VA_ARGS__)
#define ACPI_ACTUAL_DEBUG_RAW(Level, Line, Filename, Modulename, Component, ...) \
ACPI_DO_DEBUG_PRINT (AcpiDebugPrintRaw, Level, Line, \
Filename, Modulename, Component, __VA_ARGS__)
#define ACPI_DEBUG_PRINT(plist) ACPI_ACTUAL_DEBUG plist
#define ACPI_DEBUG_PRINT_RAW(plist) ACPI_ACTUAL_DEBUG_RAW plist
#endif
/*
* Function entry tracing
*
* The name of the function is emitted as a local variable that is
* intended to be used by both the entry trace and the exit trace.
*/
/* Helper macro */
#define ACPI_TRACE_ENTRY(Name, Function, Type, Param) \
ACPI_FUNCTION_NAME (Name) \
Function (ACPI_DEBUG_PARAMETERS, (Type) (Param))
/* The actual entry trace macros */
#define ACPI_FUNCTION_TRACE(Name) \
ACPI_FUNCTION_NAME(Name) \
AcpiUtTrace (ACPI_DEBUG_PARAMETERS)
#define ACPI_FUNCTION_TRACE_PTR(Name, Pointer) \
ACPI_TRACE_ENTRY (Name, AcpiUtTracePtr, void *, Pointer)
#define ACPI_FUNCTION_TRACE_U32(Name, Value) \
ACPI_TRACE_ENTRY (Name, AcpiUtTraceU32, UINT32, Value)
#define ACPI_FUNCTION_TRACE_STR(Name, String) \
ACPI_TRACE_ENTRY (Name, AcpiUtTraceStr, const char *, String)
#define ACPI_FUNCTION_ENTRY() \
AcpiUtTrackStackPtr()
/*
* Function exit tracing
*
* These macros include a return statement. This is usually considered
* bad form, but having a separate exit macro before the actual return
* is very ugly and difficult to maintain.
*
* One of the FUNCTION_TRACE macros above must be used in conjunction
* with these macros so that "_AcpiFunctionName" is defined.
*
* There are two versions of most of the return macros. The default version is
* safer, since it avoids side-effects by guaranteeing that the argument will
* not be evaluated twice.
*
* A less-safe version of the macros is provided for optional use if the
* compiler uses excessive CPU stack (for example, this may happen in the
* debug case if code optimzation is disabled.)
*/
/* Exit trace helper macro */
#ifndef ACPI_SIMPLE_RETURN_MACROS
#define ACPI_TRACE_EXIT(Function, Type, Param) \
ACPI_DO_WHILE0 ({ \
register Type _Param = (Type) (Param); \
Function (ACPI_DEBUG_PARAMETERS, _Param); \
return (_Param); \
})
#else /* Use original less-safe macros */
#define ACPI_TRACE_EXIT(Function, Type, Param) \
ACPI_DO_WHILE0 ({ \
Function (ACPI_DEBUG_PARAMETERS, (Type) (Param)); \
return (Param); \
})
#endif /* ACPI_SIMPLE_RETURN_MACROS */
/* The actual exit macros */
#define return_VOID \
ACPI_DO_WHILE0 ({ \
AcpiUtExit (ACPI_DEBUG_PARAMETERS); \
return; \
})
#define return_ACPI_STATUS(Status) \
ACPI_TRACE_EXIT (AcpiUtStatusExit, ACPI_STATUS, Status)
#define return_PTR(Pointer) \
ACPI_TRACE_EXIT (AcpiUtPtrExit, void *, Pointer)
#define return_STR(String) \
ACPI_TRACE_EXIT (AcpiUtStrExit, const char *, String)
#define return_VALUE(Value) \
ACPI_TRACE_EXIT (AcpiUtValueExit, UINT64, Value)
#define return_UINT32(Value) \
ACPI_TRACE_EXIT (AcpiUtValueExit, UINT32, Value)
#define return_UINT8(Value) \
ACPI_TRACE_EXIT (AcpiUtValueExit, UINT8, Value)
/* Conditional execution */
#define ACPI_DEBUG_EXEC(a) a
#define ACPI_DEBUG_ONLY_MEMBERS(a) a;
#define _VERBOSE_STRUCTURES
/* Various object display routines for debug */
#define ACPI_DUMP_STACK_ENTRY(a) AcpiExDumpOperand((a), 0)
#define ACPI_DUMP_OPERANDS(a, b ,c) AcpiExDumpOperands(a, b, c)
#define ACPI_DUMP_ENTRY(a, b) AcpiNsDumpEntry (a, b)
#define ACPI_DUMP_PATHNAME(a, b, c, d) AcpiNsDumpPathname(a, b, c, d)
#define ACPI_DUMP_BUFFER(a, b) AcpiUtDebugDumpBuffer((UINT8 *) a, b, DB_BYTE_DISPLAY, _COMPONENT)
#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,
* leaving no executable debug code!
*/
#define ACPI_DEBUG_PRINT(pl)
#define ACPI_DEBUG_PRINT_RAW(pl)
#define ACPI_DEBUG_EXEC(a)
#define ACPI_DEBUG_ONLY_MEMBERS(a)
#define ACPI_FUNCTION_NAME(a)
#define ACPI_FUNCTION_TRACE(a)
#define ACPI_FUNCTION_TRACE_PTR(a, b)
#define ACPI_FUNCTION_TRACE_U32(a, b)
#define ACPI_FUNCTION_TRACE_STR(a, b)
#define ACPI_FUNCTION_ENTRY()
#define ACPI_DUMP_STACK_ENTRY(a)
#define ACPI_DUMP_OPERANDS(a, b, c)
#define ACPI_DUMP_ENTRY(a, b)
#define ACPI_DUMP_PATHNAME(a, b, c, d)
#define ACPI_DUMP_BUFFER(a, b)
#define ACPI_IS_DEBUG_ENABLED(Level, Component) 0
#define ACPI_TRACE_POINT(a, b, c, d)
/* Return macros must have a return statement at the minimum */
#define return_VOID return
#define return_ACPI_STATUS(s) return(s)
#define return_PTR(s) return(s)
#define return_STR(s) return(s)
#define return_VALUE(s) return(s)
#define return_UINT8(s) return(s)
#define return_UINT32(s) return(s)
#endif /* ACPI_DEBUG_OUTPUT */
#endif /* __ACOUTPUT_H__ */
-476
View File
@@ -1,476 +0,0 @@
/******************************************************************************
*
* Module Name: acparser.h - AML Parser subcomponent prototypes and defines
*
*****************************************************************************/
/******************************************************************************
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2019, 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.
*
*****************************************************************************
*
* Alternatively, you may choose to be licensed under the terms of the
* following license:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Alternatively, you may choose to be licensed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
*****************************************************************************/
#ifndef __ACPARSER_H__
#define __ACPARSER_H__
#define OP_HAS_RETURN_VALUE 1
/* Variable number of arguments. This field must be 32 bits */
#define ACPI_VAR_ARGS ACPI_UINT32_MAX
#define ACPI_PARSE_DELETE_TREE 0x0001
#define ACPI_PARSE_NO_TREE_DELETE 0x0000
#define ACPI_PARSE_TREE_MASK 0x0001
#define ACPI_PARSE_LOAD_PASS1 0x0010
#define ACPI_PARSE_LOAD_PASS2 0x0020
#define ACPI_PARSE_EXECUTE 0x0030
#define ACPI_PARSE_MODE_MASK 0x0030
#define ACPI_PARSE_DEFERRED_OP 0x0100
#define ACPI_PARSE_DISASSEMBLE 0x0200
#define ACPI_PARSE_MODULE_LEVEL 0x0400
/******************************************************************************
*
* Parser interfaces
*
*****************************************************************************/
extern const UINT8 AcpiGbl_ShortOpIndex[];
extern const UINT8 AcpiGbl_LongOpIndex[];
/*
* psxface - Parser external interfaces
*/
ACPI_STATUS
AcpiPsExecuteMethod (
ACPI_EVALUATE_INFO *Info);
ACPI_STATUS
AcpiPsExecuteTable (
ACPI_EVALUATE_INFO *Info);
/*
* psargs - Parse AML opcode arguments
*/
UINT8 *
AcpiPsGetNextPackageEnd (
ACPI_PARSE_STATE *ParserState);
char *
AcpiPsGetNextNamestring (
ACPI_PARSE_STATE *ParserState);
void
AcpiPsGetNextSimpleArg (
ACPI_PARSE_STATE *ParserState,
UINT32 ArgType,
ACPI_PARSE_OBJECT *Arg);
ACPI_STATUS
AcpiPsGetNextNamepath (
ACPI_WALK_STATE *WalkState,
ACPI_PARSE_STATE *ParserState,
ACPI_PARSE_OBJECT *Arg,
BOOLEAN PossibleMethodCall);
/* Values for BOOLEAN above */
#define ACPI_NOT_METHOD_CALL FALSE
#define ACPI_POSSIBLE_METHOD_CALL TRUE
ACPI_STATUS
AcpiPsGetNextArg (
ACPI_WALK_STATE *WalkState,
ACPI_PARSE_STATE *ParserState,
UINT32 ArgType,
ACPI_PARSE_OBJECT **ReturnArg);
/*
* psfind
*/
ACPI_PARSE_OBJECT *
AcpiPsFindName (
ACPI_PARSE_OBJECT *Scope,
UINT32 Name,
UINT32 Opcode);
ACPI_PARSE_OBJECT*
AcpiPsGetParent (
ACPI_PARSE_OBJECT *Op);
/*
* psobject - support for parse object processing
*/
ACPI_STATUS
AcpiPsBuildNamedOp (
ACPI_WALK_STATE *WalkState,
UINT8 *AmlOpStart,
ACPI_PARSE_OBJECT *UnnamedOp,
ACPI_PARSE_OBJECT **Op);
ACPI_STATUS
AcpiPsCreateOp (
ACPI_WALK_STATE *WalkState,
UINT8 *AmlOpStart,
ACPI_PARSE_OBJECT **NewOp);
ACPI_STATUS
AcpiPsCompleteOp (
ACPI_WALK_STATE *WalkState,
ACPI_PARSE_OBJECT **Op,
ACPI_STATUS Status);
ACPI_STATUS
AcpiPsCompleteFinalOp (
ACPI_WALK_STATE *WalkState,
ACPI_PARSE_OBJECT *Op,
ACPI_STATUS Status);
/*
* psopinfo - AML Opcode information
*/
const ACPI_OPCODE_INFO *
AcpiPsGetOpcodeInfo (
UINT16 Opcode);
const char *
AcpiPsGetOpcodeName (
UINT16 Opcode);
UINT8
AcpiPsGetArgumentCount (
UINT32 OpType);
/*
* psparse - top level parsing routines
*/
ACPI_STATUS
AcpiPsParseAml (
ACPI_WALK_STATE *WalkState);
UINT32
AcpiPsGetOpcodeSize (
UINT32 Opcode);
UINT16
AcpiPsPeekOpcode (
ACPI_PARSE_STATE *state);
ACPI_STATUS
AcpiPsCompleteThisOp (
ACPI_WALK_STATE *WalkState,
ACPI_PARSE_OBJECT *Op);
ACPI_STATUS
AcpiPsNextParseState (
ACPI_WALK_STATE *WalkState,
ACPI_PARSE_OBJECT *Op,
ACPI_STATUS CallbackStatus);
/*
* psloop - main parse loop
*/
ACPI_STATUS
AcpiPsParseLoop (
ACPI_WALK_STATE *WalkState);
/*
* psscope - Scope stack management routines
*/
ACPI_STATUS
AcpiPsInitScope (
ACPI_PARSE_STATE *ParserState,
ACPI_PARSE_OBJECT *Root);
ACPI_PARSE_OBJECT *
AcpiPsGetParentScope (
ACPI_PARSE_STATE *state);
BOOLEAN
AcpiPsHasCompletedScope (
ACPI_PARSE_STATE *ParserState);
void
AcpiPsPopScope (
ACPI_PARSE_STATE *ParserState,
ACPI_PARSE_OBJECT **Op,
UINT32 *ArgList,
UINT32 *ArgCount);
ACPI_STATUS
AcpiPsPushScope (
ACPI_PARSE_STATE *ParserState,
ACPI_PARSE_OBJECT *Op,
UINT32 RemainingArgs,
UINT32 ArgCount);
void
AcpiPsCleanupScope (
ACPI_PARSE_STATE *state);
/*
* pstree - parse tree manipulation routines
*/
void
AcpiPsAppendArg(
ACPI_PARSE_OBJECT *op,
ACPI_PARSE_OBJECT *arg);
ACPI_PARSE_OBJECT*
AcpiPsFind (
ACPI_PARSE_OBJECT *Scope,
char *Path,
UINT16 Opcode,
UINT32 Create);
ACPI_PARSE_OBJECT *
AcpiPsGetArg(
ACPI_PARSE_OBJECT *op,
UINT32 argn);
ACPI_PARSE_OBJECT *
AcpiPsGetDepthNext (
ACPI_PARSE_OBJECT *Origin,
ACPI_PARSE_OBJECT *Op);
/*
* pswalk - parse tree walk routines
*/
ACPI_STATUS
AcpiPsWalkParsedAml (
ACPI_PARSE_OBJECT *StartOp,
ACPI_PARSE_OBJECT *EndOp,
ACPI_OPERAND_OBJECT *MthDesc,
ACPI_NAMESPACE_NODE *StartNode,
ACPI_OPERAND_OBJECT **Params,
ACPI_OPERAND_OBJECT **CallerReturnDesc,
ACPI_OWNER_ID OwnerId,
ACPI_PARSE_DOWNWARDS DescendingCallback,
ACPI_PARSE_UPWARDS AscendingCallback);
ACPI_STATUS
AcpiPsGetNextWalkOp (
ACPI_WALK_STATE *WalkState,
ACPI_PARSE_OBJECT *Op,
ACPI_PARSE_UPWARDS AscendingCallback);
ACPI_STATUS
AcpiPsDeleteCompletedOp (
ACPI_WALK_STATE *WalkState);
void
AcpiPsDeleteParseTree (
ACPI_PARSE_OBJECT *root);
/*
* psutils - parser utilities
*/
ACPI_PARSE_OBJECT *
AcpiPsCreateScopeOp (
UINT8 *Aml);
void
AcpiPsInitOp (
ACPI_PARSE_OBJECT *op,
UINT16 opcode);
ACPI_PARSE_OBJECT *
AcpiPsAllocOp (
UINT16 Opcode,
UINT8 *Aml);
void
AcpiPsFreeOp (
ACPI_PARSE_OBJECT *Op);
BOOLEAN
AcpiPsIsLeadingChar (
UINT32 c);
UINT32
AcpiPsGetName(
ACPI_PARSE_OBJECT *op);
void
AcpiPsSetName(
ACPI_PARSE_OBJECT *op,
UINT32 name);
/*
* psdump - display parser tree
*/
UINT32
AcpiPsSprintPath (
char *BufferStart,
UINT32 BufferSize,
ACPI_PARSE_OBJECT *Op);
UINT32
AcpiPsSprintOp (
char *BufferStart,
UINT32 BufferSize,
ACPI_PARSE_OBJECT *Op);
void
AcpiPsShow (
ACPI_PARSE_OBJECT *op);
#endif /* __ACPARSER_H__ */
-175
View File
@@ -1,175 +0,0 @@
/******************************************************************************
*
* Name: acpi.h - Master public include file used to interface to ACPICA
*
*****************************************************************************/
/******************************************************************************
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2019, 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.
*
*****************************************************************************
*
* Alternatively, you may choose to be licensed under the terms of the
* following license:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Alternatively, you may choose to be licensed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
*****************************************************************************/
#ifndef __ACPI_H__
#define __ACPI_H__
/*
* Public include files for use by code that will interface to ACPICA.
*
* Information includes the ACPICA data types, names, exceptions, and
* external interface prototypes. Also included are the definitions for
* all ACPI tables (FADT, MADT, etc.)
*
* Note: The order of these include files is important.
*/
#include "platform/acenv.h" /* Environment-specific items */
#include "actypes.h" /* ACPICA data types and structures */
#include "platform/acenvex.h" /* Extra environment-specific items */
#include "acnames.h" /* Common ACPI names and strings */
#include "acexcep.h" /* ACPICA exceptions */
#include "actbl.h" /* ACPI table definitions */
#include "acoutput.h" /* Error output and Debug macros */
#include "acrestyp.h" /* Resource Descriptor structs */
#include "acpiosxf.h" /* OSL interfaces (ACPICA-to-OS) */
#include "acpixf.h" /* ACPI core subsystem external interfaces */
#endif /* __ACPI_H__ */
-705
View File
@@ -1,705 +0,0 @@
/******************************************************************************
*
* Name: acpiosxf.h - All interfaces to the OS Services Layer (OSL). These
* interfaces must be implemented by OSL to interface the
* ACPI components to the host operating system.
*
*****************************************************************************/
/******************************************************************************
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2019, 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.
*
*****************************************************************************
*
* Alternatively, you may choose to be licensed under the terms of the
* following license:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Alternatively, you may choose to be licensed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
*****************************************************************************/
#ifndef __ACPIOSXF_H__
#define __ACPIOSXF_H__
#include "platform/acenv.h"
#include "actypes.h"
/* Types for AcpiOsExecute */
typedef enum
{
OSL_GLOBAL_LOCK_HANDLER,
OSL_NOTIFY_HANDLER,
OSL_GPE_HANDLER,
OSL_DEBUGGER_MAIN_THREAD,
OSL_DEBUGGER_EXEC_THREAD,
OSL_EC_POLL_HANDLER,
OSL_EC_BURST_HANDLER
} ACPI_EXECUTE_TYPE;
#define ACPI_NO_UNIT_LIMIT ((UINT32) -1)
#define ACPI_MUTEX_SEM 1
/* Functions for AcpiOsSignal */
#define ACPI_SIGNAL_FATAL 0
#define ACPI_SIGNAL_BREAKPOINT 1
typedef struct acpi_signal_fatal_info
{
UINT32 Type;
UINT32 Code;
UINT32 Argument;
} ACPI_SIGNAL_FATAL_INFO;
/*
* OSL Initialization and shutdown primitives
*/
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsInitialize
ACPI_STATUS
AcpiOsInitialize (
void);
#endif
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsTerminate
ACPI_STATUS
AcpiOsTerminate (
void);
#endif
/*
* ACPI Table interfaces
*/
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsGetRootPointer
ACPI_PHYSICAL_ADDRESS
AcpiOsGetRootPointer (
void);
#endif
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsPredefinedOverride
ACPI_STATUS
AcpiOsPredefinedOverride (
const ACPI_PREDEFINED_NAMES *InitVal,
ACPI_STRING *NewVal);
#endif
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsTableOverride
ACPI_STATUS
AcpiOsTableOverride (
ACPI_TABLE_HEADER *ExistingTable,
ACPI_TABLE_HEADER **NewTable);
#endif
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsPhysicalTableOverride
ACPI_STATUS
AcpiOsPhysicalTableOverride (
ACPI_TABLE_HEADER *ExistingTable,
ACPI_PHYSICAL_ADDRESS *NewAddress,
UINT32 *NewTableLength);
#endif
/*
* Spinlock primitives
*/
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsCreateLock
ACPI_STATUS
AcpiOsCreateLock (
ACPI_SPINLOCK *OutHandle);
#endif
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsDeleteLock
void
AcpiOsDeleteLock (
ACPI_SPINLOCK Handle);
#endif
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsAcquireLock
ACPI_CPU_FLAGS
AcpiOsAcquireLock (
ACPI_SPINLOCK Handle);
#endif
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsReleaseLock
void
AcpiOsReleaseLock (
ACPI_SPINLOCK Handle,
ACPI_CPU_FLAGS Flags);
#endif
/*
* Semaphore primitives
*/
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsCreateSemaphore
ACPI_STATUS
AcpiOsCreateSemaphore (
UINT32 MaxUnits,
UINT32 InitialUnits,
ACPI_SEMAPHORE *OutHandle);
#endif
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsDeleteSemaphore
ACPI_STATUS
AcpiOsDeleteSemaphore (
ACPI_SEMAPHORE Handle);
#endif
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsWaitSemaphore
ACPI_STATUS
AcpiOsWaitSemaphore (
ACPI_SEMAPHORE Handle,
UINT32 Units,
UINT16 Timeout);
#endif
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsSignalSemaphore
ACPI_STATUS
AcpiOsSignalSemaphore (
ACPI_SEMAPHORE Handle,
UINT32 Units);
#endif
/*
* Mutex primitives. May be configured to use semaphores instead via
* ACPI_MUTEX_TYPE (see platform/acenv.h)
*/
#if (ACPI_MUTEX_TYPE != ACPI_BINARY_SEMAPHORE)
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsCreateMutex
ACPI_STATUS
AcpiOsCreateMutex (
ACPI_MUTEX *OutHandle);
#endif
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsDeleteMutex
void
AcpiOsDeleteMutex (
ACPI_MUTEX Handle);
#endif
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsAcquireMutex
ACPI_STATUS
AcpiOsAcquireMutex (
ACPI_MUTEX Handle,
UINT16 Timeout);
#endif
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsReleaseMutex
void
AcpiOsReleaseMutex (
ACPI_MUTEX Handle);
#endif
#endif
/*
* Memory allocation and mapping
*/
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsAllocate
void *
AcpiOsAllocate (
ACPI_SIZE Size);
#endif
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsAllocateZeroed
void *
AcpiOsAllocateZeroed (
ACPI_SIZE Size);
#endif
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsFree
void
AcpiOsFree (
void * Memory);
#endif
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsMapMemory
void *
AcpiOsMapMemory (
ACPI_PHYSICAL_ADDRESS Where,
ACPI_SIZE Length);
#endif
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsUnmapMemory
void
AcpiOsUnmapMemory (
void *LogicalAddress,
ACPI_SIZE Size);
#endif
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsGetPhysicalAddress
ACPI_STATUS
AcpiOsGetPhysicalAddress (
void *LogicalAddress,
ACPI_PHYSICAL_ADDRESS *PhysicalAddress);
#endif
/*
* Memory/Object Cache
*/
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsCreateCache
ACPI_STATUS
AcpiOsCreateCache (
char *CacheName,
UINT16 ObjectSize,
UINT16 MaxDepth,
ACPI_CACHE_T **ReturnCache);
#endif
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsDeleteCache
ACPI_STATUS
AcpiOsDeleteCache (
ACPI_CACHE_T *Cache);
#endif
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsPurgeCache
ACPI_STATUS
AcpiOsPurgeCache (
ACPI_CACHE_T *Cache);
#endif
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsAcquireObject
void *
AcpiOsAcquireObject (
ACPI_CACHE_T *Cache);
#endif
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsReleaseObject
ACPI_STATUS
AcpiOsReleaseObject (
ACPI_CACHE_T *Cache,
void *Object);
#endif
/*
* Interrupt handlers
*/
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsInstallInterruptHandler
ACPI_STATUS
AcpiOsInstallInterruptHandler (
UINT32 InterruptNumber,
ACPI_OSD_HANDLER ServiceRoutine,
void *Context);
#endif
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsRemoveInterruptHandler
ACPI_STATUS
AcpiOsRemoveInterruptHandler (
UINT32 InterruptNumber,
ACPI_OSD_HANDLER ServiceRoutine);
#endif
/*
* Threads and Scheduling
*/
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsGetThreadId
ACPI_THREAD_ID
AcpiOsGetThreadId (
void);
#endif
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsExecute
ACPI_STATUS
AcpiOsExecute (
ACPI_EXECUTE_TYPE Type,
ACPI_OSD_EXEC_CALLBACK Function,
void *Context);
#endif
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsWaitEventsComplete
void
AcpiOsWaitEventsComplete (
void);
#endif
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsSleep
void
AcpiOsSleep (
UINT64 Milliseconds);
#endif
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsStall
void
AcpiOsStall (
UINT32 Microseconds);
#endif
/*
* Platform and hardware-independent I/O interfaces
*/
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsReadPort
ACPI_STATUS
AcpiOsReadPort (
ACPI_IO_ADDRESS Address,
UINT32 *Value,
UINT32 Width);
#endif
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsWritePort
ACPI_STATUS
AcpiOsWritePort (
ACPI_IO_ADDRESS Address,
UINT32 Value,
UINT32 Width);
#endif
/*
* Platform and hardware-independent physical memory interfaces
*/
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsReadMemory
ACPI_STATUS
AcpiOsReadMemory (
ACPI_PHYSICAL_ADDRESS Address,
UINT64 *Value,
UINT32 Width);
#endif
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsWriteMemory
ACPI_STATUS
AcpiOsWriteMemory (
ACPI_PHYSICAL_ADDRESS Address,
UINT64 Value,
UINT32 Width);
#endif
/*
* Platform and hardware-independent PCI configuration space access
* Note: Can't use "Register" as a parameter, changed to "Reg" --
* certain compilers complain.
*/
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsReadPciConfiguration
ACPI_STATUS
AcpiOsReadPciConfiguration (
ACPI_PCI_ID *PciId,
UINT32 Reg,
UINT64 *Value,
UINT32 Width);
#endif
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsWritePciConfiguration
ACPI_STATUS
AcpiOsWritePciConfiguration (
ACPI_PCI_ID *PciId,
UINT32 Reg,
UINT64 Value,
UINT32 Width);
#endif
/*
* Miscellaneous
*/
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsReadable
BOOLEAN
AcpiOsReadable (
void *Pointer,
ACPI_SIZE Length);
#endif
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsWritable
BOOLEAN
AcpiOsWritable (
void *Pointer,
ACPI_SIZE Length);
#endif
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsGetTimer
UINT64
AcpiOsGetTimer (
void);
#endif
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsSignal
ACPI_STATUS
AcpiOsSignal (
UINT32 Function,
void *Info);
#endif
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsEnterSleep
ACPI_STATUS
AcpiOsEnterSleep (
UINT8 SleepState,
UINT32 RegaValue,
UINT32 RegbValue);
#endif
/*
* Debug print routines
*/
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsPrintf
ACPI_PRINTF_LIKE (1)
void ACPI_INTERNAL_VAR_XFACE
AcpiOsPrintf (
const char *Format,
...);
#endif
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsVprintf
void
AcpiOsVprintf (
const char *Format,
va_list Args);
#endif
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsRedirectOutput
void
AcpiOsRedirectOutput (
void *Destination);
#endif
/*
* Debug IO
*/
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsGetLine
ACPI_STATUS
AcpiOsGetLine (
char *Buffer,
UINT32 BufferLength,
UINT32 *BytesRead);
#endif
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsInitializeDebugger
ACPI_STATUS
AcpiOsInitializeDebugger (
void);
#endif
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsTerminateDebugger
void
AcpiOsTerminateDebugger (
void);
#endif
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsWaitCommandReady
ACPI_STATUS
AcpiOsWaitCommandReady (
void);
#endif
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsNotifyCommandComplete
ACPI_STATUS
AcpiOsNotifyCommandComplete (
void);
#endif
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsTracePoint
void
AcpiOsTracePoint (
ACPI_TRACE_EVENT_TYPE Type,
BOOLEAN Begin,
UINT8 *Aml,
char *Pathname);
#endif
/*
* Obtain ACPI table(s)
*/
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsGetTableByName
ACPI_STATUS
AcpiOsGetTableByName (
char *Signature,
UINT32 Instance,
ACPI_TABLE_HEADER **Table,
ACPI_PHYSICAL_ADDRESS *Address);
#endif
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsGetTableByIndex
ACPI_STATUS
AcpiOsGetTableByIndex (
UINT32 Index,
ACPI_TABLE_HEADER **Table,
UINT32 *Instance,
ACPI_PHYSICAL_ADDRESS *Address);
#endif
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsGetTableByAddress
ACPI_STATUS
AcpiOsGetTableByAddress (
ACPI_PHYSICAL_ADDRESS Address,
ACPI_TABLE_HEADER **Table);
#endif
/*
* Directory manipulation
*/
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsOpenDirectory
void *
AcpiOsOpenDirectory (
char *Pathname,
char *WildcardSpec,
char RequestedFileType);
#endif
/* RequesteFileType values */
#define REQUEST_FILE_ONLY 0
#define REQUEST_DIR_ONLY 1
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsGetNextFilename
char *
AcpiOsGetNextFilename (
void *DirHandle);
#endif
#ifndef ACPI_USE_ALTERNATE_PROTOTYPE_AcpiOsCloseDirectory
void
AcpiOsCloseDirectory (
void *DirHandle);
#endif
#endif /* __ACPIOSXF_H__ */
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
-563
View File
@@ -1,563 +0,0 @@
/******************************************************************************
*
* Name: acresrc.h - Resource Manager function prototypes
*
*****************************************************************************/
/******************************************************************************
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2019, 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.
*
*****************************************************************************
*
* Alternatively, you may choose to be licensed under the terms of the
* following license:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Alternatively, you may choose to be licensed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
*****************************************************************************/
#ifndef __ACRESRC_H__
#define __ACRESRC_H__
/* Need the AML resource descriptor structs */
#include "amlresrc.h"
/*
* If possible, pack the following structures to byte alignment, since we
* don't care about performance for debug output. Two cases where we cannot
* pack the structures:
*
* 1) Hardware does not support misaligned memory transfers
* 2) Compiler does not support pointers within packed structures
*/
#if (!defined(ACPI_MISALIGNMENT_NOT_SUPPORTED) && !defined(ACPI_PACKED_POINTERS_NOT_SUPPORTED))
#pragma pack(1)
#endif
/*
* Individual entry for the resource conversion tables
*/
typedef const struct acpi_rsconvert_info
{
UINT8 Opcode;
UINT8 ResourceOffset;
UINT8 AmlOffset;
UINT8 Value;
} ACPI_RSCONVERT_INFO;
/* Resource conversion opcodes */
typedef enum
{
ACPI_RSC_INITGET = 0,
ACPI_RSC_INITSET,
ACPI_RSC_FLAGINIT,
ACPI_RSC_1BITFLAG,
ACPI_RSC_2BITFLAG,
ACPI_RSC_3BITFLAG,
ACPI_RSC_ADDRESS,
ACPI_RSC_BITMASK,
ACPI_RSC_BITMASK16,
ACPI_RSC_COUNT,
ACPI_RSC_COUNT16,
ACPI_RSC_COUNT_GPIO_PIN,
ACPI_RSC_COUNT_GPIO_RES,
ACPI_RSC_COUNT_GPIO_VEN,
ACPI_RSC_COUNT_SERIAL_RES,
ACPI_RSC_COUNT_SERIAL_VEN,
ACPI_RSC_DATA8,
ACPI_RSC_EXIT_EQ,
ACPI_RSC_EXIT_LE,
ACPI_RSC_EXIT_NE,
ACPI_RSC_LENGTH,
ACPI_RSC_MOVE_GPIO_PIN,
ACPI_RSC_MOVE_GPIO_RES,
ACPI_RSC_MOVE_SERIAL_RES,
ACPI_RSC_MOVE_SERIAL_VEN,
ACPI_RSC_MOVE8,
ACPI_RSC_MOVE16,
ACPI_RSC_MOVE32,
ACPI_RSC_MOVE64,
ACPI_RSC_SET8,
ACPI_RSC_SOURCE,
ACPI_RSC_SOURCEX
} ACPI_RSCONVERT_OPCODES;
/* Resource Conversion sub-opcodes */
#define ACPI_RSC_COMPARE_AML_LENGTH 0
#define ACPI_RSC_COMPARE_VALUE 1
#define ACPI_RSC_TABLE_SIZE(d) (sizeof (d) / sizeof (ACPI_RSCONVERT_INFO))
#define ACPI_RS_OFFSET(f) (UINT8) ACPI_OFFSET (ACPI_RESOURCE,f)
#define AML_OFFSET(f) (UINT8) ACPI_OFFSET (AML_RESOURCE,f)
/*
* Individual entry for the resource dump tables
*/
typedef const struct acpi_rsdump_info
{
UINT8 Opcode;
UINT8 Offset;
const char *Name;
const char **Pointer;
} ACPI_RSDUMP_INFO;
/* Values for the Opcode field above */
typedef enum
{
ACPI_RSD_TITLE = 0,
ACPI_RSD_1BITFLAG,
ACPI_RSD_2BITFLAG,
ACPI_RSD_3BITFLAG,
ACPI_RSD_ADDRESS,
ACPI_RSD_DWORDLIST,
ACPI_RSD_LITERAL,
ACPI_RSD_LONGLIST,
ACPI_RSD_SHORTLIST,
ACPI_RSD_SHORTLISTX,
ACPI_RSD_SOURCE,
ACPI_RSD_STRING,
ACPI_RSD_UINT8,
ACPI_RSD_UINT16,
ACPI_RSD_UINT32,
ACPI_RSD_UINT64,
ACPI_RSD_WORDLIST,
ACPI_RSD_LABEL,
ACPI_RSD_SOURCE_LABEL,
} ACPI_RSDUMP_OPCODES;
/* restore default alignment */
#pragma pack()
/* Resource tables indexed by internal resource type */
extern const UINT8 AcpiGbl_AmlResourceSizes[];
extern const UINT8 AcpiGbl_AmlResourceSerialBusSizes[];
extern ACPI_RSCONVERT_INFO *AcpiGbl_SetResourceDispatch[];
/* Resource tables indexed by raw AML resource descriptor type */
extern const UINT8 AcpiGbl_ResourceStructSizes[];
extern const UINT8 AcpiGbl_ResourceStructSerialBusSizes[];
extern ACPI_RSCONVERT_INFO *AcpiGbl_GetResourceDispatch[];
extern ACPI_RSCONVERT_INFO *AcpiGbl_ConvertResourceSerialBusDispatch[];
typedef struct acpi_vendor_walk_info
{
ACPI_VENDOR_UUID *Uuid;
ACPI_BUFFER *Buffer;
ACPI_STATUS Status;
} ACPI_VENDOR_WALK_INFO;
/*
* rscreate
*/
ACPI_STATUS
AcpiRsCreateResourceList (
ACPI_OPERAND_OBJECT *AmlBuffer,
ACPI_BUFFER *OutputBuffer);
ACPI_STATUS
AcpiRsCreateAmlResources (
ACPI_BUFFER *ResourceList,
ACPI_BUFFER *OutputBuffer);
ACPI_STATUS
AcpiRsCreatePciRoutingTable (
ACPI_OPERAND_OBJECT *PackageObject,
ACPI_BUFFER *OutputBuffer);
/*
* rsutils
*/
ACPI_STATUS
AcpiRsGetPrtMethodData (
ACPI_NAMESPACE_NODE *Node,
ACPI_BUFFER *RetBuffer);
ACPI_STATUS
AcpiRsGetCrsMethodData (
ACPI_NAMESPACE_NODE *Node,
ACPI_BUFFER *RetBuffer);
ACPI_STATUS
AcpiRsGetPrsMethodData (
ACPI_NAMESPACE_NODE *Node,
ACPI_BUFFER *RetBuffer);
ACPI_STATUS
AcpiRsGetMethodData (
ACPI_HANDLE Handle,
const char *Path,
ACPI_BUFFER *RetBuffer);
ACPI_STATUS
AcpiRsSetSrsMethodData (
ACPI_NAMESPACE_NODE *Node,
ACPI_BUFFER *RetBuffer);
ACPI_STATUS
AcpiRsGetAeiMethodData (
ACPI_NAMESPACE_NODE *Node,
ACPI_BUFFER *RetBuffer);
/*
* rscalc
*/
ACPI_STATUS
AcpiRsGetListLength (
UINT8 *AmlBuffer,
UINT32 AmlBufferLength,
ACPI_SIZE *SizeNeeded);
ACPI_STATUS
AcpiRsGetAmlLength (
ACPI_RESOURCE *ResourceList,
ACPI_SIZE ResourceListSize,
ACPI_SIZE *SizeNeeded);
ACPI_STATUS
AcpiRsGetPciRoutingTableLength (
ACPI_OPERAND_OBJECT *PackageObject,
ACPI_SIZE *BufferSizeNeeded);
ACPI_STATUS
AcpiRsConvertAmlToResources (
UINT8 *Aml,
UINT32 Length,
UINT32 Offset,
UINT8 ResourceIndex,
void **Context);
ACPI_STATUS
AcpiRsConvertResourcesToAml (
ACPI_RESOURCE *Resource,
ACPI_SIZE AmlSizeNeeded,
UINT8 *OutputBuffer);
/*
* rsaddr
*/
void
AcpiRsSetAddressCommon (
AML_RESOURCE *Aml,
ACPI_RESOURCE *Resource);
BOOLEAN
AcpiRsGetAddressCommon (
ACPI_RESOURCE *Resource,
AML_RESOURCE *Aml);
/*
* rsmisc
*/
ACPI_STATUS
AcpiRsConvertAmlToResource (
ACPI_RESOURCE *Resource,
AML_RESOURCE *Aml,
ACPI_RSCONVERT_INFO *Info);
ACPI_STATUS
AcpiRsConvertResourceToAml (
ACPI_RESOURCE *Resource,
AML_RESOURCE *Aml,
ACPI_RSCONVERT_INFO *Info);
/*
* rsutils
*/
void
AcpiRsMoveData (
void *Destination,
void *Source,
UINT16 ItemCount,
UINT8 MoveType);
UINT8
AcpiRsDecodeBitmask (
UINT16 Mask,
UINT8 *List);
UINT16
AcpiRsEncodeBitmask (
UINT8 *List,
UINT8 Count);
ACPI_RS_LENGTH
AcpiRsGetResourceSource (
ACPI_RS_LENGTH ResourceLength,
ACPI_RS_LENGTH MinimumLength,
ACPI_RESOURCE_SOURCE *ResourceSource,
AML_RESOURCE *Aml,
char *StringPtr);
ACPI_RSDESC_SIZE
AcpiRsSetResourceSource (
AML_RESOURCE *Aml,
ACPI_RS_LENGTH MinimumLength,
ACPI_RESOURCE_SOURCE *ResourceSource);
void
AcpiRsSetResourceHeader (
UINT8 DescriptorType,
ACPI_RSDESC_SIZE TotalLength,
AML_RESOURCE *Aml);
void
AcpiRsSetResourceLength (
ACPI_RSDESC_SIZE TotalLength,
AML_RESOURCE *Aml);
/*
* rsdump - Debugger support
*/
#ifdef ACPI_DEBUGGER
void
AcpiRsDumpResourceList (
ACPI_RESOURCE *Resource);
void
AcpiRsDumpIrqList (
UINT8 *RouteTable);
#endif
/*
* Resource conversion tables
*/
extern ACPI_RSCONVERT_INFO AcpiRsConvertDma[];
extern ACPI_RSCONVERT_INFO AcpiRsConvertEndDpf[];
extern ACPI_RSCONVERT_INFO AcpiRsConvertIo[];
extern ACPI_RSCONVERT_INFO AcpiRsConvertFixedIo[];
extern ACPI_RSCONVERT_INFO AcpiRsConvertEndTag[];
extern ACPI_RSCONVERT_INFO AcpiRsConvertMemory24[];
extern ACPI_RSCONVERT_INFO AcpiRsConvertGenericReg[];
extern ACPI_RSCONVERT_INFO AcpiRsConvertMemory32[];
extern ACPI_RSCONVERT_INFO AcpiRsConvertFixedMemory32[];
extern ACPI_RSCONVERT_INFO AcpiRsConvertAddress32[];
extern ACPI_RSCONVERT_INFO AcpiRsConvertAddress16[];
extern ACPI_RSCONVERT_INFO AcpiRsConvertExtIrq[];
extern ACPI_RSCONVERT_INFO AcpiRsConvertAddress64[];
extern ACPI_RSCONVERT_INFO AcpiRsConvertExtAddress64[];
extern ACPI_RSCONVERT_INFO AcpiRsConvertGpio[];
extern ACPI_RSCONVERT_INFO AcpiRsConvertFixedDma[];
extern ACPI_RSCONVERT_INFO AcpiRsConvertI2cSerialBus[];
extern ACPI_RSCONVERT_INFO AcpiRsConvertSpiSerialBus[];
extern ACPI_RSCONVERT_INFO AcpiRsConvertUartSerialBus[];
extern ACPI_RSCONVERT_INFO AcpiRsConvertPinFunction[];
extern ACPI_RSCONVERT_INFO AcpiRsConvertPinConfig[];
extern ACPI_RSCONVERT_INFO AcpiRsConvertPinGroup[];
extern ACPI_RSCONVERT_INFO AcpiRsConvertPinGroupFunction[];
extern ACPI_RSCONVERT_INFO AcpiRsConvertPinGroupConfig[];
/* These resources require separate get/set tables */
extern ACPI_RSCONVERT_INFO AcpiRsGetIrq[];
extern ACPI_RSCONVERT_INFO AcpiRsGetStartDpf[];
extern ACPI_RSCONVERT_INFO AcpiRsGetVendorSmall[];
extern ACPI_RSCONVERT_INFO AcpiRsGetVendorLarge[];
extern ACPI_RSCONVERT_INFO AcpiRsSetIrq[];
extern ACPI_RSCONVERT_INFO AcpiRsSetStartDpf[];
extern ACPI_RSCONVERT_INFO AcpiRsSetVendor[];
#if defined(ACPI_DEBUG_OUTPUT) || defined(ACPI_DEBUGGER)
/*
* rsinfo
*/
extern ACPI_RSDUMP_INFO *AcpiGbl_DumpResourceDispatch[];
extern ACPI_RSDUMP_INFO *AcpiGbl_DumpSerialBusDispatch[];
/*
* rsdumpinfo
*/
extern ACPI_RSDUMP_INFO AcpiRsDumpIrq[];
extern ACPI_RSDUMP_INFO AcpiRsDumpPrt[];
extern ACPI_RSDUMP_INFO AcpiRsDumpDma[];
extern ACPI_RSDUMP_INFO AcpiRsDumpStartDpf[];
extern ACPI_RSDUMP_INFO AcpiRsDumpEndDpf[];
extern ACPI_RSDUMP_INFO AcpiRsDumpIo[];
extern ACPI_RSDUMP_INFO AcpiRsDumpIoFlags[];
extern ACPI_RSDUMP_INFO AcpiRsDumpFixedIo[];
extern ACPI_RSDUMP_INFO AcpiRsDumpVendor[];
extern ACPI_RSDUMP_INFO AcpiRsDumpEndTag[];
extern ACPI_RSDUMP_INFO AcpiRsDumpMemory24[];
extern ACPI_RSDUMP_INFO AcpiRsDumpMemory32[];
extern ACPI_RSDUMP_INFO AcpiRsDumpMemoryFlags[];
extern ACPI_RSDUMP_INFO AcpiRsDumpFixedMemory32[];
extern ACPI_RSDUMP_INFO AcpiRsDumpAddress16[];
extern ACPI_RSDUMP_INFO AcpiRsDumpAddress32[];
extern ACPI_RSDUMP_INFO AcpiRsDumpAddress64[];
extern ACPI_RSDUMP_INFO AcpiRsDumpExtAddress64[];
extern ACPI_RSDUMP_INFO AcpiRsDumpExtIrq[];
extern ACPI_RSDUMP_INFO AcpiRsDumpGenericReg[];
extern ACPI_RSDUMP_INFO AcpiRsDumpGpio[];
extern ACPI_RSDUMP_INFO AcpiRsDumpPinFunction[];
extern ACPI_RSDUMP_INFO AcpiRsDumpFixedDma[];
extern ACPI_RSDUMP_INFO AcpiRsDumpCommonSerialBus[];
extern ACPI_RSDUMP_INFO AcpiRsDumpI2cSerialBus[];
extern ACPI_RSDUMP_INFO AcpiRsDumpSpiSerialBus[];
extern ACPI_RSDUMP_INFO AcpiRsDumpUartSerialBus[];
extern ACPI_RSDUMP_INFO AcpiRsDumpGeneralFlags[];
extern ACPI_RSDUMP_INFO AcpiRsDumpPinConfig[];
extern ACPI_RSDUMP_INFO AcpiRsDumpPinGroup[];
extern ACPI_RSDUMP_INFO AcpiRsDumpPinGroupFunction[];
extern ACPI_RSDUMP_INFO AcpiRsDumpPinGroupConfig[];
#endif
#endif /* __ACRESRC_H__ */
-924
View File
@@ -1,924 +0,0 @@
/******************************************************************************
*
* Name: acrestyp.h - Defines, types, and structures for resource descriptors
*
*****************************************************************************/
/******************************************************************************
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2019, 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.
*
*****************************************************************************
*
* Alternatively, you may choose to be licensed under the terms of the
* following license:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Alternatively, you may choose to be licensed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
*****************************************************************************/
#ifndef __ACRESTYP_H__
#define __ACRESTYP_H__
/*
* Definitions for Resource Attributes
*/
typedef UINT16 ACPI_RS_LENGTH; /* Resource Length field is fixed at 16 bits */
typedef UINT32 ACPI_RSDESC_SIZE; /* Max Resource Descriptor size is (Length+3) = (64K-1)+3 */
/*
* Memory Attributes
*/
#define ACPI_READ_ONLY_MEMORY (UINT8) 0x00
#define ACPI_READ_WRITE_MEMORY (UINT8) 0x01
#define ACPI_NON_CACHEABLE_MEMORY (UINT8) 0x00
#define ACPI_CACHABLE_MEMORY (UINT8) 0x01
#define ACPI_WRITE_COMBINING_MEMORY (UINT8) 0x02
#define ACPI_PREFETCHABLE_MEMORY (UINT8) 0x03
/*! [Begin] no source code translation */
/*
* IO Attributes
* The ISA IO ranges are: n000-n0FFh, n400-n4FFh, n800-n8FFh, nC00-nCFFh.
* The non-ISA IO ranges are: n100-n3FFh, n500-n7FFh, n900-nBFFh, nCD0-nFFFh.
*/
/*! [End] no source code translation !*/
#define ACPI_NON_ISA_ONLY_RANGES (UINT8) 0x01
#define ACPI_ISA_ONLY_RANGES (UINT8) 0x02
#define ACPI_ENTIRE_RANGE (ACPI_NON_ISA_ONLY_RANGES | ACPI_ISA_ONLY_RANGES)
/* Type of translation - 1=Sparse, 0=Dense */
#define ACPI_SPARSE_TRANSLATION (UINT8) 0x01
/*
* IO Port Descriptor Decode
*/
#define ACPI_DECODE_10 (UINT8) 0x00 /* 10-bit IO address decode */
#define ACPI_DECODE_16 (UINT8) 0x01 /* 16-bit IO address decode */
/*
* Interrupt attributes - used in multiple descriptors
*/
/* Triggering */
#define ACPI_LEVEL_SENSITIVE (UINT8) 0x00
#define ACPI_EDGE_SENSITIVE (UINT8) 0x01
/* Polarity */
#define ACPI_ACTIVE_HIGH (UINT8) 0x00
#define ACPI_ACTIVE_LOW (UINT8) 0x01
#define ACPI_ACTIVE_BOTH (UINT8) 0x02
/* Sharing */
#define ACPI_EXCLUSIVE (UINT8) 0x00
#define ACPI_SHARED (UINT8) 0x01
/* Wake */
#define ACPI_NOT_WAKE_CAPABLE (UINT8) 0x00
#define ACPI_WAKE_CAPABLE (UINT8) 0x01
/*
* DMA Attributes
*/
#define ACPI_COMPATIBILITY (UINT8) 0x00
#define ACPI_TYPE_A (UINT8) 0x01
#define ACPI_TYPE_B (UINT8) 0x02
#define ACPI_TYPE_F (UINT8) 0x03
#define ACPI_NOT_BUS_MASTER (UINT8) 0x00
#define ACPI_BUS_MASTER (UINT8) 0x01
#define ACPI_TRANSFER_8 (UINT8) 0x00
#define ACPI_TRANSFER_8_16 (UINT8) 0x01
#define ACPI_TRANSFER_16 (UINT8) 0x02
/*
* Start Dependent Functions Priority definitions
*/
#define ACPI_GOOD_CONFIGURATION (UINT8) 0x00
#define ACPI_ACCEPTABLE_CONFIGURATION (UINT8) 0x01
#define ACPI_SUB_OPTIMAL_CONFIGURATION (UINT8) 0x02
/*
* 16, 32 and 64-bit Address Descriptor resource types
*/
#define ACPI_MEMORY_RANGE (UINT8) 0x00
#define ACPI_IO_RANGE (UINT8) 0x01
#define ACPI_BUS_NUMBER_RANGE (UINT8) 0x02
#define ACPI_ADDRESS_NOT_FIXED (UINT8) 0x00
#define ACPI_ADDRESS_FIXED (UINT8) 0x01
#define ACPI_POS_DECODE (UINT8) 0x00
#define ACPI_SUB_DECODE (UINT8) 0x01
/* Producer/Consumer */
#define ACPI_PRODUCER (UINT8) 0x00
#define ACPI_CONSUMER (UINT8) 0x01
/*
* If possible, pack the following structures to byte alignment
*/
#ifndef ACPI_MISALIGNMENT_NOT_SUPPORTED
#pragma pack(1)
#endif
/* UUID data structures for use in vendor-defined resource descriptors */
typedef struct acpi_uuid
{
UINT8 Data[ACPI_UUID_LENGTH];
} ACPI_UUID;
typedef struct acpi_vendor_uuid
{
UINT8 Subtype;
UINT8 Data[ACPI_UUID_LENGTH];
} ACPI_VENDOR_UUID;
/*
* Structures used to describe device resources
*/
typedef struct acpi_resource_irq
{
UINT8 DescriptorLength;
UINT8 Triggering;
UINT8 Polarity;
UINT8 Shareable;
UINT8 WakeCapable;
UINT8 InterruptCount;
UINT8 Interrupts[1];
} ACPI_RESOURCE_IRQ;
typedef struct acpi_resource_dma
{
UINT8 Type;
UINT8 BusMaster;
UINT8 Transfer;
UINT8 ChannelCount;
UINT8 Channels[1];
} ACPI_RESOURCE_DMA;
typedef struct acpi_resource_start_dependent
{
UINT8 DescriptorLength;
UINT8 CompatibilityPriority;
UINT8 PerformanceRobustness;
} ACPI_RESOURCE_START_DEPENDENT;
/*
* The END_DEPENDENT_FUNCTIONS_RESOURCE struct is not
* needed because it has no fields
*/
typedef struct acpi_resource_io
{
UINT8 IoDecode;
UINT8 Alignment;
UINT8 AddressLength;
UINT16 Minimum;
UINT16 Maximum;
} ACPI_RESOURCE_IO;
typedef struct acpi_resource_fixed_io
{
UINT16 Address;
UINT8 AddressLength;
} ACPI_RESOURCE_FIXED_IO;
typedef struct acpi_resource_fixed_dma
{
UINT16 RequestLines;
UINT16 Channels;
UINT8 Width;
} ACPI_RESOURCE_FIXED_DMA;
/* Values for Width field above */
#define ACPI_DMA_WIDTH8 0
#define ACPI_DMA_WIDTH16 1
#define ACPI_DMA_WIDTH32 2
#define ACPI_DMA_WIDTH64 3
#define ACPI_DMA_WIDTH128 4
#define ACPI_DMA_WIDTH256 5
typedef struct acpi_resource_vendor
{
UINT16 ByteLength;
UINT8 ByteData[1];
} ACPI_RESOURCE_VENDOR;
/* Vendor resource with UUID info (introduced in ACPI 3.0) */
typedef struct acpi_resource_vendor_typed
{
UINT16 ByteLength;
UINT8 UuidSubtype;
UINT8 Uuid[ACPI_UUID_LENGTH];
UINT8 ByteData[1];
} ACPI_RESOURCE_VENDOR_TYPED;
typedef struct acpi_resource_end_tag
{
UINT8 Checksum;
} ACPI_RESOURCE_END_TAG;
typedef struct acpi_resource_memory24
{
UINT8 WriteProtect;
UINT16 Minimum;
UINT16 Maximum;
UINT16 Alignment;
UINT16 AddressLength;
} ACPI_RESOURCE_MEMORY24;
typedef struct acpi_resource_memory32
{
UINT8 WriteProtect;
UINT32 Minimum;
UINT32 Maximum;
UINT32 Alignment;
UINT32 AddressLength;
} ACPI_RESOURCE_MEMORY32;
typedef struct acpi_resource_fixed_memory32
{
UINT8 WriteProtect;
UINT32 Address;
UINT32 AddressLength;
} ACPI_RESOURCE_FIXED_MEMORY32;
typedef struct acpi_memory_attribute
{
UINT8 WriteProtect;
UINT8 Caching;
UINT8 RangeType;
UINT8 Translation;
} ACPI_MEMORY_ATTRIBUTE;
typedef struct acpi_io_attribute
{
UINT8 RangeType;
UINT8 Translation;
UINT8 TranslationType;
UINT8 Reserved1;
} ACPI_IO_ATTRIBUTE;
typedef union acpi_resource_attribute
{
ACPI_MEMORY_ATTRIBUTE Mem;
ACPI_IO_ATTRIBUTE Io;
/* Used for the *WordSpace macros */
UINT8 TypeSpecific;
} ACPI_RESOURCE_ATTRIBUTE;
typedef struct acpi_resource_label
{
UINT16 StringLength;
char *StringPtr;
} ACPI_RESOURCE_LABEL;
typedef struct acpi_resource_source
{
UINT8 Index;
UINT16 StringLength;
char *StringPtr;
} ACPI_RESOURCE_SOURCE;
/* Fields common to all address descriptors, 16/32/64 bit */
#define ACPI_RESOURCE_ADDRESS_COMMON \
UINT8 ResourceType; \
UINT8 ProducerConsumer; \
UINT8 Decode; \
UINT8 MinAddressFixed; \
UINT8 MaxAddressFixed; \
ACPI_RESOURCE_ATTRIBUTE Info;
typedef struct acpi_address16_attribute
{
UINT16 Granularity;
UINT16 Minimum;
UINT16 Maximum;
UINT16 TranslationOffset;
UINT16 AddressLength;
} ACPI_ADDRESS16_ATTRIBUTE;
typedef struct acpi_address32_attribute
{
UINT32 Granularity;
UINT32 Minimum;
UINT32 Maximum;
UINT32 TranslationOffset;
UINT32 AddressLength;
} ACPI_ADDRESS32_ATTRIBUTE;
typedef struct acpi_address64_attribute
{
UINT64 Granularity;
UINT64 Minimum;
UINT64 Maximum;
UINT64 TranslationOffset;
UINT64 AddressLength;
} ACPI_ADDRESS64_ATTRIBUTE;
typedef struct acpi_resource_address
{
ACPI_RESOURCE_ADDRESS_COMMON
} ACPI_RESOURCE_ADDRESS;
typedef struct acpi_resource_address16
{
ACPI_RESOURCE_ADDRESS_COMMON
ACPI_ADDRESS16_ATTRIBUTE Address;
ACPI_RESOURCE_SOURCE ResourceSource;
} ACPI_RESOURCE_ADDRESS16;
typedef struct acpi_resource_address32
{
ACPI_RESOURCE_ADDRESS_COMMON
ACPI_ADDRESS32_ATTRIBUTE Address;
ACPI_RESOURCE_SOURCE ResourceSource;
} ACPI_RESOURCE_ADDRESS32;
typedef struct acpi_resource_address64
{
ACPI_RESOURCE_ADDRESS_COMMON
ACPI_ADDRESS64_ATTRIBUTE Address;
ACPI_RESOURCE_SOURCE ResourceSource;
} ACPI_RESOURCE_ADDRESS64;
typedef struct acpi_resource_extended_address64
{
ACPI_RESOURCE_ADDRESS_COMMON
UINT8 RevisionID;
ACPI_ADDRESS64_ATTRIBUTE Address;
UINT64 TypeSpecific;
} ACPI_RESOURCE_EXTENDED_ADDRESS64;
typedef struct acpi_resource_extended_irq
{
UINT8 ProducerConsumer;
UINT8 Triggering;
UINT8 Polarity;
UINT8 Shareable;
UINT8 WakeCapable;
UINT8 InterruptCount;
ACPI_RESOURCE_SOURCE ResourceSource;
UINT32 Interrupts[1];
} ACPI_RESOURCE_EXTENDED_IRQ;
typedef struct acpi_resource_generic_register
{
UINT8 SpaceId;
UINT8 BitWidth;
UINT8 BitOffset;
UINT8 AccessSize;
UINT64 Address;
} ACPI_RESOURCE_GENERIC_REGISTER;
typedef struct acpi_resource_gpio
{
UINT8 RevisionId;
UINT8 ConnectionType;
UINT8 ProducerConsumer; /* For values, see Producer/Consumer above */
UINT8 PinConfig;
UINT8 Shareable; /* For values, see Interrupt Attributes above */
UINT8 WakeCapable; /* For values, see Interrupt Attributes above */
UINT8 IoRestriction;
UINT8 Triggering; /* For values, see Interrupt Attributes above */
UINT8 Polarity; /* For values, see Interrupt Attributes above */
UINT16 DriveStrength;
UINT16 DebounceTimeout;
UINT16 PinTableLength;
UINT16 VendorLength;
ACPI_RESOURCE_SOURCE ResourceSource;
UINT16 *PinTable;
UINT8 *VendorData;
} ACPI_RESOURCE_GPIO;
/* Values for GPIO ConnectionType field above */
#define ACPI_RESOURCE_GPIO_TYPE_INT 0
#define ACPI_RESOURCE_GPIO_TYPE_IO 1
/* Values for PinConfig field above */
#define ACPI_PIN_CONFIG_DEFAULT 0
#define ACPI_PIN_CONFIG_PULLUP 1
#define ACPI_PIN_CONFIG_PULLDOWN 2
#define ACPI_PIN_CONFIG_NOPULL 3
/* Values for IoRestriction field above */
#define ACPI_IO_RESTRICT_NONE 0
#define ACPI_IO_RESTRICT_INPUT 1
#define ACPI_IO_RESTRICT_OUTPUT 2
#define ACPI_IO_RESTRICT_NONE_PRESERVE 3
/* Common structure for I2C, SPI, and UART serial descriptors */
#define ACPI_RESOURCE_SERIAL_COMMON \
UINT8 RevisionId; \
UINT8 Type; \
UINT8 ProducerConsumer; /* For values, see Producer/Consumer above */\
UINT8 SlaveMode; \
UINT8 ConnectionSharing; \
UINT8 TypeRevisionId; \
UINT16 TypeDataLength; \
UINT16 VendorLength; \
ACPI_RESOURCE_SOURCE ResourceSource; \
UINT8 *VendorData;
typedef struct acpi_resource_common_serialbus
{
ACPI_RESOURCE_SERIAL_COMMON
} ACPI_RESOURCE_COMMON_SERIALBUS;
/* Values for the Type field above */
#define ACPI_RESOURCE_SERIAL_TYPE_I2C 1
#define ACPI_RESOURCE_SERIAL_TYPE_SPI 2
#define ACPI_RESOURCE_SERIAL_TYPE_UART 3
/* Values for SlaveMode field above */
#define ACPI_CONTROLLER_INITIATED 0
#define ACPI_DEVICE_INITIATED 1
typedef struct acpi_resource_i2c_serialbus
{
ACPI_RESOURCE_SERIAL_COMMON
UINT8 AccessMode;
UINT16 SlaveAddress;
UINT32 ConnectionSpeed;
} ACPI_RESOURCE_I2C_SERIALBUS;
/* Values for AccessMode field above */
#define ACPI_I2C_7BIT_MODE 0
#define ACPI_I2C_10BIT_MODE 1
typedef struct acpi_resource_spi_serialbus
{
ACPI_RESOURCE_SERIAL_COMMON
UINT8 WireMode;
UINT8 DevicePolarity;
UINT8 DataBitLength;
UINT8 ClockPhase;
UINT8 ClockPolarity;
UINT16 DeviceSelection;
UINT32 ConnectionSpeed;
} ACPI_RESOURCE_SPI_SERIALBUS;
/* Values for WireMode field above */
#define ACPI_SPI_4WIRE_MODE 0
#define ACPI_SPI_3WIRE_MODE 1
/* Values for DevicePolarity field above */
#define ACPI_SPI_ACTIVE_LOW 0
#define ACPI_SPI_ACTIVE_HIGH 1
/* Values for ClockPhase field above */
#define ACPI_SPI_FIRST_PHASE 0
#define ACPI_SPI_SECOND_PHASE 1
/* Values for ClockPolarity field above */
#define ACPI_SPI_START_LOW 0
#define ACPI_SPI_START_HIGH 1
typedef struct acpi_resource_uart_serialbus
{
ACPI_RESOURCE_SERIAL_COMMON
UINT8 Endian;
UINT8 DataBits;
UINT8 StopBits;
UINT8 FlowControl;
UINT8 Parity;
UINT8 LinesEnabled;
UINT16 RxFifoSize;
UINT16 TxFifoSize;
UINT32 DefaultBaudRate;
} ACPI_RESOURCE_UART_SERIALBUS;
/* Values for Endian field above */
#define ACPI_UART_LITTLE_ENDIAN 0
#define ACPI_UART_BIG_ENDIAN 1
/* Values for DataBits field above */
#define ACPI_UART_5_DATA_BITS 0
#define ACPI_UART_6_DATA_BITS 1
#define ACPI_UART_7_DATA_BITS 2
#define ACPI_UART_8_DATA_BITS 3
#define ACPI_UART_9_DATA_BITS 4
/* Values for StopBits field above */
#define ACPI_UART_NO_STOP_BITS 0
#define ACPI_UART_1_STOP_BIT 1
#define ACPI_UART_1P5_STOP_BITS 2
#define ACPI_UART_2_STOP_BITS 3
/* Values for FlowControl field above */
#define ACPI_UART_FLOW_CONTROL_NONE 0
#define ACPI_UART_FLOW_CONTROL_HW 1
#define ACPI_UART_FLOW_CONTROL_XON_XOFF 2
/* Values for Parity field above */
#define ACPI_UART_PARITY_NONE 0
#define ACPI_UART_PARITY_EVEN 1
#define ACPI_UART_PARITY_ODD 2
#define ACPI_UART_PARITY_MARK 3
#define ACPI_UART_PARITY_SPACE 4
/* Values for LinesEnabled bitfield above */
#define ACPI_UART_CARRIER_DETECT (1<<2)
#define ACPI_UART_RING_INDICATOR (1<<3)
#define ACPI_UART_DATA_SET_READY (1<<4)
#define ACPI_UART_DATA_TERMINAL_READY (1<<5)
#define ACPI_UART_CLEAR_TO_SEND (1<<6)
#define ACPI_UART_REQUEST_TO_SEND (1<<7)
typedef struct acpi_resource_pin_function
{
UINT8 RevisionId;
UINT8 PinConfig;
UINT8 Shareable; /* For values, see Interrupt Attributes above */
UINT16 FunctionNumber;
UINT16 PinTableLength;
UINT16 VendorLength;
ACPI_RESOURCE_SOURCE ResourceSource;
UINT16 *PinTable;
UINT8 *VendorData;
} ACPI_RESOURCE_PIN_FUNCTION;
typedef struct acpi_resource_pin_config
{
UINT8 RevisionId;
UINT8 ProducerConsumer; /* For values, see Producer/Consumer above */
UINT8 Shareable; /* For values, see Interrupt Attributes above */
UINT8 PinConfigType;
UINT32 PinConfigValue;
UINT16 PinTableLength;
UINT16 VendorLength;
ACPI_RESOURCE_SOURCE ResourceSource;
UINT16 *PinTable;
UINT8 *VendorData;
} ACPI_RESOURCE_PIN_CONFIG;
/* Values for PinConfigType field above */
#define ACPI_PIN_CONFIG_DEFAULT 0
#define ACPI_PIN_CONFIG_BIAS_PULL_UP 1
#define ACPI_PIN_CONFIG_BIAS_PULL_DOWN 2
#define ACPI_PIN_CONFIG_BIAS_DEFAULT 3
#define ACPI_PIN_CONFIG_BIAS_DISABLE 4
#define ACPI_PIN_CONFIG_BIAS_HIGH_IMPEDANCE 5
#define ACPI_PIN_CONFIG_BIAS_BUS_HOLD 6
#define ACPI_PIN_CONFIG_DRIVE_OPEN_DRAIN 7
#define ACPI_PIN_CONFIG_DRIVE_OPEN_SOURCE 8
#define ACPI_PIN_CONFIG_DRIVE_PUSH_PULL 9
#define ACPI_PIN_CONFIG_DRIVE_STRENGTH 10
#define ACPI_PIN_CONFIG_SLEW_RATE 11
#define ACPI_PIN_CONFIG_INPUT_DEBOUNCE 12
#define ACPI_PIN_CONFIG_INPUT_SCHMITT_TRIGGER 13
typedef struct acpi_resource_pin_group
{
UINT8 RevisionId;
UINT8 ProducerConsumer; /* For values, see Producer/Consumer above */
UINT16 PinTableLength;
UINT16 VendorLength;
UINT16 *PinTable;
ACPI_RESOURCE_LABEL ResourceLabel;
UINT8 *VendorData;
} ACPI_RESOURCE_PIN_GROUP;
typedef struct acpi_resource_pin_group_function
{
UINT8 RevisionId;
UINT8 ProducerConsumer; /* For values, see Producer/Consumer above */
UINT8 Shareable; /* For values, see Interrupt Attributes above */
UINT16 FunctionNumber;
UINT16 VendorLength;
ACPI_RESOURCE_SOURCE ResourceSource;
ACPI_RESOURCE_LABEL ResourceSourceLabel;
UINT8 *VendorData;
} ACPI_RESOURCE_PIN_GROUP_FUNCTION;
typedef struct acpi_resource_pin_group_config
{
UINT8 RevisionId;
UINT8 ProducerConsumer; /* For values, see Producer/Consumer above */
UINT8 Shareable; /* For values, see Interrupt Attributes above */
UINT8 PinConfigType; /* For values, see PinConfigType above */
UINT32 PinConfigValue;
UINT16 VendorLength;
ACPI_RESOURCE_SOURCE ResourceSource;
ACPI_RESOURCE_LABEL ResourceSourceLabel;
UINT8 *VendorData;
} ACPI_RESOURCE_PIN_GROUP_CONFIG;
/* ACPI_RESOURCE_TYPEs */
#define ACPI_RESOURCE_TYPE_IRQ 0
#define ACPI_RESOURCE_TYPE_DMA 1
#define ACPI_RESOURCE_TYPE_START_DEPENDENT 2
#define ACPI_RESOURCE_TYPE_END_DEPENDENT 3
#define ACPI_RESOURCE_TYPE_IO 4
#define ACPI_RESOURCE_TYPE_FIXED_IO 5
#define ACPI_RESOURCE_TYPE_VENDOR 6
#define ACPI_RESOURCE_TYPE_END_TAG 7
#define ACPI_RESOURCE_TYPE_MEMORY24 8
#define ACPI_RESOURCE_TYPE_MEMORY32 9
#define ACPI_RESOURCE_TYPE_FIXED_MEMORY32 10
#define ACPI_RESOURCE_TYPE_ADDRESS16 11
#define ACPI_RESOURCE_TYPE_ADDRESS32 12
#define ACPI_RESOURCE_TYPE_ADDRESS64 13
#define ACPI_RESOURCE_TYPE_EXTENDED_ADDRESS64 14 /* ACPI 3.0 */
#define ACPI_RESOURCE_TYPE_EXTENDED_IRQ 15
#define ACPI_RESOURCE_TYPE_GENERIC_REGISTER 16
#define ACPI_RESOURCE_TYPE_GPIO 17 /* ACPI 5.0 */
#define ACPI_RESOURCE_TYPE_FIXED_DMA 18 /* ACPI 5.0 */
#define ACPI_RESOURCE_TYPE_SERIAL_BUS 19 /* ACPI 5.0 */
#define ACPI_RESOURCE_TYPE_PIN_FUNCTION 20 /* ACPI 6.2 */
#define ACPI_RESOURCE_TYPE_PIN_CONFIG 21 /* ACPI 6.2 */
#define ACPI_RESOURCE_TYPE_PIN_GROUP 22 /* ACPI 6.2 */
#define ACPI_RESOURCE_TYPE_PIN_GROUP_FUNCTION 23 /* ACPI 6.2 */
#define ACPI_RESOURCE_TYPE_PIN_GROUP_CONFIG 24 /* ACPI 6.2 */
#define ACPI_RESOURCE_TYPE_MAX 24
/* Master union for resource descriptors */
typedef union acpi_resource_data
{
ACPI_RESOURCE_IRQ Irq;
ACPI_RESOURCE_DMA Dma;
ACPI_RESOURCE_START_DEPENDENT StartDpf;
ACPI_RESOURCE_IO Io;
ACPI_RESOURCE_FIXED_IO FixedIo;
ACPI_RESOURCE_FIXED_DMA FixedDma;
ACPI_RESOURCE_VENDOR Vendor;
ACPI_RESOURCE_VENDOR_TYPED VendorTyped;
ACPI_RESOURCE_END_TAG EndTag;
ACPI_RESOURCE_MEMORY24 Memory24;
ACPI_RESOURCE_MEMORY32 Memory32;
ACPI_RESOURCE_FIXED_MEMORY32 FixedMemory32;
ACPI_RESOURCE_ADDRESS16 Address16;
ACPI_RESOURCE_ADDRESS32 Address32;
ACPI_RESOURCE_ADDRESS64 Address64;
ACPI_RESOURCE_EXTENDED_ADDRESS64 ExtAddress64;
ACPI_RESOURCE_EXTENDED_IRQ ExtendedIrq;
ACPI_RESOURCE_GENERIC_REGISTER GenericReg;
ACPI_RESOURCE_GPIO Gpio;
ACPI_RESOURCE_I2C_SERIALBUS I2cSerialBus;
ACPI_RESOURCE_SPI_SERIALBUS SpiSerialBus;
ACPI_RESOURCE_UART_SERIALBUS UartSerialBus;
ACPI_RESOURCE_COMMON_SERIALBUS CommonSerialBus;
ACPI_RESOURCE_PIN_FUNCTION PinFunction;
ACPI_RESOURCE_PIN_CONFIG PinConfig;
ACPI_RESOURCE_PIN_GROUP PinGroup;
ACPI_RESOURCE_PIN_GROUP_FUNCTION PinGroupFunction;
ACPI_RESOURCE_PIN_GROUP_CONFIG PinGroupConfig;
/* Common fields */
ACPI_RESOURCE_ADDRESS Address; /* Common 16/32/64 address fields */
} ACPI_RESOURCE_DATA;
/* Common resource header */
typedef struct acpi_resource
{
UINT32 Type;
UINT32 Length;
ACPI_RESOURCE_DATA Data;
} ACPI_RESOURCE;
/* restore default alignment */
#pragma pack()
#define ACPI_RS_SIZE_NO_DATA 8 /* Id + Length fields */
#define ACPI_RS_SIZE_MIN (UINT32) ACPI_ROUND_UP_TO_NATIVE_WORD (12)
#define ACPI_RS_SIZE(Type) (UINT32) (ACPI_RS_SIZE_NO_DATA + sizeof (Type))
/* Macro for walking resource templates with multiple descriptors */
#define ACPI_NEXT_RESOURCE(Res) \
ACPI_ADD_PTR (ACPI_RESOURCE, (Res), (Res)->Length)
typedef struct acpi_pci_routing_table
{
UINT32 Length;
UINT32 Pin;
UINT64 Address; /* here for 64-bit alignment */
UINT32 SourceIndex;
char Source[4]; /* pad to 64 bits so sizeof() works in all cases */
} ACPI_PCI_ROUTING_TABLE;
#endif /* __ACRESTYP_H__ */
-393
View File
@@ -1,393 +0,0 @@
/******************************************************************************
*
* Name: acstruct.h - Internal structs
*
*****************************************************************************/
/******************************************************************************
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2019, 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.
*
*****************************************************************************
*
* Alternatively, you may choose to be licensed under the terms of the
* following license:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Alternatively, you may choose to be licensed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
*****************************************************************************/
#ifndef __ACSTRUCT_H__
#define __ACSTRUCT_H__
/* acpisrc:StructDefs -- for acpisrc conversion */
/*****************************************************************************
*
* Tree walking typedefs and structs
*
****************************************************************************/
/*
* Walk state - current state of a parse tree walk. Used for both a leisurely
* stroll through the tree (for whatever reason), and for control method
* execution.
*/
#define ACPI_NEXT_OP_DOWNWARD 1
#define ACPI_NEXT_OP_UPWARD 2
/*
* Groups of definitions for WalkType used for different implementations of
* walkers (never simultaneously) - flags for interpreter:
*/
#define ACPI_WALK_NON_METHOD 0
#define ACPI_WALK_METHOD 0x01
#define ACPI_WALK_METHOD_RESTART 0x02
typedef struct acpi_walk_state
{
struct acpi_walk_state *Next; /* Next WalkState in list */
UINT8 DescriptorType; /* To differentiate various internal objs */
UINT8 WalkType;
UINT16 Opcode; /* Current AML opcode */
UINT8 NextOpInfo; /* Info about NextOp */
UINT8 NumOperands; /* Stack pointer for Operands[] array */
UINT8 OperandIndex; /* Index into operand stack, to be used by AcpiDsObjStackPush */
ACPI_OWNER_ID OwnerId; /* Owner of objects created during the walk */
BOOLEAN LastPredicate; /* Result of last predicate */
UINT8 CurrentResult;
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 */
UINT8 *Aml;
UINT32 ArgTypes;
UINT32 MethodBreakpoint; /* For single stepping */
UINT32 UserBreakpoint; /* User AML breakpoint */
UINT32 ParseFlags;
ACPI_PARSE_STATE ParserState; /* Current state of parser */
UINT32 PrevArgTypes;
UINT32 ArgCount; /* push for fixed or var args */
UINT16 MethodNestingDepth;
UINT8 MethodIsNested;
struct acpi_namespace_node Arguments[ACPI_METHOD_NUM_ARGS]; /* Control method arguments */
struct acpi_namespace_node LocalVariables[ACPI_METHOD_NUM_LOCALS]; /* Control method locals */
union acpi_operand_object *Operands[ACPI_OBJ_NUM_OPERANDS + 1]; /* Operands passed to the interpreter (+1 for NULL terminator) */
union acpi_operand_object **Params;
UINT8 *AmlLastWhile;
union acpi_operand_object **CallerReturnDesc;
ACPI_GENERIC_STATE *ControlState; /* List of control states (nested IFs) */
struct acpi_namespace_node *DeferredNode; /* Used when executing deferred opcodes */
union acpi_operand_object *ImplicitReturnObj;
struct acpi_namespace_node *MethodCallNode; /* Called method Node*/
ACPI_PARSE_OBJECT *MethodCallOp; /* MethodCall Op if running a method */
union acpi_operand_object *MethodDesc; /* Method descriptor if running a method */
struct acpi_namespace_node *MethodNode; /* Method node if running a method */
char *MethodPathname; /* Full pathname of running method */
ACPI_PARSE_OBJECT *Op; /* Current parser op */
const ACPI_OPCODE_INFO *OpInfo; /* Info on current opcode */
ACPI_PARSE_OBJECT *Origin; /* Start of walk [Obsolete] */
union acpi_operand_object *ResultObj;
ACPI_GENERIC_STATE *Results; /* Stack of accumulated results */
union acpi_operand_object *ReturnDesc; /* Return object, if any */
ACPI_GENERIC_STATE *ScopeInfo; /* Stack of nested scopes */
ACPI_PARSE_OBJECT *PrevOp; /* Last op that was processed */
ACPI_PARSE_OBJECT *NextOp; /* next op to be processed */
ACPI_THREAD_STATE *Thread;
ACPI_PARSE_DOWNWARDS DescendingCallback;
ACPI_PARSE_UPWARDS AscendingCallback;
} ACPI_WALK_STATE;
/* Info used by AcpiNsInitializeObjects and AcpiDsInitializeObjects */
typedef struct acpi_init_walk_info
{
UINT32 TableIndex;
UINT32 ObjectCount;
UINT32 MethodCount;
UINT32 SerialMethodCount;
UINT32 NonSerialMethodCount;
UINT32 SerializedMethodCount;
UINT32 DeviceCount;
UINT32 OpRegionCount;
UINT32 FieldCount;
UINT32 BufferCount;
UINT32 PackageCount;
UINT32 OpRegionInit;
UINT32 FieldInit;
UINT32 BufferInit;
UINT32 PackageInit;
ACPI_OWNER_ID OwnerId;
} ACPI_INIT_WALK_INFO;
typedef struct acpi_get_devices_info
{
ACPI_WALK_CALLBACK UserFunction;
void *Context;
char *Hid;
} ACPI_GET_DEVICES_INFO;
typedef union acpi_aml_operands
{
ACPI_OPERAND_OBJECT *Operands[7];
struct
{
ACPI_OBJECT_INTEGER *Type;
ACPI_OBJECT_INTEGER *Code;
ACPI_OBJECT_INTEGER *Argument;
} Fatal;
struct
{
ACPI_OPERAND_OBJECT *Source;
ACPI_OBJECT_INTEGER *Index;
ACPI_OPERAND_OBJECT *Target;
} Index;
struct
{
ACPI_OPERAND_OBJECT *Source;
ACPI_OBJECT_INTEGER *Index;
ACPI_OBJECT_INTEGER *Length;
ACPI_OPERAND_OBJECT *Target;
} Mid;
} ACPI_AML_OPERANDS;
/*
* Structure used to pass object evaluation information and parameters.
* Purpose is to reduce CPU stack use.
*/
typedef struct acpi_evaluate_info
{
/* The first 3 elements are passed by the caller to AcpiNsEvaluate */
ACPI_NAMESPACE_NODE *PrefixNode; /* Input: starting node */
const char *RelativePathname; /* Input: path relative to PrefixNode */
ACPI_OPERAND_OBJECT **Parameters; /* Input: argument list */
ACPI_NAMESPACE_NODE *Node; /* Resolved node (PrefixNode:RelativePathname) */
ACPI_OPERAND_OBJECT *ObjDesc; /* Object attached to the resolved node */
char *FullPathname; /* Full pathname of the resolved node */
const ACPI_PREDEFINED_INFO *Predefined; /* Used if Node is a predefined name */
ACPI_OPERAND_OBJECT *ReturnObject; /* Object returned from the evaluation */
union acpi_operand_object *ParentPackage; /* Used if return object is a Package */
UINT32 ReturnFlags; /* Used for return value analysis */
UINT32 ReturnBtype; /* Bitmapped type of the returned object */
UINT16 ParamCount; /* Count of the input argument list */
UINT16 NodeFlags; /* Same as Node->Flags */
UINT8 PassNumber; /* Parser pass number */
UINT8 ReturnObjectType; /* Object type of the returned object */
UINT8 Flags; /* General flags */
} ACPI_EVALUATE_INFO;
/* Values for Flags above */
#define ACPI_IGNORE_RETURN_VALUE 1
/* Defines for ReturnFlags field above */
#define ACPI_OBJECT_REPAIRED 1
#define ACPI_OBJECT_WRAPPED 2
/* Info used by AcpiNsInitializeDevices */
typedef struct acpi_device_walk_info
{
ACPI_TABLE_DESC *TableDesc;
ACPI_EVALUATE_INFO *EvaluateInfo;
UINT32 DeviceCount;
UINT32 Num_STA;
UINT32 Num_INI;
} ACPI_DEVICE_WALK_INFO;
/* Info used by Acpi AcpiDbDisplayFields */
typedef struct acpi_region_walk_info
{
UINT32 DebugLevel;
UINT32 Count;
ACPI_OWNER_ID OwnerId;
UINT8 DisplayType;
UINT32 AddressSpaceId;
} ACPI_REGION_WALK_INFO;
/* TBD: [Restructure] Merge with struct above */
typedef struct acpi_walk_info
{
UINT32 DebugLevel;
UINT32 Count;
ACPI_OWNER_ID OwnerId;
UINT8 DisplayType;
} ACPI_WALK_INFO;
/* Display Types */
#define ACPI_DISPLAY_SUMMARY (UINT8) 0
#define ACPI_DISPLAY_OBJECTS (UINT8) 1
#define ACPI_DISPLAY_MASK (UINT8) 1
#define ACPI_DISPLAY_SHORT (UINT8) 2
#endif
-390
View File
@@ -1,390 +0,0 @@
/******************************************************************************
*
* Name: actables.h - ACPI table management
*
*****************************************************************************/
/******************************************************************************
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2019, 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.
*
*****************************************************************************
*
* Alternatively, you may choose to be licensed under the terms of the
* following license:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Alternatively, you may choose to be licensed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
*****************************************************************************/
#ifndef __ACTABLES_H__
#define __ACTABLES_H__
ACPI_STATUS
AcpiAllocateRootTable (
UINT32 InitialTableCount);
/*
* tbxfroot - Root pointer utilities
*/
UINT32
AcpiTbGetRsdpLength (
ACPI_TABLE_RSDP *Rsdp);
ACPI_STATUS
AcpiTbValidateRsdp (
ACPI_TABLE_RSDP *Rsdp);
UINT8 *
AcpiTbScanMemoryForRsdp (
UINT8 *StartAddress,
UINT32 Length);
/*
* tbdata - table data structure management
*/
ACPI_STATUS
AcpiTbGetNextTableDescriptor (
UINT32 *TableIndex,
ACPI_TABLE_DESC **TableDesc);
void
AcpiTbInitTableDescriptor (
ACPI_TABLE_DESC *TableDesc,
ACPI_PHYSICAL_ADDRESS Address,
UINT8 Flags,
ACPI_TABLE_HEADER *Table);
ACPI_STATUS
AcpiTbAcquireTempTable (
ACPI_TABLE_DESC *TableDesc,
ACPI_PHYSICAL_ADDRESS Address,
UINT8 Flags);
void
AcpiTbReleaseTempTable (
ACPI_TABLE_DESC *TableDesc);
ACPI_STATUS
AcpiTbValidateTempTable (
ACPI_TABLE_DESC *TableDesc);
ACPI_STATUS
AcpiTbVerifyTempTable (
ACPI_TABLE_DESC *TableDesc,
char *Signature,
UINT32 *TableIndex);
BOOLEAN
AcpiTbIsTableLoaded (
UINT32 TableIndex);
void
AcpiTbSetTableLoadedFlag (
UINT32 TableIndex,
BOOLEAN IsLoaded);
/*
* tbfadt - FADT parse/convert/validate
*/
void
AcpiTbParseFadt (
void);
void
AcpiTbCreateLocalFadt (
ACPI_TABLE_HEADER *Table,
UINT32 Length);
/*
* tbfind - find ACPI table
*/
ACPI_STATUS
AcpiTbFindTable (
char *Signature,
char *OemId,
char *OemTableId,
UINT32 *TableIndex);
/*
* tbinstal - Table removal and deletion
*/
ACPI_STATUS
AcpiTbResizeRootTableList (
void);
ACPI_STATUS
AcpiTbValidateTable (
ACPI_TABLE_DESC *TableDesc);
void
AcpiTbInvalidateTable (
ACPI_TABLE_DESC *TableDesc);
void
AcpiTbOverrideTable (
ACPI_TABLE_DESC *OldTableDesc);
ACPI_STATUS
AcpiTbAcquireTable (
ACPI_TABLE_DESC *TableDesc,
ACPI_TABLE_HEADER **TablePtr,
UINT32 *TableLength,
UINT8 *TableFlags);
void
AcpiTbReleaseTable (
ACPI_TABLE_HEADER *Table,
UINT32 TableLength,
UINT8 TableFlags);
ACPI_STATUS
AcpiTbInstallStandardTable (
ACPI_PHYSICAL_ADDRESS Address,
UINT8 Flags,
BOOLEAN Reload,
BOOLEAN Override,
UINT32 *TableIndex);
void
AcpiTbUninstallTable (
ACPI_TABLE_DESC *TableDesc);
ACPI_STATUS
AcpiTbLoadTable (
UINT32 TableIndex,
ACPI_NAMESPACE_NODE *ParentNode);
ACPI_STATUS
AcpiTbInstallAndLoadTable (
ACPI_PHYSICAL_ADDRESS Address,
UINT8 Flags,
BOOLEAN Override,
UINT32 *TableIndex);
ACPI_STATUS
AcpiTbUnloadTable (
UINT32 TableIndex);
void
AcpiTbNotifyTable (
UINT32 Event,
void *Table);
void
AcpiTbTerminate (
void);
ACPI_STATUS
AcpiTbDeleteNamespaceByOwner (
UINT32 TableIndex);
ACPI_STATUS
AcpiTbAllocateOwnerId (
UINT32 TableIndex);
ACPI_STATUS
AcpiTbReleaseOwnerId (
UINT32 TableIndex);
ACPI_STATUS
AcpiTbGetOwnerId (
UINT32 TableIndex,
ACPI_OWNER_ID *OwnerId);
/*
* tbutils - table manager utilities
*/
ACPI_STATUS
AcpiTbInitializeFacs (
void);
void
AcpiTbPrintTableHeader(
ACPI_PHYSICAL_ADDRESS Address,
ACPI_TABLE_HEADER *Header);
UINT8
AcpiTbChecksum (
UINT8 *Buffer,
UINT32 Length);
ACPI_STATUS
AcpiTbVerifyChecksum (
ACPI_TABLE_HEADER *Table,
UINT32 Length);
void
AcpiTbCheckDsdtHeader (
void);
ACPI_TABLE_HEADER *
AcpiTbCopyDsdt (
UINT32 TableIndex);
void
AcpiTbInstallTableWithOverride (
ACPI_TABLE_DESC *NewTableDesc,
BOOLEAN Override,
UINT32 *TableIndex);
ACPI_STATUS
AcpiTbParseRootTable (
ACPI_PHYSICAL_ADDRESS RsdpAddress);
ACPI_STATUS
AcpiTbGetTable (
ACPI_TABLE_DESC *TableDesc,
ACPI_TABLE_HEADER **OutTable);
void
AcpiTbPutTable (
ACPI_TABLE_DESC *TableDesc);
/*
* tbxfload
*/
ACPI_STATUS
AcpiTbLoadNamespace (
void);
#endif /* __ACTABLES_H__ */
-417
View File
@@ -1,417 +0,0 @@
/******************************************************************************
*
* Module Name: actbinfo - Table disassembly info for non-AML tables
*
*****************************************************************************/
/******************************************************************************
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2019, 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.
*
*****************************************************************************
*
* Alternatively, you may choose to be licensed under the terms of the
* following license:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Alternatively, you may choose to be licensed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
*****************************************************************************/
/*
* Macros used to generate offsets to specific table fields
*/
#define ACPI_FACS_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_FACS,f)
#define ACPI_GAS_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_GENERIC_ADDRESS,f)
#define ACPI_HDR_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_HEADER,f)
#define ACPI_RSDP_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_RSDP,f)
#define ACPI_BERT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_BERT,f)
#define ACPI_BGRT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_BGRT,f)
#define ACPI_BOOT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_BOOT,f)
#define ACPI_CPEP_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_CPEP,f)
#define ACPI_DBG2_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_DBG2,f)
#define ACPI_DBGP_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_DBGP,f)
#define ACPI_DMAR_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_DMAR,f)
#define ACPI_DRTM_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_DRTM,f)
#define ACPI_ECDT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_ECDT,f)
#define ACPI_EINJ_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_EINJ,f)
#define ACPI_ERST_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_ERST,f)
#define ACPI_GTDT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_GTDT,f)
#define ACPI_HEST_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_HEST,f)
#define ACPI_HPET_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_HPET,f)
#define ACPI_HMAT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_HMAT,f)
#define ACPI_IORT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_IORT,f)
#define ACPI_IVRS_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_IVRS,f)
#define ACPI_MADT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_MADT,f)
#define ACPI_MCFG_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_MCFG,f)
#define ACPI_MCHI_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_MCHI,f)
#define ACPI_MPST_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_MPST,f)
#define ACPI_MSCT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_MSCT,f)
#define ACPI_NFIT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_NFIT,f)
#define ACPI_PCCT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_PCCT,f)
#define ACPI_PDTT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_PDTT,f)
#define ACPI_PMTT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_PMTT,f)
#define ACPI_RASF_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_RASF,f)
#define ACPI_S3PT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_S3PT,f)
#define ACPI_SBST_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_SBST,f)
#define ACPI_SDEI_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_SDEI,f)
#define ACPI_SDEV_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_SDEV,f)
#define ACPI_SLIT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_SLIT,f)
#define ACPI_SPCR_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_SPCR,f)
#define ACPI_SPMI_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_SPMI,f)
#define ACPI_SRAT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_SRAT,f)
#define ACPI_STAO_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_STAO,f)
#define ACPI_TCPA_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_TCPA_HDR,f)
#define ACPI_TPM2_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_TPM2,f)
#define ACPI_TPM23_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_TPM23,f)
#define ACPI_UEFI_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_UEFI,f)
#define ACPI_WAET_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_WAET,f)
#define ACPI_WDAT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_WDAT,f)
#define ACPI_WDDT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_WDDT,f)
#define ACPI_WDRT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_WDRT,f)
#define ACPI_WPBT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_WPBT,f)
#define ACPI_WSMT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_WSMT,f)
#define ACPI_XENV_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_XENV,f)
/* Subtables */
#define ACPI_ASF0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_ASF_INFO,f)
#define ACPI_ASF1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_ASF_ALERT,f)
#define ACPI_ASF1a_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_ASF_ALERT_DATA,f)
#define ACPI_ASF2_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_ASF_REMOTE,f)
#define ACPI_ASF2a_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_ASF_CONTROL_DATA,f)
#define ACPI_ASF3_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_ASF_RMCP,f)
#define ACPI_ASF4_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_ASF_ADDRESS,f)
#define ACPI_CPEP0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_CPEP_POLLING,f)
#define ACPI_CSRT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_CSRT_GROUP,f)
#define ACPI_CSRT1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_CSRT_SHARED_INFO,f)
#define ACPI_CSRT2_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_CSRT_DESCRIPTOR,f)
#define ACPI_DBG20_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_DBG2_DEVICE,f)
#define ACPI_DMARS_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_DMAR_DEVICE_SCOPE,f)
#define ACPI_DMAR0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_DMAR_HARDWARE_UNIT,f)
#define ACPI_DMAR1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_DMAR_RESERVED_MEMORY,f)
#define ACPI_DMAR2_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_DMAR_ATSR,f)
#define ACPI_DMAR3_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_DMAR_RHSA,f)
#define ACPI_DMAR4_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_DMAR_ANDD,f)
#define ACPI_DRTM0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_DRTM_VTABLE_LIST,f)
#define ACPI_DRTM1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_DRTM_RESOURCE_LIST,f)
#define ACPI_DRTM1a_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_DRTM_RESOURCE,f)
#define ACPI_DRTM2_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_DRTM_DPS_ID,f)
#define ACPI_EINJ0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_WHEA_HEADER,f)
#define ACPI_ERST0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_WHEA_HEADER,f)
#define ACPI_FPDTH_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_FPDT_HEADER,f)
#define ACPI_FPDT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_FPDT_BOOT_POINTER,f)
#define ACPI_FPDT1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_FPDT_S3PT_POINTER,f)
#define ACPI_GTDT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_GTDT_TIMER_BLOCK,f)
#define ACPI_GTDT0a_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_GTDT_TIMER_ENTRY,f)
#define ACPI_GTDT1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_GTDT_WATCHDOG,f)
#define ACPI_GTDTH_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_GTDT_HEADER,f)
#define ACPI_GTDT_EL2_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_GTDT_EL2,f)
#define ACPI_HEST0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_HEST_IA_MACHINE_CHECK,f)
#define ACPI_HEST1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_HEST_IA_CORRECTED,f)
#define ACPI_HEST2_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_HEST_IA_NMI,f)
#define ACPI_HEST6_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_HEST_AER_ROOT,f)
#define ACPI_HEST7_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_HEST_AER,f)
#define ACPI_HEST8_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_HEST_AER_BRIDGE,f)
#define ACPI_HEST9_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_HEST_GENERIC,f)
#define ACPI_HEST10_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_HEST_GENERIC_V2,f)
#define ACPI_HEST11_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_HEST_IA_DEFERRED_CHECK,f)
#define ACPI_HESTN_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_HEST_NOTIFY,f)
#define ACPI_HESTB_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_HEST_IA_ERROR_BANK,f)
#define ACPI_HMAT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_HMAT_PROXIMITY_DOMAIN,f)
#define ACPI_HMAT1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_HMAT_LOCALITY,f)
#define ACPI_HMAT2_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_HMAT_CACHE,f)
#define ACPI_HMATH_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_HMAT_STRUCTURE,f)
#define ACPI_IORT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_IORT_ITS_GROUP,f)
#define ACPI_IORT1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_IORT_NAMED_COMPONENT,f)
#define ACPI_IORT2_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_IORT_ROOT_COMPLEX,f)
#define ACPI_IORT3_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_IORT_SMMU,f)
#define ACPI_IORT3A_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_IORT_SMMU_GSI,f)
#define ACPI_IORT4_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_IORT_SMMU_V3,f)
#define ACPI_IORT5_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_IORT_PMCG,f)
#define ACPI_IORTA_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_IORT_MEMORY_ACCESS,f)
#define ACPI_IORTH_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_IORT_NODE,f)
#define ACPI_IORTM_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_IORT_ID_MAPPING,f)
#define ACPI_IVRSH_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_IVRS_HEADER,f)
#define ACPI_IVRS0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_IVRS_HARDWARE,f)
#define ACPI_IVRS1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_IVRS_MEMORY,f)
#define ACPI_IVRSD_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_IVRS_DE_HEADER,f)
#define ACPI_IVRS8A_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_IVRS_DEVICE8A,f)
#define ACPI_IVRS8B_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_IVRS_DEVICE8B,f)
#define ACPI_IVRS8C_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_IVRS_DEVICE8C,f)
#define ACPI_LPITH_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_LPIT_HEADER,f)
#define ACPI_LPIT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_LPIT_NATIVE,f)
#define ACPI_MADT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MADT_LOCAL_APIC,f)
#define ACPI_MADT1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MADT_IO_APIC,f)
#define ACPI_MADT2_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MADT_INTERRUPT_OVERRIDE,f)
#define ACPI_MADT3_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MADT_NMI_SOURCE,f)
#define ACPI_MADT4_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MADT_LOCAL_APIC_NMI,f)
#define ACPI_MADT5_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MADT_LOCAL_APIC_OVERRIDE,f)
#define ACPI_MADT6_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MADT_IO_SAPIC,f)
#define ACPI_MADT7_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MADT_LOCAL_SAPIC,f)
#define ACPI_MADT8_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MADT_INTERRUPT_SOURCE,f)
#define ACPI_MADT9_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MADT_LOCAL_X2APIC,f)
#define ACPI_MADT10_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MADT_LOCAL_X2APIC_NMI,f)
#define ACPI_MADT11_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MADT_GENERIC_INTERRUPT,f)
#define ACPI_MADT12_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MADT_GENERIC_DISTRIBUTOR,f)
#define ACPI_MADT13_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MADT_GENERIC_MSI_FRAME,f)
#define ACPI_MADT14_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MADT_GENERIC_REDISTRIBUTOR,f)
#define ACPI_MADT15_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MADT_GENERIC_TRANSLATOR,f)
#define ACPI_MADTH_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_SUBTABLE_HEADER,f)
#define ACPI_MCFG0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MCFG_ALLOCATION,f)
#define ACPI_MPST0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MPST_POWER_NODE,f)
#define ACPI_MPST0A_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MPST_POWER_STATE,f)
#define ACPI_MPST0B_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MPST_COMPONENT,f)
#define ACPI_MPST1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MPST_DATA_HDR,f)
#define ACPI_MPST2_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MPST_POWER_DATA,f)
#define ACPI_MSCT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MSCT_PROXIMITY,f)
#define ACPI_MTMR0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_MTMR_ENTRY,f)
#define ACPI_NFITH_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_NFIT_HEADER,f)
#define ACPI_NFIT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_NFIT_SYSTEM_ADDRESS,f)
#define ACPI_NFIT1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_NFIT_MEMORY_MAP,f)
#define ACPI_NFIT2_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_NFIT_INTERLEAVE,f)
#define ACPI_NFIT3_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_NFIT_SMBIOS,f)
#define ACPI_NFIT4_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_NFIT_CONTROL_REGION,f)
#define ACPI_NFIT5_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_NFIT_DATA_REGION,f)
#define ACPI_NFIT6_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_NFIT_FLUSH_ADDRESS,f)
#define ACPI_NFIT7_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_NFIT_CAPABILITIES,f)
#define ACPI_PCCT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_PCCT_SUBSPACE,f)
#define ACPI_PCCT1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_PCCT_HW_REDUCED,f)
#define ACPI_PCCT2_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_PCCT_HW_REDUCED_TYPE2,f)
#define ACPI_PCCT3_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_PCCT_EXT_PCC_MASTER,f)
#define ACPI_PCCT4_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_PCCT_EXT_PCC_SLAVE,f)
#define ACPI_PDTT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_PDTT_CHANNEL,f)
#define ACPI_PMTT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_PMTT_SOCKET,f)
#define ACPI_PMTT1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_PMTT_CONTROLLER,f)
#define ACPI_PMTT1A_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_PMTT_DOMAIN,f)
#define ACPI_PMTT2_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_PMTT_PHYSICAL_COMPONENT,f)
#define ACPI_PMTTH_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_PMTT_HEADER,f)
#define ACPI_PPTTH_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_SUBTABLE_HEADER,f)
#define ACPI_PPTT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_PPTT_PROCESSOR,f)
#define ACPI_PPTT1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_PPTT_CACHE,f)
#define ACPI_PPTT2_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_PPTT_ID,f)
#define ACPI_S3PTH_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_FPDT_HEADER,f)
#define ACPI_S3PT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_S3PT_RESUME,f)
#define ACPI_S3PT1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_S3PT_SUSPEND,f)
#define ACPI_SDEVH_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_SDEV_HEADER,f)
#define ACPI_SDEV0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_SDEV_NAMESPACE,f)
#define ACPI_SDEV1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_SDEV_PCIE,f)
#define ACPI_SDEV1A_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_SDEV_PCIE_PATH,f)
#define ACPI_SLIC_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_SLIC,f)
#define ACPI_SRATH_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_SUBTABLE_HEADER,f)
#define ACPI_SRAT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_SRAT_CPU_AFFINITY,f)
#define ACPI_SRAT1_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_SRAT_MEM_AFFINITY,f)
#define ACPI_SRAT2_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_SRAT_X2APIC_CPU_AFFINITY,f)
#define ACPI_SRAT3_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_SRAT_GICC_AFFINITY,f)
#define ACPI_SRAT4_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_SRAT_GIC_ITS_AFFINITY,f)
#define ACPI_SRAT5_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_SRAT_GENERIC_AFFINITY,f)
#define ACPI_TCPA_CLIENT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_TCPA_CLIENT,f)
#define ACPI_TCPA_SERVER_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_TCPA_SERVER,f)
#define ACPI_TPM2A_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TPM2_TRAILER,f)
#define ACPI_TPM211_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TPM2_ARM_SMC,f)
#define ACPI_TPM23A_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TPM23_TRAILER,f)
#define ACPI_VRTC0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_VRTC_ENTRY,f)
#define ACPI_WDAT0_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_WDAT_ENTRY,f)
/*
* Simplify access to flag fields by breaking them up into bytes
*/
#define ACPI_FLAG_OFFSET(d,f,o) (UINT16) (ACPI_OFFSET (d,f) + o)
/* Flags */
#define ACPI_BGRT_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_TABLE_BGRT,f,o)
#define ACPI_DRTM_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_TABLE_DRTM,f,o)
#define ACPI_DRTM1a_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_DRTM_RESOURCE,f,o)
#define ACPI_FADT_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_TABLE_FADT,f,o)
#define ACPI_FACS_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_TABLE_FACS,f,o)
#define ACPI_HPET_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_TABLE_HPET,f,o)
#define ACPI_PPTT0_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_PPTT_PROCESSOR,f,o)
#define ACPI_PPTT1_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_PPTT_CACHE,f,o)
#define ACPI_SRAT0_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_SRAT_CPU_AFFINITY,f,o)
#define ACPI_SRAT1_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_SRAT_MEM_AFFINITY,f,o)
#define ACPI_SRAT2_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_SRAT_X2APIC_CPU_AFFINITY,f,o)
#define ACPI_SRAT3_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_SRAT_GICC_AFFINITY,f,o)
#define ACPI_SRAT5_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_SRAT_GENERIC_AFFINITY,f,o)
#define ACPI_GTDT_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_TABLE_GTDT,f,o)
#define ACPI_GTDT0a_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_GTDT_TIMER_ENTRY,f,o)
#define ACPI_GTDT1_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_GTDT_WATCHDOG,f,o)
#define ACPI_HMAT0_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_HMAT_PROXIMITY_DOMAIN,f,o)
#define ACPI_HMAT1_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_HMAT_LOCALITY,f,o)
#define ACPI_HMAT2_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_HMAT_CACHE,f,o)
#define ACPI_IORT3_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_IORT_SMMU,f,o)
#define ACPI_IORT3a_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_IORT_SMMU_GSI,f,o)
#define ACPI_IORT4_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_IORT_SMMU_V3,f,o)
#define ACPI_IORTA_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_IORT_MEMORY_ACCESS,f,o)
#define ACPI_IORTM_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_IORT_ID_MAPPING,f,o)
#define ACPI_LPITH_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_LPIT_HEADER,f,o)
#define ACPI_MADT_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_TABLE_MADT,f,o)
#define ACPI_MADT0_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_MADT_LOCAL_APIC,f,o)
#define ACPI_MADT2_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_MADT_INTERRUPT_OVERRIDE,f,o)
#define ACPI_MADT3_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_MADT_NMI_SOURCE,f,o)
#define ACPI_MADT4_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_MADT_LOCAL_APIC_NMI,f,o)
#define ACPI_MADT7_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_MADT_LOCAL_SAPIC,f,o)
#define ACPI_MADT8_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_MADT_INTERRUPT_SOURCE,f,o)
#define ACPI_MADT9_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_MADT_LOCAL_X2APIC,f,o)
#define ACPI_MADT10_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_MADT_LOCAL_X2APIC_NMI,f,o)
#define ACPI_MADT11_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_MADT_GENERIC_INTERRUPT,f,o)
#define ACPI_MADT13_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_MADT_GENERIC_MSI_FRAME,f,o)
#define ACPI_MPST0_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_MPST_POWER_NODE,f,o)
#define ACPI_MPST2_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_MPST_POWER_DATA,f,o)
#define ACPI_NFIT0_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_NFIT_SYSTEM_ADDRESS,f,o)
#define ACPI_NFIT1_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_NFIT_MEMORY_MAP,f,o)
#define ACPI_NFIT4_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_NFIT_CONTROL_REGION,f,o)
#define ACPI_NFIT7_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_NFIT_CAPABILITIES,f,o)
#define ACPI_PCCT_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_TABLE_PCCT,f,o)
#define ACPI_PCCT1_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_PCCT_HW_REDUCED,f,o)
#define ACPI_PCCT2_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_PCCT_HW_REDUCED_TYPE2,f,o)
#define ACPI_PCCT3_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_PCCT_EXT_PCC_MASTER,f,o)
#define ACPI_PCCT4_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_PCCT_EXT_PCC_SLAVE,f,o)
#define ACPI_PDTT0_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_PDTT_CHANNEL,f,o)
#define ACPI_PMTTH_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_PMTT_HEADER,f,o)
#define ACPI_SDEVH_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_SDEV_HEADER,f,o)
#define ACPI_WDDT_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_TABLE_WDDT,f,o)
#define ACPI_WSMT_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_TABLE_WSMT,f,o)
#define ACPI_EINJ0_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_WHEA_HEADER,f,o)
#define ACPI_ERST0_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_WHEA_HEADER,f,o)
#define ACPI_HEST0_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_HEST_IA_MACHINE_CHECK,f,o)
#define ACPI_HEST1_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_HEST_IA_CORRECTED,f,o)
#define ACPI_HEST6_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_HEST_AER_ROOT,f,o)
#define ACPI_HEST11_FLAG_OFFSET(f,o) ACPI_FLAG_OFFSET (ACPI_HEST_IA_DEFERRED_CHECK,f,o)
/*
* Required terminator for all tables below
*/
#define ACPI_DMT_TERMINATOR {ACPI_DMT_EXIT, 0, NULL, 0}
#define ACPI_DMT_NEW_LINE {ACPI_DMT_EXTRA_TEXT, 0, "\n", 0}
-579
View File
@@ -1,579 +0,0 @@
/******************************************************************************
*
* Name: actbl.h - Basic ACPI Table Definitions
*
*****************************************************************************/
/******************************************************************************
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2019, 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.
*
*****************************************************************************
*
* Alternatively, you may choose to be licensed under the terms of the
* following license:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Alternatively, you may choose to be licensed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
*****************************************************************************/
#ifndef __ACTBL_H__
#define __ACTBL_H__
/*******************************************************************************
*
* Fundamental ACPI tables
*
* This file contains definitions for the ACPI tables that are directly consumed
* by ACPICA. All other tables are consumed by the OS-dependent ACPI-related
* device drivers and other OS support code.
*
* The RSDP and FACS do not use the common ACPI table header. All other ACPI
* tables use the header.
*
******************************************************************************/
/*
* Values for description table header signatures for tables defined in this
* file. Useful because they make it more difficult to inadvertently type in
* the wrong signature.
*/
#define ACPI_SIG_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 */
#define ACPI_SIG_XSDT "XSDT" /* Extended System Description Table */
#define ACPI_SIG_SSDT "SSDT" /* Secondary System Description Table */
#define ACPI_RSDP_NAME "RSDP" /* Short name for RSDP, not signature */
#define ACPI_OEM_NAME "OEM" /* Short name for OEM, not signature */
/*
* All tables and structures must be byte-packed to match the ACPI
* specification, since the tables are provided by the system BIOS
*/
#pragma pack(1)
/*
* Note: C bitfields are not used for this reason:
*
* "Bitfields are great and easy to read, but unfortunately the C language
* does not specify the layout of bitfields in memory, which means they are
* essentially useless for dealing with packed data in on-disk formats or
* binary wire protocols." (Or ACPI tables and buffers.) "If you ask me,
* this decision was a design error in C. Ritchie could have picked an order
* and stuck with it." Norman Ramsey.
* See http://stackoverflow.com/a/1053662/41661
*/
/*******************************************************************************
*
* Master ACPI Table Header. This common header is used by all ACPI tables
* except the RSDP and FACS.
*
******************************************************************************/
typedef struct acpi_table_header
{
char Signature[ACPI_NAMESEG_SIZE]; /* ASCII table signature */
UINT32 Length; /* Length of table in bytes, including this header */
UINT8 Revision; /* ACPI Specification minor version number */
UINT8 Checksum; /* To make sum of entire table == 0 */
char OemId[ACPI_OEM_ID_SIZE]; /* ASCII OEM identification */
char OemTableId[ACPI_OEM_TABLE_ID_SIZE]; /* ASCII OEM table identification */
UINT32 OemRevision; /* OEM revision number */
char AslCompilerId[ACPI_NAMESEG_SIZE]; /* ASCII ASL compiler vendor ID */
UINT32 AslCompilerRevision; /* ASL compiler version */
} ACPI_TABLE_HEADER;
/*******************************************************************************
*
* GAS - Generic Address Structure (ACPI 2.0+)
*
* Note: Since this structure is used in the ACPI tables, it is byte aligned.
* If misaligned access is not supported by the hardware, accesses to the
* 64-bit Address field must be performed with care.
*
******************************************************************************/
typedef struct acpi_generic_address
{
UINT8 SpaceId; /* Address space where struct or register exists */
UINT8 BitWidth; /* Size in bits of given register */
UINT8 BitOffset; /* Bit offset within the register */
UINT8 AccessWidth; /* Minimum Access size (ACPI 3.0) */
UINT64 Address; /* 64-bit address of struct or register */
} ACPI_GENERIC_ADDRESS;
/*******************************************************************************
*
* RSDP - Root System Description Pointer (Signature is "RSD PTR ")
* Version 2
*
******************************************************************************/
typedef struct acpi_table_rsdp
{
char Signature[8]; /* ACPI signature, contains "RSD PTR " */
UINT8 Checksum; /* ACPI 1.0 checksum */
char OemId[ACPI_OEM_ID_SIZE]; /* OEM identification */
UINT8 Revision; /* Must be (0) for ACPI 1.0 or (2) for ACPI 2.0+ */
UINT32 RsdtPhysicalAddress; /* 32-bit physical address of the RSDT */
UINT32 Length; /* Table length in bytes, including header (ACPI 2.0+) */
UINT64 XsdtPhysicalAddress; /* 64-bit physical address of the XSDT (ACPI 2.0+) */
UINT8 ExtendedChecksum; /* Checksum of entire table (ACPI 2.0+) */
UINT8 Reserved[3]; /* Reserved, must be zero */
} ACPI_TABLE_RSDP;
/* Standalone struct for the ACPI 1.0 RSDP */
typedef struct acpi_rsdp_common
{
char Signature[8];
UINT8 Checksum;
char OemId[ACPI_OEM_ID_SIZE];
UINT8 Revision;
UINT32 RsdtPhysicalAddress;
} ACPI_RSDP_COMMON;
/* Standalone struct for the extended part of the RSDP (ACPI 2.0+) */
typedef struct acpi_rsdp_extension
{
UINT32 Length;
UINT64 XsdtPhysicalAddress;
UINT8 ExtendedChecksum;
UINT8 Reserved[3];
} ACPI_RSDP_EXTENSION;
/*******************************************************************************
*
* RSDT/XSDT - Root System Description Tables
* Version 1 (both)
*
******************************************************************************/
typedef struct acpi_table_rsdt
{
ACPI_TABLE_HEADER Header; /* Common ACPI table header */
UINT32 TableOffsetEntry[1]; /* Array of pointers to ACPI tables */
} ACPI_TABLE_RSDT;
typedef struct acpi_table_xsdt
{
ACPI_TABLE_HEADER Header; /* Common ACPI table header */
UINT64 TableOffsetEntry[1]; /* Array of pointers to ACPI tables */
} ACPI_TABLE_XSDT;
#define ACPI_RSDT_ENTRY_SIZE (sizeof (UINT32))
#define ACPI_XSDT_ENTRY_SIZE (sizeof (UINT64))
/*******************************************************************************
*
* FACS - Firmware ACPI Control Structure (FACS)
*
******************************************************************************/
typedef struct acpi_table_facs
{
char Signature[4]; /* ASCII table signature */
UINT32 Length; /* Length of structure, in bytes */
UINT32 HardwareSignature; /* Hardware configuration signature */
UINT32 FirmwareWakingVector; /* 32-bit physical address of the Firmware Waking Vector */
UINT32 GlobalLock; /* Global Lock for shared hardware resources */
UINT32 Flags;
UINT64 XFirmwareWakingVector; /* 64-bit version of the Firmware Waking Vector (ACPI 2.0+) */
UINT8 Version; /* Version of this table (ACPI 2.0+) */
UINT8 Reserved[3]; /* Reserved, must be zero */
UINT32 OspmFlags; /* Flags to be set by OSPM (ACPI 4.0) */
UINT8 Reserved1[24]; /* Reserved, must be zero */
} ACPI_TABLE_FACS;
/* Masks for GlobalLock flag field above */
#define ACPI_GLOCK_PENDING (1) /* 00: Pending global lock ownership */
#define ACPI_GLOCK_OWNED (1<<1) /* 01: Global lock is owned */
/* Masks for Flags field above */
#define ACPI_FACS_S4_BIOS_PRESENT (1) /* 00: S4BIOS support is present */
#define ACPI_FACS_64BIT_WAKE (1<<1) /* 01: 64-bit wake vector supported (ACPI 4.0) */
/* Masks for OspmFlags field above */
#define ACPI_FACS_64BIT_ENVIRONMENT (1) /* 00: 64-bit wake environment is required (ACPI 4.0) */
/*******************************************************************************
*
* FADT - Fixed ACPI Description Table (Signature "FACP")
* Version 6
*
******************************************************************************/
/* Fields common to all versions of the FADT */
typedef struct acpi_table_fadt
{
ACPI_TABLE_HEADER Header; /* Common ACPI table header */
UINT32 Facs; /* 32-bit physical address of FACS */
UINT32 Dsdt; /* 32-bit physical address of DSDT */
UINT8 Model; /* System Interrupt Model (ACPI 1.0) - not used in ACPI 2.0+ */
UINT8 PreferredProfile; /* Conveys preferred power management profile to OSPM. */
UINT16 SciInterrupt; /* System vector of SCI interrupt */
UINT32 SmiCommand; /* 32-bit Port address of SMI command port */
UINT8 AcpiEnable; /* Value to write to SMI_CMD to enable ACPI */
UINT8 AcpiDisable; /* Value to write to SMI_CMD to disable ACPI */
UINT8 S4BiosRequest; /* Value to write to SMI_CMD to enter S4BIOS state */
UINT8 PstateControl; /* Processor performance state control*/
UINT32 Pm1aEventBlock; /* 32-bit port address of Power Mgt 1a Event Reg Blk */
UINT32 Pm1bEventBlock; /* 32-bit port address of Power Mgt 1b Event Reg Blk */
UINT32 Pm1aControlBlock; /* 32-bit port address of Power Mgt 1a Control Reg Blk */
UINT32 Pm1bControlBlock; /* 32-bit port address of Power Mgt 1b Control Reg Blk */
UINT32 Pm2ControlBlock; /* 32-bit port address of Power Mgt 2 Control Reg Blk */
UINT32 PmTimerBlock; /* 32-bit port address of Power Mgt Timer Ctrl Reg Blk */
UINT32 Gpe0Block; /* 32-bit port address of General Purpose Event 0 Reg Blk */
UINT32 Gpe1Block; /* 32-bit port address of General Purpose Event 1 Reg Blk */
UINT8 Pm1EventLength; /* Byte Length of ports at Pm1xEventBlock */
UINT8 Pm1ControlLength; /* Byte Length of ports at Pm1xControlBlock */
UINT8 Pm2ControlLength; /* Byte Length of ports at Pm2ControlBlock */
UINT8 PmTimerLength; /* Byte Length of ports at PmTimerBlock */
UINT8 Gpe0BlockLength; /* Byte Length of ports at Gpe0Block */
UINT8 Gpe1BlockLength; /* Byte Length of ports at Gpe1Block */
UINT8 Gpe1Base; /* Offset in GPE number space where GPE1 events start */
UINT8 CstControl; /* Support for the _CST object and C-States change notification */
UINT16 C2Latency; /* Worst case HW latency to enter/exit C2 state */
UINT16 C3Latency; /* Worst case HW latency to enter/exit C3 state */
UINT16 FlushSize; /* Processor memory cache line width, in bytes */
UINT16 FlushStride; /* Number of flush strides that need to be read */
UINT8 DutyOffset; /* Processor duty cycle index in processor P_CNT reg */
UINT8 DutyWidth; /* Processor duty cycle value bit width in P_CNT register */
UINT8 DayAlarm; /* Index to day-of-month alarm in RTC CMOS RAM */
UINT8 MonthAlarm; /* Index to month-of-year alarm in RTC CMOS RAM */
UINT8 Century; /* Index to century in RTC CMOS RAM */
UINT16 BootFlags; /* IA-PC Boot Architecture Flags (see below for individual flags) */
UINT8 Reserved; /* Reserved, must be zero */
UINT32 Flags; /* Miscellaneous flag bits (see below for individual flags) */
ACPI_GENERIC_ADDRESS ResetRegister; /* 64-bit address of the Reset register */
UINT8 ResetValue; /* Value to write to the ResetRegister port to reset the system */
UINT16 ArmBootFlags; /* ARM-Specific Boot Flags (see below for individual flags) (ACPI 5.1) */
UINT8 MinorRevision; /* FADT Minor Revision (ACPI 5.1) */
UINT64 XFacs; /* 64-bit physical address of FACS */
UINT64 XDsdt; /* 64-bit physical address of DSDT */
ACPI_GENERIC_ADDRESS XPm1aEventBlock; /* 64-bit Extended Power Mgt 1a Event Reg Blk address */
ACPI_GENERIC_ADDRESS XPm1bEventBlock; /* 64-bit Extended Power Mgt 1b Event Reg Blk address */
ACPI_GENERIC_ADDRESS XPm1aControlBlock; /* 64-bit Extended Power Mgt 1a Control Reg Blk address */
ACPI_GENERIC_ADDRESS XPm1bControlBlock; /* 64-bit Extended Power Mgt 1b Control Reg Blk address */
ACPI_GENERIC_ADDRESS XPm2ControlBlock; /* 64-bit Extended Power Mgt 2 Control Reg Blk address */
ACPI_GENERIC_ADDRESS XPmTimerBlock; /* 64-bit Extended Power Mgt Timer Ctrl Reg Blk address */
ACPI_GENERIC_ADDRESS XGpe0Block; /* 64-bit Extended General Purpose Event 0 Reg Blk address */
ACPI_GENERIC_ADDRESS XGpe1Block; /* 64-bit Extended General Purpose Event 1 Reg Blk address */
ACPI_GENERIC_ADDRESS SleepControl; /* 64-bit Sleep Control register (ACPI 5.0) */
ACPI_GENERIC_ADDRESS SleepStatus; /* 64-bit Sleep Status register (ACPI 5.0) */
UINT64 HypervisorId; /* Hypervisor Vendor ID (ACPI 6.0) */
} ACPI_TABLE_FADT;
/* Masks for FADT IA-PC Boot Architecture Flags (boot_flags) [Vx]=Introduced in this FADT revision */
#define ACPI_FADT_LEGACY_DEVICES (1) /* 00: [V2] System has LPC or ISA bus devices */
#define ACPI_FADT_8042 (1<<1) /* 01: [V3] System has an 8042 controller on port 60/64 */
#define ACPI_FADT_NO_VGA (1<<2) /* 02: [V4] It is not safe to probe for VGA hardware */
#define ACPI_FADT_NO_MSI (1<<3) /* 03: [V4] Message Signaled Interrupts (MSI) must not be enabled */
#define ACPI_FADT_NO_ASPM (1<<4) /* 04: [V4] PCIe ASPM control must not be enabled */
#define ACPI_FADT_NO_CMOS_RTC (1<<5) /* 05: [V5] No CMOS real-time clock present */
/* Masks for FADT ARM Boot Architecture Flags (arm_boot_flags) ACPI 5.1 */
#define ACPI_FADT_PSCI_COMPLIANT (1) /* 00: [V5+] PSCI 0.2+ is implemented */
#define ACPI_FADT_PSCI_USE_HVC (1<<1) /* 01: [V5+] HVC must be used instead of SMC as the PSCI conduit */
/* Masks for FADT flags */
#define ACPI_FADT_WBINVD (1) /* 00: [V1] The WBINVD instruction works properly */
#define ACPI_FADT_WBINVD_FLUSH (1<<1) /* 01: [V1] WBINVD flushes but does not invalidate caches */
#define ACPI_FADT_C1_SUPPORTED (1<<2) /* 02: [V1] All processors support C1 state */
#define ACPI_FADT_C2_MP_SUPPORTED (1<<3) /* 03: [V1] C2 state works on MP system */
#define ACPI_FADT_POWER_BUTTON (1<<4) /* 04: [V1] Power button is handled as a control method device */
#define ACPI_FADT_SLEEP_BUTTON (1<<5) /* 05: [V1] Sleep button is handled as a control method device */
#define ACPI_FADT_FIXED_RTC (1<<6) /* 06: [V1] RTC wakeup status is not in fixed register space */
#define ACPI_FADT_S4_RTC_WAKE (1<<7) /* 07: [V1] RTC alarm can wake system from S4 */
#define ACPI_FADT_32BIT_TIMER (1<<8) /* 08: [V1] ACPI timer width is 32-bit (0=24-bit) */
#define ACPI_FADT_DOCKING_SUPPORTED (1<<9) /* 09: [V1] Docking supported */
#define ACPI_FADT_RESET_REGISTER (1<<10) /* 10: [V2] System reset via the FADT RESET_REG supported */
#define ACPI_FADT_SEALED_CASE (1<<11) /* 11: [V3] No internal expansion capabilities and case is sealed */
#define ACPI_FADT_HEADLESS (1<<12) /* 12: [V3] No local video capabilities or local input devices */
#define ACPI_FADT_SLEEP_TYPE (1<<13) /* 13: [V3] Must execute native instruction after writing SLP_TYPx register */
#define ACPI_FADT_PCI_EXPRESS_WAKE (1<<14) /* 14: [V4] System supports PCIEXP_WAKE (STS/EN) bits (ACPI 3.0) */
#define ACPI_FADT_PLATFORM_CLOCK (1<<15) /* 15: [V4] OSPM should use platform-provided timer (ACPI 3.0) */
#define ACPI_FADT_S4_RTC_VALID (1<<16) /* 16: [V4] Contents of RTC_STS valid after S4 wake (ACPI 3.0) */
#define ACPI_FADT_REMOTE_POWER_ON (1<<17) /* 17: [V4] System is compatible with remote power on (ACPI 3.0) */
#define ACPI_FADT_APIC_CLUSTER (1<<18) /* 18: [V4] All local APICs must use cluster model (ACPI 3.0) */
#define ACPI_FADT_APIC_PHYSICAL (1<<19) /* 19: [V4] All local xAPICs must use physical dest mode (ACPI 3.0) */
#define ACPI_FADT_HW_REDUCED (1<<20) /* 20: [V5] ACPI hardware is not implemented (ACPI 5.0) */
#define ACPI_FADT_LOW_POWER_S0 (1<<21) /* 21: [V5] S0 power savings are equal or better than S3 (ACPI 5.0) */
/* Values for PreferredProfile (Preferred Power Management Profiles) */
enum AcpiPreferredPmProfiles
{
PM_UNSPECIFIED = 0,
PM_DESKTOP = 1,
PM_MOBILE = 2,
PM_WORKSTATION = 3,
PM_ENTERPRISE_SERVER = 4,
PM_SOHO_SERVER = 5,
PM_APPLIANCE_PC = 6,
PM_PERFORMANCE_SERVER = 7,
PM_TABLET = 8
};
/* Values for SleepStatus and SleepControl registers (V5+ FADT) */
#define ACPI_X_WAKE_STATUS 0x80
#define ACPI_X_SLEEP_TYPE_MASK 0x1C
#define ACPI_X_SLEEP_TYPE_POSITION 0x02
#define ACPI_X_SLEEP_ENABLE 0x20
/* Reset to default packing */
#pragma pack()
/*
* Internal table-related structures
*/
typedef union acpi_name_union
{
UINT32 Integer;
char Ascii[4];
} ACPI_NAME_UNION;
/* Internal ACPI Table Descriptor. One per ACPI table. */
typedef struct acpi_table_desc
{
ACPI_PHYSICAL_ADDRESS Address;
ACPI_TABLE_HEADER *Pointer;
UINT32 Length; /* Length fixed at 32 bits (fixed in table header) */
ACPI_NAME_UNION Signature;
ACPI_OWNER_ID OwnerId;
UINT8 Flags;
UINT16 ValidationCount;
} ACPI_TABLE_DESC;
/*
* Maximum value of the ValidationCount field in ACPI_TABLE_DESC.
* When reached, ValidationCount cannot be changed any more and the table will
* be permanently regarded as validated.
*
* This is to prevent situations in which unbalanced table get/put operations
* may cause premature table unmapping in the OS to happen.
*
* The maximum validation count can be defined to any value, but should be
* greater than the maximum number of OS early stage mapping slots to avoid
* leaking early stage table mappings to the late stage.
*/
#define ACPI_MAX_TABLE_VALIDATIONS ACPI_UINT16_MAX
/* Masks for Flags field above */
#define ACPI_TABLE_ORIGIN_EXTERNAL_VIRTUAL (0) /* Virtual address, external maintained */
#define ACPI_TABLE_ORIGIN_INTERNAL_PHYSICAL (1) /* Physical address, internally mapped */
#define ACPI_TABLE_ORIGIN_INTERNAL_VIRTUAL (2) /* Virtual address, internallly allocated */
#define ACPI_TABLE_ORIGIN_MASK (3)
#define ACPI_TABLE_IS_VERIFIED (4)
#define ACPI_TABLE_IS_LOADED (8)
/*
* Get the remaining ACPI tables
*/
#include "actbl1.h"
#include "actbl2.h"
#include "actbl3.h"
/* Macros used to generate offsets to specific table fields */
#define ACPI_FADT_OFFSET(f) (UINT16) ACPI_OFFSET (ACPI_TABLE_FADT, f)
/*
* Sizes of the various flavors of FADT. We need to look closely
* at the FADT length because the version number essentially tells
* us nothing because of many BIOS bugs where the version does not
* match the expected length. In other words, the length of the
* FADT is the bottom line as to what the version really is.
*
* For reference, the values below are as follows:
* FADT V1 size: 0x074
* FADT V2 size: 0x084
* FADT V3 size: 0x0F4
* FADT V4 size: 0x0F4
* FADT V5 size: 0x10C
* 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) (ACPI_FADT_OFFSET (HypervisorId))
#define ACPI_FADT_V6_SIZE (UINT32) (sizeof (ACPI_TABLE_FADT))
#define ACPI_FADT_CONFORMANCE "ACPI 6.1 (FADT version 6)"
#endif /* __ACTBL_H__ */
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
-953
View File
@@ -1,953 +0,0 @@
/******************************************************************************
*
* Name: actbl3.h - ACPI Table Definitions
*
*****************************************************************************/
/******************************************************************************
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2019, 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.
*
*****************************************************************************
*
* Alternatively, you may choose to be licensed under the terms of the
* following license:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Alternatively, you may choose to be licensed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
*****************************************************************************/
#ifndef __ACTBL3_H__
#define __ACTBL3_H__
/*******************************************************************************
*
* Additional ACPI Tables
*
* These tables are not consumed directly by the ACPICA subsystem, but are
* included here to support device drivers and the AML disassembler.
*
******************************************************************************/
/*
* Values for description table header signatures for tables defined in this
* file. Useful because they make it more difficult to inadvertently type in
* the wrong signature.
*/
#define ACPI_SIG_SLIC "SLIC" /* Software Licensing Description Table */
#define ACPI_SIG_SLIT "SLIT" /* System Locality Distance Information Table */
#define ACPI_SIG_SPCR "SPCR" /* Serial Port Console Redirection table */
#define ACPI_SIG_SPMI "SPMI" /* Server Platform Management Interface table */
#define ACPI_SIG_SRAT "SRAT" /* System Resource Affinity Table */
#define ACPI_SIG_STAO "STAO" /* Status Override 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 */
#define ACPI_SIG_WDAT "WDAT" /* Watchdog Action Table */
#define ACPI_SIG_WDDT "WDDT" /* Watchdog Timer Description Table */
#define ACPI_SIG_WDRT "WDRT" /* Watchdog Resource Table */
#define ACPI_SIG_WPBT "WPBT" /* Windows Platform Binary Table */
#define ACPI_SIG_WSMT "WSMT" /* Windows SMM Security Migrations Table */
#define ACPI_SIG_XENV "XENV" /* Xen Environment table */
#define ACPI_SIG_XXXX "XXXX" /* Intermediate AML header for ASL/ASL+ converter */
/*
* All tables must be byte-packed to match the ACPI specification, since
* the tables are provided by the system BIOS.
*/
#pragma pack(1)
/*
* Note: C bitfields are not used for this reason:
*
* "Bitfields are great and easy to read, but unfortunately the C language
* does not specify the layout of bitfields in memory, which means they are
* essentially useless for dealing with packed data in on-disk formats or
* binary wire protocols." (Or ACPI tables and buffers.) "If you ask me,
* this decision was a design error in C. Ritchie could have picked an order
* and stuck with it." Norman Ramsey.
* See http://stackoverflow.com/a/1053662/41661
*/
/*******************************************************************************
*
* SLIC - Software Licensing Description Table
*
* Conforms to "Microsoft Software Licensing Tables (SLIC and MSDM)",
* November 29, 2011. Copyright 2011 Microsoft
*
******************************************************************************/
/* Basic SLIC table is only the common ACPI header */
typedef struct acpi_table_slic
{
ACPI_TABLE_HEADER Header; /* Common ACPI table header */
} ACPI_TABLE_SLIC;
/*******************************************************************************
*
* SLIT - System Locality Distance Information Table
* Version 1
*
******************************************************************************/
typedef struct acpi_table_slit
{
ACPI_TABLE_HEADER Header; /* Common ACPI table header */
UINT64 LocalityCount;
UINT8 Entry[1]; /* Real size = localities^2 */
} ACPI_TABLE_SLIT;
/*******************************************************************************
*
* SPCR - Serial Port Console Redirection table
* Version 2
*
* Conforms to "Serial Port Console Redirection Table",
* Version 1.03, August 10, 2015
*
******************************************************************************/
typedef struct acpi_table_spcr
{
ACPI_TABLE_HEADER Header; /* Common ACPI table header */
UINT8 InterfaceType; /* 0=full 16550, 1=subset of 16550 */
UINT8 Reserved[3];
ACPI_GENERIC_ADDRESS SerialPort;
UINT8 InterruptType;
UINT8 PcInterrupt;
UINT32 Interrupt;
UINT8 BaudRate;
UINT8 Parity;
UINT8 StopBits;
UINT8 FlowControl;
UINT8 TerminalType;
UINT8 Reserved1;
UINT16 PciDeviceId;
UINT16 PciVendorId;
UINT8 PciBus;
UINT8 PciDevice;
UINT8 PciFunction;
UINT32 PciFlags;
UINT8 PciSegment;
UINT32 Reserved2;
} ACPI_TABLE_SPCR;
/* Masks for PciFlags field above */
#define ACPI_SPCR_DO_NOT_DISABLE (1)
/* Values for Interface Type: See the definition of the DBG2 table */
/*******************************************************************************
*
* SPMI - Server Platform Management Interface table
* Version 5
*
* Conforms to "Intelligent Platform Management Interface Specification
* Second Generation v2.0", Document Revision 1.0, February 12, 2004 with
* June 12, 2009 markup.
*
******************************************************************************/
typedef struct acpi_table_spmi
{
ACPI_TABLE_HEADER Header; /* Common ACPI table header */
UINT8 InterfaceType;
UINT8 Reserved; /* Must be 1 */
UINT16 SpecRevision; /* Version of IPMI */
UINT8 InterruptType;
UINT8 GpeNumber; /* GPE assigned */
UINT8 Reserved1;
UINT8 PciDeviceFlag;
UINT32 Interrupt;
ACPI_GENERIC_ADDRESS IpmiRegister;
UINT8 PciSegment;
UINT8 PciBus;
UINT8 PciDevice;
UINT8 PciFunction;
UINT8 Reserved2;
} ACPI_TABLE_SPMI;
/* Values for InterfaceType above */
enum AcpiSpmiInterfaceTypes
{
ACPI_SPMI_NOT_USED = 0,
ACPI_SPMI_KEYBOARD = 1,
ACPI_SPMI_SMI = 2,
ACPI_SPMI_BLOCK_TRANSFER = 3,
ACPI_SPMI_SMBUS = 4,
ACPI_SPMI_RESERVED = 5 /* 5 and above are reserved */
};
/*******************************************************************************
*
* SRAT - System Resource Affinity Table
* Version 3
*
******************************************************************************/
typedef struct acpi_table_srat
{
ACPI_TABLE_HEADER Header; /* Common ACPI table header */
UINT32 TableRevision; /* Must be value '1' */
UINT64 Reserved; /* Reserved, must be zero */
} ACPI_TABLE_SRAT;
/* Values for subtable type in ACPI_SUBTABLE_HEADER */
enum AcpiSratType
{
ACPI_SRAT_TYPE_CPU_AFFINITY = 0,
ACPI_SRAT_TYPE_MEMORY_AFFINITY = 1,
ACPI_SRAT_TYPE_X2APIC_CPU_AFFINITY = 2,
ACPI_SRAT_TYPE_GICC_AFFINITY = 3,
ACPI_SRAT_TYPE_GIC_ITS_AFFINITY = 4, /* ACPI 6.2 */
ACPI_SRAT_TYPE_GENERIC_AFFINITY = 5, /* ACPI 6.3 */
ACPI_SRAT_TYPE_RESERVED = 6 /* 5 and greater are reserved */
};
/*
* SRAT Subtables, correspond to Type in ACPI_SUBTABLE_HEADER
*/
/* 0: Processor Local APIC/SAPIC Affinity */
typedef struct acpi_srat_cpu_affinity
{
ACPI_SUBTABLE_HEADER Header;
UINT8 ProximityDomainLo;
UINT8 ApicId;
UINT32 Flags;
UINT8 LocalSapicEid;
UINT8 ProximityDomainHi[3];
UINT32 ClockDomain;
} ACPI_SRAT_CPU_AFFINITY;
/* Flags */
#define ACPI_SRAT_CPU_USE_AFFINITY (1) /* 00: Use affinity structure */
/* 1: Memory Affinity */
typedef struct acpi_srat_mem_affinity
{
ACPI_SUBTABLE_HEADER Header;
UINT32 ProximityDomain;
UINT16 Reserved; /* Reserved, must be zero */
UINT64 BaseAddress;
UINT64 Length;
UINT32 Reserved1;
UINT32 Flags;
UINT64 Reserved2; /* Reserved, must be zero */
} ACPI_SRAT_MEM_AFFINITY;
/* Flags */
#define ACPI_SRAT_MEM_ENABLED (1) /* 00: Use affinity structure */
#define ACPI_SRAT_MEM_HOT_PLUGGABLE (1<<1) /* 01: Memory region is hot pluggable */
#define ACPI_SRAT_MEM_NON_VOLATILE (1<<2) /* 02: Memory region is non-volatile */
/* 2: Processor Local X2_APIC Affinity (ACPI 4.0) */
typedef struct acpi_srat_x2apic_cpu_affinity
{
ACPI_SUBTABLE_HEADER Header;
UINT16 Reserved; /* Reserved, must be zero */
UINT32 ProximityDomain;
UINT32 ApicId;
UINT32 Flags;
UINT32 ClockDomain;
UINT32 Reserved2;
} ACPI_SRAT_X2APIC_CPU_AFFINITY;
/* Flags for ACPI_SRAT_CPU_AFFINITY and ACPI_SRAT_X2APIC_CPU_AFFINITY */
#define ACPI_SRAT_CPU_ENABLED (1) /* 00: Use affinity structure */
/* 3: GICC Affinity (ACPI 5.1) */
typedef struct acpi_srat_gicc_affinity
{
ACPI_SUBTABLE_HEADER Header;
UINT32 ProximityDomain;
UINT32 AcpiProcessorUid;
UINT32 Flags;
UINT32 ClockDomain;
} ACPI_SRAT_GICC_AFFINITY;
/* Flags for ACPI_SRAT_GICC_AFFINITY */
#define ACPI_SRAT_GICC_ENABLED (1) /* 00: Use affinity structure */
/* 4: GCC ITS Affinity (ACPI 6.2) */
typedef struct acpi_srat_gic_its_affinity
{
ACPI_SUBTABLE_HEADER Header;
UINT32 ProximityDomain;
UINT16 Reserved;
UINT32 ItsId;
} ACPI_SRAT_GIC_ITS_AFFINITY;
/* 5: Generic Initiator Affinity Structure (ACPI 6.3) */
typedef struct acpi_srat_generic_affinity
{
ACPI_SUBTABLE_HEADER Header;
UINT8 Reserved;
UINT8 DeviceHandleType;
UINT32 ProximityDomain;
UINT8 DeviceHandle[16];
UINT32 Flags;
UINT32 Reserved1;
} ACPI_SRAT_GENERIC_AFFINITY;
/* Flags for ACPI_SRAT_GENERIC_AFFINITY */
#define ACPI_SRAT_GENERIC_AFFINITY_ENABLED (1) /* 00: Use affinity structure */
/*******************************************************************************
*
* STAO - Status Override Table (_STA override) - ACPI 6.0
* Version 1
*
* Conforms to "ACPI Specification for Status Override Table"
* 6 January 2015
*
******************************************************************************/
typedef struct acpi_table_stao
{
ACPI_TABLE_HEADER Header; /* Common ACPI table header */
UINT8 IgnoreUart;
} ACPI_TABLE_STAO;
/*******************************************************************************
*
* TCPA - Trusted Computing Platform Alliance table
* Version 2
*
* TCG Hardware Interface Table for TPM 1.2 Clients and Servers
*
* Conforms to "TCG ACPI Specification, Family 1.2 and 2.0",
* Version 1.2, Revision 8
* February 27, 2017
*
* 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_hdr
{
ACPI_TABLE_HEADER Header; /* Common ACPI table header */
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_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
*
* TCG Hardware Interface Table for TPM 2.0 Clients and Servers
*
* Conforms to "TCG ACPI Specification, Family 1.2 and 2.0",
* Version 1.2, Revision 8
* February 27, 2017
*
******************************************************************************/
/* Revision 3 */
typedef struct acpi_table_tpm23
{
ACPI_TABLE_HEADER Header; /* Common ACPI table header */
UINT32 Reserved;
UINT64 ControlAddress;
UINT32 StartMethod;
} ACPI_TABLE_TPM23;
/* Value for StartMethod above */
#define ACPI_TPM23_ACPI_START_METHOD 2
/*
* Optional trailer for revision 3. If start method is 2, there is a 4 byte
* reserved area of all zeros.
*/
typedef struct acpi_tmp23_trailer
{
UINT32 Reserved;
} ACPI_TPM23_TRAILER;
/* Revision 4 */
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_RESERVED1 1
#define ACPI_TPM2_START_METHOD 2
#define ACPI_TPM2_RESERVED3 3
#define ACPI_TPM2_RESERVED4 4
#define ACPI_TPM2_RESERVED5 5
#define ACPI_TPM2_MEMORY_MAPPED 6
#define ACPI_TPM2_COMMAND_BUFFER 7
#define ACPI_TPM2_COMMAND_BUFFER_WITH_START_METHOD 8
#define ACPI_TPM2_RESERVED9 9
#define ACPI_TPM2_RESERVED10 10
#define ACPI_TPM2_COMMAND_BUFFER_WITH_ARM_SMC 11 /* V1.2 Rev 8 */
#define ACPI_TPM2_RESERVED 12
/* Optional trailer appears after any StartMethod subtables */
typedef struct acpi_tpm2_trailer
{
UINT8 MethodParameters[12];
UINT32 MinimumLogLength; /* Minimum length for the event log area */
UINT64 LogAddress; /* Address of the event log area */
} ACPI_TPM2_TRAILER;
/*
* Subtables (StartMethod-specific)
*/
/* 11: Start Method for ARM SMC (V1.2 Rev 8) */
typedef struct acpi_tpm2_arm_smc
{
UINT32 GlobalInterrupt;
UINT8 InterruptFlags;
UINT8 OperationFlags;
UINT16 Reserved;
UINT32 FunctionId;
} ACPI_TPM2_ARM_SMC;
/* Values for InterruptFlags above */
#define ACPI_TPM2_INTERRUPT_SUPPORT (1)
/* Values for OperationFlags above */
#define ACPI_TPM2_IDLE_SUPPORT (1)
/*******************************************************************************
*
* UEFI - UEFI Boot optimization Table
* Version 1
*
* Conforms to "Unified Extensible Firmware Interface Specification",
* Version 2.3, May 8, 2009
*
******************************************************************************/
typedef struct acpi_table_uefi
{
ACPI_TABLE_HEADER Header; /* Common ACPI table header */
UINT8 Identifier[16]; /* UUID identifier */
UINT16 DataOffset; /* Offset of remaining data in table */
} ACPI_TABLE_UEFI;
/*******************************************************************************
*
* VRTC - Virtual Real Time Clock Table
* Version 1
*
* Conforms to "Simple Firmware Interface Specification",
* Draft 0.8.2, Oct 19, 2010
* NOTE: The ACPI VRTC is equivalent to The SFI MRTC table.
*
******************************************************************************/
typedef struct acpi_table_vrtc
{
ACPI_TABLE_HEADER Header; /* Common ACPI table header */
} ACPI_TABLE_VRTC;
/* VRTC entry */
typedef struct acpi_vrtc_entry
{
ACPI_GENERIC_ADDRESS PhysicalAddress;
UINT32 Irq;
} ACPI_VRTC_ENTRY;
/*******************************************************************************
*
* WAET - Windows ACPI Emulated devices Table
* Version 1
*
* Conforms to "Windows ACPI Emulated Devices Table", version 1.0, April 6, 2009
*
******************************************************************************/
typedef struct acpi_table_waet
{
ACPI_TABLE_HEADER Header; /* Common ACPI table header */
UINT32 Flags;
} ACPI_TABLE_WAET;
/* Masks for Flags field above */
#define ACPI_WAET_RTC_NO_ACK (1) /* RTC requires no int acknowledge */
#define ACPI_WAET_TIMER_ONE_READ (1<<1) /* PM timer requires only one read */
/*******************************************************************************
*
* WDAT - Watchdog Action Table
* Version 1
*
* Conforms to "Hardware Watchdog Timers Design Specification",
* Copyright 2006 Microsoft Corporation.
*
******************************************************************************/
typedef struct acpi_table_wdat
{
ACPI_TABLE_HEADER Header; /* Common ACPI table header */
UINT32 HeaderLength; /* Watchdog Header Length */
UINT16 PciSegment; /* PCI Segment number */
UINT8 PciBus; /* PCI Bus number */
UINT8 PciDevice; /* PCI Device number */
UINT8 PciFunction; /* PCI Function number */
UINT8 Reserved[3];
UINT32 TimerPeriod; /* Period of one timer count (msec) */
UINT32 MaxCount; /* Maximum counter value supported */
UINT32 MinCount; /* Minimum counter value */
UINT8 Flags;
UINT8 Reserved2[3];
UINT32 Entries; /* Number of watchdog entries that follow */
} ACPI_TABLE_WDAT;
/* Masks for Flags field above */
#define ACPI_WDAT_ENABLED (1)
#define ACPI_WDAT_STOPPED 0x80
/* WDAT Instruction Entries (actions) */
typedef struct acpi_wdat_entry
{
UINT8 Action;
UINT8 Instruction;
UINT16 Reserved;
ACPI_GENERIC_ADDRESS RegisterRegion;
UINT32 Value; /* Value used with Read/Write register */
UINT32 Mask; /* Bitmask required for this register instruction */
} ACPI_WDAT_ENTRY;
/* Values for Action field above */
enum AcpiWdatActions
{
ACPI_WDAT_RESET = 1,
ACPI_WDAT_GET_CURRENT_COUNTDOWN = 4,
ACPI_WDAT_GET_COUNTDOWN = 5,
ACPI_WDAT_SET_COUNTDOWN = 6,
ACPI_WDAT_GET_RUNNING_STATE = 8,
ACPI_WDAT_SET_RUNNING_STATE = 9,
ACPI_WDAT_GET_STOPPED_STATE = 10,
ACPI_WDAT_SET_STOPPED_STATE = 11,
ACPI_WDAT_GET_REBOOT = 16,
ACPI_WDAT_SET_REBOOT = 17,
ACPI_WDAT_GET_SHUTDOWN = 18,
ACPI_WDAT_SET_SHUTDOWN = 19,
ACPI_WDAT_GET_STATUS = 32,
ACPI_WDAT_SET_STATUS = 33,
ACPI_WDAT_ACTION_RESERVED = 34 /* 34 and greater are reserved */
};
/* Values for Instruction field above */
enum AcpiWdatInstructions
{
ACPI_WDAT_READ_VALUE = 0,
ACPI_WDAT_READ_COUNTDOWN = 1,
ACPI_WDAT_WRITE_VALUE = 2,
ACPI_WDAT_WRITE_COUNTDOWN = 3,
ACPI_WDAT_INSTRUCTION_RESERVED = 4, /* 4 and greater are reserved */
ACPI_WDAT_PRESERVE_REGISTER = 0x80 /* Except for this value */
};
/*******************************************************************************
*
* WDDT - Watchdog Descriptor Table
* Version 1
*
* Conforms to "Using the Intel ICH Family Watchdog Timer (WDT)",
* Version 001, September 2002
*
******************************************************************************/
typedef struct acpi_table_wddt
{
ACPI_TABLE_HEADER Header; /* Common ACPI table header */
UINT16 SpecVersion;
UINT16 TableVersion;
UINT16 PciVendorId;
ACPI_GENERIC_ADDRESS Address;
UINT16 MaxCount; /* Maximum counter value supported */
UINT16 MinCount; /* Minimum counter value supported */
UINT16 Period;
UINT16 Status;
UINT16 Capability;
} ACPI_TABLE_WDDT;
/* Flags for Status field above */
#define ACPI_WDDT_AVAILABLE (1)
#define ACPI_WDDT_ACTIVE (1<<1)
#define ACPI_WDDT_TCO_OS_OWNED (1<<2)
#define ACPI_WDDT_USER_RESET (1<<11)
#define ACPI_WDDT_WDT_RESET (1<<12)
#define ACPI_WDDT_POWER_FAIL (1<<13)
#define ACPI_WDDT_UNKNOWN_RESET (1<<14)
/* Flags for Capability field above */
#define ACPI_WDDT_AUTO_RESET (1)
#define ACPI_WDDT_ALERT_SUPPORT (1<<1)
/*******************************************************************************
*
* WDRT - Watchdog Resource Table
* Version 1
*
* Conforms to "Watchdog Timer Hardware Requirements for Windows Server 2003",
* Version 1.01, August 28, 2006
*
******************************************************************************/
typedef struct acpi_table_wdrt
{
ACPI_TABLE_HEADER Header; /* Common ACPI table header */
ACPI_GENERIC_ADDRESS ControlRegister;
ACPI_GENERIC_ADDRESS CountRegister;
UINT16 PciDeviceId;
UINT16 PciVendorId;
UINT8 PciBus; /* PCI Bus number */
UINT8 PciDevice; /* PCI Device number */
UINT8 PciFunction; /* PCI Function number */
UINT8 PciSegment; /* PCI Segment number */
UINT16 MaxCount; /* Maximum counter value supported */
UINT8 Units;
} ACPI_TABLE_WDRT;
/*******************************************************************************
*
* 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
{
ACPI_TABLE_HEADER Header; /* Common ACPI table header */
UINT32 HandoffSize;
UINT64 HandoffAddress;
UINT8 Layout;
UINT8 Type;
UINT16 ArgumentsLength;
} ACPI_TABLE_WPBT;
/*******************************************************************************
*
* WSMT - Windows SMM Security Migrations Table
* Version 1
*
* Conforms to "Windows SMM Security Migrations Table",
* Version 1.0, April 18, 2016
*
******************************************************************************/
typedef struct acpi_table_wsmt
{
ACPI_TABLE_HEADER Header; /* Common ACPI table header */
UINT32 ProtectionFlags;
} ACPI_TABLE_WSMT;
/* Flags for ProtectionFlags field above */
#define ACPI_WSMT_FIXED_COMM_BUFFERS (1)
#define ACPI_WSMT_COMM_BUFFER_NESTED_PTR_PROTECTION (2)
#define ACPI_WSMT_SYSTEM_RESOURCE_PROTECTION (4)
/*******************************************************************************
*
* 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 */
#pragma pack()
#endif /* __ACTBL3_H__ */
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
-203
View File
@@ -1,203 +0,0 @@
/******************************************************************************
*
* Name: acuuid.h - ACPI-related UUID/GUID definitions
*
*****************************************************************************/
/******************************************************************************
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2019, 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.
*
*****************************************************************************
*
* Alternatively, you may choose to be licensed under the terms of the
* following license:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Alternatively, you may choose to be licensed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
*****************************************************************************/
#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"
/* Processor Properties (ACPI 6.2) */
#define UUID_CACHE_PROPERTIES "6DC63E77-257E-4E78-A973-A21F2796898D"
#define UUID_PHYSICAL_PROPERTY "DDE4D59A-AA42-4349-B407-EA40F57D9FB7"
/* 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__ */
-618
View File
@@ -1,618 +0,0 @@
/******************************************************************************
*
* Name: amlcode.h - Definitions for AML, as included in "definition blocks"
* Declarations and definitions contained herein are derived
* directly from the ACPI specification.
*
*****************************************************************************/
/******************************************************************************
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2019, 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.
*
*****************************************************************************
*
* Alternatively, you may choose to be licensed under the terms of the
* following license:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Alternatively, you may choose to be licensed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
*****************************************************************************/
#ifndef __AMLCODE_H__
#define __AMLCODE_H__
/* primary opcodes */
#define AML_ZERO_OP (UINT16) 0x00
#define AML_ONE_OP (UINT16) 0x01
#define AML_ALIAS_OP (UINT16) 0x06
#define AML_NAME_OP (UINT16) 0x08
#define AML_BYTE_OP (UINT16) 0x0a
#define AML_WORD_OP (UINT16) 0x0b
#define AML_DWORD_OP (UINT16) 0x0c
#define AML_STRING_OP (UINT16) 0x0d
#define AML_QWORD_OP (UINT16) 0x0e /* ACPI 2.0 */
#define AML_SCOPE_OP (UINT16) 0x10
#define AML_BUFFER_OP (UINT16) 0x11
#define AML_PACKAGE_OP (UINT16) 0x12
#define AML_VARIABLE_PACKAGE_OP (UINT16) 0x13 /* ACPI 2.0 */
#define AML_METHOD_OP (UINT16) 0x14
#define AML_EXTERNAL_OP (UINT16) 0x15 /* ACPI 6.0 */
#define AML_DUAL_NAME_PREFIX (UINT16) 0x2e
#define AML_MULTI_NAME_PREFIX (UINT16) 0x2f
#define AML_EXTENDED_PREFIX (UINT16) 0x5b
#define AML_ROOT_PREFIX (UINT16) 0x5c
#define AML_PARENT_PREFIX (UINT16) 0x5e
#define AML_FIRST_LOCAL_OP (UINT16) 0x60 /* Used for Local op # calculations */
#define AML_LOCAL0 (UINT16) 0x60
#define AML_LOCAL1 (UINT16) 0x61
#define AML_LOCAL2 (UINT16) 0x62
#define AML_LOCAL3 (UINT16) 0x63
#define AML_LOCAL4 (UINT16) 0x64
#define AML_LOCAL5 (UINT16) 0x65
#define AML_LOCAL6 (UINT16) 0x66
#define AML_LOCAL7 (UINT16) 0x67
#define AML_FIRST_ARG_OP (UINT16) 0x68 /* Used for Arg op # calculations */
#define AML_ARG0 (UINT16) 0x68
#define AML_ARG1 (UINT16) 0x69
#define AML_ARG2 (UINT16) 0x6a
#define AML_ARG3 (UINT16) 0x6b
#define AML_ARG4 (UINT16) 0x6c
#define AML_ARG5 (UINT16) 0x6d
#define AML_ARG6 (UINT16) 0x6e
#define AML_STORE_OP (UINT16) 0x70
#define AML_REF_OF_OP (UINT16) 0x71
#define AML_ADD_OP (UINT16) 0x72
#define AML_CONCATENATE_OP (UINT16) 0x73
#define AML_SUBTRACT_OP (UINT16) 0x74
#define AML_INCREMENT_OP (UINT16) 0x75
#define AML_DECREMENT_OP (UINT16) 0x76
#define AML_MULTIPLY_OP (UINT16) 0x77
#define AML_DIVIDE_OP (UINT16) 0x78
#define AML_SHIFT_LEFT_OP (UINT16) 0x79
#define AML_SHIFT_RIGHT_OP (UINT16) 0x7a
#define AML_BIT_AND_OP (UINT16) 0x7b
#define AML_BIT_NAND_OP (UINT16) 0x7c
#define AML_BIT_OR_OP (UINT16) 0x7d
#define AML_BIT_NOR_OP (UINT16) 0x7e
#define AML_BIT_XOR_OP (UINT16) 0x7f
#define AML_BIT_NOT_OP (UINT16) 0x80
#define AML_FIND_SET_LEFT_BIT_OP (UINT16) 0x81
#define AML_FIND_SET_RIGHT_BIT_OP (UINT16) 0x82
#define AML_DEREF_OF_OP (UINT16) 0x83
#define AML_CONCATENATE_TEMPLATE_OP (UINT16) 0x84 /* ACPI 2.0 */
#define AML_MOD_OP (UINT16) 0x85 /* ACPI 2.0 */
#define AML_NOTIFY_OP (UINT16) 0x86
#define AML_SIZE_OF_OP (UINT16) 0x87
#define AML_INDEX_OP (UINT16) 0x88
#define AML_MATCH_OP (UINT16) 0x89
#define AML_CREATE_DWORD_FIELD_OP (UINT16) 0x8a
#define AML_CREATE_WORD_FIELD_OP (UINT16) 0x8b
#define AML_CREATE_BYTE_FIELD_OP (UINT16) 0x8c
#define AML_CREATE_BIT_FIELD_OP (UINT16) 0x8d
#define AML_OBJECT_TYPE_OP (UINT16) 0x8e
#define AML_CREATE_QWORD_FIELD_OP (UINT16) 0x8f /* ACPI 2.0 */
#define AML_LOGICAL_AND_OP (UINT16) 0x90
#define AML_LOGICAL_OR_OP (UINT16) 0x91
#define AML_LOGICAL_NOT_OP (UINT16) 0x92
#define AML_LOGICAL_EQUAL_OP (UINT16) 0x93
#define AML_LOGICAL_GREATER_OP (UINT16) 0x94
#define AML_LOGICAL_LESS_OP (UINT16) 0x95
#define AML_TO_BUFFER_OP (UINT16) 0x96 /* ACPI 2.0 */
#define AML_TO_DECIMAL_STRING_OP (UINT16) 0x97 /* ACPI 2.0 */
#define AML_TO_HEX_STRING_OP (UINT16) 0x98 /* ACPI 2.0 */
#define AML_TO_INTEGER_OP (UINT16) 0x99 /* ACPI 2.0 */
#define AML_TO_STRING_OP (UINT16) 0x9c /* ACPI 2.0 */
#define AML_COPY_OBJECT_OP (UINT16) 0x9d /* ACPI 2.0 */
#define AML_MID_OP (UINT16) 0x9e /* ACPI 2.0 */
#define AML_CONTINUE_OP (UINT16) 0x9f /* ACPI 2.0 */
#define AML_IF_OP (UINT16) 0xa0
#define AML_ELSE_OP (UINT16) 0xa1
#define AML_WHILE_OP (UINT16) 0xa2
#define AML_NOOP_OP (UINT16) 0xa3
#define AML_RETURN_OP (UINT16) 0xa4
#define AML_BREAK_OP (UINT16) 0xa5
#define AML_COMMENT_OP (UINT16) 0xa9
#define AML_BREAKPOINT_OP (UINT16) 0xcc
#define AML_ONES_OP (UINT16) 0xff
/*
* Combination opcodes (actually two one-byte opcodes)
* Used by the disassembler and iASL compiler
*/
#define AML_LOGICAL_GREATER_EQUAL_OP (UINT16) 0x9295 /* LNot (LLess) */
#define AML_LOGICAL_LESS_EQUAL_OP (UINT16) 0x9294 /* LNot (LGreater) */
#define AML_LOGICAL_NOT_EQUAL_OP (UINT16) 0x9293 /* LNot (LEqual) */
/* Prefixed (2-byte) opcodes (with AML_EXTENDED_PREFIX) */
#define AML_EXTENDED_OPCODE (UINT16) 0x5b00 /* Prefix for 2-byte opcodes */
#define AML_MUTEX_OP (UINT16) 0x5b01
#define AML_EVENT_OP (UINT16) 0x5b02
#define AML_SHIFT_RIGHT_BIT_OP (UINT16) 0x5b10 /* Obsolete, not in ACPI spec */
#define AML_SHIFT_LEFT_BIT_OP (UINT16) 0x5b11 /* Obsolete, not in ACPI spec */
#define AML_CONDITIONAL_REF_OF_OP (UINT16) 0x5b12
#define AML_CREATE_FIELD_OP (UINT16) 0x5b13
#define AML_LOAD_TABLE_OP (UINT16) 0x5b1f /* ACPI 2.0 */
#define AML_LOAD_OP (UINT16) 0x5b20
#define AML_STALL_OP (UINT16) 0x5b21
#define AML_SLEEP_OP (UINT16) 0x5b22
#define AML_ACQUIRE_OP (UINT16) 0x5b23
#define AML_SIGNAL_OP (UINT16) 0x5b24
#define AML_WAIT_OP (UINT16) 0x5b25
#define AML_RESET_OP (UINT16) 0x5b26
#define AML_RELEASE_OP (UINT16) 0x5b27
#define AML_FROM_BCD_OP (UINT16) 0x5b28
#define AML_TO_BCD_OP (UINT16) 0x5b29
#define AML_UNLOAD_OP (UINT16) 0x5b2a
#define AML_REVISION_OP (UINT16) 0x5b30
#define AML_DEBUG_OP (UINT16) 0x5b31
#define AML_FATAL_OP (UINT16) 0x5b32
#define AML_TIMER_OP (UINT16) 0x5b33 /* ACPI 3.0 */
#define AML_REGION_OP (UINT16) 0x5b80
#define AML_FIELD_OP (UINT16) 0x5b81
#define AML_DEVICE_OP (UINT16) 0x5b82
#define AML_PROCESSOR_OP (UINT16) 0x5b83
#define AML_POWER_RESOURCE_OP (UINT16) 0x5b84
#define AML_THERMAL_ZONE_OP (UINT16) 0x5b85
#define AML_INDEX_FIELD_OP (UINT16) 0x5b86
#define AML_BANK_FIELD_OP (UINT16) 0x5b87
#define AML_DATA_REGION_OP (UINT16) 0x5b88 /* ACPI 2.0 */
/*
* Opcodes for "Field" operators
*/
#define AML_FIELD_OFFSET_OP (UINT8) 0x00
#define AML_FIELD_ACCESS_OP (UINT8) 0x01
#define AML_FIELD_CONNECTION_OP (UINT8) 0x02 /* ACPI 5.0 */
#define AML_FIELD_EXT_ACCESS_OP (UINT8) 0x03 /* ACPI 5.0 */
/*
* Internal opcodes
* Use only "Unknown" AML opcodes, don't attempt to use
* any valid ACPI ASCII values (A-Z, 0-9, '-')
*/
#define AML_INT_NAMEPATH_OP (UINT16) 0x002d
#define AML_INT_NAMEDFIELD_OP (UINT16) 0x0030
#define AML_INT_RESERVEDFIELD_OP (UINT16) 0x0031
#define AML_INT_ACCESSFIELD_OP (UINT16) 0x0032
#define AML_INT_BYTELIST_OP (UINT16) 0x0033
#define AML_INT_METHODCALL_OP (UINT16) 0x0035
#define AML_INT_RETURN_VALUE_OP (UINT16) 0x0036
#define AML_INT_EVAL_SUBTREE_OP (UINT16) 0x0037
#define AML_INT_CONNECTION_OP (UINT16) 0x0038
#define AML_INT_EXTACCESSFIELD_OP (UINT16) 0x0039
#define ARG_NONE 0x0
/*
* Argument types for the AML Parser
* Each field in the ArgTypes UINT32 is 5 bits, allowing for a maximum of 6 arguments.
* There can be up to 31 unique argument types
* Zero is reserved as end-of-list indicator
*/
#define ARGP_BYTEDATA 0x01
#define ARGP_BYTELIST 0x02
#define ARGP_CHARLIST 0x03
#define ARGP_DATAOBJ 0x04
#define ARGP_DATAOBJLIST 0x05
#define ARGP_DWORDDATA 0x06
#define ARGP_FIELDLIST 0x07
#define ARGP_NAME 0x08
#define ARGP_NAMESTRING 0x09
#define ARGP_OBJLIST 0x0A
#define ARGP_PKGLENGTH 0x0B
#define ARGP_SUPERNAME 0x0C
#define ARGP_TARGET 0x0D
#define ARGP_TERMARG 0x0E
#define ARGP_TERMLIST 0x0F
#define ARGP_WORDDATA 0x10
#define ARGP_QWORDDATA 0x11
#define ARGP_SIMPLENAME 0x12 /* NameString | LocalTerm | ArgTerm */
#define ARGP_NAME_OR_REF 0x13 /* For ObjectType only */
#define ARGP_MAX 0x13
#define ARGP_COMMENT 0x14
/*
* Resolved argument types for the AML Interpreter
* Each field in the ArgTypes UINT32 is 5 bits, allowing for a maximum of 6 arguments.
* There can be up to 31 unique argument types (0 is end-of-arg-list indicator)
*
* Note1: These values are completely independent from the ACPI_TYPEs
* i.e., ARGI_INTEGER != ACPI_TYPE_INTEGER
*
* Note2: If and when 5 bits becomes insufficient, it would probably be best
* to convert to a 6-byte array of argument types, allowing 8 bits per argument.
*/
/* Single, simple types */
#define ARGI_ANYTYPE 0x01 /* Don't care */
#define ARGI_PACKAGE 0x02
#define ARGI_EVENT 0x03
#define ARGI_MUTEX 0x04
#define ARGI_DDBHANDLE 0x05
/* Interchangeable types (via implicit conversion) */
#define ARGI_INTEGER 0x06
#define ARGI_STRING 0x07
#define ARGI_BUFFER 0x08
#define ARGI_BUFFER_OR_STRING 0x09 /* Used by MID op only */
#define ARGI_COMPUTEDATA 0x0A /* Buffer, String, or Integer */
/* Reference objects */
#define ARGI_INTEGER_REF 0x0B
#define ARGI_OBJECT_REF 0x0C
#define ARGI_DEVICE_REF 0x0D
#define ARGI_REFERENCE 0x0E
#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 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 */
#define ARGI_INVALID_OPCODE 0xFFFFFFFF
/*
* Some of the flags and types below are of the form:
*
* AML_FLAGS_EXEC_#A_#T,#R, or
* AML_TYPE_EXEC_#A_#T,#R where:
*
* #A is the number of required arguments
* #T is the number of target operands
* #R indicates whether there is a return value
*
* These types are used for the top-level dispatch of the AML
* opcode. They group similar operators that can share common
* front-end code before dispatch to the final code that implements
* the operator.
*/
/*
* Opcode information flags
*/
#define AML_LOGICAL 0x0001
#define AML_LOGICAL_NUMERIC 0x0002
#define AML_MATH 0x0004
#define AML_CREATE 0x0008
#define AML_FIELD 0x0010
#define AML_DEFER 0x0020
#define AML_NAMED 0x0040
#define AML_NSNODE 0x0080
#define AML_NSOPCODE 0x0100
#define AML_NSOBJECT 0x0200
#define AML_HAS_RETVAL 0x0400
#define AML_HAS_TARGET 0x0800
#define AML_HAS_ARGS 0x1000
#define AML_CONSTANT 0x2000
#define AML_NO_OPERAND_RESOLVE 0x4000
/* Convenient flag groupings of the flags above */
#define AML_FLAGS_EXEC_0A_0T_1R AML_HAS_RETVAL
#define AML_FLAGS_EXEC_1A_0T_0R AML_HAS_ARGS /* Monadic1 */
#define AML_FLAGS_EXEC_1A_0T_1R AML_HAS_ARGS | AML_HAS_RETVAL /* Monadic2 */
#define AML_FLAGS_EXEC_1A_1T_0R AML_HAS_ARGS | AML_HAS_TARGET
#define AML_FLAGS_EXEC_1A_1T_1R AML_HAS_ARGS | AML_HAS_TARGET | AML_HAS_RETVAL /* Monadic2R */
#define AML_FLAGS_EXEC_2A_0T_0R AML_HAS_ARGS /* Dyadic1 */
#define AML_FLAGS_EXEC_2A_0T_1R AML_HAS_ARGS | AML_HAS_RETVAL /* Dyadic2 */
#define AML_FLAGS_EXEC_2A_1T_1R AML_HAS_ARGS | AML_HAS_TARGET | AML_HAS_RETVAL /* Dyadic2R */
#define AML_FLAGS_EXEC_2A_2T_1R AML_HAS_ARGS | AML_HAS_TARGET | AML_HAS_RETVAL
#define AML_FLAGS_EXEC_3A_0T_0R AML_HAS_ARGS
#define AML_FLAGS_EXEC_3A_1T_1R AML_HAS_ARGS | AML_HAS_TARGET | AML_HAS_RETVAL
#define AML_FLAGS_EXEC_6A_0T_1R AML_HAS_ARGS | AML_HAS_RETVAL
/*
* The opcode Type is used in a dispatch table, do not change
* or add anything new without updating the table.
*/
#define AML_TYPE_EXEC_0A_0T_1R 0x00 /* 0 Args, 0 Target, 1 RetVal */
#define AML_TYPE_EXEC_1A_0T_0R 0x01 /* 1 Args, 0 Target, 0 RetVal */
#define AML_TYPE_EXEC_1A_0T_1R 0x02 /* 1 Args, 0 Target, 1 RetVal */
#define AML_TYPE_EXEC_1A_1T_0R 0x03 /* 1 Args, 1 Target, 0 RetVal */
#define AML_TYPE_EXEC_1A_1T_1R 0x04 /* 1 Args, 1 Target, 1 RetVal */
#define AML_TYPE_EXEC_2A_0T_0R 0x05 /* 2 Args, 0 Target, 0 RetVal */
#define AML_TYPE_EXEC_2A_0T_1R 0x06 /* 2 Args, 0 Target, 1 RetVal */
#define AML_TYPE_EXEC_2A_1T_1R 0x07 /* 2 Args, 1 Target, 1 RetVal */
#define AML_TYPE_EXEC_2A_2T_1R 0x08 /* 2 Args, 2 Target, 1 RetVal */
#define AML_TYPE_EXEC_3A_0T_0R 0x09 /* 3 Args, 0 Target, 0 RetVal */
#define AML_TYPE_EXEC_3A_1T_1R 0x0A /* 3 Args, 1 Target, 1 RetVal */
#define AML_TYPE_EXEC_6A_0T_1R 0x0B /* 6 Args, 0 Target, 1 RetVal */
/* End of types used in dispatch table */
#define AML_TYPE_LITERAL 0x0C
#define AML_TYPE_CONSTANT 0x0D
#define AML_TYPE_METHOD_ARGUMENT 0x0E
#define AML_TYPE_LOCAL_VARIABLE 0x0F
#define AML_TYPE_DATA_TERM 0x10
/* Generic for an op that returns a value */
#define AML_TYPE_METHOD_CALL 0x11
/* Miscellaneous types */
#define AML_TYPE_CREATE_FIELD 0x12
#define AML_TYPE_CREATE_OBJECT 0x13
#define AML_TYPE_CONTROL 0x14
#define AML_TYPE_NAMED_NO_OBJ 0x15
#define AML_TYPE_NAMED_FIELD 0x16
#define AML_TYPE_NAMED_SIMPLE 0x17
#define AML_TYPE_NAMED_COMPLEX 0x18
#define AML_TYPE_RETURN 0x19
#define AML_TYPE_UNDEFINED 0x1A
#define AML_TYPE_BOGUS 0x1B
/* AML Package Length encodings */
#define ACPI_AML_PACKAGE_TYPE1 0x40
#define ACPI_AML_PACKAGE_TYPE2 0x4000
#define ACPI_AML_PACKAGE_TYPE3 0x400000
#define ACPI_AML_PACKAGE_TYPE4 0x40000000
/*
* Opcode classes
*/
#define AML_CLASS_EXECUTE 0x00
#define AML_CLASS_CREATE 0x01
#define AML_CLASS_ARGUMENT 0x02
#define AML_CLASS_NAMED_OBJECT 0x03
#define AML_CLASS_CONTROL 0x04
#define AML_CLASS_ASCII 0x05
#define AML_CLASS_PREFIX 0x06
#define AML_CLASS_INTERNAL 0x07
#define AML_CLASS_RETURN_VALUE 0x08
#define AML_CLASS_METHOD_CALL 0x09
#define AML_CLASS_UNKNOWN 0x0A
/* Comparison operation codes for MatchOp operator */
typedef enum
{
MATCH_MTR = 0,
MATCH_MEQ = 1,
MATCH_MLE = 2,
MATCH_MLT = 3,
MATCH_MGE = 4,
MATCH_MGT = 5
} AML_MATCH_OPERATOR;
#define MAX_MATCH_OPERATOR 5
/*
* FieldFlags
*
* This byte is extracted from the AML and includes three separate
* pieces of information about the field:
* 1) The field access type
* 2) The field update rule
* 3) The lock rule for the field
*
* Bits 00 - 03 : AccessType (AnyAcc, ByteAcc, etc.)
* 04 : LockRule (1 == Lock)
* 05 - 06 : UpdateRule
*/
#define AML_FIELD_ACCESS_TYPE_MASK 0x0F
#define AML_FIELD_LOCK_RULE_MASK 0x10
#define AML_FIELD_UPDATE_RULE_MASK 0x60
/* 1) Field Access Types */
typedef enum
{
AML_FIELD_ACCESS_ANY = 0x00,
AML_FIELD_ACCESS_BYTE = 0x01,
AML_FIELD_ACCESS_WORD = 0x02,
AML_FIELD_ACCESS_DWORD = 0x03,
AML_FIELD_ACCESS_QWORD = 0x04, /* ACPI 2.0 */
AML_FIELD_ACCESS_BUFFER = 0x05 /* ACPI 2.0 */
} AML_ACCESS_TYPE;
/* 2) Field Lock Rules */
typedef enum
{
AML_FIELD_LOCK_NEVER = 0x00,
AML_FIELD_LOCK_ALWAYS = 0x10
} AML_LOCK_RULE;
/* 3) Field Update Rules */
typedef enum
{
AML_FIELD_UPDATE_PRESERVE = 0x00,
AML_FIELD_UPDATE_WRITE_AS_ONES = 0x20,
AML_FIELD_UPDATE_WRITE_AS_ZEROS = 0x40
} AML_UPDATE_RULE;
/*
* Field Access Attributes.
* This byte is extracted from the AML via the
* AccessAs keyword
*/
typedef enum
{
AML_FIELD_ATTRIB_QUICK = 0x02,
AML_FIELD_ATTRIB_SEND_RECEIVE = 0x04,
AML_FIELD_ATTRIB_BYTE = 0x06,
AML_FIELD_ATTRIB_WORD = 0x08,
AML_FIELD_ATTRIB_BLOCK = 0x0A,
AML_FIELD_ATTRIB_BYTES = 0x0B,
AML_FIELD_ATTRIB_PROCESS_CALL = 0x0C,
AML_FIELD_ATTRIB_BLOCK_PROCESS_CALL = 0x0D,
AML_FIELD_ATTRIB_RAW_BYTES = 0x0E,
AML_FIELD_ATTRIB_RAW_PROCESS_BYTES = 0x0F
} AML_ACCESS_ATTRIBUTE;
/* Bit fields in the AML MethodFlags byte */
#define AML_METHOD_ARG_COUNT 0x07
#define AML_METHOD_SERIALIZED 0x08
#define AML_METHOD_SYNC_LEVEL 0xF0
#endif /* __AMLCODE_H__ */
-857
View File
@@ -1,857 +0,0 @@
/******************************************************************************
*
* Module Name: amlresrc.h - AML resource descriptors
*
*****************************************************************************/
/******************************************************************************
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2019, 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.
*
*****************************************************************************
*
* Alternatively, you may choose to be licensed under the terms of the
* following license:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Alternatively, you may choose to be licensed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
*****************************************************************************/
/* acpisrc:StructDefs -- for acpisrc conversion */
#ifndef __AMLRESRC_H
#define __AMLRESRC_H
/*
* Resource descriptor tags, as defined in the ACPI specification.
* Used to symbolically reference fields within a descriptor.
*/
#define ACPI_RESTAG_ADDRESS "_ADR"
#define ACPI_RESTAG_ALIGNMENT "_ALN"
#define ACPI_RESTAG_ADDRESSSPACE "_ASI"
#define ACPI_RESTAG_ACCESSSIZE "_ASZ"
#define ACPI_RESTAG_TYPESPECIFICATTRIBUTES "_ATT"
#define ACPI_RESTAG_BASEADDRESS "_BAS"
#define ACPI_RESTAG_BUSMASTER "_BM_" /* Master(1), Slave(0) */
#define ACPI_RESTAG_DEBOUNCETIME "_DBT"
#define ACPI_RESTAG_DECODE "_DEC"
#define ACPI_RESTAG_DEVICEPOLARITY "_DPL"
#define ACPI_RESTAG_DMA "_DMA"
#define ACPI_RESTAG_DMATYPE "_TYP" /* Compatible(0), A(1), B(2), F(3) */
#define ACPI_RESTAG_DRIVESTRENGTH "_DRS"
#define ACPI_RESTAG_ENDIANNESS "_END"
#define ACPI_RESTAG_FLOWCONTROL "_FLC"
#define ACPI_RESTAG_FUNCTION "_FUN"
#define ACPI_RESTAG_GRANULARITY "_GRA"
#define ACPI_RESTAG_INTERRUPT "_INT"
#define ACPI_RESTAG_INTERRUPTLEVEL "_LL_" /* ActiveLo(1), ActiveHi(0) */
#define ACPI_RESTAG_INTERRUPTSHARE "_SHR" /* Shareable(1), NoShare(0) */
#define ACPI_RESTAG_INTERRUPTTYPE "_HE_" /* Edge(1), Level(0) */
#define ACPI_RESTAG_IORESTRICTION "_IOR"
#define ACPI_RESTAG_LENGTH "_LEN"
#define ACPI_RESTAG_LINE "_LIN"
#define ACPI_RESTAG_MEMATTRIBUTES "_MTP" /* Memory(0), Reserved(1), ACPI(2), NVS(3) */
#define ACPI_RESTAG_MEMTYPE "_MEM" /* NonCache(0), Cacheable(1) Cache+combine(2), Cache+prefetch(3) */
#define ACPI_RESTAG_MAXADDR "_MAX"
#define ACPI_RESTAG_MINADDR "_MIN"
#define ACPI_RESTAG_MAXTYPE "_MAF"
#define ACPI_RESTAG_MINTYPE "_MIF"
#define ACPI_RESTAG_MODE "_MOD"
#define ACPI_RESTAG_PARITY "_PAR"
#define ACPI_RESTAG_PHASE "_PHA"
#define ACPI_RESTAG_PIN "_PIN"
#define ACPI_RESTAG_PINCONFIG "_PPI"
#define ACPI_RESTAG_PINCONFIG_TYPE "_TYP"
#define ACPI_RESTAG_PINCONFIG_VALUE "_VAL"
#define ACPI_RESTAG_POLARITY "_POL"
#define ACPI_RESTAG_REGISTERBITOFFSET "_RBO"
#define ACPI_RESTAG_REGISTERBITWIDTH "_RBW"
#define ACPI_RESTAG_RANGETYPE "_RNG"
#define ACPI_RESTAG_READWRITETYPE "_RW_" /* ReadOnly(0), Writeable (1) */
#define ACPI_RESTAG_LENGTH_RX "_RXL"
#define ACPI_RESTAG_LENGTH_TX "_TXL"
#define ACPI_RESTAG_SLAVEMODE "_SLV"
#define ACPI_RESTAG_SPEED "_SPE"
#define ACPI_RESTAG_STOPBITS "_STB"
#define ACPI_RESTAG_TRANSLATION "_TRA"
#define ACPI_RESTAG_TRANSTYPE "_TRS" /* Sparse(1), Dense(0) */
#define ACPI_RESTAG_TYPE "_TTP" /* Translation(1), Static (0) */
#define ACPI_RESTAG_XFERTYPE "_SIZ" /* 8(0), 8And16(1), 16(2) */
#define ACPI_RESTAG_VENDORDATA "_VEN"
/* Default sizes for "small" resource descriptors */
#define ASL_RDESC_IRQ_SIZE 0x02
#define ASL_RDESC_DMA_SIZE 0x02
#define ASL_RDESC_ST_DEPEND_SIZE 0x00
#define ASL_RDESC_END_DEPEND_SIZE 0x00
#define ASL_RDESC_IO_SIZE 0x07
#define ASL_RDESC_FIXED_IO_SIZE 0x03
#define ASL_RDESC_FIXED_DMA_SIZE 0x05
#define ASL_RDESC_END_TAG_SIZE 0x01
typedef struct asl_resource_node
{
UINT32 BufferLength;
void *Buffer;
struct asl_resource_node *Next;
} ASL_RESOURCE_NODE;
typedef struct asl_resource_info
{
ACPI_PARSE_OBJECT *DescriptorTypeOp; /* Resource descriptor parse node */
ACPI_PARSE_OBJECT *MappingOp; /* Used for mapfile support */
UINT32 CurrentByteOffset; /* Offset in resource template */
} ASL_RESOURCE_INFO;
/* Macros used to generate AML resource length fields */
#define ACPI_AML_SIZE_LARGE(r) (sizeof (r) - sizeof (AML_RESOURCE_LARGE_HEADER))
#define ACPI_AML_SIZE_SMALL(r) (sizeof (r) - sizeof (AML_RESOURCE_SMALL_HEADER))
/*
* Resource descriptors defined in the ACPI specification.
*
* Packing/alignment must be BYTE because these descriptors
* are used to overlay the raw AML byte stream.
*/
#pragma pack(1)
/*
* SMALL descriptors
*/
#define AML_RESOURCE_SMALL_HEADER_COMMON \
UINT8 DescriptorType;
typedef struct aml_resource_small_header
{
AML_RESOURCE_SMALL_HEADER_COMMON
} AML_RESOURCE_SMALL_HEADER;
typedef struct aml_resource_irq
{
AML_RESOURCE_SMALL_HEADER_COMMON
UINT16 IrqMask;
UINT8 Flags;
} AML_RESOURCE_IRQ;
typedef struct aml_resource_irq_noflags
{
AML_RESOURCE_SMALL_HEADER_COMMON
UINT16 IrqMask;
} AML_RESOURCE_IRQ_NOFLAGS;
typedef struct aml_resource_dma
{
AML_RESOURCE_SMALL_HEADER_COMMON
UINT8 DmaChannelMask;
UINT8 Flags;
} AML_RESOURCE_DMA;
typedef struct aml_resource_start_dependent
{
AML_RESOURCE_SMALL_HEADER_COMMON
UINT8 Flags;
} AML_RESOURCE_START_DEPENDENT;
typedef struct aml_resource_start_dependent_noprio
{
AML_RESOURCE_SMALL_HEADER_COMMON
} AML_RESOURCE_START_DEPENDENT_NOPRIO;
typedef struct aml_resource_end_dependent
{
AML_RESOURCE_SMALL_HEADER_COMMON
} AML_RESOURCE_END_DEPENDENT;
typedef struct aml_resource_io
{
AML_RESOURCE_SMALL_HEADER_COMMON
UINT8 Flags;
UINT16 Minimum;
UINT16 Maximum;
UINT8 Alignment;
UINT8 AddressLength;
} AML_RESOURCE_IO;
typedef struct aml_resource_fixed_io
{
AML_RESOURCE_SMALL_HEADER_COMMON
UINT16 Address;
UINT8 AddressLength;
} AML_RESOURCE_FIXED_IO;
typedef struct aml_resource_vendor_small
{
AML_RESOURCE_SMALL_HEADER_COMMON
} AML_RESOURCE_VENDOR_SMALL;
typedef struct aml_resource_end_tag
{
AML_RESOURCE_SMALL_HEADER_COMMON
UINT8 Checksum;
} AML_RESOURCE_END_TAG;
typedef struct aml_resource_fixed_dma
{
AML_RESOURCE_SMALL_HEADER_COMMON
UINT16 RequestLines;
UINT16 Channels;
UINT8 Width;
} AML_RESOURCE_FIXED_DMA;
/*
* LARGE descriptors
*/
#define AML_RESOURCE_LARGE_HEADER_COMMON \
UINT8 DescriptorType;\
UINT16 ResourceLength;
typedef struct aml_resource_large_header
{
AML_RESOURCE_LARGE_HEADER_COMMON
} AML_RESOURCE_LARGE_HEADER;
/* General Flags for address space resource descriptors */
#define ACPI_RESOURCE_FLAG_DEC 2
#define ACPI_RESOURCE_FLAG_MIF 4
#define ACPI_RESOURCE_FLAG_MAF 8
typedef struct aml_resource_memory24
{
AML_RESOURCE_LARGE_HEADER_COMMON
UINT8 Flags;
UINT16 Minimum;
UINT16 Maximum;
UINT16 Alignment;
UINT16 AddressLength;
} AML_RESOURCE_MEMORY24;
typedef struct aml_resource_vendor_large
{
AML_RESOURCE_LARGE_HEADER_COMMON
} AML_RESOURCE_VENDOR_LARGE;
typedef struct aml_resource_memory32
{
AML_RESOURCE_LARGE_HEADER_COMMON
UINT8 Flags;
UINT32 Minimum;
UINT32 Maximum;
UINT32 Alignment;
UINT32 AddressLength;
} AML_RESOURCE_MEMORY32;
typedef struct aml_resource_fixed_memory32
{
AML_RESOURCE_LARGE_HEADER_COMMON
UINT8 Flags;
UINT32 Address;
UINT32 AddressLength;
} AML_RESOURCE_FIXED_MEMORY32;
#define AML_RESOURCE_ADDRESS_COMMON \
UINT8 ResourceType; \
UINT8 Flags; \
UINT8 SpecificFlags;
typedef struct aml_resource_address
{
AML_RESOURCE_LARGE_HEADER_COMMON
AML_RESOURCE_ADDRESS_COMMON
} AML_RESOURCE_ADDRESS;
typedef struct aml_resource_extended_address64
{
AML_RESOURCE_LARGE_HEADER_COMMON
AML_RESOURCE_ADDRESS_COMMON
UINT8 RevisionID;
UINT8 Reserved;
UINT64 Granularity;
UINT64 Minimum;
UINT64 Maximum;
UINT64 TranslationOffset;
UINT64 AddressLength;
UINT64 TypeSpecific;
} AML_RESOURCE_EXTENDED_ADDRESS64;
#define AML_RESOURCE_EXTENDED_ADDRESS_REVISION 1 /* ACPI 3.0 */
typedef struct aml_resource_address64
{
AML_RESOURCE_LARGE_HEADER_COMMON
AML_RESOURCE_ADDRESS_COMMON
UINT64 Granularity;
UINT64 Minimum;
UINT64 Maximum;
UINT64 TranslationOffset;
UINT64 AddressLength;
} AML_RESOURCE_ADDRESS64;
typedef struct aml_resource_address32
{
AML_RESOURCE_LARGE_HEADER_COMMON
AML_RESOURCE_ADDRESS_COMMON
UINT32 Granularity;
UINT32 Minimum;
UINT32 Maximum;
UINT32 TranslationOffset;
UINT32 AddressLength;
} AML_RESOURCE_ADDRESS32;
typedef struct aml_resource_address16
{
AML_RESOURCE_LARGE_HEADER_COMMON
AML_RESOURCE_ADDRESS_COMMON
UINT16 Granularity;
UINT16 Minimum;
UINT16 Maximum;
UINT16 TranslationOffset;
UINT16 AddressLength;
} AML_RESOURCE_ADDRESS16;
typedef struct aml_resource_extended_irq
{
AML_RESOURCE_LARGE_HEADER_COMMON
UINT8 Flags;
UINT8 InterruptCount;
UINT32 Interrupts[1];
/* ResSourceIndex, ResSource optional fields follow */
} AML_RESOURCE_EXTENDED_IRQ;
typedef struct aml_resource_generic_register
{
AML_RESOURCE_LARGE_HEADER_COMMON
UINT8 AddressSpaceId;
UINT8 BitWidth;
UINT8 BitOffset;
UINT8 AccessSize; /* ACPI 3.0, was previously Reserved */
UINT64 Address;
} AML_RESOURCE_GENERIC_REGISTER;
/* Common descriptor for GpioInt and GpioIo (ACPI 5.0) */
typedef struct aml_resource_gpio
{
AML_RESOURCE_LARGE_HEADER_COMMON
UINT8 RevisionId;
UINT8 ConnectionType;
UINT16 Flags;
UINT16 IntFlags;
UINT8 PinConfig;
UINT16 DriveStrength;
UINT16 DebounceTimeout;
UINT16 PinTableOffset;
UINT8 ResSourceIndex;
UINT16 ResSourceOffset;
UINT16 VendorOffset;
UINT16 VendorLength;
/*
* Optional fields follow immediately:
* 1) PIN list (Words)
* 2) Resource Source String
* 3) Vendor Data bytes
*/
} AML_RESOURCE_GPIO;
#define AML_RESOURCE_GPIO_REVISION 1 /* ACPI 5.0 */
/* Values for ConnectionType above */
#define AML_RESOURCE_GPIO_TYPE_INT 0
#define AML_RESOURCE_GPIO_TYPE_IO 1
#define AML_RESOURCE_MAX_GPIOTYPE 1
/* Common preamble for all serial descriptors (ACPI 5.0) */
#define AML_RESOURCE_SERIAL_COMMON \
UINT8 RevisionId; \
UINT8 ResSourceIndex; \
UINT8 Type; \
UINT8 Flags; \
UINT16 TypeSpecificFlags; \
UINT8 TypeRevisionId; \
UINT16 TypeDataLength; \
/* Values for the type field above */
#define AML_RESOURCE_I2C_SERIALBUSTYPE 1
#define AML_RESOURCE_SPI_SERIALBUSTYPE 2
#define AML_RESOURCE_UART_SERIALBUSTYPE 3
#define AML_RESOURCE_MAX_SERIALBUSTYPE 3
#define AML_RESOURCE_VENDOR_SERIALBUSTYPE 192 /* Vendor defined is 0xC0-0xFF (NOT SUPPORTED) */
typedef struct aml_resource_common_serialbus
{
AML_RESOURCE_LARGE_HEADER_COMMON
AML_RESOURCE_SERIAL_COMMON
} AML_RESOURCE_COMMON_SERIALBUS;
typedef struct aml_resource_i2c_serialbus
{
AML_RESOURCE_LARGE_HEADER_COMMON
AML_RESOURCE_SERIAL_COMMON
UINT32 ConnectionSpeed;
UINT16 SlaveAddress;
/*
* Optional fields follow immediately:
* 1) Vendor Data bytes
* 2) Resource Source String
*/
} AML_RESOURCE_I2C_SERIALBUS;
#define AML_RESOURCE_I2C_REVISION 1 /* ACPI 5.0 */
#define AML_RESOURCE_I2C_TYPE_REVISION 1 /* ACPI 5.0 */
#define AML_RESOURCE_I2C_MIN_DATA_LEN 6
typedef struct aml_resource_spi_serialbus
{
AML_RESOURCE_LARGE_HEADER_COMMON
AML_RESOURCE_SERIAL_COMMON
UINT32 ConnectionSpeed;
UINT8 DataBitLength;
UINT8 ClockPhase;
UINT8 ClockPolarity;
UINT16 DeviceSelection;
/*
* Optional fields follow immediately:
* 1) Vendor Data bytes
* 2) Resource Source String
*/
} AML_RESOURCE_SPI_SERIALBUS;
#define AML_RESOURCE_SPI_REVISION 1 /* ACPI 5.0 */
#define AML_RESOURCE_SPI_TYPE_REVISION 1 /* ACPI 5.0 */
#define AML_RESOURCE_SPI_MIN_DATA_LEN 9
typedef struct aml_resource_uart_serialbus
{
AML_RESOURCE_LARGE_HEADER_COMMON
AML_RESOURCE_SERIAL_COMMON
UINT32 DefaultBaudRate;
UINT16 RxFifoSize;
UINT16 TxFifoSize;
UINT8 Parity;
UINT8 LinesEnabled;
/*
* Optional fields follow immediately:
* 1) Vendor Data bytes
* 2) Resource Source String
*/
} AML_RESOURCE_UART_SERIALBUS;
#define AML_RESOURCE_UART_REVISION 1 /* ACPI 5.0 */
#define AML_RESOURCE_UART_TYPE_REVISION 1 /* ACPI 5.0 */
#define AML_RESOURCE_UART_MIN_DATA_LEN 10
typedef struct aml_resource_pin_function
{
AML_RESOURCE_LARGE_HEADER_COMMON
UINT8 RevisionId;
UINT16 Flags;
UINT8 PinConfig;
UINT16 FunctionNumber;
UINT16 PinTableOffset;
UINT8 ResSourceIndex;
UINT16 ResSourceOffset;
UINT16 VendorOffset;
UINT16 VendorLength;
/*
* Optional fields follow immediately:
* 1) PIN list (Words)
* 2) Resource Source String
* 3) Vendor Data bytes
*/
} AML_RESOURCE_PIN_FUNCTION;
#define AML_RESOURCE_PIN_FUNCTION_REVISION 1 /* ACPI 6.2 */
typedef struct aml_resource_pin_config
{
AML_RESOURCE_LARGE_HEADER_COMMON
UINT8 RevisionId;
UINT16 Flags;
UINT8 PinConfigType;
UINT32 PinConfigValue;
UINT16 PinTableOffset;
UINT8 ResSourceIndex;
UINT16 ResSourceOffset;
UINT16 VendorOffset;
UINT16 VendorLength;
/*
* Optional fields follow immediately:
* 1) PIN list (Words)
* 2) Resource Source String
* 3) Vendor Data bytes
*/
} AML_RESOURCE_PIN_CONFIG;
#define AML_RESOURCE_PIN_CONFIG_REVISION 1 /* ACPI 6.2 */
typedef struct aml_resource_pin_group
{
AML_RESOURCE_LARGE_HEADER_COMMON
UINT8 RevisionId;
UINT16 Flags;
UINT16 PinTableOffset;
UINT16 LabelOffset;
UINT16 VendorOffset;
UINT16 VendorLength;
/*
* Optional fields follow immediately:
* 1) PIN list (Words)
* 2) Resource Label String
* 3) Vendor Data bytes
*/
} AML_RESOURCE_PIN_GROUP;
#define AML_RESOURCE_PIN_GROUP_REVISION 1 /* ACPI 6.2 */
typedef struct aml_resource_pin_group_function
{
AML_RESOURCE_LARGE_HEADER_COMMON
UINT8 RevisionId;
UINT16 Flags;
UINT16 FunctionNumber;
UINT8 ResSourceIndex;
UINT16 ResSourceOffset;
UINT16 ResSourceLabelOffset;
UINT16 VendorOffset;
UINT16 VendorLength;
/*
* Optional fields follow immediately:
* 1) Resource Source String
* 2) Resource Source Label String
* 3) Vendor Data bytes
*/
} AML_RESOURCE_PIN_GROUP_FUNCTION;
#define AML_RESOURCE_PIN_GROUP_FUNCTION_REVISION 1 /* ACPI 6.2 */
typedef struct aml_resource_pin_group_config
{
AML_RESOURCE_LARGE_HEADER_COMMON
UINT8 RevisionId;
UINT16 Flags;
UINT8 PinConfigType;
UINT32 PinConfigValue;
UINT8 ResSourceIndex;
UINT16 ResSourceOffset;
UINT16 ResSourceLabelOffset;
UINT16 VendorOffset;
UINT16 VendorLength;
/*
* Optional fields follow immediately:
* 1) Resource Source String
* 2) Resource Source Label String
* 3) Vendor Data bytes
*/
} AML_RESOURCE_PIN_GROUP_CONFIG;
#define AML_RESOURCE_PIN_GROUP_CONFIG_REVISION 1 /* ACPI 6.2 */
/* restore default alignment */
#pragma pack()
/* Union of all resource descriptors, so we can allocate the worst case */
typedef union aml_resource
{
/* Descriptor headers */
UINT8 DescriptorType;
AML_RESOURCE_SMALL_HEADER SmallHeader;
AML_RESOURCE_LARGE_HEADER LargeHeader;
/* Small resource descriptors */
AML_RESOURCE_IRQ Irq;
AML_RESOURCE_DMA Dma;
AML_RESOURCE_START_DEPENDENT StartDpf;
AML_RESOURCE_END_DEPENDENT EndDpf;
AML_RESOURCE_IO Io;
AML_RESOURCE_FIXED_IO FixedIo;
AML_RESOURCE_FIXED_DMA FixedDma;
AML_RESOURCE_VENDOR_SMALL VendorSmall;
AML_RESOURCE_END_TAG EndTag;
/* Large resource descriptors */
AML_RESOURCE_MEMORY24 Memory24;
AML_RESOURCE_GENERIC_REGISTER GenericReg;
AML_RESOURCE_VENDOR_LARGE VendorLarge;
AML_RESOURCE_MEMORY32 Memory32;
AML_RESOURCE_FIXED_MEMORY32 FixedMemory32;
AML_RESOURCE_ADDRESS16 Address16;
AML_RESOURCE_ADDRESS32 Address32;
AML_RESOURCE_ADDRESS64 Address64;
AML_RESOURCE_EXTENDED_ADDRESS64 ExtAddress64;
AML_RESOURCE_EXTENDED_IRQ ExtendedIrq;
AML_RESOURCE_GPIO Gpio;
AML_RESOURCE_I2C_SERIALBUS I2cSerialBus;
AML_RESOURCE_SPI_SERIALBUS SpiSerialBus;
AML_RESOURCE_UART_SERIALBUS UartSerialBus;
AML_RESOURCE_COMMON_SERIALBUS CommonSerialBus;
AML_RESOURCE_PIN_FUNCTION PinFunction;
AML_RESOURCE_PIN_CONFIG PinConfig;
AML_RESOURCE_PIN_GROUP PinGroup;
AML_RESOURCE_PIN_GROUP_FUNCTION PinGroupFunction;
AML_RESOURCE_PIN_GROUP_CONFIG PinGroupConfig;
/* Utility overlays */
AML_RESOURCE_ADDRESS Address;
UINT32 DwordItem;
UINT16 WordItem;
UINT8 ByteItem;
} AML_RESOURCE;
/* Interfaces used by both the disassembler and compiler */
void
MpSaveGpioInfo (
ACPI_PARSE_OBJECT *Op,
AML_RESOURCE *Resource,
UINT32 PinCount,
UINT16 *PinList,
char *DeviceName);
void
MpSaveSerialInfo (
ACPI_PARSE_OBJECT *Op,
AML_RESOURCE *Resource,
char *DeviceName);
char *
MpGetHidFromParseTree (
ACPI_NAMESPACE_NODE *HidNode);
char *
MpGetHidViaNamestring (
char *DeviceName);
char *
MpGetConnectionInfo (
ACPI_PARSE_OBJECT *Op,
UINT32 PinIndex,
ACPI_NAMESPACE_NODE **TargetNode,
char **TargetName);
char *
MpGetParentDeviceHid (
ACPI_PARSE_OBJECT *Op,
ACPI_NAMESPACE_NODE **TargetNode,
char **ParentDeviceName);
char *
MpGetDdnValue (
char *DeviceName);
char *
MpGetHidValue (
ACPI_NAMESPACE_NODE *DeviceNode);
#endif
-503
View File
@@ -1,503 +0,0 @@
/******************************************************************************
*
* Name: acenv.h - Host and compiler configuration
*
*****************************************************************************/
/******************************************************************************
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2019, 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.
*
*****************************************************************************
*
* Alternatively, you may choose to be licensed under the terms of the
* following license:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Alternatively, you may choose to be licensed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
*****************************************************************************/
#ifndef __ACENV_H__
#define __ACENV_H__
/*
* Environment configuration. The purpose of this file is to interface ACPICA
* to the local environment. This includes compiler-specific, OS-specific,
* and machine-specific configuration.
*/
/* Types for ACPI_MUTEX_TYPE */
#define ACPI_BINARY_SEMAPHORE 0
#define ACPI_OSL_MUTEX 1
/* Types for DEBUGGER_THREADING */
#define DEBUGGER_SINGLE_THREADED 0
#define DEBUGGER_MULTI_THREADED 1
/******************************************************************************
*
* Configuration for ACPI tools and utilities
*
*****************************************************************************/
/* Common application configuration. All single threaded except for AcpiExec. */
#if (defined ACPI_ASL_COMPILER) || \
(defined ACPI_BIN_APP) || \
(defined ACPI_DUMP_APP) || \
(defined ACPI_HELP_APP) || \
(defined ACPI_NAMES_APP) || \
(defined ACPI_SRC_APP) || \
(defined ACPI_XTRACT_APP) || \
(defined ACPI_EXAMPLE_APP) || \
(defined ACPI_EFI_HELLO)
#define ACPI_APPLICATION
#define ACPI_SINGLE_THREADED
#define USE_NATIVE_ALLOCATE_ZEROED
#endif
/* iASL configuration */
#ifdef ACPI_ASL_COMPILER
#define ACPI_DEBUG_OUTPUT
#define ACPI_CONSTANT_EVAL_ONLY
#define ACPI_LARGE_NAMESPACE_NODE
#define ACPI_DATA_TABLE_DISASSEMBLY
#define ACPI_32BIT_PHYSICAL_ADDRESS
#define ACPI_DISASSEMBLER 1
#endif
/* AcpiExec configuration. Multithreaded with full AML debugger */
#ifdef ACPI_EXEC_APP
#define ACPI_APPLICATION
#define ACPI_FULL_DEBUG
#define ACPI_MUTEX_DEBUG
#define ACPI_DBG_TRACK_ALLOCATIONS
#endif
/* AcpiHelp configuration. Error messages disabled. */
#ifdef ACPI_HELP_APP
#define ACPI_NO_ERROR_MESSAGES
#endif
/* AcpiNames configuration. Debug output enabled. */
#ifdef ACPI_NAMES_APP
#define ACPI_DEBUG_OUTPUT
#endif
/* AcpiExec/AcpiNames/Example configuration. Native RSDP used. */
#if (defined ACPI_EXEC_APP) || \
(defined ACPI_EXAMPLE_APP) || \
(defined ACPI_NAMES_APP)
#define ACPI_USE_NATIVE_RSDP_POINTER
#endif
/* AcpiDump configuration. Native mapping used if provided by the host */
#ifdef ACPI_DUMP_APP
#define ACPI_USE_NATIVE_MEMORY_MAPPING
#endif
/* AcpiNames/Example configuration. Hardware disabled */
#if (defined ACPI_EXAMPLE_APP) || \
(defined ACPI_NAMES_APP)
#define ACPI_REDUCED_HARDWARE 1
#endif
/* Linkable ACPICA library. Two versions, one with full debug. */
#ifdef ACPI_LIBRARY
#define ACPI_USE_LOCAL_CACHE
#define ACPI_DEBUGGER 1
#define ACPI_DISASSEMBLER 1
#ifdef _DEBUG
#define ACPI_DEBUG_OUTPUT
#endif
#endif
/* Common for all ACPICA applications */
#ifdef ACPI_APPLICATION
#define ACPI_USE_LOCAL_CACHE
#endif
/* Common debug/disassembler support */
#ifdef ACPI_FULL_DEBUG
#define ACPI_DEBUG_OUTPUT
#define ACPI_DEBUGGER 1
#define ACPI_DISASSEMBLER 1
#endif
/*! [Begin] no source code translation */
/******************************************************************************
*
* Host configuration files. The compiler configuration files are included
* first.
*
*****************************************************************************/
#include "acgcc.h"
#include "acygg.h"
//#if defined(__GNUC__) && !defined(__INTEL_COMPILER)
//
//#elif defined(_MSC_VER)
//#include "acmsvc.h"
//
//#elif defined(__INTEL_COMPILER)
//#include "acintel.h"
//
//#endif
//
//#if defined(_LINUX) || defined(__linux__)
//#include "aclinux.h"
//
//#elif defined(_APPLE) || defined(__APPLE__)
//#include "acmacosx.h"
//
//#elif defined(__DragonFly__)
//#include "acdragonfly.h"
//
//#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__)
//#include "acfreebsd.h"
//
//#elif defined(__NetBSD__)
//#include "acnetbsd.h"
//
//#elif defined(__sun)
//#include "acsolaris.h"
//
//#elif defined(MODESTO)
//#include "acmodesto.h"
//
//#elif defined(NETWARE)
//#include "acnetware.h"
//
//#elif defined(_CYGWIN)
//#include "accygwin.h"
//
//#elif defined(WIN32)
//#include "acwin.h"
//
//#elif defined(WIN64)
//#include "acwin64.h"
//
//#elif defined(_WRS_LIB_BUILD)
//#include "acvxworks.h"
//
//#elif defined(__OS2__)
//#include "acos2.h"
//
//#elif defined(__HAIKU__)
//#include "achaiku.h"
//
//#elif defined(__QNX__)
//#include "acqnx.h"
//
///*
// * EFI applications can be built with -nostdlib, in this case, it must be
// * included after including all other host environmental definitions, in
// * order to override the definitions.
// */
//#elif defined(_AED_EFI) || defined(_GNU_EFI) || defined(_EDK2_EFI)
//#include "acefi.h"
//
//#else
//
///* Unknown environment */
//
//#error Unknown target environment
//#endif
/*! [End] no source code translation !*/
/******************************************************************************
*
* Setup defaults for the required symbols that were not defined in one of
* the host/compiler files above.
*
*****************************************************************************/
/* 64-bit data types */
#ifndef COMPILER_DEPENDENT_INT64
#define COMPILER_DEPENDENT_INT64 long long
#endif
#ifndef COMPILER_DEPENDENT_UINT64
#define COMPILER_DEPENDENT_UINT64 unsigned long long
#endif
/* Type of mutex supported by host. Default is binary semaphores. */
#ifndef ACPI_MUTEX_TYPE
#define ACPI_MUTEX_TYPE ACPI_BINARY_SEMAPHORE
#endif
/* Global Lock acquire/release */
#ifndef ACPI_ACQUIRE_GLOBAL_LOCK
#define ACPI_ACQUIRE_GLOBAL_LOCK(GLptr, Acquired) Acquired = 1
#endif
#ifndef ACPI_RELEASE_GLOBAL_LOCK
#define ACPI_RELEASE_GLOBAL_LOCK(GLptr, Pending) Pending = 0
#endif
/* Flush CPU cache - used when going to sleep. Wbinvd or similar. */
#ifndef ACPI_FLUSH_CPU_CACHE
#define ACPI_FLUSH_CPU_CACHE()
#endif
/* "inline" keywords - configurable since inline is not standardized */
#ifndef ACPI_INLINE
#define ACPI_INLINE
#endif
/* Use ordered initialization if compiler doesn't support designated. */
#ifndef ACPI_STRUCT_INIT
#define ACPI_STRUCT_INIT(field, value) value
#endif
/*
* Configurable calling conventions:
*
* ACPI_SYSTEM_XFACE - Interfaces to host OS (handlers, threads)
* ACPI_EXTERNAL_XFACE - External ACPI interfaces
* ACPI_INTERNAL_XFACE - Internal ACPI interfaces
* ACPI_INTERNAL_VAR_XFACE - Internal variable-parameter list interfaces
*/
#ifndef ACPI_SYSTEM_XFACE
#define ACPI_SYSTEM_XFACE
#endif
#ifndef ACPI_EXTERNAL_XFACE
#define ACPI_EXTERNAL_XFACE
#endif
#ifndef ACPI_INTERNAL_XFACE
#define ACPI_INTERNAL_XFACE
#endif
#ifndef ACPI_INTERNAL_VAR_XFACE
#define ACPI_INTERNAL_VAR_XFACE
#endif
/*
* Debugger threading model
* Use single threaded if the entire subsystem is contained in an application
* Use multiple threaded when the subsystem is running in the kernel.
*
* By default the model is single threaded if ACPI_APPLICATION is set,
* multi-threaded if ACPI_APPLICATION is not set.
*/
#ifndef DEBUGGER_THREADING
#if !defined (ACPI_APPLICATION) || defined (ACPI_EXEC_APP)
#define DEBUGGER_THREADING DEBUGGER_MULTI_THREADED
#else
#define DEBUGGER_THREADING DEBUGGER_SINGLE_THREADED
#endif
#endif /* !DEBUGGER_THREADING */
/******************************************************************************
*
* C library configuration
*
*****************************************************************************/
/*
* ACPI_USE_SYSTEM_CLIBRARY - Define this if linking to an actual C library.
* Otherwise, local versions of string/memory functions will be used.
* ACPI_USE_STANDARD_HEADERS - Define this if linking to a C library and
* the standard header files may be used. Defining this implies that
* ACPI_USE_SYSTEM_CLIBRARY has been defined.
*
* 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.
*/
/* Use the standard C library headers. We want to keep these to a minimum. */
#ifdef ACPI_USE_STANDARD_HEADERS
/* Use the standard headers from the standard locations */
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#if defined (ACPI_APPLICATION) || defined(ACPI_LIBRARY)
#include <stdio.h>
#include <fcntl.h>
#include <errno.h>
#include <time.h>
#include <signal.h>
#endif
#endif /* ACPI_USE_STANDARD_HEADERS */
#ifdef ACPI_APPLICATION
#define ACPI_FILE FILE *
#define ACPI_FILE_OUT stdout
#define ACPI_FILE_ERR stderr
#else
#define ACPI_FILE void *
#define ACPI_FILE_OUT NULL
#define ACPI_FILE_ERR NULL
#endif /* ACPI_APPLICATION */
#ifndef ACPI_INIT_FUNCTION
#define ACPI_INIT_FUNCTION
#endif
#endif /* __ACENV_H__ */
-190
View File
@@ -1,190 +0,0 @@
/******************************************************************************
*
* Name: acenvex.h - Extra host and compiler configuration
*
*****************************************************************************/
/******************************************************************************
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2019, 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.
*
*****************************************************************************
*
* Alternatively, you may choose to be licensed under the terms of the
* following license:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Alternatively, you may choose to be licensed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
*****************************************************************************/
#ifndef __ACENVEX_H__
#define __ACENVEX_H__
/*! [Begin] no source code translation */
/******************************************************************************
*
* Extra host configuration files. All ACPICA headers are included before
* including these files.
*
*****************************************************************************/
//#if defined(_LINUX) || defined(__linux__)
//#include "aclinuxex.h"
//
//#elif defined(__DragonFly__)
//#include "acdragonflyex.h"
//
///*
// * EFI applications can be built with -nostdlib, in this case, it must be
// * included after including all other host environmental definitions, in
// * order to override the definitions.
// */
//#elif defined(_AED_EFI) || defined(_GNU_EFI) || defined(_EDK2_EFI)
//#include "acefiex.h"
//
//#endif
//
//#if defined(__GNUC__) && !defined(__INTEL_COMPILER)
//#include "acgccex.h"
//
//#elif defined(_MSC_VER)
//#include "acmsvcex.h"
//
//#endif
/*! [End] no source code translation !*/
#endif /* __ACENVEX_H__ */
-199
View File
@@ -1,199 +0,0 @@
/******************************************************************************
*
* Name: acgcc.h - GCC specific defines, etc.
*
*****************************************************************************/
/******************************************************************************
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2019, 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.
*
*****************************************************************************
*
* Alternatively, you may choose to be licensed under the terms of the
* following license:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Alternatively, you may choose to be licensed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
*****************************************************************************/
#ifndef __ACGCC_H__
#define __ACGCC_H__
/*
* Use compiler specific <stdarg.h> is a good practice for even when
* -nostdinc is specified (i.e., ACPI_USE_STANDARD_HEADERS undefined.
*/
#ifndef va_arg
#ifdef ACPI_USE_BUILTIN_STDARG
typedef __builtin_va_list va_list;
#define va_start(v, l) __builtin_va_start(v, l)
#define va_end(v) __builtin_va_end(v)
#define va_arg(v, l) __builtin_va_arg(v, l)
#define va_copy(d, s) __builtin_va_copy(d, s)
#else
#include <stdarg.h>
#endif
#endif
#define ACPI_INLINE __inline__
/* Function name is used for debug output. Non-ANSI, compiler-dependent */
#define ACPI_GET_FUNCTION_NAME __func__
/*
* This macro is used to tag functions as "printf-like" because
* some compilers (like GCC) can catch printf format string problems.
*/
#define ACPI_PRINTF_LIKE(c) __attribute__ ((__format__ (__printf__, c, c+1)))
/*
* Some compilers complain about unused variables. Sometimes we don't want to
* use all the variables (for example, _AcpiModuleName). This allows us
* to tell the compiler warning in a per-variable manner that a variable
* is unused.
*/
#define ACPI_UNUSED_VAR __attribute__ ((unused))
/* GCC supports __VA_ARGS__ in macros */
#define COMPILER_VA_MACRO 1
/* GCC supports native multiply/shift on 32-bit platforms */
#define ACPI_USE_NATIVE_MATH64
#endif /* __ACGCC_H__ */
-166
View File
@@ -1,166 +0,0 @@
/******************************************************************************
*
* Name: acgccex.h - Extra GCC specific defines, etc.
*
*****************************************************************************/
/******************************************************************************
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2019, 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.
*
*****************************************************************************
*
* Alternatively, you may choose to be licensed under the terms of the
* following license:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Alternatively, you may choose to be licensed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
*****************************************************************************/
#ifndef __ACGCCEX_H__
#define __ACGCCEX_H__
/*
* Some versions of gcc implement strchr() with a buggy macro. So,
* undef it here. Prevents error messages of this form (usually from the
* file getopt.c):
*
* error: logical '&&' with non-zero constant will always evaluate as true
*/
#ifdef strchr
#undef strchr
#endif
#endif /* __ACGCCEX_H__ */
-190
View File
@@ -1,190 +0,0 @@
/******************************************************************************
*
* Name: aclinux.h - OS specific defines, etc. for Linux
*
*****************************************************************************/
/******************************************************************************
*
* 1. Copyright Notice
*
* Some or all of this work - Copyright (c) 1999 - 2019, 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.
*
*****************************************************************************
*
* Alternatively, you may choose to be licensed under the terms of the
* following license:
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
* LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
* DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
* THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* Alternatively, you may choose to be licensed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
*****************************************************************************/
#ifndef __ACLINUX_H__
#define __ACLINUX_H__
#define ACPI_USE_SYSTEM_CLIBRARY
#define ACPI_USE_DO_WHILE_0
#define ACPI_USE_SYSTEM_INTTYPES
#undef ACPI_NO_MEM_ALLOCATIONS
#include "sys/string.h"
#include "sys/ctype.h"
#include "sys/types.h"
typedef uint64_t UINT64;
typedef uint32_t UINT32;
typedef uint16_t UINT16;
typedef uint8_t UINT8;
typedef int64_t INT64;
typedef int32_t INT32;
typedef int16_t INT16;
typedef int8_t INT8;
typedef int BOOLEAN;
#if defined (YGG_ACPI_DEBUGGING)
#undef ACPI_NO_ERROR_MESSAGES
#define ACPI_DEBUG_OUTPUT
#else
#define ACPI_NO_ERROR_MESSAGES
#undef ACPI_DEBUG_OUTPUT
#endif
#define ACPI_MACHINE_WIDTH 64
#define ACPI_CACHE_T ACPI_MEMORY_LIST
#define ACPI_USE_LOCAL_CACHE 1
#define ACPI_USE_NATIVE_MATH64
#define ACPI_USE_GPE_POLLING
#endif /* __ACLINUX_H__ */
-15
View File
@@ -1,15 +0,0 @@
#pragma once
#define LAPIC_REG_ID 0x20
#define LAPIC_REG_TPR 0x80
#define LAPIC_REG_EOI 0xB0
#define LAPIC_REG_SVR 0xF0
#define LAPIC_REG_CMD0 0x300
#define LAPIC_REG_CMD1 0x310
#define LAPIC_REG_LVTT 0x320
#define LAPIC_REG_TMRINITCNT 0x380
#define LAPIC_REG_TMRCURRCNT 0x390
#define LAPIC_REG_TMRDIV 0x3E0
-49
View File
@@ -1,49 +0,0 @@
#pragma once
#if defined(__ASM__)
.extern cpu
#if defined(AMD64_SMP)
#define get_cpu(off) \
%gs:off
#else
#define get_cpu(off) \
(__amd64_cpu + off)(%rip)
#endif
// To be used in interrupt handlers
// DIRECTLY AFTER ENTRY without prior stack modification
.macro swapgs_if_needed
cmpq $0x08, 0x08(%rsp)
je 1f
swapgs
1:
.endm
#define CPU_SELF 0x00
#define CPU_THREAD 0x08
#define CPU_TSS 0x10
#define CPU_SYSCALL_RSP 0x18
#define TSS_RSP0 0x04
#else
#include "sys/types.h"
struct cpu {
// TODO: somehow export offsets to asm
struct cpu *self; // 0x00
struct thread *thread; // 0x08
amd64_tss_t *tss; // 0x10
uint64_t syscall_rsp; // 0x18
uint64_t ticks;
uint64_t processor_id;
// No need to define offsets for these: ther're not accessed
// from assembly
uint64_t flags;
uint64_t apic_id;
};
#endif
-74
View File
@@ -1,74 +0,0 @@
#pragma once
#include "sys/amd64/asm/asm_apic.h"
#define AMD64_STACK_CTX_CANARY 0xBAD57AC6BAD57AC6
// TODO: use base + off instead of an absolute address
#if defined(__ASM__)
.extern local_apic
.extern irq_handle
.macro irq_entry, n
.global amd64_irq\n
amd64_irq\n:
cli
pushq %r11
pushq %r10
pushq %r9
pushq %r8
pushq %rcx
pushq %rdx
pushq %rsi
pushq %rdi
pushq %rax
irq_eoi_lapic 0
movq $\n, %rdi
call irq_handle
popq %rax
popq %rdi
popq %rsi
popq %rdx
popq %rcx
popq %r8
popq %r9
popq %r10
popq %r11
iretq
.endm
.macro irq_eoi_lapic, n
// n is actually ignored for APIC
movq local_apic(%rip), %rax
addq $LAPIC_REG_EOI, %rax
movl $0, (%rax)
.endm
#else
// Externs for C code
extern void amd64_irq0_early();
extern void amd64_irq0();
extern void amd64_irq1();
extern void amd64_irq2();
extern void amd64_irq3();
extern void amd64_irq4();
extern void amd64_irq5();
extern void amd64_irq6();
extern void amd64_irq7();
extern void amd64_irq8();
extern void amd64_irq9();
extern void amd64_irq10();
extern void amd64_irq11();
extern void amd64_irq12();
extern void amd64_irq13();
extern void amd64_irq14();
extern void amd64_irq15();
#if defined(AMD64_MAX_SMP)
extern void amd64_irq_ipi();
extern void amd64_irq_ipi_panic();
#endif
extern void amd64_irq_msi0();
#endif
-20
View File
@@ -1,20 +0,0 @@
#pragma once
#define THREAD_RSP0 0x00
#define THREAD_RSP0_TOP 0x08
#define THREAD_CR3 0x10
#define THREAD_RSP0_SIGENTER 0x18
#if !defined(__ASM__)
#include "sys/types.h"
struct thread_data {
uintptr_t rsp0; // 0x00
uintptr_t rsp0_top; // 0x08
uintptr_t cr3; // 0x10
uintptr_t rsp0_sigenter; // 0x18
uintptr_t rsp0_base, rsp0_size;
uintptr_t rsp3_base, rsp3_size;
};
#endif
-16
View File
@@ -1,16 +0,0 @@
#pragma once
#include "sys/types.h"
struct thread;
// Enter a newly-created task
extern void context_enter(struct thread *thr);
// Enter a task from exec
extern void context_exec_enter(void *arg, struct thread *thr, uintptr_t stack3, uintptr_t entry);
// Stores current task context, loads new one's
extern void context_switch_to(struct thread *thr, struct thread *from);
// No current task, only load the first task to begin execution
extern void context_switch_first(struct thread *thr);
extern void context_sigenter(uintptr_t entry, uintptr_t stack, int signum);
extern void context_sigreturn(void);
-43
View File
@@ -1,43 +0,0 @@
#pragma once
#include "sys/amd64/asm/asm_irq.h"
#include "sys/amd64/hw/gdt.h"
#include "sys/types.h"
#define FXSAVE_REGION 512
#include "sys/amd64/asm/asm_cpu.h"
#define thread_self get_cpu()->thread
#if defined(AMD64_SMP)
extern struct cpu cpus[AMD64_MAX_SMP];
static inline struct cpu *get_cpu(void) {
struct cpu *cpu;
asm volatile ("movq %%gs:0, %0":"=r"(cpu));
return cpu;
}
#else
extern struct cpu __amd64_cpu;
#define get_cpu() ((struct cpu *) &__amd64_cpu)
#endif
#define MSR_IA32_APIC_BASE 0x1B
#define IA32_APIC_BASE_BSP 0x100
#define IA32_APIC_BASE_ENABLE 0x800
#define MSR_IA32_EFER 0xC0000080
#define IA32_EFER_NXE (1 << 11)
#define MSR_IA32_KERNEL_GS_BASE 0xC0000102
static inline uint64_t rdmsr(uint32_t addr) {
uint64_t v;
asm volatile ("rdmsr":"=A"(v):"c"(addr));
return v;
}
static inline void wrmsr(uint32_t addr, uint64_t v) {
uint32_t low = (v & 0xFFFFFFFF), high = v >> 32;
asm volatile ("wrmsr"::"c"(addr),"a"(low),"d"(high));
}
-20
View File
@@ -1,20 +0,0 @@
#pragma once
#include "sys/types.h"
#define CPUID_REQ_VENDOR 0x00
#define CPUID_REQ_FEATURES 0x01
#define CPUID_REQ_CACHE 0x02
#define CPUID_REQ_SERIAL 0x03
#define CPUID_REQ_EXT_FEATURES 0x80000001
#define CPUID_EXT_EDX_FEATURE_NX (1U << 20)
#define CPUID_EXT_EDX_FEATURE_SYSCALL (1U << 11)
extern uint32_t cpuid_features_ecx, cpuid_features_edx;
extern uint32_t cpuid_ext_features_ecx, cpuid_ext_features_edx;
static inline void cpuid(uint32_t eax, uint32_t *out) {
asm volatile ("cpuid":"=a"(out[0]),"=c"(out[1]),"=d"(out[2]),"=b"(out[3]):"a"(eax));
}
void cpuid_init(void);
-3
View File
@@ -1,3 +0,0 @@
#pragma once
void amd64_fpu_init(void);
-106
View File
@@ -1,106 +0,0 @@
#pragma once
#include "sys/types.h"
struct acpi_rsdp {
char signature[8];
uint8_t checksum;
char oemid[6];
uint8_t rev;
uint32_t rsdt_address;
} __attribute__((packed));
struct acpi_rsdp_ext {
struct acpi_rsdp rsdp;
uint32_t length;
uint64_t xsdt_address;
uint8_t ext_checksum;
uint8_t reserved[3];
} __attribute__((packed));
struct acpi_header {
char signature[4];
uint32_t length;
uint8_t rev;
uint8_t checksum;
char oemid[6];
char oem_table_id[8];
uint32_t oem_rev;
char asl_id[4];
uint32_t asl_rev;
} __attribute__((packed));
struct acpi_rsdt {
struct acpi_header hdr;
uint32_t entry[];
} __attribute__((packed));
struct acpi_madt {
struct acpi_header hdr;
uint32_t local_apic_addr;
uint32_t flags;
char entry[];
} __attribute__((packed));
struct acpi_mcfg {
struct acpi_header hdr;
uint64_t __res0;
struct acpi_mcfg_entry {
uint64_t base_address;
uint16_t pci_segment_group;
uint8_t start_pci_bus;
uint8_t end_pci_bus;
uint32_t reserved;
} __attribute__((packed)) entry[];
} __attribute__((packed));
struct acpi_fadt {
struct acpi_header hdr;
uint32_t firmware_ctrl;
uint32_t dsdt;
uint8_t __res0;
uint8_t preferred_pm_profile;
uint16_t sci_int;
uint32_t sci_cmd_port;
uint8_t acpi_enable;
uint8_t acpi_disable;
uint8_t s4bios_req;
uint8_t pstate_control;
uint32_t pm1a_event_block;
uint32_t pm1b_event_block;
uint32_t pm1a_control_block;
uint32_t pm1b_control_block;
uint32_t pm2_control_block;
uint32_t pm_timer_block;
uint32_t gpe0_block;
uint32_t gpe1_block;
uint8_t pm1_event_length;
uint8_t pm1_control_length;
uint8_t pm2_control_length;
uint8_t pm_timer_length;
uint8_t gpe0_length;
uint8_t gpe1_length;
uint8_t gpe1_base;
uint8_t cstate_control;
uint16_t worst_c2_latency;
uint16_t worst_c3_latency;
uint16_t flush_size;
uint16_t flush_stride;
uint8_t duty_offset;
uint8_t duty_width;
uint8_t day_alarm;
uint8_t month_alarm;
uint8_t century;
//...
} __attribute__((packed));
extern struct acpi_madt *acpi_madt;
extern struct acpi_mcfg *acpi_mcfg;
void amd64_acpi_init(void);
-11
View File
@@ -1,11 +0,0 @@
#pragma once
#include "sys/amd64/hw/acpi.h"
#include "sys/amd64/asm/asm_apic.h"
#define LAPIC(reg) \
(*(uint32_t *) ((reg) + local_apic))
extern uintptr_t local_apic;
void amd64_apic_set_madt(struct acpi_madt *madt);
void amd64_apic_init(void);
-13
View File
@@ -1,13 +0,0 @@
#pragma once
struct winsize;
void amd64_con_get_size(struct winsize *ws);
// For tty
int pc_con_putc(void *dev, char c);
void con_blink(void);
void amd64_con_putc(int c);
void amd64_con_init(void);
void amd64_con_sync_cursor(void);
-40
View File
@@ -1,40 +0,0 @@
#pragma once
#include <stdint.h>
#include <stddef.h>
typedef struct {
uint16_t limit_lo;
uint16_t base_lo;
uint8_t base_mi;
uint8_t access;
uint8_t flags;
uint8_t base_hi;
} amd64_gdt_entry_t;
typedef struct {
uint32_t __res0;
uint64_t rsp0;
uint64_t rsp1;
uint64_t rsp2;
uint64_t __res1;
uint64_t ist1;
uint64_t ist2;
uint64_t ist3;
uint64_t ist4;
uint64_t ist5;
uint64_t ist6;
uint64_t ist7;
uint64_t __res2;
uint16_t __res3;
uint16_t iopb_base;
}__attribute__((packed)) amd64_tss_t;
typedef struct {
uint16_t size;
uintptr_t offset;
} __attribute__((packed)) amd64_gdt_ptr_t;
amd64_gdt_ptr_t *amd64_gdtr_get(int cpu);
amd64_tss_t *amd64_tss_get(int cpu);
void amd64_gdt_init(void);
-25
View File
@@ -1,25 +0,0 @@
#pragma once
#include "sys/types.h"
#define IDT_FLG_TASK32 0x5
#define IDT_FLG_INT16 0x6
#define IDT_FLG_TRAP16 0x7
#define IDT_FLG_INT32 0xE
#define IDT_FLG_TRAP32 0xF
#define IDT_FLG_SS (1 << 4)
#define IDT_FLG_R0 (0 << 5)
#define IDT_FLG_R1 (1 << 5)
#define IDT_FLG_R2 (2 << 5)
#define IDT_FLG_R3 (3 << 5)
#define IDT_FLG_P (1 << 7)
struct amd64_idtr {
uint16_t size;
uintptr_t offset;
} __attribute__((packed));
extern struct amd64_idtr amd64_idtr[AMD64_MAX_SMP];
void amd64_idt_set(int cpu, int idx, uintptr_t base, uint16_t selector, uint8_t flags);
void amd64_idt_init(int cpu);
-38
View File
@@ -1,38 +0,0 @@
#pragma once
#include <stdint.h>
static inline void outb(uint16_t addr, uint8_t v) {
asm volatile("outb %0, %1"::"a"(v), "Nd"(addr));
}
static inline uint8_t inb(uint16_t addr) {
uint8_t v;
asm volatile("inb %1, %0":"=a"(v):"Nd"(addr));
return v;
}
static inline void outw(uint16_t addr, uint16_t v) {
asm volatile("outw %0, %1"::"a"(v), "Nd"(addr));
}
static inline void outl(uint16_t addr, uint32_t v) {
asm volatile("outl %0, %1"::"a"(v), "Nd"(addr));
}
static inline uint32_t inl(uint16_t addr) {
uint32_t v;
asm volatile("inl %1, %0":"=a"(v):"Nd"(addr));
return v;
}
static inline uint16_t inw(uint16_t addr) {
uint16_t v;
asm volatile("inw %1, %0":"=a"(v):"Nd"(addr));
return v;
}
static inline void io_wait(void) {
asm volatile("jmp 1f\n\t"
"1:jmp 2f\n\t"
"2:" );
}
-53
View File
@@ -1,53 +0,0 @@
#pragma once
// TODO: lots of stuff can be moved to some kind of generic
// irq.h header to provide controller-agnostic interface
#include "sys/types.h"
#define IOAPIC_REG_ID 0x00
#define IOAPIC_REG_VER 0x01
#define IOAPIC_REG_REDIR 0x10
#define IOAPIC_REDIR_DEL_NOPRI (0x0 << 8)
#define IOAPIC_REDIR_DEL_LOPRI (0x1 << 8)
#define IOAPIC_REDIR_DEL_SMI (0x2 << 8)
#define IOAPIC_REDIR_DEL_NMI (0x4 << 8)
#define IOAPIC_REDIR_DEL_INIT (0x5 << 8)
#define IOAPIC_REDIR_DEL_EXTI (0x7 << 8)
#define IOAPIC_REDIR_DST_LOG (1 << 11)
#define IOAPIC_REDIR_POL_LOW (1 << 13)
#define IOAPIC_REDIR_TRG_LEVEL (1 << 15)
#define IOAPIC_REDIR_MSK (1 << 16)
#define IOAPIC_REDIR_DST_SET(x) (((x) & 0xFF) << 24)
#define IOAPIC_REDIR_DST_GET(x) (((uint32_t) x) >> 24)
// Base address of the two-register structure
// 0 means "Not available"
// [Virtual]
extern uintptr_t amd64_ioapic_base;
uint32_t amd64_ioapic_read(uint8_t reg);
void amd64_ioapic_write(uint8_t reg, uint32_t v);
// Set from reading the MADT
void amd64_ioapic_set(uintptr_t addr);
void amd64_ioapic_int_src_override(uint8_t bus, uint8_t src, uint32_t no, uint16_t flags);
void amd64_ioapic_map_gsi(uint8_t gsi, uint8_t lapic, uint8_t vector);
void amd64_ioapic_unmask(uint8_t gsi);
void amd64_ioapic_mask(uint8_t gsi);
uint8_t amd64_ioapic_leg_gsi(uint8_t leg_irq);
//// Generic IRQ stuff
// A route exists (LNKx) but is not mapped to any IRQ at the moment
#define PCI_IRQ_NO_ROUTE 0xFFFFFFFF
// No route even exists
#define PCI_IRQ_INVALID 0xFFFFFFFE
int amd64_pci_init_irqs(void);
uint32_t amd64_pci_pin_irq_route(uint8_t bus, uint8_t dev, uint8_t func, uint8_t pin);
-26
View File
@@ -1,26 +0,0 @@
#pragma once
#include "sys/types.h"
#define IRQ_LEG_KEYBOARD 1
#define IRQ_LEG_COM1_3 4
#define IRQ_LEG_MOUSE 12
#define IRQ_HANDLED ((uint32_t) 0)
#define IRQ_UNHANDLED ((uint32_t) -1)
typedef uint32_t (*irq_handler_func_t) (void *);
struct irq_handler {
irq_handler_func_t func;
void *ctx;
};
int irq_add_handler(uint8_t gsi, irq_handler_func_t handler, void *ctx);
int irq_add_leg_handler(uint8_t leg_irq, irq_handler_func_t handler, void *ctx);
int irq_add_msi_handler(irq_handler_func_t handler, void *ctx, uint8_t *vector);
//int irq_add_pci_handler(pci_addr_t addr, uint8_t pin, irq_handler_func_t handler, void *ctx);
int irq_has_handler(uint8_t gsi);
void irq_enable_ioapic_mode(void);
void irq_init(int cpu);
-5
View File
@@ -1,5 +0,0 @@
#pragma once
struct chrdev;
void ps2_init(void);
void ps2_register_device(void);
-12
View File
@@ -1,12 +0,0 @@
#pragma once
#include <stdint.h>
#define RS232_COM1 0x3F8
struct chrdev;
int rs232_putc(void *dev, char c);
void rs232_set_tty(uint16_t com, struct chrdev *tty);
void rs232_init(uint16_t port);
void rs232_send(uint16_t port, char c);
char rs232_recv(uint16_t port);
-6
View File
@@ -1,6 +0,0 @@
#pragma once
#include "sys/types.h"
void rtc_read(struct tm *time);
void rtc_set_century(uint8_t c);
void rtc_init(void);
-8
View File
@@ -1,8 +0,0 @@
#pragma once
#include "sys/types.h"
struct thread;
void timer_add_sleep(struct thread *thr);
void timer_remove_sleep(struct thread *thr);
void amd64_timer_init(void);
-11
View File
@@ -1,11 +0,0 @@
#pragma once
#include "sys/amd64/loader/multiboot.h"
#include "sys/types.h"
extern int vesa_available, vesa_hold;
extern uint32_t vesa_width, vesa_height, vesa_pitch, vesa_bpp;
extern uint64_t vesa_addr;
void amd64_vesa_init(multiboot_info_t *info);
void vesa_put(uint32_t x, uint32_t y, uint32_t v);
void vesa_clear(uint32_t color);
-17
View File
@@ -1,17 +0,0 @@
#pragma once
#include <stdint.h>
#define KERNEL_CMDLINE_MAX 256
struct amd64_loader_data {
uint32_t multiboot_info_ptr;
uint32_t symtab_ptr;
uint32_t symtab_size;
uint32_t strtab_ptr;
uint32_t strtab_size;
uint32_t initrd_ptr;
uint32_t initrd_len;
char cmdline[KERNEL_CMDLINE_MAX];
// Just in case
uint8_t checksum;
} __attribute__((packed));
-443
View File
@@ -1,443 +0,0 @@
/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
#ifndef _UAPI_LINUX_ELF_H
#define _UAPI_LINUX_ELF_H
#include <stdint.h>
/* 32-bit ELF base types. */
typedef uint32_t Elf32_Addr;
typedef uint16_t Elf32_Half;
typedef uint32_t Elf32_Off;
typedef uint32_t Elf32_Sword;
typedef uint32_t Elf32_Word;
/* 64-bit ELF base types. */
typedef uint64_t Elf64_Addr;
typedef uint16_t Elf64_Half;
typedef uint16_t Elf64_SHalf;
typedef uint64_t Elf64_Off;
typedef uint32_t Elf64_Sword;
typedef uint32_t Elf64_Word;
typedef uint64_t Elf64_Xword;
typedef uint64_t Elf64_Sxword;
/* These constants are for the segment types stored in the image headers */
#define PT_NULL 0
#define PT_LOAD 1
#define PT_DYNAMIC 2
#define PT_INTERP 3
#define PT_NOTE 4
#define PT_SHLIB 5
#define PT_PHDR 6
#define PT_TLS 7 /* Thread local storage segment */
#define PT_LOOS 0x60000000 /* OS-specific */
#define PT_HIOS 0x6fffffff /* OS-specific */
#define PT_LOPROC 0x70000000
#define PT_HIPROC 0x7fffffff
#define PT_GNU_EH_FRAME 0x6474e550
#define PT_GNU_STACK (PT_LOOS + 0x474e551)
/*
* Extended Numbering
*
* If the real number of program header table entries is larger than
* or equal to PN_XNUM(0xffff), it is set to sh_info field of the
* section header at index 0, and PN_XNUM is set to e_phnum
* field. Otherwise, the section header at index 0 is zero
* initialized, if it exists.
*
* Specifications are available in:
*
* - Oracle: Linker and Libraries.
* Part No: 817198419, August 2011.
* http://docs.oracle.com/cd/E18752_01/pdf/817-1984.pdf
*
* - System V ABI AMD64 Architecture Processor Supplement
* Draft Version 0.99.4,
* January 13, 2010.
* http://www.cs.washington.edu/education/courses/cse351/12wi/supp-docs/abi.pdf
*/
#define PN_XNUM 0xffff
/* These constants define the different elf file types */
#define ET_NONE 0
#define ET_REL 1
#define ET_EXEC 2
#define ET_DYN 3
#define ET_CORE 4
#define ET_LOPROC 0xff00
#define ET_HIPROC 0xffff
/* This is the info that is needed to parse the dynamic section of the file */
#define DT_NULL 0
#define DT_NEEDED 1
#define DT_PLTRELSZ 2
#define DT_PLTGOT 3
#define DT_HASH 4
#define DT_STRTAB 5
#define DT_SYMTAB 6
#define DT_RELA 7
#define DT_RELASZ 8
#define DT_RELAENT 9
#define DT_STRSZ 10
#define DT_SYMENT 11
#define DT_INIT 12
#define DT_FINI 13
#define DT_SONAME 14
#define DT_RPATH 15
#define DT_SYMBOLIC 16
#define DT_REL 17
#define DT_RELSZ 18
#define DT_RELENT 19
#define DT_PLTREL 20
#define DT_DEBUG 21
#define DT_TEXTREL 22
#define DT_JMPREL 23
#define DT_ENCODING 32
#define OLD_DT_LOOS 0x60000000
#define DT_LOOS 0x6000000d
#define DT_HIOS 0x6ffff000
#define DT_VALRNGLO 0x6ffffd00
#define DT_VALRNGHI 0x6ffffdff
#define DT_ADDRRNGLO 0x6ffffe00
#define DT_ADDRRNGHI 0x6ffffeff
#define DT_VERSYM 0x6ffffff0
#define DT_RELACOUNT 0x6ffffff9
#define DT_RELCOUNT 0x6ffffffa
#define DT_FLAGS_1 0x6ffffffb
#define DT_VERDEF 0x6ffffffc
#define DT_VERDEFNUM 0x6ffffffd
#define DT_VERNEED 0x6ffffffe
#define DT_VERNEEDNUM 0x6fffffff
#define OLD_DT_HIOS 0x6fffffff
#define DT_LOPROC 0x70000000
#define DT_HIPROC 0x7fffffff
/* This info is needed when parsing the symbol table */
#define STB_LOCAL 0
#define STB_GLOBAL 1
#define STB_WEAK 2
#define STT_NOTYPE 0
#define STT_OBJECT 1
#define STT_FUNC 2
#define STT_SECTION 3
#define STT_FILE 4
#define STT_COMMON 5
#define STT_TLS 6
#define ELF_ST_BIND(x) ((x) >> 4)
#define ELF_ST_TYPE(x) (((unsigned int) x) & 0xf)
#define ELF32_ST_BIND(x) ELF_ST_BIND(x)
#define ELF32_ST_TYPE(x) ELF_ST_TYPE(x)
#define ELF64_ST_BIND(x) ELF_ST_BIND(x)
#define ELF64_ST_TYPE(x) ELF_ST_TYPE(x)
typedef struct dynamic{
Elf32_Sword d_tag;
union{
Elf32_Sword d_val;
Elf32_Addr d_ptr;
} d_un;
} Elf32_Dyn;
typedef struct {
Elf64_Sxword d_tag; /* entry tag value */
union {
Elf64_Xword d_val;
Elf64_Addr d_ptr;
} d_un;
} Elf64_Dyn;
/* The following are used with relocations */
#define ELF32_R_SYM(x) ((x) >> 8)
#define ELF32_R_TYPE(x) ((x) & 0xff)
#define ELF64_R_SYM(i) ((i) >> 32)
#define ELF64_R_TYPE(i) ((i) & 0xffffffff)
typedef struct elf32_rel {
Elf32_Addr r_offset;
Elf32_Word r_info;
} Elf32_Rel;
typedef struct elf64_rel {
Elf64_Addr r_offset; /* Location at which to apply the action */
Elf64_Xword r_info; /* index and type of relocation */
} Elf64_Rel;
typedef struct elf32_rela{
Elf32_Addr r_offset;
Elf32_Word r_info;
Elf32_Sword r_addend;
} Elf32_Rela;
typedef struct elf64_rela {
Elf64_Addr r_offset; /* Location at which to apply the action */
Elf64_Xword r_info; /* index and type of relocation */
Elf64_Sxword r_addend; /* Constant addend used to compute value */
} Elf64_Rela;
typedef struct elf32_sym{
Elf32_Word st_name;
Elf32_Addr st_value;
Elf32_Word st_size;
unsigned char st_info;
unsigned char st_other;
Elf32_Half st_shndx;
} Elf32_Sym;
typedef struct elf64_sym {
Elf64_Word st_name; /* Symbol name, index in string tbl */
unsigned char st_info; /* Type and binding attributes */
unsigned char st_other; /* No defined meaning, 0 */
Elf64_Half st_shndx; /* Associated section index */
Elf64_Addr st_value; /* Value of the symbol */
Elf64_Xword st_size; /* Associated symbol size */
} Elf64_Sym;
#define EI_NIDENT 16
typedef struct elf32_hdr{
unsigned char e_ident[EI_NIDENT];
Elf32_Half e_type;
Elf32_Half e_machine;
Elf32_Word e_version;
Elf32_Addr e_entry; /* Entry point */
Elf32_Off e_phoff;
Elf32_Off e_shoff;
Elf32_Word e_flags;
Elf32_Half e_ehsize;
Elf32_Half e_phentsize;
Elf32_Half e_phnum;
Elf32_Half e_shentsize;
Elf32_Half e_shnum;
Elf32_Half e_shstrndx;
} Elf32_Ehdr;
typedef struct elf64_hdr {
unsigned char e_ident[EI_NIDENT]; /* ELF "magic number" */
Elf64_Half e_type;
Elf64_Half e_machine;
Elf64_Word e_version;
Elf64_Addr e_entry; /* Entry point virtual address */
Elf64_Off e_phoff; /* Program header table file offset */
Elf64_Off e_shoff; /* Section header table file offset */
Elf64_Word e_flags;
Elf64_Half e_ehsize;
Elf64_Half e_phentsize;
Elf64_Half e_phnum;
Elf64_Half e_shentsize;
Elf64_Half e_shnum;
Elf64_Half e_shstrndx;
} Elf64_Ehdr;
/* These constants define the permissions on sections in the program
header, p_flags. */
#define PF_R 0x4
#define PF_W 0x2
#define PF_X 0x1
typedef struct elf32_phdr{
Elf32_Word p_type;
Elf32_Off p_offset;
Elf32_Addr p_vaddr;
Elf32_Addr p_paddr;
Elf32_Word p_filesz;
Elf32_Word p_memsz;
Elf32_Word p_flags;
Elf32_Word p_align;
} Elf32_Phdr;
typedef struct elf64_phdr {
Elf64_Word p_type;
Elf64_Word p_flags;
Elf64_Off p_offset; /* Segment file offset */
Elf64_Addr p_vaddr; /* Segment virtual address */
Elf64_Addr p_paddr; /* Segment physical address */
Elf64_Xword p_filesz; /* Segment size in file */
Elf64_Xword p_memsz; /* Segment size in memory */
Elf64_Xword p_align; /* Segment alignment, file & memory */
} Elf64_Phdr;
/* sh_type */
#define SHT_NULL 0
#define SHT_PROGBITS 1
#define SHT_SYMTAB 2
#define SHT_STRTAB 3
#define SHT_RELA 4
#define SHT_HASH 5
#define SHT_DYNAMIC 6
#define SHT_NOTE 7
#define SHT_NOBITS 8
#define SHT_REL 9
#define SHT_SHLIB 10
#define SHT_DYNSYM 11
#define SHT_NUM 12
#define SHT_LOPROC 0x70000000
#define SHT_HIPROC 0x7fffffff
#define SHT_LOUSER 0x80000000
#define SHT_HIUSER 0xffffffff
/* sh_flags */
#define SHF_WRITE 0x1
#define SHF_ALLOC 0x2
#define SHF_EXECINSTR 0x4
#define SHF_RELA_LIVEPATCH 0x00100000
#define SHF_RO_AFTER_INIT 0x00200000
#define SHF_MASKPROC 0xf0000000
/* special section indexes */
#define SHN_UNDEF 0
#define SHN_LORESERVE 0xff00
#define SHN_LOPROC 0xff00
#define SHN_HIPROC 0xff1f
#define SHN_LIVEPATCH 0xff20
#define SHN_ABS 0xfff1
#define SHN_COMMON 0xfff2
#define SHN_HIRESERVE 0xffff
typedef struct elf32_shdr {
Elf32_Word sh_name;
Elf32_Word sh_type;
Elf32_Word sh_flags;
Elf32_Addr sh_addr;
Elf32_Off sh_offset;
Elf32_Word sh_size;
Elf32_Word sh_link;
Elf32_Word sh_info;
Elf32_Word sh_addralign;
Elf32_Word sh_entsize;
} Elf32_Shdr;
typedef struct elf64_shdr {
Elf64_Word sh_name; /* Section name, index in string tbl */
Elf64_Word sh_type; /* Type of section */
Elf64_Xword sh_flags; /* Miscellaneous section attributes */
Elf64_Addr sh_addr; /* Section virtual addr at execution */
Elf64_Off sh_offset; /* Section file offset */
Elf64_Xword sh_size; /* Size of section in bytes */
Elf64_Word sh_link; /* Index of another section */
Elf64_Word sh_info; /* Additional section information */
Elf64_Xword sh_addralign; /* Section alignment */
Elf64_Xword sh_entsize; /* Entry size if section holds table */
} Elf64_Shdr;
#define EI_MAG0 0 /* e_ident[] indexes */
#define EI_MAG1 1
#define EI_MAG2 2
#define EI_MAG3 3
#define EI_CLASS 4
#define EI_DATA 5
#define EI_VERSION 6
#define EI_OSABI 7
#define EI_PAD 8
#define ELFMAG0 0x7f /* EI_MAG */
#define ELFMAG1 'E'
#define ELFMAG2 'L'
#define ELFMAG3 'F'
#define ELFMAG "\177ELF"
#define SELFMAG 4
#define ELFCLASSNONE 0 /* EI_CLASS */
#define ELFCLASS32 1
#define ELFCLASS64 2
#define ELFCLASSNUM 3
#define ELFDATANONE 0 /* e_ident[EI_DATA] */
#define ELFDATA2LSB 1
#define ELFDATA2MSB 2
#define EV_NONE 0 /* e_version, EI_VERSION */
#define EV_CURRENT 1
#define EV_NUM 2
#define ELFOSABI_NONE 0
#define ELFOSABI_LINUX 3
#ifndef ELF_OSABI
#define ELF_OSABI ELFOSABI_NONE
#endif
/*
* Notes used in ET_CORE. Architectures export some of the arch register sets
* using the corresponding note types via the PTRACE_GETREGSET and
* PTRACE_SETREGSET requests.
*/
#define NT_PRSTATUS 1
#define NT_PRFPREG 2
#define NT_PRPSINFO 3
#define NT_TASKSTRUCT 4
#define NT_AUXV 6
/*
* Note to userspace developers: size of NT_SIGINFO note may increase
* in the future to accomodate more fields, don't assume it is fixed!
*/
#define NT_SIGINFO 0x53494749
#define NT_FILE 0x46494c45
#define NT_PRXFPREG 0x46e62b7f /* copied from gdb5.1/include/elf/common.h */
#define NT_PPC_VMX 0x100 /* PowerPC Altivec/VMX registers */
#define NT_PPC_SPE 0x101 /* PowerPC SPE/EVR registers */
#define NT_PPC_VSX 0x102 /* PowerPC VSX registers */
#define NT_PPC_TAR 0x103 /* Target Address Register */
#define NT_PPC_PPR 0x104 /* Program Priority Register */
#define NT_PPC_DSCR 0x105 /* Data Stream Control Register */
#define NT_PPC_EBB 0x106 /* Event Based Branch Registers */
#define NT_PPC_PMU 0x107 /* Performance Monitor Registers */
#define NT_PPC_TM_CGPR 0x108 /* TM checkpointed GPR Registers */
#define NT_PPC_TM_CFPR 0x109 /* TM checkpointed FPR Registers */
#define NT_PPC_TM_CVMX 0x10a /* TM checkpointed VMX Registers */
#define NT_PPC_TM_CVSX 0x10b /* TM checkpointed VSX Registers */
#define NT_PPC_TM_SPR 0x10c /* TM Special Purpose Registers */
#define NT_PPC_TM_CTAR 0x10d /* TM checkpointed Target Address Register */
#define NT_PPC_TM_CPPR 0x10e /* TM checkpointed Program Priority Register */
#define NT_PPC_TM_CDSCR 0x10f /* TM checkpointed Data Stream Control Register */
#define NT_PPC_PKEY 0x110 /* Memory Protection Keys registers */
#define NT_386_TLS 0x200 /* i386 TLS slots (struct user_desc) */
#define NT_386_IOPERM 0x201 /* x86 io permission bitmap (1=deny) */
#define NT_X86_XSTATE 0x202 /* x86 extended state using xsave */
#define NT_S390_HIGH_GPRS 0x300 /* s390 upper register halves */
#define NT_S390_TIMER 0x301 /* s390 timer register */
#define NT_S390_TODCMP 0x302 /* s390 TOD clock comparator register */
#define NT_S390_TODPREG 0x303 /* s390 TOD programmable register */
#define NT_S390_CTRS 0x304 /* s390 control registers */
#define NT_S390_PREFIX 0x305 /* s390 prefix register */
#define NT_S390_LAST_BREAK 0x306 /* s390 breaking event address */
#define NT_S390_SYSTEM_CALL 0x307 /* s390 system call restart data */
#define NT_S390_TDB 0x308 /* s390 transaction diagnostic block */
#define NT_S390_VXRS_LOW 0x309 /* s390 vector registers 0-15 upper half */
#define NT_S390_VXRS_HIGH 0x30a /* s390 vector registers 16-31 */
#define NT_S390_GS_CB 0x30b /* s390 guarded storage registers */
#define NT_S390_GS_BC 0x30c /* s390 guarded storage broadcast control block */
#define NT_S390_RI_CB 0x30d /* s390 runtime instrumentation */
#define NT_ARM_VFP 0x400 /* ARM VFP/NEON registers */
#define NT_ARM_TLS 0x401 /* ARM TLS register */
#define NT_ARM_HW_BREAK 0x402 /* ARM hardware breakpoint registers */
#define NT_ARM_HW_WATCH 0x403 /* ARM hardware watchpoint registers */
#define NT_ARM_SYSTEM_CALL 0x404 /* ARM system call number */
#define NT_ARM_SVE 0x405 /* ARM Scalable Vector Extension registers */
#define NT_ARM_PAC_MASK 0x406 /* ARM pointer authentication code masks */
#define NT_ARC_V2 0x600 /* ARCv2 accumulator/extra registers */
#define NT_VMCOREDD 0x700 /* Vmcore Device Dump Note */
#define NT_MIPS_DSP 0x800 /* MIPS DSP ASE registers */
#define NT_MIPS_FP_MODE 0x801 /* MIPS floating-point mode */
#define NT_MIPS_MSA 0x802 /* MIPS SIMD registers */
/* Note header in a PT_NOTE section */
typedef struct elf32_note {
Elf32_Word n_namesz; /* Name size */
Elf32_Word n_descsz; /* Content size */
Elf32_Word n_type; /* Content type */
} Elf32_Nhdr;
/* Note header in a PT_NOTE section */
typedef struct elf64_note {
Elf64_Word n_namesz; /* Name size */
Elf64_Word n_descsz; /* Content size */
Elf64_Word n_type; /* Content type */
} Elf64_Nhdr;
#endif /* _UAPI_LINUX_ELF_H */
-274
View File
@@ -1,274 +0,0 @@
/* multiboot.h - Multiboot header file. */
/* Copyright (C) 1999,2003,2007,2008,2009,2010 Free Software Foundation, Inc.
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to
* deal in the Software without restriction, including without limitation the
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
* sell copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included in
* all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL ANY
* DEVELOPER OR DISTRIBUTOR BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
* WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
* IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#ifndef MULTIBOOT_HEADER
#define MULTIBOOT_HEADER 1
/* How many bytes from the start of the file we search for the header. */
#define MULTIBOOT_SEARCH 8192
#define MULTIBOOT_HEADER_ALIGN 4
/* The magic field should contain this. */
#define MULTIBOOT_HEADER_MAGIC 0x1BADB002
/* This should be in %eax. */
#define MULTIBOOT_BOOTLOADER_MAGIC 0x2BADB002
/* Alignment of multiboot modules. */
#define MULTIBOOT_MOD_ALIGN 0x00001000
/* Alignment of the multiboot info structure. */
#define MULTIBOOT_INFO_ALIGN 0x00000004
/* Flags set in the 'flags' member of the multiboot header. */
/* Align all boot modules on i386 page (4KB) boundaries. */
#define MULTIBOOT_PAGE_ALIGN 0x00000001
/* Must pass memory information to OS. */
#define MULTIBOOT_MEMORY_INFO 0x00000002
/* Must pass video information to OS. */
#define MULTIBOOT_VIDEO_MODE 0x00000004
/* This flag indicates the use of the address fields in the header. */
#define MULTIBOOT_AOUT_KLUDGE 0x00010000
/* Flags to be set in the 'flags' member of the multiboot info structure. */
/* is there basic lower/upper memory information? */
#define MULTIBOOT_INFO_MEMORY 0x00000001
/* is there a boot device set? */
#define MULTIBOOT_INFO_BOOTDEV 0x00000002
/* is the command-line defined? */
#define MULTIBOOT_INFO_CMDLINE 0x00000004
/* are there modules to do something with? */
#define MULTIBOOT_INFO_MODS 0x00000008
/* These next two are mutually exclusive */
/* is there a symbol table loaded? */
#define MULTIBOOT_INFO_AOUT_SYMS 0x00000010
/* is there an ELF section header table? */
#define MULTIBOOT_INFO_ELF_SHDR 0X00000020
/* is there a full memory map? */
#define MULTIBOOT_INFO_MEM_MAP 0x00000040
/* Is there drive info? */
#define MULTIBOOT_INFO_DRIVE_INFO 0x00000080
/* Is there a config table? */
#define MULTIBOOT_INFO_CONFIG_TABLE 0x00000100
/* Is there a boot loader name? */
#define MULTIBOOT_INFO_BOOT_LOADER_NAME 0x00000200
/* Is there a APM table? */
#define MULTIBOOT_INFO_APM_TABLE 0x00000400
/* Is there video information? */
#define MULTIBOOT_INFO_VBE_INFO 0x00000800
#define MULTIBOOT_INFO_FRAMEBUFFER_INFO 0x00001000
#ifndef ASM_FILE
typedef unsigned char multiboot_uint8_t;
typedef unsigned short multiboot_uint16_t;
typedef unsigned int multiboot_uint32_t;
typedef unsigned long long multiboot_uint64_t;
struct multiboot_header
{
/* Must be MULTIBOOT_MAGIC - see above. */
multiboot_uint32_t magic;
/* Feature flags. */
multiboot_uint32_t flags;
/* The above fields plus this one must equal 0 mod 2^32. */
multiboot_uint32_t checksum;
/* These are only valid if MULTIBOOT_AOUT_KLUDGE is set. */
multiboot_uint32_t header_addr;
multiboot_uint32_t load_addr;
multiboot_uint32_t load_end_addr;
multiboot_uint32_t bss_end_addr;
multiboot_uint32_t entry_addr;
/* These are only valid if MULTIBOOT_VIDEO_MODE is set. */
multiboot_uint32_t mode_type;
multiboot_uint32_t width;
multiboot_uint32_t height;
multiboot_uint32_t depth;
};
/* The symbol table for a.out. */
struct multiboot_aout_symbol_table
{
multiboot_uint32_t tabsize;
multiboot_uint32_t strsize;
multiboot_uint32_t addr;
multiboot_uint32_t reserved;
};
typedef struct multiboot_aout_symbol_table multiboot_aout_symbol_table_t;
/* The section header table for ELF. */
struct multiboot_elf_section_header_table
{
multiboot_uint32_t num;
multiboot_uint32_t size;
multiboot_uint32_t addr;
multiboot_uint32_t shndx;
};
typedef struct multiboot_elf_section_header_table multiboot_elf_section_header_table_t;
struct multiboot_info
{
/* Multiboot info version number */
multiboot_uint32_t flags;
/* Available memory from BIOS */
multiboot_uint32_t mem_lower;
multiboot_uint32_t mem_upper;
/* "root" partition */
multiboot_uint32_t boot_device;
/* Kernel command line */
multiboot_uint32_t cmdline;
/* Boot-Module list */
multiboot_uint32_t mods_count;
multiboot_uint32_t mods_addr;
union
{
multiboot_aout_symbol_table_t aout_sym;
multiboot_elf_section_header_table_t elf_sec;
} u;
/* Memory Mapping buffer */
multiboot_uint32_t mmap_length;
multiboot_uint32_t mmap_addr;
/* Drive Info buffer */
multiboot_uint32_t drives_length;
multiboot_uint32_t drives_addr;
/* ROM configuration table */
multiboot_uint32_t config_table;
/* Boot Loader Name */
multiboot_uint32_t boot_loader_name;
/* APM table */
multiboot_uint32_t apm_table;
/* Video */
multiboot_uint32_t vbe_control_info;
multiboot_uint32_t vbe_mode_info;
multiboot_uint16_t vbe_mode;
multiboot_uint16_t vbe_interface_seg;
multiboot_uint16_t vbe_interface_off;
multiboot_uint16_t vbe_interface_len;
multiboot_uint64_t framebuffer_addr;
multiboot_uint32_t framebuffer_pitch;
multiboot_uint32_t framebuffer_width;
multiboot_uint32_t framebuffer_height;
multiboot_uint8_t framebuffer_bpp;
#define MULTIBOOT_FRAMEBUFFER_TYPE_INDEXED 0
#define MULTIBOOT_FRAMEBUFFER_TYPE_RGB 1
#define MULTIBOOT_FRAMEBUFFER_TYPE_EGA_TEXT 2
multiboot_uint8_t framebuffer_type;
union
{
struct
{
multiboot_uint32_t framebuffer_palette_addr;
multiboot_uint16_t framebuffer_palette_num_colors;
};
struct
{
multiboot_uint8_t framebuffer_red_field_position;
multiboot_uint8_t framebuffer_red_mask_size;
multiboot_uint8_t framebuffer_green_field_position;
multiboot_uint8_t framebuffer_green_mask_size;
multiboot_uint8_t framebuffer_blue_field_position;
multiboot_uint8_t framebuffer_blue_mask_size;
};
};
};
typedef struct multiboot_info multiboot_info_t;
struct multiboot_color
{
multiboot_uint8_t red;
multiboot_uint8_t green;
multiboot_uint8_t blue;
};
struct multiboot_mmap_entry
{
multiboot_uint32_t size;
multiboot_uint64_t addr;
multiboot_uint64_t len;
#define MULTIBOOT_MEMORY_AVAILABLE 1
#define MULTIBOOT_MEMORY_RESERVED 2
#define MULTIBOOT_MEMORY_ACPI_RECLAIMABLE 3
#define MULTIBOOT_MEMORY_NVS 4
#define MULTIBOOT_MEMORY_BADRAM 5
multiboot_uint32_t type;
} __attribute__((packed));
typedef struct multiboot_mmap_entry multiboot_memory_map_t;
struct multiboot_mod_list
{
/* the memory used goes from bytes 'mod_start' to 'mod_end-1' inclusive */
multiboot_uint32_t mod_start;
multiboot_uint32_t mod_end;
/* Module command line */
multiboot_uint32_t cmdline;
/* padding to take it to 16 bytes (must be zero) */
multiboot_uint32_t pad;
};
typedef struct multiboot_mod_list multiboot_module_t;
/* APM BIOS info. */
struct multiboot_apm_info
{
multiboot_uint16_t version;
multiboot_uint16_t cseg;
multiboot_uint32_t offset;
multiboot_uint16_t cseg_16;
multiboot_uint16_t dseg;
multiboot_uint16_t flags;
multiboot_uint16_t cseg_len;
multiboot_uint16_t cseg_16_len;
multiboot_uint16_t dseg_len;
};
#endif /* ! ASM_FILE */
#endif /* ! MULTIBOOT_HEADER */
-17
View File
@@ -1,17 +0,0 @@
#pragma once
#include <stddef.h>
#include <stdint.h>
// General utils
size_t strlen(const char *s);
char *strcpy(char *dst, const char *src);
void *memset(void *blk, int v, size_t sz);
void *memcpy(void *dst, const void *src, size_t sz);
int strcmp(const char *a, const char *b);
int strncmp(const char *a, const char *b, size_t lim);
// Debug utils
void panic(const char *s);
void puts(const char *s);
void putx(uint64_t v);
void putc(char c);
-30
View File
@@ -1,30 +0,0 @@
// vim: set ft=cpp.doxygen :
#pragma once
#include "sys/heap.h"
#include <stdint.h>
#define KERNEL_HEAP (16 * 1024 * 1024)
/**
* @brief Initialize heap instance of size `sz' at `phys_base'
* @param heap Heap instance
* @param phys_base Physical address of the first byte of the heap
* @param sz Count of bytes available for heap usage
* @note Physical addresses are used internally for heap because this
* allows heap to just MM_VIRTUALIZE allocated pointers no matter
* where the kernel heap actually resides, which could be the
* problem if we created a separate mapping for kernel heap
* memory.
*/
void amd64_heap_init(heap_t *heap, uintptr_t phys_base, size_t sz);
// Debug info
/**
* @return Number of blocks in heap
*/
size_t amd64_heap_blocks(const heap_t *heap);
/**
* @brief Print kernel heap block list to debug output
*/
void amd64_heap_dump(const heap_t *heap);
-49
View File
@@ -1,49 +0,0 @@
/** vim: set ft=cpp.doxygen :
* @file arch/amd64/mm/map.h
* @brief amd64-specific virtual memory space functions
*/
#pragma once
#include "sys/types.h"
#include "sys/mm.h"
/// Splits userspace mappings and kernelspace ones
#define AMD64_PML4I_USER_END 255
/**
* @brief Translate a virtual address in `space' to its physical mapping (if one exists).
* May optionally return access flags in `flags' if non-NULL
* @param space Virtual memory space
* @param vaddr Virtual address
* @param flags Access flags storage pointer or NULL
* @return Physical address corresponding to `vaddr' in `space' if mapping exists,
* MM_NADDR otherwise.
*/
uintptr_t amd64_map_get(const mm_space_t space, uintptr_t vaddr, uint64_t *flags);
/**
* @brief Remove a virtual address mapping from memory space, optionally checking if it
* is of a specific page size.
* @param space Virtual memory space
* @param vaddr Virtual address
* @param size Expected page size:
* * 1 for 4KiB
* * 2 for 2MiB
* * 3 for 1GiB
* * 0 for any size
* @return Physical address of the unmapped page (in case it has to be freed),
* MM_NADDR in case the mapping does not exist or the size does not match.
*/
uintptr_t amd64_map_umap(mm_space_t space, uintptr_t vaddr, uint32_t size);
/**
* @brief Add a single page mapping to `pml4'
* @param pml4 Virtual memory space
* @param virt_addr Source virtual address
* @param phys Destination physical address
* @param flags Access flags:
* * TODO: size-specific
* * AMD64_MAP_WRITE
* * AMD64_MAP_USER
* @return 0 on success, -1 otherwise
*/
int amd64_map_single(mm_space_t pml4, uintptr_t virt_addr, uintptr_t phys, uint64_t flags);
-65
View File
@@ -1,65 +0,0 @@
/* vim: set ft=cpp.doxygen : */
#pragma once
#include <stdint.h>
#include "sys/amd64/loader/data.h"
/// The place where the kernel pages are virtually mapped to
#define KERNEL_VIRT_BASE 0xFFFFFF0000000000
/// amd64 standard states that addresses' upper bits are copies of the 47th bit, so these need to be
/// stripped down to only 48 bits
#define AMD64_MM_STRIPSX(a) ((uintptr_t) (a) & 0xFFFFFFFFFFFF)
#define AMD64_MM_ADDRSX(a) (((uintptr_t) (a) & (1ULL << 47)) ? \
(0xFFFFFF0000000000 | ((uintptr_t) (a))) : \
((uintptr_t) (a)))
#define MM_VIRTUALIZE(a) ((uintptr_t) (a) + 0xFFFFFF0000000000)
#define MM_PHYS(a) ((uintptr_t) (a) - 0xFFFFFF0000000000)
#define MM_PAGE_SIZE 0x1000
#define MM_PTE_INDEX_MASK 0x1FF
#define MM_PTE_COUNT 512
#define MM_PTE_FLAGS_MASK (0xFFF | MM_PAGE_NOEXEC)
#define MM_PTE_MASK (~MM_PTE_FLAGS_MASK)
#define MM_PAGE_MASK (~0xFFF)
// Same as L1 mask
#define MM_PAGE_OFFSET_MASK 0xFFF
#define MM_PAGE_L2_OFFSET_MASK ((1 << MM_PDI_SHIFT) - 1)
#define MM_PAGE_L3_OFFSET_MASK ((1 << MM_PDPTI_SHIFT) - 1)
#define MM_PAGE_L4_OFFSET_MASK ((1 << MM_PML4I_SHIFT) - 1)
#define MM_PTI_SHIFT 12
#define MM_PDI_SHIFT 21
#define MM_PDPTI_SHIFT 30
#define MM_PML4I_SHIFT 39
#define MM_PAGE_PRESENT (1ULL << 0)
#define MM_PAGE_WRITE (1ULL << 1)
#define MM_PAGE_USER (1ULL << 2)
#define MM_PAGE_WT (1ULL << 3)
#define MM_PAGE_NOCACHE (1ULL << 4)
#define MM_PAGE_ACCESSED (1ULL << 5)
#define MM_PAGE_DIRTY (1ULL << 6)
#define MM_PAGE_HUGE (1ULL << 7)
#define MM_PAGE_GLOBAL (1ULL << 8)
#define MM_PAGE_NOEXEC (1ULL << 63)
/// Page map level 4
typedef uint64_t *mm_pml4_t;
/// Page directory pointer table
typedef uint64_t *mm_pdpt_t;
/// Page directory
typedef uint64_t *mm_pagedir_t;
/// Page table
typedef uint64_t *mm_pagetab_t;
/// Virtual memory space
typedef mm_pml4_t mm_space_t;
/// Kernel memory space
extern mm_space_t mm_kernel;
void amd64_mm_init(struct amd64_loader_data *data);
-18
View File
@@ -1,18 +0,0 @@
#pragma once
#include "sys/amd64/loader/multiboot.h"
#include "sys/types.h"
#include <stdint.h>
struct amd64_phys_stat {
size_t pages_free;
size_t pages_used;
size_t limit;
};
void amd64_phys_memory_map(const multiboot_memory_map_t *mmap, size_t length);
void amd64_phys_free(uintptr_t page);
uintptr_t amd64_phys_alloc_page(void);
uintptr_t amd64_phys_alloc_contiguous(size_t count);
void amd64_phys_stat(struct amd64_phys_stat *st);
-22
View File
@@ -1,22 +0,0 @@
#pragma once
#include <stddef.h>
#include <stdint.h>
// 8192 page tables
#define MM_POOL_SIZE (8192 * 0x1000)
struct amd64_pool_stat {
size_t pages_free;
size_t pages_used;
};
/// Initialize the paging structure allocation pool
void amd64_mm_pool_init(uintptr_t base, size_t size);
/// Allocate a paging structure (returns virtual addresses)
uint64_t *amd64_mm_pool_alloc(void);
/// Free a paging structure (obj is a virtual pointer)
void amd64_mm_pool_free(uint64_t *obj);
void amd64_mm_pool_stat(struct amd64_pool_stat *st);
-7
View File
@@ -1,7 +0,0 @@
#pragma once
#include "sys/types.h"
#define IPI_VECTOR_GENERIC 0xF0
#define IPI_VECTOR_PANIC 0xF3
void amd64_ipi_send(int cpu, uint8_t vector);
-9
View File
@@ -1,9 +0,0 @@
#pragma once
#include "sys/types.h"
extern size_t smp_ncpus;
void amd64_smp_bsp_configure(void);
void amd64_smp_add(uint8_t apic_id);
void amd64_smp_init(void);
void amd64_load_ap_code(void);
-4
View File
@@ -1,4 +0,0 @@
#pragma once
#include "sys/types.h"
typedef uint64_t spin_t;
-3
View File
@@ -1,3 +0,0 @@
#pragma once
void syscall_init(void);
+1 -1
View File
@@ -1,5 +1,5 @@
#pragma once
#include "sys/user/termios.h"
#include "user/termios.h"
#include "sys/char/ring.h"
#include "sys/types.h"
+5 -1
View File
@@ -1,5 +1,9 @@
#pragma once
#include "sys/amd64/loader/data.h"
#if defined(ARCH_AMD64)
// For KERNEL_CMDLINE_MAX
#include "arch/amd64/loader/data.h"
#endif
#include "sys/types.h"
enum {
+1 -1
View File
@@ -7,7 +7,7 @@
#include <stdint.h>
#include <stddef.h>
#include "sys/user/time.h"
#include "user/time.h"
#define DEBUG_DEFAULT 0
#define DEBUG_INFO 1
-33
View File
@@ -1,33 +0,0 @@
#pragma once
#include "sys/types.h"
struct ahci_registers;
struct pci_device;
struct ahci_fis_reg_h2d {
uint8_t type;
uint8_t cmd_port;
uint8_t cmd;
uint8_t feature_low;
uint8_t lba0;
uint8_t lba1;
uint8_t lba2;
uint8_t device;
uint8_t lba3;
uint8_t lba4;
uint8_t lba5;
uint8_t feature_high;
uint16_t count;
uint8_t icc;
uint8_t control;
uint32_t __res0;
};
struct ahci_controller {
struct pci_device *pci_dev;
uintptr_t abar_phys;
struct ahci_registers *regs;
};
-21
View File
@@ -1,21 +0,0 @@
#pragma once
#define ATA_CMD_IDENTIFY 0xEC
#define ATA_CMD_PACKET 0xA0
#define ATA_CMD_READ_DMA_EX 0x25
#define ATA_CMD_WRITE_DMA_EX 0x35
#define ATA_CMD_PACKET_IDENTIFY 0xA1
#define ATAPI_CMD_READ_SECTORS 0xA8
#define ATA_SR_BUSY (1 << 7)
#define ATA_SR_DRQ (1 << 3)
// Response to ATA_CMD_IDENTIFY
#define ATA_IDENT_DEVICE_TYPE 0x00
#define ATA_IDENT_SERIAL 0x14
#define ATA_IDENT_MODEL 0x36
#define ATA_IDENT_CAPS 0x62
#define ATA_IDENT_MAX_LBA 0x78
#define ATA_IDENT_CMD_SETS 0xA4
#define ATA_IDENT_MAX_LBAEXT 0xC8
-34
View File
@@ -1,34 +0,0 @@
#pragma once
#include "sys/amd64/hw/irq.h"
#include "sys/types.h"
#define PCI_PORT_CONFIG_ADDR 0xCF8
#define PCI_PORT_CONFIG_DATA 0xCFC
#define PCI_CONFIG_ID 0x00
#define PCI_CONFIG_CMD 0x04
#define PCI_CONFIG_CLASS 0x08
#define PCI_CONFIG_INFO 0x0C
#define PCI_CONFIG_BAR(n) (0x10 + (n) * 4)
#define PCI_CONFIG_SUBSYSTEM 0x2C
#define PCI_CONFIG_CAPABILITIES 0x34
#define PCI_CONFIG_IRQ 0x3C
#define PCI_CONFIG_BRIDGE 0x18
#define PCI_ID(vnd, dev) (((uint32_t) (vnd)) | ((uint32_t) (dev) << 16))
struct pci_device;
typedef void (*pci_driver_func_t)(struct pci_device *dev);
void pci_init(void);
void pci_add_root_bus(uint8_t n);
uint32_t pci_config_read_dword_legacy(uint8_t bus, uint8_t dev, uint8_t func, uint32_t off);
uint32_t pci_config_read_dword(struct pci_device *dev, uint16_t off);
void pci_add_irq(struct pci_device *dev, irq_handler_func_t handler, void *ctx);
void pci_add_class_driver(uint32_t full_class, pci_driver_func_t func);
// pcidb.c
const char *pci_class_string(uint16_t full_class);
-10
View File
@@ -1,10 +0,0 @@
#pragma once
// Classes
#define USB_CLASS_HID 0x03
// HID subclasses
#define USB_SUBCLASS_BOOT 0x01
// HID protocols
#define USB_PROTOCOL_KEYBOARD 0x01
-29
View File
@@ -1,29 +0,0 @@
#pragma once
#include "sys/driver/usb/request.h"
#include "sys/types.h"
struct usb_transfer;
struct usb_request;
struct usb_device {
void *hc;
uint16_t address;
uint8_t speed;
uint32_t max_packet;
uint8_t endpoint_toggle;
struct usb_desc_interface desc_interface;
struct usb_desc_endpoint desc_endpoint;
struct usb_driver *driver;
void *driver_data;
void (*hc_control)(struct usb_device *, struct usb_transfer *);
void (*hc_interrupt)(struct usb_device *, struct usb_transfer *);
struct usb_device *next;
};
struct usb_device *usb_device_create(void);
int usb_device_init(struct usb_device *dev);
int usb_device_request(struct usb_device *dev, uint8_t type, uint8_t request, uint16_t index, uint16_t value, uint16_t len, void *data);
-13
View File
@@ -1,13 +0,0 @@
#pragma once
struct usb_device;
struct usb_driver {
int (*usb_init)(struct usb_device *dev);
void (*usb_poll)(struct usb_device *dev);
struct usb_driver *next;
};
int usb_select_driver(struct usb_device *dev);
void usb_add_driver(struct usb_driver *drv);
-97
View File
@@ -1,97 +0,0 @@
#pragma once
#include "sys/types.h"
#define USB_REQUEST_TYPE_D2H (1 << 7)
#define USB_REQUEST_TYPE_CLASS (1 << 5)
#define USB_REQUEST_TO_INTERFACE (1 << 0)
// General
#define USB_REQUEST_GET_STATUS 0
#define USB_REQUEST_SET_ADDRESS 5
#define USB_REQUEST_GET_DESCRIPTOR 6
#define USB_REQUEST_SET_CONFIGURATION 9
// USB HID
#define USB_REQUEST_SET_IDLE 0x0A
#define USB_DESCRIPTOR_DEVICE 1
#define USB_DESCRIPTOR_CONFIGURATION 2
#define USB_DESCRIPTOR_STRING 3
#define USB_DESCRIPTOR_INTERFACE 4
#define USB_DESCRIPTOR_ENDPOINT 5
struct usb_request {
uint8_t type;
uint8_t request;
uint16_t value;
uint16_t index;
uint16_t length;
};
#define USB_TRANSFER_COMPLETE (1 << 0)
#define USB_TRANSFER_SUCCESS (1 << 1)
struct usb_transfer {
struct usb_request *request;
uint8_t endp;
void *data;
size_t length;
uint32_t flags;
};
struct usb_desc_configuration {
uint8_t length;
uint8_t type;
uint16_t total_length;
uint8_t num_interfaces;
uint8_t configuration_value;
uint8_t idx_configuration;
uint8_t attributes;
uint8_t max_power;
} __attribute__((packed));
struct usb_desc_interface {
uint8_t length;
uint8_t type;
uint8_t interface_number;
uint8_t alternate_setting;
uint8_t num_endpoints;
uint8_t interface_class;
uint8_t interface_subclass;
uint8_t interface_protocol;
uint8_t idx_interface;
} __attribute__((packed));
struct usb_desc_endpoint {
uint8_t length;
uint8_t type;
uint8_t address;
uint8_t attributes;
uint16_t max_packet_size;
uint8_t interval;
} __attribute__((packed));
struct usb_desc_string {
uint8_t len;
uint8_t type;
uint16_t data[0];
} __attribute__((packed));
struct usb_desc_device {
uint8_t length;
uint8_t type;
uint16_t bcd_usb;
uint8_t dev_class;
uint8_t dev_subclass;
uint8_t dev_protocol;
uint8_t max_packet_zero;
// After 8 bytes
uint16_t id_vendor;
uint16_t id_product;
uint16_t bcd_device;
uint8_t idx_manufacturer;
uint8_t idx_product;
uint8_t idx_serial_number;
uint8_t num_configurations;
} __attribute__((packed));
-19
View File
@@ -1,19 +0,0 @@
#pragma once
#include "sys/types.h"
#define USB_SPEC_UHCI 0x00
#define USB_SPEED_LOW 0x00
#define USB_SPEED_FULL 0x01
#define USB_SPEED_HIGH 0x02
struct usb_controller {
uint8_t spec;
void (*hc_poll)(struct usb_controller *hc);
struct usb_controller *next;
};
void usb_controller_add(struct usb_controller *hc);
void usb_daemon_start(void);
void usb_poll(void);
-1
View File
@@ -1 +0,0 @@
#pragma once
-17
View File
@@ -1,17 +0,0 @@
#pragma once
#include "sys/types.h"
struct ext2_inode;
struct fs;
int ext2_read_superblock(struct fs *ext2);
int ext2_write_superblock(struct fs *ext2);
int ext2_read_block(struct fs *ext2, void *blk, uint32_t no);
int ext2_read_inode_block(struct fs *ext2, struct ext2_inode *inode, void *block, uint32_t index);
int ext2_read_inode(struct fs *ext2, struct ext2_inode *dst, uint32_t ino);
// NOTE: this function automatically updates access and modification time
// on the inode written
int ext2_write_inode(struct fs *ext2, struct ext2_inode *node, uint32_t ino);
-146
View File
@@ -1,146 +0,0 @@
#pragma once
#include "sys/types.h"
#define EXT2_FLAG_RO (1 << 0)
#define EXT2_STATE_CLEAN 1
#define EXT2_STATE_DIRTY 2
#define EXT2_ERROR_IGNORE 1
#define EXT2_ERROR_READONLY 2
#define EXT2_ERROR_PANIC 3
#define EXT2_REQ_COMP (1 << 0)
#define EXT2_REQ_ENT_TYPE (1 << 1)
#define EXT2_REQ_REPLAY_JOURNAL (1 << 2)
#define EXT2_REQ_JOURNAL_DEV (1 << 3)
#define EXT2_RO_SPARSE_SB (1 << 0)
#define EXT2_RO_64BIT_SIZE (1 << 1)
#define EXT2_RO_DIR_BTREE (1 << 2)
#define EXT2_SIGNATURE 0xEF53
#define EXT2_IFIFO 0x1000
#define EXT2_IFCHR 0x2000
#define EXT2_IFDIR 0x4000
#define EXT2_IFBLK 0x6000
#define EXT2_IFREG 0x8000
#define EXT2_IFLNK 0xA000
#define EXT2_IFSOCK 0xC000
struct vnode;
struct ext2_superblock {
// Base superblock
uint32_t inode_count;
uint32_t block_count;
uint32_t reserved_blocks;
uint32_t free_blocks;
uint32_t free_inodes;
uint32_t superblock_no;
uint32_t log2_block_size;
uint32_t log2_frag_size;
uint32_t block_group_blocks;
uint32_t block_group_frags;
uint32_t block_group_inodes;
uint32_t mount_time;
uint32_t write_time;
uint16_t mount_count;
uint16_t fsck_mount_count;
uint16_t ext2_signature;
uint16_t state;
uint16_t error_behavior;
uint16_t version_minor;
uint32_t fsck_time;
uint32_t fsck_interval;
uint32_t os_id;
uint32_t version_major;
uint16_t reserved_uid;
uint16_t reserved_gid;
// Extended superblock
uint32_t first_inode; // == 11 in < 1.0
uint16_t inode_size; // == 128 in < 1.0
uint16_t superblock_block_group; // For backup
uint32_t optional_features; // Don't matter
uint32_t required_features; // Cannot read without these
uint32_t write_required_features; // Can read without these
char filesystem_id[16];
char volume_name[16];
char last_mount_path[64];
uint32_t compression;
uint8_t prealloc_file_blocks;
uint8_t prealloc_dir_blocks;
uint16_t __res0;
char journal_id[16];
uint32_t journal_inode;
uint32_t journal_device;
uint32_t orphan_inode_list_head;
} __attribute__((packed));
struct ext2_blkgrp_desc {
uint32_t block_bitmap_no;
uint32_t inode_bitmap_no;
uint32_t inode_table_no;
uint16_t free_blocks;
uint16_t free_inodes;
uint16_t directory_count;
char __pad[14];
} __attribute__((packed));
struct ext2_inode {
uint16_t mode;
uint16_t uid;
uint32_t size_lower;
uint32_t atime;
uint32_t ctime;
uint32_t mtime;
uint32_t dtime;
uint16_t gid;
uint16_t hard_links;
uint32_t sector_count;
uint32_t flags;
uint32_t os_val1;
uint32_t direct_blocks[12];
uint32_t indirect_block_l1;
uint32_t indirect_block_l2;
uint32_t indirect_block_l3;
uint32_t generation;
uint32_t facl;
union {
uint32_t size_upper;
uint32_t dir_acl;
};
uint32_t frag_block_no;
uint32_t os_val2;
} __attribute__((packed));
struct ext2_dirent {
uint32_t ino;
uint16_t ent_size;
uint8_t name_length_low;
union {
uint8_t type_indicator;
uint8_t name_length_high;
};
char name[0];
} __attribute__((packed));
struct ext2_data {
union {
struct ext2_superblock sb;
char __data[1024];
};
struct ext2_blkgrp_desc *bgdt;
struct vnode *root;
struct ext2_inode *root_inode;
uint32_t flags;
uint32_t block_size;
uint32_t inode_size;
uint32_t inodes_per_block;
uint32_t blkgrp_inode_blocks;
uint32_t bgdt_entry_count;
uint32_t bgdt_size_blocks;
};
-10
View File
@@ -1,10 +0,0 @@
#pragma once
#include "sys/types.h"
struct vnode_operations;
struct ext2_inode;
struct vnode;
extern struct vnode_operations g_ext2_vnode_ops;
void ext2_inode_to_vnode(struct vnode *vnode, struct ext2_inode *inode, uint32_t ino);
-35
View File
@@ -1,35 +0,0 @@
#pragma once
struct statvfs;
struct blkdev;
struct vnode;
struct fs;
struct fs_class {
char name[64];
int opt;
struct vnode *(*get_root) (struct fs *fs);
int (*init) (struct fs *fs, const char *opt);
int (*mount) (struct fs *fs);
int (*umount) (struct fs *fs);
int (*statvfs) (struct fs *fs, struct statvfs *st);
};
// The actual filesystem instance,
// one per each mount
struct fs {
// Block device on which the filesystem resides
struct blkdev *blk;
// Private data structure per-mount
void *fs_private;
struct fs_class *cls;
};
struct fs *fs_create(struct fs_class *cls, struct blkdev *blk);
void fs_release(struct fs *fs);
struct fs_class *fs_class_by_name(const char *name);
int fs_class_register(struct fs_class *cls);
-34
View File
@@ -1,34 +0,0 @@
#pragma once
#include <sys/types.h>
#include <stdint.h>
typedef struct hash_entry {
uint64_t key;
void *value;
struct hash_entry *next;
} hash_entry_t;
typedef struct {
int (*keycmp) (uint64_t, uint64_t);
uint64_t (*keyhsh) (uint64_t);
uint64_t (*keydup) (uint64_t);
void (*keyfree) (uint64_t);
void (*valfree) (void *);
size_t bucket_count;
size_t item_count;
hash_entry_t **buckets;
} hash_t;
void hash_init(hash_t *h, int nb);
void hash_walk(hash_t *h, int (*wlkfn) (hash_entry_t *));
void hash_clear(hash_t *h);
void hash_put(hash_t *h, uint64_t key, void *value);
int hash_del(hash_t *h, uint64_t key);
int hash_get(hash_t *h, uint64_t key, void **value);
// Helper functions
int hash_u64_keycmp(uint64_t v0, uint64_t v1);
uint64_t hash_u64_keyhsh(uint64_t v0);
-7
View File
@@ -1,7 +0,0 @@
#pragma once
typedef struct list_simple {
void *car;
struct list_simple *cdr;
} list_simple_t;
-98
View File
@@ -1,98 +0,0 @@
/** vim: ft=c.doxygen
* @file node.h
* @brief vnode
*/
#pragma once
#include <stdint.h>
#include "sys/user/dirent.h"
#include "sys/user/stat.h"
#include "sys/types.h"
#define NODE_MAXLEN 64
// Means the node has no physical storage and resides only
// in memory
#define VN_MEMORY (1 << 0)
struct ofile;
struct vfs_ioctx;
struct vnode;
struct fs;
enum vnode_type {
VN_REG,
VN_DIR,
VN_BLK,
VN_CHR,
VN_LNK,
VN_UNK,
VN_MNT,
};
struct vnode_operations {
int (*find) (struct vnode *at, const char *name, struct vnode **node);
ssize_t (*readdir) (struct ofile *fd, struct dirent *ent);
int (*opendir) (struct ofile *fd);
int (*open) (struct ofile *fd, int opt);
void (*close) (struct ofile *fd);
int (*creat) (struct vnode *at, const char *filename, uid_t uid, gid_t gid, mode_t mode);
int (*mkdir) (struct vnode *at, const char *filename, uid_t uid, gid_t gid, mode_t mode);
int (*truncate) (struct vnode *at, size_t size);
int (*unlink) (struct vnode *vn);
off_t (*lseek) (struct ofile *fd, off_t offset, int whence);
int (*stat) (struct vnode *at, struct stat *st);
int (*chmod) (struct vnode *node, mode_t mode);
int (*chown) (struct vnode *node, uid_t uid, gid_t gid);
int (*readlink) (struct vnode *at, char *buf, size_t lim);
ssize_t (*read) (struct ofile *fd, void *buf, size_t count);
ssize_t (*write) (struct ofile *fd, const void *buf, size_t count);
};
struct vnode {
enum vnode_type type;
char name[NODE_MAXLEN];
uint32_t flags;
struct vnode *first_child;
struct vnode *next_child;
struct vnode *parent;
// For filesystem roots, mountpoint directory vnode
// For symlinks, this is target vnode
// For mountpoints, this is filesystem root
struct vnode *target;
uint32_t open_count;
uint64_t ino;
gid_t gid;
uid_t uid;
mode_t mode;
struct fs *fs;
void *fs_data;
/*
* (struct blkdev *) if type == VN_BLK
* (struct chrdev *) if type == VN_CHR
*/
void *dev;
struct vnode_operations *op;
};
// Node itself
struct vnode *vnode_create(enum vnode_type t, const char *name);
// Tree manipulation
void vnode_attach(struct vnode *parent, struct vnode *child);
void vnode_detach(struct vnode *node);
// Tree traversal
void vnode_dump_tree(int level, struct vnode *node, int depth);
int vnode_lookup_child(struct vnode *of, const char *name, struct vnode **child);
-18
View File
@@ -1,18 +0,0 @@
#pragma once
#include "node.h"
#include <sys/types.h>
#define OF_WRITABLE (1 << 0)
#define OF_READABLE (1 << 1)
#define OF_DIRECTORY (1 << 2)
#define OF_MEMDIR (1 << 3)
#define OF_MEMDIR_DOT (1 << 4)
#define OF_MEMDIR_DOTDOT (1 << 5)
struct ofile {
int refcount;
int flags;
struct vnode *vnode;
size_t pos;
void *priv_data;
};
-36
View File
@@ -1,36 +0,0 @@
#pragma once
#include "sys/types.h"
#define sysfs_buf_puts(buf, lim, s) \
{ \
if (lim > 0) { \
size_t l = MIN(strlen(s), (lim) - 1); \
strncpy(buf, s, l); \
buf += l; \
*buf = 0; \
lim -= l; \
} \
}
#define sysfs_buf_printf(buf, lim, fmt, ...) \
{ \
int res = snprintf(buf, lim, fmt, ##__VA_ARGS__); \
if (res >= (int) lim) { \
lim = 0; \
} else { \
buf += res; \
lim -= res; \
} \
}
typedef int (*cfg_read_func_t)(void *ctx, char *buf, size_t lim);
typedef int (*cfg_write_func_t)(void *ctx, const char *value);
// Generic getter for config values
// ctx: a pointer to a NULL-terminated string
int sysfs_config_getter(void *ctx, char *buf, size_t lim);
// Generic (u)int64_t getter
// ctx: a pointer to an (u)int64_t value
int sysfs_config_int64_getter(void *ctx, char *buf, size_t lim);
int sysfs_add_config_endpoint(const char *name, size_t bufsz, void *ctx, cfg_read_func_t read, cfg_write_func_t write);
void sysfs_populate(void);

Some files were not shown because too many files have changed in this diff Show More