aslglobal.h revision 233250
11283Ssundar 21365Ssundar 31283Ssundar/****************************************************************************** 41365Ssundar * 51283Ssundar * Module Name: aslglobal.h - Global variable definitions 61283Ssundar * 71283Ssundar *****************************************************************************/ 81365Ssundar 91283Ssundar/* 101283Ssundar * Copyright (C) 2000 - 2012, Intel Corp. 111283Ssundar * All rights reserved. 121283Ssundar * 131283Ssundar * Redistribution and use in source and binary forms, with or without 141365Ssundar * modification, are permitted provided that the following conditions 151283Ssundar * are met: 161283Ssundar * 1. Redistributions of source code must retain the above copyright 171283Ssundar * notice, this list of conditions, and the following disclaimer, 181365Ssundar * without modification. 191283Ssundar * 2. Redistributions in binary form must reproduce at minimum a disclaimer 201283Ssundar * substantially similar to the "NO WARRANTY" disclaimer below 211283Ssundar * ("Disclaimer") and any redistribution must be conditioned upon 221283Ssundar * including a substantially similar Disclaimer requirement for further 231283Ssundar * binary redistribution. 241283Ssundar * 3. Neither the names of the above-listed copyright holders nor the names 251283Ssundar * of any contributors may be used to endorse or promote products derived 261283Ssundar * from this software without specific prior written permission. 271283Ssundar * 281283Ssundar * Alternatively, this software may be distributed under the terms of the 291283Ssundar * GNU General Public License ("GPL") version 2 as published by the Free 301283Ssundar * Software Foundation. 311283Ssundar * 321283Ssundar * NO WARRANTY 331283Ssundar * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 341283Ssundar * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 351283Ssundar * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR 361283Ssundar * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 371283Ssundar * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 381283Ssundar * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 391283Ssundar * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 401283Ssundar * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 411283Ssundar * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 421283Ssundar * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 431283Ssundar * POSSIBILITY OF SUCH DAMAGES. 441283Ssundar */ 451283Ssundar 461283Ssundar 471283Ssundar#ifndef __ASLGLOBAL_H 481283Ssundar#define __ASLGLOBAL_H 491283Ssundar 501283Ssundar 511283Ssundar/* 521283Ssundar * Global variables. Defined in aslmain.c only, externed in all other files 531283Ssundar */ 541283Ssundar 551283Ssundar#undef ASL_EXTERN 561283Ssundar 571283Ssundar#ifdef _DECLARE_GLOBALS 581283Ssundar#define ASL_EXTERN 591283Ssundar#define ASL_INIT_GLOBAL(a,b) (a)=(b) 601283Ssundar#else 611283Ssundar#define ASL_EXTERN extern 621283Ssundar#define ASL_INIT_GLOBAL(a,b) (a) 631283Ssundar#endif 641283Ssundar 651283Ssundar 661283Ssundar/* 671283Ssundar * Parser and other externals 681283Ssundar */ 691283Ssundarextern int yydebug; 701283Ssundarextern FILE *AslCompilerin; 711283Ssundarextern int AslCompilerdebug; 721283Ssundarextern int DtParserdebug; 731283Ssundarextern int PrParserdebug; 741283Ssundarextern const ASL_MAPPING_ENTRY AslKeywordMapping[]; 751283Ssundarextern char *AslCompilertext; 761283Ssundar 771283Ssundar#define ASL_LINE_BUFFER_SIZE 4096 781283Ssundar#define ASL_MSG_BUFFER_SIZE 4096 791283Ssundar#define HEX_TABLE_LINE_SIZE 8 801283Ssundar#define HEX_LISTING_LINE_SIZE 8 811283Ssundar 821283Ssundar 831283Ssundar/* Source code buffers and pointers for error reporting */ 841283Ssundar 851283SsundarASL_EXTERN char Gbl_CurrentLineBuffer[ASL_LINE_BUFFER_SIZE]; 861283SsundarASL_EXTERN UINT32 ASL_INIT_GLOBAL (Gbl_CurrentColumn, 0); 871283SsundarASL_EXTERN UINT32 ASL_INIT_GLOBAL (Gbl_CurrentLineNumber, 1); 881283SsundarASL_EXTERN UINT32 ASL_INIT_GLOBAL (Gbl_LogicalLineNumber, 1); 891283SsundarASL_EXTERN UINT32 ASL_INIT_GLOBAL (Gbl_CurrentLineOffset, 0); 90ASL_EXTERN char ASL_INIT_GLOBAL (*Gbl_LineBufPtr, Gbl_CurrentLineBuffer); 91 92/* Exception reporting */ 93 94ASL_EXTERN ASL_ERROR_MSG ASL_INIT_GLOBAL (*Gbl_ErrorLog,NULL); 95ASL_EXTERN ASL_ERROR_MSG ASL_INIT_GLOBAL (*Gbl_NextError,NULL); 96 97/* Option flags */ 98 99ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_DoCompile, TRUE); 100ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_DoSignon, TRUE); 101ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_PreprocessOnly, FALSE); 102ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_DisassembleAll, FALSE); 103 104ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_Acpi2, FALSE); 105ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_UseDefaultAmlFilename, TRUE); 106ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_NsOutputFlag, FALSE); 107ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_PreprocessorOutputFlag, FALSE); 108ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_DebugFlag, FALSE); 109ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_AsmOutputFlag, FALSE); 110ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_C_OutputFlag, FALSE); 111ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_AsmIncludeOutputFlag, FALSE); 112ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_C_IncludeOutputFlag, FALSE); 113ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_ListingFlag, FALSE); 114ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_IgnoreErrors, FALSE); 115ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_SourceOutputFlag, FALSE); 116ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_ParseOnlyFlag, FALSE); 117ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_CompileTimesFlag, FALSE); 118ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_FoldConstants, TRUE); 119ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_VerboseErrors, TRUE); 120ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_NoErrors, FALSE); 121ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_NoResourceChecking, FALSE); 122ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_DisasmFlag, FALSE); 123ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_GetAllTables, FALSE); 124ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_IntegerOptimizationFlag, TRUE); 125ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_ReferenceOptimizationFlag, TRUE); 126ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_DisplayRemarks, TRUE); 127ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_DisplayOptimizations, FALSE); 128ASL_EXTERN UINT8 ASL_INIT_GLOBAL (Gbl_WarningLevel, ASL_WARNING); 129ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_UseOriginalCompilerId, FALSE); 130ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_VerboseTemplates, FALSE); 131ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_DoTemplates, FALSE); 132ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_CompileGeneric, FALSE); 133 134 135#define HEX_OUTPUT_NONE 0 136#define HEX_OUTPUT_C 1 137#define HEX_OUTPUT_ASM 2 138#define HEX_OUTPUT_ASL 3 139 140ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_HexOutputFlag, HEX_OUTPUT_NONE); 141 142 143/* Files */ 144 145ASL_EXTERN ASL_FILE_INFO Gbl_Files [ASL_NUM_FILES]; 146 147ASL_EXTERN char *Gbl_DirectoryPath; 148ASL_EXTERN char ASL_INIT_GLOBAL (*Gbl_IncludeFilename, NULL); 149ASL_EXTERN char ASL_INIT_GLOBAL (*Gbl_OutputFilenamePrefix, NULL); 150ASL_EXTERN ASL_INCLUDE_DIR ASL_INIT_GLOBAL (*Gbl_IncludeDirList, NULL); 151ASL_EXTERN char *Gbl_CurrentInputFilename; 152 153ASL_EXTERN BOOLEAN ASL_INIT_GLOBAL (Gbl_HasIncludeFiles, FALSE); 154 155 156/* Statistics */ 157 158ASL_EXTERN UINT32 ASL_INIT_GLOBAL (Gbl_InputByteCount, 0); 159ASL_EXTERN UINT32 ASL_INIT_GLOBAL (Gbl_InputFieldCount, 0); 160ASL_EXTERN UINT32 ASL_INIT_GLOBAL (Gbl_NsLookupCount, 0); 161ASL_EXTERN UINT32 ASL_INIT_GLOBAL (TotalKeywords, 0); 162ASL_EXTERN UINT32 ASL_INIT_GLOBAL (TotalNamedObjects, 0); 163ASL_EXTERN UINT32 ASL_INIT_GLOBAL (TotalExecutableOpcodes, 0); 164ASL_EXTERN UINT32 ASL_INIT_GLOBAL (TotalParseNodes, 0); 165ASL_EXTERN UINT32 ASL_INIT_GLOBAL (TotalMethods, 0); 166ASL_EXTERN UINT32 ASL_INIT_GLOBAL (TotalAllocations, 0); 167ASL_EXTERN UINT32 ASL_INIT_GLOBAL (TotalAllocated, 0); 168ASL_EXTERN UINT32 ASL_INIT_GLOBAL (TotalFolds, 0); 169 170 171/* Misc */ 172 173ASL_EXTERN UINT8 ASL_INIT_GLOBAL (Gbl_RevisionOverride, 0); 174ASL_EXTERN UINT8 ASL_INIT_GLOBAL (Gbl_TempCount, 0); 175ASL_EXTERN ACPI_PARSE_OBJECT ASL_INIT_GLOBAL (*RootNode, NULL); 176ASL_EXTERN UINT32 ASL_INIT_GLOBAL (Gbl_TableLength, 0); 177ASL_EXTERN UINT32 ASL_INIT_GLOBAL (Gbl_SourceLine, 0); 178ASL_EXTERN ASL_LISTING_NODE ASL_INIT_GLOBAL (*Gbl_ListingNode, NULL); 179ASL_EXTERN ACPI_PARSE_OBJECT ASL_INIT_GLOBAL (*Gbl_NodeCacheNext, NULL); 180ASL_EXTERN ACPI_PARSE_OBJECT ASL_INIT_GLOBAL (*Gbl_NodeCacheLast, NULL); 181ASL_EXTERN char ASL_INIT_GLOBAL (*Gbl_StringCacheNext, NULL); 182ASL_EXTERN char ASL_INIT_GLOBAL (*Gbl_StringCacheLast, NULL); 183ASL_EXTERN ACPI_PARSE_OBJECT *Gbl_FirstLevelInsertionNode; 184ASL_EXTERN UINT8 ASL_INIT_GLOBAL (Gbl_FileType, 0); 185ASL_EXTERN char ASL_INIT_GLOBAL (*Gbl_Signature, NULL); 186ASL_EXTERN char *Gbl_TemplateSignature; 187 188ASL_EXTERN UINT32 ASL_INIT_GLOBAL (Gbl_CurrentHexColumn, 0); 189ASL_EXTERN UINT32 ASL_INIT_GLOBAL (Gbl_CurrentAmlOffset, 0); 190ASL_EXTERN UINT32 ASL_INIT_GLOBAL (Gbl_CurrentLine, 0); 191ASL_EXTERN UINT8 ASL_INIT_GLOBAL (Gbl_HexBytesWereWritten, FALSE); 192ASL_EXTERN UINT32 ASL_INIT_GLOBAL (Gbl_NumNamespaceObjects, 0); 193ASL_EXTERN UINT32 ASL_INIT_GLOBAL (Gbl_ReservedMethods, 0); 194ASL_EXTERN char ASL_INIT_GLOBAL (*Gbl_TableSignature, "NO_SIG"); 195ASL_EXTERN char ASL_INIT_GLOBAL (*Gbl_TableId, "NO_ID"); 196ASL_EXTERN FILE *AcpiGbl_DebugFile; /* Placeholder for oswinxf only */ 197 198 199/* Static structures */ 200 201ASL_EXTERN ASL_ANALYSIS_WALK_INFO AnalysisWalkInfo; 202ASL_EXTERN ACPI_TABLE_HEADER TableHeader; 203extern char AslHexLookup[]; 204 205/* Event timing */ 206 207#define ASL_NUM_EVENTS 20 208ASL_EXTERN ASL_EVENT_INFO AslGbl_Events[ASL_NUM_EVENTS]; 209ASL_EXTERN UINT8 AslGbl_NextEvent; 210ASL_EXTERN UINT8 AslGbl_NamespaceEvent; 211 212/* Scratch buffers */ 213 214ASL_EXTERN UINT8 Gbl_AmlBuffer[HEX_LISTING_LINE_SIZE]; 215ASL_EXTERN char MsgBuffer[ASL_MSG_BUFFER_SIZE]; 216ASL_EXTERN char StringBuffer[ASL_MSG_BUFFER_SIZE]; 217ASL_EXTERN char StringBuffer2[ASL_MSG_BUFFER_SIZE]; 218 219 220#ifdef _DECLARE_GLOBALS 221UINT32 Gbl_ExceptionCount[ASL_NUM_REPORT_LEVELS] = {0,0,0,0,0,0}; 222#else 223extern UINT32 Gbl_ExceptionCount[ASL_NUM_REPORT_LEVELS]; 224#endif 225 226#endif /* __ASLGLOBAL_H */ 227 228