aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/acpi/acpica/amlcode.h
diff options
context:
space:
mode:
authorBob Moore <robert.moore@intel.com>2017-04-26 04:18:40 -0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2017-04-26 18:31:00 -0400
commit9ff5a21a50301ef16aeb2e3937867de7eb0af030 (patch)
tree0d118587bd0ca6817aa591c16e538aaf96f60e6a /drivers/acpi/acpica/amlcode.h
parent069f9bf454a61d6fafa415dc2a8713938196d650 (diff)
ACPICA: Cleanup AML opcode definitions, no functional change
ACPICA commit ec969d38fef3be95358e65f0dd071b5f2c045b6b This change is a cleanup and further standardization of the AML opcode defines in amlcode.h Improves the readability and maintainability of the source code. Link: https://github.com/acpica/acpica/commit/ec969d38 Signed-off-by: Bob Moore <robert.moore@intel.com> Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
Diffstat (limited to 'drivers/acpi/acpica/amlcode.h')
-rw-r--r--drivers/acpi/acpica/amlcode.h97
1 files changed, 43 insertions, 54 deletions
diff --git a/drivers/acpi/acpica/amlcode.h b/drivers/acpi/acpica/amlcode.h
index b536fd471292..7e2b369487ae 100644
--- a/drivers/acpi/acpica/amlcode.h
+++ b/drivers/acpi/acpica/amlcode.h
@@ -48,11 +48,8 @@
48 48
49/* primary opcodes */ 49/* primary opcodes */
50 50
51#define AML_NULL_CHAR (u16) 0x00
52
53#define AML_ZERO_OP (u16) 0x00 51#define AML_ZERO_OP (u16) 0x00
54#define AML_ONE_OP (u16) 0x01 52#define AML_ONE_OP (u16) 0x01
55#define AML_UNASSIGNED (u16) 0x02
56#define AML_ALIAS_OP (u16) 0x06 53#define AML_ALIAS_OP (u16) 0x06
57#define AML_NAME_OP (u16) 0x08 54#define AML_NAME_OP (u16) 0x08
58#define AML_BYTE_OP (u16) 0x0a 55#define AML_BYTE_OP (u16) 0x0a
@@ -63,17 +60,15 @@
63#define AML_SCOPE_OP (u16) 0x10 60#define AML_SCOPE_OP (u16) 0x10
64#define AML_BUFFER_OP (u16) 0x11 61#define AML_BUFFER_OP (u16) 0x11
65#define AML_PACKAGE_OP (u16) 0x12 62#define AML_PACKAGE_OP (u16) 0x12
66#define AML_VAR_PACKAGE_OP (u16) 0x13 /* ACPI 2.0 */ 63#define AML_VARIABLE_PACKAGE_OP (u16) 0x13 /* ACPI 2.0 */
67#define AML_METHOD_OP (u16) 0x14 64#define AML_METHOD_OP (u16) 0x14
68#define AML_EXTERNAL_OP (u16) 0x15 /* ACPI 6.0 */ 65#define AML_EXTERNAL_OP (u16) 0x15 /* ACPI 6.0 */
69#define AML_DUAL_NAME_PREFIX (u16) 0x2e 66#define AML_DUAL_NAME_PREFIX (u16) 0x2e
70#define AML_MULTI_NAME_PREFIX_OP (u16) 0x2f 67#define AML_MULTI_NAME_PREFIX (u16) 0x2f
71#define AML_NAME_CHAR_SUBSEQ (u16) 0x30 68#define AML_EXTENDED_PREFIX (u16) 0x5b
72#define AML_NAME_CHAR_FIRST (u16) 0x41
73#define AML_EXTENDED_OP_PREFIX (u16) 0x5b
74#define AML_ROOT_PREFIX (u16) 0x5c 69#define AML_ROOT_PREFIX (u16) 0x5c
75#define AML_PARENT_PREFIX (u16) 0x5e 70#define AML_PARENT_PREFIX (u16) 0x5e
76#define AML_LOCAL_OP (u16) 0x60 71#define AML_FIRST_LOCAL_OP (u16) 0x60 /* Used for Local op # calculations */
77#define AML_LOCAL0 (u16) 0x60 72#define AML_LOCAL0 (u16) 0x60
78#define AML_LOCAL1 (u16) 0x61 73#define AML_LOCAL1 (u16) 0x61
79#define AML_LOCAL2 (u16) 0x62 74#define AML_LOCAL2 (u16) 0x62
@@ -82,7 +77,7 @@
82#define AML_LOCAL5 (u16) 0x65 77#define AML_LOCAL5 (u16) 0x65
83#define AML_LOCAL6 (u16) 0x66 78#define AML_LOCAL6 (u16) 0x66
84#define AML_LOCAL7 (u16) 0x67 79#define AML_LOCAL7 (u16) 0x67
85#define AML_ARG_OP (u16) 0x68 80#define AML_FIRST_ARG_OP (u16) 0x68 /* Used for Arg op # calculations */
86#define AML_ARG0 (u16) 0x68 81#define AML_ARG0 (u16) 0x68
87#define AML_ARG1 (u16) 0x69 82#define AML_ARG1 (u16) 0x69
88#define AML_ARG2 (u16) 0x6a 83#define AML_ARG2 (u16) 0x6a
@@ -93,7 +88,7 @@
93#define AML_STORE_OP (u16) 0x70 88#define AML_STORE_OP (u16) 0x70
94#define AML_REF_OF_OP (u16) 0x71 89#define AML_REF_OF_OP (u16) 0x71
95#define AML_ADD_OP (u16) 0x72 90#define AML_ADD_OP (u16) 0x72
96#define AML_CONCAT_OP (u16) 0x73 91#define AML_CONCATENATE_OP (u16) 0x73
97#define AML_SUBTRACT_OP (u16) 0x74 92#define AML_SUBTRACT_OP (u16) 0x74
98#define AML_INCREMENT_OP (u16) 0x75 93#define AML_INCREMENT_OP (u16) 0x75
99#define AML_DECREMENT_OP (u16) 0x76 94#define AML_DECREMENT_OP (u16) 0x76
@@ -110,7 +105,7 @@
110#define AML_FIND_SET_LEFT_BIT_OP (u16) 0x81 105#define AML_FIND_SET_LEFT_BIT_OP (u16) 0x81
111#define AML_FIND_SET_RIGHT_BIT_OP (u16) 0x82 106#define AML_FIND_SET_RIGHT_BIT_OP (u16) 0x82
112#define AML_DEREF_OF_OP (u16) 0x83 107#define AML_DEREF_OF_OP (u16) 0x83
113#define AML_CONCAT_RES_OP (u16) 0x84 /* ACPI 2.0 */ 108#define AML_CONCATENATE_TEMPLATE_OP (u16) 0x84 /* ACPI 2.0 */
114#define AML_MOD_OP (u16) 0x85 /* ACPI 2.0 */ 109#define AML_MOD_OP (u16) 0x85 /* ACPI 2.0 */
115#define AML_NOTIFY_OP (u16) 0x86 110#define AML_NOTIFY_OP (u16) 0x86
116#define AML_SIZE_OF_OP (u16) 0x87 111#define AML_SIZE_OF_OP (u16) 0x87
@@ -122,18 +117,18 @@
122#define AML_CREATE_BIT_FIELD_OP (u16) 0x8d 117#define AML_CREATE_BIT_FIELD_OP (u16) 0x8d
123#define AML_OBJECT_TYPE_OP (u16) 0x8e 118#define AML_OBJECT_TYPE_OP (u16) 0x8e
124#define AML_CREATE_QWORD_FIELD_OP (u16) 0x8f /* ACPI 2.0 */ 119#define AML_CREATE_QWORD_FIELD_OP (u16) 0x8f /* ACPI 2.0 */
125#define AML_LAND_OP (u16) 0x90 120#define AML_LOGICAL_AND_OP (u16) 0x90
126#define AML_LOR_OP (u16) 0x91 121#define AML_LOGICAL_OR_OP (u16) 0x91
127#define AML_LNOT_OP (u16) 0x92 122#define AML_LOGICAL_NOT_OP (u16) 0x92
128#define AML_LEQUAL_OP (u16) 0x93 123#define AML_LOGICAL_EQUAL_OP (u16) 0x93
129#define AML_LGREATER_OP (u16) 0x94 124#define AML_LOGICAL_GREATER_OP (u16) 0x94
130#define AML_LLESS_OP (u16) 0x95 125#define AML_LOGICAL_LESS_OP (u16) 0x95
131#define AML_TO_BUFFER_OP (u16) 0x96 /* ACPI 2.0 */ 126#define AML_TO_BUFFER_OP (u16) 0x96 /* ACPI 2.0 */
132#define AML_TO_DECSTRING_OP (u16) 0x97 /* ACPI 2.0 */ 127#define AML_TO_DECIMAL_STRING_OP (u16) 0x97 /* ACPI 2.0 */
133#define AML_TO_HEXSTRING_OP (u16) 0x98 /* ACPI 2.0 */ 128#define AML_TO_HEX_STRING_OP (u16) 0x98 /* ACPI 2.0 */
134#define AML_TO_INTEGER_OP (u16) 0x99 /* ACPI 2.0 */ 129#define AML_TO_INTEGER_OP (u16) 0x99 /* ACPI 2.0 */
135#define AML_TO_STRING_OP (u16) 0x9c /* ACPI 2.0 */ 130#define AML_TO_STRING_OP (u16) 0x9c /* ACPI 2.0 */
136#define AML_COPY_OP (u16) 0x9d /* ACPI 2.0 */ 131#define AML_COPY_OBJECT_OP (u16) 0x9d /* ACPI 2.0 */
137#define AML_MID_OP (u16) 0x9e /* ACPI 2.0 */ 132#define AML_MID_OP (u16) 0x9e /* ACPI 2.0 */
138#define AML_CONTINUE_OP (u16) 0x9f /* ACPI 2.0 */ 133#define AML_CONTINUE_OP (u16) 0x9f /* ACPI 2.0 */
139#define AML_IF_OP (u16) 0xa0 134#define AML_IF_OP (u16) 0xa0
@@ -142,18 +137,26 @@
142#define AML_NOOP_OP (u16) 0xa3 137#define AML_NOOP_OP (u16) 0xa3
143#define AML_RETURN_OP (u16) 0xa4 138#define AML_RETURN_OP (u16) 0xa4
144#define AML_BREAK_OP (u16) 0xa5 139#define AML_BREAK_OP (u16) 0xa5
145#define AML_BREAK_POINT_OP (u16) 0xcc 140#define AML_BREAKPOINT_OP (u16) 0xcc
146#define AML_ONES_OP (u16) 0xff 141#define AML_ONES_OP (u16) 0xff
147 142
148/* prefixed opcodes */ 143/*
144 * Combination opcodes (actually two one-byte opcodes)
145 * Used by the disassembler and iASL compiler
146 */
147#define AML_LOGICAL_GREATER_EQUAL_OP (u16) 0x9295 /* LNot (LLess) */
148#define AML_LOGICAL_LESS_EQUAL_OP (u16) 0x9294 /* LNot (LGreater) */
149#define AML_LOGICAL_NOT_EQUAL_OP (u16) 0x9293 /* LNot (LEqual) */
150
151/* Prefixed (2-byte) opcodes (with AML_EXTENDED_PREFIX) */
149 152
150#define AML_EXTENDED_OPCODE (u16) 0x5b00 /* prefix for 2-byte opcodes */ 153#define AML_EXTENDED_OPCODE (u16) 0x5b00 /* Prefix for 2-byte opcodes */
151 154
152#define AML_MUTEX_OP (u16) 0x5b01 155#define AML_MUTEX_OP (u16) 0x5b01
153#define AML_EVENT_OP (u16) 0x5b02 156#define AML_EVENT_OP (u16) 0x5b02
154#define AML_SHIFT_RIGHT_BIT_OP (u16) 0x5b10 157#define AML_SHIFT_RIGHT_BIT_OP (u16) 0x5b10 /* Obsolete, not in ACPI spec */
155#define AML_SHIFT_LEFT_BIT_OP (u16) 0x5b11 158#define AML_SHIFT_LEFT_BIT_OP (u16) 0x5b11 /* Obsolete, not in ACPI spec */
156#define AML_COND_REF_OF_OP (u16) 0x5b12 159#define AML_CONDITIONAL_REF_OF_OP (u16) 0x5b12
157#define AML_CREATE_FIELD_OP (u16) 0x5b13 160#define AML_CREATE_FIELD_OP (u16) 0x5b13
158#define AML_LOAD_TABLE_OP (u16) 0x5b1f /* ACPI 2.0 */ 161#define AML_LOAD_TABLE_OP (u16) 0x5b1f /* ACPI 2.0 */
159#define AML_LOAD_OP (u16) 0x5b20 162#define AML_LOAD_OP (u16) 0x5b20
@@ -175,21 +178,13 @@
175#define AML_FIELD_OP (u16) 0x5b81 178#define AML_FIELD_OP (u16) 0x5b81
176#define AML_DEVICE_OP (u16) 0x5b82 179#define AML_DEVICE_OP (u16) 0x5b82
177#define AML_PROCESSOR_OP (u16) 0x5b83 180#define AML_PROCESSOR_OP (u16) 0x5b83
178#define AML_POWER_RES_OP (u16) 0x5b84 181#define AML_POWER_RESOURCE_OP (u16) 0x5b84
179#define AML_THERMAL_ZONE_OP (u16) 0x5b85 182#define AML_THERMAL_ZONE_OP (u16) 0x5b85
180#define AML_INDEX_FIELD_OP (u16) 0x5b86 183#define AML_INDEX_FIELD_OP (u16) 0x5b86
181#define AML_BANK_FIELD_OP (u16) 0x5b87 184#define AML_BANK_FIELD_OP (u16) 0x5b87
182#define AML_DATA_REGION_OP (u16) 0x5b88 /* ACPI 2.0 */ 185#define AML_DATA_REGION_OP (u16) 0x5b88 /* ACPI 2.0 */
183 186
184/* 187/*
185 * Combination opcodes (actually two one-byte opcodes)
186 * Used by the disassembler and iASL compiler
187 */
188#define AML_LGREATEREQUAL_OP (u16) 0x9295
189#define AML_LLESSEQUAL_OP (u16) 0x9294
190#define AML_LNOTEQUAL_OP (u16) 0x9293
191
192/*
193 * Opcodes for "Field" operators 188 * Opcodes for "Field" operators
194 */ 189 */
195#define AML_FIELD_OFFSET_OP (u8) 0x00 190#define AML_FIELD_OFFSET_OP (u8) 0x00
@@ -308,24 +303,19 @@
308#define ARGI_INVALID_OPCODE 0xFFFFFFFF 303#define ARGI_INVALID_OPCODE 0xFFFFFFFF
309 304
310/* 305/*
311 * hash offsets 306 * Some of the flags and types below are of the form:
312 */ 307 *
313#define AML_EXTOP_HASH_OFFSET 22 308 * AML_FLAGS_EXEC_#A_#T,#R, or
314#define AML_LNOT_HASH_OFFSET 19 309 * AML_TYPE_EXEC_#A_#T,#R where:
315 310 *
316/* 311 * #A is the number of required arguments
317 * opcode groups and types 312 * #T is the number of target operands
313 * #R indicates whether there is a return value
318 */ 314 */
319#define OPGRP_NAMED 0x01
320#define OPGRP_FIELD 0x02
321#define OPGRP_BYTELIST 0x04
322 315
323/* 316/*
324 * Opcode information 317 * Opcode information flags
325 */ 318 */
326
327/* Opcode flags */
328
329#define AML_LOGICAL 0x0001 319#define AML_LOGICAL 0x0001
330#define AML_LOGICAL_NUMERIC 0x0002 320#define AML_LOGICAL_NUMERIC 0x0002
331#define AML_MATH 0x0004 321#define AML_MATH 0x0004
@@ -342,7 +332,7 @@
342#define AML_CONSTANT 0x2000 332#define AML_CONSTANT 0x2000
343#define AML_NO_OPERAND_RESOLVE 0x4000 333#define AML_NO_OPERAND_RESOLVE 0x4000
344 334
345/* Convenient flag groupings */ 335/* Convenient flag groupings of the flags above */
346 336
347#define AML_FLAGS_EXEC_0A_0T_1R AML_HAS_RETVAL 337#define AML_FLAGS_EXEC_0A_0T_1R AML_HAS_RETVAL
348#define AML_FLAGS_EXEC_1A_0T_0R AML_HAS_ARGS /* Monadic1 */ 338#define AML_FLAGS_EXEC_1A_0T_0R AML_HAS_ARGS /* Monadic1 */
@@ -359,7 +349,7 @@
359 349
360/* 350/*
361 * The opcode Type is used in a dispatch table, do not change 351 * The opcode Type is used in a dispatch table, do not change
362 * without updating the table. 352 * or add anything new without updating the table.
363 */ 353 */
364#define AML_TYPE_EXEC_0A_0T_1R 0x00 354#define AML_TYPE_EXEC_0A_0T_1R 0x00
365#define AML_TYPE_EXEC_1A_0T_0R 0x01 /* Monadic1 */ 355#define AML_TYPE_EXEC_1A_0T_0R 0x01 /* Monadic1 */
@@ -385,7 +375,7 @@
385 375
386#define AML_TYPE_METHOD_CALL 0x10 376#define AML_TYPE_METHOD_CALL 0x10
387 377
388/* Misc */ 378/* Miscellaneous types */
389 379
390#define AML_TYPE_CREATE_FIELD 0x11 380#define AML_TYPE_CREATE_FIELD 0x11
391#define AML_TYPE_CREATE_OBJECT 0x12 381#define AML_TYPE_CREATE_OBJECT 0x12
@@ -395,7 +385,6 @@
395#define AML_TYPE_NAMED_SIMPLE 0x16 385#define AML_TYPE_NAMED_SIMPLE 0x16
396#define AML_TYPE_NAMED_COMPLEX 0x17 386#define AML_TYPE_NAMED_COMPLEX 0x17
397#define AML_TYPE_RETURN 0x18 387#define AML_TYPE_RETURN 0x18
398
399#define AML_TYPE_UNDEFINED 0x19 388#define AML_TYPE_UNDEFINED 0x19
400#define AML_TYPE_BOGUS 0x1A 389#define AML_TYPE_BOGUS 0x1A
401 390