Provide a function which sets this pointer, for use in the EFI app.
Signed-off-by: Simon Glass <[email protected]>
---
(no changes since v1)
arch/x86/include/asm/global_data.h | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/arch/x86/include/asm/global_data.h
b/arch/x86/include/asm/global_data.h
index 06bd80ccc13..1bd1fa92078 100644
--- a/arch/x86/include/asm/global_data.h
+++ b/arch/x86/include/asm/global_data.h
@@ -142,6 +142,13 @@ struct arch_global_data {
/* TODO([email protected]): Consider using a fixed register for gd on x86_64 */
#define gd global_data_ptr
+static inline void set_gd(volatile gd_t *gd_ptr)
+{
+ extern struct global_data *global_data_ptr;
+
+ global_data_ptr = (void *)gd_ptr;
+}
+
#define DECLARE_GLOBAL_DATA_PTR extern struct global_data *global_data_ptr
# else
static inline notrace gd_t *get_fs_gd_ptr(void)
--
2.43.0