aslglobal.h revision 210976
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 148209746Sjkim#define ASL_LINE_BUFFER_SIZE 1024 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); 174210976SjkimASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_DisassembleAll, FALSE); 175193529Sjkim 176151937SjkimASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_Acpi2, FALSE); 177118611SnjlASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_UseDefaultAmlFilename, TRUE); 178118611SnjlASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_NsOutputFlag, FALSE); 179118611SnjlASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_DebugFlag, FALSE); 180118611SnjlASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_AsmOutputFlag, FALSE); 181118611SnjlASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_C_OutputFlag, FALSE); 182118611SnjlASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_AsmIncludeOutputFlag, FALSE); 183118611SnjlASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_C_IncludeOutputFlag, FALSE); 184118611SnjlASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_ListingFlag, FALSE); 185118611SnjlASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_IgnoreErrors, FALSE); 186118611SnjlASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_SourceOutputFlag, FALSE); 187118611SnjlASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_ParseOnlyFlag, FALSE); 188118611SnjlASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_CompileTimesFlag, FALSE); 189118611SnjlASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_FoldConstants, TRUE); 190118611SnjlASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_VerboseErrors, TRUE); 191193529SjkimASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_NoErrors, FALSE); 192207344SjkimASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_NoResourceChecking, FALSE); 193118611SnjlASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_DisasmFlag, FALSE); 194118611SnjlASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_GetAllTables, FALSE); 195118611SnjlASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_IntegerOptimizationFlag, TRUE); 196118611SnjlASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_ReferenceOptimizationFlag, TRUE); 197118611SnjlASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_DisplayRemarks, TRUE); 198118611SnjlASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_DisplayOptimizations, FALSE); 199167802SjkimASL_EXTERN UINT8 ASL_INIT_GLOBAL (Gbl_WarningLevel, ASL_WARNING); 200209746SjkimASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_UseOriginalCompilerId, FALSE); 201209746SjkimASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_VerboseTemplates, FALSE); 202209746SjkimASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_DoTemplates, FALSE); 203118611Snjl 204167802Sjkim 205118611Snjl#define HEX_OUTPUT_NONE 0 206118611Snjl#define HEX_OUTPUT_C 1 207118611Snjl#define HEX_OUTPUT_ASM 2 208207344Sjkim#define HEX_OUTPUT_ASL 3 209207344Sjkim 210118611SnjlASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_HexOutputFlag, HEX_OUTPUT_NONE); 211118611Snjl 212118611Snjl 213118611Snjl/* Files */ 214118611Snjl 215118611SnjlASL_EXTERN ASL_FILE_INFO Gbl_Files [ASL_NUM_FILES]; 216118611Snjl 217118611SnjlASL_EXTERN char *Gbl_DirectoryPath; 218118611SnjlASL_EXTERN char ASL_INIT_GLOBAL (*Gbl_IncludeFilename, NULL); 219118611SnjlASL_EXTERN char ASL_INIT_GLOBAL (*Gbl_OutputFilenamePrefix, NULL); 220197104SjkimASL_EXTERN ASL_INCLUDE_DIR ASL_INIT_GLOBAL (*Gbl_IncludeDirList, NULL); 221118611SnjlASL_EXTERN char *Gbl_CurrentInputFilename; 222118611Snjl 223118611SnjlASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_HasIncludeFiles, FALSE); 224118611Snjl 225118611Snjl 226118611Snjl/* Statistics */ 227118611Snjl 228118611SnjlASL_EXTERN UINT32 ASL_INIT_GLOBAL (Gbl_InputByteCount, 0); 229209746SjkimASL_EXTERN UINT32 ASL_INIT_GLOBAL (Gbl_InputFieldCount, 0); 230118611SnjlASL_EXTERN UINT32 ASL_INIT_GLOBAL (Gbl_NsLookupCount, 0); 231118611SnjlASL_EXTERN UINT32 ASL_INIT_GLOBAL (TotalKeywords, 0); 232118611SnjlASL_EXTERN UINT32 ASL_INIT_GLOBAL (TotalNamedObjects, 0); 233118611SnjlASL_EXTERN UINT32 ASL_INIT_GLOBAL (TotalExecutableOpcodes, 0); 234118611SnjlASL_EXTERN UINT32 ASL_INIT_GLOBAL (TotalParseNodes, 0); 235118611SnjlASL_EXTERN UINT32 ASL_INIT_GLOBAL (TotalMethods, 0); 236118611SnjlASL_EXTERN UINT32 ASL_INIT_GLOBAL (TotalAllocations, 0); 237118611SnjlASL_EXTERN UINT32 ASL_INIT_GLOBAL (TotalAllocated, 0); 238118611SnjlASL_EXTERN UINT32 ASL_INIT_GLOBAL (TotalFolds, 0); 239118611Snjl 240118611Snjl 241118611Snjl/* Misc */ 242118611Snjl 243138287SmarksASL_EXTERN UINT8 ASL_INIT_GLOBAL (Gbl_RevisionOverride, 0); 244151937SjkimASL_EXTERN UINT8 ASL_INIT_GLOBAL (Gbl_TempCount, 0); 245118611SnjlASL_EXTERN ACPI_PARSE_OBJECT ASL_INIT_GLOBAL (*RootNode, NULL); 246118611SnjlASL_EXTERN UINT32 ASL_INIT_GLOBAL (Gbl_TableLength, 0); 247118611SnjlASL_EXTERN UINT32 ASL_INIT_GLOBAL (Gbl_SourceLine, 0); 248118611SnjlASL_EXTERN ASL_LISTING_NODE ASL_INIT_GLOBAL (*Gbl_ListingNode, NULL); 249118611SnjlASL_EXTERN ACPI_PARSE_OBJECT ASL_INIT_GLOBAL (*Gbl_NodeCacheNext, NULL); 250118611SnjlASL_EXTERN ACPI_PARSE_OBJECT ASL_INIT_GLOBAL (*Gbl_NodeCacheLast, NULL); 251118611SnjlASL_EXTERN char ASL_INIT_GLOBAL (*Gbl_StringCacheNext, NULL); 252118611SnjlASL_EXTERN char ASL_INIT_GLOBAL (*Gbl_StringCacheLast, NULL); 253118611SnjlASL_EXTERN ACPI_PARSE_OBJECT *Gbl_FirstLevelInsertionNode; 254209746SjkimASL_EXTERN UINT8 ASL_INIT_GLOBAL (Gbl_FileType, 0); 255209746SjkimASL_EXTERN char ASL_INIT_GLOBAL (*Gbl_Signature, NULL); 256209746SjkimASL_EXTERN char *Gbl_TemplateSignature; 257118611Snjl 258118611SnjlASL_EXTERN UINT32 ASL_INIT_GLOBAL (Gbl_CurrentHexColumn, 0); 259118611SnjlASL_EXTERN UINT32 ASL_INIT_GLOBAL (Gbl_CurrentAmlOffset, 0); 260118611SnjlASL_EXTERN UINT32 ASL_INIT_GLOBAL (Gbl_CurrentLine, 0); 261118611SnjlASL_EXTERN UINT8 ASL_INIT_GLOBAL (Gbl_HexBytesWereWritten, FALSE); 262118611SnjlASL_EXTERN UINT32 ASL_INIT_GLOBAL (Gbl_NumNamespaceObjects, 0); 263118611SnjlASL_EXTERN UINT32 ASL_INIT_GLOBAL (Gbl_ReservedMethods, 0); 264118611SnjlASL_EXTERN char ASL_INIT_GLOBAL (*Gbl_TableSignature, "NO_SIG"); 265118611SnjlASL_EXTERN char ASL_INIT_GLOBAL (*Gbl_TableId, "NO_ID"); 266118611SnjlASL_EXTERN FILE *AcpiGbl_DebugFile; /* Placeholder for oswinxf only */ 267118611Snjl 268118611Snjl 269118611Snjl/* Static structures */ 270118611Snjl 271118611SnjlASL_EXTERN ASL_ANALYSIS_WALK_INFO AnalysisWalkInfo; 272118611SnjlASL_EXTERN ACPI_TABLE_HEADER TableHeader; 273118611Snjl 274151937Sjkim/* Event timing */ 275118611Snjl 276151937Sjkim#define ASL_NUM_EVENTS 19 277151937SjkimASL_EXTERN ASL_EVENT_INFO AslGbl_Events[ASL_NUM_EVENTS]; 278151937SjkimASL_EXTERN UINT8 AslGbl_NextEvent; 279151937SjkimASL_EXTERN UINT8 AslGbl_NamespaceEvent; 280151937Sjkim 281118611Snjl/* Scratch buffers */ 282118611Snjl 283118611SnjlASL_EXTERN UINT8 Gbl_AmlBuffer[HEX_LISTING_LINE_SIZE]; 284118611SnjlASL_EXTERN char MsgBuffer[ASL_MSG_BUFFER_SIZE]; 285118611SnjlASL_EXTERN char StringBuffer[ASL_MSG_BUFFER_SIZE]; 286118611SnjlASL_EXTERN char StringBuffer2[ASL_MSG_BUFFER_SIZE]; 287118611Snjl 288202771Sjkim 289202771Sjkim#ifdef _DECLARE_GLOBALS 290202771SjkimUINT32 Gbl_ExceptionCount[ASL_NUM_REPORT_LEVELS] = {0,0,0,0,0,0}; 291202771Sjkim#else 292202771Sjkimextern UINT32 Gbl_ExceptionCount[ASL_NUM_REPORT_LEVELS]; 293202771Sjkim#endif 294202771Sjkim 295118611Snjl#endif /* __ASLGLOBAL_H */ 296118611Snjl 297