5336{
5342
5343
5344
5345
5346
5351 } else {
5353 }
5354
5355 if (
ctx->prev_op_ctx)
5357
5358 for (;;) {
5361
5362 op_ctx =
ctx->cur_op_ctx;
5363 frame =
ctx->cur_frame;
5364
5365 if (op_ctx->
pc == 0 &&
ctx->prev_op_ctx) {
5366
5367
5368
5369
5370
5371
5375 }
5376
5379
5381 item = item_array_alloc(&op_ctx->
items);
5384
5388
5391
5395 } else {
5397 }
5400 }
5401
5406
5409
5412 break;
5413
5415 }
5416
5418
5420 if (
ctx->cur_op_ctx) {
5422 ctx->cur_op_ctx->pc++;
5423 }
5424
5426 }
5427
5430 break;
5431
5443
5444
5445
5446
5450
5456 break;
5457
5462
5466 src_width = 8;
5467 } else {
5470 }
5471
5475 );
5476 op_ctx->
pc += src_width;
5477 break;
5478 }
5479
5481 break;
5482
5487
5491
5496 } else {
5498 }
5499
5502 break;
5503 }
5504
5510 break;
5511 }
5512
5515 break;
5516
5519 break;
5520
5523
5525
5531 }
5532
5533 break;
5534 }
5535
5541
5543 for (
i = 0;
i < num_types;
i++) {
5547
5548 expected_mask |= 1u <<
type;
5549 }
5550
5553 break;
5554
5556
5559 "bad object type: expected one of %s/%s, got %s!",
5563 );
5564 break;
5565 }
5566
5568 "bad object type: expected one of 0x%08X, got %s!",
5570 );
5571 break;
5572 }
5573
5576 break;
5577
5580 break;
5581
5585 break;
5586
5591
5593 pkg = &item_array_at(&op_ctx->
items, pkg_idx)->pkg;
5594
5596 op_ctx->
pc += bytes_skip;
5597
5598 break;
5599 }
5600
5607
5611 } else {
5614 }
5615
5619
5621 op_ctx->
pc += bytes_skip;
5622
5623 break;
5624 }
5625
5628
5631
5633 op_ctx->
pc += bytes_skip;
5634
5635 break;
5636 }
5637
5642
5646
5647 if (is_false == skip_if_false)
5648 op_ctx->
pc += bytes_skip;
5649
5650 break;
5651 }
5652
5655 break;
5656 }
5657
5665
5669 else
5671
5673
5676
5677 if (prev_op) {
5680 } else {
5681
5682 is_ok = op_ctx->
op->code == UACPI_AML_OP_ExternalOp;
5683 }
5684
5685 if (is_ok)
5687 }
5688
5693
5694 if (frame->
method->named_objects_persist &&
5698
5699 first_ctx = op_context_array_at(&frame->
pending_ops, 0);
5700 abort_whileif = first_ctx->
op->code == UACPI_AML_OP_WhileOp ||
5701 first_ctx->
op->code == UACPI_AML_OP_IfOp;
5702
5706 }
5707 }
5708
5711 );
5712
5713 if (abort_whileif) {
5714 while (op_context_array_size(&frame->
pending_ops) != 1)
5716
5717 op_ctx = op_context_array_at(&frame->
pending_ops, 0);
5720 break;
5721 }
5722
5725 }
5726
5728 !frame->
method->named_objects_persist)
5730
5731 break;
5732 }
5733
5737
5740 else
5742
5744 break;
5745 }
5746
5753 }
5754 break;
5755
5760
5761 if (!
ctx->prev_op_ctx)
5762 break;
5763
5764 switch (prev_op) {
5770
5777
5778 break;
5782 break;
5783
5790 break;
5791
5792 default:
5793 EXEC_OP_ERR_1(
"don't know how to copy/transfer object to %d",
5794 prev_op);
5796 break;
5797 }
5798
5800 dst = item_array_last(&
ctx->prev_op_ctx->items);
5802
5806 } else {
5810 break;
5811 }
5812
5815 }
5816 }
5817 break;
5818 }
5819
5823
5825
5827 src = item_array_at(&op_ctx->
items,
5829 } else {
5831 }
5832
5834 break;
5835 }
5836
5837
5841 break;
5842
5847
5848 item_array_pop(&op_ctx->
items);
5850
5853 else
5855
5858 break;
5859
5862 break;
5863 }
5864
5868
5869 node = item_array_at(&op_ctx->
items, 0)->node;
5871
5874 );
5876 }
5877
5881
5882 node = item_array_at(&op_ctx->
items, 0)->node;
5883 method = item_array_at(&op_ctx->
items, 1)->obj->method;
5884
5887 );
5889 }
5890
5892 uacpi_aml_op new_op = UACPI_AML_OP_InternalOpNamedObject;
5894
5898 break;
5899 }
5900
5902
5903 switch (
obj->type) {
5906
5907 switch (prev_op) {
5911 break;
5912 default:
5914 }
5915
5916 if (!should_invoke)
5917 break;
5918
5919 new_op = UACPI_AML_OP_InternalOpMethodCall0Args;
5920 new_op +=
obj->method->args;
5921 break;
5922 }
5923
5927
5929 break;
5930
5934
5937 );
5938
5940 "unable to perform a read from field %s: "
5941 "parent opregion gone", field_path
5942 );
5944 }
5945
5948 new_op = UACPI_AML_OP_InternalOpReadFieldAsBuffer;
5949 break;
5951 new_op = UACPI_AML_OP_InternalOpReadFieldAsInteger;
5952 break;
5953 default:
5955 continue;
5956 }
5957 break;
5958 }
5959 default:
5960 break;
5961 }
5962
5965 break;
5966 }
5967
5972
5976
5978 if (op_length == 0 || next_op != target_op) {
5979
5981 break;
5982 }
5983
5988 break;
5989 }
5990
5994
5997
5999 op_ctx->
pc += skip_bytes;
6000 break;
6001 }
6002
6003 default:
6006 break;
6007 }
6008 }
6009}
#define UACPI_ARRAY_SIZE(arr)
#define UACPI_NAMESPACE_NODE_FLAG_TEMPORARY
@ UACPI_PARSE_OP_COMPUTATIONAL_DATA
@ UACPI_PARSE_OP_OBJECT_CONVERT_TO_DEEP_COPY
@ UACPI_PARSE_OP_EXISTING_NAMESTRING_OR_NULL_IF_LOAD
@ UACPI_PARSE_OP_TYPECHECK_ONE_OF
@ UACPI_PARSE_OP_STORE_TO_TARGET_INDIRECT
@ UACPI_PARSE_OP_TERM_ARG
@ UACPI_PARSE_OP_CREATE_NAMESTRING
@ UACPI_PARSE_OP_TRACKED_PKGLEN
@ UACPI_PARSE_OP_CONVERT_NAMESTRING
@ UACPI_PARSE_OP_INSTALL_NAMESPACE_NODE
@ UACPI_PARSE_OP_IF_LAST_NULL
@ UACPI_PARSE_OP_AML_PC_DECREMENT
@ UACPI_PARSE_OP_OBJECT_COPY_TO_PREV
@ UACPI_PARSE_OP_EXISTING_NAMESTRING_OR_NULL
@ UACPI_PARSE_OP_LOAD_TRUE_OBJECT
@ UACPI_PARSE_OP_EXISTING_NAMESTRING
@ UACPI_PARSE_OP_TERM_ARG_OR_NAMED_OBJECT
@ UACPI_PARSE_OP_IF_LAST_NOT_NULL
@ UACPI_PARSE_OP_INVOKE_HANDLER
@ UACPI_PARSE_OP_IF_HAS_DATA
@ UACPI_PARSE_OP_DISPATCH_TABLE_LOAD
@ UACPI_PARSE_OP_TERM_ARG_UNWRAP_INTERNAL
@ UACPI_PARSE_OP_TYPECHECK
@ UACPI_PARSE_OP_SIMPLE_NAME
@ UACPI_PARSE_OP_IF_LAST_FALSE
@ UACPI_PARSE_OP_ITEM_POP
@ UACPI_PARSE_OP_SWITCH_TO_NEXT_IF_EQUALS
@ UACPI_PARSE_OP_SUPERNAME_OR_UNRESOLVED
@ UACPI_PARSE_OP_RECORD_AML_PC
@ UACPI_PARSE_OP_DISPATCH_METHOD_CALL
@ UACPI_PARSE_OP_SUPERNAME
@ UACPI_PARSE_OP_OBJECT_ALLOC
@ UACPI_PARSE_OP_OBJECT_TRANSFER_TO_PREV
@ UACPI_PARSE_OP_IF_LAST_TRUE
@ UACPI_PARSE_OP_LOAD_INLINE_IMM_AS_OBJECT
@ UACPI_PARSE_OP_LOAD_IMM
@ UACPI_PARSE_OP_STORE_TO_TARGET
@ UACPI_PARSE_OP_SKIP_WITH_WARN_IF_NULL
@ UACPI_PARSE_OP_CREATE_NAMESTRING_OR_NULL_IF_LOAD
@ UACPI_PARSE_OP_EMPTY_OBJECT_ALLOC
@ UACPI_PARSE_OP_LOAD_IMM_AS_OBJECT
@ UACPI_PARSE_OP_OBJECT_CONVERT_TO_SHALLOW_COPY
@ UACPI_PARSE_OP_TERM_ARG_OR_NAMED_OBJECT_OR_UNRESOLVED
@ UACPI_PARSE_OP_IF_LAST_EQUALS
@ UACPI_PARSE_OP_IF_NOT_NULL
@ UACPI_PARSE_OP_LOAD_FALSE_OBJECT
@ UACPI_PARSE_OP_OBJECT_ALLOC_TYPED
@ UACPI_PARSE_OP_EMIT_SKIP_WARN
@ UACPI_PARSE_OP_LOAD_ZERO_IMM
@ UACPI_PARSE_OP_IF_SWITCHED_FROM
@ UACPI_PARSE_OP_TRUNCATE_NUMBER
@ UACPI_PARSE_OP_IMM_DECREMENT
@ UACPI_PARSE_OP_LOAD_INLINE_IMM
const struct uacpi_op_spec * uacpi_get_op_spec(uacpi_aml_op)
#define uacpi_memzero(ptr, size)
@ UACPI_ASSIGN_BEHAVIOR_SHALLOW_COPY
void uacpi_free_absolute_path(const uacpi_char *path)
const uacpi_char * uacpi_namespace_node_generate_absolute_path(const uacpi_namespace_node *node)
@ UACPI_STATUS_AML_OBJECT_ALREADY_EXISTS
@ UACPI_STATUS_UNIMPLEMENTED
@ UACPI_STATUS_AML_UNDEFINED_REFERENCE
void uacpi_object_ref(uacpi_object *obj)
uacpi_bool uacpi_object_is_one_of(uacpi_object *, uacpi_object_type_bits type_mask)
@ UACPI_OBJECT_BUFFER_FIELD
static uacpi_status typecheck_operand(const struct op_context *op_ctx, const uacpi_object *obj)
#define EXEC_OP_ERR_3(reason, arg0, arg1, arg2)
static uacpi_status store_to_target(uacpi_object *dst, uacpi_object *src, uacpi_data_view *wtr_response)
static void apply_tracked_pkg(struct call_frame *frame, struct op_context *op_ctx)
static uacpi_status prepare_method_call(struct execution_context *ctx, uacpi_namespace_node *node, uacpi_control_method *method, enum method_call_type type, const uacpi_object_array *args)
static uacpi_bool op_allows_unresolved_if_load(enum uacpi_parse_op op)
static void truncate_number_if_needed(uacpi_object *obj)
static uacpi_status field_get_read_type(uacpi_object *obj, uacpi_object_type *out_type)
static uacpi_u8 parse_op_generates_item[0x100]
static uacpi_u64 ones(void)
static void trace_pop(uacpi_u8 pop)
static void pop_op(struct execution_context *ctx)
static void trace_named_object_lookup_or_creation_failure(struct call_frame *frame, uacpi_size offset, enum uacpi_parse_op op, uacpi_status ret, enum uacpi_log_level level)
static uacpi_bool pop_item(struct op_context *op_ctx)
static uacpi_u8 handler_idx_of_ext_op[0x100]
static void emit_op_skip_warn(const struct op_context *op_ctx)
static uacpi_bool op_wants_supername(enum uacpi_parse_op op)
static uacpi_status push_op(struct execution_context *ctx)
static uacpi_status parse_package_length(struct call_frame *frame, struct package_length *out_pkg)
static void * call_frame_cursor(struct call_frame *frame)
static uacpi_u8 peek_next_op(struct call_frame *frame, uacpi_aml_op *out_op)
static uacpi_u8 op_decode_byte(struct op_context *ctx)
static uacpi_bool op_wants_term_arg_or_operand(enum uacpi_parse_op op)
static uacpi_u8 handler_idx_of_op[0x100]
static uacpi_bool op_allows_unresolved(enum uacpi_parse_op op)
static void trace_op(const struct uacpi_op_spec *op, enum op_trace_action_type action)
static uacpi_status typecheck_string(const struct op_context *op_ctx, const uacpi_object *obj)
static uacpi_status(* op_handlers[])(struct execution_context *ctx)
static uacpi_aml_op op_decode_aml_op(struct op_context *op_ctx)
static uacpi_status do_install_node_item(struct call_frame *frame, struct item *item)
static uacpi_status resolve_name_string(struct call_frame *frame, enum resolve_behavior behavior, struct uacpi_namespace_node **out_node)
#define EXEC_OP_ERR_1(reason, arg0)
#define EXEC_OP_ERR_2(reason, arg0, arg1)
static uacpi_bool ctx_has_non_preempted_op(struct execution_context *ctx)
static uacpi_status typecheck_computational_data(const struct op_context *op_ctx, const uacpi_object *obj)
static uacpi_status op_typecheck(const struct op_context *op_ctx, const struct op_context *cur_op_ctx)
static const uacpi_u8 * op_decode_cursor(const struct op_context *ctx)
GLuint GLuint GLsizei GLenum type
GLint GLint GLsizei width
static BOOL is_null(jsval_t v)
uacpi_u8 immediate_bytes[8]
uacpi_aml_op switched_from
uacpi_control_method * method