ReactOS 0.4.16-dev-1946-g52006dd
opcodes.h File Reference
#include <uacpi/types.h>
Include dependency graph for opcodes.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  uacpi_op_spec
 

Macros

#define UACPI_EXT_PREFIX   0x5B
 
#define UACPI_EXT_OP(op)   ((UACPI_EXT_PREFIX << 8) | (op))
 
#define UACPI_DUAL_NAME_PREFIX   0x2E
 
#define UACPI_MULTI_NAME_PREFIX   0x2F
 
#define UACPI_NULL_NAME   0x00
 
#define UACPI_INTERNAL_OP(code)    UACPI_OP(Internal_##code, code, { UACPI_PARSE_OP_UNREACHABLE })
 
#define UACPI_BAD_OPCODE(code)    UACPI_OP(Reserved_##code, code, { UACPI_PARSE_OP_BAD_OPCODE })
 
#define UACPI_METHOD_CALL_OPCODE(nargs)
 
#define UACPI_UNRESOLVED_NAME_STRING_OP(character, code)
 
#define UACPI_BUILD_LOCAL_OR_ARG_OP(prefix, base, offset)
 
#define UACPI_LOCALX_OP(idx)   UACPI_BUILD_LOCAL_OR_ARG_OP(Local, 0x60, idx)
 
#define UACPI_ARGX_OP(idx)   UACPI_BUILD_LOCAL_OR_ARG_OP(Arg, 0x68, idx)
 
#define UACPI_BUILD_PACKAGE_OP(name, code, jmp_off, ...)
 
#define UACPI_BUILD_BINARY_MATH_OP(prefix, code)
 
#define UACPI_BUILD_UNARY_MATH_OP(type, code)
 
#define UACPI_DO_BUILD_BUFFER_FIELD_OP(type, code, node_idx, ...)
 
#define UACPI_BUILD_BUFFER_FIELD_OP(type, code)    UACPI_DO_BUILD_BUFFER_FIELD_OP(Create##type, code, 2)
 
#define UACPI_INTEGER_LITERAL_OP(type, code, bytes)
 
#define UACPI_BUILD_BINARY_LOGIC_OP(type, code)
 
#define UACPI_BUILD_TO_OP(kind, code, dst_type)
 
#define UACPI_BUILD_INC_DEC_OP(prefix, code)
 
#define UACPI_ENUMERATE_OPCODES
 
#define UACPI_BUILD_NAMED_SCOPE_OBJECT_OP(name, code, type, ...)
 
#define UACPI_BUILD_TO_FROM_BCD(type, code)
 
#define UACPI_ENUMERATE_EXT_OPCODES
 
#define UACPI_OP(name, code, ...)   UACPI_AML_OP_##name = code,
 
#define UACPI_OUT_OF_LINE_OP(name, code, ...)   UACPI_AML_OP_##name = code,
 

Typedefs

typedef uacpi_u16 uacpi_aml_op
 

Enumerations

