TSC(9) | Kernel Developer's Manual (x86) | TSC(9) |
uint64_t
rdtsc(void);
void
tsc_tc_init(void);
void
tsc_sync_ap(struct cpu_info *ci);
void
tsc_sync_bp(struct cpu_info *ci);
void
tsc_sync_drift(int64_t drift);
Already because of the access method, TSC provides a low-overhead and high-resolution way to obtain CPU timing information. This traditional premise was violated when such factors as system sleep states, CPU “hotplugging”, “hibernation”, and CPU frequency scaling were introduced to the x86 lineage. This was however mainly a short abruption: in many new x86 CPUs the time stamp counter is again invariant with respect to the stability of the clock frequency. Care should be however taken in implementations that rely on this assumption.
It is necessary to call both tsc_sync_ap() and tsc_sync_bp() during the boot, but additional synchronization may be required also during runtime. As an example, the TSC needs to be synchronized for all processors when the system resumes from an acpi(4) sleep state.
November 20, 2013 | NetBSD 7.2 |