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