aslglobal.h revision 202771
1118611Snjl
2118611Snjl
3118611Snjl/******************************************************************************
4118611Snjl *
5118611Snjl * Module Name: aslglobal.h - Global variable definitions
6118611Snjl *
7118611Snjl *****************************************************************************/
8118611Snjl
9118611Snjl/******************************************************************************
10118611Snjl *
11118611Snjl * 1. Copyright Notice
12118611Snjl *
13202771Sjkim * Some or all of this work - Copyright (c) 1999 - 2010, Intel Corp.
14118611Snjl * All rights reserved.
15118611Snjl *
16118611Snjl * 2. License
17118611Snjl *
18118611Snjl * 2.1. This is your license from Intel Corp. under its intellectual property
19118611Snjl * rights.  You may have additional license terms from the party that provided
20118611Snjl * you this software, covering your right to use that party's intellectual
21118611Snjl * property rights.
22118611Snjl *
23118611Snjl * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
24118611Snjl * copy of the source code appearing in this file ("Covered Code") an
25118611Snjl * irrevocable, perpetual, worldwide license under Intel's copyrights in the
26118611Snjl * base code distributed originally by Intel ("Original Intel Code") to copy,
27118611Snjl * make derivatives, distribute, use and display any portion of the Covered
28118611Snjl * Code in any form, with the right to sublicense such rights; and
29118611Snjl *
30118611Snjl * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
31118611Snjl * license (with the right to sublicense), under only those claims of Intel
32118611Snjl * patents that are infringed by the Original Intel Code, to make, use, sell,
33118611Snjl * offer to sell, and import the Covered Code and derivative works thereof
34118611Snjl * solely to the minimum extent necessary to exercise the above copyright
35118611Snjl * license, and in no event shall the patent license extend to any additions
36118611Snjl * to or modifications of the Original Intel Code.  No other license or right
37118611Snjl * is granted directly or by implication, estoppel or otherwise;
38118611Snjl *
39118611Snjl * The above copyright and patent license is granted only if the following
40118611Snjl * conditions are met:
41118611Snjl *
42118611Snjl * 3. Conditions
43118611Snjl *
44118611Snjl * 3.1. Redistribution of Source with Rights to Further Distribute Source.
45118611Snjl * Redistribution of source code of any substantial portion of the Covered
46118611Snjl * Code or modification with rights to further distribute source must include
47118611Snjl * the above Copyright Notice, the above License, this list of Conditions,
48118611Snjl * and the following Disclaimer and Export Compliance provision.  In addition,
49118611Snjl * Licensee must cause all Covered Code to which Licensee contributes to
50118611Snjl * contain a file documenting the changes Licensee made to create that Covered
51118611Snjl * Code and the date of any change.  Licensee must include in that file the
52118611Snjl * documentation of any changes made by any predecessor Licensee.  Licensee
53118611Snjl * must include a prominent statement that the modification is derived,
54118611Snjl * directly or indirectly, from Original Intel Code.
55118611Snjl *
56118611Snjl * 3.2. Redistribution of Source with no Rights to Further Distribute Source.
57118611Snjl * Redistribution of source code of any substantial portion of the Covered
58118611Snjl * Code or modification without rights to further distribute source must
59118611Snjl * include the following Disclaimer and Export Compliance provision in the
60118611Snjl * documentation and/or other materials provided with distribution.  In
61118611Snjl * addition, Licensee may not authorize further sublicense of source of any
62118611Snjl * portion of the Covered Code, and must include terms to the effect that the
63118611Snjl * license from Licensee to its licensee is limited to the intellectual
64118611Snjl * property embodied in the software Licensee provides to its licensee, and
65118611Snjl * not to intellectual property embodied in modifications its licensee may
66118611Snjl * make.
67118611Snjl *
68118611Snjl * 3.3. Redistribution of Executable. Redistribution in executable form of any
69118611Snjl * substantial portion of the Covered Code or modification must reproduce the
70118611Snjl * above Copyright Notice, and the following Disclaimer and Export Compliance
71118611Snjl * provision in the documentation and/or other materials provided with the
72118611Snjl * distribution.
73118611Snjl *
74118611Snjl * 3.4. Intel retains all right, title, and interest in and to the Original
75118611Snjl * Intel Code.
76118611Snjl *
77118611Snjl * 3.5. Neither the name Intel nor any other trademark owned or controlled by
78118611Snjl * Intel shall be used in advertising or otherwise to promote the sale, use or
79118611Snjl * other dealings in products derived from or relating to the Covered Code
80118611Snjl * without prior written authorization from Intel.
81118611Snjl *
82118611Snjl * 4. Disclaimer and Export Compliance
83118611Snjl *
84118611Snjl * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
85118611Snjl * HERE.  ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
86118611Snjl * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT,  ASSISTANCE,
87118611Snjl * INSTALLATION, TRAINING OR OTHER SERVICES.  INTEL WILL NOT PROVIDE ANY
88118611Snjl * UPDATES, ENHANCEMENTS OR EXTENSIONS.  INTEL SPECIFICALLY DISCLAIMS ANY
89118611Snjl * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
90118611Snjl * PARTICULAR PURPOSE.
91118611Snjl *
92118611Snjl * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
93118611Snjl * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
94118611Snjl * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
95118611Snjl * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
96118611Snjl * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
97118611Snjl * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES.  THESE LIMITATIONS
98118611Snjl * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
99118611Snjl * LIMITED REMEDY.
100118611Snjl *
101118611Snjl * 4.3. Licensee shall not export, either directly or indirectly, any of this
102118611Snjl * software or system incorporating such software without first obtaining any
103118611Snjl * required license or other approval from the U. S. Department of Commerce or
104118611Snjl * any other agency or department of the United States Government.  In the
105118611Snjl * event Licensee exports any such software from the United States or
106118611Snjl * re-exports any such software from a foreign destination, Licensee shall
107118611Snjl * ensure that the distribution and export/re-export of the software is in
108118611Snjl * compliance with all laws, regulations, orders, or other restrictions of the
109118611Snjl * U.S. Export Administration Regulations. Licensee agrees that neither it nor
110118611Snjl * any of its subsidiaries will export/re-export any technical data, process,
111118611Snjl * software, or service, directly or indirectly, to any country for which the
112118611Snjl * United States government or any agency thereof requires an export license,
113118611Snjl * other governmental approval, or letter of assurance, without first obtaining
114118611Snjl * such license, approval or letter.
115118611Snjl *
116118611Snjl *****************************************************************************/
117118611Snjl
118118611Snjl
119118611Snjl#ifndef __ASLGLOBAL_H
120118611Snjl#define __ASLGLOBAL_H
121118611Snjl
122118611Snjl
123118611Snjl/*
124118611Snjl * Global variables.  Defined in aslmain.c only, externed in all other files
125118611Snjl */
126118611Snjl
127151937Sjkim#undef ASL_EXTERN
128151937Sjkim
129118611Snjl#ifdef _DECLARE_GLOBALS
130118611Snjl#define ASL_EXTERN
131118611Snjl#define ASL_INIT_GLOBAL(a,b)        (a)=(b)
132118611Snjl#else
133118611Snjl#define ASL_EXTERN                  extern
134118611Snjl#define ASL_INIT_GLOBAL(a,b)        (a)
135118611Snjl#endif
136118611Snjl
137118611Snjl
138118611Snjl/*
139118611Snjl * Parser and other externals
140118611Snjl */
141118611Snjlextern int                          yydebug;
142118611Snjlextern FILE                         *AslCompilerin;
143118611Snjlextern int                          AslCompilerdebug;
144118611Snjlextern const ASL_MAPPING_ENTRY      AslKeywordMapping[];
145118611Snjlextern char                         *AslCompilertext;
146193529Sjkimextern char                         HexLookup[];
147118611Snjl
148118611Snjl#define ASL_LINE_BUFFER_SIZE        512
149167802Sjkim#define ASL_MSG_BUFFER_SIZE         4096
150118611Snjl#define HEX_TABLE_LINE_SIZE         8
151197104Sjkim#define HEX_LISTING_LINE_SIZE       8
152118611Snjl
153118611Snjl
154118611Snjl/* Source code buffers and pointers for error reporting */
155118611Snjl
156118611SnjlASL_EXTERN char                     Gbl_CurrentLineBuffer[ASL_LINE_BUFFER_SIZE];
157118611SnjlASL_EXTERN UINT32                   ASL_INIT_GLOBAL (Gbl_CurrentColumn, 0);
158118611SnjlASL_EXTERN UINT32                   ASL_INIT_GLOBAL (Gbl_CurrentLineNumber, 1);
159118611SnjlASL_EXTERN UINT32                   ASL_INIT_GLOBAL (Gbl_LogicalLineNumber, 1);
160118611SnjlASL_EXTERN UINT32                   ASL_INIT_GLOBAL (Gbl_CurrentLineOffset, 0);
161118611SnjlASL_EXTERN char                     ASL_INIT_GLOBAL (*Gbl_LineBufPtr, Gbl_CurrentLineBuffer);
162118611Snjl
163118611Snjl
164118611Snjl/* Exception reporting */
165118611Snjl
166118611SnjlASL_EXTERN ASL_ERROR_MSG            ASL_INIT_GLOBAL (*Gbl_ErrorLog,NULL);
167118611SnjlASL_EXTERN ASL_ERROR_MSG            ASL_INIT_GLOBAL (*Gbl_NextError,NULL);
168118611Snjl
169118611Snjl
170118611Snjl/* Option flags */
171118611Snjl
172193529SjkimASL_EXTERN BOOLEAN                  ASL_INIT_GLOBAL (Gbl_DoCompile, TRUE);
173193529SjkimASL_EXTERN BOOLEAN                  ASL_INIT_GLOBAL (Gbl_DoSignon, TRUE);
174193529Sjkim
175151937SjkimASL_EXTERN BOOLEAN                  ASL_INIT_GLOBAL (Gbl_Acpi2, FALSE);
176118611SnjlASL_EXTERN BOOLEAN                  ASL_INIT_GLOBAL (Gbl_UseDefaultAmlFilename, TRUE);
177118611SnjlASL_EXTERN BOOLEAN                  ASL_INIT_GLOBAL (Gbl_NsOutputFlag, FALSE);
178118611SnjlASL_EXTERN BOOLEAN                  ASL_INIT_GLOBAL (Gbl_DebugFlag, FALSE);
179118611SnjlASL_EXTERN BOOLEAN                  ASL_INIT_GLOBAL (Gbl_AsmOutputFlag, FALSE);
180118611SnjlASL_EXTERN BOOLEAN                  ASL_INIT_GLOBAL (Gbl_C_OutputFlag, FALSE);
181118611SnjlASL_EXTERN BOOLEAN                  ASL_INIT_GLOBAL (Gbl_AsmIncludeOutputFlag, FALSE);
182118611SnjlASL_EXTERN BOOLEAN                  ASL_INIT_GLOBAL (Gbl_C_IncludeOutputFlag, FALSE);
183118611SnjlASL_EXTERN BOOLEAN                  ASL_INIT_GLOBAL (Gbl_ListingFlag, FALSE);
184118611SnjlASL_EXTERN BOOLEAN                  ASL_INIT_GLOBAL (Gbl_IgnoreErrors, FALSE);
185118611SnjlASL_EXTERN BOOLEAN                  ASL_INIT_GLOBAL (Gbl_SourceOutputFlag, FALSE);
186118611SnjlASL_EXTERN BOOLEAN                  ASL_INIT_GLOBAL (Gbl_ParseOnlyFlag, FALSE);
187118611SnjlASL_EXTERN BOOLEAN                  ASL_INIT_GLOBAL (Gbl_CompileTimesFlag, FALSE);
188118611SnjlASL_EXTERN BOOLEAN                  ASL_INIT_GLOBAL (Gbl_FoldConstants, TRUE);
189118611SnjlASL_EXTERN BOOLEAN                  ASL_INIT_GLOBAL (Gbl_VerboseErrors, TRUE);
190193529SjkimASL_EXTERN BOOLEAN                  ASL_INIT_GLOBAL (Gbl_NoErrors, FALSE);
191118611SnjlASL_EXTERN BOOLEAN                  ASL_INIT_GLOBAL (Gbl_DisasmFlag, FALSE);
192118611SnjlASL_EXTERN BOOLEAN                  ASL_INIT_GLOBAL (Gbl_GetAllTables, FALSE);
193118611SnjlASL_EXTERN BOOLEAN                  ASL_INIT_GLOBAL (Gbl_IntegerOptimizationFlag, TRUE);
194118611SnjlASL_EXTERN BOOLEAN                  ASL_INIT_GLOBAL (Gbl_ReferenceOptimizationFlag, TRUE);
195118611SnjlASL_EXTERN BOOLEAN                  ASL_INIT_GLOBAL (Gbl_DisplayRemarks, TRUE);
196118611SnjlASL_EXTERN BOOLEAN                  ASL_INIT_GLOBAL (Gbl_DisplayOptimizations, FALSE);
197167802SjkimASL_EXTERN UINT8                    ASL_INIT_GLOBAL (Gbl_WarningLevel, ASL_WARNING);
198118611Snjl
199167802Sjkim
200118611Snjl#define HEX_OUTPUT_NONE         0
201118611Snjl#define HEX_OUTPUT_C            1
202118611Snjl#define HEX_OUTPUT_ASM          2
203118611SnjlASL_EXTERN BOOLEAN                  ASL_INIT_GLOBAL (Gbl_HexOutputFlag, HEX_OUTPUT_NONE);
204118611Snjl
205118611Snjl
206118611Snjl/* Files */
207118611Snjl
208118611SnjlASL_EXTERN ASL_FILE_INFO            Gbl_Files [ASL_NUM_FILES];
209118611Snjl
210118611SnjlASL_EXTERN char                     *Gbl_DirectoryPath;
211167802SjkimASL_EXTERN char                     ASL_INIT_GLOBAL (*Gbl_ExternalFilename, NULL);
212118611SnjlASL_EXTERN char                     ASL_INIT_GLOBAL (*Gbl_IncludeFilename, NULL);
213118611SnjlASL_EXTERN char                     ASL_INIT_GLOBAL (*Gbl_OutputFilenamePrefix, NULL);
214197104SjkimASL_EXTERN ASL_INCLUDE_DIR          ASL_INIT_GLOBAL (*Gbl_IncludeDirList, NULL);
215118611SnjlASL_EXTERN char                     *Gbl_CurrentInputFilename;
216118611Snjl
217118611SnjlASL_EXTERN BOOLEAN                  ASL_INIT_GLOBAL (Gbl_HasIncludeFiles, FALSE);
218118611Snjl
219118611Snjl
220118611Snjl/* Statistics */
221118611Snjl
222118611SnjlASL_EXTERN UINT32                   ASL_INIT_GLOBAL (Gbl_InputByteCount, 0);
223118611SnjlASL_EXTERN UINT32                   ASL_INIT_GLOBAL (Gbl_NsLookupCount, 0);
224118611SnjlASL_EXTERN UINT32                   ASL_INIT_GLOBAL (TotalKeywords, 0);
225118611SnjlASL_EXTERN UINT32                   ASL_INIT_GLOBAL (TotalNamedObjects, 0);
226118611SnjlASL_EXTERN UINT32                   ASL_INIT_GLOBAL (TotalExecutableOpcodes, 0);
227118611SnjlASL_EXTERN UINT32                   ASL_INIT_GLOBAL (TotalParseNodes, 0);
228118611SnjlASL_EXTERN UINT32                   ASL_INIT_GLOBAL (TotalMethods, 0);
229118611SnjlASL_EXTERN UINT32                   ASL_INIT_GLOBAL (TotalAllocations, 0);
230118611SnjlASL_EXTERN UINT32                   ASL_INIT_GLOBAL (TotalAllocated, 0);
231118611SnjlASL_EXTERN UINT32                   ASL_INIT_GLOBAL (TotalFolds, 0);
232118611Snjl
233118611Snjl
234118611Snjl/* Misc */
235118611Snjl
236138287SmarksASL_EXTERN UINT8                    ASL_INIT_GLOBAL (Gbl_RevisionOverride, 0);
237151937SjkimASL_EXTERN UINT8                    ASL_INIT_GLOBAL (Gbl_TempCount, 0);
238118611SnjlASL_EXTERN ACPI_PARSE_OBJECT        ASL_INIT_GLOBAL (*RootNode, NULL);
239118611SnjlASL_EXTERN UINT32                   ASL_INIT_GLOBAL (Gbl_TableLength, 0);
240118611SnjlASL_EXTERN UINT32                   ASL_INIT_GLOBAL (Gbl_SourceLine, 0);
241118611SnjlASL_EXTERN ASL_LISTING_NODE         ASL_INIT_GLOBAL (*Gbl_ListingNode, NULL);
242118611SnjlASL_EXTERN ACPI_PARSE_OBJECT        ASL_INIT_GLOBAL (*Gbl_NodeCacheNext, NULL);
243118611SnjlASL_EXTERN ACPI_PARSE_OBJECT        ASL_INIT_GLOBAL (*Gbl_NodeCacheLast, NULL);
244118611SnjlASL_EXTERN char                     ASL_INIT_GLOBAL (*Gbl_StringCacheNext, NULL);
245118611SnjlASL_EXTERN char                     ASL_INIT_GLOBAL (*Gbl_StringCacheLast, NULL);
246118611SnjlASL_EXTERN ACPI_PARSE_OBJECT        *Gbl_FirstLevelInsertionNode;
247118611Snjl
248118611Snjl
249118611SnjlASL_EXTERN UINT32                   ASL_INIT_GLOBAL (Gbl_CurrentHexColumn, 0);
250118611SnjlASL_EXTERN UINT32                   ASL_INIT_GLOBAL (Gbl_CurrentAmlOffset, 0);
251118611SnjlASL_EXTERN UINT32                   ASL_INIT_GLOBAL (Gbl_CurrentLine, 0);
252118611SnjlASL_EXTERN UINT8                    ASL_INIT_GLOBAL (Gbl_HexBytesWereWritten, FALSE);
253118611SnjlASL_EXTERN UINT32                   ASL_INIT_GLOBAL (Gbl_NumNamespaceObjects, 0);
254118611SnjlASL_EXTERN UINT32                   ASL_INIT_GLOBAL (Gbl_ReservedMethods, 0);
255118611SnjlASL_EXTERN char                     ASL_INIT_GLOBAL (*Gbl_TableSignature, "NO_SIG");
256118611SnjlASL_EXTERN char                     ASL_INIT_GLOBAL (*Gbl_TableId, "NO_ID");
257118611SnjlASL_EXTERN FILE                     *AcpiGbl_DebugFile; /* Placeholder for oswinxf only */
258118611Snjl
259118611Snjl
260118611Snjl/* Static structures */
261118611Snjl
262118611SnjlASL_EXTERN ASL_ANALYSIS_WALK_INFO   AnalysisWalkInfo;
263118611SnjlASL_EXTERN ACPI_TABLE_HEADER        TableHeader;
264118611Snjlextern const ASL_RESERVED_INFO      ReservedMethods[];
265118611Snjl
266151937Sjkim/* Event timing */
267118611Snjl
268151937Sjkim#define ASL_NUM_EVENTS              19
269151937SjkimASL_EXTERN ASL_EVENT_INFO           AslGbl_Events[ASL_NUM_EVENTS];
270151937SjkimASL_EXTERN UINT8                    AslGbl_NextEvent;
271151937SjkimASL_EXTERN UINT8                    AslGbl_NamespaceEvent;
272151937Sjkim
273118611Snjl/* Scratch buffers */
274118611Snjl
275118611SnjlASL_EXTERN UINT8                    Gbl_AmlBuffer[HEX_LISTING_LINE_SIZE];
276118611SnjlASL_EXTERN char                     MsgBuffer[ASL_MSG_BUFFER_SIZE];
277118611SnjlASL_EXTERN char                     StringBuffer[ASL_MSG_BUFFER_SIZE];
278118611SnjlASL_EXTERN char                     StringBuffer2[ASL_MSG_BUFFER_SIZE];
279118611Snjl
280202771Sjkim
281202771Sjkim#ifdef _DECLARE_GLOBALS
282202771SjkimUINT32                              Gbl_ExceptionCount[ASL_NUM_REPORT_LEVELS] = {0,0,0,0,0,0};
283202771Sjkim#else
284202771Sjkimextern UINT32                       Gbl_ExceptionCount[ASL_NUM_REPORT_LEVELS];
285202771Sjkim#endif
286202771Sjkim
287118611Snjl#endif /* __ASLGLOBAL_H */
288118611Snjl
289