ia64/linux-2.6.18-xen.hg

diff Documentation/time_interpolators.txt @ 0:831230e53067

Import 2.6.18 from kernel.org tarball.
author Ian Campbell <ian.campbell@xensource.com>
date Wed Apr 11 14:15:44 2007 +0100 (2007-04-11)
parents
children
line diff
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/Documentation/time_interpolators.txt	Wed Apr 11 14:15:44 2007 +0100
     1.3 @@ -0,0 +1,41 @@
     1.4 +Time Interpolators
     1.5 +------------------
     1.6 +
     1.7 +Time interpolators are a base of time calculation between timer ticks and
     1.8 +allow an accurate determination of time down to the accuracy of the time
     1.9 +source in nanoseconds.
    1.10 +
    1.11 +The architecture specific code typically provides gettimeofday and
    1.12 +settimeofday under Linux. The time interpolator provides both if an arch
    1.13 +defines CONFIG_TIME_INTERPOLATION. The arch still must set up timer tick
    1.14 +operations and call the necessary functions to advance the clock.
    1.15 +
    1.16 +With the time interpolator a standardized interface exists for time
    1.17 +interpolation between ticks. The provided logic is highly scalable
    1.18 +and has been tested in SMP situations of up to 512 CPUs.
    1.19 +
    1.20 +If CONFIG_TIME_INTERPOLATION is defined then the architecture specific code
    1.21 +(or the device drivers - like HPET) may register time interpolators.
    1.22 +These are typically defined in the following way:
    1.23 +
    1.24 +static struct time_interpolator my_interpolator {
    1.25 +	.frequency = MY_FREQUENCY,
    1.26 +	.source = TIME_SOURCE_MMIO32,
    1.27 +	.shift = 8,		/* scaling for higher accuracy */
    1.28 +	.drift = -1,		/* Unknown drift */
    1.29 +	.jitter = 0		/* time source is stable */
    1.30 +};
    1.31 +
    1.32 +void time_init(void)
    1.33 +{
    1.34 +	....
    1.35 +	/* Initialization of the timer *.
    1.36 +	my_interpolator.address = &my_timer;
    1.37 +	register_time_interpolator(&my_interpolator);
    1.38 +	....
    1.39 +}
    1.40 +
    1.41 +For more details see include/linux/timex.h and kernel/timer.c.
    1.42 +
    1.43 +Christoph Lameter <christoph@lameter.com>, October 31, 2004
    1.44 +