wdenk | 2262cfe | 2002-11-18 00:14:45 +0000 | [diff] [blame] | 1 | /* |
Wolfgang Denk | 91a7675 | 2010-07-24 20:22:02 +0200 | [diff] [blame] | 2 | * (C) Copyright 2002-2010 |
wdenk | 2262cfe | 2002-11-18 00:14:45 +0000 | [diff] [blame] | 3 | * Wolfgang Denk, DENX Software Engineering, wd@denx.de. |
| 4 | * |
Wolfgang Denk | 1a45966 | 2013-07-08 09:37:19 +0200 | [diff] [blame] | 5 | * SPDX-License-Identifier: GPL-2.0+ |
wdenk | 2262cfe | 2002-11-18 00:14:45 +0000 | [diff] [blame] | 6 | */ |
| 7 | |
| 8 | #ifndef __ASM_GBL_DATA_H |
| 9 | #define __ASM_GBL_DATA_H |
Simon Glass | 5cb4858 | 2012-12-13 20:48:30 +0000 | [diff] [blame] | 10 | |
| 11 | #ifndef __ASSEMBLY__ |
| 12 | |
| 13 | /* Architecture-specific global data */ |
| 14 | struct arch_global_data { |
Simon Glass | 5a35e6c | 2012-12-13 20:48:41 +0000 | [diff] [blame] | 15 | struct global_data *gd_addr; /* Location of Global Data */ |
Simon Glass | bc2df1a | 2013-02-28 19:26:12 +0000 | [diff] [blame] | 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() */ |
Simon Glass | f697d52 | 2013-02-28 19:26:15 +0000 | [diff] [blame] | 19 | void *new_fdt; /* Relocated FDT */ |
Simon Glass | 5cb4858 | 2012-12-13 20:48:30 +0000 | [diff] [blame] | 20 | }; |
| 21 | |
Graeme Russ | 9558b48 | 2011-09-01 00:48:27 +0000 | [diff] [blame] | 22 | #endif |
wdenk | 2262cfe | 2002-11-18 00:14:45 +0000 | [diff] [blame] | 23 | |
Simon Glass | 43cff66 | 2012-12-13 20:49:27 +0000 | [diff] [blame] | 24 | #include <asm-generic/global_data.h> |
| 25 | |
| 26 | #ifndef __ASSEMBLY__ |
Simon Glass | d8819f9 | 2013-06-11 11:14:52 -0700 | [diff] [blame] | 27 | static inline __attribute__((no_instrument_function)) gd_t *get_fs_gd_ptr(void) |
Graeme Russ | 9e6c572 | 2011-12-31 22:58:15 +1100 | [diff] [blame] | 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() |
Graeme Russ | 161b358 | 2010-10-07 20:03:29 +1100 | [diff] [blame] | 37 | |
| 38 | #endif |
| 39 | |
Gabe Black | 91d82a2 | 2012-11-03 11:41:28 +0000 | [diff] [blame] | 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 | |
Graeme Russ | 3ef96de | 2008-09-07 07:08:42 +1000 | [diff] [blame] | 46 | #define DECLARE_GLOBAL_DATA_PTR |
wdenk | 2262cfe | 2002-11-18 00:14:45 +0000 | [diff] [blame] | 47 | |
| 48 | #endif /* __ASM_GBL_DATA_H */ |