@ -104,8 +104,9 @@ struct arch_global_data {
# include <asm-generic/global_data.h>
# include <asm-generic/global_data.h>
# ifndef __ASSEMBLY__
# ifndef __ASSEMBLY__
# ifdef CONFIG_EFI_APP
# if defined(CONFIG_EFI_APP) || CONFIG_IS_ENABLED(X86_64)
/* TODO(sjg@chromium.org): Consider using a fixed register for gd on x86_64 */
# define gd global_data_ptr
# define gd global_data_ptr
# define DECLARE_GLOBAL_DATA_PTR extern struct global_data *global_data_ptr
# define DECLARE_GLOBAL_DATA_PTR extern struct global_data *global_data_ptr
@ -114,7 +115,11 @@ static inline __attribute__((no_instrument_function)) gd_t *get_fs_gd_ptr(void)
{
{
gd_t * gd_ptr ;
gd_t * gd_ptr ;
# if CONFIG_IS_ENABLED(X86_64)
asm volatile ( " fs mov 0, %0 \n " : " =r " ( gd_ptr ) ) ;
# else
asm volatile ( " fs movl 0, %0 \n " : " =r " ( gd_ptr ) ) ;
asm volatile ( " fs movl 0, %0 \n " : " =r " ( gd_ptr ) ) ;
# endif
return gd_ptr ;
return gd_ptr ;
}
}