PatchworkOS
Loading...
Searching...
No Matches
Compare

Object Comparison. More...

Enumerations

enum  aml_compare_operation_t {
  AML_COMPARE_AND = 0 ,
  AML_COMPARE_EQUAL = 1 ,
  AML_COMPARE_GREATER = 2 ,
  AML_COMPARE_LESS = 3 ,
  AML_COMPARE_OR = 4 ,
  AML_COMPARE_INVERT_BASE = 0xFF ,
  AML_COMPARE_NOT_EQUAL = AML_COMPARE_INVERT_BASE + AML_COMPARE_EQUAL ,
  AML_COMPARE_LESS_EQUAL = AML_COMPARE_INVERT_BASE + AML_COMPARE_GREATER ,
  AML_COMPARE_GREATER_EQUAL = AML_COMPARE_INVERT_BASE + AML_COMPARE_LESS
}
 

Functions

aml_integer_t aml_compare_not (aml_integer_t value)
 Perform a logical NOT operation on an integer value.
 
aml_integer_t aml_compare (aml_object_t *a, aml_object_t *b, aml_compare_operation_t operation)
 Compare two ACPI objects.
 

Detailed Description

Object Comparison.

Enumeration Type Documentation

◆ aml_compare_operation_t

Enumerator
AML_COMPARE_AND 

Section 19.6.69, integer only.

AML_COMPARE_EQUAL 

Section 19.6.70.

AML_COMPARE_GREATER 

Section 19.6.71.

AML_COMPARE_LESS 

Section 19.6.73.

AML_COMPARE_OR 

Section 19.6.80, integer only.

AML_COMPARE_INVERT_BASE 

All operations above this value are inverted versions of the base operations.

AML_COMPARE_NOT_EQUAL 
AML_COMPARE_LESS_EQUAL 
AML_COMPARE_GREATER_EQUAL 

Definition at line 17 of file compare.h.

Function Documentation

◆ aml_compare()

aml_integer_t aml_compare ( aml_object_t a,
aml_object_t b,
aml_compare_operation_t  operation 
)

Compare two ACPI objects.

Only objects of type AML_OBJECT_INTEGER, AML_OBJECT_STRING and AML_OBJECT_BUFFER can be compared, and certain operations only support AML_OBJECT_INTEGER. Both a and b must be of the same type, otherwise return false.

Parameters
aPointer to the first object.
bPointer to the second object.
operationThe comparison operation to perform.
Returns
AML_TRUE if the comparison is true, AML_FALSE if the comparison is false.

Definition at line 30 of file compare.c.

References AML_BUFFER, aml_compare(), AML_COMPARE_EQUAL, AML_COMPARE_GREATER, aml_compare_integers(), AML_COMPARE_INVERT_BASE, AML_COMPARE_LESS, aml_compare_not(), AML_FALSE, AML_INTEGER, AML_STRING, AML_TRUE, aml_object_t::buffer, aml_buffer_obj_t::content, aml_string_obj_t::content, aml_object_t::integer, aml_buffer_obj_t::length, aml_string_obj_t::length, memcmp(), NULL, aml_object_t::string, and aml_integer_obj_t::value.

Referenced by aml_compare(), aml_def_land_read(), aml_def_lequal_read(), aml_def_lgreater_equal_read(), aml_def_lgreater_read(), aml_def_lless_equal_read(), aml_def_lless_read(), aml_def_lnot_equal_read(), aml_def_lor_read(), and aml_match_compare().

◆ aml_compare_not()

aml_integer_t aml_compare_not ( aml_integer_t  value)

Perform a logical NOT operation on an integer value.

Parameters
valueThe integer value to negate.
Returns
AML_TRUE if the input value is AML_FALSE, otherwise AML_FALSE.

Definition at line 25 of file compare.c.

References AML_FALSE, and AML_TRUE.

Referenced by aml_compare(), and aml_def_lnot_read().