1 /* 2 * (C) Copyright 2002-2010 3 * Wolfgang Denk, DENX Software Engineering, wd@denx.de. 4 * 5 * SPDX-License-Identifier: GPL-2.0+ 6 */ 7 8 #ifndef __ASM_GBL_DATA_H 9 #define __ASM_GBL_DATA_H 10 11 #ifndef __ASSEMBLY__ 12 13 /* Architecture-specific global data */ 14 struct arch_global_data { 15 struct global_data *gd_addr; /* Location of Global Data */ 16 uint64_t tsc_base; /* Initial value returned by rdtsc() */ 17 uint32_t tsc_base_kclocks; /* Initial tsc as a kclocks value */ 18 uint32_t tsc_prev; /* For show_boot_progress() */ 19 void *new_fdt; /* Relocated FDT */ 20 }; 21 22 #endif 23 24 #include <asm-generic/global_data.h> 25 26 #ifndef __ASSEMBLY__ 27 static inline __attribute__((no_instrument_function)) gd_t *get_fs_gd_ptr(void) 28 { 29 gd_t *gd_ptr; 30 31 asm volatile("fs movl 0, %0\n" : "=r" (gd_ptr)); 32 33 return gd_ptr; 34 } 35 36 #define gd get_fs_gd_ptr() 37 38 #endif 39 40 /* 41 * Our private Global Data Flags 42 */ 43 #define GD_FLG_COLD_BOOT 0x00100 /* Cold Boot */ 44 #define GD_FLG_WARM_BOOT 0x00200 /* Warm Boot */ 45 46 #define DECLARE_GLOBAL_DATA_PTR 47 48 #endif /* __ASM_GBL_DATA_H */ 49