mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-24 13:43:28 +00:00
riscv: support standalone applications on RV64I systems
Add an implementation of EXPORT_FUNC() for RV64I systems to support them in standalone applications. Signed-off-by: Lukas Auer <lukas.auer@aisec.fraunhofer.de> Reviewed-by: Bin Meng <bmeng.cn@gmail.com> Tested-by: Bin Meng <bmeng.cn@gmail.com>
This commit is contained in:
parent
cbb860f2c8
commit
7eb792970e
1 changed files with 11 additions and 0 deletions
|
@ -176,6 +176,16 @@ gd_t *global_data;
|
|||
/*
|
||||
* gp holds the pointer to the global_data. t0 is call clobbered.
|
||||
*/
|
||||
#ifdef CONFIG_ARCH_RV64I
|
||||
#define EXPORT_FUNC(f, a, x, ...) \
|
||||
asm volatile ( \
|
||||
" .globl " #x "\n" \
|
||||
#x ":\n" \
|
||||
" ld t0, %0(gp)\n" \
|
||||
" ld t0, %1(t0)\n" \
|
||||
" jr t0\n" \
|
||||
: : "i"(offsetof(gd_t, jt)), "i"(FO(x)) : "t0");
|
||||
#else
|
||||
#define EXPORT_FUNC(f, a, x, ...) \
|
||||
asm volatile ( \
|
||||
" .globl " #x "\n" \
|
||||
|
@ -184,6 +194,7 @@ gd_t *global_data;
|
|||
" lw t0, %1(t0)\n" \
|
||||
" jr t0\n" \
|
||||
: : "i"(offsetof(gd_t, jt)), "i"(FO(x)) : "t0");
|
||||
#endif
|
||||
#elif defined(CONFIG_ARC)
|
||||
/*
|
||||
* r25 holds the pointer to the global_data. r10 is call clobbered.
|
||||
|
|
Loading…
Reference in a new issue