Lines Matching +full:clock +full:- +full:accuracy

2 Clock sources, Clock events, sched_clock() and delay timers
10 If you grep through the kernel source you will find a number of architecture-
11 specific implementations of clock sources, clockevents and several likewise
12 architecture-specific overrides of the sched_clock() function and some
15 To provide timekeeping for your platform, the clock source provides
16 the basic timeline, whereas clock events shoot interrupts on certain points
17 on this timeline, providing facilities such as high-resolution timers.
22 Clock sources
23 -------------
25 The purpose of the clock source is to provide a timeline for the system that
27 a Linux system will eventually read the clock source to determine exactly
30 Typically the clock source is a monotonic, atomic counter which will provide
31 n bits which count from 0 to (2^n)-1 and then wraps around to 0 and start over.
35 The clock source shall have as high resolution as possible, and the frequency
36 shall be as stable and correct as possible as compared to a real-world wall
37 clock. It should not move unpredictably back and forth in time or miss a few
46 When the wall-clock accuracy of the clock source isn't satisfactory, there
48 the user-visible time to RTC clocks in the system or against networked time
50 the clock source, which provides the fundamental timeline for the system.
51 These measures does not affect the clock source per se, they only adapt the
54 The clock source struct shall provide means to translate the provided counter
63 You will find a number of helper functions in the clock source code intended
68 factors using the frequency of the clock source as the only input.
70 For real simple clock sources accessed from a single I/O memory location
73 register counts up or down, and the timer clock rate, and then conjure all
76 Since a 32-bit counter at say 100 MHz will wrap around to zero after some 43
77 seconds, the code handling the clock source will have to compensate for this.
78 That is the reason why the clock source struct also contains a 'mask'
85 Clock events
86 ------------
88 Clock events are the conceptual reverse of clock sources: they take a
92 Clock events are orthogonal to clock sources. The same hardware
93 and register range may be used for the clock event, but it is essentially
94 a different thing. The hardware driving clock events has to be able to
100 You will notice that the clock event device code is based on the same basic
103 assigning these values. The clock event driver does not need a 'mask'
105 horizon of the clock event.
109 -------------
111 In addition to the clock sources and clock events there is a special weak
123 Compared to clock sources, sched_clock() has to be very fast: it is called
124 much more often, especially by the scheduler. If you have to do trade-offs
125 between accuracy compared to the clock source, you may sacrifice accuracy
127 characteristics as the clock source, i.e. it should be monotonic.
135 jiffy frequency for the architecture. This will affect scheduling accuracy
138 The clock driving sched_clock() may stop or reset to zero during system
143 The sched_clock() function should be callable in any context, IRQ- and
144 NMI-safe and return a sane value in any context.
147 counter to derive a 64-bit nanosecond value, so for example on the ARM
149 sched_clock() nanosecond base from a 16- or 32-bit counter. Sometimes the
150 same counter that is also used as clock source is used for this purpose.
157 that makes sched_clock() different from the ordinary clock source.
161 --------------------------------------
174 Enter timer-based delays. Using these, a timer read may be used instead of
175 a hard-coded loop for providing the desired delay.