enum  uacpi_parse_op {
  UACPI_PARSE_OP_END = 0 , UACPI_PARSE_OP_SKIP_WITH_WARN_IF_NULL , UACPI_PARSE_OP_EMIT_SKIP_WARN , UACPI_PARSE_OP_SIMPLE_NAME ,
  UACPI_PARSE_OP_SUPERNAME , UACPI_PARSE_OP_SUPERNAME_OR_UNRESOLVED , UACPI_PARSE_OP_TERM_ARG , UACPI_PARSE_OP_TERM_ARG_UNWRAP_INTERNAL ,
  UACPI_PARSE_OP_TERM_ARG_OR_NAMED_OBJECT , UACPI_PARSE_OP_TERM_ARG_OR_NAMED_OBJECT_OR_UNRESOLVED , UACPI_PARSE_OP_OPERAND , UACPI_PARSE_OP_STRING ,
  UACPI_PARSE_OP_COMPUTATIONAL_DATA , UACPI_PARSE_OP_TARGET , UACPI_PARSE_OP_PKGLEN , UACPI_PARSE_OP_TRACKED_PKGLEN ,
  UACPI_PARSE_OP_CREATE_NAMESTRING , UACPI_PARSE_OP_CREATE_NAMESTRING_OR_NULL_IF_LOAD , UACPI_PARSE_OP_EXISTING_NAMESTRING , UACPI_PARSE_OP_EXISTING_NAMESTRING_OR_NULL ,
  UACPI_PARSE_OP_EXISTING_NAMESTRING_OR_NULL_IF_LOAD , UACPI_PARSE_OP_INVOKE_HANDLER , UACPI_PARSE_OP_OBJECT_ALLOC , UACPI_PARSE_OP_EMPTY_OBJECT_ALLOC ,
  UACPI_PARSE_OP_OBJECT_CONVERT_TO_SHALLOW_COPY , UACPI_PARSE_OP_OBJECT_CONVERT_TO_DEEP_COPY , UACPI_PARSE_OP_OBJECT_ALLOC_TYPED , UACPI_PARSE_OP_RECORD_AML_PC ,
  UACPI_PARSE_OP_LOAD_INLINE_IMM_AS_OBJECT , UACPI_PARSE_OP_LOAD_INLINE_IMM , UACPI_PARSE_OP_LOAD_ZERO_IMM , UACPI_PARSE_OP_LOAD_IMM ,
  UACPI_PARSE_OP_LOAD_IMM_AS_OBJECT , UACPI_PARSE_OP_LOAD_FALSE_OBJECT , UACPI_PARSE_OP_LOAD_TRUE_OBJECT , UACPI_PARSE_OP_TRUNCATE_NUMBER ,
  UACPI_PARSE_OP_TYPECHECK , UACPI_PARSE_OP_INSTALL_NAMESPACE_NODE , UACPI_PARSE_OP_OBJECT_TRANSFER_TO_PREV , UACPI_PARSE_OP_OBJECT_COPY_TO_PREV ,
  UACPI_PARSE_OP_STORE_TO_TARGET , UACPI_PARSE_OP_STORE_TO_TARGET_INDIRECT , UACPI_PARSE_OP_UNREACHABLE , UACPI_PARSE_OP_BAD_OPCODE ,
  UACPI_PARSE_OP_AML_PC_DECREMENT , UACPI_PARSE_OP_IMM_DECREMENT , UACPI_PARSE_OP_ITEM_POP , UACPI_PARSE_OP_DISPATCH_METHOD_CALL ,
  UACPI_PARSE_OP_DISPATCH_TABLE_LOAD , UACPI_PARSE_OP_CONVERT_NAMESTRING , UACPI_PARSE_OP_IF_HAS_DATA , UACPI_PARSE_OP_IF_NULL ,
  UACPI_PARSE_OP_IF_LAST_NULL , UACPI_PARSE_OP_IF_NOT_NULL , UACPI_PARSE_OP_IF_LAST_NOT_NULL , UACPI_PARSE_OP_IF_LAST_EQUALS ,
  UACPI_PARSE_OP_IF_LAST_FALSE , UACPI_PARSE_OP_IF_LAST_TRUE , UACPI_PARSE_OP_SWITCH_TO_NEXT_IF_EQUALS , UACPI_PARSE_OP_IF_SWITCHED_FROM ,
  UACPI_PARSE_OP_JMP , UACPI_PARSE_OP_MAX = UACPI_PARSE_OP_JMP
}
 
enum  uacpi_op_property {
  UACPI_OP_PROPERTY_TERM_ARG = 1 , UACPI_OP_PROPERTY_SUPERNAME = 2 , UACPI_OP_PROPERTY_SIMPLE_NAME = 4 , UACPI_OP_PROPERTY_TARGET = 8 ,
  UACPI_OP_PROPERTY_OUT_OF_LINE = 16 , UACPI_OP_PROPERTY_RESERVED = 128
}
 
enum  uacpi_aml_op { UACPI_ENUMERATE_EXT_OPCODES }
 

Functions

const uacpi_charuacpi_parse_op_to_string (enum uacpi_parse_op op)
 
const struct uacpi_op_specuacpi_get_op_spec (uacpi_aml_op)
 

Variables

uacpi_u8 uacpi_field_op_decode_ops []
 
uacpi_u8 uacpi_index_field_op_decode_ops []
 
uacpi_u8 uacpi_bank_field_op_decode_ops []
 
uacpi_u8 uacpi_load_op_decode_ops []
 
uacpi_u8 uacpi_load_table_op_decode_ops []
 

Macro Definition Documentation

◆ UACPI_ARGX_OP

#define UACPI_ARGX_OP (   idx)    UACPI_BUILD_LOCAL_OR_ARG_OP(Arg, 0x68, idx)

Definition at line 379 of file opcodes.h.

◆ UACPI_BAD_OPCODE

#define UACPI_BAD_OPCODE (   code)     UACPI_OP(Reserved_##code, code, { UACPI_PARSE_OP_BAD_OPCODE })

Definition at line 313 of file opcodes.h.

◆ UACPI_BUILD_BINARY_LOGIC_OP

