[PATCH 3/3] MIPS: asm: add get_runtime_offset stub
Ahmad Fatoum
a.fatoum at pengutronix.de
Fri Aug 5 00:42:37 PDT 2022
MIPS' relocation setup differs from ARM and RISC-V, but as it always
happen within assembly, we can assume C code to always be relocated,
which allows a trivial implementation of get_runtime_offset().
Signed-off-by: Ahmad Fatoum <a.fatoum at pengutronix.de>
---
arch/mips/include/asm/reloc.h | 14 ++++++++++++++
1 file changed, 14 insertions(+)
create mode 100644 arch/mips/include/asm/reloc.h
diff --git a/arch/mips/include/asm/reloc.h b/arch/mips/include/asm/reloc.h
new file mode 100644
index 000000000000..adffd6f1c7ef
--- /dev/null
+++ b/arch/mips/include/asm/reloc.h
@@ -0,0 +1,14 @@
+/* SPDX-License-Identifier: GPL-2.0-or-later */
+
+#ifndef _ASM_RELOC_H_
+#define _ASM_RELOC_H_
+
+static inline unsigned long get_runtime_offset(void)
+{
+ /* On MIPS, we always relocate before jumping into C */
+ return 0;
+}
+
+#include <asm-generic/reloc.h>
+
+#endif
--
2.30.2
More information about the barebox
mailing list