summaryrefslogtreecommitdiffstats
path: root/arch/arm/lib64
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2018-03-07 09:17:13 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2018-03-21 12:23:02 +0100
commit07172d63f31109c89012ddf0c5470c57c65c38a6 (patch)
treef12e4c8aba73b154c1930c5b4c0c4e88c710d04a /arch/arm/lib64
parent7fe6896739fea73912b06df7026443a4a9c61f58 (diff)
downloadbarebox-07172d63f31109c89012ddf0c5470c57c65c38a6.tar.gz
barebox-07172d63f31109c89012ddf0c5470c57c65c38a6.tar.xz
ARM: aarch64: Add runtime-offset
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/arm/lib64')
-rw-r--r--arch/arm/lib64/Makefile1
-rw-r--r--arch/arm/lib64/runtime-offset.S19
2 files changed, 20 insertions, 0 deletions
diff --git a/arch/arm/lib64/Makefile b/arch/arm/lib64/Makefile
index 4b7b7e3cc5..679ca556e5 100644
--- a/arch/arm/lib64/Makefile
+++ b/arch/arm/lib64/Makefile
@@ -3,5 +3,6 @@ obj-y += div0.o
obj-$(CONFIG_ARM_OPTIMZED_STRING_FUNCTIONS) += memcpy.o
obj-$(CONFIG_ARM_OPTIMZED_STRING_FUNCTIONS) += memset.o
extra-y += barebox.lds
+obj-pbl-y += runtime-offset.o
pbl-y += div0.o
diff --git a/arch/arm/lib64/runtime-offset.S b/arch/arm/lib64/runtime-offset.S
new file mode 100644
index 0000000000..177ca64784
--- /dev/null
+++ b/arch/arm/lib64/runtime-offset.S
@@ -0,0 +1,19 @@
+#include <linux/linkage.h>
+#include <asm/assembler.h>
+
+.section ".text_bare_init","ax"
+
+/*
+ * Get the offset between the link address and the address
+ * we are currently running at.
+ */
+ENTRY(get_runtime_offset)
+1: adr x0, 1b
+ ldr x1, linkadr
+ subs x0, x0, x1
+ ret
+
+.align 3
+linkadr:
+.quad get_runtime_offset
+ENDPROC(get_runtime_offset)