1a9643ea8Slogwang /******************************************************************************
2a9643ea8Slogwang  *
3a9643ea8Slogwang  * Name: amlcode.h - Definitions for AML, as included in "definition blocks"
4a9643ea8Slogwang  *                   Declarations and definitions contained herein are derived
5a9643ea8Slogwang  *                   directly from the ACPI specification.
6a9643ea8Slogwang  *
7a9643ea8Slogwang  *****************************************************************************/
8a9643ea8Slogwang 
9*22ce4affSfengbojiang /******************************************************************************
10*22ce4affSfengbojiang  *
11*22ce4affSfengbojiang  * 1. Copyright Notice
12*22ce4affSfengbojiang  *
13*22ce4affSfengbojiang  * Some or all of this work - Copyright (c) 1999 - 2020, Intel Corp.
14a9643ea8Slogwang  * All rights reserved.
15a9643ea8Slogwang  *
16*22ce4affSfengbojiang  * 2. License
17*22ce4affSfengbojiang  *
18*22ce4affSfengbojiang  * 2.1. This is your license from Intel Corp. under its intellectual property
19*22ce4affSfengbojiang  * rights. You may have additional license terms from the party that provided
20*22ce4affSfengbojiang  * you this software, covering your right to use that party's intellectual
21*22ce4affSfengbojiang  * property rights.
22*22ce4affSfengbojiang  *
23*22ce4affSfengbojiang  * 2.2. Intel grants, free of charge, to any person ("Licensee") obtaining a
24*22ce4affSfengbojiang  * copy of the source code appearing in this file ("Covered Code") an
25*22ce4affSfengbojiang  * irrevocable, perpetual, worldwide license under Intel's copyrights in the
26*22ce4affSfengbojiang  * base code distributed originally by Intel ("Original Intel Code") to copy,
27*22ce4affSfengbojiang  * make derivatives, distribute, use and display any portion of the Covered
28*22ce4affSfengbojiang  * Code in any form, with the right to sublicense such rights; and
29*22ce4affSfengbojiang  *
30*22ce4affSfengbojiang  * 2.3. Intel grants Licensee a non-exclusive and non-transferable patent
31*22ce4affSfengbojiang  * license (with the right to sublicense), under only those claims of Intel
32*22ce4affSfengbojiang  * patents that are infringed by the Original Intel Code, to make, use, sell,
33*22ce4affSfengbojiang  * offer to sell, and import the Covered Code and derivative works thereof
34*22ce4affSfengbojiang  * solely to the minimum extent necessary to exercise the above copyright
35*22ce4affSfengbojiang  * license, and in no event shall the patent license extend to any additions
36*22ce4affSfengbojiang  * to or modifications of the Original Intel Code. No other license or right
37*22ce4affSfengbojiang  * is granted directly or by implication, estoppel or otherwise;
38*22ce4affSfengbojiang  *
39*22ce4affSfengbojiang  * The above copyright and patent license is granted only if the following
40*22ce4affSfengbojiang  * conditions are met:
41*22ce4affSfengbojiang  *
42*22ce4affSfengbojiang  * 3. Conditions
43*22ce4affSfengbojiang  *
44*22ce4affSfengbojiang  * 3.1. Redistribution of Source with Rights to Further Distribute Source.
45*22ce4affSfengbojiang  * Redistribution of source code of any substantial portion of the Covered
46*22ce4affSfengbojiang  * Code or modification with rights to further distribute source must include
47*22ce4affSfengbojiang  * the above Copyright Notice, the above License, this list of Conditions,
48*22ce4affSfengbojiang  * and the following Disclaimer and Export Compliance provision. In addition,
49*22ce4affSfengbojiang  * Licensee must cause all Covered Code to which Licensee contributes to
50*22ce4affSfengbojiang  * contain a file documenting the changes Licensee made to create that Covered
51*22ce4affSfengbojiang  * Code and the date of any change. Licensee must include in that file the
52*22ce4affSfengbojiang  * documentation of any changes made by any predecessor Licensee. Licensee
53*22ce4affSfengbojiang  * must include a prominent statement that the modification is derived,
54*22ce4affSfengbojiang  * directly or indirectly, from Original Intel Code.
55*22ce4affSfengbojiang  *
56*22ce4affSfengbojiang  * 3.2. Redistribution of Source with no Rights to Further Distribute Source.
57*22ce4affSfengbojiang  * Redistribution of source code of any substantial portion of the Covered
58*22ce4affSfengbojiang  * Code or modification without rights to further distribute source must
59*22ce4affSfengbojiang  * include the following Disclaimer and Export Compliance provision in the
60*22ce4affSfengbojiang  * documentation and/or other materials provided with distribution. In
61*22ce4affSfengbojiang  * addition, Licensee may not authorize further sublicense of source of any
62*22ce4affSfengbojiang  * portion of the Covered Code, and must include terms to the effect that the
63*22ce4affSfengbojiang  * license from Licensee to its licensee is limited to the intellectual
64*22ce4affSfengbojiang  * property embodied in the software Licensee provides to its licensee, and
65*22ce4affSfengbojiang  * not to intellectual property embodied in modifications its licensee may
66*22ce4affSfengbojiang  * make.
67*22ce4affSfengbojiang  *
68*22ce4affSfengbojiang  * 3.3. Redistribution of Executable. Redistribution in executable form of any
69*22ce4affSfengbojiang  * substantial portion of the Covered Code or modification must reproduce the
70*22ce4affSfengbojiang  * above Copyright Notice, and the following Disclaimer and Export Compliance
71*22ce4affSfengbojiang  * provision in the documentation and/or other materials provided with the
72*22ce4affSfengbojiang  * distribution.
73*22ce4affSfengbojiang  *
74*22ce4affSfengbojiang  * 3.4. Intel retains all right, title, and interest in and to the Original
75*22ce4affSfengbojiang  * Intel Code.
76*22ce4affSfengbojiang  *
77*22ce4affSfengbojiang  * 3.5. Neither the name Intel nor any other trademark owned or controlled by
78*22ce4affSfengbojiang  * Intel shall be used in advertising or otherwise to promote the sale, use or
79*22ce4affSfengbojiang  * other dealings in products derived from or relating to the Covered Code
80*22ce4affSfengbojiang  * without prior written authorization from Intel.
81*22ce4affSfengbojiang  *
82*22ce4affSfengbojiang  * 4. Disclaimer and Export Compliance
83*22ce4affSfengbojiang  *
84*22ce4affSfengbojiang  * 4.1. INTEL MAKES NO WARRANTY OF ANY KIND REGARDING ANY SOFTWARE PROVIDED
85*22ce4affSfengbojiang  * HERE. ANY SOFTWARE ORIGINATING FROM INTEL OR DERIVED FROM INTEL SOFTWARE
86*22ce4affSfengbojiang  * IS PROVIDED "AS IS," AND INTEL WILL NOT PROVIDE ANY SUPPORT, ASSISTANCE,
87*22ce4affSfengbojiang  * INSTALLATION, TRAINING OR OTHER SERVICES. INTEL WILL NOT PROVIDE ANY
88*22ce4affSfengbojiang  * UPDATES, ENHANCEMENTS OR EXTENSIONS. INTEL SPECIFICALLY DISCLAIMS ANY
89*22ce4affSfengbojiang  * IMPLIED WARRANTIES OF MERCHANTABILITY, NONINFRINGEMENT AND FITNESS FOR A
90*22ce4affSfengbojiang  * PARTICULAR PURPOSE.
91*22ce4affSfengbojiang  *
92*22ce4affSfengbojiang  * 4.2. IN NO EVENT SHALL INTEL HAVE ANY LIABILITY TO LICENSEE, ITS LICENSEES
93*22ce4affSfengbojiang  * OR ANY OTHER THIRD PARTY, FOR ANY LOST PROFITS, LOST DATA, LOSS OF USE OR
94*22ce4affSfengbojiang  * COSTS OF PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES, OR FOR ANY INDIRECT,
95*22ce4affSfengbojiang  * SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THIS AGREEMENT, UNDER ANY
96*22ce4affSfengbojiang  * CAUSE OF ACTION OR THEORY OF LIABILITY, AND IRRESPECTIVE OF WHETHER INTEL
97*22ce4affSfengbojiang  * HAS ADVANCE NOTICE OF THE POSSIBILITY OF SUCH DAMAGES. THESE LIMITATIONS
98*22ce4affSfengbojiang  * SHALL APPLY NOTWITHSTANDING THE FAILURE OF THE ESSENTIAL PURPOSE OF ANY
99*22ce4affSfengbojiang  * LIMITED REMEDY.
100*22ce4affSfengbojiang  *
101*22ce4affSfengbojiang  * 4.3. Licensee shall not export, either directly or indirectly, any of this
102*22ce4affSfengbojiang  * software or system incorporating such software without first obtaining any
103*22ce4affSfengbojiang  * required license or other approval from the U. S. Department of Commerce or
104*22ce4affSfengbojiang  * any other agency or department of the United States Government. In the
105*22ce4affSfengbojiang  * event Licensee exports any such software from the United States or
106*22ce4affSfengbojiang  * re-exports any such software from a foreign destination, Licensee shall
107*22ce4affSfengbojiang  * ensure that the distribution and export/re-export of the software is in
108*22ce4affSfengbojiang  * compliance with all laws, regulations, orders, or other restrictions of the
109*22ce4affSfengbojiang  * U.S. Export Administration Regulations. Licensee agrees that neither it nor
110*22ce4affSfengbojiang  * any of its subsidiaries will export/re-export any technical data, process,
111*22ce4affSfengbojiang  * software, or service, directly or indirectly, to any country for which the
112*22ce4affSfengbojiang  * United States government or any agency thereof requires an export license,
113*22ce4affSfengbojiang  * other governmental approval, or letter of assurance, without first obtaining
114*22ce4affSfengbojiang  * such license, approval or letter.
115*22ce4affSfengbojiang  *
116*22ce4affSfengbojiang  *****************************************************************************
117*22ce4affSfengbojiang  *
118*22ce4affSfengbojiang  * Alternatively, you may choose to be licensed under the terms of the
119*22ce4affSfengbojiang  * following license:
120*22ce4affSfengbojiang  *
121a9643ea8Slogwang  * Redistribution and use in source and binary forms, with or without
122a9643ea8Slogwang  * modification, are permitted provided that the following conditions
123a9643ea8Slogwang  * are met:
124a9643ea8Slogwang  * 1. Redistributions of source code must retain the above copyright
125a9643ea8Slogwang  *    notice, this list of conditions, and the following disclaimer,
126a9643ea8Slogwang  *    without modification.
127a9643ea8Slogwang  * 2. Redistributions in binary form must reproduce at minimum a disclaimer
128a9643ea8Slogwang  *    substantially similar to the "NO WARRANTY" disclaimer below
129a9643ea8Slogwang  *    ("Disclaimer") and any redistribution must be conditioned upon
130a9643ea8Slogwang  *    including a substantially similar Disclaimer requirement for further
131a9643ea8Slogwang  *    binary redistribution.
132a9643ea8Slogwang  * 3. Neither the names of the above-listed copyright holders nor the names
133a9643ea8Slogwang  *    of any contributors may be used to endorse or promote products derived
134a9643ea8Slogwang  *    from this software without specific prior written permission.
135a9643ea8Slogwang  *
136*22ce4affSfengbojiang  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
137*22ce4affSfengbojiang  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
138*22ce4affSfengbojiang  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
139*22ce4affSfengbojiang  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
140*22ce4affSfengbojiang  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
141*22ce4affSfengbojiang  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
142*22ce4affSfengbojiang  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
143*22ce4affSfengbojiang  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
144*22ce4affSfengbojiang  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
145*22ce4affSfengbojiang  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
146*22ce4affSfengbojiang  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
147*22ce4affSfengbojiang  *
148*22ce4affSfengbojiang  * Alternatively, you may choose to be licensed under the terms of the
149a9643ea8Slogwang  * GNU General Public License ("GPL") version 2 as published by the Free
150a9643ea8Slogwang  * Software Foundation.
151a9643ea8Slogwang  *
152*22ce4affSfengbojiang  *****************************************************************************/
153a9643ea8Slogwang 
154a9643ea8Slogwang #ifndef __AMLCODE_H__
155a9643ea8Slogwang #define __AMLCODE_H__
156a9643ea8Slogwang 
157a9643ea8Slogwang /* primary opcodes */
158a9643ea8Slogwang 
159a9643ea8Slogwang #define AML_ZERO_OP                 (UINT16) 0x00
160a9643ea8Slogwang #define AML_ONE_OP                  (UINT16) 0x01
161a9643ea8Slogwang #define AML_ALIAS_OP                (UINT16) 0x06
162a9643ea8Slogwang #define AML_NAME_OP                 (UINT16) 0x08
163a9643ea8Slogwang #define AML_BYTE_OP                 (UINT16) 0x0a
164a9643ea8Slogwang #define AML_WORD_OP                 (UINT16) 0x0b
165a9643ea8Slogwang #define AML_DWORD_OP                (UINT16) 0x0c
166a9643ea8Slogwang #define AML_STRING_OP               (UINT16) 0x0d
167a9643ea8Slogwang #define AML_QWORD_OP                (UINT16) 0x0e     /* ACPI 2.0 */
168a9643ea8Slogwang #define AML_SCOPE_OP                (UINT16) 0x10
169a9643ea8Slogwang #define AML_BUFFER_OP               (UINT16) 0x11
170a9643ea8Slogwang #define AML_PACKAGE_OP              (UINT16) 0x12
171*22ce4affSfengbojiang #define AML_VARIABLE_PACKAGE_OP     (UINT16) 0x13     /* ACPI 2.0 */
172a9643ea8Slogwang #define AML_METHOD_OP               (UINT16) 0x14
173a9643ea8Slogwang #define AML_EXTERNAL_OP             (UINT16) 0x15     /* ACPI 6.0 */
174a9643ea8Slogwang #define AML_DUAL_NAME_PREFIX        (UINT16) 0x2e
175*22ce4affSfengbojiang #define AML_MULTI_NAME_PREFIX       (UINT16) 0x2f
176*22ce4affSfengbojiang #define AML_EXTENDED_PREFIX         (UINT16) 0x5b
177a9643ea8Slogwang #define AML_ROOT_PREFIX             (UINT16) 0x5c
178a9643ea8Slogwang #define AML_PARENT_PREFIX           (UINT16) 0x5e
179*22ce4affSfengbojiang #define AML_FIRST_LOCAL_OP          (UINT16) 0x60     /* Used for Local op # calculations */
180a9643ea8Slogwang #define AML_LOCAL0                  (UINT16) 0x60
181a9643ea8Slogwang #define AML_LOCAL1                  (UINT16) 0x61
182a9643ea8Slogwang #define AML_LOCAL2                  (UINT16) 0x62
183a9643ea8Slogwang #define AML_LOCAL3                  (UINT16) 0x63
184a9643ea8Slogwang #define AML_LOCAL4                  (UINT16) 0x64
185a9643ea8Slogwang #define AML_LOCAL5                  (UINT16) 0x65
186a9643ea8Slogwang #define AML_LOCAL6                  (UINT16) 0x66
187a9643ea8Slogwang #define AML_LOCAL7                  (UINT16) 0x67
188*22ce4affSfengbojiang #define AML_FIRST_ARG_OP            (UINT16) 0x68     /* Used for Arg op # calculations */
189a9643ea8Slogwang #define AML_ARG0                    (UINT16) 0x68
190a9643ea8Slogwang #define AML_ARG1                    (UINT16) 0x69
191a9643ea8Slogwang #define AML_ARG2                    (UINT16) 0x6a
192a9643ea8Slogwang #define AML_ARG3                    (UINT16) 0x6b
193a9643ea8Slogwang #define AML_ARG4                    (UINT16) 0x6c
194a9643ea8Slogwang #define AML_ARG5                    (UINT16) 0x6d
195a9643ea8Slogwang #define AML_ARG6                    (UINT16) 0x6e
196a9643ea8Slogwang #define AML_STORE_OP                (UINT16) 0x70
197a9643ea8Slogwang #define AML_REF_OF_OP               (UINT16) 0x71
198a9643ea8Slogwang #define AML_ADD_OP                  (UINT16) 0x72
199*22ce4affSfengbojiang #define AML_CONCATENATE_OP          (UINT16) 0x73
200a9643ea8Slogwang #define AML_SUBTRACT_OP             (UINT16) 0x74
201a9643ea8Slogwang #define AML_INCREMENT_OP            (UINT16) 0x75
202a9643ea8Slogwang #define AML_DECREMENT_OP            (UINT16) 0x76
203a9643ea8Slogwang #define AML_MULTIPLY_OP             (UINT16) 0x77
204a9643ea8Slogwang #define AML_DIVIDE_OP               (UINT16) 0x78
205a9643ea8Slogwang #define AML_SHIFT_LEFT_OP           (UINT16) 0x79
206a9643ea8Slogwang #define AML_SHIFT_RIGHT_OP          (UINT16) 0x7a
207a9643ea8Slogwang #define AML_BIT_AND_OP              (UINT16) 0x7b
208a9643ea8Slogwang #define AML_BIT_NAND_OP             (UINT16) 0x7c
209a9643ea8Slogwang #define AML_BIT_OR_OP               (UINT16) 0x7d
210a9643ea8Slogwang #define AML_BIT_NOR_OP              (UINT16) 0x7e
211a9643ea8Slogwang #define AML_BIT_XOR_OP              (UINT16) 0x7f
212a9643ea8Slogwang #define AML_BIT_NOT_OP              (UINT16) 0x80
213a9643ea8Slogwang #define AML_FIND_SET_LEFT_BIT_OP    (UINT16) 0x81
214a9643ea8Slogwang #define AML_FIND_SET_RIGHT_BIT_OP   (UINT16) 0x82
215a9643ea8Slogwang #define AML_DEREF_OF_OP             (UINT16) 0x83
216*22ce4affSfengbojiang #define AML_CONCATENATE_TEMPLATE_OP (UINT16) 0x84     /* ACPI 2.0 */
217a9643ea8Slogwang #define AML_MOD_OP                  (UINT16) 0x85     /* ACPI 2.0 */
218a9643ea8Slogwang #define AML_NOTIFY_OP               (UINT16) 0x86
219a9643ea8Slogwang #define AML_SIZE_OF_OP              (UINT16) 0x87
220a9643ea8Slogwang #define AML_INDEX_OP                (UINT16) 0x88
221a9643ea8Slogwang #define AML_MATCH_OP                (UINT16) 0x89
222a9643ea8Slogwang #define AML_CREATE_DWORD_FIELD_OP   (UINT16) 0x8a
223a9643ea8Slogwang #define AML_CREATE_WORD_FIELD_OP    (UINT16) 0x8b
224a9643ea8Slogwang #define AML_CREATE_BYTE_FIELD_OP    (UINT16) 0x8c
225a9643ea8Slogwang #define AML_CREATE_BIT_FIELD_OP     (UINT16) 0x8d
226a9643ea8Slogwang #define AML_OBJECT_TYPE_OP          (UINT16) 0x8e
227a9643ea8Slogwang #define AML_CREATE_QWORD_FIELD_OP   (UINT16) 0x8f     /* ACPI 2.0 */
228*22ce4affSfengbojiang #define AML_LOGICAL_AND_OP          (UINT16) 0x90
229*22ce4affSfengbojiang #define AML_LOGICAL_OR_OP           (UINT16) 0x91
230*22ce4affSfengbojiang #define AML_LOGICAL_NOT_OP          (UINT16) 0x92
231*22ce4affSfengbojiang #define AML_LOGICAL_EQUAL_OP        (UINT16) 0x93
232*22ce4affSfengbojiang #define AML_LOGICAL_GREATER_OP      (UINT16) 0x94
233*22ce4affSfengbojiang #define AML_LOGICAL_LESS_OP         (UINT16) 0x95
234a9643ea8Slogwang #define AML_TO_BUFFER_OP            (UINT16) 0x96     /* ACPI 2.0 */
235*22ce4affSfengbojiang #define AML_TO_DECIMAL_STRING_OP    (UINT16) 0x97     /* ACPI 2.0 */
236*22ce4affSfengbojiang #define AML_TO_HEX_STRING_OP        (UINT16) 0x98     /* ACPI 2.0 */
237a9643ea8Slogwang #define AML_TO_INTEGER_OP           (UINT16) 0x99     /* ACPI 2.0 */
238a9643ea8Slogwang #define AML_TO_STRING_OP            (UINT16) 0x9c     /* ACPI 2.0 */
239*22ce4affSfengbojiang #define AML_COPY_OBJECT_OP          (UINT16) 0x9d     /* ACPI 2.0 */
240a9643ea8Slogwang #define AML_MID_OP                  (UINT16) 0x9e     /* ACPI 2.0 */
241a9643ea8Slogwang #define AML_CONTINUE_OP             (UINT16) 0x9f     /* ACPI 2.0 */
242a9643ea8Slogwang #define AML_IF_OP                   (UINT16) 0xa0
243a9643ea8Slogwang #define AML_ELSE_OP                 (UINT16) 0xa1
244a9643ea8Slogwang #define AML_WHILE_OP                (UINT16) 0xa2
245a9643ea8Slogwang #define AML_NOOP_OP                 (UINT16) 0xa3
246a9643ea8Slogwang #define AML_RETURN_OP               (UINT16) 0xa4
247a9643ea8Slogwang #define AML_BREAK_OP                (UINT16) 0xa5
248*22ce4affSfengbojiang #define AML_COMMENT_OP              (UINT16) 0xa9
249*22ce4affSfengbojiang #define AML_BREAKPOINT_OP          (UINT16) 0xcc
250a9643ea8Slogwang #define AML_ONES_OP                 (UINT16) 0xff
251a9643ea8Slogwang 
252a9643ea8Slogwang 
253*22ce4affSfengbojiang /*
254*22ce4affSfengbojiang  * Combination opcodes (actually two one-byte opcodes)
255*22ce4affSfengbojiang  * Used by the disassembler and iASL compiler
256*22ce4affSfengbojiang  */
257*22ce4affSfengbojiang #define AML_LOGICAL_GREATER_EQUAL_OP (UINT16) 0x9295    /* LNot (LLess) */
258*22ce4affSfengbojiang #define AML_LOGICAL_LESS_EQUAL_OP    (UINT16) 0x9294    /* LNot (LGreater) */
259*22ce4affSfengbojiang #define AML_LOGICAL_NOT_EQUAL_OP     (UINT16) 0x9293    /* LNot (LEqual) */
260*22ce4affSfengbojiang 
261*22ce4affSfengbojiang 
262*22ce4affSfengbojiang /* Prefixed (2-byte) opcodes (with AML_EXTENDED_PREFIX) */
263*22ce4affSfengbojiang 
264*22ce4affSfengbojiang #define AML_EXTENDED_OPCODE         (UINT16) 0x5b00     /* Prefix for 2-byte opcodes */
265a9643ea8Slogwang 
266a9643ea8Slogwang #define AML_MUTEX_OP                (UINT16) 0x5b01
267a9643ea8Slogwang #define AML_EVENT_OP                (UINT16) 0x5b02
268*22ce4affSfengbojiang #define AML_SHIFT_RIGHT_BIT_OP      (UINT16) 0x5b10     /* Obsolete, not in ACPI spec */
269*22ce4affSfengbojiang #define AML_SHIFT_LEFT_BIT_OP       (UINT16) 0x5b11     /* Obsolete, not in ACPI spec */
270*22ce4affSfengbojiang #define AML_CONDITIONAL_REF_OF_OP   (UINT16) 0x5b12
271a9643ea8Slogwang #define AML_CREATE_FIELD_OP         (UINT16) 0x5b13
272a9643ea8Slogwang #define AML_LOAD_TABLE_OP           (UINT16) 0x5b1f     /* ACPI 2.0 */
273a9643ea8Slogwang #define AML_LOAD_OP                 (UINT16) 0x5b20
274a9643ea8Slogwang #define AML_STALL_OP                (UINT16) 0x5b21
275a9643ea8Slogwang #define AML_SLEEP_OP                (UINT16) 0x5b22
276a9643ea8Slogwang #define AML_ACQUIRE_OP              (UINT16) 0x5b23
277a9643ea8Slogwang #define AML_SIGNAL_OP               (UINT16) 0x5b24
278a9643ea8Slogwang #define AML_WAIT_OP                 (UINT16) 0x5b25
279a9643ea8Slogwang #define AML_RESET_OP                (UINT16) 0x5b26
280a9643ea8Slogwang #define AML_RELEASE_OP              (UINT16) 0x5b27
281a9643ea8Slogwang #define AML_FROM_BCD_OP             (UINT16) 0x5b28
282a9643ea8Slogwang #define AML_TO_BCD_OP               (UINT16) 0x5b29
283a9643ea8Slogwang #define AML_UNLOAD_OP               (UINT16) 0x5b2a
284a9643ea8Slogwang #define AML_REVISION_OP             (UINT16) 0x5b30
285a9643ea8Slogwang #define AML_DEBUG_OP                (UINT16) 0x5b31
286a9643ea8Slogwang #define AML_FATAL_OP                (UINT16) 0x5b32
287a9643ea8Slogwang #define AML_TIMER_OP                (UINT16) 0x5b33     /* ACPI 3.0 */
288a9643ea8Slogwang #define AML_REGION_OP               (UINT16) 0x5b80
289a9643ea8Slogwang #define AML_FIELD_OP                (UINT16) 0x5b81
290a9643ea8Slogwang #define AML_DEVICE_OP               (UINT16) 0x5b82
291a9643ea8Slogwang #define AML_PROCESSOR_OP            (UINT16) 0x5b83
292*22ce4affSfengbojiang #define AML_POWER_RESOURCE_OP       (UINT16) 0x5b84
293a9643ea8Slogwang #define AML_THERMAL_ZONE_OP         (UINT16) 0x5b85
294a9643ea8Slogwang #define AML_INDEX_FIELD_OP          (UINT16) 0x5b86
295a9643ea8Slogwang #define AML_BANK_FIELD_OP           (UINT16) 0x5b87
296a9643ea8Slogwang #define AML_DATA_REGION_OP          (UINT16) 0x5b88     /* ACPI 2.0 */
297a9643ea8Slogwang 
298a9643ea8Slogwang 
299a9643ea8Slogwang /*
300a9643ea8Slogwang  * Opcodes for "Field" operators
301a9643ea8Slogwang  */
302a9643ea8Slogwang #define AML_FIELD_OFFSET_OP         (UINT8) 0x00
303a9643ea8Slogwang #define AML_FIELD_ACCESS_OP         (UINT8) 0x01
304a9643ea8Slogwang #define AML_FIELD_CONNECTION_OP     (UINT8) 0x02        /* ACPI 5.0 */
305a9643ea8Slogwang #define AML_FIELD_EXT_ACCESS_OP     (UINT8) 0x03        /* ACPI 5.0 */
306a9643ea8Slogwang 
307a9643ea8Slogwang 
308a9643ea8Slogwang /*
309a9643ea8Slogwang  * Internal opcodes
310a9643ea8Slogwang  * Use only "Unknown" AML opcodes, don't attempt to use
311a9643ea8Slogwang  * any valid ACPI ASCII values (A-Z, 0-9, '-')
312a9643ea8Slogwang  */
313a9643ea8Slogwang #define AML_INT_NAMEPATH_OP         (UINT16) 0x002d
314a9643ea8Slogwang #define AML_INT_NAMEDFIELD_OP       (UINT16) 0x0030
315a9643ea8Slogwang #define AML_INT_RESERVEDFIELD_OP    (UINT16) 0x0031
316a9643ea8Slogwang #define AML_INT_ACCESSFIELD_OP      (UINT16) 0x0032
317a9643ea8Slogwang #define AML_INT_BYTELIST_OP         (UINT16) 0x0033
318a9643ea8Slogwang #define AML_INT_METHODCALL_OP       (UINT16) 0x0035
319a9643ea8Slogwang #define AML_INT_RETURN_VALUE_OP     (UINT16) 0x0036
320a9643ea8Slogwang #define AML_INT_EVAL_SUBTREE_OP     (UINT16) 0x0037
321a9643ea8Slogwang #define AML_INT_CONNECTION_OP       (UINT16) 0x0038
322a9643ea8Slogwang #define AML_INT_EXTACCESSFIELD_OP   (UINT16) 0x0039
323a9643ea8Slogwang 
324a9643ea8Slogwang #define ARG_NONE                    0x0
325a9643ea8Slogwang 
326a9643ea8Slogwang /*
327a9643ea8Slogwang  * Argument types for the AML Parser
328a9643ea8Slogwang  * Each field in the ArgTypes UINT32 is 5 bits, allowing for a maximum of 6 arguments.
329a9643ea8Slogwang  * There can be up to 31 unique argument types
330a9643ea8Slogwang  * Zero is reserved as end-of-list indicator
331a9643ea8Slogwang  */
332a9643ea8Slogwang #define ARGP_BYTEDATA               0x01
333a9643ea8Slogwang #define ARGP_BYTELIST               0x02
334a9643ea8Slogwang #define ARGP_CHARLIST               0x03
335a9643ea8Slogwang #define ARGP_DATAOBJ                0x04
336a9643ea8Slogwang #define ARGP_DATAOBJLIST            0x05
337a9643ea8Slogwang #define ARGP_DWORDDATA              0x06
338a9643ea8Slogwang #define ARGP_FIELDLIST              0x07
339a9643ea8Slogwang #define ARGP_NAME                   0x08
340a9643ea8Slogwang #define ARGP_NAMESTRING             0x09
341a9643ea8Slogwang #define ARGP_OBJLIST                0x0A
342a9643ea8Slogwang #define ARGP_PKGLENGTH              0x0B
343a9643ea8Slogwang #define ARGP_SUPERNAME              0x0C
344a9643ea8Slogwang #define ARGP_TARGET                 0x0D
345a9643ea8Slogwang #define ARGP_TERMARG                0x0E
346a9643ea8Slogwang #define ARGP_TERMLIST               0x0F
347a9643ea8Slogwang #define ARGP_WORDDATA               0x10
348a9643ea8Slogwang #define ARGP_QWORDDATA              0x11
349a9643ea8Slogwang #define ARGP_SIMPLENAME             0x12 /* NameString | LocalTerm | ArgTerm */
350a9643ea8Slogwang #define ARGP_NAME_OR_REF            0x13 /* For ObjectType only */
351*22ce4affSfengbojiang #define ARGP_MAX                    0x13
352*22ce4affSfengbojiang #define ARGP_COMMENT                0x14
353a9643ea8Slogwang 
354a9643ea8Slogwang /*
355a9643ea8Slogwang  * Resolved argument types for the AML Interpreter
356a9643ea8Slogwang  * Each field in the ArgTypes UINT32 is 5 bits, allowing for a maximum of 6 arguments.
357a9643ea8Slogwang  * There can be up to 31 unique argument types (0 is end-of-arg-list indicator)
358a9643ea8Slogwang  *
359a9643ea8Slogwang  * Note1: These values are completely independent from the ACPI_TYPEs
360a9643ea8Slogwang  *        i.e., ARGI_INTEGER != ACPI_TYPE_INTEGER
361a9643ea8Slogwang  *
362a9643ea8Slogwang  * Note2: If and when 5 bits becomes insufficient, it would probably be best
363a9643ea8Slogwang  * to convert to a 6-byte array of argument types, allowing 8 bits per argument.
364a9643ea8Slogwang  */
365a9643ea8Slogwang 
366a9643ea8Slogwang /* Single, simple types */
367a9643ea8Slogwang 
368a9643ea8Slogwang #define ARGI_ANYTYPE                0x01    /* Don't care */
369a9643ea8Slogwang #define ARGI_PACKAGE                0x02
370a9643ea8Slogwang #define ARGI_EVENT                  0x03
371a9643ea8Slogwang #define ARGI_MUTEX                  0x04
372a9643ea8Slogwang #define ARGI_DDBHANDLE              0x05
373a9643ea8Slogwang 
374a9643ea8Slogwang /* Interchangeable types (via implicit conversion) */
375a9643ea8Slogwang 
376a9643ea8Slogwang #define ARGI_INTEGER                0x06
377a9643ea8Slogwang #define ARGI_STRING                 0x07
378a9643ea8Slogwang #define ARGI_BUFFER                 0x08
379a9643ea8Slogwang #define ARGI_BUFFER_OR_STRING       0x09    /* Used by MID op only */
380a9643ea8Slogwang #define ARGI_COMPUTEDATA            0x0A    /* Buffer, String, or Integer */
381a9643ea8Slogwang 
382a9643ea8Slogwang /* Reference objects */
383a9643ea8Slogwang 
384a9643ea8Slogwang #define ARGI_INTEGER_REF            0x0B
385a9643ea8Slogwang #define ARGI_OBJECT_REF             0x0C
386a9643ea8Slogwang #define ARGI_DEVICE_REF             0x0D
387a9643ea8Slogwang #define ARGI_REFERENCE              0x0E
388a9643ea8Slogwang #define ARGI_TARGETREF              0x0F    /* Target, subject to implicit conversion */
389a9643ea8Slogwang #define ARGI_FIXED_TARGET           0x10    /* Target, no implicit conversion */
390a9643ea8Slogwang #define ARGI_SIMPLE_TARGET          0x11    /* Name, Local, Arg -- no implicit conversion */
391a9643ea8Slogwang #define ARGI_STORE_TARGET           0x12    /* Target for store is TARGETREF + package objects */
392a9643ea8Slogwang 
393a9643ea8Slogwang /* Multiple/complex types */
394a9643ea8Slogwang 
395a9643ea8Slogwang #define ARGI_DATAOBJECT             0x13    /* Buffer, String, package or reference to a Node - Used only by SizeOf operator*/
396a9643ea8Slogwang #define ARGI_COMPLEXOBJ             0x14    /* Buffer, String, or package (Used by INDEX op only) */
397a9643ea8Slogwang #define ARGI_REF_OR_STRING          0x15    /* Reference or String (Used by DEREFOF op only) */
398a9643ea8Slogwang #define ARGI_REGION_OR_BUFFER       0x16    /* Used by LOAD op only */
399a9643ea8Slogwang #define ARGI_DATAREFOBJ             0x17
400a9643ea8Slogwang 
401a9643ea8Slogwang /* Note: types above can expand to 0x1F maximum */
402a9643ea8Slogwang 
403a9643ea8Slogwang #define ARGI_INVALID_OPCODE         0xFFFFFFFF
404a9643ea8Slogwang 
405a9643ea8Slogwang 
406a9643ea8Slogwang /*
407*22ce4affSfengbojiang  * Some of the flags and types below are of the form:
408*22ce4affSfengbojiang  *
409*22ce4affSfengbojiang  * AML_FLAGS_EXEC_#A_#T,#R, or
410*22ce4affSfengbojiang  * AML_TYPE_EXEC_#A_#T,#R where:
411*22ce4affSfengbojiang  *
412*22ce4affSfengbojiang  *      #A is the number of required arguments
413*22ce4affSfengbojiang  *      #T is the number of target operands
414*22ce4affSfengbojiang  *      #R indicates whether there is a return value
415*22ce4affSfengbojiang  *
416*22ce4affSfengbojiang  * These types are used for the top-level dispatch of the AML
417*22ce4affSfengbojiang  * opcode. They group similar operators that can share common
418*22ce4affSfengbojiang  * front-end code before dispatch to the final code that implements
419*22ce4affSfengbojiang  * the operator.
420a9643ea8Slogwang  */
421a9643ea8Slogwang 
422a9643ea8Slogwang /*
423*22ce4affSfengbojiang  * Opcode information flags
424a9643ea8Slogwang  */
425a9643ea8Slogwang #define AML_LOGICAL                 0x0001
426a9643ea8Slogwang #define AML_LOGICAL_NUMERIC         0x0002
427a9643ea8Slogwang #define AML_MATH                    0x0004
428a9643ea8Slogwang #define AML_CREATE                  0x0008
429a9643ea8Slogwang #define AML_FIELD                   0x0010
430a9643ea8Slogwang #define AML_DEFER                   0x0020
431a9643ea8Slogwang #define AML_NAMED                   0x0040
432a9643ea8Slogwang #define AML_NSNODE                  0x0080
433a9643ea8Slogwang #define AML_NSOPCODE                0x0100
434a9643ea8Slogwang #define AML_NSOBJECT                0x0200
435a9643ea8Slogwang #define AML_HAS_RETVAL              0x0400
436a9643ea8Slogwang #define AML_HAS_TARGET              0x0800
437a9643ea8Slogwang #define AML_HAS_ARGS                0x1000
438a9643ea8Slogwang #define AML_CONSTANT                0x2000
439a9643ea8Slogwang #define AML_NO_OPERAND_RESOLVE      0x4000
440a9643ea8Slogwang 
441*22ce4affSfengbojiang /* Convenient flag groupings of the flags above */
442a9643ea8Slogwang 
443a9643ea8Slogwang #define AML_FLAGS_EXEC_0A_0T_1R                                     AML_HAS_RETVAL
444a9643ea8Slogwang #define AML_FLAGS_EXEC_1A_0T_0R     AML_HAS_ARGS                                   /* Monadic1  */
445a9643ea8Slogwang #define AML_FLAGS_EXEC_1A_0T_1R     AML_HAS_ARGS |                  AML_HAS_RETVAL /* Monadic2  */
446a9643ea8Slogwang #define AML_FLAGS_EXEC_1A_1T_0R     AML_HAS_ARGS | AML_HAS_TARGET
447a9643ea8Slogwang #define AML_FLAGS_EXEC_1A_1T_1R     AML_HAS_ARGS | AML_HAS_TARGET | AML_HAS_RETVAL /* Monadic2R */
448a9643ea8Slogwang #define AML_FLAGS_EXEC_2A_0T_0R     AML_HAS_ARGS                                   /* Dyadic1   */
449a9643ea8Slogwang #define AML_FLAGS_EXEC_2A_0T_1R     AML_HAS_ARGS |                  AML_HAS_RETVAL /* Dyadic2   */
450a9643ea8Slogwang #define AML_FLAGS_EXEC_2A_1T_1R     AML_HAS_ARGS | AML_HAS_TARGET | AML_HAS_RETVAL /* Dyadic2R  */
451a9643ea8Slogwang #define AML_FLAGS_EXEC_2A_2T_1R     AML_HAS_ARGS | AML_HAS_TARGET | AML_HAS_RETVAL
452a9643ea8Slogwang #define AML_FLAGS_EXEC_3A_0T_0R     AML_HAS_ARGS
453a9643ea8Slogwang #define AML_FLAGS_EXEC_3A_1T_1R     AML_HAS_ARGS | AML_HAS_TARGET | AML_HAS_RETVAL
454a9643ea8Slogwang #define AML_FLAGS_EXEC_6A_0T_1R     AML_HAS_ARGS |                  AML_HAS_RETVAL
455a9643ea8Slogwang 
456a9643ea8Slogwang 
457a9643ea8Slogwang /*
458a9643ea8Slogwang  * The opcode Type is used in a dispatch table, do not change
459*22ce4affSfengbojiang  * or add anything new without updating the table.
460a9643ea8Slogwang  */
461*22ce4affSfengbojiang #define AML_TYPE_EXEC_0A_0T_1R      0x00 /* 0 Args, 0 Target, 1 RetVal */
462*22ce4affSfengbojiang #define AML_TYPE_EXEC_1A_0T_0R      0x01 /* 1 Args, 0 Target, 0 RetVal */
463*22ce4affSfengbojiang #define AML_TYPE_EXEC_1A_0T_1R      0x02 /* 1 Args, 0 Target, 1 RetVal */
464*22ce4affSfengbojiang #define AML_TYPE_EXEC_1A_1T_0R      0x03 /* 1 Args, 1 Target, 0 RetVal */
465*22ce4affSfengbojiang #define AML_TYPE_EXEC_1A_1T_1R      0x04 /* 1 Args, 1 Target, 1 RetVal */
466*22ce4affSfengbojiang #define AML_TYPE_EXEC_2A_0T_0R      0x05 /* 2 Args, 0 Target, 0 RetVal */
467*22ce4affSfengbojiang #define AML_TYPE_EXEC_2A_0T_1R      0x06 /* 2 Args, 0 Target, 1 RetVal */
468*22ce4affSfengbojiang #define AML_TYPE_EXEC_2A_1T_1R      0x07 /* 2 Args, 1 Target, 1 RetVal */
469*22ce4affSfengbojiang #define AML_TYPE_EXEC_2A_2T_1R      0x08 /* 2 Args, 2 Target, 1 RetVal */
470*22ce4affSfengbojiang #define AML_TYPE_EXEC_3A_0T_0R      0x09 /* 3 Args, 0 Target, 0 RetVal */
471*22ce4affSfengbojiang #define AML_TYPE_EXEC_3A_1T_1R      0x0A /* 3 Args, 1 Target, 1 RetVal */
472*22ce4affSfengbojiang #define AML_TYPE_EXEC_6A_0T_1R      0x0B /* 6 Args, 0 Target, 1 RetVal */
473a9643ea8Slogwang /* End of types used in dispatch table */
474a9643ea8Slogwang 
475*22ce4affSfengbojiang #define AML_TYPE_LITERAL            0x0C
476*22ce4affSfengbojiang #define AML_TYPE_CONSTANT           0x0D
477*22ce4affSfengbojiang #define AML_TYPE_METHOD_ARGUMENT    0x0E
478*22ce4affSfengbojiang #define AML_TYPE_LOCAL_VARIABLE     0x0F
479*22ce4affSfengbojiang #define AML_TYPE_DATA_TERM          0x10
480a9643ea8Slogwang 
481a9643ea8Slogwang /* Generic for an op that returns a value */
482a9643ea8Slogwang 
483*22ce4affSfengbojiang #define AML_TYPE_METHOD_CALL        0x11
484a9643ea8Slogwang 
485*22ce4affSfengbojiang /* Miscellaneous types */
486a9643ea8Slogwang 
487*22ce4affSfengbojiang #define AML_TYPE_CREATE_FIELD       0x12
488*22ce4affSfengbojiang #define AML_TYPE_CREATE_OBJECT      0x13
489*22ce4affSfengbojiang #define AML_TYPE_CONTROL            0x14
490*22ce4affSfengbojiang #define AML_TYPE_NAMED_NO_OBJ       0x15
491*22ce4affSfengbojiang #define AML_TYPE_NAMED_FIELD        0x16
492*22ce4affSfengbojiang #define AML_TYPE_NAMED_SIMPLE       0x17
493*22ce4affSfengbojiang #define AML_TYPE_NAMED_COMPLEX      0x18
494*22ce4affSfengbojiang #define AML_TYPE_RETURN             0x19
495*22ce4affSfengbojiang #define AML_TYPE_UNDEFINED          0x1A
496*22ce4affSfengbojiang #define AML_TYPE_BOGUS              0x1B
497a9643ea8Slogwang 
498a9643ea8Slogwang /* AML Package Length encodings */
499a9643ea8Slogwang 
500a9643ea8Slogwang #define ACPI_AML_PACKAGE_TYPE1      0x40
501a9643ea8Slogwang #define ACPI_AML_PACKAGE_TYPE2      0x4000
502a9643ea8Slogwang #define ACPI_AML_PACKAGE_TYPE3      0x400000
503a9643ea8Slogwang #define ACPI_AML_PACKAGE_TYPE4      0x40000000
504a9643ea8Slogwang 
505a9643ea8Slogwang /*
506a9643ea8Slogwang  * Opcode classes
507a9643ea8Slogwang  */
508a9643ea8Slogwang #define AML_CLASS_EXECUTE           0x00
509a9643ea8Slogwang #define AML_CLASS_CREATE            0x01
510a9643ea8Slogwang #define AML_CLASS_ARGUMENT          0x02
511a9643ea8Slogwang #define AML_CLASS_NAMED_OBJECT      0x03
512a9643ea8Slogwang #define AML_CLASS_CONTROL           0x04
513a9643ea8Slogwang #define AML_CLASS_ASCII             0x05
514a9643ea8Slogwang #define AML_CLASS_PREFIX            0x06
515a9643ea8Slogwang #define AML_CLASS_INTERNAL          0x07
516a9643ea8Slogwang #define AML_CLASS_RETURN_VALUE      0x08
517a9643ea8Slogwang #define AML_CLASS_METHOD_CALL       0x09
518a9643ea8Slogwang #define AML_CLASS_UNKNOWN           0x0A
519a9643ea8Slogwang 
520a9643ea8Slogwang 
521a9643ea8Slogwang /* Comparison operation codes for MatchOp operator */
522a9643ea8Slogwang 
523a9643ea8Slogwang typedef enum
524a9643ea8Slogwang {
525a9643ea8Slogwang     MATCH_MTR                       = 0,
526a9643ea8Slogwang     MATCH_MEQ                       = 1,
527a9643ea8Slogwang     MATCH_MLE                       = 2,
528a9643ea8Slogwang     MATCH_MLT                       = 3,
529a9643ea8Slogwang     MATCH_MGE                       = 4,
530a9643ea8Slogwang     MATCH_MGT                       = 5
531a9643ea8Slogwang 
532a9643ea8Slogwang } AML_MATCH_OPERATOR;
533a9643ea8Slogwang 
534a9643ea8Slogwang #define MAX_MATCH_OPERATOR          5
535a9643ea8Slogwang 
536a9643ea8Slogwang 
537a9643ea8Slogwang /*
538a9643ea8Slogwang  * FieldFlags
539a9643ea8Slogwang  *
540a9643ea8Slogwang  * This byte is extracted from the AML and includes three separate
541a9643ea8Slogwang  * pieces of information about the field:
542a9643ea8Slogwang  * 1) The field access type
543a9643ea8Slogwang  * 2) The field update rule
544a9643ea8Slogwang  * 3) The lock rule for the field
545a9643ea8Slogwang  *
546a9643ea8Slogwang  * Bits 00 - 03 : AccessType (AnyAcc, ByteAcc, etc.)
547a9643ea8Slogwang  *      04      : LockRule (1 == Lock)
548a9643ea8Slogwang  *      05 - 06 : UpdateRule
549a9643ea8Slogwang  */
550a9643ea8Slogwang #define AML_FIELD_ACCESS_TYPE_MASK  0x0F
551a9643ea8Slogwang #define AML_FIELD_LOCK_RULE_MASK    0x10
552a9643ea8Slogwang #define AML_FIELD_UPDATE_RULE_MASK  0x60
553a9643ea8Slogwang 
554a9643ea8Slogwang 
555a9643ea8Slogwang /* 1) Field Access Types */
556a9643ea8Slogwang 
557a9643ea8Slogwang typedef enum
558a9643ea8Slogwang {
559a9643ea8Slogwang     AML_FIELD_ACCESS_ANY            = 0x00,
560a9643ea8Slogwang     AML_FIELD_ACCESS_BYTE           = 0x01,
561a9643ea8Slogwang     AML_FIELD_ACCESS_WORD           = 0x02,
562a9643ea8Slogwang     AML_FIELD_ACCESS_DWORD          = 0x03,
563a9643ea8Slogwang     AML_FIELD_ACCESS_QWORD          = 0x04,    /* ACPI 2.0 */
564a9643ea8Slogwang     AML_FIELD_ACCESS_BUFFER         = 0x05     /* ACPI 2.0 */
565a9643ea8Slogwang 
566a9643ea8Slogwang } AML_ACCESS_TYPE;
567a9643ea8Slogwang 
568a9643ea8Slogwang 
569a9643ea8Slogwang /* 2) Field Lock Rules */
570a9643ea8Slogwang 
571a9643ea8Slogwang typedef enum
572a9643ea8Slogwang {
573a9643ea8Slogwang     AML_FIELD_LOCK_NEVER            = 0x00,
574a9643ea8Slogwang     AML_FIELD_LOCK_ALWAYS           = 0x10
575a9643ea8Slogwang 
576a9643ea8Slogwang } AML_LOCK_RULE;
577a9643ea8Slogwang 
578a9643ea8Slogwang 
579a9643ea8Slogwang /* 3) Field Update Rules */
580a9643ea8Slogwang 
581a9643ea8Slogwang typedef enum
582a9643ea8Slogwang {
583a9643ea8Slogwang     AML_FIELD_UPDATE_PRESERVE       = 0x00,
584a9643ea8Slogwang     AML_FIELD_UPDATE_WRITE_AS_ONES  = 0x20,
585a9643ea8Slogwang     AML_FIELD_UPDATE_WRITE_AS_ZEROS = 0x40
586a9643ea8Slogwang 
587a9643ea8Slogwang } AML_UPDATE_RULE;
588a9643ea8Slogwang 
589a9643ea8Slogwang 
590a9643ea8Slogwang /*
591a9643ea8Slogwang  * Field Access Attributes.
592a9643ea8Slogwang  * This byte is extracted from the AML via the
593a9643ea8Slogwang  * AccessAs keyword
594a9643ea8Slogwang  */
595a9643ea8Slogwang typedef enum
596a9643ea8Slogwang {
597a9643ea8Slogwang     AML_FIELD_ATTRIB_QUICK              = 0x02,
598*22ce4affSfengbojiang     AML_FIELD_ATTRIB_SEND_RECEIVE       = 0x04,
599a9643ea8Slogwang     AML_FIELD_ATTRIB_BYTE               = 0x06,
600a9643ea8Slogwang     AML_FIELD_ATTRIB_WORD               = 0x08,
601a9643ea8Slogwang     AML_FIELD_ATTRIB_BLOCK              = 0x0A,
602*22ce4affSfengbojiang     AML_FIELD_ATTRIB_BYTES              = 0x0B,
603*22ce4affSfengbojiang     AML_FIELD_ATTRIB_PROCESS_CALL       = 0x0C,
604*22ce4affSfengbojiang     AML_FIELD_ATTRIB_BLOCK_PROCESS_CALL = 0x0D,
605a9643ea8Slogwang     AML_FIELD_ATTRIB_RAW_BYTES          = 0x0E,
606*22ce4affSfengbojiang     AML_FIELD_ATTRIB_RAW_PROCESS_BYTES  = 0x0F
607a9643ea8Slogwang 
608a9643ea8Slogwang } AML_ACCESS_ATTRIBUTE;
609a9643ea8Slogwang 
610a9643ea8Slogwang 
611a9643ea8Slogwang /* Bit fields in the AML MethodFlags byte */
612a9643ea8Slogwang 
613a9643ea8Slogwang #define AML_METHOD_ARG_COUNT        0x07
614a9643ea8Slogwang #define AML_METHOD_SERIALIZED       0x08
615a9643ea8Slogwang #define AML_METHOD_SYNC_LEVEL       0xF0
616a9643ea8Slogwang 
617a9643ea8Slogwang 
618a9643ea8Slogwang #endif /* __AMLCODE_H__ */
619