summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakeo Takahashi <takeo.takahashi.xv@renesas.com>2023-05-01 22:54:32 +0900
committerDamien George <damien.p.george@gmail.com>2023-05-11 16:18:39 +1000
commit3229791b60185faa47d87af80b6a8ccbb34d15e5 (patch)
treefcee6bb223fbcfe77b81b7fe489c19d38316ba09
parentb4834e5cba70a620265b81e74521665d863cf597 (diff)
renesas-ra: Add a macro definition to avoid compile error of FSP v4.4.0.
FSP v4.4.0 refers to CMSIS V5.4.1, and __COMPILER_BARRIER() is used in bsp. On the other hand, lib/cmsis is V5.1.0 and the macro is not defined. Therefore, compile error happens. As the workaround, the macro definition is added. If lib/cmsis is updated in the future, this addition can be removed. Signed-off-by: Takeo Takahashi <takeo.takahashi.xv@renesas.com>
-rw-r--r--ports/renesas-ra/Makefile1
-rw-r--r--ports/renesas-ra/boards/compiler_barrier.h4
2 files changed, 5 insertions, 0 deletions
diff --git a/ports/renesas-ra/Makefile b/ports/renesas-ra/Makefile
index bcfae8555..85ffd9a1e 100644
--- a/ports/renesas-ra/Makefile
+++ b/ports/renesas-ra/Makefile
@@ -89,6 +89,7 @@ SYSTEM_FILE ?= lib/fsp/ra/fsp/src/bsp/cmsis/Device/RENESAS/Source/system.o
# Select the cross compile prefix
CROSS_COMPILE ?= arm-none-eabi-
+INC += -imacros boards/compiler_barrier.h
INC += -I.
INC += -I$(TOP)
INC += -I$(BUILD)
diff --git a/ports/renesas-ra/boards/compiler_barrier.h b/ports/renesas-ra/boards/compiler_barrier.h
new file mode 100644
index 000000000..c1145b1b9
--- /dev/null
+++ b/ports/renesas-ra/boards/compiler_barrier.h
@@ -0,0 +1,4 @@
+// we need to provide a definition of __COMPILER_BARRIER() defined in cmsis/cmsis_gcc.h V5.4.1 for FSP v4.4.0
+#ifndef __COMPILER_BARRIER
+ #define __COMPILER_BARRIER() __ASM volatile ("" ::: "memory")
+#endif