asltypes.h revision 229989
1
2/******************************************************************************
3 *
4 * Module Name: asltypes.h - compiler data types and struct definitions
5 *
6 *****************************************************************************/
7
8/*
9 * Copyright (C) 2000 - 2012, 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
46#ifndef __ASLTYPES_H
47#define __ASLTYPES_H
48
49
50/*******************************************************************************
51 *
52 * Structure definitions
53 *
54 ******************************************************************************/
55
56
57/* Op flags for the ACPI_PARSE_OBJECT */
58
59#define NODE_VISITED                0x00000001
60#define NODE_AML_PACKAGE            0x00000002
61#define NODE_IS_TARGET              0x00000004
62#define NODE_IS_RESOURCE_DESC       0x00000008
63#define NODE_IS_RESOURCE_FIELD      0x00000010
64#define NODE_HAS_NO_EXIT            0x00000020
65#define NODE_IF_HAS_NO_EXIT         0x00000040
66#define NODE_NAME_INTERNALIZED      0x00000080
67#define NODE_METHOD_NO_RETVAL       0x00000100
68#define NODE_METHOD_SOME_NO_RETVAL  0x00000200
69#define NODE_RESULT_NOT_USED        0x00000400
70#define NODE_METHOD_TYPED           0x00000800
71#define NODE_UNUSED_FLAG            0x00001000
72#define NODE_COMPILE_TIME_CONST     0x00002000
73#define NODE_IS_TERM_ARG            0x00004000
74#define NODE_WAS_ONES_OP            0x00008000
75#define NODE_IS_NAME_DECLARATION    0x00010000
76#define NODE_COMPILER_EMITTED       0x00020000
77#define NODE_IS_DUPLICATE           0x00040000
78#define NODE_IS_RESOURCE_DATA       0x00080000
79#define NODE_IS_NULL_RETURN         0x00100000
80
81/* Keeps information about individual control methods */
82
83typedef struct asl_method_info
84{
85    UINT8                   NumArguments;
86    UINT8                   LocalInitialized[ACPI_METHOD_NUM_LOCALS];
87    UINT8                   ArgInitialized[ACPI_METHOD_NUM_ARGS];
88    UINT32                  ValidArgTypes[ACPI_METHOD_NUM_ARGS];
89    UINT32                  ValidReturnTypes;
90    UINT32                  NumReturnNoValue;
91    UINT32                  NumReturnWithValue;
92    ACPI_PARSE_OBJECT       *Op;
93    struct asl_method_info  *Next;
94    UINT8                   HasBeenTyped;
95
96} ASL_METHOD_INFO;
97
98
99/* Parse tree walk info for control method analysis */
100
101typedef struct asl_analysis_walk_info
102{
103    ASL_METHOD_INFO         *MethodStack;
104
105} ASL_ANALYSIS_WALK_INFO;
106
107
108/* An entry in the ParseOpcode to AmlOpcode mapping table */
109
110typedef struct asl_mapping_entry
111{
112    UINT32                      Value;
113    UINT32                      AcpiBtype;   /* Object type or return type */
114    UINT16                      AmlOpcode;
115    UINT8                       Flags;
116
117} ASL_MAPPING_ENTRY;
118
119
120/* Parse tree walk info structure */
121
122typedef struct asl_walk_info
123{
124    ACPI_PARSE_OBJECT           **NodePtr;
125    UINT32                      *LevelPtr;
126
127} ASL_WALK_INFO;
128
129
130/* File info */
131
132typedef struct asl_file_info
133{
134    FILE                        *Handle;
135    char                        *Filename;
136
137} ASL_FILE_INFO;
138
139typedef struct asl_file_status
140{
141    UINT32                  Line;
142    UINT32                  Offset;
143
144} ASL_FILE_STATUS;
145
146
147/*
148 * File types. Note: Any changes to this table must also be reflected
149 * in the AslFileTypeNames array.
150 */
151typedef enum
152{
153    ASL_FILE_STDOUT             = 0,
154    ASL_FILE_STDERR,
155    ASL_FILE_INPUT,
156    ASL_FILE_AML_OUTPUT,
157    ASL_FILE_SOURCE_OUTPUT,
158    ASL_FILE_LISTING_OUTPUT,
159    ASL_FILE_HEX_OUTPUT,
160    ASL_FILE_NAMESPACE_OUTPUT,
161    ASL_FILE_DEBUG_OUTPUT,
162    ASL_FILE_ASM_SOURCE_OUTPUT,
163    ASL_FILE_C_SOURCE_OUTPUT,
164    ASL_FILE_ASM_INCLUDE_OUTPUT,
165    ASL_FILE_C_INCLUDE_OUTPUT
166
167} ASL_FILE_TYPES;
168
169
170#define ASL_MAX_FILE_TYPE       12
171#define ASL_NUM_FILES           (ASL_MAX_FILE_TYPE + 1)
172
173
174typedef struct asl_include_dir
175{
176    char                        *Dir;
177    struct asl_include_dir      *Next;
178
179} ASL_INCLUDE_DIR;
180
181
182/* An entry in the exception list, one for each error/warning */
183
184typedef struct asl_error_msg
185{
186    UINT32                      LineNumber;
187    UINT32                      LogicalLineNumber;
188    UINT32                      LogicalByteOffset;
189    UINT32                      Column;
190    char                        *Message;
191    struct asl_error_msg        *Next;
192    char                        *Filename;
193    UINT32                      FilenameLength;
194    UINT8                       MessageId;
195    UINT8                       Level;
196
197} ASL_ERROR_MSG;
198
199
200/* An entry in the listing file stack (for include files) */
201
202typedef struct asl_listing_node
203{
204    char                        *Filename;
205    UINT32                      LineNumber;
206    struct asl_listing_node     *Next;
207
208} ASL_LISTING_NODE;
209
210
211/* Callback interface for a parse tree walk */
212
213/*
214 * TBD - another copy of this is in adisasm.h, fix
215 */
216#ifndef ASL_WALK_CALLBACK_DEFINED
217typedef
218ACPI_STATUS (*ASL_WALK_CALLBACK) (
219    ACPI_PARSE_OBJECT           *Op,
220    UINT32                      Level,
221    void                        *Context);
222#define ASL_WALK_CALLBACK_DEFINED
223#endif
224
225
226typedef struct asl_event_info
227{
228    UINT64                      StartTime;
229    UINT64                      EndTime;
230    char                        *EventName;
231    BOOLEAN                     Valid;
232
233} ASL_EVENT_INFO;
234
235
236#endif  /* __ASLTYPES_H */
237