global_data.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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. #ifndef __ASM_GBL_DATA_H
  8. #define __ASM_GBL_DATA_H
  9. #ifndef __ASSEMBLY__
  10. /* Architecture-specific global data */
  11. struct arch_global_data {
  12. struct global_data *gd_addr; /* Location of Global Data */
  13. uint8_t x86; /* CPU family */
  14. uint8_t x86_vendor; /* CPU vendor */
  15. uint8_t x86_model;
  16. uint8_t x86_mask;
  17. uint32_t x86_device;
  18. uint64_t tsc_base; /* Initial value returned by rdtsc() */
  19. uint32_t tsc_base_kclocks; /* Initial tsc as a kclocks value */
  20. uint32_t tsc_prev; /* For show_boot_progress() */
  21. uint32_t tsc_mhz; /* TSC frequency in MHz */
  22. void *new_fdt; /* Relocated FDT */
  23. uint32_t bist; /* Built-in self test value */
  24. };
  25. #endif
  26. #include <asm-generic/global_data.h>
  27. #ifndef __ASSEMBLY__
  28. static inline __attribute__((no_instrument_function)) gd_t *get_fs_gd_ptr(void)
  29. {
  30. gd_t *gd_ptr;
  31. asm volatile("fs movl 0, %0\n" : "=r" (gd_ptr));
  32. return gd_ptr;
  33. }
  34. #define gd get_fs_gd_ptr()
  35. #endif
  36. /*
  37. * Our private Global Data Flags
  38. */
  39. #define GD_FLG_COLD_BOOT 0x00100 /* Cold Boot */
  40. #define GD_FLG_WARM_BOOT 0x00200 /* Warm Boot */
  41. #define DECLARE_GLOBAL_DATA_PTR
  42. #endif /* __ASM_GBL_DATA_H */