#define UACPI_BUILD_BINARY_LOGIC_OP (   type,
  code 
)
Value:
type##Op, code, \
{ \
}, \
)
#define UACPI_OP(name, code,...)
Definition: opcodes.h:1384
@ UACPI_PARSE_OP_COMPUTATIONAL_DATA
Definition: opcodes.h:64
@ UACPI_PARSE_OP_INVOKE_HANDLER
Definition: opcodes.h:110
@ UACPI_PARSE_OP_OBJECT_TRANSFER_TO_PREV
Definition: opcodes.h:159
@ UACPI_PARSE_OP_OBJECT_ALLOC_TYPED
Definition: opcodes.h:125
@ UACPI_OP_PROPERTY_TERM_ARG
Definition: opcodes.h:286
@ UACPI_OBJECT_INTEGER
Definition: types.h:106
GLuint GLuint GLsizei GLenum type
Definition: gl.h:1545
Definition: inflate.c:139

Definition at line 457 of file opcodes.h.

◆ UACPI_BUILD_BINARY_MATH_OP

#define UACPI_BUILD_BINARY_MATH_OP (   prefix,
  code 
)
Value:

Definition at line 398 of file opcodes.h.

◆ UACPI_BUILD_BUFFER_FIELD_OP

#define UACPI_BUILD_BUFFER_FIELD_OP (   type,
  code 
)     UACPI_DO_BUILD_BUFFER_FIELD_OP(Create##type, code, 2)

Definition at line 444 of file opcodes.h.

◆ UACPI_BUILD_INC_DEC_OP

◆ UACPI_BUILD_LOCAL_OR_ARG_OP

#define UACPI_BUILD_LOCAL_OR_ARG_OP (   prefix,
  base,
  offset 
)
Value:

Definition at line 365 of file opcodes.h.

◆ UACPI_BUILD_NAMED_SCOPE_OBJECT_OP

#define UACPI_BUILD_NAMED_SCOPE_OBJECT_OP (   name,
  code,
  type,
  ... 
)
Value:
{ \
##__VA_ARGS__, \
UACPI_PARSE_OP_SKIP_WITH_WARN_IF_NULL, 1, \
UACPI_PARSE_OP_OBJECT_ALLOC_TYPED, type, \
UACPI_PARSE_OP_INVOKE_HANDLER, \
UACPI_PARSE_OP_INSTALL_NAMESPACE_NODE, 1, \
} \
)
#define UACPI_EXT_OP(op)
Definition: opcodes.h:8
@ UACPI_PARSE_OP_TRACKED_PKGLEN
Definition: opcodes.h:77
@ UACPI_PARSE_OP_CREATE_NAMESTRING_OR_NULL_IF_LOAD
Definition: opcodes.h:89
Definition: name.c:39

Definition at line 1125 of file opcodes.h.

◆ UACPI_BUILD_PACKAGE_OP

#define UACPI_BUILD_PACKAGE_OP (   name,
  code,
  jmp_off,
  ... 
)
Value:
name##Op, code, \
{ \
##__VA_ARGS__, \
UACPI_PARSE_OP_IF_HAS_DATA, 4, \
UACPI_PARSE_OP_RECORD_AML_PC, \
UACPI_PARSE_OP_TERM_ARG_OR_NAMED_OBJECT_OR_UNRESOLVED, \
UACPI_PARSE_OP_JMP, jmp_off, \
UACPI_PARSE_OP_OBJECT_ALLOC_TYPED, UACPI_OBJECT_PACKAGE, \
UACPI_PARSE_OP_INVOKE_HANDLER, \
UACPI_PARSE_OP_OBJECT_TRANSFER_TO_PREV, \
}, \
UACPI_OP_PROPERTY_TERM_ARG \
)

Definition at line 381 of file opcodes.h.

◆ UACPI_BUILD_TO_FROM_BCD

◆ UACPI_BUILD_TO_OP

◆ UACPI_BUILD_UNARY_MATH_OP

◆ UACPI_DO_BUILD_BUFFER_FIELD_OP

#define UACPI_DO_BUILD_BUFFER_FIELD_OP (   type,
  code,
  node_idx,
  ... 
)
Value:
type##FieldOp, code, \
{ \
##__VA_ARGS__, \
UACPI_PARSE_OP_CREATE_NAMESTRING_OR_NULL_IF_LOAD, \
UACPI_PARSE_OP_SKIP_WITH_WARN_IF_NULL, node_idx, \
UACPI_PARSE_OP_OBJECT_ALLOC_TYPED, UACPI_OBJECT_BUFFER_FIELD, \
UACPI_PARSE_OP_INVOKE_HANDLER, \
UACPI_PARSE_OP_INSTALL_NAMESPACE_NODE, node_idx, \
} \
)
@ UACPI_PARSE_OP_TERM_ARG_UNWRAP_INTERNAL
Definition: opcodes.h:40
@ UACPI_PARSE_OP_TYPECHECK
Definition: opcodes.h:153
@ UACPI_OBJECT_BUFFER
Definition: types.h:108

