acpredef.h revision 199767f8919635c4928607450d9e0abb932109ce
/******************************************************************************
*
* Name: acpredef - Information table for ACPI predefined methods and objects
*
*****************************************************************************/
/*
* Copyright (C) 2000 - 2015, Intel Corp.
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions, and the following disclaimer,
* without modification.
* 2. Redistributions in binary form must reproduce at minimum a disclaimer
* substantially similar to the "NO WARRANTY" disclaimer below
* ("Disclaimer") and any redistribution must be conditioned upon
* including a substantially similar Disclaimer requirement for further
* binary redistribution.
* 3. Neither the names of the above-listed copyright holders nor the names
* of any contributors may be used to endorse or promote products derived
* from this software without specific prior written permission.
*
* Alternatively, this software may be distributed under the terms of the
* GNU General Public License ("GPL") version 2 as published by the Free
* Software Foundation.
*
* NO WARRANTY
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
* A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
* HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
* POSSIBILITY OF SUCH DAMAGES.
*/
#ifndef __ACPREDEF_H__
#define __ACPREDEF_H__
/******************************************************************************
*
* Return Package types
*
* 1) PTYPE1 packages do not contain subpackages.
*
* ACPI_PTYPE1_FIXED: Fixed-length length, 1 or 2 object types:
* object type
* count
* object type
* count
*
* ACPI_PTYPE1_VAR: Variable-length length. Zero-length package is allowed:
*
* ACPI_PTYPE1_OPTION: Package has some required and some optional elements
* (Used for _PRW)
*
*
* 2) PTYPE2 packages contain a Variable-length number of subpackages. Each
* of the different types describe the contents of each of the subpackages.
*
* ACPI_PTYPE2: Each subpackage contains 1 or 2 object types. Zero-length
* parent package is allowed:
* object type
* count
* object type
* count
* (Used for _ALR,_MLS,_PSS,_TRT,_TSS)
*
* ACPI_PTYPE2_COUNT: Each subpackage has a count as first element.
* Zero-length parent package is allowed:
* object type
* (Used for _CSD,_PSD,_TSD)
*
* ACPI_PTYPE2_PKG_COUNT: Count of subpackages at start, 1 or 2 object types:
* object type
* count
* object type
* count
* (Used for _CST)
*
* ACPI_PTYPE2_FIXED: Each subpackage is of Fixed-length. Zero-length
* parent package is allowed.
* (Used for _PRT)
*
* ACPI_PTYPE2_MIN: Each subpackage has a Variable-length but minimum length.
* Zero-length parent package is allowed:
* (Used for _HPX)
*
* ACPI_PTYPE2_REV_FIXED: Revision at start, each subpackage is Fixed-length
* (Used for _ART, _FPS)
*
* ACPI_PTYPE2_FIX_VAR: Each subpackage consists of some fixed-length elements
* followed by an optional element. Zero-length parent package is allowed.
* object type
* count
* object type
* count = 0 (optional)
* (Used for _DLM)
*
* ACPI_PTYPE2_VAR_VAR: Variable number of subpackages, each of either a
* constant or variable length. The subpackages are preceded by a
* constant number of objects.
* (Used for _LPI, _RDI)
*
* ACPI_PTYPE2_UUID_PAIR: Each subpackage is preceded by a UUID Buffer. The UUID
* defines the format of the package. Zero-length parent package is
* allowed.
* (Used for _DSD)
*
*****************************************************************************/
{
ACPI_PTYPE1_FIXED = 1,
ACPI_PTYPE1_VAR = 2,
ACPI_PTYPE1_OPTION = 3,
ACPI_PTYPE2 = 4,
ACPI_PTYPE2_COUNT = 5,
ACPI_PTYPE2_FIXED = 7,
ACPI_PTYPE2_MIN = 8,
ACPI_PTYPE2_FIX_VAR = 10,
ACPI_PTYPE2_VAR_VAR = 11,
};
/* Support macros for users of the predefined info table */
#define METHOD_PREDEF_ARGS_MAX 4
#define METHOD_ARG_BIT_WIDTH 3
#define METHOD_ARG_MASK 0x0007
#define ARG_COUNT_IS_MINIMUM 0x8000
#define METHOD_MAX_ARG_TYPE ACPI_TYPE_PACKAGE
/* Macros used to build the predefined info table */
#define METHOD_0ARGS 0
#define METHOD_NO_RETURN_VALUE 0
/* Support macros for the resource descriptor info table */
#define WIDTH_1 0x0001
#define WIDTH_2 0x0002
#define WIDTH_3 0x0004
#define WIDTH_8 0x0008
#define WIDTH_16 0x0010
#define WIDTH_32 0x0020
#define WIDTH_64 0x0040
#define VARIABLE_DATA 0x0080
#define NUM_RESOURCE_WIDTHS 8
#ifdef ACPI_CREATE_PREDEFINED_TABLE
/******************************************************************************
*
*
* These are the names that can actually be evaluated via AcpiEvaluateObject.
* Not present in this table are the following:
*
* 1) Predefined/Reserved names that are not usually evaluated via
* AcpiEvaluateObject:
* _Lxx and _Exx GPE methods
* _Qxx EC methods
* _T_x compiler temporary variables
* _Wxx wake events
*
* 2) Predefined names that never actually exist within the AML code:
* Predefined resource descriptor field names
*
* 3) Predefined names that are implemented within ACPICA:
* _OSI
*
* The main entries in the table each contain the following items:
*
* Name - The ACPI reserved name
* ArgumentList - Contains (in 16 bits), the number of required
* arguments to the method (3 bits), and a 3-bit type
* field for each argument (up to 4 arguments). The
* METHOD_?ARGS macros generate the correct packed data.
* ExpectedBtypes - Allowed type(s) for the return value.
* 0 means that no return value is expected.
*
* For methods that return packages, the next entry in the table contains
* information about the expected structure of the package. This information
* is saved here (rather than in a separate table) in order to minimize the
* overall size of the stored data.
*
* Note: The additional braces are intended to promote portability.
*
* Note2: Table is used by the kernel-resident subsystem, the iASL compiler,
* and the AcpiHelp utility.
*
* TBD: _PRT - currently ignore reversed entries. Attempt to fix in nsrepair.
* Possibly fixing package elements like _BIF, etc.
*
*****************************************************************************/
{
{{"_AC0", METHOD_0ARGS,
{{"_AC1", METHOD_0ARGS,
{{"_AC2", METHOD_0ARGS,
{{"_AC3", METHOD_0ARGS,
{{"_AC4", METHOD_0ARGS,
{{"_AC5", METHOD_0ARGS,
{{"_AC6", METHOD_0ARGS,
{{"_AC7", METHOD_0ARGS,
{{"_AC8", METHOD_0ARGS,
{{"_AC9", METHOD_0ARGS,
{{"_ADR", METHOD_0ARGS,
{{"_AEI", METHOD_0ARGS,
{{"_AL0", METHOD_0ARGS,
{{"_AL1", METHOD_0ARGS,
{{"_AL2", METHOD_0ARGS,
{{"_AL3", METHOD_0ARGS,
{{"_AL4", METHOD_0ARGS,
{{"_AL5", METHOD_0ARGS,
{{"_AL6", METHOD_0ARGS,
{{"_AL7", METHOD_0ARGS,
{{"_AL8", METHOD_0ARGS,
{{"_AL9", METHOD_0ARGS,
{{"_ALC", METHOD_0ARGS,
{{"_ALI", METHOD_0ARGS,
{{"_ALP", METHOD_0ARGS,
{{"_ALR", METHOD_0ARGS,
{{"_ALT", METHOD_0ARGS,
{{"_ART", METHOD_0ARGS,
{{"_BBN", METHOD_0ARGS,
{{"_BCL", METHOD_0ARGS,
{{"_BDN", METHOD_0ARGS,
{{"_BIF", METHOD_0ARGS,
{{"_BIX", METHOD_0ARGS,
{{"_BMD", METHOD_0ARGS,
{{"_BQC", METHOD_0ARGS,
{{"_BST", METHOD_0ARGS,
{{"_CBA", METHOD_0ARGS,
{{"_CCA", METHOD_0ARGS,
{{"_CDM", METHOD_0ARGS,
{{"_CID", METHOD_0ARGS,
METHOD_RETURNS (ACPI_RTYPE_INTEGER | ACPI_RTYPE_STRING | ACPI_RTYPE_PACKAGE)}}, /* Variable-length (Ints/Strs) */
{{"_CLS", METHOD_0ARGS,
{{"_CPC", METHOD_0ARGS,
{{"_CRS", METHOD_0ARGS,
{{"_CRT", METHOD_0ARGS,
{{"_CSD", METHOD_0ARGS,
{{"_CST", METHOD_0ARGS,
{{"_DCS", METHOD_0ARGS,
{{"_DDN", METHOD_0ARGS,
{{"_DEP", METHOD_0ARGS,
{{"_DGS", METHOD_0ARGS,
{{"_DIS", METHOD_0ARGS,
{{"_DLM", METHOD_0ARGS,
METHOD_RETURNS (ACPI_RTYPE_PACKAGE)}}, /* Variable-length (Pkgs) each (1 Ref, 0/1 Optional Buf/Ref) */
PACKAGE_INFO (ACPI_PTYPE2_FIX_VAR, ACPI_RTYPE_REFERENCE, 1, ACPI_RTYPE_REFERENCE | ACPI_RTYPE_BUFFER, 0,0),
{{"_DMA", METHOD_0ARGS,
{{"_DOD", METHOD_0ARGS,
{{"_EC_", METHOD_0ARGS,
{{"_EDL", METHOD_0ARGS,
{{"_EJD", METHOD_0ARGS,
{{"_FDE", METHOD_0ARGS,
{{"_FDI", METHOD_0ARGS,
{{"_FIF", METHOD_0ARGS,
{{"_FIX", METHOD_0ARGS,
{{"_FPS", METHOD_0ARGS,
{{"_FST", METHOD_0ARGS,
{{"_GAI", METHOD_0ARGS,
{{"_GCP", METHOD_0ARGS,
{{"_GHL", METHOD_0ARGS,
{{"_GLK", METHOD_0ARGS,
{{"_GPD", METHOD_0ARGS,
{{"_GPE", METHOD_0ARGS,
{{"_GRT", METHOD_0ARGS,
{{"_GSB", METHOD_0ARGS,
{{"_GTF", METHOD_0ARGS,
{{"_GTM", METHOD_0ARGS,
{{"_HID", METHOD_0ARGS,
{{"_HOT", METHOD_0ARGS,
{{"_HPP", METHOD_0ARGS,
/*
* For _HPX, a single package is returned, containing a variable-length number
* of subpackages. Each subpackage contains a PCI record setting.
* There are several different type of record settings, of different
* lengths, but all elements of all settings are Integers.
*/
{{"_HPX", METHOD_0ARGS,
{{"_HRV", METHOD_0ARGS,
{{"_IFT", METHOD_0ARGS,
{{"_INI", METHOD_0ARGS,
{{"_IRC", METHOD_0ARGS,
{{"_LID", METHOD_0ARGS,
{{"_LPD", METHOD_0ARGS,
{{"_MAT", METHOD_0ARGS,
{{"_MBM", METHOD_0ARGS,
{{"_MLS", METHOD_0ARGS,
{{"_MSM", METHOD_4ARGS (ACPI_TYPE_INTEGER, ACPI_TYPE_INTEGER, ACPI_TYPE_INTEGER, ACPI_TYPE_INTEGER),
{{"_NTT", METHOD_0ARGS,
{{"_OFF", METHOD_0ARGS,
{{"_ON_", METHOD_0ARGS,
{{"_OS_", METHOD_0ARGS,
{{"_PCL", METHOD_0ARGS,
{{"_PCT", METHOD_0ARGS,
{{"_PDL", METHOD_0ARGS,
{{"_PIF", METHOD_0ARGS,
{{"_PLD", METHOD_0ARGS,
{{"_PMC", METHOD_0ARGS,
{{"_PMD", METHOD_0ARGS,
{{"_PMM", METHOD_0ARGS,
{{"_PPC", METHOD_0ARGS,
{{"_PPE", METHOD_0ARGS,
{{"_PR0", METHOD_0ARGS,
{{"_PR1", METHOD_0ARGS,
{{"_PR2", METHOD_0ARGS,
{{"_PR3", METHOD_0ARGS,
{{"_PRE", METHOD_0ARGS,
{{"_PRL", METHOD_0ARGS,
{{"_PRS", METHOD_0ARGS,
/*
* For _PRT, many BIOSs reverse the 3rd and 4th Package elements (Source
* and SourceIndex). This bug is so prevalent that there is code in the
* ACPICA Resource Manager to detect this and switch them back. For now,
* do not allow and issue a warning. To allow this and eliminate the
* warning, add the ACPI_RTYPE_REFERENCE type to the 4th element (index 3)
* in the statement below.
*/
{{"_PRT", METHOD_0ARGS,
{{"_PRW", METHOD_0ARGS,
METHOD_RETURNS (ACPI_RTYPE_PACKAGE)}}, /* Variable-length (Pkgs) each: Pkg/Int,Int,[Variable-length Refs] (Pkg is Ref/Int) */
{{"_PS0", METHOD_0ARGS,
{{"_PS1", METHOD_0ARGS,
{{"_PS2", METHOD_0ARGS,
{{"_PS3", METHOD_0ARGS,
{{"_PSC", METHOD_0ARGS,
{{"_PSD", METHOD_0ARGS,
{{"_PSL", METHOD_0ARGS,
{{"_PSR", METHOD_0ARGS,
{{"_PSS", METHOD_0ARGS,
{{"_PSV", METHOD_0ARGS,
{{"_PTC", METHOD_0ARGS,
{{"_PUR", METHOD_0ARGS,
{{"_PXM", METHOD_0ARGS,
ACPI_RTYPE_REFERENCE,0,0),
{{"_REV", METHOD_0ARGS,
{{"_RMV", METHOD_0ARGS,
{{"_RTV", METHOD_0ARGS,
/*
* For _S0_ through _S5_, the ACPI spec defines a return Package
* containing 1 Integer, but most DSDTs have it wrong - 2,3, or 4 integers.
* Allow this by making the objects "Variable-length length", but all elements
* must be Integers.
*/
{{"_S0_", METHOD_0ARGS,
{{"_S1_", METHOD_0ARGS,
{{"_S2_", METHOD_0ARGS,
{{"_S3_", METHOD_0ARGS,
{{"_S4_", METHOD_0ARGS,
{{"_S5_", METHOD_0ARGS,
{{"_S1D", METHOD_0ARGS,
{{"_S2D", METHOD_0ARGS,
{{"_S3D", METHOD_0ARGS,
{{"_S4D", METHOD_0ARGS,
{{"_S0W", METHOD_0ARGS,
{{"_S1W", METHOD_0ARGS,
{{"_S2W", METHOD_0ARGS,
{{"_S3W", METHOD_0ARGS,
{{"_S4W", METHOD_0ARGS,
{{"_SBS", METHOD_0ARGS,
METHOD_NO_RETURN_VALUE}}, /* Acpi 1.0 allowed 1 integer arg. Acpi 3.0 expanded to 3 args. Allow both. */
{{"_SEG", METHOD_0ARGS,
{{"_SLI", METHOD_0ARGS,
{{"_SRV", METHOD_0ARGS,
{{"_STA", METHOD_0ARGS,
{{"_STR", METHOD_0ARGS,
{{"_SUB", METHOD_0ARGS,
{{"_SUN", METHOD_0ARGS,
{{"_SWS", METHOD_0ARGS,
{{"_TC1", METHOD_0ARGS,
{{"_TC2", METHOD_0ARGS,
{{"_TDL", METHOD_0ARGS,
{{"_TMP", METHOD_0ARGS,
{{"_TPC", METHOD_0ARGS,
{{"_TRT", METHOD_0ARGS,
{{"_TSD", METHOD_0ARGS,
{{"_TSP", METHOD_0ARGS,
{{"_TSS", METHOD_0ARGS,
{{"_TST", METHOD_0ARGS,
{{"_TZD", METHOD_0ARGS,
{{"_TZM", METHOD_0ARGS,
{{"_TZP", METHOD_0ARGS,
{{"_UID", METHOD_0ARGS,
{{"_UPC", METHOD_0ARGS,
{{"_UPD", METHOD_0ARGS,
{{"_UPP", METHOD_0ARGS,
{{"_VPO", METHOD_0ARGS,
/* Acpi 1.0 defined _WAK with no return value. Later, it was changed to return a package */
PACKAGE_INFO (ACPI_PTYPE1_FIXED, ACPI_RTYPE_INTEGER, 2,0,0,0), /* Fixed-length (2 Int), but is optional */
/* _WDG/_WED are MS extensions defined by "Windows Instrumentation" */
{{"_WDG", METHOD_0ARGS,
PACKAGE_INFO (0,0,0,0,0,0) /* Table terminator */
};
#else
extern const ACPI_PREDEFINED_INFO AcpiGbl_PredefinedMethods[];
#endif
#if (defined ACPI_CREATE_RESOURCE_TABLE && defined ACPI_APPLICATION)
/******************************************************************************
*
* Predefined names for use in Resource Descriptors. These names do not
* appear in the global Predefined Name table (since these names never
* appear in actual AML byte code, only in the original ASL)
*
* Note: Used by iASL compiler and AcpiHelp utility only.
*
*****************************************************************************/
const ACPI_PREDEFINED_INFO AcpiGbl_ResourceNames[] =
{
{{"_ASI", WIDTH_8, 0}},
{{"_ASZ", WIDTH_8, 0}},
{{"_ATT", WIDTH_64, 0}},
{{"_BM_", WIDTH_1, 0}},
{{"_DEC", WIDTH_1, 0}},
{{"_DMA", WIDTH_8, 0}},
{{"_GRA", WIDTH_ADDRESS, 0}},
{{"_HE_", WIDTH_1, 0}},
{{"_LL_", WIDTH_1, 0}},
{{"_MAF", WIDTH_1, 0}},
{{"_MAX", WIDTH_ADDRESS, 0}},
{{"_MEM", WIDTH_2, 0}},
{{"_MIF", WIDTH_1, 0}},
{{"_MIN", WIDTH_ADDRESS, 0}},
{{"_MTP", WIDTH_2, 0}},
{{"_RBO", WIDTH_8, 0}},
{{"_RBW", WIDTH_8, 0}},
{{"_RNG", WIDTH_1, 0}},
{{"_RW_", WIDTH_1, 0}},
{{"_SHR", WIDTH_2, 0}},
{{"_SIZ", WIDTH_2, 0}},
{{"_TRA", WIDTH_ADDRESS, 0}},
{{"_TRS", WIDTH_1, 0}},
{{"_TTP", WIDTH_1, 0}},
PACKAGE_INFO (0,0,0,0,0,0) /* Table terminator */
};
static const ACPI_PREDEFINED_INFO AcpiGbl_ScopeNames[] = {
{{"_GPE", 0, 0}},
{{"_PR_", 0, 0}},
{{"_SB_", 0, 0}},
{{"_SI_", 0, 0}},
{{"_TZ_", 0, 0}},
PACKAGE_INFO (0,0,0,0,0,0) /* Table terminator */
};
#else
extern const ACPI_PREDEFINED_INFO AcpiGbl_ResourceNames[];
#endif
#endif