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 - 2015, 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  */
51 const 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 
154 const AH_DIRECTIVE_INFO      PreprocessorDirectives[] =
155 {
156     {"#define",         "OriginalName, DefinedName"},
157     {"#elif",           "Expression"},
158     {"#else",           ""},
159     {"#endif",          ""},
160     {"#error",          "Message"},
161     {"#if",             "Expression"},
162     {"#ifdef",          "DefinedName"},
163     {"#ifndef",         "DefinedName"},
164     {"#include",        "\"Filename\""},
165     {"#include",        "<Filename>"},
166     {"#includebuffer",  "\"Filename\""},
167     {"#includebuffer",  "<Filename>"},
168     {"#line",           ""},
169     {"#pragma",         "Disable error-number"},
170     {"#pragma",         "Message"},
171     {"#undef",          "DefinedName"},
172     {"#warning",        ""},
173     {"__DATE__",        "Returns current date"},
174     {"__FILE__",        "Returns name of current ASL file"},
175     {"__LINE__",        "Returns line number in ASL file"},
176     {"__PATH__",        "Returns full pathname of current ASL file"},
177     {NULL,              0}
178 };
179