diff options
author | Bob Moore <robert.moore@intel.com> | 2014-02-07 20:42:01 -0500 |
---|---|---|
committer | Rafael J. Wysocki <rafael.j.wysocki@intel.com> | 2014-02-10 18:30:23 -0500 |
commit | c03775c0827f4d10fcb360c9b8af9a922aedaf4b (patch) | |
tree | 3498aa7535f2a94c5e12bc87150dd66c1d7d6bd4 /drivers/acpi/acpica/acmacros.h | |
parent | b28a960c42fcd9cfc987441fa6d1c1a471f0f9ed (diff) |
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.h | 14 |
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 @@ | |||
63 | #define ACPI_SET64(ptr, val) (*ACPI_CAST64 (ptr) = (u64) (val)) | 63 | #define ACPI_SET64(ptr, val) (*ACPI_CAST64 (ptr) = (u64) (val)) |
64 | 64 | ||
65 | /* | 65 | /* |
66 | * printf() format helpers | 66 | * printf() format helpers. These macros are workarounds for the difficulties |
67 | * with emitting 64-bit integers and 64-bit pointers with the same code | ||
68 | * for both 32-bit and 64-bit hosts. | ||
67 | */ | 69 | */ |
68 | |||
69 | /* Split 64-bit integer into two 32-bit values. Use with %8.8X%8.8X */ | ||
70 | |||
71 | #define ACPI_FORMAT_UINT64(i) ACPI_HIDWORD(i), ACPI_LODWORD(i) | 70 | #define ACPI_FORMAT_UINT64(i) ACPI_HIDWORD(i), ACPI_LODWORD(i) |
72 | 71 | ||
73 | #if ACPI_MACHINE_WIDTH == 64 | 72 | #if ACPI_MACHINE_WIDTH == 64 |
74 | #define ACPI_FORMAT_NATIVE_UINT(i) ACPI_FORMAT_UINT64(i) | 73 | #define ACPI_FORMAT_NATIVE_UINT(i) ACPI_FORMAT_UINT64(i) |
74 | #define ACPI_FORMAT_TO_UINT(i) ACPI_FORMAT_UINT64(i) | ||
75 | #define ACPI_PRINTF_UINT "0x%8.8X%8.8X" | ||
76 | |||
75 | #else | 77 | #else |
76 | #define ACPI_FORMAT_NATIVE_UINT(i) 0, (i) | 78 | #define ACPI_FORMAT_NATIVE_UINT(i) 0, (u32) (i) |
79 | #define ACPI_FORMAT_TO_UINT(i) (u32) (i) | ||
80 | #define ACPI_PRINTF_UINT "0x%8.8X" | ||
77 | #endif | 81 | #endif |
78 | 82 | ||
79 | /* | 83 | /* |