aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBob Moore <robert.moore@intel.com>2012-12-19 00:38:18 -0500
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2013-01-10 06:36:19 -0500
commit2f3faaba5922d3763f3e9398a2b00dc7239e2d27 (patch)
tree5b39a3fe111590f0820504a5a2f9192d7f7aa40d
parent1f06c92110b4512beffc98656286fdc60ed00a85 (diff)
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: Bob Moore <robert.moore@intel.com> Signed-off-by: Lv Zheng <lv.zheng@intel.com> Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
-rw-r--r--drivers/acpi/acpica/acmacros.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/acpi/acpica/acmacros.h b/drivers/acpi/acpica/acmacros.h
index 5efad99f2169..1fa91f1d8994 100644
--- a/drivers/acpi/acpica/acmacros.h
+++ b/drivers/acpi/acpica/acmacros.h
@@ -293,6 +293,20 @@
293#define ACPI_16BIT_MASK 0x0000FFFF 293#define ACPI_16BIT_MASK 0x0000FFFF
294#define ACPI_24BIT_MASK 0x00FFFFFF 294#define ACPI_24BIT_MASK 0x00FFFFFF
295 295
296/* Macros to extract flag bits from position zero */
297
298#define ACPI_GET_1BIT_FLAG(value) ((value) & ACPI_1BIT_MASK)
299#define ACPI_GET_2BIT_FLAG(value) ((value) & ACPI_2BIT_MASK)
300#define ACPI_GET_3BIT_FLAG(value) ((value) & ACPI_3BIT_MASK)
301#define ACPI_GET_4BIT_FLAG(value) ((value) & ACPI_4BIT_MASK)
302
303/* Macros to extract flag bits from position one and above */
304
305#define ACPI_EXTRACT_1BIT_FLAG(field, position) (ACPI_GET_1BIT_FLAG ((field) >> position))
306#define ACPI_EXTRACT_2BIT_FLAG(field, position) (ACPI_GET_2BIT_FLAG ((field) >> position))
307#define ACPI_EXTRACT_3BIT_FLAG(field, position) (ACPI_GET_3BIT_FLAG ((field) >> position))
308#define ACPI_EXTRACT_4BIT_FLAG(field, position) (ACPI_GET_4BIT_FLAG ((field) >> position))
309
296/* 310/*
297 * An object of type struct acpi_namespace_node can appear in some contexts 311 * An object of type struct acpi_namespace_node can appear in some contexts
298 * where a pointer to an object of type union acpi_operand_object can also 312 * where a pointer to an object of type union acpi_operand_object can also