|
@@ -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));
|
|
|
+#else
|
|
|
+ asm volatile("lw gp, %0\n" : : "m"(gd_ptr));
|
|
|
+#endif
|
|
|
+}
|
|
|
+
|
|
|
#endif /* __ASM_GBL_DATA_H */
|