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

1 comment on commit 3098875

@tnmysh
Copy link
Collaborator

@tnmysh tnmysh commented on 3098875 Aug 16, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@arnopo can we have this macros with guards in lib/utilities.h ?
On Xilinx Platforms they will be used across multiple OS demos such as baremetal, FreeRTOS etc.
If we define with guards, then it shouldn't produce any warnings right?

Please sign in to comment.