Definition at line 428 of file opcodes.h.

◆ UACPI_DUAL_NAME_PREFIX

#define UACPI_DUAL_NAME_PREFIX   0x2E

Definition at line 10 of file opcodes.h.

◆ UACPI_ENUMERATE_EXT_OPCODES

#define UACPI_ENUMERATE_EXT_OPCODES

Definition at line 1154 of file opcodes.h.

◆ UACPI_ENUMERATE_OPCODES

#define UACPI_ENUMERATE_OPCODES

Definition at line 498 of file opcodes.h.

◆ UACPI_EXT_OP

#define UACPI_EXT_OP (   op)    ((UACPI_EXT_PREFIX << 8) | (op))

Definition at line 8 of file opcodes.h.

◆ UACPI_EXT_PREFIX

#define UACPI_EXT_PREFIX   0x5B

Definition at line 7 of file opcodes.h.

◆ UACPI_INTEGER_LITERAL_OP

#define UACPI_INTEGER_LITERAL_OP (   type,
  code,
  bytes 
)
Value:
{ \
}, \
) \
static unsigned char bytes[4]
Definition: adnsresfilter.c:74
@ UACPI_PARSE_OP_LOAD_IMM_AS_OBJECT
Definition: opcodes.h:143
_In_ __drv_aliasesMem PSTRING Prefix
Definition: rtlfuncs.h:1647

Definition at line 447 of file opcodes.h.

◆ UACPI_INTERNAL_OP

#define UACPI_INTERNAL_OP (   code)     UACPI_OP(Internal_##code, code, { UACPI_PARSE_OP_UNREACHABLE })

Definition at line 310 of file opcodes.h.

◆ UACPI_LOCALX_OP

#define UACPI_LOCALX_OP (   idx)    UACPI_BUILD_LOCAL_OR_ARG_OP(Local, 0x60, idx)

Definition at line 378 of file opcodes.h.

◆ UACPI_METHOD_CALL_OPCODE

#define UACPI_METHOD_CALL_OPCODE (   nargs)
Value:
InternalOpMethodCall##nargs##Args, 0xF7 + nargs, \
{ \
}, \
)
char ** Args
Definition: acdebug.h:353
@ UACPI_PARSE_OP_JMP
Definition: opcodes.h:271
@ UACPI_PARSE_OP_DISPATCH_METHOD_CALL
Definition: opcodes.h:198
@ UACPI_PARSE_OP_OBJECT_ALLOC
Definition: opcodes.h:113
@ UACPI_PARSE_OP_OBJECT_CONVERT_TO_SHALLOW_COPY
Definition: opcodes.h:118
@ UACPI_PARSE_OP_IF_NOT_NULL
Definition: opcodes.h:233
@ UACPI_PARSE_OP_IMM_DECREMENT
Definition: opcodes.h:192
@ UACPI_PARSE_OP_LOAD_INLINE_IMM
Definition: opcodes.h:134
@ UACPI_OP_PROPERTY_RESERVED
Definition: opcodes.h:295

Definition at line 316 of file opcodes.h.

◆ UACPI_MULTI_NAME_PREFIX

#define UACPI_MULTI_NAME_PREFIX   0x2F

Definition at line 11 of file opcodes.h.

◆ UACPI_NULL_NAME

#define UACPI_NULL_NAME   0x00

Definition at line 12 of file opcodes.h.

◆ UACPI_OP

#define UACPI_OP (   name,
  code,
  ... 
)    UACPI_AML_OP_##name = code,

Definition at line 1384 of file opcodes.h.

◆ UACPI_OUT_OF_LINE_OP

#define UACPI_OUT_OF_LINE_OP (   name,
  code,
  ... 
)    UACPI_AML_OP_##name = code,

Definition at line 1385 of file opcodes.h.

◆ UACPI_UNRESOLVED_NAME_STRING_OP

#define UACPI_UNRESOLVED_NAME_STRING_OP (   character,
  code 
)
Value:
UACPI_InternalOpUnresolvedNameString_##character, code, \
{ \
}, \
)
@ UACPI_PARSE_OP_CONVERT_NAMESTRING
Definition: opcodes.h:211
@ UACPI_PARSE_OP_AML_PC_DECREMENT
Definition: opcodes.h:189
@ UACPI_PARSE_OP_EXISTING_NAMESTRING_OR_NULL
Definition: opcodes.h:101

