11713ce7cSNathan Lynch /*
21713ce7cSNathan Lynch  * Adapted from arm64 version.
31713ce7cSNathan Lynch  *
41713ce7cSNathan Lynch  * Copyright (C) 2012 ARM Limited
51713ce7cSNathan Lynch  *
61713ce7cSNathan Lynch  * This program is free software; you can redistribute it and/or modify
71713ce7cSNathan Lynch  * it under the terms of the GNU General Public License version 2 as
81713ce7cSNathan Lynch  * published by the Free Software Foundation.
91713ce7cSNathan Lynch  *
101713ce7cSNathan Lynch  * This program is distributed in the hope that it will be useful,
111713ce7cSNathan Lynch  * but WITHOUT ANY WARRANTY; without even the implied warranty of
121713ce7cSNathan Lynch  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
131713ce7cSNathan Lynch  * GNU General Public License for more details.
141713ce7cSNathan Lynch  *
151713ce7cSNathan Lynch  * You should have received a copy of the GNU General Public License
161713ce7cSNathan Lynch  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
171713ce7cSNathan Lynch  */
181713ce7cSNathan Lynch #ifndef __ASM_VDSO_DATAPAGE_H
191713ce7cSNathan Lynch #define __ASM_VDSO_DATAPAGE_H
201713ce7cSNathan Lynch 
211713ce7cSNathan Lynch #ifdef __KERNEL__
221713ce7cSNathan Lynch 
231713ce7cSNathan Lynch #ifndef __ASSEMBLY__
241713ce7cSNathan Lynch 
251713ce7cSNathan Lynch #include <asm/page.h>
261713ce7cSNathan Lynch 
271713ce7cSNathan Lynch /* Try to be cache-friendly on systems that don't implement the
281713ce7cSNathan Lynch  * generic timer: fit the unconditionally updated fields in the first
291713ce7cSNathan Lynch  * 32 bytes.
301713ce7cSNathan Lynch  */
311713ce7cSNathan Lynch struct vdso_data {
321713ce7cSNathan Lynch 	u32 seq_count;		/* sequence count - odd during updates */
331713ce7cSNathan Lynch 	u16 tk_is_cntvct;	/* fall back to syscall if false */
341713ce7cSNathan Lynch 	u16 cs_shift;		/* clocksource shift */
351713ce7cSNathan Lynch 	u32 xtime_coarse_sec;	/* coarse time */
361713ce7cSNathan Lynch 	u32 xtime_coarse_nsec;
371713ce7cSNathan Lynch 
381713ce7cSNathan Lynch 	u32 wtm_clock_sec;	/* wall to monotonic offset */
391713ce7cSNathan Lynch 	u32 wtm_clock_nsec;
401713ce7cSNathan Lynch 	u32 xtime_clock_sec;	/* CLOCK_REALTIME - seconds */
411713ce7cSNathan Lynch 	u32 cs_mult;		/* clocksource multiplier */
421713ce7cSNathan Lynch 
431713ce7cSNathan Lynch 	u64 cs_cycle_last;	/* last cycle value */
441713ce7cSNathan Lynch 	u64 cs_mask;		/* clocksource mask */
451713ce7cSNathan Lynch 
461713ce7cSNathan Lynch 	u64 xtime_clock_snsec;	/* CLOCK_REALTIME sub-ns base */
471713ce7cSNathan Lynch 	u32 tz_minuteswest;	/* timezone info for gettimeofday(2) */
481713ce7cSNathan Lynch 	u32 tz_dsttime;
491713ce7cSNathan Lynch };
501713ce7cSNathan Lynch 
511713ce7cSNathan Lynch union vdso_data_store {
521713ce7cSNathan Lynch 	struct vdso_data data;
531713ce7cSNathan Lynch 	u8 page[PAGE_SIZE];
541713ce7cSNathan Lynch };
551713ce7cSNathan Lynch 
561713ce7cSNathan Lynch #endif /* !__ASSEMBLY__ */
571713ce7cSNathan Lynch 
581713ce7cSNathan Lynch #endif /* __KERNEL__ */
591713ce7cSNathan Lynch 
601713ce7cSNathan Lynch #endif /* __ASM_VDSO_DATAPAGE_H */
61