mail archive of the barebox mailing list
 help / color / mirror / Atom feed
From: Ahmad Fatoum <>
Cc: Ahmad Fatoum <>
Subject: [PATCH 3/3] MIPS: asm: add get_runtime_offset stub
Date: Fri,  5 Aug 2022 09:42:37 +0200	[thread overview]
Message-ID: <> (raw)
In-Reply-To: <>

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 <>
 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>

  parent reply	other threads:[~2022-08-05  7:44 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-05  7:42 [PATCH 1/3] RISC-V: asm: factor relocation related functions into asm/reloc.h Ahmad Fatoum
2022-08-05  7:42 ` [PATCH 2/3] ARM: asm: factor relocation related functions in asm/reloc.h Ahmad Fatoum
2022-08-05  7:42 ` Ahmad Fatoum [this message]
2022-08-08 12:48 ` [PATCH 1/3] RISC-V: asm: factor relocation related functions into asm/reloc.h Sascha Hauer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox