Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 2f3faaba authored by Bob Moore's avatar Bob Moore Committed by Rafael J. Wysocki
Browse files

ACPICA: Add macros to extract flag bits from resource descriptors.



Improves readability and maintainability of the code.  Fixes a
problem with the UART serial bus descriptor for the number of
data bits flags (was incorrectly 2 bits, should be 3).

Signed-off-by: default avatarBob Moore <robert.moore@intel.com>
Signed-off-by: default avatarLv Zheng <lv.zheng@intel.com>
Signed-off-by: default avatarRafael J. Wysocki <rafael.j.wysocki@intel.com>
parent 1f06c921
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -293,6 +293,20 @@
#define ACPI_16BIT_MASK     0x0000FFFF
#define ACPI_24BIT_MASK     0x00FFFFFF

/* Macros to extract flag bits from position zero */

#define ACPI_GET_1BIT_FLAG(value)                   ((value) & ACPI_1BIT_MASK)
#define ACPI_GET_2BIT_FLAG(value)                   ((value) & ACPI_2BIT_MASK)
#define ACPI_GET_3BIT_FLAG(value)                   ((value) & ACPI_3BIT_MASK)
#define ACPI_GET_4BIT_FLAG(value)                   ((value) & ACPI_4BIT_MASK)

/* Macros to extract flag bits from position one and above */

#define ACPI_EXTRACT_1BIT_FLAG(field, position)     (ACPI_GET_1BIT_FLAG ((field) >> position))
#define ACPI_EXTRACT_2BIT_FLAG(field, position)     (ACPI_GET_2BIT_FLAG ((field) >> position))
#define ACPI_EXTRACT_3BIT_FLAG(field, position)     (ACPI_GET_3BIT_FLAG ((field) >> position))
#define ACPI_EXTRACT_4BIT_FLAG(field, position)     (ACPI_GET_4BIT_FLAG ((field) >> position))

/*
 * An object of type struct acpi_namespace_node can appear in some contexts
 * where a pointer to an object of type union acpi_operand_object can also