PatchworkOS
Loading...
Searching...
No Matches
expression.h
Go to the documentation of this file.
1#pragma once
2
6
7typedef struct aml_object aml_object_t;
8typedef struct aml_term_list_ctx aml_term_list_ctx_t;
9
24typedef struct aml_term_arg_list
25{
26 aml_object_t* args[AML_MAX_ARGS + 1]; // null-terminated
28
49
62
75
89
108
120
132
143
154
164
174
186
198
210
222
234
246
258
270
282
294
306
317
329
341
353
365
377
389
403
414
429
441
453
465
477
489
501
513
525
537
547
558
571
583
595
607
619
631
642
654
666
678
688
700
712
724
737
738/*
739 * @brief Reads a ReferenceTypeOpcode structure from the AML byte stream.
740 *
741 * A ReferenceTypeOpcode structure is defined as `ReferenceTypeOpcode := DefRefOf | DefDerefOf | DefIndex |
742 * UserTermObj`.
743 *
744 * I have no idea what the `UserTermObj` is supposed to be, so its currently unimplemented.
745 *
746 * @param ctx The TermList context.
747 * @return On success, the object pointer storing the result. On failure, `NULL` and `errno` is set.
748 */
750
762
774
784
798
815
826
839
864
#define AML_MAX_ARGS
Maximum number of arguments that can be passed to a method.
Definition arg.h:19
uint64_t aml_divisor_read(aml_term_list_ctx_t *ctx, aml_integer_t *out)
Reads a Divisor structure from the AML byte stream.
Definition expression.c:509
uint64_t aml_def_buffer_read(aml_term_list_ctx_t *ctx, aml_object_t *out)
Reads a DefBuffer structure from the AML byte stream.
Definition expression.c:296
aml_object_t * aml_def_acquire_read(aml_term_list_ctx_t *ctx)
Reads a DefAcquire structure from the AML byte stream.
uint64_t aml_term_arg_list_read(aml_term_list_ctx_t *ctx, uint64_t argCount, aml_term_arg_list_t *out)
Reads a TermArgList structure from the AML byte stream.
Definition expression.c:333
aml_object_t * aml_def_to_string_read(aml_term_list_ctx_t *ctx)
Reads a DefToString structure from the AML byte stream.
uint64_t aml_shift_count_read(aml_term_list_ctx_t *ctx, aml_integer_t *out)
Reads a ShiftCount structure from the AML byte stream.
Definition expression.c:931
aml_object_t * aml_def_add_read(aml_term_list_ctx_t *ctx)
Reads a DefAdd structure from the AML byte stream.
Definition expression.c:544
uint64_t aml_timeout_read(aml_term_list_ctx_t *ctx, uint16_t *out)
Reads a Timeout structure from the AML byte stream.
aml_object_t * aml_def_increment_read(aml_term_list_ctx_t *ctx)
Reads a DefIncrement structure from the AML byte stream.
aml_object_t * aml_def_concat_read(aml_term_list_ctx_t *ctx)
Reads a DefConcat structure from the AML byte stream.
aml_object_t * aml_def_land_read(aml_term_list_ctx_t *ctx)
Reads a DefLAnd structure from the AML byte stream.
aml_object_t * aml_def_to_hex_string_read(aml_term_list_ctx_t *ctx)
Reads a DefToHexString structure from the AML byte stream.
aml_object_t * aml_def_find_set_left_bit_read(aml_term_list_ctx_t *ctx)
Reads a DefFindSetLeftBit structure from the AML byte stream.
aml_object_t * aml_def_match_read(aml_term_list_ctx_t *ctx)
Reads a DefMatch structure from the AML byte stream.
aml_object_t * aml_def_cond_ref_of_read(aml_term_list_ctx_t *ctx)
Reads a DefCondRefOf structure from the AML byte stream.
Definition expression.c:406
aml_object_t * aml_def_to_integer_read(aml_term_list_ctx_t *ctx)
Reads a DefToInteger structure from the AML byte stream.
aml_object_t * aml_mutex_object_read(aml_term_list_ctx_t *ctx)
Reads a MutexObject structure from the AML byte stream.
aml_object_t * aml_def_lgreater_equal_read(aml_term_list_ctx_t *ctx)
Reads a DefLGreaterEqual structure from the AML byte stream.
aml_object_t * aml_def_object_type_read(aml_term_list_ctx_t *ctx)
Reads a DefObjectType structure from the AML byte stream.
aml_object_t * aml_def_to_decimal_string_read(aml_term_list_ctx_t *ctx)
Reads a DefToDecimalString structure from the AML byte stream.
uint64_t aml_index_value_read(aml_term_list_ctx_t *ctx, aml_integer_t *out)
Reads an IndexValue structure from the AML byte stream.
aml_object_t * aml_def_size_of_read(aml_term_list_ctx_t *ctx)
Reads a DefSizeOf structure from the AML byte stream.
aml_object_t * aml_def_decrement_read(aml_term_list_ctx_t *ctx)
Reads a DefDecrement structure from the AML byte stream.
aml_object_t * aml_remainder_read(aml_term_list_ctx_t *ctx)
Reads a Remainder structure from the AML byte stream.
Definition expression.c:520
aml_object_t * aml_def_lor_read(aml_term_list_ctx_t *ctx)
Reads a DefLOr structure from the AML byte stream.
aml_object_t * aml_def_copy_object_read(aml_term_list_ctx_t *ctx)
Reads a DefCopyObject structure from the AML byte stream.
aml_object_t * aml_def_nor_read(aml_term_list_ctx_t *ctx)
Reads a DefNOr structure from the AML byte stream.
Definition expression.c:844
aml_object_t * aml_data_read(aml_term_list_ctx_t *ctx)
Reads a Data structure from the AML byte stream.
aml_object_t * aml_def_xor_read(aml_term_list_ctx_t *ctx)
Reads a DefXOr structure from the AML byte stream.
Definition expression.c:874
aml_package_obj_t * aml_search_pkg_read(aml_term_list_ctx_t *ctx)
Reads a SearchPkg structure from the AML byte stream.
aml_object_t * aml_def_multiply_read(aml_term_list_ctx_t *ctx)
Reads a DefMultiply structure from the AML byte stream.
Definition expression.c:604
aml_object_t * aml_def_to_bcd_read(aml_term_list_ctx_t *ctx)
Reads a DefToBcd structure from the AML byte stream.
aml_object_t * aml_expression_opcode_read(aml_term_list_ctx_t *ctx)
Reads an ExpressionOpcode structure from the AML byte stream.
aml_object_t * aml_def_lnot_read(aml_term_list_ctx_t *ctx)
Reads a DefLNot structure from the AML byte stream.
uint64_t aml_length_arg_read(aml_term_list_ctx_t *ctx, aml_integer_t *out)
Reads a LengthArg structure from the AML byte stream.
aml_object_t * aml_operand_read(aml_term_list_ctx_t *ctx, aml_type_t allowedTypes)
Reads an Operand structure from the AML byte stream.
Definition expression.c:24
aml_object_t * aml_def_nand_read(aml_term_list_ctx_t *ctx)
Reads a DefNAnd structure from the AML byte stream.
Definition expression.c:784
uint64_t aml_start_index_read(aml_term_list_ctx_t *ctx, aml_integer_t *out)
Reads a StartIndex structure from the AML byte stream.
uint64_t aml_match_opcode_read(aml_term_list_ctx_t *ctx, aml_match_opcode_t *out)
Reads a MatchOpcode structure from the AML byte stream.
aml_object_t * aml_def_store_read(aml_term_list_ctx_t *ctx)
Reads a DefStore structure from the AML byte stream.
Definition expression.c:476
aml_object_t * aml_def_shift_right_read(aml_term_list_ctx_t *ctx)
Reads a DefShiftRight structure from the AML byte stream.
Definition expression.c:988
aml_object_t * aml_def_lequal_read(aml_term_list_ctx_t *ctx)
Reads a DefLEqual structure from the AML byte stream.
aml_object_t * aml_def_shift_left_read(aml_term_list_ctx_t *ctx)
Reads a DefShiftLeft structure from the AML byte stream.
Definition expression.c:942
uint64_t aml_buffer_size_read(aml_term_list_ctx_t *ctx, aml_integer_t *out)
Reads a BufferSize structure from the AML byte stream.
Definition expression.c:286
aml_object_t * aml_def_lless_equal_read(aml_term_list_ctx_t *ctx)
Reads a DefLLessEqual structure from the AML byte stream.
aml_object_t * aml_def_lless_read(aml_term_list_ctx_t *ctx)
Reads a DefLLess structure from the AML byte stream.
aml_object_t * aml_def_subtract_read(aml_term_list_ctx_t *ctx)
Reads a DefSubtract structure from the AML byte stream.
Definition expression.c:574
aml_object_t * aml_def_timer_read(aml_term_list_ctx_t *ctx)
Reads a DefTimer structure from the AML byte stream.
aml_object_t * aml_reference_type_opcode_read(aml_term_list_ctx_t *ctx)
aml_object_t * aml_def_mod_read(aml_term_list_ctx_t *ctx)
Reads a DefMod structure from the AML byte stream.
Definition expression.c:703
aml_object_t * aml_obj_reference_read(aml_term_list_ctx_t *ctx)
Reads an ObjReference structure from the AML byte stream.
aml_object_t * aml_def_and_read(aml_term_list_ctx_t *ctx)
Reads a DefAnd structure from the AML byte stream.
Definition expression.c:754
aml_object_t * aml_quotient_read(aml_term_list_ctx_t *ctx)
Reads a Quotient structure from the AML byte stream.
Definition expression.c:532
uint64_t aml_dividend_read(aml_term_list_ctx_t *ctx, aml_integer_t *out)
Reads a Dividend structure from the AML byte stream.
Definition expression.c:498
aml_object_t * aml_def_to_buffer_read(aml_term_list_ctx_t *ctx)
Reads a DefToBuffer structure from the AML byte stream.
aml_object_t * aml_def_not_read(aml_term_list_ctx_t *ctx)
Reads a DefNot structure from the AML byte stream.
Definition expression.c:904
aml_object_t * aml_def_lgreater_read(aml_term_list_ctx_t *ctx)
Reads a DefLGreater structure from the AML byte stream.
aml_object_t * aml_method_invocation_read(aml_term_list_ctx_t *ctx)
Reads a MethodInvocation structure from the AML byte stream.
Definition expression.c:360
aml_match_opcode_t
Match opcodes for DefMatch.
Definition expression.h:790
aml_object_t * aml_def_lnot_equal_read(aml_term_list_ctx_t *ctx)
Reads a DefLNotEqual structure from the AML byte stream.
aml_object_t * aml_buff_pkg_str_obj_read(aml_term_list_ctx_t *ctx)
Reads a BuffPkgStrObj structure from the AML byte stream.
aml_object_t * aml_def_index_read(aml_term_list_ctx_t *ctx)
Reads a DefIndex structure from the AML byte stream.
aml_object_t * aml_def_divide_read(aml_term_list_ctx_t *ctx)
Reads a DefDivide structure from the AML byte stream.
Definition expression.c:634
aml_object_t * aml_def_deref_of_read(aml_term_list_ctx_t *ctx)
Reads a DefDerefOf structure from the AML byte stream.
aml_object_t * aml_def_or_read(aml_term_list_ctx_t *ctx)
Reads a DefOr structure from the AML byte stream.
Definition expression.c:814
aml_object_t * aml_def_find_set_right_bit_read(aml_term_list_ctx_t *ctx)
Reads a DefFindSetRightBit structure from the AML byte stream.
aml_object_t * aml_def_ref_of_read(aml_term_list_ctx_t *ctx)
Reads a DefRefOf structure from the AML byte stream.
@ AML_MATCH_MGT
Definition expression.h:796
@ AML_MATCH_MLT
Definition expression.h:794
@ AML_MATCH_MTR
Definition expression.h:791
@ AML_MATCH_MGE
Definition expression.h:795
@ AML_MATCH_MLE
Definition expression.h:793
@ AML_MATCH_MEQ
Definition expression.h:792
uint64_t aml_integer_t
AML Integer type.
Definition integer.h:20
aml_type_t
ACPI data types.
Definition object.h:57
__UINT64_TYPE__ uint64_t
Definition stdint.h:17
__UINT16_TYPE__ uint16_t
Definition stdint.h:13
ACPI object.
Definition object.h:425
Data for a package object.
Definition object.h:337
TermArgList structure.
Definition expression.h:25
Context for reading a TermList.
Definition term.h:37