21#ifndef UACPI_BAREBONES_MODE
74 struct op_context_array *arr
79 size = op_context_array_size(arr);
84 return op_context_array_at(arr,
size - 2);
119 slot = held_mutexes_array_alloc(arr);
134 size = held_mutexes_array_inline_capacity(arr);
139 size = arr->size_including_inline -
size;
143 &arr->dynamic_storage[
i], &arr->dynamic_storage[
i + 1],
144 size *
sizeof(arr->inline_storage[0])
147 held_mutexes_array_pop(arr);
152 arr->size_including_inline);
155 &arr->inline_storage[
i], &arr->inline_storage[
i + 1],
156 size *
sizeof(arr->inline_storage[0])
159 size = held_mutexes_array_size(arr);
160 i = held_mutexes_array_inline_capacity(arr);
168 arr->inline_storage[
i - 1] = arr->dynamic_storage[0];
172 &arr->dynamic_storage[0], &arr->dynamic_storage[1],
173 size *
sizeof(arr->inline_storage[0])
177 held_mutexes_array_pop(arr);
196 item = *held_mutexes_array_last(arr);
201 "ignoring mutex @%p release due to sync level mismatch: %d vs %d",
216 held_mutexes_array_pop(arr);
226 i = held_mutexes_array_size(arr);
228 item = *held_mutexes_array_at(arr, --
i);
259 slot = temp_namespace_node_array_alloc(arr);
312 struct call_frame_array *arr
317 size = call_frame_array_size(arr);
322 return call_frame_array_at(arr,
size - 2);
340#define AML_READ(ptr, offset) (*(((uacpi_u8*)(ptr)) + offset))
372 uacpi_size bytes_left, prefix_bytes, nameseg_bytes = 0, namesegs;
399 if (prev_char !=
'^')
445 nameseg_bytes = namesegs * 4;
448 nameseg_bytes += namesegs - 1;
451 *
out_size = nameseg_bytes + prefix_bytes + 1;
459 base_cursor = *out_string;
460 base_cursor += prefix_bytes;
462 while (namesegs-- > 0) {
468 *base_cursor++ =
'.';
502 if (prev_char ==
'^')
512 cur_node = cur_node->
parent;
531 if (prev_char !=
'^')
580 for (; namesegs;
cursor += 4, namesegs--) {
610 if (just_one_nameseg) {
636 *out_node = cur_node;
649 if (!frame->
method->named_objects_persist)
709 "invalid opcode '%s' (0x%04X) at AML offset %u",
710 ctx->cur_op->name,
op,
ctx->cur_frame->code_offset
729 aml_offset = item_array_at(&op_ctx->
items, 2)->immediate;
730 src =
ctx->cur_frame->method->code;
733 pkg = &item_array_at(&op_ctx->
items, 0)->pkg;
734 init_size = pkg->
end - aml_offset;
740 declared_size = item_array_at(&op_ctx->
items, 1)->obj;
744 "buffer is too large (%"UACPI_PRIu64"), assuming corrupted "
753 "too many buffer initializers: %u (size is %u)",
763 dst = item_array_at(&op_ctx->
items, 3)->obj;
781 obj = item_array_last(&
ctx->cur_op_ctx->items)->obj;
805 uacpi_u32 num_elements, num_defined_elements,
i;
814 package = item_array_last(&op_ctx->items)->obj->package;
817 if (op_ctx->
op->code == UACPI_AML_OP_VarPackageOp) {
820 var_num_elements = item_array_at(&op_ctx->
items, 1)->obj;
828 num_elements = var_num_elements->
integer;
830 num_elements = item_array_at(&op_ctx->
items, 1)->immediate;
833 num_defined_elements = (item_array_size(&op_ctx->
items) - 3) / 2;
836 "too many package initializers: %u, truncating to %u",
837 num_defined_elements, num_elements
840 num_defined_elements = num_elements;
849 for (
i = 0;
i < num_defined_elements; ++
i) {
855 base_pkg_index = (
i * 2) + 2;
856 item = item_array_at(&op_ctx->
items, base_pkg_index + 1);
887 item_array_at(&op_ctx->
items, base_pkg_index)->immediate,
928 if (out_buf->
length && !include_null)
931 out_buf->
text =
obj->buffer->text;
934 if (
obj->buffer->size == 0) {
957 out_cursor += buf_idx->
idx;
982 if (chunk_size == 0 ||
buf->length == 0)
987 offset = (
buf->length - 1) / chunk_size * chunk_size;
1025 switch (
dst->type) {
1045 dst->buffer_field.bit_length
1066 dst->field_unit,
src, &src_buf, wtr_response
1087 "attempted to perform an invalid implicit cast (%s -> %s)",
1130 dst = item_array_last(&
ctx->cur_op_ctx->items);
1143 idx = op_ctx->
op->code - UACPI_AML_OP_Local0Op;
1152 idx = op_ctx->
op->code - UACPI_AML_OP_Arg0Op;
1161 src = item_array_at(&
ctx->cur_op_ctx->items, 0)->node;
1162 dst = item_array_at(&
ctx->cur_op_ctx->items, 1);
1175 src = item_array_at(&
ctx->cur_op_ctx->items, 0)->node;
1176 dst = item_array_at(&
ctx->cur_op_ctx->items, 1)->node;
1178 dst->object =
src->object;
1192 node = item_array_at(&
ctx->cur_op_ctx->items, 0)->node;
1193 obj = item_array_at(&
ctx->cur_op_ctx->items, 4)->obj;
1194 op_region =
obj->op_region;
1196 op_region->
space = item_array_at(&
ctx->cur_op_ctx->items, 1)->immediate;
1197 op_region->
offset = item_array_at(&
ctx->cur_op_ctx->items, 2)->obj->integer;
1198 op_region->
length = item_array_at(&
ctx->cur_op_ctx->items, 3)->obj->integer;
1203 uacpi_warn(
"unusable/empty operation region %.4s",
node->name.text);
1206 "invalid operation region %.4s bounds: offset=0x%"UACPI_PRIX64
1215 "invalid PCC operation region %.4s subspace %"UACPI_PRIX64,
1245 "%s: unable to find table '%.4s' (OEM ID '%.6s', "
1246 "OEM Table ID '%.8s'): %s",
1247 opcode,
id->signature.text,
id->oemid,
id->oem_table_id,
1279 oem_table_id->
size ? oem_table_id->
size - 1 : 0
1288 struct item_array *
items = &
ctx->cur_op_ctx->items;
1298 "DataTableRegion", &table_id,
1299 item_array_at(
items, 1)->
obj->buffer,
1300 item_array_at(
items, 2)->
obj->buffer,
1301 item_array_at(
items, 3)->
obj->buffer
1312 obj = item_array_at(
items, 4)->obj;
1313 op_region =
obj->op_region;
1339 struct acpi_dsdt *dsdt =
ptr;
1348 "host-invoked load of" :
"dynamic load of";
1357 in_method->
code = dsdt->definition_block;
1358 in_method->
size = dsdt->hdr.length -
sizeof(dsdt->hdr);
1389 struct item_array *
items = &
ctx->cur_op_ctx->items;
1390 struct item *root_node_item;
1403 if (item_array_size(
items) == 12) {
1407 idx = item_array_at(
items, 2)->immediate;
1432 "LoadTable", &table_id,
1433 item_array_at(
items, 5)->
obj->buffer,
1434 item_array_at(
items, 6)->
obj->buffer,
1435 item_array_at(
items, 7)->
obj->buffer
1440 root_path = item_array_at(
items, 8)->obj->buffer;
1441 param_path = item_array_at(
items, 9)->obj->buffer;
1442 root_node_item = item_array_at(
items, 0);
1444 if (root_path->
size > 1) {
1460 if (param_path->
size > 1) {
1461 struct item *param_item;
1475 param_item = item_array_at(
items, 3);
1497 item_array_at(
items, 2)->immediate =
table.index;
1499 root_node_item->
node = root_node;
1509 struct item_array *
items = &
ctx->cur_op_ctx->items;
1524 if (item_array_size(
items) == 6) {
1528 idx = item_array_at(
items, 2)->immediate;
1532 if (item_array_at(
items, 5)->
obj->integer != 0)
1537 src = item_array_at(
items, 3)->obj;
1539 switch (
src->type) {
1543 op_region =
src->op_region;
1547 uacpi_error(
"Load: operation region is not SystemMemory");
1564 "Load: failed to map operation region "
1574 declared_size = op_region->
length;
1582 if (
buffer->size <
sizeof(
struct acpi_sdt_hdr)) {
1584 "Load: buffer is too small: %zu",
1592 src_table =
buffer->data;
1593 declared_size =
buffer->size;
1599 "Load: invalid argument '%s', expected "
1600 "Buffer/Field/OperationRegion",
1609 "Load: table size %u is larger than the declared size %zu",
1610 src_table->length, declared_size
1616 if (
uacpi_unlikely(src_table->length <
sizeof(
struct acpi_sdt_hdr))) {
1617 uacpi_error(
"Load: table size %u is too small", src_table->length);
1628 uacpi_memcpy(table_buffer, src_table, src_table->length);
1661 item_array_at(
items, 2)->immediate =
table.index;
1667 if (unmap_src && src_table)
1707 "invalid argument: '%.4s' is not a field unit (%s)",
1713 *out_field =
obj->field_unit;
1725 "invalid argument: '%.4s' is not an operation region (%s)",
1745 uacpi_u8 raw_value, access_type, lock_rule, update_rule;
1746 uacpi_u8 access_attrib = 0, access_length = 0;
1748 switch (op_ctx->
op->code) {
1749 case UACPI_AML_OP_FieldOp:
1750 node = item_array_at(&op_ctx->
items,
i++)->node;
1756 case UACPI_AML_OP_BankFieldOp:
1757 node = item_array_at(&op_ctx->
items,
i++)->node;
1762 node = item_array_at(&op_ctx->
items,
i++)->node;
1767 field_data.
value = item_array_at(&op_ctx->
items,
i++)->obj->integer;
1770 case UACPI_AML_OP_IndexFieldOp:
1771 node = item_array_at(&op_ctx->
items,
i++)->node;
1776 node = item_array_at(&op_ctx->
items,
i++)->node;
1806 raw_value = item_array_at(&op_ctx->
items,
i++)->immediate;
1807 access_type = (raw_value >> 0) & 0xF;
1808 lock_rule = (raw_value >> 4) & 0x1;
1809 update_rule = (raw_value >> 5) & 0x3;
1811 while (
i < item_array_size(&op_ctx->
items)) {
1822 obj = item_array_at(&op_ctx->
items,
i++)->obj;
1830 field->update_rule = update_rule;
1831 field->lock_rule = lock_rule;
1832 field->attributes = access_attrib;
1833 field->access_length = access_length;
1845 switch (access_type) {
1856 field->access_width_bytes = 1;
1859 field->access_width_bytes = 2;
1862 field->access_width_bytes = 4;
1865 field->access_width_bytes = 8;
1868 uacpi_error(
"invalid field '%.4s' access type %d",
1869 node->name.text, access_type);
1874 field->pin_offset = pin_offset;
1879 field->access_width_bytes,
1883 field->bit_offset_within_first_byte =
1884 bit_offset & ((
field->access_width_bytes * 8) - 1);
1886 switch (op_ctx->
op->code) {
1887 case UACPI_AML_OP_FieldOp:
1894 case UACPI_AML_OP_BankFieldOp:
1905 case UACPI_AML_OP_IndexFieldOp:
1919 field->connection = connection_obj;
1920 if (
field->connection)
1935 !
ctx->cur_frame->method->named_objects_persist)
1938 uacpi_warn(
"duplicate field '%.4s', skipping",
1961 raw_value = item_array_at(&op_ctx->
items,
i++)->immediate;
1963 access_type = raw_value & 0xF;
1964 access_attrib = (raw_value >> 6) & 0x3;
1966 raw_value = item_array_at(&op_ctx->
items,
i++)->immediate;
1976 if (access_attrib) {
1977 switch (access_attrib) {
1989 access_length = raw_value;
1991 access_attrib = raw_value;
1995 access_length = item_array_at(&op_ctx->
items,
i++)->immediate;
2000 connection_obj = item_array_at(&op_ctx->
items,
i++)->obj;
2017 obj->integer &= 0xFFFFFFFF;
2031 depth = call_frame_array_size(&
ctx->call_stack);
2036 frame = call_frame_array_at(&
ctx->call_stack,
depth - 2);
2053 op_ctx->
op->code == UACPI_AML_OP_LoadTableOp)) {
2058 *out_operand = item_array_last(&op_ctx->
items)->obj;
2072 *out_obj =
ctx->ret;
2089 i = code_block_array_size(
blocks);
2096 *out_idx_plus_one =
i + 1;
2102 *out_idx_plus_one = 0;
2117 pkg = &item_array_at(&op_ctx->
items, 0)->pkg;
2122 switch (op_ctx->
op->code) {
2123 case UACPI_AML_OP_IfOp:
2126 case UACPI_AML_OP_ElseOp:
2129 case UACPI_AML_OP_WhileOp:
2138 uacpi_error(
"loop time out after running for %u seconds",
2151 block->expiration_point +=
2159 case UACPI_AML_OP_ScopeOp:
2160 case UACPI_AML_OP_DeviceOp:
2161 case UACPI_AML_OP_ProcessorOp:
2162 case UACPI_AML_OP_PowerResOp:
2163 case UACPI_AML_OP_ThermalZoneOp:
2165 block->node = item_array_at(&op_ctx->
items, 1)->node;
2218 switch (
src->type) {
2242 "%s Package @%p (%p) (%zu elements)",
2248 "%s Buffer @%p (%p) (%zu bytes)",
2262 "%s Power Resource %d %d",
2263 prefix,
src->power_resource.system_level,
2264 src->power_resource.resource_order
2269 "%s Processor[%d] 0x%08X (%d)",
2270 prefix,
src->processor->id,
src->processor->block_address,
2271 src->processor->block_length
2276 "%s Buffer Index %p[%zu] => 0x%02X",
2277 prefix,
src->buffer_index.buffer->data,
src->buffer_index.idx,
2283 "%s Mutex @%p (%p => %p) sync level %d",
2285 src->mutex->sync_level
2392 struct object_queue
queue = { 0 };
2403 for (
i = 0;
i < object_queue_size(&
queue); ++
i) {
2410 uacpi_error(
"store would create a reference cycle");
2420 for (
j = 0;
j <
obj->package->count; ++
j) {
2427 for (
i = 0;
i < object_queue_size(&
queue); ++
i)
2430 object_queue_clear(&
queue);
2441 if (
node->object == target_object) {
2574 switch (
dst->flags) {
2641 switch (
dst->flags) {
2658 "attempted to overwrite %s object via an ArgX reference",
2702 dst->inner_object, src_obj, wtr_response
2711 src = item_array_at(&op_ctx->
items, 0)->obj;
2713 if (op_ctx->
op->code == UACPI_AML_OP_CondRefOfOp)
2714 dst = item_array_at(&op_ctx->
items, 2)->obj;
2716 dst = item_array_at(&op_ctx->
items, 1)->obj;
2734 rhs =
arg1->integer;
2738 case UACPI_AML_OP_AddOp:
2741 case UACPI_AML_OP_SubtractOp:
2744 case UACPI_AML_OP_MultiplyOp:
2747 case UACPI_AML_OP_ShiftLeftOp:
2748 case UACPI_AML_OP_ShiftRightOp:
2750 if (
op == UACPI_AML_OP_ShiftLeftOp)
2758 case UACPI_AML_OP_NandOp:
2761 case UACPI_AML_OP_AndOp:
2764 case UACPI_AML_OP_NorOp:
2767 case UACPI_AML_OP_OrOp:
2770 case UACPI_AML_OP_XorOp:
2773 case UACPI_AML_OP_DivideOp:
2781 case UACPI_AML_OP_ModOp:
2783 uacpi_error(
"attempted to calculate modulo of zero");
2802 struct item_array *
items = &
ctx->cur_op_ctx->items;
2805 arg0 = item_array_at(
items, 0)->obj;
2808 if (
op == UACPI_AML_OP_DivideOp) {
2809 tgt0 = item_array_at(
items, 4)->obj;
2810 tgt1 = item_array_at(
items, 5)->obj;
2812 tgt0 = item_array_at(
items, 3)->obj;
2822 struct item_array *
items = &
ctx->cur_op_ctx->items;
2825 arg = item_array_at(
items, 0)->obj;
2826 tgt = item_array_at(
items, 2)->obj;
2829 case UACPI_AML_OP_NotOp:
2833 case UACPI_AML_OP_FindSetRightBitOp:
2836 case UACPI_AML_OP_FindSetLeftBitOp:
2853 "invalid index %zu, %s@%p has %zu elements",
2867 src = item_array_at(&op_ctx->
items, 0)->obj;
2868 idx = item_array_at(&op_ctx->
items, 1)->obj->integer;
2869 dst = item_array_at(&op_ctx->
items, 3);
2871 switch (
src->type) {
2887 buf_idx = &
dst->obj->buffer_index;
2934 "invalid argument for Index: %s, "
2935 "expected String/Buffer/Package",
2949 switch (
obj->type) {
2981 int_buf,
sizeof(int_buf),
2989 final_size = (
is_hex ? 2 : 0) + repr_len + 1;
3000 str->size = final_size;
3015 final_size = 4 *
buf->size;
3019 for (
i = 0;
i <
buf->size; ++
i) {
3024 else if (
value < 100)
3043 for (
i = 0;
i <
buf->size; ++
i) {
3045 int_buf,
sizeof(int_buf),
3046 is_hex ?
"0x%02X" :
"%d",
3058 if (
i !=
buf->size - 1)
3063 str->size = final_size;
3101 src = item_array_at(&op_ctx->
items, 0)->obj;
3102 dst = item_array_at(&op_ctx->
items, 2)->obj;
3104 switch (op_ctx->
op->code) {
3105 case UACPI_AML_OP_ToIntegerOp:
3109 case UACPI_AML_OP_ToHexStringOp:
3110 case UACPI_AML_OP_ToDecimalStringOp: {
3122 case UACPI_AML_OP_ToBufferOp: {
3138 dst->buffer->data = dst_buf;
3139 dst->buffer->size =
buf.length;
3156 src_buf = item_array_at(&op_ctx->
items, 0)->obj->buffer;
3157 req_len = item_array_at(&op_ctx->
items, 1)->obj->integer;
3158 dst_buf = item_array_at(&op_ctx->
items, 3)->obj->buffer;
3186 src = item_array_at(&op_ctx->
items, 0)->obj;
3190 "invalid argument for Mid: %s, expected String/Buffer",
3196 idx = item_array_at(&op_ctx->
items, 1)->obj->integer;
3197 len = item_array_at(&op_ctx->
items, 2)->obj->integer;
3198 dst = item_array_at(&op_ctx->
items, 4)->obj;
3199 dst_buf =
dst->buffer;
3225 dst_buf->
text[dst_buf->
size++] =
'\0';
3240 arg0 = item_array_at(&op_ctx->
items, 0)->obj;
3241 arg1 = item_array_at(&op_ctx->
items, 1)->obj;
3242 dst = item_array_at(&op_ctx->
items, 3)->obj;
3244 switch (arg0->
type) {
3250 buf_size = int_size * 2;
3259 uacpi_memcpy(dst_buf+ int_size, &arg1_as_int, int_size);
3284 switch (
arg1->type) {
3293 arg1_size =
size + 1;
3297 arg1_ptr =
arg1->buffer->data;
3298 arg1_size =
arg1->buffer->size;
3307 arg1_ptr = tmp_buf.
data;
3308 arg1_size = tmp_buf.
size;
3315 arg0_size = arg0_buf->
size ? arg0_buf->
size - 1 : arg0_buf->
size;
3316 buf_size = arg0_size + arg1_size;
3325 uacpi_memcpy(dst_buf + arg0_size, arg1_ptr, arg1_size);
3338 dst->buffer->data = dst_buf;
3339 dst->buffer->size = buf_size;
3353 arg0 = item_array_at(&op_ctx->
items, 0)->obj;
3354 arg1 = item_array_at(&op_ctx->
items, 1)->obj;
3355 dst = item_array_at(&op_ctx->
items, 3)->obj;
3373 dst->buffer->data = dst_buf;
3374 dst->buffer->size = dst_size;
3383 dst_buf[dst_size - 2] =
3386 dst_buf[dst_size - 1] = 0;
3396 src = item_array_at(&op_ctx->
items, 0)->obj;
3397 dst = item_array_at(&op_ctx->
items, 1)->obj;
3402 switch (
src->type) {
3408 dst->integer =
buf.length;
3413 dst->integer =
src->package->count;
3418 "invalid argument for Sizeof: %s, "
3419 "expected String/Buffer/Package",
3433 src = item_array_at(&op_ctx->
items, 0)->obj;
3434 dst = item_array_at(&op_ctx->
items, 1)->obj;
3451 dst = item_array_at(&op_ctx->
items, 0)->obj;
3462 time = item_array_at(&op_ctx->
items, 0)->obj->integer;
3464 if (op_ctx->
op->code == UACPI_AML_OP_SleepOp) {
3493 dst_obj = item_array_at(&op_ctx->
items, 2)->obj;
3501 if (op_ctx->
op->code == UACPI_AML_OP_FromBCDOp) {
3541 uacpi_warn(
"refusing to unload a table from AML");
3550 src = item_array_at(&op_ctx->
items, 0)->obj;
3551 dst = item_array_at(&op_ctx->
items, 1)->obj;
3596 else if (lhs_buf->
size > rhs_buf->
size)
3600 if (
op == UACPI_AML_OP_LLessOp)
3606 if (
op == UACPI_AML_OP_LLessOp)
3619 lhs = item_array_at(&op_ctx->
items, 0)->obj;
3620 rhs = item_array_at(&op_ctx->
items, 1)->obj;
3621 dst = item_array_at(&op_ctx->
items, 2)->obj;
3624 case UACPI_AML_OP_LEqualOp:
3625 case UACPI_AML_OP_LLessOp:
3626 case UACPI_AML_OP_LGreaterOp:
3630 "don't know how to do a logical comparison of '%s' and '%s'",
3637 if (
op == UACPI_AML_OP_LEqualOp)
3649 if (
op == UACPI_AML_OP_LandOp)
3650 res = lhs_int && rhs_int;
3652 res = lhs_int || rhs_int;
3698 pkg = item_array_at(&op_ctx->
items, 0)->obj->package;
3699 mop0 = item_array_at(&op_ctx->
items, 1)->immediate;
3700 operand0 = item_array_at(&op_ctx->
items, 2)->obj->integer;
3701 mop1 = item_array_at(&op_ctx->
items, 3)->immediate;
3702 operand1 = item_array_at(&op_ctx->
items, 4)->obj->integer;
3703 start_idx = item_array_at(&op_ctx->
items, 5)->obj->integer;
3704 dst = item_array_at(&op_ctx->
items, 6)->obj;
3706 for (
i = start_idx;
i < pkg->
count; ++
i) {
3749 marker_length += *
data >> 6;
3754 switch (marker_length) {
3767 size |= temp_byte << 4;
3777 "PkgLength overflow: start=%u, size=%u", out_pkg->
begin,
size
3795 method->args = flags_byte & 0x7;
3796 method->is_serialized = (flags_byte >> 3) & 1;
3797 method->sync_level = flags_byte >> 4;
3807 uacpi_u32 method_begin_offset, method_size;
3809 this_method =
ctx->cur_frame->method;
3810 pkg = &item_array_at(&op_ctx->
items, 0)->pkg;
3811 node = item_array_at(&op_ctx->
items, 1)->node;
3812 method_begin_offset = item_array_at(&op_ctx->
items, 3)->immediate;
3815 pkg->
end < method_begin_offset ||
3816 pkg->
end > this_method->
size)) {
3818 "invalid method %.4s bounds [%u..%u] (parent size is %u)",
3819 node->name.text, method_begin_offset, pkg->
end, this_method->
size
3824 dst = item_array_at(&op_ctx->
items, 4)->obj;
3827 method_size = pkg->
end - method_begin_offset;
3836 ctx->cur_frame->method->code + method_begin_offset,
3839 method->size = method_size;
3859 node = item_array_at(&op_ctx->
items, 0)->node;
3861 if (op_ctx->
op->code == UACPI_AML_OP_MutexOp) {
3862 dst = item_array_at(&op_ctx->
items, 2)->obj;
3865 dst->mutex->sync_level = item_array_at(&op_ctx->
items, 1)->immediate;
3866 dst->mutex->sync_level &= 0xF;
3868 dst = item_array_at(&op_ctx->
items, 1)->obj;
3887 item_array_at(&op_ctx->
items, 0)->obj
3891 "%s: invalid argument '%s', expected an Event object",
3897 switch (op_ctx->
op->code)
3899 case UACPI_AML_OP_SignalOp:
3902 case UACPI_AML_OP_ResetOp:
3905 case UACPI_AML_OP_WaitOp: {
3909 timeout = item_array_at(&op_ctx->
items, 1)->obj->integer;
3932 item_array_at(&op_ctx->
items, 2)->obj->integer = 0;
3948 item_array_at(&op_ctx->
items, 0)->obj
3952 "%s: invalid argument '%s', expected a Mutex object",
3958 switch (op_ctx->
op->code)
3960 case UACPI_AML_OP_AcquireOp: {
3965 return_value = &item_array_at(&op_ctx->
items, 2)->obj->integer;
3969 "ignoring attempt to acquire mutex @%p with a lower sync level "
3970 "(%d < %d)",
obj->mutex,
obj->mutex->sync_level,
3997 ret = held_mutexes_array_push(&
ctx->held_mutexes,
obj->mutex);
4004 ctx->sync_level =
obj->mutex->sync_level;
4012 case UACPI_AML_OP_ReleaseOp: {
4017 "attempted to release not-previously-acquired mutex object "
4018 "@%p (%p)",
obj->mutex,
obj->mutex->handle
4024 &
ctx->held_mutexes,
obj->mutex,
4030 last_mutex = held_mutexes_array_last(&
ctx->held_mutexes);
4032 ctx->sync_level = 0;
4036 ctx->sync_level = (*last_mutex)->sync_level;
4055 node = item_array_at(&op_ctx->
items, 0)->node;
4056 value = item_array_at(&op_ctx->
items, 1)->obj->integer;
4067 "ignoring firmware Notify(%s, 0x%"UACPI_PRIX64") request, "
4076 uacpi_error(
"Notify() called on an invalid object %.4s",
4089 switch (op_ctx->
op->code) {
4090 case UACPI_AML_OP_BreakPointOp:
4094 case UACPI_AML_OP_FatalOp:
4096 req.
fatal.type = item_array_at(&op_ctx->
items, 0)->immediate;
4097 req.
fatal.code = item_array_at(&op_ctx->
items, 1)->immediate;
4098 req.
fatal.arg = item_array_at(&op_ctx->
items, 2)->obj->integer;
4117 node = item_array_at(&op_ctx->
items, 0)->node;
4118 src = item_array_at(&op_ctx->
items, 1)->obj;
4133 field->force_buffer)
4158 bit_length =
obj->buffer_field.bit_length;
4180 src = item_array_at(&op_ctx->
items, 0)->obj;
4181 dst = item_array_at(&op_ctx->
items, 1)->obj;
4189 sizeof(
dst->integer), 1
4218 "unable to perform a read from field %p: "
4219 "parent opregion gone", unwound_src
4224 switch (read_type) {
4226 new_op = UACPI_AML_OP_InternalOpReadFieldAsBuffer;
4229 new_op = UACPI_AML_OP_InternalOpReadFieldAsInteger;
4239 item_array_at(&op_ctx->
items, 0)->obj = unwound_src;
4247 item_array_pop(&op_ctx->
items);
4262 struct item *src_item;
4268 src_item = item_array_at(&op_ctx->
items, 0);
4277 node = item_array_at(&op_ctx->
items, 0)->node;
4280 src_obj = src_item->
obj;
4283 dst_obj = item_array_at(&op_ctx->
items, 1)->obj;
4285 if (op_ctx->
op->code == UACPI_AML_OP_InternalOpReadFieldAsBuffer) {
4292 if (dst_size != 0) {
4300 buf->size = dst_size;
4345 src_buf = item_array_at(&op_ctx->
items, 0)->obj->buffer;
4347 if (op_ctx->
op->code == UACPI_AML_OP_CreateFieldOp) {
4350 idx_obj = item_array_at(&op_ctx->
items, 1)->obj;
4351 len_obj = item_array_at(&op_ctx->
items, 2)->obj;
4352 node = item_array_at(&op_ctx->
items, 3)->node;
4353 field_obj = item_array_at(&op_ctx->
items, 4)->obj;
4375 idx_obj = item_array_at(&op_ctx->
items, 1)->obj;
4376 node = item_array_at(&op_ctx->
items, 2)->node;
4377 field_obj = item_array_at(&op_ctx->
items, 3)->obj;
4381 switch (op_ctx->
op->code) {
4382 case UACPI_AML_OP_CreateBitFieldOp:
4383 field->bit_length = 1;
4385 case UACPI_AML_OP_CreateByteFieldOp:
4386 field->bit_length = 8;
4388 case UACPI_AML_OP_CreateWordFieldOp:
4389 field->bit_length = 16;
4391 case UACPI_AML_OP_CreateDWordFieldOp:
4392 field->bit_length = 32;
4394 case UACPI_AML_OP_CreateQWordFieldOp:
4395 field->bit_length = 64;
4401 if (op_ctx->
op->code != UACPI_AML_OP_CreateBitFieldOp)
4402 field->bit_index *= 8;
4406 src_buf->
size * 8)) {
4408 "invalid buffer field: bits [%zu..%zu], buffer size is %zu bytes",
4415 field->backing = src_buf;
4432 "attempting to %s outside of a While block",
4433 op_ctx->
op->code == UACPI_AML_OP_BreakOp ?
"Break" :
"Continue"
4445 if (op_ctx->
op->code == UACPI_AML_OP_BreakOp)
4461 node = item_array_at(&op_ctx->
items, 1)->node;
4462 obj = item_array_last(&op_ctx->
items)->obj;
4464 switch (op_ctx->
op->code) {
4465 case UACPI_AML_OP_ProcessorOp: {
4467 proc->id = item_array_at(&op_ctx->
items, 2)->immediate;
4468 proc->block_address = item_array_at(&op_ctx->
items, 3)->immediate;
4469 proc->block_length = item_array_at(&op_ctx->
items, 4)->immediate;
4473 case UACPI_AML_OP_PowerResOp: {
4496 switch (op_ctx->
op->code) {
4497 case UACPI_AML_OP_ProcessorOp:
4498 case UACPI_AML_OP_PowerResOp:
4499 case UACPI_AML_OP_ThermalZoneOp:
4500 case UACPI_AML_OP_DeviceOp: {
4509 case UACPI_AML_OP_ScopeOp:
4510 case UACPI_AML_OP_IfOp:
4511 case UACPI_AML_OP_ElseOp:
4512 case UACPI_AML_OP_WhileOp: {
4527 ctx->cur_frame->code_offset =
ctx->cur_frame->method->size;
4542 item_array_at(&
ctx->cur_op_ctx->items, 0)->obj,
4559 ctx->prev_op_ctx = op_context_array_one_before_last(&frame->
pending_ops);
4565 return ctx->cur_op_ctx && !
ctx->cur_op_ctx->preempted;
4585 "%s OP '%s' (0x%04X)",
4609 for (
i = 2;
i < item_array_size(&op_ctx->
items) - 1;
i++) {
4612 src = item_array_at(&op_ctx->
items,
i)->obj;
4635 block->node = scope;
4645 struct call_frame_array *call_stack = &
ctx->call_stack;
4648 *out_frame = call_frame_array_calloc(call_stack);
4657 prev_frame = call_frame_array_one_before_last(call_stack);
4658 ctx->cur_frame = prev_frame;
4687 switch (
dst->type) {
4702 if (
dst->integer == 0) {
4708 uacpi_error(
"attempted to store to an invalid target: %s",
4721 src = item_array_at(&op_ctx->
items, 0)->obj;
4722 dst = item_array_at(&op_ctx->
items, 1)->obj;
4724 if (op_ctx->
op->code == UACPI_AML_OP_StoreOp) {
4751 item_array_at(&op_ctx->
items, 0)->obj = wtr_response_obj;
4770 src = item_array_at(&op_ctx->
items, 0)->obj;
4771 dst = item_array_at(&op_ctx->
items, 1)->obj;
4784 switch (true_src_type) {
4786 dst->integer =
src->integer;
4814 if (op_ctx->
op->code == UACPI_AML_OP_IncrementOp)
4822 uacpi_error(
"Increment/Decrement: invalid object type '%s'",
4837 if (!
method->is_serialized)
4842 "cannot invoke method @%p, sync level %d is too low "
4861 ret = held_mutexes_array_push(&
ctx->held_mutexes,
method->mutex);
4878 op_ctx = op_context_array_calloc(&frame->
pending_ops);
4882 op_ctx->
op =
ctx->cur_op;
4891 if (item_array_size(&op_ctx->
items) == 0)
4902 item_array_pop(&op_ctx->
items);
4913 item_array_clear(&cur_op_ctx->
items);
4924 while (temp_namespace_node_array_size(&frame->
temp_nodes) != 0) {
4929 temp_namespace_node_array_pop(&frame->
temp_nodes);
4931 temp_namespace_node_array_clear(&frame->
temp_nodes);
4933 for (
i = 0;
i < 7; ++
i)
4935 for (
i = 0;
i < 8; ++
i)
5006#define EXEC_OP_DO_LVL(lvl, reason, ...) \
5007 uacpi_##lvl("Op 0x%04X ('%s'): "reason, \
5008 op_ctx->op->code, op_ctx->op->name __VA_ARGS__)
5010#define EXEC_OP_DO_ERR(reason, ...) EXEC_OP_DO_LVL(error, reason, __VA_ARGS__)
5011#define EXEC_OP_DO_WARN(reason, ...) EXEC_OP_DO_LVL(warn, reason, __VA_ARGS__)
5013#define EXEC_OP_ERR_3(reason, arg0, arg1, arg2) \
5014 EXEC_OP_DO_ERR(reason, ,arg0, arg1, arg2)
5015#define EXEC_OP_ERR_2(reason, arg0, arg1) EXEC_OP_DO_ERR(reason, ,arg0, arg1)
5016#define EXEC_OP_ERR_1(reason, arg0) EXEC_OP_DO_ERR(reason, ,arg0)
5017#define EXEC_OP_ERR(reason) EXEC_OP_DO_ERR(reason)
5019#define EXEC_OP_WARN(reason) EXEC_OP_DO_WARN(reason)
5021#define SPEC_SIMPLE_NAME "SimpleName := NameString | ArgObj | LocalObj"
5022#define SPEC_SUPER_NAME \
5023 "SuperName := SimpleName | DebugObj | ReferenceTypeOpcode"
5024#define SPEC_TERM_ARG \
5025 "TermArg := ExpressionOpcode | DataObject | ArgObj | LocalObj"
5026#define SPEC_OPERAND "Operand := TermArg => Integer"
5027#define SPEC_STRING "String := TermArg => String"
5028#define SPEC_TARGET "Target := SuperName | NullName"
5030#define SPEC_COMPUTATIONAL_DATA \
5031 "ComputationalData := ByteConst | WordConst | DWordConst | QWordConst " \
5032 "| String | ConstObj | RevisionOp | DefBuffer"
5126 if (!(
props & ok_mask)) {
5128 cur_op_ctx->
op->name, expected_type_str);
5171 switch (
obj->type) {
5178 "invalid argument type: %s, expected a %s",
5196 static const uacpi_char *oom_prefix =
"<...>";
5198 static const uacpi_char *unknown_path =
"<unknown-path>";
5199 static const uacpi_char *invalid_path =
"<invalid-path>";
5223 requested_path_to_print = unknown_path;
5225 requested_path_to_print = invalid_path;
5227 requested_path_to_print = requested_path;
5230 if (requested_path && requested_path[0] !=
'\\') {
5235 prefix_path = oom_prefix;
5237 if (prefix_path[1] !=
'\0')
5240 prefix_path = empty_string;
5244 middle_part = empty_string;
5246 if (
length == 5 && !is_create) {
5249 "unable to %s named object '%s' within (or above) "
5250 "scope '%s': %s",
action, requested_path_to_print,
5256 "unable to %s named object '%s%s%s': %s",
5257 action, prefix_path, middle_part,
5263 if (prefix_path != oom_prefix && prefix_path != empty_string)
5488#define EXT_OP_IDX(op) (op & 0xFF)
5553 goto method_dispatch_error;
5558 arg_count =
args ?
args->count : 0;
5561 "invalid number of arguments %zu to call %.4s, expected %d",
5566 goto method_dispatch_error;
5580 goto method_dispatch_error;
5585 goto method_dispatch_error;
5587 ctx->cur_frame = frame;
5590 ctx->cur_block = code_block_array_last(&
ctx->cur_frame->code_blocks);
5592 if (
method->native_call) {
5597 goto method_dispatch_error;
5604method_dispatch_error:
5606 call_frame_array_pop(&
ctx->call_stack);
5643 if (
ctx->prev_op_ctx)
5650 op_ctx =
ctx->cur_op_ctx;
5651 frame =
ctx->cur_frame;
5653 if (op_ctx->
pc == 0 &&
ctx->prev_op_ctx) {
5669 item = item_array_alloc(&op_ctx->
items);
5708 if (
ctx->cur_op_ctx) {
5710 ctx->cur_op_ctx->pc++;
5728 next_op == UACPI_AML_OP_ZeroOp) {
5777 op_ctx->
pc += src_width;
5844 for (
i = 0;
i < num_types;
i++) {
5849 expected_mask |= 1u <<
type;
5860 "bad object type: expected one of %s/%s, got %s!",
5869 "bad object type: expected one of 0x%08X, got %s!",
5894 pkg = &item_array_at(&op_ctx->
items, pkg_idx)->pkg;
5897 op_ctx->
pc += bytes_skip;
5922 op_ctx->
pc += bytes_skip;
5934 op_ctx->
pc += bytes_skip;
5948 if (is_false == skip_if_false)
5949 op_ctx->
pc += bytes_skip;
5983 is_ok = op_ctx->
op->code == UACPI_AML_OP_ExternalOp;
5995 if (frame->
method->named_objects_persist &&
6000 first_ctx = op_context_array_at(&frame->
pending_ops, 0);
6001 abort_whileif = first_ctx->
op->code == UACPI_AML_OP_WhileOp ||
6002 first_ctx->
op->code == UACPI_AML_OP_IfOp;
6014 if (abort_whileif) {
6015 while (op_context_array_size(&frame->
pending_ops) != 1)
6018 op_ctx = op_context_array_at(&frame->
pending_ops, 0);
6030 !frame->
method->named_objects_persist)
6063 if (!
ctx->prev_op_ctx)
6095 EXEC_OP_ERR_1(
"don't know how to copy/transfer object to %u",
6102 dst = item_array_last(&
ctx->prev_op_ctx->items);
6129 src = item_array_at(&op_ctx->
items,
6154 item_array_pop(&op_ctx->
items);
6181 node = item_array_at(&op_ctx->
items, 0)->node;
6194 node = item_array_at(&op_ctx->
items, 0)->node;
6195 method = item_array_at(&op_ctx->
items, 1)->obj->method;
6204 uacpi_aml_op new_op = UACPI_AML_OP_InternalOpNamedObject;
6215 switch (
obj->type) {
6231 new_op = UACPI_AML_OP_InternalOpMethodCall0Args;
6232 new_op +=
obj->method->args;
6250 new_op = UACPI_AML_OP_InternalOpDerefNamedObject;
6269 "unable to perform a read from field %s: "
6270 "parent opregion gone", field_path
6277 new_op = UACPI_AML_OP_InternalOpReadFieldAsBuffer;
6280 new_op = UACPI_AML_OP_InternalOpReadFieldAsInteger;
6307 if (op_length == 0 || next_op != target_op) {
6328 op_ctx->
pc += skip_bytes;
6344 if (
method->is_serialized) {
6348 ctx->sync_level =
ctx->cur_frame->prev_sync_level;
6352 call_frame_array_pop(&
ctx->call_stack);
6354 ctx->cur_frame = call_frame_array_last(&
ctx->call_stack);
6363 static const uacpi_char *unknown_path =
"<unknown>";
6373 absolute_path = unknown_path;
6377 " #%zu in %s()+%u/%u at %s",
6378 depth, absolute_path, aml_offset, method_size,
op
6381 if (absolute_path != oom_absolute_path && absolute_path != unknown_path)
6394 depth = call_frame_array_size(&
ctx->call_stack);
6404 table_level_code =
ctx->cur_frame->method->named_objects_persist;
6406 if (table_level_code &&
idx != 0)
6415 while (op_context_array_size(&
ctx->cur_frame->pending_ops) != 0) {
6417 op = op_context_array_last(
6418 &
ctx->cur_frame->pending_ops
6444 op_name +=
sizeof(
"InternalOp") - 1;
6446 op_name =
"<unknown>";
6450 code_block_array_at(&
ctx->cur_frame->code_blocks, 0),
idx,
6451 ctx->cur_frame->code_offset,
ctx->cur_frame->method->size,
6455 should_stop =
idx++ == 0 && table_level_code;
6457 }
while (--
depth && !should_stop);
6466 while (held_mutexes_array_size(&
ctx->held_mutexes) != 0) {
6469 *held_mutexes_array_last(&
ctx->held_mutexes),
6474 call_frame_array_clear(&
ctx->call_stack);
6475 held_mutexes_array_clear(&
ctx->held_mutexes);
6518 goto handle_method_abort;
6525 goto handle_method_abort;
6529 handle_method_abort:
6530 uacpi_error(
"aborting %s due to previous error: %s",
6531 ctx->cur_frame->method->named_objects_persist ?
6532 "table load" :
"method invocation",
6541 if (
ctx->cur_frame) {
6544 it = item_array_last(&
ctx->cur_op_ctx->items);
6575 uacpi_error(
"_OSI: invalid argument type %s, expected a String",
6591 uacpi_trace(
"_OSI(%s) => reporting as %ssupported",
6592 arg->buffer->text, is_supported ?
"" :
"un");
static unsigned char bytes[4]
void user(int argc, const char *argv[])
uacpi_status uacpi_acquire_aml_mutex(uacpi_mutex *, uacpi_u16 timeout)
static void uacpi_signal_native_event(uacpi_handle evt)
static void uacpi_reset_native_event(uacpi_handle evt)
uacpi_status uacpi_release_aml_mutex(uacpi_mutex *)
uacpi_bool uacpi_this_thread_owns_aml_mutex(uacpi_mutex *)
static uacpi_bool uacpi_wait_for_native_event(uacpi_handle evt, uacpi_u16 timeout)
static void cleanup(void)
#define ACPI_SMALL_ITEM_NAME_IDX
struct uacpi_runtime_context g_uacpi_rt_ctx
static uacpi_bool uacpi_should_log(enum uacpi_log_level lvl)
#define UACPI_ARRAY_SIZE(arr)
uacpi_size uacpi_round_up_bits_to_bytes(uacpi_size bit_length)
void uacpi_write_buffer_field(uacpi_buffer_field *field, const void *src, uacpi_size size)
uacpi_status uacpi_field_unit_get_bit_length(struct uacpi_field_unit *field, uacpi_size *out_length)
uacpi_status uacpi_write_field_unit_in_chunks(uacpi_field_unit *field, const void *src, uacpi_size size, uacpi_data_view *wtr_response)
void uacpi_read_buffer_field(const uacpi_buffer_field *field, void *dst)
uacpi_status uacpi_field_unit_get_read_type(struct uacpi_field_unit *field, uacpi_object_type *out_type)
uacpi_status uacpi_read_field_unit(uacpi_field_unit *field, void *dst, uacpi_size size, uacpi_data_view *wtr_response)
uacpi_status uacpi_write_field_unit(uacpi_field_unit *field, const void *src, uacpi_size size, uacpi_data_view *wtr_response)
#define uacpi_log_lvl(lvl, fmt,...)
void uacpi_namespace_node_unref(uacpi_namespace_node *node)
uacpi_status uacpi_namespace_do_for_each_child(uacpi_namespace_node *parent, uacpi_iteration_callback descending_callback, uacpi_iteration_callback ascending_callback, uacpi_object_type_bits, uacpi_u32 max_depth, enum uacpi_should_lock, enum uacpi_permanent_only, void *user)
uacpi_status uacpi_namespace_write_unlock(void)
#define UACPI_NAMESPACE_NODE_FLAG_TEMPORARY
@ UACPI_PERMANENT_ONLY_NO
uacpi_namespace_node * uacpi_namespace_node_find_sub_node(uacpi_namespace_node *parent, uacpi_object_name name)
#define UACPI_NAMESPACE_NODE_FLAG_ALIAS
uacpi_object * uacpi_namespace_node_get_object(const uacpi_namespace_node *node)
uacpi_namespace_node * uacpi_namespace_node_alloc(uacpi_object_name name)
uacpi_status uacpi_namespace_node_install(uacpi_namespace_node *parent, uacpi_namespace_node *node)
uacpi_status uacpi_namespace_node_uninstall(uacpi_namespace_node *node)
uacpi_status uacpi_namespace_write_lock(void)
@ UACPI_MAY_SEARCH_ABOVE_PARENT_YES
uacpi_status uacpi_namespace_node_resolve(uacpi_namespace_node *scope, const uacpi_char *path, enum uacpi_should_lock, enum uacpi_may_search_above_parent, enum uacpi_permanent_only, uacpi_namespace_node **out_node)
#define UACPI_DUAL_NAME_PREFIX
#define UACPI_MULTI_NAME_PREFIX
const uacpi_char * uacpi_parse_op_to_string(enum uacpi_parse_op op)
@ 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)
@ UACPI_OP_PROPERTY_SIMPLE_NAME
@ UACPI_OP_PROPERTY_TERM_ARG
@ UACPI_OP_PROPERTY_INVALID
@ UACPI_OP_PROPERTY_INTERNAL
@ UACPI_OP_PROPERTY_SUPERNAME
@ UACPI_OP_PROPERTY_OUT_OF_LINE
@ UACPI_OP_PROPERTY_TARGET
uacpi_status uacpi_find_aml_resource_end_tag(uacpi_data_view, uacpi_size *out_offset)
uacpi_u8 uacpi_bit_scan_forward(uacpi_u64)
uacpi_i32 uacpi_snprintf(uacpi_char *buffer, uacpi_size capacity, const uacpi_char *fmt,...)
#define uacpi_memzero(ptr, size)
#define uacpi_kernel_alloc_zeroed
uacpi_size uacpi_strnlen(const uacpi_char *str, uacpi_size max)
#define UACPI_ALIGN_DOWN(x, val, type)
#define uacpi_free(mem, _)
uacpi_u8 uacpi_bit_scan_backward(uacpi_u64)
void uacpi_memcpy_zerout(void *dst, const void *src, uacpi_size dst_size, uacpi_size src_size)
struct uacpi_object * uacpi_create_internal_reference(enum uacpi_reference_kind kind, uacpi_object *child)
@ UACPI_PREALLOC_OBJECTS_YES
uacpi_object * uacpi_create_object(uacpi_object_type type)
void uacpi_object_detach_child(uacpi_object *parent)
uacpi_bool uacpi_package_fill(uacpi_package *pkg, uacpi_size num_elements, enum uacpi_prealloc_objects prealloc_objects)
void uacpi_buffer_to_view(uacpi_buffer *, uacpi_data_view *)
@ UACPI_REFERENCE_KIND_LOCAL
@ UACPI_REFERENCE_KIND_ARG
@ UACPI_REFERENCE_KIND_PKG_INDEX
@ UACPI_REFERENCE_KIND_NAMED
@ UACPI_FIELD_UNIT_KIND_NORMAL
@ UACPI_FIELD_UNIT_KIND_BANK
@ UACPI_FIELD_UNIT_KIND_INDEX
uacpi_mutex * uacpi_create_mutex(void)
void uacpi_object_attach_child(uacpi_object *parent, uacpi_object *child)
uacpi_status uacpi_object_assign(uacpi_object *dst, uacpi_object *src, enum uacpi_assign_behavior)
void uacpi_method_unref(uacpi_control_method *)
@ UACPI_ASSIGN_BEHAVIOR_DEEP_COPY
@ UACPI_ASSIGN_BEHAVIOR_SHALLOW_COPY
void uacpi_mutex_unref(uacpi_mutex *)
uacpi_object * uacpi_unwrap_internal_reference(uacpi_object *object)
void uacpi_free_absolute_path(const uacpi_char *path)
#define UACPI_MAX_DEPTH_ANY
const uacpi_char * uacpi_namespace_node_generate_absolute_path(const uacpi_namespace_node *node)
uacpi_namespace_node * uacpi_namespace_root(void)
#define uacpi_likely_success(expr)
#define uacpi_unlikely_error(expr)
@ UACPI_STATUS_INVALID_ARGUMENT
@ UACPI_STATUS_AML_OBJECT_ALREADY_EXISTS
@ UACPI_STATUS_AML_OUT_OF_BOUNDS_INDEX
@ UACPI_STATUS_UNIMPLEMENTED
@ UACPI_STATUS_AML_REFERENCE_CYCLE
@ UACPI_STATUS_OUT_OF_MEMORY
@ UACPI_STATUS_OVERRIDDEN
@ UACPI_STATUS_INVALID_TABLE_LENGTH
@ UACPI_STATUS_AML_INCOMPATIBLE_OBJECT_TYPE
@ UACPI_STATUS_AML_UNDEFINED_REFERENCE
@ UACPI_STATUS_AML_LOOP_TIMEOUT
@ UACPI_STATUS_AML_BAD_ENCODING
@ UACPI_STATUS_AML_INVALID_OPCODE
@ UACPI_STATUS_MAPPING_FAILED
@ UACPI_STATUS_AML_INVALID_NAMESTRING
@ UACPI_STATUS_AML_CALL_STACK_DEPTH_LIMIT
@ UACPI_STATUS_AML_SYNC_LEVEL_TOO_HIGH
@ UACPI_STATUS_NO_HANDLER
const uacpi_char * uacpi_status_to_string(uacpi_status)
void uacpi_object_ref(uacpi_object *obj)
uacpi_bool uacpi_object_is_one_of(uacpi_object *, uacpi_object_type_bits type_mask)
@ UACPI_ITERATION_DECISION_BREAK
@ UACPI_ITERATION_DECISION_CONTINUE
@ UACPI_OBJECT_REFERENCE_BIT
@ UACPI_OBJECT_METHOD_BIT
@ UACPI_OBJECT_BUFFER_INDEX_BIT
@ UACPI_OBJECT_FIELD_UNIT_BIT
@ UACPI_OBJECT_PROCESSOR_BIT
@ UACPI_OBJECT_POWER_RESOURCE_BIT
@ UACPI_OBJECT_BUFFER_FIELD_BIT
@ UACPI_OBJECT_OPERATION_REGION_BIT
@ UACPI_OBJECT_PACKAGE_BIT
@ UACPI_OBJECT_THERMAL_ZONE_BIT
@ UACPI_OBJECT_DEVICE_BIT
@ UACPI_ACCESS_ATTRIBUTE_RAW_BYTES
@ UACPI_ACCESS_ATTRIBUTE_RAW_PROCESS_BYTES
@ UACPI_ACCESS_ATTRIBUTE_BYTES
const uacpi_char * uacpi_object_type_to_string(uacpi_object_type)
@ UACPI_OBJECT_POWER_RESOURCE
@ UACPI_OBJECT_UNINITIALIZED
@ UACPI_OBJECT_BUFFER_FIELD
@ UACPI_OBJECT_OPERATION_REGION
@ UACPI_OBJECT_FIELD_UNIT
@ UACPI_OBJECT_BUFFER_INDEX
@ UACPI_FIRMWARE_REQUEST_TYPE_FATAL
@ UACPI_FIRMWARE_REQUEST_TYPE_BREAKPOINT
uacpi_bool uacpi_object_is(uacpi_object *, uacpi_object_type)
@ UACPI_ADDRESS_SPACE_SYSTEM_MEMORY
@ UACPI_ADDRESS_SPACE_TABLE_DATA
@ UACPI_ADDRESS_SPACE_PCC
void uacpi_object_unref(uacpi_object *obj)
void uacpi_events_match_post_dynamic_table_load(void)
static uacpi_status field_byte_size(uacpi_object *obj, uacpi_size *out_size)
static uacpi_status handle_arg(struct execution_context *ctx)
static uacpi_status handle_control_flow(struct execution_context *ctx)
static uacpi_status handle_create_field(struct execution_context *ctx)
static uacpi_status table_id_error(const uacpi_char *opcode, const uacpi_char *arg, uacpi_buffer *str)
static uacpi_status handle_concatenate(struct execution_context *ctx)
static uacpi_status handle_unload(struct execution_context *ctx)
#define AML_READ(ptr, offset)
static const uacpi_char *const op_trace_action_types[3]
static uacpi_status handle_deref_of(struct execution_context *ctx)
static uacpi_status handle_field_read(struct execution_context *ctx)
static uacpi_status frame_setup_base_scope(struct call_frame *frame, uacpi_namespace_node *scope, uacpi_control_method *method)
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 prepare_table_load(void *ptr, enum uacpi_table_load_cause cause, uacpi_control_method *in_method)
static uacpi_status do_load_table(uacpi_namespace_node *parent, struct acpi_sdt_hdr *tbl, enum uacpi_table_load_cause cause)
static uacpi_status method_get_ret_target(struct execution_context *ctx, uacpi_object **out_operand)
static uacpi_status object_copy_for_overwrite(uacpi_object *src, uacpi_object **out_obj)
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 uacpi_status handle_code_block(struct execution_context *ctx)
@ RESOLVE_FAIL_IF_DOESNT_EXIST
@ RESOLVE_CREATE_LAST_NAMESEG_FAIL_IF_EXISTS
static void trace_method_abort(struct code_block *block, uacpi_size depth, uacpi_u32 aml_offset, uacpi_u32 method_size, const uacpi_char *op)
static void truncate_number_if_needed(uacpi_object *obj)
static uacpi_status handle_event_ctl(struct execution_context *ctx)
@ OP_HANDLER_CREATE_METHOD
@ OP_HANDLER_STALL_OR_SLEEP
@ OP_HANDLER_CREATE_DATA_REGION
@ OP_HANDLER_BINARY_LOGIC
@ OP_HANDLER_CREATE_MUTEX_OR_EVENT
@ OP_HANDLER_CREATE_FIELD
@ OP_HANDLER_COPY_OBJECT_OR_STORE
@ OP_HANDLER_NAMED_OBJECT
@ OP_HANDLER_CONCATENATE_RES
@ OP_HANDLER_CONTROL_FLOW
@ OP_HANDLER_FIRMWARE_REQUEST
@ OP_HANDLER_CREATE_BUFFER_FIELD
@ OP_HANDLER_CREATE_NAMED
@ OP_HANDLER_CREATE_OP_REGION
static uacpi_status debug_store(uacpi_object *src)
static uacpi_status field_get_read_type(uacpi_object *obj, uacpi_object_type *out_type)
static uacpi_status handle_create_named(struct execution_context *ctx)
static uacpi_status object_assign_with_implicit_cast(uacpi_object *dst, uacpi_object *src, uacpi_data_view *wtr_response)
static uacpi_status ensure_valid_idx(uacpi_object *obj, uacpi_size idx, uacpi_size src_size)
static uacpi_status method_get_ret_object(struct execution_context *ctx, uacpi_object **out_obj)
static uacpi_status handle_to(struct execution_context *ctx)
static uacpi_u8 parse_op_generates_item[0x100]
static uacpi_status handle_return(struct execution_context *ctx)
static uacpi_bool maybe_end_block(struct execution_context *ctx)
static void init_method_flags(uacpi_control_method *method, uacpi_u8 flags_byte)
static uacpi_status handle_create_method(struct execution_context *ctx)
static uacpi_status handle_buffer(struct execution_context *ctx)
static uacpi_status handle_mid(struct execution_context *ctx)
static uacpi_u64 ones(void)
static uacpi_object_type buffer_field_get_read_type(struct uacpi_buffer_field *field)
static void trace_pop(uacpi_u8 pop)
static uacpi_status do_binary_math(uacpi_object *arg0, uacpi_object *arg1, uacpi_object *tgt0, uacpi_object *tgt1, uacpi_aml_op op)
static uacpi_status name_string_to_path(struct call_frame *frame, uacpi_size offset, uacpi_char **out_string, uacpi_size *out_size)
static uacpi_status handle_create_mutex_or_event(struct execution_context *ctx)
static uacpi_status handle_inc_dec(struct execution_context *ctx)
static uacpi_status handle_unary_math(struct execution_context *ctx)
static uacpi_status handle_object_type(struct execution_context *ctx)
static void report_table_id_find_error(const uacpi_char *opcode, struct uacpi_table_identifiers *id, uacpi_status ret)
static uacpi_status handle_bcd(struct execution_context *ctx)
static void pop_op(struct execution_context *ctx)
static uacpi_status queue_object(struct object_queue *queue, uacpi_object *obj)
static uacpi_bool object_is_package_index(uacpi_object *obj)
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_status held_mutexes_array_remove_and_release(struct held_mutexes_array *arr, uacpi_mutex *mutex, enum force_release force)
static uacpi_status handle_create_buffer_field(struct execution_context *ctx)
static uacpi_status build_table_id(const uacpi_char *opcode, struct uacpi_table_identifiers *out_id, uacpi_buffer *signature, uacpi_buffer *oem_id, uacpi_buffer *oem_table_id)
static uacpi_u8 handler_idx_of_ext_op[0x100]
static uacpi_status handle_match(struct execution_context *ctx)
static void emit_op_skip_warn(const struct op_context *op_ctx)
static uacpi_status handle_stall_or_sleep(struct execution_context *ctx)
static uacpi_status handle_notify(struct execution_context *ctx)
static uacpi_bool op_wants_supername(enum uacpi_parse_op op)
static uacpi_status do_make_empty_object(uacpi_buffer *buf, uacpi_bool is_string)
static uacpi_status handle_ref_of(struct execution_context *ctx)
static void write_buffer_index(uacpi_buffer_index *buf_idx, uacpi_data_view *src_buf)
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 uacpi_status handle_to_string(struct execution_context *ctx)
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_status handle_copy_object_or_store(struct execution_context *ctx)
static uacpi_status handle_string(struct execution_context *ctx)
static uacpi_status handle_arg_or_local(struct execution_context *ctx, uacpi_size idx, enum argx_or_localx type)
static uacpi_status handle_timer(struct execution_context *ctx)
static uacpi_u8 op_decode_byte(struct op_context *ctx)
static void stack_unwind(struct execution_context *ctx)
static uacpi_bool op_wants_term_arg_or_operand(enum uacpi_parse_op op)
static uacpi_status create_named_scope(struct op_context *op_ctx)
static uacpi_status check_no_reference_cycle(uacpi_object *dst, uacpi_object *new_obj)
static void debug_store_no_recurse(const uacpi_char *prefix, uacpi_object *src)
static uacpi_status exec_op(struct execution_context *ctx)
static uacpi_status begin_block_execution(struct execution_context *ctx)
static uacpi_u8 handler_idx_of_op[0x100]
static uacpi_object * reference_unwind(uacpi_object *obj)
uacpi_status uacpi_execute_table(void *tbl, enum uacpi_table_load_cause cause)
static uacpi_status object_replace_child(uacpi_object *parent, uacpi_object *new_child)
static bool op_is_invalid(const struct uacpi_op_spec *op)
static uacpi_status get_op(struct execution_context *ctx)
static uacpi_iteration_decision opregion_try_detach_from_parent(void *user, uacpi_namespace_node *node, uacpi_u32 node_depth)
static void execution_context_release(struct execution_context *ctx)
static uacpi_status make_null_string(uacpi_buffer *buf)
static uacpi_bool op_allows_unresolved(enum uacpi_parse_op op)
static uacpi_status copy_object_to_reference(uacpi_object *dst, uacpi_object *src)
static uacpi_status handle_create_alias(struct execution_context *ctx)
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)
#define EXEC_OP_ERR(reason)
static uacpi_status handle_load_table(struct execution_context *ctx)
static void frame_reset_post_end_block(struct execution_context *ctx, enum code_block_type type)
static uacpi_size sizeof_int(void)
static uacpi_status handle_local(struct execution_context *ctx)
static struct code_block * find_last_block(struct code_block_array *blocks, enum code_block_type type, uacpi_size *out_idx_plus_one)
static uacpi_status(* op_handlers[])(struct execution_context *ctx)
static uacpi_bool object_is_written_in_place(uacpi_object *obj)
static uacpi_size call_frame_code_bytes_left(struct call_frame *frame)
static uacpi_aml_op op_decode_aml_op(struct op_context *op_ctx)
static uacpi_status handle_create_op_region(struct execution_context *ctx)
static void call_frame_clear(struct call_frame *frame)
static uacpi_status do_install_node_item(struct call_frame *frame, struct item *item)
static uacpi_status handle_sizeof(struct execution_context *ctx)
static uacpi_status handle_load(struct execution_context *ctx)
static uacpi_bool trim_to_last_chunk(uacpi_object *src, uacpi_data_view *buf, uacpi_size chunk_size)
#define SPEC_COMPUTATIONAL_DATA
static uacpi_status resolve_name_string(struct call_frame *frame, enum resolve_behavior behavior, struct uacpi_namespace_node **out_node)
static uacpi_status handle_firmware_request(struct execution_context *ctx)
static void held_mutexes_array_remove_idx(struct held_mutexes_array *arr, uacpi_size i)
uacpi_status uacpi_execute_control_method(uacpi_namespace_node *scope, uacpi_control_method *method, const uacpi_object_array *args, uacpi_object **out_obj)
static uacpi_status handle_package(struct execution_context *ctx)
#define EXEC_OP_ERR_1(reason, arg0)
static void refresh_ctx_pointers(struct execution_context *ctx)
static uacpi_bool is_dynamic_table_load(enum uacpi_table_load_cause cause)
static uacpi_status store_to_field_unit(uacpi_field_unit *field, uacpi_object *src, uacpi_data_view *buf, uacpi_data_view *wtr_response)
#define EXEC_OP_ERR_2(reason, arg0, arg1)
static uacpi_u64 object_to_integer(const uacpi_object *obj, uacpi_size max_buffer_bytes)
static uacpi_status handle_logical_not(struct execution_context *ctx)
static uacpi_status make_null_buffer(uacpi_buffer *buf)
static uacpi_bool call_frame_has_code(struct call_frame *frame)
static uacpi_u8 * buffer_index_cursor(uacpi_buffer_index *buf_idx)
static uacpi_bool match_one(enum match_op op, uacpi_u64 lhs, uacpi_u64 rhs)
static uacpi_status get_object_storage(uacpi_object *obj, uacpi_data_view *out_buf, uacpi_bool include_null)
static uacpi_status enter_method(struct execution_context *ctx, struct call_frame *new_frame, uacpi_control_method *method)
static void ctx_reload_post_ret(struct execution_context *ctx)
static bool op_is_internal(const struct uacpi_op_spec *op)
static uacpi_status ensure_is_a_field_unit(uacpi_namespace_node *node, uacpi_field_unit **out_field)
static uacpi_status handle_mutex_ctl(struct execution_context *ctx)
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_u32 get_field_length(struct item *item)
static uacpi_status store_to_reference(uacpi_object *dst, uacpi_object *src, uacpi_data_view *wtr_response)
static uacpi_status push_new_frame(struct execution_context *ctx, struct call_frame **out_frame)
static uacpi_status handle_concatenate_res(struct execution_context *ctx)
static uacpi_bool handle_logical_equality(uacpi_object *lhs, uacpi_object *rhs)
static uacpi_status ensure_is_an_op_region(uacpi_namespace_node *node, uacpi_namespace_node **out_node)
static uacpi_status handle_binary_math(struct execution_context *ctx)
static uacpi_status buffer_to_string(uacpi_buffer *buf, uacpi_buffer *str, uacpi_bool is_hex)
static uacpi_status handle_binary_logic(struct execution_context *ctx)
static uacpi_status handle_named_object(struct execution_context *ctx)
static uacpi_status integer_to_string(uacpi_u64 integer, uacpi_buffer *str, uacpi_bool is_hex)
static uacpi_status frame_push_args(struct call_frame *frame, struct op_context *op_ctx)
static uacpi_status uninstalled_op_handler(struct execution_context *ctx)
static uacpi_status parse_nameseg(uacpi_u8 *cursor, uacpi_object_name *out_name)
static uacpi_status typecheck_obj(const struct op_context *op_ctx, const uacpi_object *obj, enum uacpi_object_type expected_type, const uacpi_char *spec_desc)
static uacpi_bool handle_logical_less_or_greater(uacpi_aml_op op, uacpi_object *lhs, uacpi_object *rhs)
static uacpi_status handle_create_data_region(struct execution_context *ctx)
static uacpi_status op_typecheck(const struct op_context *op_ctx, const struct op_context *cur_op_ctx)
#define EXEC_OP_WARN(reason)
static uacpi_bool object_is_namespace_only(uacpi_object *obj)
uacpi_status uacpi_osi(uacpi_handle handle, uacpi_object *retval)
static const uacpi_u8 * op_decode_cursor(const struct op_context *ctx)
static uacpi_status handle_index(struct execution_context *ctx)
#define DYNAMIC_ARRAY_WITH_INLINE_STORAGE_IMPL(name, type, prefix)
#define DYNAMIC_ARRAY_WITH_INLINE_STORAGE(name, type, inline_capacity)
GLint GLint GLsizei GLsizei GLsizei depth
GLuint GLuint GLsizei count
GLuint GLuint GLsizei GLenum type
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
GLint GLint GLsizei width
GLuint GLuint GLuint GLuint arg1
GLenum GLuint GLenum GLsizei const GLchar * buf
GLuint GLsizei GLsizei * length
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
uacpi_status uacpi_notify_all(uacpi_namespace_node *node, uacpi_u64 value)
void uacpi_opregion_uninstall_handler(uacpi_namespace_node *node)
uacpi_status uacpi_initialize_opregion_node(uacpi_namespace_node *node)
uacpi_status uacpi_handle_osi(const uacpi_char *string, uacpi_bool *out_value)
#define UACPI_PRI_TBL_HDR
uacpi_status uacpi_table_install_with_origin(void *virt, enum uacpi_table_origin origin, uacpi_table *out_table)
void uacpi_table_mark_as_loaded(uacpi_size idx)
#define UACPI_FMT_TBL_HDR(hdr)
#define UACPI_NANOSECONDS_PER_SEC
uacpi_status uacpi_string_to_integer(const uacpi_char *str, uacpi_size max_chars, enum uacpi_base base, uacpi_u64 *out_value)
uacpi_bool uacpi_is_valid_nameseg(uacpi_u8 *nameseg)
void uacpi_free_dynamic_string(const uacpi_char *str)
@ UACPI_TABLE_LOAD_CAUSE_HOST
@ UACPI_TABLE_LOAD_CAUSE_INIT
@ UACPI_TABLE_LOAD_CAUSE_LOAD_OP
@ UACPI_TABLE_LOAD_CAUSE_LOAD_TABLE_OP
static BOOL is_null(jsval_t v)
void * uacpi_kernel_alloc(uacpi_size size)
void uacpi_kernel_stall(uacpi_u8 usec)
void uacpi_kernel_sleep(uacpi_u64 msec)
uacpi_u64 uacpi_kernel_get_nanoseconds_since_boot(void)
uacpi_status uacpi_kernel_handle_firmware_request(uacpi_firmware_request *)
void uacpi_kernel_unmap(void *addr, uacpi_size len)
void * uacpi_kernel_map(uacpi_phys_addr addr, uacpi_size len)
static HANDLE PIO_APC_ROUTINE PVOID PIO_STATUS_BLOCK ULONG PVOID ULONG PVOID ULONG out_size
static BOOL is_string(parse_buffer *buf)
for(i=0;i< sizeof(testsuite)/sizeof(testsuite[0]);++i) ok(call_test(testsuite[i].func)
static calc_node_t * pop(void)
static uacpi_u32 uacpi_shareable_ref(uacpi_handle handle)
wchar_t const *const size_t const buffer_size
uacpi_u32 prev_while_code_offset
struct uacpi_namespace_node * cur_scope
struct temp_namespace_node_array temp_nodes
struct op_context_array pending_ops
uacpi_size last_while_idx_plus_one
struct uacpi_control_method * method
struct code_block_array code_blocks
uacpi_u64 prev_while_expiration
enum code_block_type type
struct uacpi_namespace_node * node
uacpi_u64 expiration_point
struct op_context * prev_op_ctx
struct code_block * cur_block
struct held_mutexes_array held_mutexes
struct call_frame * cur_frame
struct call_frame_array call_stack
struct op_context * cur_op_ctx
const struct uacpi_op_spec * cur_op
struct uacpi_field_unit * field1
struct uacpi_field_unit * field0
uacpi_namespace_node * region
struct uacpi_namespace_node * node
struct package_length pkg
uacpi_u8 immediate_bytes[8]
const struct uacpi_op_spec * op
uacpi_aml_op switched_from
uacpi_u8 named_objects_persist
struct uacpi_firmware_request::@810::@813 fatal
struct uacpi_firmware_request::@810::@812 breakpoint
struct uacpi_namespace_node * parent
uacpi_control_method * method
uacpi_field_unit * field_unit
uacpi_buffer_field buffer_field
uacpi_object * inner_object
uacpi_u8 * indirect_decode_ops
uacpi_object_name signature
uacpi_status uacpi_table_find(const uacpi_table_identifiers *id, uacpi_table *out_table)
uacpi_status uacpi_table_unref(uacpi_table *)
@ UACPI_TABLE_ORIGIN_FIRMWARE_VIRTUAL
Character const *const prefix
static const WCHAR props[]
wchar_t tm const _CrtWcstime_Writes_and_advances_ptr_ count wchar_t ** out
static unsigned int block