On ARM systems gd is stored in register r9 or x18. When compiling with
clang gd is defined as a macro calling function gd_ptr(). So we can not
make assignments to gd.
Use function set_gd() for setting the register on ARM.
Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Reviewed-by: Simon Glass <sjg@chromium.org>
return offset / FUNC_SITE_SIZE;
}
-#ifdef CONFIG_EFI_LOADER
+#if defined(CONFIG_EFI_LOADER) && defined(CONFIG_ARM)
/**
* trace_gd - the value of the gd register
*/
-static volatile void *trace_gd;
+static volatile gd_t *trace_gd;
/**
* trace_save_gd() - save the value of the gd register
*/
static void __attribute__((no_instrument_function)) trace_swap_gd(void)
{
- volatile void *temp_gd = trace_gd;
+ volatile gd_t *temp_gd = trace_gd;
trace_gd = gd;
- gd = temp_gd;
+ set_gd(temp_gd);
}
#else