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