Commit 6b9966e1 authored by Heinrich Schuchardt's avatar Heinrich Schuchardt 💬

riscv: define function set_gd()

Function set_gd() is needed in the UEFI sub-system if the global data
pointer is stored in a register.
Signed-off-by: Heinrich Schuchardt's avatarHeinrich Schuchardt <>
parent e5a31376
......@@ -39,4 +39,13 @@ struct arch_global_data {
#define DECLARE_GLOBAL_DATA_PTR register gd_t *gd asm ("gp")
static inline void set_gd(volatile gd_t *gd_ptr)
#ifdef CONFIG_64BIT
asm volatile("ld gp, %0\n" : : "m"(gd_ptr));
asm volatile("lw gp, %0\n" : : "m"(gd_ptr));
#endif /* __ASM_GBL_DATA_H */
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment