asltypes.h revision 250838
1118611Snjl/****************************************************************************** 2118611Snjl * 3118611Snjl * Module Name: asltypes.h - compiler data types and struct definitions 4118611Snjl * 5118611Snjl *****************************************************************************/ 6118611Snjl 7217365Sjkim/* 8245582Sjkim * Copyright (C) 2000 - 2013, Intel Corp. 9118611Snjl * All rights reserved. 10118611Snjl * 11217365Sjkim * Redistribution and use in source and binary forms, with or without 12217365Sjkim * modification, are permitted provided that the following conditions 13217365Sjkim * are met: 14217365Sjkim * 1. Redistributions of source code must retain the above copyright 15217365Sjkim * notice, this list of conditions, and the following disclaimer, 16217365Sjkim * without modification. 17217365Sjkim * 2. Redistributions in binary form must reproduce at minimum a disclaimer 18217365Sjkim * substantially similar to the "NO WARRANTY" disclaimer below 19217365Sjkim * ("Disclaimer") and any redistribution must be conditioned upon 20217365Sjkim * including a substantially similar Disclaimer requirement for further 21217365Sjkim * binary redistribution. 22217365Sjkim * 3. Neither the names of the above-listed copyright holders nor the names 23217365Sjkim * of any contributors may be used to endorse or promote products derived 24217365Sjkim * from this software without specific prior written permission. 25118611Snjl * 26217365Sjkim * Alternatively, this software may be distributed under the terms of the 27217365Sjkim * GNU General Public License ("GPL") version 2 as published by the Free 28217365Sjkim * Software Foundation. 29118611Snjl * 30217365Sjkim * NO WARRANTY 31217365Sjkim * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 32217365Sjkim * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 33217365Sjkim * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR 34217365Sjkim * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 35217365Sjkim * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 36217365Sjkim * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 37217365Sjkim * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 38217365Sjkim * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, 39217365Sjkim * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 40217365Sjkim * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 41217365Sjkim * POSSIBILITY OF SUCH DAMAGES. 42217365Sjkim */ 43118611Snjl 44118611Snjl 45118611Snjl#ifndef __ASLTYPES_H 46118611Snjl#define __ASLTYPES_H 47118611Snjl 48118611Snjl 49118611Snjl/******************************************************************************* 50118611Snjl * 51118611Snjl * Structure definitions 52118611Snjl * 53118611Snjl ******************************************************************************/ 54118611Snjl 55118611Snjl 56118611Snjl/* Op flags for the ACPI_PARSE_OBJECT */ 57118611Snjl 58118611Snjl#define NODE_VISITED 0x00000001 59118611Snjl#define NODE_AML_PACKAGE 0x00000002 60118611Snjl#define NODE_IS_TARGET 0x00000004 61118611Snjl#define NODE_IS_RESOURCE_DESC 0x00000008 62118611Snjl#define NODE_IS_RESOURCE_FIELD 0x00000010 63118611Snjl#define NODE_HAS_NO_EXIT 0x00000020 64118611Snjl#define NODE_IF_HAS_NO_EXIT 0x00000040 65118611Snjl#define NODE_NAME_INTERNALIZED 0x00000080 66118611Snjl#define NODE_METHOD_NO_RETVAL 0x00000100 67118611Snjl#define NODE_METHOD_SOME_NO_RETVAL 0x00000200 68118611Snjl#define NODE_RESULT_NOT_USED 0x00000400 69118611Snjl#define NODE_METHOD_TYPED 0x00000800 70228110Sjkim#define NODE_UNUSED_FLAG 0x00001000 71118611Snjl#define NODE_COMPILE_TIME_CONST 0x00002000 72118611Snjl#define NODE_IS_TERM_ARG 0x00004000 73118611Snjl#define NODE_WAS_ONES_OP 0x00008000 74118611Snjl#define NODE_IS_NAME_DECLARATION 0x00010000 75138287Smarks#define NODE_COMPILER_EMITTED 0x00020000 76151937Sjkim#define NODE_IS_DUPLICATE 0x00040000 77167802Sjkim#define NODE_IS_RESOURCE_DATA 0x00080000 78220663Sjkim#define NODE_IS_NULL_RETURN 0x00100000 79118611Snjl 80118611Snjl/* Keeps information about individual control methods */ 81118611Snjl 82118611Snjltypedef struct asl_method_info 83118611Snjl{ 84250838Sjkim ACPI_PARSE_OBJECT *Op; 85250838Sjkim struct asl_method_info *Next; 86138287Smarks UINT32 ValidArgTypes[ACPI_METHOD_NUM_ARGS]; 87138287Smarks UINT32 ValidReturnTypes; 88118611Snjl UINT32 NumReturnNoValue; 89118611Snjl UINT32 NumReturnWithValue; 90250838Sjkim UINT8 NumArguments; 91250838Sjkim UINT8 LocalInitialized[ACPI_METHOD_NUM_LOCALS]; 92250838Sjkim UINT8 ArgInitialized[ACPI_METHOD_NUM_ARGS]; 93118611Snjl UINT8 HasBeenTyped; 94250838Sjkim UINT8 ShouldBeSerialized; 95118611Snjl 96118611Snjl} ASL_METHOD_INFO; 97118611Snjl 98118611Snjl 99118611Snjl/* Parse tree walk info for control method analysis */ 100118611Snjl 101118611Snjltypedef struct asl_analysis_walk_info 102118611Snjl{ 103118611Snjl ASL_METHOD_INFO *MethodStack; 104118611Snjl 105118611Snjl} ASL_ANALYSIS_WALK_INFO; 106118611Snjl 107118611Snjl 108118611Snjl/* An entry in the ParseOpcode to AmlOpcode mapping table */ 109118611Snjl 110118611Snjltypedef struct asl_mapping_entry 111118611Snjl{ 112118611Snjl UINT32 Value; 113118611Snjl UINT32 AcpiBtype; /* Object type or return type */ 114118611Snjl UINT16 AmlOpcode; 115118611Snjl UINT8 Flags; 116118611Snjl 117118611Snjl} ASL_MAPPING_ENTRY; 118118611Snjl 119118611Snjl 120118611Snjl/* Parse tree walk info structure */ 121118611Snjl 122118611Snjltypedef struct asl_walk_info 123118611Snjl{ 124118611Snjl ACPI_PARSE_OBJECT **NodePtr; 125118611Snjl UINT32 *LevelPtr; 126118611Snjl 127118611Snjl} ASL_WALK_INFO; 128118611Snjl 129118611Snjl 130118611Snjl/* File info */ 131118611Snjl 132118611Snjltypedef struct asl_file_info 133118611Snjl{ 134118611Snjl FILE *Handle; 135118611Snjl char *Filename; 136240716Sjkim const char *ShortDescription; 137240716Sjkim const char *Description; 138118611Snjl 139118611Snjl} ASL_FILE_INFO; 140118611Snjl 141167802Sjkimtypedef struct asl_file_status 142167802Sjkim{ 143167802Sjkim UINT32 Line; 144167802Sjkim UINT32 Offset; 145118611Snjl 146167802Sjkim} ASL_FILE_STATUS; 147167802Sjkim 148167802Sjkim 149228110Sjkim/* 150228110Sjkim * File types. Note: Any changes to this table must also be reflected 151240716Sjkim * in the Gbl_Files array. 152228110Sjkim */ 153118611Snjltypedef enum 154118611Snjl{ 155118611Snjl ASL_FILE_STDOUT = 0, 156118611Snjl ASL_FILE_STDERR, 157240716Sjkim ASL_FILE_INPUT, 158240716Sjkim ASL_FILE_AML_OUTPUT, /* Don't move these first 4 file types */ 159118611Snjl ASL_FILE_SOURCE_OUTPUT, 160233250Sjkim ASL_FILE_PREPROCESSOR, 161118611Snjl ASL_FILE_LISTING_OUTPUT, 162118611Snjl ASL_FILE_HEX_OUTPUT, 163118611Snjl ASL_FILE_NAMESPACE_OUTPUT, 164118611Snjl ASL_FILE_DEBUG_OUTPUT, 165118611Snjl ASL_FILE_ASM_SOURCE_OUTPUT, 166118611Snjl ASL_FILE_C_SOURCE_OUTPUT, 167118611Snjl ASL_FILE_ASM_INCLUDE_OUTPUT, 168249112Sjkim ASL_FILE_C_INCLUDE_OUTPUT, 169249112Sjkim ASL_FILE_C_OFFSET_OUTPUT 170118611Snjl 171118611Snjl} ASL_FILE_TYPES; 172118611Snjl 173118611Snjl 174249112Sjkim#define ASL_MAX_FILE_TYPE 14 175118611Snjl#define ASL_NUM_FILES (ASL_MAX_FILE_TYPE + 1) 176118611Snjl 177118611Snjl 178197104Sjkimtypedef struct asl_include_dir 179197104Sjkim{ 180197104Sjkim char *Dir; 181197104Sjkim struct asl_include_dir *Next; 182197104Sjkim 183197104Sjkim} ASL_INCLUDE_DIR; 184197104Sjkim 185197104Sjkim 186118611Snjl/* An entry in the exception list, one for each error/warning */ 187118611Snjl 188118611Snjltypedef struct asl_error_msg 189118611Snjl{ 190118611Snjl UINT32 LineNumber; 191118611Snjl UINT32 LogicalLineNumber; 192118611Snjl UINT32 LogicalByteOffset; 193118611Snjl UINT32 Column; 194118611Snjl char *Message; 195118611Snjl struct asl_error_msg *Next; 196118611Snjl char *Filename; 197233250Sjkim char *SourceLine; 198118611Snjl UINT32 FilenameLength; 199118611Snjl UINT8 MessageId; 200118611Snjl UINT8 Level; 201118611Snjl 202118611Snjl} ASL_ERROR_MSG; 203118611Snjl 204118611Snjl 205118611Snjl/* An entry in the listing file stack (for include files) */ 206118611Snjl 207118611Snjltypedef struct asl_listing_node 208118611Snjl{ 209118611Snjl char *Filename; 210118611Snjl UINT32 LineNumber; 211118611Snjl struct asl_listing_node *Next; 212118611Snjl 213118611Snjl} ASL_LISTING_NODE; 214118611Snjl 215118611Snjl 216118611Snjl/* Callback interface for a parse tree walk */ 217118611Snjl 218209746Sjkim/* 219209746Sjkim * TBD - another copy of this is in adisasm.h, fix 220209746Sjkim */ 221209746Sjkim#ifndef ASL_WALK_CALLBACK_DEFINED 222118611Snjltypedef 223118611SnjlACPI_STATUS (*ASL_WALK_CALLBACK) ( 224118611Snjl ACPI_PARSE_OBJECT *Op, 225118611Snjl UINT32 Level, 226118611Snjl void *Context); 227209746Sjkim#define ASL_WALK_CALLBACK_DEFINED 228209746Sjkim#endif 229118611Snjl 230118611Snjl 231118611Snjltypedef struct asl_event_info 232118611Snjl{ 233151937Sjkim UINT64 StartTime; 234151937Sjkim UINT64 EndTime; 235118611Snjl char *EventName; 236118611Snjl BOOLEAN Valid; 237118611Snjl 238118611Snjl} ASL_EVENT_INFO; 239118611Snjl 240118611Snjl 241118611Snjl#endif /* __ASLTYPES_H */ 242