summaryrefslogtreecommitdiff
path: root/arch/riscv/lib/asm-offsets.c
diff options
context:
space:
mode:
authorBin Meng <bmeng.cn@gmail.com>2018-12-12 17:12:45 +0300
committerAndes <uboot@andestech.com>2018-12-18 04:56:27 +0300
commit51ab4570f3920ae3d6822c96fe03ffb97e2072b4 (patch)
tree7474fc94b643c1627d43c4b9029d1dc4d3f46f90 /arch/riscv/lib/asm-offsets.c
parent7f5d35a547afb1e4d8e7ca780ab1b9f78ed11d68 (diff)
downloadu-boot-51ab4570f3920ae3d6822c96fe03ffb97e2072b4.tar.xz
riscv: Save boot hart id to the global data
At present the hart id passed via a0 in the U-Boot entry is saved to s0 at the beginning but does not preserve later. Save it to the global data structure so that it can be used later. Signed-off-by: Bin Meng <bmeng.cn@gmail.com> Reviewed-by: Lukas Auer <lukas.auer@aisec.fraunhofer.de> Reviewed-by: Anup Patel <anup@brainfault.org>
Diffstat (limited to 'arch/riscv/lib/asm-offsets.c')
-rw-r--r--arch/riscv/lib/asm-offsets.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/arch/riscv/lib/asm-offsets.c b/arch/riscv/lib/asm-offsets.c
new file mode 100644
index 0000000000..e0b71f5691
--- /dev/null
+++ b/arch/riscv/lib/asm-offsets.c
@@ -0,0 +1,19 @@
+// SPDX-License-Identifier: GPL-2.0+
+/*
+ * Copyright (C) 2018, Bin Meng <bmeng.cn@gmail.com>
+ *
+ * From arch/x86/lib/asm-offsets.c
+ *
+ * This program is used to generate definitions needed by
+ * assembly language modules.
+ */
+
+#include <common.h>
+#include <linux/kbuild.h>
+
+int main(void)
+{
+ DEFINE(GD_BOOT_HART, offsetof(gd_t, arch.boot_hart));
+
+ return 0;
+}