[PATCH rtems-libbsd 3/3] freebsd/cgem: Add weak symbol for riscv

Padmarao Begari padmarao.begari at microchip.com
Wed Mar 1 05:57:28 UTC 2023


Add __weak_symbol instead of __weak_reference for the
cgem_set_ref_clk() function for riscv build.
---
 freebsd/sys/dev/cadence/if_cgem.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/freebsd/sys/dev/cadence/if_cgem.c b/freebsd/sys/dev/cadence/if_cgem.c
index 363a9717..a12f7b43 100644
--- a/freebsd/sys/dev/cadence/if_cgem.c
+++ b/freebsd/sys/dev/cadence/if_cgem.c
@@ -1764,6 +1764,12 @@ cgem_miibus_linkchg(device_t dev)
  * Overridable weak symbol cgem_set_ref_clk().  This allows platforms to
  * provide a function to set the cgem's reference clock.
  */
+#ifdef __riscv
+__weak_symbol int cgem_set_ref_clk(int unit, int frequency)
+{
+	return 0;
+}
+#else
 static int __used
 cgem_default_set_ref_clk(int unit, int frequency)
 {
@@ -1771,6 +1777,7 @@ cgem_default_set_ref_clk(int unit, int frequency)
 	return 0;
 }
 __weak_reference(cgem_default_set_ref_clk, cgem_set_ref_clk);
+#endif /* __riscv */
 
 /* Call to set reference clock and network config bits according to media. */
 static void
-- 
2.25.1



More information about the devel mailing list