diff options
author | Bin Meng <bmeng.cn@gmail.com> | 2018-12-12 06:12:45 -0800 |
---|---|---|
committer | Andes <uboot@andestech.com> | 2018-12-18 09:56:27 +0800 |
commit | 51ab4570f3920ae3d6822c96fe03ffb97e2072b4 (patch) | |
tree | 7474fc94b643c1627d43c4b9029d1dc4d3f46f90 /arch/riscv/lib | |
parent | 7f5d35a547afb1e4d8e7ca780ab1b9f78ed11d68 (diff) | |
download | u-boot-51ab4570f3920ae3d6822c96fe03ffb97e2072b4.tar.gz u-boot-51ab4570f3920ae3d6822c96fe03ffb97e2072b4.tar.xz u-boot-51ab4570f3920ae3d6822c96fe03ffb97e2072b4.zip |
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')
-rw-r--r-- | arch/riscv/lib/asm-offsets.c | 19 |
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; +} |