Skip to content

Commit

Permalink
lib: remove MB and GB definition in utilities.h
Browse files Browse the repository at this point in the history
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 <arnaud.pouliquen@foss.st.com>
  • Loading branch information
arnopo committed Aug 16, 2023
1 parent 7ec5b63 commit 3098875
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
8 changes: 8 additions & 0 deletions lib/system/generic/xlnx_common/zynqmp_aarch64/sys.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
3 changes: 0 additions & 3 deletions lib/utilities.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit 3098875

Please sign in to comment.