File tree Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -61,6 +61,7 @@ struct vdso_timestamp {
61
61
* @seq: timebase sequence counter
62
62
* @clock_mode: clock mode
63
63
* @cycle_last: timebase at clocksource init
64
+ * @max_cycles: maximum cycles which won't overflow 64bit multiplication
64
65
* @mask: clocksource mask
65
66
* @mult: clocksource multiplier
66
67
* @shift: clocksource shift
@@ -92,6 +93,9 @@ struct vdso_data {
92
93
93
94
s32 clock_mode ;
94
95
u64 cycle_last ;
96
+ #ifdef CONFIG_GENERIC_VDSO_OVERFLOW_PROTECT
97
+ u64 max_cycles ;
98
+ #endif
95
99
u64 mask ;
96
100
u32 mult ;
97
101
u32 shift ;
Original file line number Diff line number Diff line change @@ -22,10 +22,16 @@ static inline void update_vdso_data(struct vdso_data *vdata,
22
22
u64 nsec , sec ;
23
23
24
24
vdata [CS_HRES_COARSE ].cycle_last = tk -> tkr_mono .cycle_last ;
25
+ #ifdef CONFIG_GENERIC_VDSO_OVERFLOW_PROTECT
26
+ vdata [CS_HRES_COARSE ].max_cycles = tk -> tkr_mono .clock -> max_cycles ;
27
+ #endif
25
28
vdata [CS_HRES_COARSE ].mask = tk -> tkr_mono .mask ;
26
29
vdata [CS_HRES_COARSE ].mult = tk -> tkr_mono .mult ;
27
30
vdata [CS_HRES_COARSE ].shift = tk -> tkr_mono .shift ;
28
31
vdata [CS_RAW ].cycle_last = tk -> tkr_raw .cycle_last ;
32
+ #ifdef CONFIG_GENERIC_VDSO_OVERFLOW_PROTECT
33
+ vdata [CS_RAW ].max_cycles = tk -> tkr_raw .clock -> max_cycles ;
34
+ #endif
29
35
vdata [CS_RAW ].mask = tk -> tkr_raw .mask ;
30
36
vdata [CS_RAW ].mult = tk -> tkr_raw .mult ;
31
37
vdata [CS_RAW ].shift = tk -> tkr_raw .shift ;
You can’t perform that action at this time.
0 commit comments