diff options
author | Ahmad Fatoum <a.fatoum@pengutronix.de> | 2022-08-05 09:42:35 +0200 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2022-08-08 14:47:58 +0200 |
commit | 870da755c9664b7844805d5ede3c1e89b2636b79 (patch) | |
tree | 0552b4d7a9dea482e0bac7c53f6f344a3d2e9dd6 /arch/riscv | |
parent | 039663c9d51dee0760942fa705780e3db3b34aea (diff) | |
download | barebox-870da755c9664b7844805d5ede3c1e89b2636b79.tar.gz |
RISC-V: asm: factor relocation related functions into asm/reloc.h
To allow use of global_variable_offset() from common PBL code,
move the definition into a new <asm/reloc.h> header.
At current time, it's expected that PBL enabled platforms define
at least get_runtime_offset() there.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de>
Link: https://lore.barebox.org/20220805074237.1148255-1-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'arch/riscv')
-rw-r--r-- | arch/riscv/include/asm/barebox-riscv.h | 7 | ||||
-rw-r--r-- | arch/riscv/include/asm/reloc.h | 15 |
2 files changed, 16 insertions, 6 deletions
diff --git a/arch/riscv/include/asm/barebox-riscv.h b/arch/riscv/include/asm/barebox-riscv.h index 5c87d37c9e..db6ff0ea71 100644 --- a/arch/riscv/include/asm/barebox-riscv.h +++ b/arch/riscv/include/asm/barebox-riscv.h @@ -21,12 +21,7 @@ #include <asm/barebox-riscv-head.h> #include <asm/system.h> #include <asm/cache.h> - -unsigned long get_runtime_offset(void); - -void setup_c(void); -void relocate_to_current_adr(void); -void relocate_to_adr(unsigned long target); +#include <asm/reloc.h> void __noreturn __naked barebox_riscv_entry(unsigned long membase, unsigned long memsize, void *boarddata, unsigned int flags); diff --git a/arch/riscv/include/asm/reloc.h b/arch/riscv/include/asm/reloc.h new file mode 100644 index 0000000000..9a59326cad --- /dev/null +++ b/arch/riscv/include/asm/reloc.h @@ -0,0 +1,15 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later */ + +#ifndef _ASM_RELOC_H_ +#define _ASM_RELOC_H_ + +unsigned long get_runtime_offset(void); + +void relocate_to_current_adr(void); +void relocate_to_adr(unsigned long target); + +void setup_c(void); + +#include <asm-generic/reloc.h> + +#endif /* _BAREBOX_RISCV_H_ */ |