FROMLIST: [PATCH v5 11/12] lib: vdso: Add support for CLOCK_BOOTTIME
[GitHub/LineageOS/G12/android_kernel_amlogic_linux-4.9.git] / arch / arm / include / asm / vdso_datapage.h
1 /*
2 * Adapted from arm64 version.
3 *
4 * Copyright (C) 2012 ARM Limited
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17 */
18 #ifndef __ASM_VDSO_DATAPAGE_H
19 #define __ASM_VDSO_DATAPAGE_H
20
21 #ifdef __KERNEL__
22
23 #ifndef __ASSEMBLY__
24
25 #include <asm/page.h>
26
27 #ifndef _VDSO_WTM_CLOCK_SEC_T
28 #define _VDSO_WTM_CLOCK_SEC_T
29 typedef u32 vdso_wtm_clock_nsec_t;
30 #endif
31
32 #ifndef _VDSO_XTIME_CLOCK_SEC_T
33 #define _VDSO_XTIME_CLOCK_SEC_T
34 typedef u32 vdso_xtime_clock_sec_t;
35 #endif
36
37 #ifndef _VDSO_RAW_TIME_SEC_T
38 #define _VDSO_RAW_TIME_SEC_T
39 typedef u32 vdso_raw_time_sec_t;
40 #endif
41
42 /* Try to be cache-friendly on systems that don't implement the
43 * generic timer: fit the unconditionally updated fields in the first
44 * 32 bytes.
45 */
46 struct vdso_data {
47 u32 tb_seq_count; /* sequence count - odd during updates */
48 u16 use_syscall; /* fall back to syscall if true */
49 u16 cs_shift; /* clocksource shift */
50 u32 xtime_coarse_sec; /* coarse time */
51 u32 xtime_coarse_nsec;
52
53 /* wall to monotonic offset */
54 u32 wtm_clock_sec;
55 vdso_wtm_clock_nsec_t wtm_clock_nsec;
56 /* CLOCK_REALTIME - seconds */
57 vdso_xtime_clock_sec_t xtime_clock_sec;
58 u32 cs_mono_mult; /* clocksource multiplier */
59
60 u64 cs_cycle_last; /* last cycle value */
61 u64 cs_mask; /* clocksource mask */
62
63 u64 xtime_clock_snsec; /* CLOCK_REALTIME sub-ns base */
64 u32 tz_minuteswest; /* timezone info for gettimeofday(2) */
65 u32 tz_dsttime;
66
67 u64 btm_nsec; /* monotonic to boot time */
68 /* Raw clocksource multipler */
69 u32 cs_raw_mult;
70 /* Raw time */
71 vdso_raw_time_sec_t raw_time_sec;
72 u32 raw_time_nsec;
73 };
74
75 union vdso_data_store {
76 struct vdso_data data;
77 u8 page[PAGE_SIZE];
78 };
79
80 #endif /* !__ASSEMBLY__ */
81
82 #endif /* __KERNEL__ */
83
84 #endif /* __ASM_VDSO_DATAPAGE_H */