Definition at line 352 of file opcodes.h.

Typedef Documentation

◆ uacpi_aml_op

Definition at line 5 of file opcodes.h.

Enumeration Type Documentation

◆ uacpi_aml_op

Enumerator
UACPI_ENUMERATE_EXT_OPCODES 

Definition at line 1383 of file opcodes.h.

1383 {
1384#define UACPI_OP(name, code, ...) UACPI_AML_OP_##name = code,
1385#define UACPI_OUT_OF_LINE_OP(name, code, ...) UACPI_AML_OP_##name = code,
1388#undef UACPI_OP
1389#undef UACPI_OUT_OF_LINE_OP
1390};
#define UACPI_ENUMERATE_EXT_OPCODES
Definition: opcodes.h:1154
#define UACPI_ENUMERATE_OPCODES
Definition: opcodes.h:498

◆ uacpi_op_property

Enumerator
UACPI_OP_PROPERTY_TERM_ARG 
UACPI_OP_PROPERTY_SUPERNAME 
UACPI_OP_PROPERTY_SIMPLE_NAME 
UACPI_OP_PROPERTY_TARGET 
UACPI_OP_PROPERTY_OUT_OF_LINE 
UACPI_OP_PROPERTY_RESERVED 

Definition at line 285 of file opcodes.h.

285 {
290
291 // The ops to execute are pointed to by indirect_decode_ops
293
294 // Error if encountered in the AML byte strem
296};
@ UACPI_OP_PROPERTY_OUT_OF_LINE
Definition: opcodes.h:292
@ UACPI_OP_PROPERTY_TARGET
Definition: opcodes.h:289

◆ uacpi_parse_op

Enumerator
UACPI_PARSE_OP_END 
UACPI_PARSE_OP_SKIP_WITH_WARN_IF_NULL 
UACPI_PARSE_OP_EMIT_SKIP_WARN 
UACPI_PARSE_OP_SIMPLE_NAME 
UACPI_PARSE_OP_SUPERNAME 
UACPI_PARSE_OP_SUPERNAME_OR_UNRESOLVED 
UACPI_PARSE_OP_TERM_ARG 
UACPI_PARSE_OP_TERM_ARG_UNWRAP_INTERNAL 
UACPI_PARSE_OP_TERM_ARG_OR_NAMED_OBJECT 
UACPI_PARSE_OP_TERM_ARG_OR_NAMED_OBJECT_OR_UNRESOLVED 
UACPI_PARSE_OP_OPERAND 
UACPI_PARSE_OP_STRING 
UACPI_PARSE_OP_COMPUTATIONAL_DATA 
UACPI_PARSE_OP_TARGET 
UACPI_PARSE_OP_PKGLEN 
UACPI_PARSE_OP_TRACKED_PKGLEN 
UACPI_PARSE_OP_CREATE_NAMESTRING 
UACPI_PARSE_OP_CREATE_NAMESTRING_OR_NULL_IF_LOAD 
UACPI_PARSE_OP_EXISTING_NAMESTRING 
UACPI_PARSE_OP_EXISTING_NAMESTRING_OR_NULL 
UACPI_PARSE_OP_EXISTING_NAMESTRING_OR_NULL_IF_LOAD 
UACPI_PARSE_OP_INVOKE_HANDLER 
UACPI_PARSE_OP_OBJECT_ALLOC 
UACPI_PARSE_OP_EMPTY_OBJECT_ALLOC 
UACPI_PARSE_OP_OBJECT_CONVERT_TO_SHALLOW_COPY 
UACPI_PARSE_OP_OBJECT_CONVERT_TO_DEEP_COPY 
UACPI_PARSE_OP_OBJECT_ALLOC_TYPED 
UACPI_PARSE_OP_RECORD_AML_PC 
UACPI_PARSE_OP_LOAD_INLINE_IMM_AS_OBJECT 
UACPI_PARSE_OP_LOAD_INLINE_IMM 
UACPI_PARSE_OP_LOAD_ZERO_IMM 
UACPI_PARSE_OP_LOAD_IMM 
UACPI_PARSE_OP_LOAD_IMM_AS_OBJECT 
UACPI_PARSE_OP_LOAD_FALSE_OBJECT 
UACPI_PARSE_OP_LOAD_TRUE_OBJECT 
UACPI_PARSE_OP_TRUNCATE_NUMBER 
UACPI_PARSE_OP_TYPECHECK 
UACPI_PARSE_OP_INSTALL_NAMESPACE_NODE 
UACPI_PARSE_OP_OBJECT_TRANSFER_TO_PREV 
UACPI_PARSE_OP_OBJECT_COPY_TO_PREV 
UACPI_PARSE_OP_STORE_TO_TARGET 
UACPI_PARSE_OP_STORE_TO_TARGET_INDIRECT 
UACPI_PARSE_OP_UNREACHABLE 
UACPI_PARSE_OP_BAD_OPCODE 
UACPI_PARSE_OP_AML_PC_DECREMENT 
UACPI_PARSE_OP_IMM_DECREMENT 
UACPI_PARSE_OP_ITEM_POP 
UACPI_PARSE_OP_DISPATCH_METHOD_CALL 
UACPI_PARSE_OP_DISPATCH_TABLE_LOAD 
UACPI_PARSE_OP_CONVERT_NAMESTRING 
UACPI_PARSE_OP_IF_HAS_DATA 
UACPI_PARSE_OP_IF_NULL 
UACPI_PARSE_OP_IF_LAST_NULL 
UACPI_PARSE_OP_IF_NOT_NULL 
UACPI_PARSE_OP_IF_LAST_NOT_NULL 
UACPI_PARSE_OP_IF_LAST_EQUALS 
UACPI_PARSE_OP_IF_LAST_FALSE 
UACPI_PARSE_OP_IF_LAST_TRUE 
UACPI_PARSE_OP_SWITCH_TO_NEXT_IF_EQUALS 
UACPI_PARSE_OP_IF_SWITCHED_FROM 
UACPI_PARSE_OP_JMP 
UACPI_PARSE_OP_MAX 

