1 /******************************************************************************
   2  *
   3  * Module Name: asltypes.h - compiler data types and struct definitions
   4  *
   5  *****************************************************************************/
   6 
   7 /*
   8  * Copyright (C) 2000 - 2014, Intel Corp.
   9  * All rights reserved.
  10  *
  11  * Redistribution and use in source and binary forms, with or without
  12  * modification, are permitted provided that the following conditions
  13  * are met:
  14  * 1. Redistributions of source code must retain the above copyright
  15  *    notice, this list of conditions, and the following disclaimer,
  16  *    without modification.
  17  * 2. Redistributions in binary form must reproduce at minimum a disclaimer
  18  *    substantially similar to the "NO WARRANTY" disclaimer below
  19  *    ("Disclaimer") and any redistribution must be conditioned upon
  20  *    including a substantially similar Disclaimer requirement for further
  21  *    binary redistribution.
  22  * 3. Neither the names of the above-listed copyright holders nor the names
  23  *    of any contributors may be used to endorse or promote products derived
  24  *    from this software without specific prior written permission.
  25  *
  26  * Alternatively, this software may be distributed under the terms of the
  27  * GNU General Public License ("GPL") version 2 as published by the Free
  28  * Software Foundation.
  29  *
  30  * NO WARRANTY
  31  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  32  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  33  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
  34  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  35  * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  36  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  37  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  38  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
  39  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
  40  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
  41  * POSSIBILITY OF SUCH DAMAGES.
  42  */
  43 
  44 
  45 #ifndef __ASLTYPES_H
  46 #define __ASLTYPES_H
  47 
  48 
  49 /*******************************************************************************
  50  *
  51  * Structure definitions
  52  *
  53  ******************************************************************************/
  54 
  55 
  56 /* Op flags for the ACPI_PARSE_OBJECT */
  57 
  58 #define NODE_VISITED                0x00000001
  59 #define NODE_AML_PACKAGE            0x00000002
  60 #define NODE_IS_TARGET              0x00000004
  61 #define NODE_IS_RESOURCE_DESC       0x00000008
  62 #define NODE_IS_RESOURCE_FIELD      0x00000010
  63 #define NODE_HAS_NO_EXIT            0x00000020
  64 #define NODE_IF_HAS_NO_EXIT         0x00000040
  65 #define NODE_NAME_INTERNALIZED      0x00000080
  66 #define NODE_METHOD_NO_RETVAL       0x00000100
  67 #define NODE_METHOD_SOME_NO_RETVAL  0x00000200
  68 #define NODE_RESULT_NOT_USED        0x00000400
  69 #define NODE_METHOD_TYPED           0x00000800
  70 #define NODE_UNUSED_FLAG            0x00001000
  71 #define NODE_COMPILE_TIME_CONST     0x00002000
  72 #define NODE_IS_TERM_ARG            0x00004000
  73 #define NODE_WAS_ONES_OP            0x00008000
  74 #define NODE_IS_NAME_DECLARATION    0x00010000
  75 #define NODE_COMPILER_EMITTED       0x00020000
  76 #define NODE_IS_DUPLICATE           0x00040000
  77 #define NODE_IS_RESOURCE_DATA       0x00080000
  78 #define NODE_IS_NULL_RETURN         0x00100000
  79 
  80 /* Keeps information about individual control methods */
  81 
  82 typedef struct asl_method_info
  83 {
  84     ACPI_PARSE_OBJECT       *Op;
  85     struct asl_method_info  *Next;
  86     UINT32                  ValidArgTypes[ACPI_METHOD_NUM_ARGS];
  87     UINT32                  ValidReturnTypes;
  88     UINT32                  NumReturnNoValue;
  89     UINT32                  NumReturnWithValue;
  90     UINT8                   NumArguments;
  91     UINT8                   LocalInitialized[ACPI_METHOD_NUM_LOCALS];
  92     UINT8                   ArgInitialized[ACPI_METHOD_NUM_ARGS];
  93     UINT8                   HasBeenTyped;
  94     UINT8                   ShouldBeSerialized;
  95 
  96 } ASL_METHOD_INFO;
  97 
  98 
  99 /* Parse tree walk info for control method analysis */
 100 
 101 typedef struct asl_analysis_walk_info
 102 {
 103     ASL_METHOD_INFO         *MethodStack;
 104 
 105 } ASL_ANALYSIS_WALK_INFO;
 106 
 107 
 108 /* An entry in the ParseOpcode to AmlOpcode mapping table */
 109 
 110 typedef struct asl_mapping_entry
 111 {
 112     UINT32                      Value;
 113     UINT32                      AcpiBtype;   /* Object type or return type */
 114     UINT16                      AmlOpcode;
 115     UINT8                       Flags;
 116 
 117 } ASL_MAPPING_ENTRY;
 118 
 119 
 120 /* Parse tree walk info structure */
 121 
 122 typedef struct asl_walk_info
 123 {
 124     ACPI_PARSE_OBJECT           **NodePtr;
 125     UINT32                      *LevelPtr;
 126 
 127 } ASL_WALK_INFO;
 128 
 129 
 130 /* File info */
 131 
 132 typedef struct asl_file_info
 133 {
 134     FILE                        *Handle;
 135     char                        *Filename;
 136     const char                  *ShortDescription;
 137     const char                  *Description;
 138 
 139 } ASL_FILE_INFO;
 140 
 141 typedef struct asl_file_status
 142 {
 143     UINT32                  Line;
 144     UINT32                  Offset;
 145 
 146 } ASL_FILE_STATUS;
 147 
 148 
 149 /*
 150  * File types. Note: Any changes to this table must also be reflected
 151  * in the Gbl_Files array.
 152  */
 153 typedef enum
 154 {
 155     ASL_FILE_STDOUT             = 0,
 156     ASL_FILE_STDERR,
 157     ASL_FILE_INPUT,
 158     ASL_FILE_AML_OUTPUT,        /* Don't move these first 4 file types */
 159     ASL_FILE_SOURCE_OUTPUT,
 160     ASL_FILE_PREPROCESSOR,
 161     ASL_FILE_LISTING_OUTPUT,
 162     ASL_FILE_HEX_OUTPUT,
 163     ASL_FILE_NAMESPACE_OUTPUT,
 164     ASL_FILE_DEBUG_OUTPUT,
 165     ASL_FILE_ASM_SOURCE_OUTPUT,
 166     ASL_FILE_C_SOURCE_OUTPUT,
 167     ASL_FILE_ASM_INCLUDE_OUTPUT,
 168     ASL_FILE_C_INCLUDE_OUTPUT,
 169     ASL_FILE_C_OFFSET_OUTPUT
 170 
 171 } ASL_FILE_TYPES;
 172 
 173 
 174 #define ASL_MAX_FILE_TYPE       14
 175 #define ASL_NUM_FILES           (ASL_MAX_FILE_TYPE + 1)
 176 
 177 
 178 typedef struct asl_include_dir
 179 {
 180     char                        *Dir;
 181     struct asl_include_dir      *Next;
 182 
 183 } ASL_INCLUDE_DIR;
 184 
 185 
 186 /* An entry in the exception list, one for each error/warning */
 187 
 188 typedef struct asl_error_msg
 189 {
 190     UINT32                      LineNumber;
 191     UINT32                      LogicalLineNumber;
 192     UINT32                      LogicalByteOffset;
 193     UINT32                      Column;
 194     char                        *Message;
 195     struct asl_error_msg        *Next;
 196     char                        *Filename;
 197     char                        *SourceLine;
 198     UINT32                      FilenameLength;
 199     UINT8                       MessageId;
 200     UINT8                       Level;
 201 
 202 } ASL_ERROR_MSG;
 203 
 204 
 205 /* An entry in the listing file stack (for include files) */
 206 
 207 typedef struct asl_listing_node
 208 {
 209     char                        *Filename;
 210     UINT32                      LineNumber;
 211     struct asl_listing_node     *Next;
 212 
 213 } ASL_LISTING_NODE;
 214 
 215 
 216 /* Callback interface for a parse tree walk */
 217 
 218 /*
 219  * TBD - another copy of this is in adisasm.h, fix
 220  */
 221 #ifndef ASL_WALK_CALLBACK_DEFINED
 222 typedef
 223 ACPI_STATUS (*ASL_WALK_CALLBACK) (
 224     ACPI_PARSE_OBJECT           *Op,
 225     UINT32                      Level,
 226     void                        *Context);
 227 #define ASL_WALK_CALLBACK_DEFINED
 228 #endif
 229 
 230 
 231 typedef struct asl_event_info
 232 {
 233     UINT64                      StartTime;
 234     UINT64                      EndTime;
 235     char                        *EventName;
 236     BOOLEAN                     Valid;
 237 
 238 } ASL_EVENT_INFO;
 239 
 240 
 241 #endif  /* __ASLTYPES_H */