~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/include/vdso/datapage.h

Version: ~ [ linux-6.11-rc3 ] ~ [ linux-6.10.4 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.45 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.104 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.164 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.223 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.281 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.319 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

Diff markup

Differences between /include/vdso/datapage.h (Version linux-6.11-rc3) and /include/vdso/datapage.h (Version linux-5.5.19)


  1 /* SPDX-License-Identifier: GPL-2.0 */              1 /* SPDX-License-Identifier: GPL-2.0 */
  2 #ifndef __VDSO_DATAPAGE_H                           2 #ifndef __VDSO_DATAPAGE_H
  3 #define __VDSO_DATAPAGE_H                           3 #define __VDSO_DATAPAGE_H
  4                                                     4 
  5 #ifndef __ASSEMBLY__                                5 #ifndef __ASSEMBLY__
  6                                                     6 
  7 #include <linux/compiler.h>                    !!   7 #include <linux/bits.h>
  8 #include <uapi/linux/time.h>                   !!   8 #include <linux/time.h>
  9 #include <uapi/linux/types.h>                  !!   9 #include <linux/types.h>
 10 #include <uapi/asm-generic/errno-base.h>       << 
 11                                                << 
 12 #include <vdso/bits.h>                         << 
 13 #include <vdso/clocksource.h>                  << 
 14 #include <vdso/ktime.h>                        << 
 15 #include <vdso/limits.h>                       << 
 16 #include <vdso/math64.h>                       << 
 17 #include <vdso/processor.h>                    << 
 18 #include <vdso/time.h>                         << 
 19 #include <vdso/time32.h>                       << 
 20 #include <vdso/time64.h>                       << 
 21                                                << 
 22 #ifdef CONFIG_ARCH_HAS_VDSO_DATA               << 
 23 #include <asm/vdso/data.h>                     << 
 24 #else                                          << 
 25 struct arch_vdso_data {};                      << 
 26 #endif                                         << 
 27                                                    10 
 28 #define VDSO_BASES      (CLOCK_TAI + 1)            11 #define VDSO_BASES      (CLOCK_TAI + 1)
 29 #define VDSO_HRES       (BIT(CLOCK_REALTIME)       12 #define VDSO_HRES       (BIT(CLOCK_REALTIME)            | \
 30                          BIT(CLOCK_MONOTONIC)      13                          BIT(CLOCK_MONOTONIC)           | \
 31                          BIT(CLOCK_BOOTTIME)       14                          BIT(CLOCK_BOOTTIME)            | \
 32                          BIT(CLOCK_TAI))           15                          BIT(CLOCK_TAI))
 33 #define VDSO_COARSE     (BIT(CLOCK_REALTIME_CO     16 #define VDSO_COARSE     (BIT(CLOCK_REALTIME_COARSE)     | \
 34                          BIT(CLOCK_MONOTONIC_C     17                          BIT(CLOCK_MONOTONIC_COARSE))
 35 #define VDSO_RAW        (BIT(CLOCK_MONOTONIC_R     18 #define VDSO_RAW        (BIT(CLOCK_MONOTONIC_RAW))
 36                                                    19 
 37 #define CS_HRES_COARSE  0                          20 #define CS_HRES_COARSE  0
 38 #define CS_RAW          1                          21 #define CS_RAW          1
 39 #define CS_BASES        (CS_RAW + 1)               22 #define CS_BASES        (CS_RAW + 1)
 40                                                    23 
 41 /**                                                24 /**
 42  * struct vdso_timestamp - basetime per clock_     25  * struct vdso_timestamp - basetime per clock_id
 43  * @sec:        seconds                            26  * @sec:        seconds
 44  * @nsec:       nanoseconds                        27  * @nsec:       nanoseconds
 45  *                                                 28  *
 46  * There is one vdso_timestamp object in vvar      29  * There is one vdso_timestamp object in vvar for each vDSO-accelerated
 47  * clock_id. For high-resolution clocks, this      30  * clock_id. For high-resolution clocks, this encodes the time
 48  * corresponding to vdso_data.cycle_last. For      31  * corresponding to vdso_data.cycle_last. For coarse clocks this encodes
 49  * the actual time.                                32  * the actual time.
 50  *                                                 33  *
 51  * To be noticed that for highres clocks nsec      34  * To be noticed that for highres clocks nsec is left-shifted by
 52  * vdso_data.cs[x].shift.                          35  * vdso_data.cs[x].shift.
 53  */                                                36  */
 54 struct vdso_timestamp {                            37 struct vdso_timestamp {
 55         u64     sec;                               38         u64     sec;
 56         u64     nsec;                              39         u64     nsec;
 57 };                                                 40 };
 58                                                    41 
 59 /**                                                42 /**
 60  * struct vdso_data - vdso datapage representa     43  * struct vdso_data - vdso datapage representation
 61  * @seq:                timebase sequence coun     44  * @seq:                timebase sequence counter
 62  * @clock_mode:         clock mode                 45  * @clock_mode:         clock mode
 63  * @cycle_last:         timebase at clocksourc     46  * @cycle_last:         timebase at clocksource init
 64  * @max_cycles:         maximum cycles which w << 
 65  * @mask:               clocksource mask           47  * @mask:               clocksource mask
 66  * @mult:               clocksource multiplier     48  * @mult:               clocksource multiplier
 67  * @shift:              clocksource shift          49  * @shift:              clocksource shift
 68  * @basetime[clock_id]: basetime per clock_id      50  * @basetime[clock_id]: basetime per clock_id
 69  * @offset[clock_id]:   time namespace offset  << 
 70  * @tz_minuteswest:     minutes west of Greenw     51  * @tz_minuteswest:     minutes west of Greenwich
 71  * @tz_dsttime:         type of DST correction     52  * @tz_dsttime:         type of DST correction
 72  * @hrtimer_res:        hrtimer resolution         53  * @hrtimer_res:        hrtimer resolution
 73  * @__unused:           unused                     54  * @__unused:           unused
 74  * @arch_data:          architecture specific  << 
 75  *                      to an empty struct)    << 
 76  *                                                 55  *
 77  * vdso_data will be accessed by 64 bit and co     56  * vdso_data will be accessed by 64 bit and compat code at the same time
 78  * so we should be careful before modifying th     57  * so we should be careful before modifying this structure.
 79  *                                             << 
 80  * The ordering of the struct members is optim << 
 81  * often required struct members which are rel << 
 82  * CLOCK_MONOTONIC. This information is stored << 
 83  *                                             << 
 84  * @basetime is used to store the base time fo << 
 85  * VVAR page.                                  << 
 86  *                                             << 
 87  * @offset is used by the special time namespa << 
 88  * installed instead of the real VVAR page. Th << 
 89  * @seq to 1 and @clock_mode to VDSO_CLOCKMODE << 
 90  * the time namespace slow path. The namespace << 
 91  * real system wide VVAR page, read host time  << 
 92  * For clocks which are not affected by time n << 
 93  * offset must be zero.                        << 
 94  */                                                58  */
 95 struct vdso_data {                                 59 struct vdso_data {
 96         u32                     seq;               60         u32                     seq;
 97                                                    61 
 98         s32                     clock_mode;        62         s32                     clock_mode;
 99         u64                     cycle_last;        63         u64                     cycle_last;
100 #ifdef CONFIG_GENERIC_VDSO_OVERFLOW_PROTECT    << 
101         u64                     max_cycles;    << 
102 #endif                                         << 
103         u64                     mask;              64         u64                     mask;
104         u32                     mult;              65         u32                     mult;
105         u32                     shift;             66         u32                     shift;
106                                                    67 
107         union {                                !!  68         struct vdso_timestamp   basetime[VDSO_BASES];
108                 struct vdso_timestamp   baseti << 
109                 struct timens_offset    offset << 
110         };                                     << 
111                                                    69 
112         s32                     tz_minuteswest     70         s32                     tz_minuteswest;
113         s32                     tz_dsttime;        71         s32                     tz_dsttime;
114         u32                     hrtimer_res;       72         u32                     hrtimer_res;
115         u32                     __unused;          73         u32                     __unused;
116                                                << 
117         struct arch_vdso_data   arch_data;     << 
118 };                                             << 
119                                                << 
120 /**                                            << 
121  * struct vdso_rng_data - vdso RNG state infor << 
122  * @generation: counter representing the numbe << 
123  * @is_ready:   boolean signaling whether the  << 
124  */                                            << 
125 struct vdso_rng_data {                         << 
126         u64     generation;                    << 
127         u8      is_ready;                      << 
128 };                                                 74 };
129                                                    75 
130 /*                                                 76 /*
131  * We use the hidden visibility to prevent the     77  * We use the hidden visibility to prevent the compiler from generating a GOT
132  * relocation. Not only is going through a GOT     78  * relocation. Not only is going through a GOT useless (the entry couldn't and
133  * must not be overridden by another library),     79  * must not be overridden by another library), it does not even work: the linker
134  * cannot generate an absolute address to the      80  * cannot generate an absolute address to the data page.
135  *                                                 81  *
136  * With the hidden visibility, the compiler si     82  * With the hidden visibility, the compiler simply generates a PC-relative
137  * relocation, and this is what we need.           83  * relocation, and this is what we need.
138  */                                                84  */
139 extern struct vdso_data _vdso_data[CS_BASES] _     85 extern struct vdso_data _vdso_data[CS_BASES] __attribute__((visibility("hidden")));
140 extern struct vdso_data _timens_data[CS_BASES] << 
141 extern struct vdso_rng_data _vdso_rng_data __a << 
142                                                << 
143 /**                                            << 
144  * union vdso_data_store - Generic vDSO data p << 
145  */                                            << 
146 union vdso_data_store {                        << 
147         struct vdso_data        data[CS_BASES] << 
148         u8                      page[1U << CON << 
149 };                                             << 
150                                                << 
151 /*                                             << 
152  * The generic vDSO implementation requires th << 
153  * provides:                                   << 
154  * - __arch_get_vdso_data(): to get the vdso d << 
155  * - __arch_get_hw_counter(): to get the hw co << 
156  *   clock_mode.                               << 
157  * - gettimeofday_fallback(): fallback for get << 
158  * - clock_gettime_fallback(): fallback for cl << 
159  * - clock_getres_fallback(): fallback for clo << 
160  */                                            << 
161 #ifdef ENABLE_COMPAT_VDSO                      << 
162 #include <asm/vdso/compat_gettimeofday.h>      << 
163 #else                                          << 
164 #include <asm/vdso/gettimeofday.h>             << 
165 #endif /* ENABLE_COMPAT_VDSO */                << 
166                                                    86 
167 #endif /* !__ASSEMBLY__ */                         87 #endif /* !__ASSEMBLY__ */
168                                                    88 
169 #endif /* __VDSO_DATAPAGE_H */                     89 #endif /* __VDSO_DATAPAGE_H */
170                                                    90 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php