Definition at line 18 of file opcodes.h.

18 {
20
21 /*
22 * End the execution of the current instruction with a warning if the item
23 * at decode_ops[pc + 1] is NULL.
24 */
26
27 // Emit a warning as if the current opcode is being skipped
29
30 // SimpleName := NameString | ArgObj | LocalObj
32
33 // SuperName := SimpleName | DebugObj | ReferenceTypeOpcode
35 // The resulting item will be set to null if name couldn't be resolved
37
38 // TermArg := ExpressionOpcode | DataObject | ArgObj | LocalObj
41
42 /*
43 * Same as TERM_ARG, but named references are passed as-is.
44 * This means methods are not invoked, fields are not read, etc.
45 */
47
48 /*
49 * Same as UACPI_PARSE_OP_TERM_ARG_OR_NAMED_OBJECT but allows unresolved
50 * name strings.
51 */
53
54 // Operand := TermArg => Integer
56
57 // TermArg => String
59
60 /*
61 * ComputationalData := ByteConst | WordConst | DWordConst | QWordConst |
62 * String | ConstObj | RevisionOp | DefBuffer
63 */
65
66 // Target := SuperName | NullName
68
69 // Parses a pkglen
71
72 /*
73 * Parses a pkglen and records it, the end of this pkglen is considered
74 * the end of the instruction. The PC is always set to the end of this
75 * package once parser reaches UACPI_PARSE_OP_END.
76 */
78
79 /*
80 * Parse a NameString and create the last nameseg.
81 * Note that this errors out if last nameseg already exists.
82 */
84
85 /*
86 * same as UACPI_PARSE_OP_CREATE_NAMESTRING, but attempting to create an
87 * already existing object is not fatal if currently loading a table.
88 */
90
91 /*
92 * Parse a NameString and put the node into the ready parts array.
93 * Note that this errors out if the referenced node doesn't exist.
94 */
96
97 /*
98 * Same as UACPI_PARSE_OP_EXISTING_NAMESTRING except the op doesn't error
99 * out if namestring couldn't be resolved.
100 */
102
103 /*
104 * Same as UACPI_PARSE_OP_EXISTING_NAMESTRING, but undefined references
105 * are not fatal if currently loading a table.
106 */
108
109 // Invoke a handler at op_handlers[spec->code]
111
112 // Allocate an object an put it at the front of the item list
114
116
117 // Convert last item into a shallow/deep copy of itself
120
121 /*
122 * Same as UACPI_PARSE_OP_OBJECT_ALLOC except the type of the allocated
123 * object is specified at decode_ops[pc + 1]
124 */
126
127 // Record current AML program counter as a QWORD immediate
129
130 // Load a QWORD immediate located at decode_ops[pc + 1]
132
133 // Load a decode_ops[pc + 1] byte imm at decode_ops[pc + 2]
135
136 // Load a QWORD zero immediate
138
139 // Load a decode_ops[pc + 1] byte imm from the instructions stream
141
142 // Same as UACPI_PARSE_OP_LOAD_IMM, expect the resulting value is an object
144
145 // Create & Load an integer constant representing either true or false
148
149 // Truncate the last item in the list if needed
151
152 // Ensure the type of item is decode_ops[pc + 1]
154
155 // Install the namespace node specified in items[decode_ops[pc + 1]]
157
158 // Move item to the previous (preempted) op
160
161 /*
162 * Same as UACPI_PARSE_OP_OBJECT_TRANSFER_TO_PREV, but the object
163 * is copied instead. (Useful when dealing with multiple targets)
164 * TODO: optimize this so that we can optionally move the object
165 * if target was a null target.
166 */
168
169 // Store the last item to the target at items[decode_ops[pc + 1]]
171
172 /*
173 * Store the item at items[decode_ops[pc + 2]] to target
174 * at items[decode_ops[pc + 1]]
175 */
177
178 /*
179 * Error if reached. Should be used for opcodes that are supposed to be
180 * converted at op parse time, e.g. invoking a method or referring to
181 * a named object.
182 */
184
185 // Invalid opcode, should never be encountered in the stream
187
188 // Decrement the current AML instruction pointer
190
191 // Decrement the immediate at decode_ops[pc + 1]
193
194 // Remove the last item off the item stack
196
197 // Dispatch the method call from items[0] and return from current op_exec
199
200 /*
201 * Dispatch a table load with scope node at items[0] and method at items[1].
202 * The last item is expected to be an integer object that is set to 0 in
203 * case load fails.
204 */
206
207 /*
208 * Convert the current resolved namestring to either a method call
209 * or a named object reference.
210 */
212
213 /*
214 * Execute the next instruction only if currently tracked package still
215 * has data left, otherwise skip decode_ops[pc + 1] bytes.
216 */
218
219 /*
220 * Execute the next instruction only if the handle at
221 * items[decode_ops[pc + 1]] is null. Otherwise skip
222 * decode_ops[pc + 2] bytes.
223 */
225
226 /*
227 * Execute the next instruction only if the handle at
228 * items[-1] is null. Otherwise skip decode_ops[pc + 1] bytes.
229 */
231
232 // The inverse of UACPI_PARSE_OP_IF_NULL
234
235 // The inverse of UACPI_PARSE_OP_IF_LAST_NULL
237
238 /*
239 * Execute the next instruction only if the last immediate is equal to
240 * decode_ops[pc + 1], otherwise skip decode_ops[pc + 2] bytes.
241 */
243
244 /*
245 * Execute the next instruction only if the last object is a false value
246 * (has a value of 0), otherwise skip decode_ops[pc + 1] bytes.
247 */
249
250 // The inverse of UACPI_PARSE_OP_IF_LAST_FALSE
252
253 /*
254 * Switch to opcode at decode_ops[pc + 1] only if the next AML instruction
255 * in the stream is equal to it. Note that this looks ahead of the tracked
256 * package if one is active. Switching to the next op also applies the
257 * currently tracked package.
258 */
260
261 /*
262 * Execute the next instruction only if this op was switched to from op at
263 * (decode_ops[pc + 1] | decode_ops[pc + 2] << 8), otherwise skip
264 * decode_ops[pc + 3] bytes.
265 */
267
268 /*
269 * pc = decode_ops[pc + 1]
270 */
273};
@ UACPI_PARSE_OP_OBJECT_CONVERT_TO_DEEP_COPY
Definition: opcodes.h:119
@ UACPI_PARSE_OP_EXISTING_NAMESTRING_OR_NULL_IF_LOAD
Definition: opcodes.h:107
@ UACPI_PARSE_OP_END
Definition: opcodes.h:19
@ UACPI_PARSE_OP_BAD_OPCODE
Definition: opcodes.h:186
@ UACPI_PARSE_OP_STORE_TO_TARGET_INDIRECT
Definition: opcodes.h:176
@ UACPI_PARSE_OP_TERM_ARG
Definition: opcodes.h:39
@ UACPI_PARSE_OP_CREATE_NAMESTRING
Definition: opcodes.h:83
@ UACPI_PARSE_OP_INSTALL_NAMESPACE_NODE
Definition: opcodes.h:156
@ UACPI_PARSE_OP_IF_LAST_NULL
Definition: opcodes.h:230
@ UACPI_PARSE_OP_LOAD_TRUE_OBJECT
Definition: opcodes.h:147
@ UACPI_PARSE_OP_PKGLEN
Definition: opcodes.h:70
@ UACPI_PARSE_OP_EXISTING_NAMESTRING
Definition: opcodes.h:95
@ UACPI_PARSE_OP_TERM_ARG_OR_NAMED_OBJECT
Definition: opcodes.h:46
@ UACPI_PARSE_OP_IF_LAST_NOT_NULL
Definition: opcodes.h:236
@ UACPI_PARSE_OP_IF_HAS_DATA
Definition: opcodes.h:217
@ UACPI_PARSE_OP_DISPATCH_TABLE_LOAD
Definition: opcodes.h:205
@ UACPI_PARSE_OP_SIMPLE_NAME
Definition: opcodes.h:31
@ UACPI_PARSE_OP_IF_LAST_FALSE
Definition: opcodes.h:248
@ UACPI_PARSE_OP_ITEM_POP
Definition: opcodes.h:195
@ UACPI_PARSE_OP_SWITCH_TO_NEXT_IF_EQUALS
Definition: opcodes.h:259
@ UACPI_PARSE_OP_SUPERNAME_OR_UNRESOLVED
Definition: opcodes.h:36
@ UACPI_PARSE_OP_RECORD_AML_PC
Definition: opcodes.h:128
@ UACPI_PARSE_OP_MAX
Definition: opcodes.h:272
@ UACPI_PARSE_OP_UNREACHABLE
Definition: opcodes.h:183
@ UACPI_PARSE_OP_IF_LAST_TRUE
Definition: opcodes.h:251
@ UACPI_PARSE_OP_IF_NULL
Definition: opcodes.h:224
@ UACPI_PARSE_OP_LOAD_INLINE_IMM_AS_OBJECT
Definition: opcodes.h:131
@ UACPI_PARSE_OP_STRING
Definition: opcodes.h:58
@ UACPI_PARSE_OP_LOAD_IMM
Definition: opcodes.h:140
@ UACPI_PARSE_OP_SKIP_WITH_WARN_IF_NULL
Definition: opcodes.h:25
@ UACPI_PARSE_OP_TERM_ARG_OR_NAMED_OBJECT_OR_UNRESOLVED
Definition: opcodes.h:52
@ UACPI_PARSE_OP_IF_LAST_EQUALS
Definition: opcodes.h:242
@ UACPI_PARSE_OP_LOAD_FALSE_OBJECT
Definition: opcodes.h:146
@ UACPI_PARSE_OP_EMIT_SKIP_WARN
Definition: opcodes.h:28
@ UACPI_PARSE_OP_LOAD_ZERO_IMM
Definition: opcodes.h:137
@ UACPI_PARSE_OP_IF_SWITCHED_FROM
Definition: opcodes.h:266

