PatchworkOS  966e257
A non-POSIX operating system.
Loading...
Searching...
No Matches
compare.h
Go to the documentation of this file.
1#pragma once
2
4
5/**
6 * @brief Object Comparison
7 * @defgroup modules_acpi_aml_compare Compare
8 * @ingroup modules_acpi_aml
9 *
10 * @{
11 */
12
13/**
14 * @brief Types of comparisons that can be performed between two ACPI objects.
15 * @enum aml_object_compare_type_t
16 */
17typedef enum
18{
19 AML_COMPARE_AND = 0, ///< Section 19.6.69, integer only
20 AML_COMPARE_EQUAL = 1, ///< Section 19.6.70
21 AML_COMPARE_GREATER = 2, ///< Section 19.6.71
22 AML_COMPARE_LESS = 3, ///< Section 19.6.73
23 AML_COMPARE_OR = 4, ///< Section 19.6.80, integer only
24
25 AML_COMPARE_INVERT_BASE = 0xFF, ///< All operations above this value are inverted versions of the base operations.
30
31/**
32 * @brief Perform a logical NOT operation on an integer value.
33 *
34 * @param value The integer value to negate.
35 * @return `AML_TRUE` if the input value is `AML_FALSE`, otherwise `AML_FALSE`.
36 */
38
39/**
40 * @brief Compare two ACPI objects.
41 *
42 * Only objects of type `AML_OBJECT_INTEGER`, `AML_OBJECT_STRING` and `AML_OBJECT_BUFFER` can be compared, and certain
43 * operations only support `AML_OBJECT_INTEGER`. Both `a` and `b` must be of the same type, otherwise return false.
44 *
45 * @param a Pointer to the first object.
46 * @param b Pointer to the second object.
47 * @param operation The comparison operation to perform.
48 * @return `AML_TRUE` if the comparison is true, `AML_FALSE` if the comparison is false.
49 */
51
52/** @} */
aml_uint_t aml_compare_not(aml_uint_t value)
Perform a logical NOT operation on an integer value.
Definition compare.c:25
aml_uint_t aml_compare(aml_object_t *a, aml_object_t *b, aml_compare_operation_t operation)
Compare two ACPI objects.
Definition compare.c:30
aml_compare_operation_t
Definition compare.h:18
@ AML_COMPARE_NOT_EQUAL
Definition compare.h:26
@ AML_COMPARE_GREATER_EQUAL
Definition compare.h:28
@ AML_COMPARE_OR
Section 19.6.80, integer only.
Definition compare.h:23
@ AML_COMPARE_LESS
Section 19.6.73.
Definition compare.h:22
@ AML_COMPARE_GREATER
Section 19.6.71.
Definition compare.h:21
@ AML_COMPARE_EQUAL
Section 19.6.70.
Definition compare.h:20
@ AML_COMPARE_LESS_EQUAL
Definition compare.h:27
@ AML_COMPARE_AND
Section 19.6.69, integer only.
Definition compare.h:19
@ AML_COMPARE_INVERT_BASE
All operations above this value are inverted versions of the base operations.
Definition compare.h:25
uint64_t aml_uint_t
AML Integer type.
Definition integer.h:20
ACPI object.
Definition object.h:447