blob: bed08de7528c20e1762a8c989e89fece2a368bdf [file] [log] [blame]
Linus Torvalds1da177e2005-04-16 15:20:36 -07001/******************************************************************************
2 *
3 * Module Name: psopcode - Parser/Interpreter opcode information table
4 *
5 *****************************************************************************/
6
7/*
Bob Mooreb4e104e2011-01-17 11:05:40 +08008 * Copyright (C) 2000 - 2011, Intel Corp.
Linus Torvalds1da177e2005-04-16 15:20:36 -07009 * 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
Linus Torvalds1da177e2005-04-16 15:20:36 -070044#include <acpi/acpi.h>
Len Browne2f7a772009-01-09 00:30:03 -050045#include "accommon.h"
46#include "acparser.h"
47#include "acopcode.h"
48#include "amlcode.h"
Linus Torvalds1da177e2005-04-16 15:20:36 -070049
Linus Torvalds1da177e2005-04-16 15:20:36 -070050#define _COMPONENT ACPI_PARSER
Len Brown4be44fc2005-08-05 00:44:28 -040051ACPI_MODULE_NAME("psopcode")
Linus Torvalds1da177e2005-04-16 15:20:36 -070052
Bob Mooreb7f9f042008-04-10 19:06:40 +040053static const u8 acpi_gbl_argument_count[] =
54 { 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 6 };
Bob Moore4e3156b2008-04-10 19:06:37 +040055
Linus Torvalds1da177e2005-04-16 15:20:36 -070056/*******************************************************************************
57 *
58 * NAME: acpi_gbl_aml_op_info
59 *
60 * DESCRIPTION: Opcode table. Each entry contains <opcode, type, name, operands>
61 * The name is a simple ascii string, the operand specifier is an
62 * ascii string with one letter per operand. The letter specifies
63 * the operand type.
64 *
65 ******************************************************************************/
Bob Moore4e3156b2008-04-10 19:06:37 +040066
Linus Torvalds1da177e2005-04-16 15:20:36 -070067/*
68 * Summary of opcode types/flags
Robert Moore44f6c012005-04-18 22:49:35 -040069 *
Linus Torvalds1da177e2005-04-16 15:20:36 -070070
71 Opcodes that have associated namespace objects (AML_NSOBJECT flag)
72
73 AML_SCOPE_OP
74 AML_DEVICE_OP
75 AML_THERMAL_ZONE_OP
76 AML_METHOD_OP
77 AML_POWER_RES_OP
78 AML_PROCESSOR_OP
79 AML_FIELD_OP
80 AML_INDEX_FIELD_OP
81 AML_BANK_FIELD_OP
82 AML_NAME_OP
83 AML_ALIAS_OP
84 AML_MUTEX_OP
85 AML_EVENT_OP
86 AML_REGION_OP
87 AML_CREATE_FIELD_OP
88 AML_CREATE_BIT_FIELD_OP
89 AML_CREATE_BYTE_FIELD_OP
90 AML_CREATE_WORD_FIELD_OP
91 AML_CREATE_DWORD_FIELD_OP
92 AML_CREATE_QWORD_FIELD_OP
93 AML_INT_NAMEDFIELD_OP
94 AML_INT_METHODCALL_OP
95 AML_INT_NAMEPATH_OP
96
97 Opcodes that are "namespace" opcodes (AML_NSOPCODE flag)
98
99 AML_SCOPE_OP
100 AML_DEVICE_OP
101 AML_THERMAL_ZONE_OP
102 AML_METHOD_OP
103 AML_POWER_RES_OP
104 AML_PROCESSOR_OP
105 AML_FIELD_OP
106 AML_INDEX_FIELD_OP
107 AML_BANK_FIELD_OP
108 AML_NAME_OP
109 AML_ALIAS_OP
110 AML_MUTEX_OP
111 AML_EVENT_OP
112 AML_REGION_OP
113 AML_INT_NAMEDFIELD_OP
114
115 Opcodes that have an associated namespace node (AML_NSNODE flag)
116
117 AML_SCOPE_OP
118 AML_DEVICE_OP
119 AML_THERMAL_ZONE_OP
120 AML_METHOD_OP
121 AML_POWER_RES_OP
122 AML_PROCESSOR_OP
123 AML_NAME_OP
124 AML_ALIAS_OP
125 AML_MUTEX_OP
126 AML_EVENT_OP
127 AML_REGION_OP
128 AML_CREATE_FIELD_OP
129 AML_CREATE_BIT_FIELD_OP
130 AML_CREATE_BYTE_FIELD_OP
131 AML_CREATE_WORD_FIELD_OP
132 AML_CREATE_DWORD_FIELD_OP
133 AML_CREATE_QWORD_FIELD_OP
134 AML_INT_NAMEDFIELD_OP
135 AML_INT_METHODCALL_OP
136 AML_INT_NAMEPATH_OP
137
138 Opcodes that define named ACPI objects (AML_NAMED flag)
139
140 AML_SCOPE_OP
141 AML_DEVICE_OP
142 AML_THERMAL_ZONE_OP
143 AML_METHOD_OP
144 AML_POWER_RES_OP
145 AML_PROCESSOR_OP
146 AML_NAME_OP
147 AML_ALIAS_OP
148 AML_MUTEX_OP
149 AML_EVENT_OP
150 AML_REGION_OP
151 AML_INT_NAMEDFIELD_OP
152
153 Opcodes that contain executable AML as part of the definition that
154 must be deferred until needed
155
156 AML_METHOD_OP
157 AML_VAR_PACKAGE_OP
158 AML_CREATE_FIELD_OP
159 AML_CREATE_BIT_FIELD_OP
160 AML_CREATE_BYTE_FIELD_OP
161 AML_CREATE_WORD_FIELD_OP
162 AML_CREATE_DWORD_FIELD_OP
163 AML_CREATE_QWORD_FIELD_OP
164 AML_REGION_OP
165 AML_BUFFER_OP
166
167 Field opcodes
168
169 AML_CREATE_FIELD_OP
170 AML_FIELD_OP
171 AML_INDEX_FIELD_OP
172 AML_BANK_FIELD_OP
173
174 Field "Create" opcodes
175
176 AML_CREATE_FIELD_OP
177 AML_CREATE_BIT_FIELD_OP
178 AML_CREATE_BYTE_FIELD_OP
179 AML_CREATE_WORD_FIELD_OP
180 AML_CREATE_DWORD_FIELD_OP
181 AML_CREATE_QWORD_FIELD_OP
182
Robert Moore44f6c012005-04-18 22:49:35 -0400183 ******************************************************************************/
Bob Moore4e3156b2008-04-10 19:06:37 +0400184
Linus Torvalds1da177e2005-04-16 15:20:36 -0700185/*
Robert Moore44f6c012005-04-18 22:49:35 -0400186 * Master Opcode information table. A summary of everything we know about each
187 * opcode, all in one place.
Linus Torvalds1da177e2005-04-16 15:20:36 -0700188 */
Len Brown4be44fc2005-08-05 00:44:28 -0400189const struct acpi_opcode_info acpi_gbl_aml_op_info[AML_NUM_OPCODES] = {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700190/*! [Begin] no source code translation */
191/* Index Name Parser Args Interpreter Args ObjectType Class Type Flags */
192
Len Brown4be44fc2005-08-05 00:44:28 -0400193/* 00 */ ACPI_OP("Zero", ARGP_ZERO_OP, ARGI_ZERO_OP, ACPI_TYPE_INTEGER,
Len Brownfd350942007-05-09 23:34:35 -0400194 AML_CLASS_ARGUMENT, AML_TYPE_CONSTANT, AML_CONSTANT),
Len Brown4be44fc2005-08-05 00:44:28 -0400195/* 01 */ ACPI_OP("One", ARGP_ONE_OP, ARGI_ONE_OP, ACPI_TYPE_INTEGER,
Len Brownfd350942007-05-09 23:34:35 -0400196 AML_CLASS_ARGUMENT, AML_TYPE_CONSTANT, AML_CONSTANT),
Len Brown4be44fc2005-08-05 00:44:28 -0400197/* 02 */ ACPI_OP("Alias", ARGP_ALIAS_OP, ARGI_ALIAS_OP,
Len Brownfd350942007-05-09 23:34:35 -0400198 ACPI_TYPE_LOCAL_ALIAS, AML_CLASS_NAMED_OBJECT,
199 AML_TYPE_NAMED_SIMPLE,
200 AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE |
201 AML_NSNODE | AML_NAMED),
Len Brown4be44fc2005-08-05 00:44:28 -0400202/* 03 */ ACPI_OP("Name", ARGP_NAME_OP, ARGI_NAME_OP, ACPI_TYPE_ANY,
Len Brownfd350942007-05-09 23:34:35 -0400203 AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_COMPLEX,
204 AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE |
205 AML_NSNODE | AML_NAMED),
Len Brown4be44fc2005-08-05 00:44:28 -0400206/* 04 */ ACPI_OP("ByteConst", ARGP_BYTE_OP, ARGI_BYTE_OP,
Len Brownfd350942007-05-09 23:34:35 -0400207 ACPI_TYPE_INTEGER, AML_CLASS_ARGUMENT,
208 AML_TYPE_LITERAL, AML_CONSTANT),
Len Brown4be44fc2005-08-05 00:44:28 -0400209/* 05 */ ACPI_OP("WordConst", ARGP_WORD_OP, ARGI_WORD_OP,
Len Brownfd350942007-05-09 23:34:35 -0400210 ACPI_TYPE_INTEGER, AML_CLASS_ARGUMENT,
211 AML_TYPE_LITERAL, AML_CONSTANT),
Len Brown4be44fc2005-08-05 00:44:28 -0400212/* 06 */ ACPI_OP("DwordConst", ARGP_DWORD_OP, ARGI_DWORD_OP,
Len Brownfd350942007-05-09 23:34:35 -0400213 ACPI_TYPE_INTEGER, AML_CLASS_ARGUMENT,
214 AML_TYPE_LITERAL, AML_CONSTANT),
Len Brown4be44fc2005-08-05 00:44:28 -0400215/* 07 */ ACPI_OP("String", ARGP_STRING_OP, ARGI_STRING_OP,
Len Brownfd350942007-05-09 23:34:35 -0400216 ACPI_TYPE_STRING, AML_CLASS_ARGUMENT,
217 AML_TYPE_LITERAL, AML_CONSTANT),
Len Brown4be44fc2005-08-05 00:44:28 -0400218/* 08 */ ACPI_OP("Scope", ARGP_SCOPE_OP, ARGI_SCOPE_OP,
Len Brownfd350942007-05-09 23:34:35 -0400219 ACPI_TYPE_LOCAL_SCOPE, AML_CLASS_NAMED_OBJECT,
220 AML_TYPE_NAMED_NO_OBJ,
221 AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE |
222 AML_NSNODE | AML_NAMED),
Len Brown4be44fc2005-08-05 00:44:28 -0400223/* 09 */ ACPI_OP("Buffer", ARGP_BUFFER_OP, ARGI_BUFFER_OP,
Len Brownfd350942007-05-09 23:34:35 -0400224 ACPI_TYPE_BUFFER, AML_CLASS_CREATE,
225 AML_TYPE_CREATE_OBJECT,
226 AML_HAS_ARGS | AML_DEFER | AML_CONSTANT),
Len Brown4be44fc2005-08-05 00:44:28 -0400227/* 0A */ ACPI_OP("Package", ARGP_PACKAGE_OP, ARGI_PACKAGE_OP,
Len Brownfd350942007-05-09 23:34:35 -0400228 ACPI_TYPE_PACKAGE, AML_CLASS_CREATE,
229 AML_TYPE_CREATE_OBJECT,
230 AML_HAS_ARGS | AML_DEFER | AML_CONSTANT),
Len Brown4be44fc2005-08-05 00:44:28 -0400231/* 0B */ ACPI_OP("Method", ARGP_METHOD_OP, ARGI_METHOD_OP,
Len Brownfd350942007-05-09 23:34:35 -0400232 ACPI_TYPE_METHOD, AML_CLASS_NAMED_OBJECT,
233 AML_TYPE_NAMED_COMPLEX,
234 AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE |
235 AML_NSNODE | AML_NAMED | AML_DEFER),
Len Brown4be44fc2005-08-05 00:44:28 -0400236/* 0C */ ACPI_OP("Local0", ARGP_LOCAL0, ARGI_LOCAL0,
Len Brownfd350942007-05-09 23:34:35 -0400237 ACPI_TYPE_LOCAL_REFERENCE, AML_CLASS_ARGUMENT,
238 AML_TYPE_LOCAL_VARIABLE, 0),
Len Brown4be44fc2005-08-05 00:44:28 -0400239/* 0D */ ACPI_OP("Local1", ARGP_LOCAL1, ARGI_LOCAL1,
Len Brownfd350942007-05-09 23:34:35 -0400240 ACPI_TYPE_LOCAL_REFERENCE, AML_CLASS_ARGUMENT,
241 AML_TYPE_LOCAL_VARIABLE, 0),
Len Brown4be44fc2005-08-05 00:44:28 -0400242/* 0E */ ACPI_OP("Local2", ARGP_LOCAL2, ARGI_LOCAL2,
Len Brownfd350942007-05-09 23:34:35 -0400243 ACPI_TYPE_LOCAL_REFERENCE, AML_CLASS_ARGUMENT,
244 AML_TYPE_LOCAL_VARIABLE, 0),
Len Brown4be44fc2005-08-05 00:44:28 -0400245/* 0F */ ACPI_OP("Local3", ARGP_LOCAL3, ARGI_LOCAL3,
Len Brownfd350942007-05-09 23:34:35 -0400246 ACPI_TYPE_LOCAL_REFERENCE, AML_CLASS_ARGUMENT,
247 AML_TYPE_LOCAL_VARIABLE, 0),
Len Brown4be44fc2005-08-05 00:44:28 -0400248/* 10 */ ACPI_OP("Local4", ARGP_LOCAL4, ARGI_LOCAL4,
Len Brownfd350942007-05-09 23:34:35 -0400249 ACPI_TYPE_LOCAL_REFERENCE, AML_CLASS_ARGUMENT,
250 AML_TYPE_LOCAL_VARIABLE, 0),
Len Brown4be44fc2005-08-05 00:44:28 -0400251/* 11 */ ACPI_OP("Local5", ARGP_LOCAL5, ARGI_LOCAL5,
Len Brownfd350942007-05-09 23:34:35 -0400252 ACPI_TYPE_LOCAL_REFERENCE, AML_CLASS_ARGUMENT,
253 AML_TYPE_LOCAL_VARIABLE, 0),
Len Brown4be44fc2005-08-05 00:44:28 -0400254/* 12 */ ACPI_OP("Local6", ARGP_LOCAL6, ARGI_LOCAL6,
Len Brownfd350942007-05-09 23:34:35 -0400255 ACPI_TYPE_LOCAL_REFERENCE, AML_CLASS_ARGUMENT,
256 AML_TYPE_LOCAL_VARIABLE, 0),
Len Brown4be44fc2005-08-05 00:44:28 -0400257/* 13 */ ACPI_OP("Local7", ARGP_LOCAL7, ARGI_LOCAL7,
Len Brownfd350942007-05-09 23:34:35 -0400258 ACPI_TYPE_LOCAL_REFERENCE, AML_CLASS_ARGUMENT,
259 AML_TYPE_LOCAL_VARIABLE, 0),
Len Brown4be44fc2005-08-05 00:44:28 -0400260/* 14 */ ACPI_OP("Arg0", ARGP_ARG0, ARGI_ARG0,
Len Brownfd350942007-05-09 23:34:35 -0400261 ACPI_TYPE_LOCAL_REFERENCE, AML_CLASS_ARGUMENT,
262 AML_TYPE_METHOD_ARGUMENT, 0),
Len Brown4be44fc2005-08-05 00:44:28 -0400263/* 15 */ ACPI_OP("Arg1", ARGP_ARG1, ARGI_ARG1,
Len Brownfd350942007-05-09 23:34:35 -0400264 ACPI_TYPE_LOCAL_REFERENCE, AML_CLASS_ARGUMENT,
265 AML_TYPE_METHOD_ARGUMENT, 0),
Len Brown4be44fc2005-08-05 00:44:28 -0400266/* 16 */ ACPI_OP("Arg2", ARGP_ARG2, ARGI_ARG2,
Len Brownfd350942007-05-09 23:34:35 -0400267 ACPI_TYPE_LOCAL_REFERENCE, AML_CLASS_ARGUMENT,
268 AML_TYPE_METHOD_ARGUMENT, 0),
Len Brown4be44fc2005-08-05 00:44:28 -0400269/* 17 */ ACPI_OP("Arg3", ARGP_ARG3, ARGI_ARG3,
Len Brownfd350942007-05-09 23:34:35 -0400270 ACPI_TYPE_LOCAL_REFERENCE, AML_CLASS_ARGUMENT,
271 AML_TYPE_METHOD_ARGUMENT, 0),
Len Brown4be44fc2005-08-05 00:44:28 -0400272/* 18 */ ACPI_OP("Arg4", ARGP_ARG4, ARGI_ARG4,
Len Brownfd350942007-05-09 23:34:35 -0400273 ACPI_TYPE_LOCAL_REFERENCE, AML_CLASS_ARGUMENT,
274 AML_TYPE_METHOD_ARGUMENT, 0),
Len Brown4be44fc2005-08-05 00:44:28 -0400275/* 19 */ ACPI_OP("Arg5", ARGP_ARG5, ARGI_ARG5,
Len Brownfd350942007-05-09 23:34:35 -0400276 ACPI_TYPE_LOCAL_REFERENCE, AML_CLASS_ARGUMENT,
277 AML_TYPE_METHOD_ARGUMENT, 0),
Len Brown4be44fc2005-08-05 00:44:28 -0400278/* 1A */ ACPI_OP("Arg6", ARGP_ARG6, ARGI_ARG6,
Len Brownfd350942007-05-09 23:34:35 -0400279 ACPI_TYPE_LOCAL_REFERENCE, AML_CLASS_ARGUMENT,
280 AML_TYPE_METHOD_ARGUMENT, 0),
Len Brown4be44fc2005-08-05 00:44:28 -0400281/* 1B */ ACPI_OP("Store", ARGP_STORE_OP, ARGI_STORE_OP, ACPI_TYPE_ANY,
Len Brownfd350942007-05-09 23:34:35 -0400282 AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_1T_1R,
283 AML_FLAGS_EXEC_1A_1T_1R),
Len Brown4be44fc2005-08-05 00:44:28 -0400284/* 1C */ ACPI_OP("RefOf", ARGP_REF_OF_OP, ARGI_REF_OF_OP, ACPI_TYPE_ANY,
Len Brownfd350942007-05-09 23:34:35 -0400285 AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_0T_1R,
286 AML_FLAGS_EXEC_1A_0T_1R),
Len Brown4be44fc2005-08-05 00:44:28 -0400287/* 1D */ ACPI_OP("Add", ARGP_ADD_OP, ARGI_ADD_OP, ACPI_TYPE_ANY,
Len Brownfd350942007-05-09 23:34:35 -0400288 AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_1T_1R,
289 AML_FLAGS_EXEC_2A_1T_1R | AML_MATH | AML_CONSTANT),
Len Brown4be44fc2005-08-05 00:44:28 -0400290/* 1E */ ACPI_OP("Concatenate", ARGP_CONCAT_OP, ARGI_CONCAT_OP,
Len Brownfd350942007-05-09 23:34:35 -0400291 ACPI_TYPE_ANY, AML_CLASS_EXECUTE,
292 AML_TYPE_EXEC_2A_1T_1R,
293 AML_FLAGS_EXEC_2A_1T_1R | AML_CONSTANT),
Len Brown4be44fc2005-08-05 00:44:28 -0400294/* 1F */ ACPI_OP("Subtract", ARGP_SUBTRACT_OP, ARGI_SUBTRACT_OP,
Len Brownfd350942007-05-09 23:34:35 -0400295 ACPI_TYPE_ANY, AML_CLASS_EXECUTE,
296 AML_TYPE_EXEC_2A_1T_1R,
297 AML_FLAGS_EXEC_2A_1T_1R | AML_MATH | AML_CONSTANT),
Len Brown4be44fc2005-08-05 00:44:28 -0400298/* 20 */ ACPI_OP("Increment", ARGP_INCREMENT_OP, ARGI_INCREMENT_OP,
Len Brownfd350942007-05-09 23:34:35 -0400299 ACPI_TYPE_ANY, AML_CLASS_EXECUTE,
300 AML_TYPE_EXEC_1A_0T_1R,
301 AML_FLAGS_EXEC_1A_0T_1R | AML_CONSTANT),
Len Brown4be44fc2005-08-05 00:44:28 -0400302/* 21 */ ACPI_OP("Decrement", ARGP_DECREMENT_OP, ARGI_DECREMENT_OP,
Len Brownfd350942007-05-09 23:34:35 -0400303 ACPI_TYPE_ANY, AML_CLASS_EXECUTE,
304 AML_TYPE_EXEC_1A_0T_1R,
305 AML_FLAGS_EXEC_1A_0T_1R | AML_CONSTANT),
Len Brown4be44fc2005-08-05 00:44:28 -0400306/* 22 */ ACPI_OP("Multiply", ARGP_MULTIPLY_OP, ARGI_MULTIPLY_OP,
Len Brownfd350942007-05-09 23:34:35 -0400307 ACPI_TYPE_ANY, AML_CLASS_EXECUTE,
308 AML_TYPE_EXEC_2A_1T_1R,
309 AML_FLAGS_EXEC_2A_1T_1R | AML_MATH | AML_CONSTANT),
Len Brown4be44fc2005-08-05 00:44:28 -0400310/* 23 */ ACPI_OP("Divide", ARGP_DIVIDE_OP, ARGI_DIVIDE_OP,
Len Brownfd350942007-05-09 23:34:35 -0400311 ACPI_TYPE_ANY, AML_CLASS_EXECUTE,
312 AML_TYPE_EXEC_2A_2T_1R,
313 AML_FLAGS_EXEC_2A_2T_1R | AML_CONSTANT),
Len Brown4be44fc2005-08-05 00:44:28 -0400314/* 24 */ ACPI_OP("ShiftLeft", ARGP_SHIFT_LEFT_OP, ARGI_SHIFT_LEFT_OP,
Len Brownfd350942007-05-09 23:34:35 -0400315 ACPI_TYPE_ANY, AML_CLASS_EXECUTE,
316 AML_TYPE_EXEC_2A_1T_1R,
317 AML_FLAGS_EXEC_2A_1T_1R | AML_MATH | AML_CONSTANT),
Len Brown4be44fc2005-08-05 00:44:28 -0400318/* 25 */ ACPI_OP("ShiftRight", ARGP_SHIFT_RIGHT_OP, ARGI_SHIFT_RIGHT_OP,
Len Brownfd350942007-05-09 23:34:35 -0400319 ACPI_TYPE_ANY, AML_CLASS_EXECUTE,
320 AML_TYPE_EXEC_2A_1T_1R,
321 AML_FLAGS_EXEC_2A_1T_1R | AML_MATH | AML_CONSTANT),
Len Brown4be44fc2005-08-05 00:44:28 -0400322/* 26 */ ACPI_OP("And", ARGP_BIT_AND_OP, ARGI_BIT_AND_OP, ACPI_TYPE_ANY,
Len Brownfd350942007-05-09 23:34:35 -0400323 AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_1T_1R,
324 AML_FLAGS_EXEC_2A_1T_1R | AML_MATH | AML_CONSTANT),
Len Brown4be44fc2005-08-05 00:44:28 -0400325/* 27 */ ACPI_OP("NAnd", ARGP_BIT_NAND_OP, ARGI_BIT_NAND_OP,
Len Brownfd350942007-05-09 23:34:35 -0400326 ACPI_TYPE_ANY, AML_CLASS_EXECUTE,
327 AML_TYPE_EXEC_2A_1T_1R,
328 AML_FLAGS_EXEC_2A_1T_1R | AML_MATH | AML_CONSTANT),
Len Brown4be44fc2005-08-05 00:44:28 -0400329/* 28 */ ACPI_OP("Or", ARGP_BIT_OR_OP, ARGI_BIT_OR_OP, ACPI_TYPE_ANY,
Len Brownfd350942007-05-09 23:34:35 -0400330 AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_1T_1R,
331 AML_FLAGS_EXEC_2A_1T_1R | AML_MATH | AML_CONSTANT),
Len Brown4be44fc2005-08-05 00:44:28 -0400332/* 29 */ ACPI_OP("NOr", ARGP_BIT_NOR_OP, ARGI_BIT_NOR_OP, ACPI_TYPE_ANY,
Len Brownfd350942007-05-09 23:34:35 -0400333 AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_1T_1R,
334 AML_FLAGS_EXEC_2A_1T_1R | AML_MATH | AML_CONSTANT),
Len Brown4be44fc2005-08-05 00:44:28 -0400335/* 2A */ ACPI_OP("XOr", ARGP_BIT_XOR_OP, ARGI_BIT_XOR_OP, ACPI_TYPE_ANY,
Len Brownfd350942007-05-09 23:34:35 -0400336 AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_1T_1R,
337 AML_FLAGS_EXEC_2A_1T_1R | AML_MATH | AML_CONSTANT),
Len Brown4be44fc2005-08-05 00:44:28 -0400338/* 2B */ ACPI_OP("Not", ARGP_BIT_NOT_OP, ARGI_BIT_NOT_OP, ACPI_TYPE_ANY,
Len Brownfd350942007-05-09 23:34:35 -0400339 AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_1T_1R,
340 AML_FLAGS_EXEC_1A_1T_1R | AML_CONSTANT),
Len Brown4be44fc2005-08-05 00:44:28 -0400341/* 2C */ ACPI_OP("FindSetLeftBit", ARGP_FIND_SET_LEFT_BIT_OP,
Len Brownfd350942007-05-09 23:34:35 -0400342 ARGI_FIND_SET_LEFT_BIT_OP, ACPI_TYPE_ANY,
343 AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_1T_1R,
344 AML_FLAGS_EXEC_1A_1T_1R | AML_CONSTANT),
Len Brown4be44fc2005-08-05 00:44:28 -0400345/* 2D */ ACPI_OP("FindSetRightBit", ARGP_FIND_SET_RIGHT_BIT_OP,
Len Brownfd350942007-05-09 23:34:35 -0400346 ARGI_FIND_SET_RIGHT_BIT_OP, ACPI_TYPE_ANY,
347 AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_1T_1R,
348 AML_FLAGS_EXEC_1A_1T_1R | AML_CONSTANT),
Len Brown4be44fc2005-08-05 00:44:28 -0400349/* 2E */ ACPI_OP("DerefOf", ARGP_DEREF_OF_OP, ARGI_DEREF_OF_OP,
Len Brownfd350942007-05-09 23:34:35 -0400350 ACPI_TYPE_ANY, AML_CLASS_EXECUTE,
351 AML_TYPE_EXEC_1A_0T_1R, AML_FLAGS_EXEC_1A_0T_1R),
Len Brown4be44fc2005-08-05 00:44:28 -0400352/* 2F */ ACPI_OP("Notify", ARGP_NOTIFY_OP, ARGI_NOTIFY_OP,
Len Brownfd350942007-05-09 23:34:35 -0400353 ACPI_TYPE_ANY, AML_CLASS_EXECUTE,
354 AML_TYPE_EXEC_2A_0T_0R, AML_FLAGS_EXEC_2A_0T_0R),
Len Brown4be44fc2005-08-05 00:44:28 -0400355/* 30 */ ACPI_OP("SizeOf", ARGP_SIZE_OF_OP, ARGI_SIZE_OF_OP,
Len Brownfd350942007-05-09 23:34:35 -0400356 ACPI_TYPE_ANY, AML_CLASS_EXECUTE,
357 AML_TYPE_EXEC_1A_0T_1R,
358 AML_FLAGS_EXEC_1A_0T_1R | AML_NO_OPERAND_RESOLVE),
Len Brown4be44fc2005-08-05 00:44:28 -0400359/* 31 */ ACPI_OP("Index", ARGP_INDEX_OP, ARGI_INDEX_OP, ACPI_TYPE_ANY,
Len Brownfd350942007-05-09 23:34:35 -0400360 AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_1T_1R,
361 AML_FLAGS_EXEC_2A_1T_1R),
Len Brown4be44fc2005-08-05 00:44:28 -0400362/* 32 */ ACPI_OP("Match", ARGP_MATCH_OP, ARGI_MATCH_OP, ACPI_TYPE_ANY,
Len Brownfd350942007-05-09 23:34:35 -0400363 AML_CLASS_EXECUTE, AML_TYPE_EXEC_6A_0T_1R,
364 AML_FLAGS_EXEC_6A_0T_1R | AML_CONSTANT),
Len Brown4be44fc2005-08-05 00:44:28 -0400365/* 33 */ ACPI_OP("CreateDWordField", ARGP_CREATE_DWORD_FIELD_OP,
Len Brownfd350942007-05-09 23:34:35 -0400366 ARGI_CREATE_DWORD_FIELD_OP,
367 ACPI_TYPE_BUFFER_FIELD, AML_CLASS_CREATE,
368 AML_TYPE_CREATE_FIELD,
369 AML_HAS_ARGS | AML_NSOBJECT | AML_NSNODE |
370 AML_DEFER | AML_CREATE),
Len Brown4be44fc2005-08-05 00:44:28 -0400371/* 34 */ ACPI_OP("CreateWordField", ARGP_CREATE_WORD_FIELD_OP,
Len Brownfd350942007-05-09 23:34:35 -0400372 ARGI_CREATE_WORD_FIELD_OP,
373 ACPI_TYPE_BUFFER_FIELD, AML_CLASS_CREATE,
374 AML_TYPE_CREATE_FIELD,
375 AML_HAS_ARGS | AML_NSOBJECT | AML_NSNODE |
376 AML_DEFER | AML_CREATE),
Len Brown4be44fc2005-08-05 00:44:28 -0400377/* 35 */ ACPI_OP("CreateByteField", ARGP_CREATE_BYTE_FIELD_OP,
Len Brownfd350942007-05-09 23:34:35 -0400378 ARGI_CREATE_BYTE_FIELD_OP,
379 ACPI_TYPE_BUFFER_FIELD, AML_CLASS_CREATE,
380 AML_TYPE_CREATE_FIELD,
381 AML_HAS_ARGS | AML_NSOBJECT | AML_NSNODE |
382 AML_DEFER | AML_CREATE),
Len Brown4be44fc2005-08-05 00:44:28 -0400383/* 36 */ ACPI_OP("CreateBitField", ARGP_CREATE_BIT_FIELD_OP,
Len Brownfd350942007-05-09 23:34:35 -0400384 ARGI_CREATE_BIT_FIELD_OP,
385 ACPI_TYPE_BUFFER_FIELD, AML_CLASS_CREATE,
386 AML_TYPE_CREATE_FIELD,
387 AML_HAS_ARGS | AML_NSOBJECT | AML_NSNODE |
388 AML_DEFER | AML_CREATE),
Len Brown4be44fc2005-08-05 00:44:28 -0400389/* 37 */ ACPI_OP("ObjectType", ARGP_TYPE_OP, ARGI_TYPE_OP,
Len Brownfd350942007-05-09 23:34:35 -0400390 ACPI_TYPE_ANY, AML_CLASS_EXECUTE,
391 AML_TYPE_EXEC_1A_0T_1R,
392 AML_FLAGS_EXEC_1A_0T_1R | AML_NO_OPERAND_RESOLVE),
Len Brown4be44fc2005-08-05 00:44:28 -0400393/* 38 */ ACPI_OP("LAnd", ARGP_LAND_OP, ARGI_LAND_OP, ACPI_TYPE_ANY,
Len Brownfd350942007-05-09 23:34:35 -0400394 AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_0T_1R,
395 AML_FLAGS_EXEC_2A_0T_1R | AML_LOGICAL_NUMERIC | AML_CONSTANT),
Len Brown4be44fc2005-08-05 00:44:28 -0400396/* 39 */ ACPI_OP("LOr", ARGP_LOR_OP, ARGI_LOR_OP, ACPI_TYPE_ANY,
Len Brownfd350942007-05-09 23:34:35 -0400397 AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_0T_1R,
398 AML_FLAGS_EXEC_2A_0T_1R | AML_LOGICAL_NUMERIC | AML_CONSTANT),
Len Brown4be44fc2005-08-05 00:44:28 -0400399/* 3A */ ACPI_OP("LNot", ARGP_LNOT_OP, ARGI_LNOT_OP, ACPI_TYPE_ANY,
Len Brownfd350942007-05-09 23:34:35 -0400400 AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_0T_1R,
401 AML_FLAGS_EXEC_1A_0T_1R | AML_CONSTANT),
Len Brown4be44fc2005-08-05 00:44:28 -0400402/* 3B */ ACPI_OP("LEqual", ARGP_LEQUAL_OP, ARGI_LEQUAL_OP,
Len Brownfd350942007-05-09 23:34:35 -0400403 ACPI_TYPE_ANY, AML_CLASS_EXECUTE,
404 AML_TYPE_EXEC_2A_0T_1R,
405 AML_FLAGS_EXEC_2A_0T_1R | AML_LOGICAL | AML_CONSTANT),
Len Brown4be44fc2005-08-05 00:44:28 -0400406/* 3C */ ACPI_OP("LGreater", ARGP_LGREATER_OP, ARGI_LGREATER_OP,
Len Brownfd350942007-05-09 23:34:35 -0400407 ACPI_TYPE_ANY, AML_CLASS_EXECUTE,
408 AML_TYPE_EXEC_2A_0T_1R,
409 AML_FLAGS_EXEC_2A_0T_1R | AML_LOGICAL | AML_CONSTANT),
Len Brown4be44fc2005-08-05 00:44:28 -0400410/* 3D */ ACPI_OP("LLess", ARGP_LLESS_OP, ARGI_LLESS_OP, ACPI_TYPE_ANY,
Len Brownfd350942007-05-09 23:34:35 -0400411 AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_0T_1R,
412 AML_FLAGS_EXEC_2A_0T_1R | AML_LOGICAL | AML_CONSTANT),
Len Brown4be44fc2005-08-05 00:44:28 -0400413/* 3E */ ACPI_OP("If", ARGP_IF_OP, ARGI_IF_OP, ACPI_TYPE_ANY,
Len Brownfd350942007-05-09 23:34:35 -0400414 AML_CLASS_CONTROL, AML_TYPE_CONTROL, AML_HAS_ARGS),
Len Brown4be44fc2005-08-05 00:44:28 -0400415/* 3F */ ACPI_OP("Else", ARGP_ELSE_OP, ARGI_ELSE_OP, ACPI_TYPE_ANY,
Len Brownfd350942007-05-09 23:34:35 -0400416 AML_CLASS_CONTROL, AML_TYPE_CONTROL, AML_HAS_ARGS),
Len Brown4be44fc2005-08-05 00:44:28 -0400417/* 40 */ ACPI_OP("While", ARGP_WHILE_OP, ARGI_WHILE_OP, ACPI_TYPE_ANY,
Len Brownfd350942007-05-09 23:34:35 -0400418 AML_CLASS_CONTROL, AML_TYPE_CONTROL, AML_HAS_ARGS),
Len Brown4be44fc2005-08-05 00:44:28 -0400419/* 41 */ ACPI_OP("Noop", ARGP_NOOP_OP, ARGI_NOOP_OP, ACPI_TYPE_ANY,
Len Brownfd350942007-05-09 23:34:35 -0400420 AML_CLASS_CONTROL, AML_TYPE_CONTROL, 0),
Len Brown4be44fc2005-08-05 00:44:28 -0400421/* 42 */ ACPI_OP("Return", ARGP_RETURN_OP, ARGI_RETURN_OP,
Len Brownfd350942007-05-09 23:34:35 -0400422 ACPI_TYPE_ANY, AML_CLASS_CONTROL,
423 AML_TYPE_CONTROL, AML_HAS_ARGS),
Len Brown4be44fc2005-08-05 00:44:28 -0400424/* 43 */ ACPI_OP("Break", ARGP_BREAK_OP, ARGI_BREAK_OP, ACPI_TYPE_ANY,
Len Brownfd350942007-05-09 23:34:35 -0400425 AML_CLASS_CONTROL, AML_TYPE_CONTROL, 0),
Len Brown4be44fc2005-08-05 00:44:28 -0400426/* 44 */ ACPI_OP("BreakPoint", ARGP_BREAK_POINT_OP, ARGI_BREAK_POINT_OP,
Len Brownfd350942007-05-09 23:34:35 -0400427 ACPI_TYPE_ANY, AML_CLASS_CONTROL, AML_TYPE_CONTROL, 0),
Len Brown4be44fc2005-08-05 00:44:28 -0400428/* 45 */ ACPI_OP("Ones", ARGP_ONES_OP, ARGI_ONES_OP, ACPI_TYPE_INTEGER,
Len Brownfd350942007-05-09 23:34:35 -0400429 AML_CLASS_ARGUMENT, AML_TYPE_CONSTANT, AML_CONSTANT),
Linus Torvalds1da177e2005-04-16 15:20:36 -0700430
431/* Prefixed opcodes (Two-byte opcodes with a prefix op) */
432
Len Brown4be44fc2005-08-05 00:44:28 -0400433/* 46 */ ACPI_OP("Mutex", ARGP_MUTEX_OP, ARGI_MUTEX_OP, ACPI_TYPE_MUTEX,
Len Brownfd350942007-05-09 23:34:35 -0400434 AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_SIMPLE,
435 AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE |
436 AML_NSNODE | AML_NAMED),
Len Brown4be44fc2005-08-05 00:44:28 -0400437/* 47 */ ACPI_OP("Event", ARGP_EVENT_OP, ARGI_EVENT_OP, ACPI_TYPE_EVENT,
Len Brownfd350942007-05-09 23:34:35 -0400438 AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_SIMPLE,
439 AML_NSOBJECT | AML_NSOPCODE | AML_NSNODE | AML_NAMED),
Len Brown4be44fc2005-08-05 00:44:28 -0400440/* 48 */ ACPI_OP("CondRefOf", ARGP_COND_REF_OF_OP, ARGI_COND_REF_OF_OP,
Len Brownfd350942007-05-09 23:34:35 -0400441 ACPI_TYPE_ANY, AML_CLASS_EXECUTE,
442 AML_TYPE_EXEC_1A_1T_1R, AML_FLAGS_EXEC_1A_1T_1R),
Len Brown4be44fc2005-08-05 00:44:28 -0400443/* 49 */ ACPI_OP("CreateField", ARGP_CREATE_FIELD_OP,
Len Brownfd350942007-05-09 23:34:35 -0400444 ARGI_CREATE_FIELD_OP, ACPI_TYPE_BUFFER_FIELD,
445 AML_CLASS_CREATE, AML_TYPE_CREATE_FIELD,
446 AML_HAS_ARGS | AML_NSOBJECT | AML_NSNODE |
447 AML_DEFER | AML_FIELD | AML_CREATE),
Len Brown4be44fc2005-08-05 00:44:28 -0400448/* 4A */ ACPI_OP("Load", ARGP_LOAD_OP, ARGI_LOAD_OP, ACPI_TYPE_ANY,
Len Brownfd350942007-05-09 23:34:35 -0400449 AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_1T_0R,
450 AML_FLAGS_EXEC_1A_1T_0R),
Len Brown4be44fc2005-08-05 00:44:28 -0400451/* 4B */ ACPI_OP("Stall", ARGP_STALL_OP, ARGI_STALL_OP, ACPI_TYPE_ANY,
Len Brownfd350942007-05-09 23:34:35 -0400452 AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_0T_0R,
453 AML_FLAGS_EXEC_1A_0T_0R),
Len Brown4be44fc2005-08-05 00:44:28 -0400454/* 4C */ ACPI_OP("Sleep", ARGP_SLEEP_OP, ARGI_SLEEP_OP, ACPI_TYPE_ANY,
Len Brownfd350942007-05-09 23:34:35 -0400455 AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_0T_0R,
456 AML_FLAGS_EXEC_1A_0T_0R),
Len Brown4be44fc2005-08-05 00:44:28 -0400457/* 4D */ ACPI_OP("Acquire", ARGP_ACQUIRE_OP, ARGI_ACQUIRE_OP,
Len Brownfd350942007-05-09 23:34:35 -0400458 ACPI_TYPE_ANY, AML_CLASS_EXECUTE,
459 AML_TYPE_EXEC_2A_0T_1R, AML_FLAGS_EXEC_2A_0T_1R),
Len Brown4be44fc2005-08-05 00:44:28 -0400460/* 4E */ ACPI_OP("Signal", ARGP_SIGNAL_OP, ARGI_SIGNAL_OP,
Len Brownfd350942007-05-09 23:34:35 -0400461 ACPI_TYPE_ANY, AML_CLASS_EXECUTE,
462 AML_TYPE_EXEC_1A_0T_0R, AML_FLAGS_EXEC_1A_0T_0R),
Len Brown4be44fc2005-08-05 00:44:28 -0400463/* 4F */ ACPI_OP("Wait", ARGP_WAIT_OP, ARGI_WAIT_OP, ACPI_TYPE_ANY,
Len Brownfd350942007-05-09 23:34:35 -0400464 AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_0T_1R,
465 AML_FLAGS_EXEC_2A_0T_1R),
Len Brown4be44fc2005-08-05 00:44:28 -0400466/* 50 */ ACPI_OP("Reset", ARGP_RESET_OP, ARGI_RESET_OP, ACPI_TYPE_ANY,
Len Brownfd350942007-05-09 23:34:35 -0400467 AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_0T_0R,
468 AML_FLAGS_EXEC_1A_0T_0R),
Len Brown4be44fc2005-08-05 00:44:28 -0400469/* 51 */ ACPI_OP("Release", ARGP_RELEASE_OP, ARGI_RELEASE_OP,
Len Brownfd350942007-05-09 23:34:35 -0400470 ACPI_TYPE_ANY, AML_CLASS_EXECUTE,
471 AML_TYPE_EXEC_1A_0T_0R, AML_FLAGS_EXEC_1A_0T_0R),
Len Brown4be44fc2005-08-05 00:44:28 -0400472/* 52 */ ACPI_OP("FromBCD", ARGP_FROM_BCD_OP, ARGI_FROM_BCD_OP,
Len Brownfd350942007-05-09 23:34:35 -0400473 ACPI_TYPE_ANY, AML_CLASS_EXECUTE,
474 AML_TYPE_EXEC_1A_1T_1R,
475 AML_FLAGS_EXEC_1A_1T_1R | AML_CONSTANT),
Len Brown4be44fc2005-08-05 00:44:28 -0400476/* 53 */ ACPI_OP("ToBCD", ARGP_TO_BCD_OP, ARGI_TO_BCD_OP, ACPI_TYPE_ANY,
Len Brownfd350942007-05-09 23:34:35 -0400477 AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_1T_1R,
478 AML_FLAGS_EXEC_1A_1T_1R | AML_CONSTANT),
Len Brown4be44fc2005-08-05 00:44:28 -0400479/* 54 */ ACPI_OP("Unload", ARGP_UNLOAD_OP, ARGI_UNLOAD_OP,
Len Brownfd350942007-05-09 23:34:35 -0400480 ACPI_TYPE_ANY, AML_CLASS_EXECUTE,
481 AML_TYPE_EXEC_1A_0T_0R, AML_FLAGS_EXEC_1A_0T_0R),
Len Brown4be44fc2005-08-05 00:44:28 -0400482/* 55 */ ACPI_OP("Revision", ARGP_REVISION_OP, ARGI_REVISION_OP,
Len Brownfd350942007-05-09 23:34:35 -0400483 ACPI_TYPE_INTEGER, AML_CLASS_ARGUMENT,
484 AML_TYPE_CONSTANT, 0),
Len Brown4be44fc2005-08-05 00:44:28 -0400485/* 56 */ ACPI_OP("Debug", ARGP_DEBUG_OP, ARGI_DEBUG_OP,
Len Brownfd350942007-05-09 23:34:35 -0400486 ACPI_TYPE_LOCAL_REFERENCE, AML_CLASS_ARGUMENT,
487 AML_TYPE_CONSTANT, 0),
Len Brown4be44fc2005-08-05 00:44:28 -0400488/* 57 */ ACPI_OP("Fatal", ARGP_FATAL_OP, ARGI_FATAL_OP, ACPI_TYPE_ANY,
Len Brownfd350942007-05-09 23:34:35 -0400489 AML_CLASS_EXECUTE, AML_TYPE_EXEC_3A_0T_0R,
490 AML_FLAGS_EXEC_3A_0T_0R),
Len Brown4be44fc2005-08-05 00:44:28 -0400491/* 58 */ ACPI_OP("OperationRegion", ARGP_REGION_OP, ARGI_REGION_OP,
Len Brownfd350942007-05-09 23:34:35 -0400492 ACPI_TYPE_REGION, AML_CLASS_NAMED_OBJECT,
493 AML_TYPE_NAMED_COMPLEX,
494 AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE |
495 AML_NSNODE | AML_NAMED | AML_DEFER),
Len Brown4be44fc2005-08-05 00:44:28 -0400496/* 59 */ ACPI_OP("Field", ARGP_FIELD_OP, ARGI_FIELD_OP, ACPI_TYPE_ANY,
Len Brownfd350942007-05-09 23:34:35 -0400497 AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_FIELD,
498 AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE | AML_FIELD),
Len Brown4be44fc2005-08-05 00:44:28 -0400499/* 5A */ ACPI_OP("Device", ARGP_DEVICE_OP, ARGI_DEVICE_OP,
Len Brownfd350942007-05-09 23:34:35 -0400500 ACPI_TYPE_DEVICE, AML_CLASS_NAMED_OBJECT,
501 AML_TYPE_NAMED_NO_OBJ,
502 AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE |
503 AML_NSNODE | AML_NAMED),
Len Brown4be44fc2005-08-05 00:44:28 -0400504/* 5B */ ACPI_OP("Processor", ARGP_PROCESSOR_OP, ARGI_PROCESSOR_OP,
Len Brownfd350942007-05-09 23:34:35 -0400505 ACPI_TYPE_PROCESSOR, AML_CLASS_NAMED_OBJECT,
506 AML_TYPE_NAMED_SIMPLE,
507 AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE |
508 AML_NSNODE | AML_NAMED),
Len Brown4be44fc2005-08-05 00:44:28 -0400509/* 5C */ ACPI_OP("PowerResource", ARGP_POWER_RES_OP, ARGI_POWER_RES_OP,
Len Brownfd350942007-05-09 23:34:35 -0400510 ACPI_TYPE_POWER, AML_CLASS_NAMED_OBJECT,
511 AML_TYPE_NAMED_SIMPLE,
512 AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE |
513 AML_NSNODE | AML_NAMED),
Len Brown4be44fc2005-08-05 00:44:28 -0400514/* 5D */ ACPI_OP("ThermalZone", ARGP_THERMAL_ZONE_OP,
Len Brownfd350942007-05-09 23:34:35 -0400515 ARGI_THERMAL_ZONE_OP, ACPI_TYPE_THERMAL,
516 AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_NO_OBJ,
517 AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE |
518 AML_NSNODE | AML_NAMED),
Len Brown4be44fc2005-08-05 00:44:28 -0400519/* 5E */ ACPI_OP("IndexField", ARGP_INDEX_FIELD_OP, ARGI_INDEX_FIELD_OP,
Len Brownfd350942007-05-09 23:34:35 -0400520 ACPI_TYPE_ANY, AML_CLASS_NAMED_OBJECT,
521 AML_TYPE_NAMED_FIELD,
522 AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE | AML_FIELD),
Len Brown4be44fc2005-08-05 00:44:28 -0400523/* 5F */ ACPI_OP("BankField", ARGP_BANK_FIELD_OP, ARGI_BANK_FIELD_OP,
Lin Mingef805d92008-04-10 19:06:41 +0400524 ACPI_TYPE_LOCAL_BANK_FIELD, AML_CLASS_NAMED_OBJECT,
Len Brownfd350942007-05-09 23:34:35 -0400525 AML_TYPE_NAMED_FIELD,
Lin Mingef805d92008-04-10 19:06:41 +0400526 AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE | AML_FIELD |
527 AML_DEFER),
Linus Torvalds1da177e2005-04-16 15:20:36 -0700528
529/* Internal opcodes that map to invalid AML opcodes */
530
Len Brown4be44fc2005-08-05 00:44:28 -0400531/* 60 */ ACPI_OP("LNotEqual", ARGP_LNOTEQUAL_OP, ARGI_LNOTEQUAL_OP,
Len Brownfd350942007-05-09 23:34:35 -0400532 ACPI_TYPE_ANY, AML_CLASS_INTERNAL,
533 AML_TYPE_BOGUS, AML_HAS_ARGS | AML_CONSTANT),
Len Brown4be44fc2005-08-05 00:44:28 -0400534/* 61 */ ACPI_OP("LLessEqual", ARGP_LLESSEQUAL_OP, ARGI_LLESSEQUAL_OP,
Len Brownfd350942007-05-09 23:34:35 -0400535 ACPI_TYPE_ANY, AML_CLASS_INTERNAL,
536 AML_TYPE_BOGUS, AML_HAS_ARGS | AML_CONSTANT),
Len Brown4be44fc2005-08-05 00:44:28 -0400537/* 62 */ ACPI_OP("LGreaterEqual", ARGP_LGREATEREQUAL_OP,
Len Brownfd350942007-05-09 23:34:35 -0400538 ARGI_LGREATEREQUAL_OP, ACPI_TYPE_ANY,
539 AML_CLASS_INTERNAL, AML_TYPE_BOGUS,
540 AML_HAS_ARGS | AML_CONSTANT),
Len Brown4be44fc2005-08-05 00:44:28 -0400541/* 63 */ ACPI_OP("-NamePath-", ARGP_NAMEPATH_OP, ARGI_NAMEPATH_OP,
Len Brownfd350942007-05-09 23:34:35 -0400542 ACPI_TYPE_LOCAL_REFERENCE, AML_CLASS_ARGUMENT,
543 AML_TYPE_LITERAL, AML_NSOBJECT | AML_NSNODE),
Len Brown4be44fc2005-08-05 00:44:28 -0400544/* 64 */ ACPI_OP("-MethodCall-", ARGP_METHODCALL_OP, ARGI_METHODCALL_OP,
Len Brownfd350942007-05-09 23:34:35 -0400545 ACPI_TYPE_METHOD, AML_CLASS_METHOD_CALL,
546 AML_TYPE_METHOD_CALL,
547 AML_HAS_ARGS | AML_NSOBJECT | AML_NSNODE),
Len Brown4be44fc2005-08-05 00:44:28 -0400548/* 65 */ ACPI_OP("-ByteList-", ARGP_BYTELIST_OP, ARGI_BYTELIST_OP,
Len Brownfd350942007-05-09 23:34:35 -0400549 ACPI_TYPE_ANY, AML_CLASS_ARGUMENT,
550 AML_TYPE_LITERAL, 0),
Len Brown4be44fc2005-08-05 00:44:28 -0400551/* 66 */ ACPI_OP("-ReservedField-", ARGP_RESERVEDFIELD_OP,
Len Brownfd350942007-05-09 23:34:35 -0400552 ARGI_RESERVEDFIELD_OP, ACPI_TYPE_ANY,
553 AML_CLASS_INTERNAL, AML_TYPE_BOGUS, 0),
Len Brown4be44fc2005-08-05 00:44:28 -0400554/* 67 */ ACPI_OP("-NamedField-", ARGP_NAMEDFIELD_OP, ARGI_NAMEDFIELD_OP,
Len Brownfd350942007-05-09 23:34:35 -0400555 ACPI_TYPE_ANY, AML_CLASS_INTERNAL,
556 AML_TYPE_BOGUS,
557 AML_NSOBJECT | AML_NSOPCODE | AML_NSNODE | AML_NAMED),
Len Brown4be44fc2005-08-05 00:44:28 -0400558/* 68 */ ACPI_OP("-AccessField-", ARGP_ACCESSFIELD_OP,
Len Brownfd350942007-05-09 23:34:35 -0400559 ARGI_ACCESSFIELD_OP, ACPI_TYPE_ANY,
560 AML_CLASS_INTERNAL, AML_TYPE_BOGUS, 0),
Len Brown4be44fc2005-08-05 00:44:28 -0400561/* 69 */ ACPI_OP("-StaticString", ARGP_STATICSTRING_OP,
Len Brownfd350942007-05-09 23:34:35 -0400562 ARGI_STATICSTRING_OP, ACPI_TYPE_ANY,
563 AML_CLASS_INTERNAL, AML_TYPE_BOGUS, 0),
Len Brown4be44fc2005-08-05 00:44:28 -0400564/* 6A */ ACPI_OP("-Return Value-", ARG_NONE, ARG_NONE, ACPI_TYPE_ANY,
Len Brownfd350942007-05-09 23:34:35 -0400565 AML_CLASS_RETURN_VALUE, AML_TYPE_RETURN,
566 AML_HAS_ARGS | AML_HAS_RETVAL),
Len Brown4be44fc2005-08-05 00:44:28 -0400567/* 6B */ ACPI_OP("-UNKNOWN_OP-", ARG_NONE, ARG_NONE, ACPI_TYPE_INVALID,
Len Brownfd350942007-05-09 23:34:35 -0400568 AML_CLASS_UNKNOWN, AML_TYPE_BOGUS, AML_HAS_ARGS),
Len Brown4be44fc2005-08-05 00:44:28 -0400569/* 6C */ ACPI_OP("-ASCII_ONLY-", ARG_NONE, ARG_NONE, ACPI_TYPE_ANY,
Len Brownfd350942007-05-09 23:34:35 -0400570 AML_CLASS_ASCII, AML_TYPE_BOGUS, AML_HAS_ARGS),
Len Brown4be44fc2005-08-05 00:44:28 -0400571/* 6D */ ACPI_OP("-PREFIX_ONLY-", ARG_NONE, ARG_NONE, ACPI_TYPE_ANY,
Len Brownfd350942007-05-09 23:34:35 -0400572 AML_CLASS_PREFIX, AML_TYPE_BOGUS, AML_HAS_ARGS),
Linus Torvalds1da177e2005-04-16 15:20:36 -0700573
574/* ACPI 2.0 opcodes */
575
Len Brown4be44fc2005-08-05 00:44:28 -0400576/* 6E */ ACPI_OP("QwordConst", ARGP_QWORD_OP, ARGI_QWORD_OP,
Len Brownfd350942007-05-09 23:34:35 -0400577 ACPI_TYPE_INTEGER, AML_CLASS_ARGUMENT,
578 AML_TYPE_LITERAL, AML_CONSTANT),
Len Brown4be44fc2005-08-05 00:44:28 -0400579 /* 6F */ ACPI_OP("Package", /* Var */ ARGP_VAR_PACKAGE_OP,
580 ARGI_VAR_PACKAGE_OP, ACPI_TYPE_PACKAGE,
581 AML_CLASS_CREATE, AML_TYPE_CREATE_OBJECT,
582 AML_HAS_ARGS | AML_DEFER),
583/* 70 */ ACPI_OP("ConcatenateResTemplate", ARGP_CONCAT_RES_OP,
Len Brownfd350942007-05-09 23:34:35 -0400584 ARGI_CONCAT_RES_OP, ACPI_TYPE_ANY,
585 AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_1T_1R,
586 AML_FLAGS_EXEC_2A_1T_1R | AML_CONSTANT),
Len Brown4be44fc2005-08-05 00:44:28 -0400587/* 71 */ ACPI_OP("Mod", ARGP_MOD_OP, ARGI_MOD_OP, ACPI_TYPE_ANY,
Len Brownfd350942007-05-09 23:34:35 -0400588 AML_CLASS_EXECUTE, AML_TYPE_EXEC_2A_1T_1R,
589 AML_FLAGS_EXEC_2A_1T_1R | AML_CONSTANT),
Len Brown4be44fc2005-08-05 00:44:28 -0400590/* 72 */ ACPI_OP("CreateQWordField", ARGP_CREATE_QWORD_FIELD_OP,
Len Brownfd350942007-05-09 23:34:35 -0400591 ARGI_CREATE_QWORD_FIELD_OP,
592 ACPI_TYPE_BUFFER_FIELD, AML_CLASS_CREATE,
593 AML_TYPE_CREATE_FIELD,
594 AML_HAS_ARGS | AML_NSOBJECT | AML_NSNODE |
595 AML_DEFER | AML_CREATE),
Len Brown4be44fc2005-08-05 00:44:28 -0400596/* 73 */ ACPI_OP("ToBuffer", ARGP_TO_BUFFER_OP, ARGI_TO_BUFFER_OP,
Len Brownfd350942007-05-09 23:34:35 -0400597 ACPI_TYPE_ANY, AML_CLASS_EXECUTE,
598 AML_TYPE_EXEC_1A_1T_1R,
599 AML_FLAGS_EXEC_1A_1T_1R | AML_CONSTANT),
Len Brown4be44fc2005-08-05 00:44:28 -0400600/* 74 */ ACPI_OP("ToDecimalString", ARGP_TO_DEC_STR_OP,
Len Brownfd350942007-05-09 23:34:35 -0400601 ARGI_TO_DEC_STR_OP, ACPI_TYPE_ANY,
602 AML_CLASS_EXECUTE, AML_TYPE_EXEC_1A_1T_1R,
603 AML_FLAGS_EXEC_1A_1T_1R | AML_CONSTANT),
Len Brown4be44fc2005-08-05 00:44:28 -0400604/* 75 */ ACPI_OP("ToHexString", ARGP_TO_HEX_STR_OP, ARGI_TO_HEX_STR_OP,
Len Brownfd350942007-05-09 23:34:35 -0400605 ACPI_TYPE_ANY, AML_CLASS_EXECUTE,
606 AML_TYPE_EXEC_1A_1T_1R,
607 AML_FLAGS_EXEC_1A_1T_1R | AML_CONSTANT),
Len Brown4be44fc2005-08-05 00:44:28 -0400608/* 76 */ ACPI_OP("ToInteger", ARGP_TO_INTEGER_OP, ARGI_TO_INTEGER_OP,
Len Brownfd350942007-05-09 23:34:35 -0400609 ACPI_TYPE_ANY, AML_CLASS_EXECUTE,
610 AML_TYPE_EXEC_1A_1T_1R,
611 AML_FLAGS_EXEC_1A_1T_1R | AML_CONSTANT),
Len Brown4be44fc2005-08-05 00:44:28 -0400612/* 77 */ ACPI_OP("ToString", ARGP_TO_STRING_OP, ARGI_TO_STRING_OP,
Len Brownfd350942007-05-09 23:34:35 -0400613 ACPI_TYPE_ANY, AML_CLASS_EXECUTE,
614 AML_TYPE_EXEC_2A_1T_1R,
615 AML_FLAGS_EXEC_2A_1T_1R | AML_CONSTANT),
Len Brown4be44fc2005-08-05 00:44:28 -0400616/* 78 */ ACPI_OP("CopyObject", ARGP_COPY_OP, ARGI_COPY_OP,
Len Brownfd350942007-05-09 23:34:35 -0400617 ACPI_TYPE_ANY, AML_CLASS_EXECUTE,
618 AML_TYPE_EXEC_1A_1T_1R, AML_FLAGS_EXEC_1A_1T_1R),
Len Brown4be44fc2005-08-05 00:44:28 -0400619/* 79 */ ACPI_OP("Mid", ARGP_MID_OP, ARGI_MID_OP, ACPI_TYPE_ANY,
Len Brownfd350942007-05-09 23:34:35 -0400620 AML_CLASS_EXECUTE, AML_TYPE_EXEC_3A_1T_1R,
621 AML_FLAGS_EXEC_3A_1T_1R | AML_CONSTANT),
Len Brown4be44fc2005-08-05 00:44:28 -0400622/* 7A */ ACPI_OP("Continue", ARGP_CONTINUE_OP, ARGI_CONTINUE_OP,
Len Brownfd350942007-05-09 23:34:35 -0400623 ACPI_TYPE_ANY, AML_CLASS_CONTROL, AML_TYPE_CONTROL, 0),
Len Brown4be44fc2005-08-05 00:44:28 -0400624/* 7B */ ACPI_OP("LoadTable", ARGP_LOAD_TABLE_OP, ARGI_LOAD_TABLE_OP,
Len Brownfd350942007-05-09 23:34:35 -0400625 ACPI_TYPE_ANY, AML_CLASS_EXECUTE,
626 AML_TYPE_EXEC_6A_0T_1R, AML_FLAGS_EXEC_6A_0T_1R),
Len Brown4be44fc2005-08-05 00:44:28 -0400627/* 7C */ ACPI_OP("DataTableRegion", ARGP_DATA_REGION_OP,
Len Brownfd350942007-05-09 23:34:35 -0400628 ARGI_DATA_REGION_OP, ACPI_TYPE_REGION,
Lin Ming941f48b2008-04-10 19:06:41 +0400629 AML_CLASS_NAMED_OBJECT, AML_TYPE_NAMED_COMPLEX,
Len Brownfd350942007-05-09 23:34:35 -0400630 AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE |
Lin Ming941f48b2008-04-10 19:06:41 +0400631 AML_NSNODE | AML_NAMED | AML_DEFER),
Len Brown4be44fc2005-08-05 00:44:28 -0400632/* 7D */ ACPI_OP("[EvalSubTree]", ARGP_SCOPE_OP, ARGI_SCOPE_OP,
Len Brownfd350942007-05-09 23:34:35 -0400633 ACPI_TYPE_ANY, AML_CLASS_NAMED_OBJECT,
634 AML_TYPE_NAMED_NO_OBJ,
635 AML_HAS_ARGS | AML_NSOBJECT | AML_NSOPCODE | AML_NSNODE),
Linus Torvalds1da177e2005-04-16 15:20:36 -0700636
637/* ACPI 3.0 opcodes */
638
Len Brown4be44fc2005-08-05 00:44:28 -0400639/* 7E */ ACPI_OP("Timer", ARGP_TIMER_OP, ARGI_TIMER_OP, ACPI_TYPE_ANY,
Len Brownfd350942007-05-09 23:34:35 -0400640 AML_CLASS_EXECUTE, AML_TYPE_EXEC_0A_0T_1R,
641 AML_FLAGS_EXEC_0A_0T_1R)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700642
643/*! [End] no source code translation !*/
644};
645
646/*
647 * This table is directly indexed by the opcodes, and returns an
648 * index into the table above
649 */
Len Brown4be44fc2005-08-05 00:44:28 -0400650static const u8 acpi_gbl_short_op_index[256] = {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700651/* 0 1 2 3 4 5 6 7 */
652/* 8 9 A B C D E F */
Len Brown4be44fc2005-08-05 00:44:28 -0400653/* 0x00 */ 0x00, 0x01, _UNK, _UNK, _UNK, _UNK, 0x02, _UNK,
654/* 0x08 */ 0x03, _UNK, 0x04, 0x05, 0x06, 0x07, 0x6E, _UNK,
655/* 0x10 */ 0x08, 0x09, 0x0a, 0x6F, 0x0b, _UNK, _UNK, _UNK,
656/* 0x18 */ _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK,
657/* 0x20 */ _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK,
658/* 0x28 */ _UNK, _UNK, _UNK, _UNK, _UNK, 0x63, _PFX, _PFX,
659/* 0x30 */ 0x67, 0x66, 0x68, 0x65, 0x69, 0x64, 0x6A, 0x7D,
660/* 0x38 */ _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK,
661/* 0x40 */ _UNK, _ASC, _ASC, _ASC, _ASC, _ASC, _ASC, _ASC,
662/* 0x48 */ _ASC, _ASC, _ASC, _ASC, _ASC, _ASC, _ASC, _ASC,
663/* 0x50 */ _ASC, _ASC, _ASC, _ASC, _ASC, _ASC, _ASC, _ASC,
664/* 0x58 */ _ASC, _ASC, _ASC, _UNK, _PFX, _UNK, _PFX, _ASC,
665/* 0x60 */ 0x0c, 0x0d, 0x0e, 0x0f, 0x10, 0x11, 0x12, 0x13,
666/* 0x68 */ 0x14, 0x15, 0x16, 0x17, 0x18, 0x19, 0x1a, _UNK,
667/* 0x70 */ 0x1b, 0x1c, 0x1d, 0x1e, 0x1f, 0x20, 0x21, 0x22,
668/* 0x78 */ 0x23, 0x24, 0x25, 0x26, 0x27, 0x28, 0x29, 0x2a,
669/* 0x80 */ 0x2b, 0x2c, 0x2d, 0x2e, 0x70, 0x71, 0x2f, 0x30,
670/* 0x88 */ 0x31, 0x32, 0x33, 0x34, 0x35, 0x36, 0x37, 0x72,
671/* 0x90 */ 0x38, 0x39, 0x3a, 0x3b, 0x3c, 0x3d, 0x73, 0x74,
672/* 0x98 */ 0x75, 0x76, _UNK, _UNK, 0x77, 0x78, 0x79, 0x7A,
673/* 0xA0 */ 0x3e, 0x3f, 0x40, 0x41, 0x42, 0x43, 0x60, 0x61,
674/* 0xA8 */ 0x62, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK,
675/* 0xB0 */ _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK,
676/* 0xB8 */ _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK,
677/* 0xC0 */ _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK,
678/* 0xC8 */ _UNK, _UNK, _UNK, _UNK, 0x44, _UNK, _UNK, _UNK,
679/* 0xD0 */ _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK,
680/* 0xD8 */ _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK,
681/* 0xE0 */ _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK,
682/* 0xE8 */ _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK,
683/* 0xF0 */ _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK,
684/* 0xF8 */ _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, 0x45,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700685};
686
687/*
688 * This table is indexed by the second opcode of the extended opcode
689 * pair. It returns an index into the opcode table (acpi_gbl_aml_op_info)
690 */
Len Brown4be44fc2005-08-05 00:44:28 -0400691static const u8 acpi_gbl_long_op_index[NUM_EXTENDED_OPCODE] = {
Linus Torvalds1da177e2005-04-16 15:20:36 -0700692/* 0 1 2 3 4 5 6 7 */
693/* 8 9 A B C D E F */
Len Brown4be44fc2005-08-05 00:44:28 -0400694/* 0x00 */ _UNK, 0x46, 0x47, _UNK, _UNK, _UNK, _UNK, _UNK,
695/* 0x08 */ _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK,
696/* 0x10 */ _UNK, _UNK, 0x48, 0x49, _UNK, _UNK, _UNK, _UNK,
697/* 0x18 */ _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, 0x7B,
698/* 0x20 */ 0x4a, 0x4b, 0x4c, 0x4d, 0x4e, 0x4f, 0x50, 0x51,
699/* 0x28 */ 0x52, 0x53, 0x54, _UNK, _UNK, _UNK, _UNK, _UNK,
700/* 0x30 */ 0x55, 0x56, 0x57, 0x7e, _UNK, _UNK, _UNK, _UNK,
701/* 0x38 */ _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK,
702/* 0x40 */ _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK,
703/* 0x48 */ _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK,
704/* 0x50 */ _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK,
705/* 0x58 */ _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK,
706/* 0x60 */ _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK,
707/* 0x68 */ _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK,
708/* 0x70 */ _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK,
709/* 0x78 */ _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK, _UNK,
710/* 0x80 */ 0x58, 0x59, 0x5a, 0x5b, 0x5c, 0x5d, 0x5e, 0x5f,
711/* 0x88 */ 0x7C,
Linus Torvalds1da177e2005-04-16 15:20:36 -0700712};
713
Linus Torvalds1da177e2005-04-16 15:20:36 -0700714/*******************************************************************************
715 *
716 * FUNCTION: acpi_ps_get_opcode_info
717 *
718 * PARAMETERS: Opcode - The AML opcode
719 *
Robert Moore44f6c012005-04-18 22:49:35 -0400720 * RETURN: A pointer to the info about the opcode.
Linus Torvalds1da177e2005-04-16 15:20:36 -0700721 *
722 * DESCRIPTION: Find AML opcode description based on the opcode.
723 * NOTE: This procedure must ALWAYS return a valid pointer!
724 *
725 ******************************************************************************/
726
Len Brown4be44fc2005-08-05 00:44:28 -0400727const struct acpi_opcode_info *acpi_ps_get_opcode_info(u16 opcode)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700728{
Bob Mooreb229cf92006-04-21 17:15:00 -0400729 ACPI_FUNCTION_NAME(ps_get_opcode_info);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700730
731 /*
732 * Detect normal 8-bit opcode or extended 16-bit opcode
733 */
Robert Moore73459f72005-06-24 00:00:00 -0400734 if (!(opcode & 0xFF00)) {
Bob Moore52fc0b02006-10-02 00:00:00 -0400735
Linus Torvalds1da177e2005-04-16 15:20:36 -0700736 /* Simple (8-bit) opcode: 0-255, can't index beyond table */
737
Len Brown4be44fc2005-08-05 00:44:28 -0400738 return (&acpi_gbl_aml_op_info
739 [acpi_gbl_short_op_index[(u8) opcode]]);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700740 }
741
Robert Moore73459f72005-06-24 00:00:00 -0400742 if (((opcode & 0xFF00) == AML_EXTENDED_OPCODE) &&
Len Brown4be44fc2005-08-05 00:44:28 -0400743 (((u8) opcode) <= MAX_EXTENDED_OPCODE)) {
Bob Moore52fc0b02006-10-02 00:00:00 -0400744
Robert Moore73459f72005-06-24 00:00:00 -0400745 /* Valid extended (16-bit) opcode */
Linus Torvalds1da177e2005-04-16 15:20:36 -0700746
Len Brown4be44fc2005-08-05 00:44:28 -0400747 return (&acpi_gbl_aml_op_info
748 [acpi_gbl_long_op_index[(u8) opcode]]);
Robert Moore73459f72005-06-24 00:00:00 -0400749 }
750
751 /* Unknown AML opcode */
752
Bob Moore4a90c7e2006-01-13 16:22:00 -0500753 ACPI_DEBUG_PRINT((ACPI_DB_EXEC,
Len Brown4be44fc2005-08-05 00:44:28 -0400754 "Unknown AML opcode [%4.4X]\n", opcode));
Linus Torvalds1da177e2005-04-16 15:20:36 -0700755
Len Brown4be44fc2005-08-05 00:44:28 -0400756 return (&acpi_gbl_aml_op_info[_UNK]);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700757}
758
Linus Torvalds1da177e2005-04-16 15:20:36 -0700759/*******************************************************************************
760 *
761 * FUNCTION: acpi_ps_get_opcode_name
762 *
763 * PARAMETERS: Opcode - The AML opcode
764 *
765 * RETURN: A pointer to the name of the opcode (ASCII String)
766 * Note: Never returns NULL.
767 *
768 * DESCRIPTION: Translate an opcode into a human-readable string
769 *
770 ******************************************************************************/
771
Len Brown4be44fc2005-08-05 00:44:28 -0400772char *acpi_ps_get_opcode_name(u16 opcode)
Linus Torvalds1da177e2005-04-16 15:20:36 -0700773{
774#if defined(ACPI_DISASSEMBLER) || defined (ACPI_DEBUG_OUTPUT)
775
Len Brown4be44fc2005-08-05 00:44:28 -0400776 const struct acpi_opcode_info *op;
Linus Torvalds1da177e2005-04-16 15:20:36 -0700777
Len Brown4be44fc2005-08-05 00:44:28 -0400778 op = acpi_ps_get_opcode_info(opcode);
Linus Torvalds1da177e2005-04-16 15:20:36 -0700779
780 /* Always guaranteed to return a valid pointer */
781
782 return (op->name);
783
784#else
Bob Mooreb229cf92006-04-21 17:15:00 -0400785 return ("OpcodeName unavailable");
Linus Torvalds1da177e2005-04-16 15:20:36 -0700786
787#endif
788}
Bob Moore4e3156b2008-04-10 19:06:37 +0400789
790/*******************************************************************************
791 *
792 * FUNCTION: acpi_ps_get_argument_count
793 *
794 * PARAMETERS: op_type - Type associated with the AML opcode
795 *
796 * RETURN: Argument count
797 *
798 * DESCRIPTION: Obtain the number of expected arguments for an AML opcode
799 *
800 ******************************************************************************/
801
802u8 acpi_ps_get_argument_count(u32 op_type)
803{
804
805 if (op_type <= AML_TYPE_EXEC_6A_0T_1R) {
806 return (acpi_gbl_argument_count[op_type]);
807 }
808
809 return (0);
810}