Function Documentation

◆ uacpi_get_op_spec()

const struct uacpi_op_spec * uacpi_get_op_spec ( uacpi_aml_op  op)

Definition at line 44 of file opcodes.c.

45{
46 if (op > 0xFF)
48
49 return &opcode_table[op];
50}
UINT op
Definition: effect.c:236
static const uacpi_u8 ext_op_to_idx[0x100]
Definition: opcodes.c:26
static const struct uacpi_op_spec ext_opcode_table[]
Definition: opcodes.c:20
#define _(op)
Definition: opcodes.c:24
static const struct uacpi_op_spec opcode_table[0x100]
Definition: opcodes.c:16

Referenced by exec_op(), and get_op().

◆ uacpi_parse_op_to_string()

const uacpi_char * uacpi_parse_op_to_string ( enum uacpi_parse_op  op)

Definition at line 260 of file opcodes.c.

265{
#define uacpi_unlikely(expr)
Definition: compiler.h:58

Referenced by trace_pop().

Variable Documentation

◆ uacpi_bank_field_op_decode_ops

uacpi_u8 uacpi_bank_field_op_decode_ops[]
extern

Definition at line 102 of file opcodes.c.

◆ uacpi_field_op_decode_ops

uacpi_u8 uacpi_field_op_decode_ops[]
extern

Definition at line 95 of file opcodes.c.

◆ uacpi_index_field_op_decode_ops

uacpi_u8 uacpi_index_field_op_decode_ops[]
extern

Definition at line 111 of file opcodes.c.

◆ uacpi_load_op_decode_ops

uacpi_u8 uacpi_load_op_decode_ops[]
extern

Definition at line 119 of file opcodes.c.

◆ uacpi_load_table_op_decode_ops

uacpi_u8 uacpi_load_table_op_decode_ops[]
extern

Definition at line 149 of file opcodes.c.