Home | History | Annotate | Line # | Download | only in compiler
asldefine.h revision 1.1.1.3
      1      1.1  jruoho 
      2      1.1  jruoho /******************************************************************************
      3      1.1  jruoho  *
      4      1.1  jruoho  * Module Name: asldefine.h - Common defines for the iASL compiler
      5      1.1  jruoho  *
      6      1.1  jruoho  *****************************************************************************/
      7      1.1  jruoho 
      8  1.1.1.2  jruoho /*
      9  1.1.1.2  jruoho  * Copyright (C) 2000 - 2011, Intel Corp.
     10      1.1  jruoho  * All rights reserved.
     11      1.1  jruoho  *
     12  1.1.1.2  jruoho  * Redistribution and use in source and binary forms, with or without
     13  1.1.1.2  jruoho  * modification, are permitted provided that the following conditions
     14  1.1.1.2  jruoho  * are met:
     15  1.1.1.2  jruoho  * 1. Redistributions of source code must retain the above copyright
     16  1.1.1.2  jruoho  *    notice, this list of conditions, and the following disclaimer,
     17  1.1.1.2  jruoho  *    without modification.
     18  1.1.1.2  jruoho  * 2. Redistributions in binary form must reproduce at minimum a disclaimer
     19  1.1.1.2  jruoho  *    substantially similar to the "NO WARRANTY" disclaimer below
     20  1.1.1.2  jruoho  *    ("Disclaimer") and any redistribution must be conditioned upon
     21  1.1.1.2  jruoho  *    including a substantially similar Disclaimer requirement for further
     22  1.1.1.2  jruoho  *    binary redistribution.
     23  1.1.1.2  jruoho  * 3. Neither the names of the above-listed copyright holders nor the names
     24  1.1.1.2  jruoho  *    of any contributors may be used to endorse or promote products derived
     25  1.1.1.2  jruoho  *    from this software without specific prior written permission.
     26  1.1.1.2  jruoho  *
     27  1.1.1.2  jruoho  * Alternatively, this software may be distributed under the terms of the
     28  1.1.1.2  jruoho  * GNU General Public License ("GPL") version 2 as published by the Free
     29  1.1.1.2  jruoho  * Software Foundation.
     30  1.1.1.2  jruoho  *
     31  1.1.1.2  jruoho  * NO WARRANTY
     32  1.1.1.2  jruoho  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
     33  1.1.1.2  jruoho  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
     34  1.1.1.2  jruoho  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
     35  1.1.1.2  jruoho  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
     36  1.1.1.2  jruoho  * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     37  1.1.1.2  jruoho  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
     38  1.1.1.2  jruoho  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     39  1.1.1.2  jruoho  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
     40  1.1.1.2  jruoho  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
     41  1.1.1.2  jruoho  * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
     42  1.1.1.2  jruoho  * POSSIBILITY OF SUCH DAMAGES.
     43  1.1.1.2  jruoho  */
     44      1.1  jruoho 
     45      1.1  jruoho 
     46      1.1  jruoho #ifndef __ASLDEFINE_H
     47      1.1  jruoho #define __ASLDEFINE_H
     48      1.1  jruoho 
     49      1.1  jruoho 
     50      1.1  jruoho /*
     51      1.1  jruoho  * Compiler versions and names
     52      1.1  jruoho  */
     53  1.1.1.2  jruoho #define ASL_REVISION                ACPI_CA_VERSION
     54  1.1.1.2  jruoho #define ASL_COMPILER_NAME           "ASL Optimizing Compiler"
     55  1.1.1.2  jruoho #define AML_DISASSEMBLER_NAME       "AML Disassembler"
     56  1.1.1.2  jruoho #define ASL_INVOCATION_NAME         "iasl"
     57  1.1.1.2  jruoho #define ASL_CREATOR_ID              "INTL"
     58      1.1  jruoho 
     59  1.1.1.2  jruoho #define ASL_COMPLIANCE              "Supports ACPI Specification Revision 4.0a"
     60      1.1  jruoho 
     61      1.1  jruoho 
     62      1.1  jruoho /* Configuration constants */
     63      1.1  jruoho 
     64      1.1  jruoho #define ASL_MAX_ERROR_COUNT         200
     65      1.1  jruoho #define ASL_NODE_CACHE_SIZE         1024
     66      1.1  jruoho #define ASL_STRING_CACHE_SIZE       32768
     67      1.1  jruoho 
     68      1.1  jruoho #define ASL_FIRST_PARSE_OPCODE      PARSEOP_ACCESSAS
     69      1.1  jruoho #define ASL_PARSE_OPCODE_BASE       PARSEOP_ACCESSAS        /* First Lex type */
     70      1.1  jruoho 
     71      1.1  jruoho 
     72      1.1  jruoho /*
     73  1.1.1.3  jruoho  * Per-parser-generator configuration. These values are used to cheat and
     74  1.1.1.3  jruoho  * directly access the bison/yacc token name table (yyname or yytname).
     75  1.1.1.3  jruoho  * Note: These values are the index in yyname for the first lex token
     76  1.1.1.3  jruoho  * (PARSEOP_ACCCESSAS).
     77  1.1.1.3  jruoho  */
     78  1.1.1.3  jruoho #if defined (YYBISON)
     79  1.1.1.3  jruoho #define ASL_YYTNAME_START           3   /* Bison */
     80  1.1.1.3  jruoho #elif defined (YYBYACC)
     81  1.1.1.3  jruoho #define ASL_YYTNAME_START           257 /* Berkeley yacc */
     82  1.1.1.3  jruoho #endif
     83  1.1.1.3  jruoho 
     84  1.1.1.3  jruoho 
     85  1.1.1.3  jruoho /*
     86      1.1  jruoho  * Macros
     87      1.1  jruoho  */
     88      1.1  jruoho #define ASL_RESDESC_OFFSET(m)       ACPI_OFFSET (AML_RESOURCE, m)
     89      1.1  jruoho #define ASL_PTR_DIFF(a,b)           ((UINT8 *)(b) - (UINT8 *)(a))
     90      1.1  jruoho #define ASL_PTR_ADD(a,b)            ((UINT8 *)(a) = ((UINT8 *)(a) + (b)))
     91      1.1  jruoho #define ASL_GET_CHILD_NODE(a)       (a)->Asl.Child
     92      1.1  jruoho #define ASL_GET_PEER_NODE(a)        (a)->Asl.Next
     93      1.1  jruoho #define OP_TABLE_ENTRY(a,b,c,d)     {b,d,a,c}
     94      1.1  jruoho 
     95      1.1  jruoho 
     96      1.1  jruoho /* Internal AML opcodes */
     97      1.1  jruoho 
     98      1.1  jruoho #define AML_RAW_DATA_BYTE           (UINT16) 0xAA01 /* write one raw byte */
     99      1.1  jruoho #define AML_RAW_DATA_WORD           (UINT16) 0xAA02 /* write 2 raw bytes */
    100      1.1  jruoho #define AML_RAW_DATA_DWORD          (UINT16) 0xAA04 /* write 4 raw bytes */
    101      1.1  jruoho #define AML_RAW_DATA_QWORD          (UINT16) 0xAA08 /* write 8 raw bytes */
    102      1.1  jruoho #define AML_RAW_DATA_BUFFER         (UINT16) 0xAA0B /* raw buffer with length */
    103      1.1  jruoho #define AML_RAW_DATA_CHAIN          (UINT16) 0xAA0C /* chain of raw buffers */
    104      1.1  jruoho #define AML_PACKAGE_LENGTH          (UINT16) 0xAA10
    105      1.1  jruoho #define AML_UNASSIGNED_OPCODE       (UINT16) 0xEEEE
    106      1.1  jruoho #define AML_DEFAULT_ARG_OP          (UINT16) 0xDDDD
    107      1.1  jruoho 
    108      1.1  jruoho 
    109      1.1  jruoho /* filename suffixes for output files */
    110      1.1  jruoho 
    111  1.1.1.3  jruoho #define FILE_SUFFIX_PREPROCESSOR    "i"
    112      1.1  jruoho #define FILE_SUFFIX_AML_CODE        "aml"
    113      1.1  jruoho #define FILE_SUFFIX_LISTING         "lst"
    114      1.1  jruoho #define FILE_SUFFIX_HEX_DUMP        "hex"
    115      1.1  jruoho #define FILE_SUFFIX_DEBUG           "txt"
    116      1.1  jruoho #define FILE_SUFFIX_SOURCE          "src"
    117      1.1  jruoho #define FILE_SUFFIX_NAMESPACE       "nsp"
    118      1.1  jruoho #define FILE_SUFFIX_ASM_SOURCE      "asm"
    119      1.1  jruoho #define FILE_SUFFIX_C_SOURCE        "c"
    120      1.1  jruoho #define FILE_SUFFIX_DISASSEMBLY     "dsl"
    121      1.1  jruoho #define FILE_SUFFIX_ASM_INCLUDE     "inc"
    122      1.1  jruoho #define FILE_SUFFIX_C_INCLUDE       "h"
    123  1.1.1.2  jruoho #define FILE_SUFFIX_ASL_CODE        "asl"
    124      1.1  jruoho 
    125      1.1  jruoho 
    126      1.1  jruoho /* Types for input files */
    127      1.1  jruoho 
    128      1.1  jruoho #define ASL_INPUT_TYPE_BINARY       0
    129      1.1  jruoho #define ASL_INPUT_TYPE_ASCII_ASL    1
    130      1.1  jruoho #define ASL_INPUT_TYPE_ASCII_DATA   2
    131      1.1  jruoho 
    132      1.1  jruoho 
    133      1.1  jruoho /* Misc */
    134      1.1  jruoho 
    135      1.1  jruoho #define ASL_EXTERNAL_METHOD         255
    136      1.1  jruoho #define ASL_ABORT                   TRUE
    137      1.1  jruoho #define ASL_NO_ABORT                FALSE
    138  1.1.1.3  jruoho #define ASL_EOF                     ACPI_UINT32_MAX
    139      1.1  jruoho 
    140      1.1  jruoho 
    141      1.1  jruoho /* Support for reserved method names */
    142      1.1  jruoho 
    143      1.1  jruoho #define ACPI_VALID_RESERVED_NAME_MAX    0x80000000
    144      1.1  jruoho #define ACPI_NOT_RESERVED_NAME          ACPI_UINT32_MAX
    145      1.1  jruoho #define ACPI_PREDEFINED_NAME            (ACPI_UINT32_MAX - 1)
    146      1.1  jruoho #define ACPI_EVENT_RESERVED_NAME        (ACPI_UINT32_MAX - 2)
    147      1.1  jruoho #define ACPI_COMPILER_RESERVED_NAME     (ACPI_UINT32_MAX - 3)
    148      1.1  jruoho 
    149      1.1  jruoho 
    150      1.1  jruoho /* String to Integer conversion */
    151      1.1  jruoho 
    152      1.1  jruoho #define NEGATIVE                    1
    153      1.1  jruoho #define POSITIVE                    0
    154      1.1  jruoho 
    155      1.1  jruoho 
    156      1.1  jruoho #endif /* ASLDEFINE.H */
    157      1.1  jruoho 
    158