summaryrefslogtreecommitdiff
path: root/drivers/acpi/acpica/acmacros.h
diff options
context:
space:
mode:
authorBob Moore <robert.moore@intel.com>2014-02-08 05:42:01 +0400
committerRafael J. Wysocki <rafael.j.wysocki@intel.com>2014-02-11 03:30:23 +0400
commitc03775c0827f4d10fcb360c9b8af9a922aedaf4b (patch)
tree3498aa7535f2a94c5e12bc87150dd66c1d7d6bd4 /drivers/acpi/acpica/acmacros.h
parentb28a960c42fcd9cfc987441fa6d1c1a471f0f9ed (diff)
downloadlinux-c03775c0827f4d10fcb360c9b8af9a922aedaf4b.tar.xz
ACPICA: Improve support for 32/64 bit physical addresses in printf().
This change improves the support for physical addresses in printf debug statements and other output on both 32-bit and 64-bit hosts. It consistently outputs the appropriate number of bytes for each host. The %p specifier is unsatisfactory since it does not emit uniform output on all hosts/clib implementations (on some, leading zeros are not supported, leading to difficult-to-read output). 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>
Diffstat (limited to 'drivers/acpi/acpica/acmacros.h')
-rw-r--r--drivers/acpi/acpica/acmacros.h14
1 files changed, 9 insertions, 5 deletions
diff --git a/drivers/acpi/acpica/acmacros.h b/drivers/acpi/acpica/acmacros.h
index 2a86c65d873b..25467828e864 100644
--- a/drivers/acpi/acpica/acmacros.h
+++ b/drivers/acpi/acpica/acmacros.h
@@ -63,17 +63,21 @@
#define ACPI_SET64(ptr, val) (*ACPI_CAST64 (ptr) = (u64) (val))
/*
- * printf() format helpers
+ * printf() format helpers. These macros are workarounds for the difficulties
+ * with emitting 64-bit integers and 64-bit pointers with the same code
+ * for both 32-bit and 64-bit hosts.
*/
-
-/* Split 64-bit integer into two 32-bit values. Use with %8.8X%8.8X */
-
#define ACPI_FORMAT_UINT64(i) ACPI_HIDWORD(i), ACPI_LODWORD(i)
#if ACPI_MACHINE_WIDTH == 64
#define ACPI_FORMAT_NATIVE_UINT(i) ACPI_FORMAT_UINT64(i)
+#define ACPI_FORMAT_TO_UINT(i) ACPI_FORMAT_UINT64(i)
+#define ACPI_PRINTF_UINT "0x%8.8X%8.8X"
+
#else
-#define ACPI_FORMAT_NATIVE_UINT(i) 0, (i)
+#define ACPI_FORMAT_NATIVE_UINT(i) 0, (u32) (i)
+#define ACPI_FORMAT_TO_UINT(i) (u32) (i)
+#define ACPI_PRINTF_UINT "0x%8.8X"
#endif
/*