ahaslkey.c revision 1.1.1.6
1/******************************************************************************
2 *
3 * Module Name: ahaslkey - Table of all known ASL non-operator keywords and
4 *                         table of iASL Preprocessor directives
5 *
6 *****************************************************************************/
7
8/*
9 * Copyright (C) 2000 - 2016, Intel Corp.
10 * All rights reserved.
11 *
12 * Redistribution and use in source and binary forms, with or without
13 * modification, are permitted provided that the following conditions
14 * are met:
15 * 1. Redistributions of source code must retain the above copyright
16 *    notice, this list of conditions, and the following disclaimer,
17 *    without modification.
18 * 2. Redistributions in binary form must reproduce at minimum a disclaimer
19 *    substantially similar to the "NO WARRANTY" disclaimer below
20 *    ("Disclaimer") and any redistribution must be conditioned upon
21 *    including a substantially similar Disclaimer requirement for further
22 *    binary redistribution.
23 * 3. Neither the names of the above-listed copyright holders nor the names
24 *    of any contributors may be used to endorse or promote products derived
25 *    from this software without specific prior written permission.
26 *
27 * Alternatively, this software may be distributed under the terms of the
28 * GNU General Public License ("GPL") version 2 as published by the Free
29 * Software Foundation.
30 *
31 * NO WARRANTY
32 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
33 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
34 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
35 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
36 * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
37 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
38 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
39 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
40 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
41 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
42 * POSSIBILITY OF SUCH DAMAGES.
43 */
44
45#include "acpihelp.h"
46
47/*
48 * ASL Keyword types and associated actual keywords.
49 * This table was extracted from the ACPI specification.
50 */
51const AH_ASL_KEYWORD        AslKeywordInfo[] =
52{
53    {"AccessAttribKeyword", "Serial Bus Attributes (with legacy SMBus aliases)",
54        ":= AttribQuick (SMBusQuick) | AttribSendReceive (SMBusSendReceive) | "
55        "AttribByte (SMBusByte) | AttribWord (SMBusWord) | "
56        "AttribBlock (SMBusBlock) | AttribProcessCall (SMBusProcessCall) | "
57        "AttribBlockProcessCall (SMBusProcessCall)"},
58    {"AccessTypeKeyword", "Field Access Types",
59        ":= AnyAcc | ByteAcc | WordAcc | DWordAcc | QWordAcc | BufferAcc"},
60    {"AddressingModeKeyword", "Mode - Resource Descriptors",
61        ":= AddressingMode7Bit | AddressingMode10Bit"},
62    {"AddressKeyword", "ACPI memory range types",
63        ":= AddressRangeMemory | AddressRangeReserved | "
64        "AddressRangeNVS | AddressRangeACPI"},
65    {"AddressSpaceKeyword", "Operation Region Address Space Types",
66        ":= RegionSpaceKeyword | FFixedHW"},
67    {"BusMasterKeyword", "DMA Bus Mastering",
68        ":= BusMaster | NotBusMaster"},
69    {"ByteLengthKeyword", "Bits per Byte - Resource Descriptors",
70        ":= DataBitsFive | DataBitsSix | DataBitsSeven | DataBitsEight | DataBitsNine"},
71    {"ClockPhaseKeyword", "Resource Descriptors",
72        ":= ClockPhaseFirst | ClockPhaseSecond"},
73    {"ClockPolarityKeyword", "Resource Descriptors",
74        ":= ClockPolarityLow | ClockPolarityHigh"},
75    {"DecodeKeyword", "Type of Memory Decoding - Resource Descriptors",
76        ":= SubDecode | PosDecode"},
77    {"DmaTypeKeyword", "DMA Types - DMA Resource Descriptor",
78        ":= Compatibility | TypeA | TypeB | TypeF"},
79    {"EndianKeyword", "Endian type - Resource Descriptor",
80        ":= BigEndian | LittleEndian"},
81    {"ExtendedAttribKeyword", "Extended Bus Attributes",
82        ":= AttribBytes (AccessLength) | AttribRawBytes (AccessLength) | "
83        "AttribRawProcessBytes (AccessLength)"},
84    {"FlowControlKeyword", "Resource Descriptor",
85        ":= FlowControlNone | FlowControlXon | FlowControlHardware"},
86    {"InterruptLevelKeyword", "Interrupt Active Types",
87        ":= ActiveHigh | ActiveLow | ActiveBoth"},
88    {"InterruptTypeKeyword", "Interrupt Types",
89        ":= Edge | Level"},
90    {"IoDecodeKeyword", "I/O Decoding - IO Resource Descriptor",
91        ":= Decode16 | Decode10"},
92    {"IoRestrictionKeyword", "I/O Restriction - GPIO Resource Descriptors",
93        ":= IoRestrictionNone | IoRestrictionInputOnly | "
94        "IoRestrictionOutputOnly | IoRestrictionNoneAndPreserve"},
95    {"LockRuleKeyword", "Global Lock use for Field Operator",
96        ":= Lock | NoLock"},
97    {"MatchOpKeyword", "Types for Match Operator",
98        ":= MTR | MEQ | MLE | MLT | MGE | MGT"},
99    {"MaxKeyword", "Max Range Type - Resource Descriptors",
100        ":= MaxFixed | MaxNotFixed"},
101    {"MemTypeKeyword", "Memory Types - Resource Descriptors",
102        ":= Cacheable | WriteCombining | Prefetchable | NonCacheable"},
103    {"MinKeyword", "Min Range Type - Resource Descriptors",
104        ":= MinFixed | MinNotFixed"},
105    {"ObjectTypeKeyword", "ACPI Object Types",
106        ":= UnknownObj | IntObj | StrObj | BuffObj | PkgObj | FieldUnitObj | "
107        "DeviceObj | EventObj | MethodObj | MutexObj | OpRegionObj | PowerResObj | "
108        "ProcessorObj | ThermalZoneObj | BuffFieldObj | DDBHandleObj"},
109    {"ParityKeyword", "Resource Descriptors",
110        ":= ParityTypeNone | ParityTypeSpace | ParityTypeMark | "
111        "ParityTypeOdd | ParityTypeEven"},
112    {"PinConfigKeyword", "Pin Configuration - GPIO Resource Descriptors",
113        ":= PullDefault | PullUp | PullDown | PullNone"},
114    {"PolarityKeyword", "Resource Descriptors",
115        ":= PolarityHigh | PolarityLow"},
116    {"RangeTypeKeyword", "I/O Range Types - Resource Descriptors",
117        ":= ISAOnlyRanges | NonISAOnlyRanges | EntireRange"},
118    {"ReadWriteKeyword", "Memory Access Types - Resource Descriptors",
119        ":= ReadWrite | ReadOnly"},
120    {"RegionSpaceKeyword", "Operation Region Address Space Types",
121        ":= UserDefRegionSpace | SystemIO | SystemMemory | PCI_Config | "
122        "EmbeddedControl | SMBus | SystemCMOS | PciBarTarget | IPMI | "
123        "GeneralPurposeIo, GenericSerialBus"},
124    {"ResourceTypeKeyword", "Resource Usage - Resource Descriptors",
125        ":= ResourceConsumer | ResourceProducer"},
126    {"SerializeRuleKeyword", "Control Method Serialization",
127        ":= Serialized | NotSerialized"},
128    {"ShareTypeKeyword", "Interrupt Sharing - Resource Descriptors",
129        ":= Shared | Exclusive | SharedAndWake | ExclusiveAndWake"},
130    {"SlaveModeKeyword", "Resource Descriptors",
131        ":= ControllerInitiated | DeviceInitiated"},
132    {"StopBitsKeyword", "Resource Descriptors",
133        ":= StopBitsZero | StopBitsOne | StopBitsOnePlusHalf | StopBitsTwo"},
134    {"TransferWidthKeyword", "DMA Widths - Fixed DMA Resource Descriptor",
135        ":= Width8bit | Width16bit | Width32bit | Width64bit | "
136        "Width128bit | Width256bit"},
137    {"TranslationKeyword", "Translation Density Types - Resource Descriptors",
138        ":= SparseTranslation | DenseTranslation"},
139    {"TypeKeyword", "Translation Types - Resource Descriptors",
140        ":= TypeTranslation | TypeStatic"},
141    {"UpdateRuleKeyword", "Field Update Rules",
142        ":= Preserve | WriteAsOnes | WriteAsZeros"},
143    {"UserDefRegionSpace", "User defined address spaces",
144        ":= IntegerData => 0x80 - 0xFF"},
145    {"WireModeKeyword", "SPI Wire Mode - Resource Descriptors",
146        ":= ThreeWireMode | FourWireMode"},
147    {"XferTypeKeyword", "DMA Transfer Types",
148        ":= Transfer8 | Transfer16 | Transfer8_16"},
149    {NULL, NULL, NULL}
150};
151
152/* Preprocessor directives */
153
154const AH_DIRECTIVE_INFO      PreprocessorDirectives[] =
155{
156    {"#include \"Filename\"",               "Standard include of an ASCII ASL source code file"},
157    {"#include <Filename>",                 "Alternate syntax for #include, alternate search path"},
158    {"#includebuffer \"Filename\" <Name>",  "Include a binary file to create AML Buffer with ASL namepath"},
159    {"#includebuffer <Filename> <Name>",    "Alternate syntax for #includebuffer, alternate search path"},
160
161    {"",  ""},
162    {"#define <Name>, <Defined name>",      "Simple macro definition (full macros not supported at this time)"},
163    {"#define <Expression>, <Defined name>","Simple macro definition (full macros not supported at this time)"},
164    {"#undef <Defined name>",               "Delete a previous #define"},
165
166    {"",  ""},
167    {"#if <Expression>",                    "Evaluate <Expression> and test return value"},
168    {"#ifdef <Defined name>",               "Test existence of the <Defined Name>"},
169    {"#ifndef <Defined name>",              "Test non-existence of the <Defined Name>"},
170    {"#elif <Expression>",                  "Else-If contraction - evaluate #if <Expression>, test return value"},
171    {"#else",                               "Execute alternate case for a previous #if, #ifdef or #ifndef block"},
172    {"#endif",                              "Close a previous #if, #ifdef or #ifndef block"},
173
174    {"",   ""},
175    {"#line <LineNumber> [Filename]",       "Set the current ASL source code line number, optional filename"},
176
177    {"",   ""},
178    {"#error \"String\"",                   "Emit error message and abort compilation"},
179    {"#warning \"String\"",                 "Emit an iASL warning at this location in the ASL source"},
180
181    {"",  ""},
182    {"#pragma disable (Error number)",      "Disable an iASL error or warning number"},
183    {"#pragma message \"String\"",          "Emit an informational message to the output file(s)"},
184
185    {"",  ""},
186    {"__FILE__",                            "Return the simple filename of the current ASL file"},
187    {"__PATH__",                            "Return the full pathname of the current ASL file"},
188    {"__LINE__",                            "Return the current line number within the current ASL file"},
189    {"__DATE__",                            "Return the current date"},
190    {"__IASL__",                            "Permanently defined for the iASL compiler"},
191    {NULL,                                   NULL}
192};
193