[rtems commit] riscv: Move functions to avoid build issues

Sebastian Huber sebh at rtems.org
Fri Oct 14 09:41:34 UTC 2022


Module:    rtems
Branch:    master
Commit:    e9a69c57442b6898a3f6f3184068857676ff40fe
Changeset: http://git.rtems.org/rtems/commit/?id=e9a69c57442b6898a3f6f3184068857676ff40fe

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Fri Oct 14 10:52:00 2022 +0200

riscv: Move functions to avoid build issues

The _RISCV_Map_cpu_index_to_hardid() and _RISCV_Map_hardid_to_cpu_index()
functions must be available to all riscv BSPs.

---

 bsps/riscv/riscv/include/bsp/riscv.h                 | 10 ----------
 cpukit/score/cpu/riscv/include/rtems/score/cpuimpl.h | 10 ++++++++++
 2 files changed, 10 insertions(+), 10 deletions(-)

diff --git a/bsps/riscv/riscv/include/bsp/riscv.h b/bsps/riscv/riscv/include/bsp/riscv.h
index 2ef2f8d83d..d38f46c069 100644
--- a/bsps/riscv/riscv/include/bsp/riscv.h
+++ b/bsps/riscv/riscv/include/bsp/riscv.h
@@ -34,16 +34,6 @@
 extern "C" {
 #endif
 
-static inline uint32_t _RISCV_Map_hardid_to_cpu_index(uint32_t hardid)
-{
-  return (hardid - RISCV_BOOT_HARTID);
-}
-
-static inline uint32_t _RISCV_Map_cpu_index_to_hardid(uint32_t cpu_index)
-{
-  return (cpu_index + RISCV_BOOT_HARTID);
-}
-
 extern volatile RISCV_CLINT_regs *riscv_clint;
 
 void *riscv_fdt_get_address(const void *fdt, int node);
diff --git a/cpukit/score/cpu/riscv/include/rtems/score/cpuimpl.h b/cpukit/score/cpu/riscv/include/rtems/score/cpuimpl.h
index 627c48f94c..ea1e139d55 100644
--- a/cpukit/score/cpu/riscv/include/rtems/score/cpuimpl.h
+++ b/cpukit/score/cpu/riscv/include/rtems/score/cpuimpl.h
@@ -298,6 +298,16 @@
 extern "C" {
 #endif
 
+static inline uint32_t _RISCV_Map_hardid_to_cpu_index( uint32_t hardid )
+{
+  return hardid - RISCV_BOOT_HARTID;
+}
+
+static inline uint32_t _RISCV_Map_cpu_index_to_hardid( uint32_t cpu_index )
+{
+  return cpu_index + RISCV_BOOT_HARTID;
+}
+
 /* Core Local Interruptor (CLINT) */
 
 typedef union {



More information about the vc mailing list