From 30988751560a6e25772f43209280f479ae711f18 Mon Sep 17 00:00:00 2001 From: Arnaud Pouliquen Date: Wed, 5 Jul 2023 15:13:20 +0200 Subject: [PATCH] lib: remove MB and GB definition in utilities.h The introduction of MB and GB macros introduces warnings in Zephyr build. Indeed they are already defined in zephyr/include/zephyr/sys/util.h. Remove them and put them back in lib/system/generic/xlnx_common/zynqmp_aarch64/sys.c. Signed-off-by: Arnaud Pouliquen --- lib/system/generic/xlnx_common/zynqmp_aarch64/sys.c | 8 ++++++++ lib/utilities.h | 3 --- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/lib/system/generic/xlnx_common/zynqmp_aarch64/sys.c b/lib/system/generic/xlnx_common/zynqmp_aarch64/sys.c index 1de54b18..e8cb7405 100644 --- a/lib/system/generic/xlnx_common/zynqmp_aarch64/sys.c +++ b/lib/system/generic/xlnx_common/zynqmp_aarch64/sys.c @@ -27,6 +27,14 @@ #include "xreg_cortexa53.h" #endif /* defined(versal) */ +#ifndef MB +#define MB (1024 * 1024UL) +#endif /* MB */ + +#ifndef GB +#define GB (MB * 1024UL) +#endif /* GB */ + void sys_irq_restore_enable(unsigned int flags) { Xil_ExceptionEnableMask(~flags); diff --git a/lib/utilities.h b/lib/utilities.h index 5ec6aeed..5a123c92 100644 --- a/lib/utilities.h +++ b/lib/utilities.h @@ -25,9 +25,6 @@ extern "C" { * @{ */ -#define MB (1024 * 1024UL) -#define GB (1024 * 1024 * 1024UL) - /** Marker for unused function arguments/variables. */ #define metal_unused(x) do { (x) = (x); } while (0)