[PATCH v14 05/11] log: select physical address formatting in a generic way

Abdellatif El Khlifi
2023-07-07T14:45:16Z

sets the log formatting according to the platform (64-bit vs 32-bit)

Signed-off-by: Abdellatif El Khlifi <abdellatif.elkhlifi@arm.com>
Cc: Simon Glass <sjg@chromium.org>
---
include/log.h | 8 ++++++++
1 file changed, 8 insertions(+)

diff --git a/include/log.h b/include/log.h
index 3bab40b617..689cef905b 100644
--- a/include/log.h
+++ b/include/log.h
@@ -686,4 +686,12 @@ static inline int log_get_default_format(void)
(IS_ENABLED(CONFIG_LOGF_FUNC) ? BIT(LOGF_FUNC) : 0);
}

+/* Select the right physical address formatting according to the platform */
+#ifdef CONFIG_PHYS_64BIT
+#define PhysAddrLength "ll"
+#else
+#define PhysAddrLength ""
+#endif
+#define PHYS_ADDR_LN "%" PhysAddrLength "x"
+#define PHYS_ADDR_LNU "%" PhysAddrLength "u"
#endif
--
2.25.1