2 /******************************************************************************
4 * Module Name: asldefine.h - Common defines for the iASL compiler
6 *****************************************************************************/
9 * Copyright (C) 2000 - 2011, Intel Corp.
10 * All rights reserved.
12 * Redistribution and use in source and binary forms, with or without
13 * modification, are permitted provided that the following conditions
15 * 1. Redistributions of source code must retain the above copyright
16 * notice, this list of conditions, and the following disclaimer,
17 * without modification.
18 * 2. Redistributions in binary form must reproduce at minimum a disclaimer
19 * substantially similar to the "NO WARRANTY" disclaimer below
20 * ("Disclaimer") and any redistribution must be conditioned upon
21 * including a substantially similar Disclaimer requirement for further
22 * binary redistribution.
23 * 3. Neither the names of the above-listed copyright holders nor the names
24 * of any contributors may be used to endorse or promote products derived
25 * from this software without specific prior written permission.
27 * Alternatively, this software may be distributed under the terms of the
28 * GNU General Public License ("GPL") version 2 as published by the Free
29 * Software Foundation.
32 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
33 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
34 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR
35 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
36 * HOLDERS OR CONTRIBUTORS BE LIABLE FOR SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
37 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
38 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
39 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
40 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
41 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
42 * POSSIBILITY OF SUCH DAMAGES.
51 * Compiler versions and names
53 #define ASL_REVISION ACPI_CA_VERSION
54 #define ASL_COMPILER_NAME "ASL Optimizing Compiler"
55 #define AML_DISASSEMBLER_NAME "AML Disassembler"
56 #define ASL_INVOCATION_NAME "iasl"
57 #define ASL_CREATOR_ID "INTL"
59 #define ASL_COMPLIANCE "Supports ACPI Specification Revision 4.0a"
62 /* Configuration constants */
64 #define ASL_MAX_ERROR_COUNT 200
65 #define ASL_NODE_CACHE_SIZE 1024
66 #define ASL_STRING_CACHE_SIZE 32768
68 #define ASL_FIRST_PARSE_OPCODE PARSEOP_ACCESSAS
69 #define ASL_YYTNAME_START 3
71 #define ASL_PARSE_OPCODE_BASE PARSEOP_ACCESSAS /* First Lex type */
77 #define ASL_RESDESC_OFFSET(m) ACPI_OFFSET (AML_RESOURCE, m)
78 #define ASL_PTR_DIFF(a,b) ((UINT8 *)(b) - (UINT8 *)(a))
79 #define ASL_PTR_ADD(a,b) ((UINT8 *)(a) = ((UINT8 *)(a) + (b)))
80 #define ASL_GET_CHILD_NODE(a) (a)->Asl.Child
81 #define ASL_GET_PEER_NODE(a) (a)->Asl.Next
82 #define OP_TABLE_ENTRY(a,b,c,d) {b,d,a,c}
85 /* Internal AML opcodes */
87 #define AML_RAW_DATA_BYTE (UINT16) 0xAA01 /* write one raw byte */
88 #define AML_RAW_DATA_WORD (UINT16) 0xAA02 /* write 2 raw bytes */
89 #define AML_RAW_DATA_DWORD (UINT16) 0xAA04 /* write 4 raw bytes */
90 #define AML_RAW_DATA_QWORD (UINT16) 0xAA08 /* write 8 raw bytes */
91 #define AML_RAW_DATA_BUFFER (UINT16) 0xAA0B /* raw buffer with length */
92 #define AML_RAW_DATA_CHAIN (UINT16) 0xAA0C /* chain of raw buffers */
93 #define AML_PACKAGE_LENGTH (UINT16) 0xAA10
94 #define AML_UNASSIGNED_OPCODE (UINT16) 0xEEEE
95 #define AML_DEFAULT_ARG_OP (UINT16) 0xDDDD
98 /* filename suffixes for output files */
100 #define FILE_SUFFIX_AML_CODE "aml"
101 #define FILE_SUFFIX_LISTING "lst"
102 #define FILE_SUFFIX_HEX_DUMP "hex"
103 #define FILE_SUFFIX_DEBUG "txt"
104 #define FILE_SUFFIX_SOURCE "src"
105 #define FILE_SUFFIX_NAMESPACE "nsp"
106 #define FILE_SUFFIX_ASM_SOURCE "asm"
107 #define FILE_SUFFIX_C_SOURCE "c"
108 #define FILE_SUFFIX_DISASSEMBLY "dsl"
109 #define FILE_SUFFIX_ASM_INCLUDE "inc"
110 #define FILE_SUFFIX_C_INCLUDE "h"
111 #define FILE_SUFFIX_ASL_CODE "asl"
114 /* Types for input files */
116 #define ASL_INPUT_TYPE_BINARY 0
117 #define ASL_INPUT_TYPE_ASCII_ASL 1
118 #define ASL_INPUT_TYPE_ASCII_DATA 2
123 #define ASL_EXTERNAL_METHOD 255
124 #define ASL_ABORT TRUE
125 #define ASL_NO_ABORT FALSE
128 /* Support for reserved method names */
130 #define ACPI_VALID_RESERVED_NAME_MAX 0x80000000
131 #define ACPI_NOT_RESERVED_NAME ACPI_UINT32_MAX
132 #define ACPI_PREDEFINED_NAME (ACPI_UINT32_MAX - 1)
133 #define ACPI_EVENT_RESERVED_NAME (ACPI_UINT32_MAX - 2)
134 #define ACPI_COMPILER_RESERVED_NAME (ACPI_UINT32_MAX - 3)
137 /* String to Integer conversion */
143 #endif /* ASLDEFINE.H */