Generic Timeofday Subsystem (v B7) (cumulative-i386)
Subsystems (6)
cover Generic Timeofday Subsystem (v B7) (cumulative-i386)
All,
Attached is the cumulative patch (for i386 only it does not include
x86-64 support, which is available as a separate patch to follow) for my generic timekeeping rework (v. B7). Individual broken out patches to follow. This patch provides the NTP changes, the timesource abstraction, the core timekeeping code as well as the code to convert the i386 arch and the i386 clocksources.
The biggest change here is the name changing from using "timesource" to "clocksource" for the hardware counter abstraction. This had been reccomended before, but I finally had enough people mention it that I figured I ought to just do it. Hopefully this will allow the terms to better map to related technical documentation.
With the exception of a few issues on the TODO list below, I'm feeling the core arch generic code is getting really solid, and I intend to focus on the arch specific bits and getting it into -mm soon. So please let me know if you have further concerns or issues especially with the arch generic bits.
New in this release: (most from suggestions by tglx)
o Cleaned up the fixed interval math code.
o Added better remainder accounting in the fixed interval math
o Further fast-path optimizations in periodic_hook()
o priority -> rating name change
o C code convention fixups
o Moved from array based to list based timesource management (from tglx)
o sysfs \n cleanup (from tglx)
Still on the TODO list:
o Optimize out the timesource_read switch statement
o Cleanup i386 arch specific bits
o Re-organize the clocksource drivers directory
This patch should apply against Linus' git tree from today.
I'd like to thank the following people who have contributed ideas, criticism, testing and code that has helped shape this work:
George Anzinger, Nish Aravamudan, Max Asbock, Dominik Brodowski, Thomas
Gleixner, Darren Hart, Christoph Lameter, Matt Mackal, Keith Mannthey, Ingo Molnar, Martin Schwidefsky, Frank Sorenson, Ulrich Windl, Darrick Wong, Roman Zippel and any others whom I've accidentally forgotten.
Please let me know if you have any comments or feedback.
thanks
-john
[RFC] Generic Timeofday Subsystem Simulator (v1)
All,
At Roman's prodding, and inspired by Dave Mills' simulator, I've
scratched out a pretty simple userspace simulator for my timeofday and NTP changes.
The project is attached. It is pretty simple right now and if you have any suggestions for changes, please let me know.
To use it:
1. Download my timeofday patches (or just the cumulative one) and apply them to a current git tree.
2. Untar the simulator.
3. Run ./generate.sh <path to patched kernel tree>
4. Run make
5. Run ./todsim <offset> <ppm skew>
Pretty easy. It will output a whole lot of data providing:
<simulator time> <kernel time> <hardware value> <offset> <ppm adj>
Its not terribly interesting at the moment, but hopefully folks can play with it and make suggestions for improvements to the simulator, timeofday code or the ntp changes.
thanks
-john
RFC PATCH 1/12 Reduced NTP rework (part 1)
In reply to john stultzAll,
With Roman's suggestions, I've been working on reducing the footprint
of my timeofday patches. This is the first of two patches that reworks some of the interrupt time NTP adjustments so that it could be re-used with the timeofday patches. The motivation of the change is to logically separate the code which adjusts xtime and the code that decides, based on the NTP state variables, how much per tick to adjust xtime.
Thus this patch should not affect the existing behaviour, but just separate the logical functionality so it can be re-used.
This patch applies ontop of my ntp-shift-right patch I posted awhile back (currently in -mm).
thanks
-john
timer.c | 88 ++++++++++++++++++++++++++++++++++++++++------------------------ 1 files changed, 55 insertions(+), 33 deletions(-)
linux-2.6.14-rc4_timeofday-ntp-part1_B7.patch
============================================
kernel/timer.c +55 -33
@@ -620,6 +620,7 @@ static long time_adj; /* tick adjust (long time_reftime;/* time at last adjustment (s) */ long time_adjust;long time_next_adjust; +long time_adjust_step;/* per tick time_adjust step */ /* * this routine handles the overflow of the microsecond field
@@ -742,46 +743,46 @@ static void second_overflow(void)#endif } -/* in the NTP reference this is called "hardclock()" */ -static void update_wall_time_one_tick (void ) + +static void ntp_advance (unsigned long interval_ns) { -long time_adjust_step, delta_nsec; +static unsigned long interval_sum; -if ( (time_adjust_step = time_adjust) !=0 ) { -/* We are doing an adjtime thing. -* -* Prepare time_adjust_step to be within bounds. -* Note that a positive time_adjust means we want the clock -* to run faster. -* -* Limit the amount of the step to be in the range -* -tickadj .. +tickadj -*/ - time_adjust_step =min (time_adjust_step, (long )tickadj); - time_adjust_step =max (time_adjust_step, (long )-tickadj); +/* increment the interval sum */ + interval_sum += interval_ns; -/* Reduce by this step the amount of time left */ - time_adjust -= time_adjust_step; - } - delta_nsec = tick_nsec + time_adjust_step *1000 ; -/* -* Advance the phase, once it gets to one microsecond, then -* advance the tick more. -*/ - time_phase += time_adj; -if ((time_phase >=FINENSEC ) || (time_phase <= -FINENSEC )) { -long ltemp =shift_right (time_phase, (SHIFT_SCALE -10 )); - time_phase -= ltemp << (SHIFT_SCALE -10 ); - delta_nsec += ltemp; +/* calculate the per tick singleshot adjtime adjustment step */ +while (interval_ns >= tick_nsec) { + time_adjust_step = time_adjust; +if (time_adjust_step) { +/* We are doing an adjtime thing. +* +* Prepare time_adjust_step to be within bounds. +* Note that a positive time_adjust means we want the clock +* to run faster. +* +* Limit the amount of the step to be in the range +* -tickadj .. +tickadj +*/ + time_adjust_step =min (time_adjust_step, (long )tickadj); + time_adjust_step =max (time_adjust_step, (long )-tickadj); + +/* Reduce by this step the amount of time left */ + time_adjust -= time_adjust_step; + } + interval_ns -= tick_nsec; } - xtime.tv_nsec += delta_nsec; -time_interpolator_update (delta_nsec);/* Changes by adjtime() do not take effect till next tick. */ -if (time_next_adjust !=0 ) { +if (time_next_adjust) { time_adjust = time_next_adjust; time_next_adjust =0 ; } + +while (interval_sum >NSEC_PER_SEC ) { + interval_sum -=NSEC_PER_SEC ; +second_overflow (); + } }/*
@@ -793,14 +794,35 @@ static void update_wall_time_one_tick(vo*/ static void update_wall_time (unsigned long ticks) { +long delta_nsec; +do { ticks--; -update_wall_time_one_tick (); + +/* Calculate the nsec delta using the +* precomputed NTP adjustments: +* tick_nsec, time_adjust_step, time_adj +*/ + delta_nsec = tick_nsec + time_adjust_step *1000 ; +/* +* Advance the phase, once it gets to one microsecond, then +* advance the tick more. +*/ + time_phase += time_adj; +if ((time_phase >=FINENSEC ) || (time_phase <= -FINENSEC )) { +long ltemp =shift_right (time_phase, (SHIFT_SCALE -10 )); + time_phase -= ltemp << (SHIFT_SCALE -10 ); + delta_nsec += ltemp; + } + + xtime.tv_nsec += delta_nsec;if (xtime.tv_nsec >=1000000000 ) { xtime.tv_nsec -=1000000000 ; xtime.tv_sec++; -second_overflow (); } +ntp_advance (tick_nsec); +time_interpolator_update (delta_nsec); + }while (ticks); }
RFC PATCH 2/12 Reduced NTP rework (part 2)
All,
Here is the second of two patches which try to minimize my ntp rework
patches.
This patch further changes the interrupt time NTP code, breaking out the leapsecond processing and introduces an accessor to a shifted ppm adjustment value. For correctness, I've also introduced a new lock, the ntp_lock, which protects the NTP state machine when accessing it from my timekeeping code (which does not use the xtime_lock).
Again, this patch should not affect the existing behavior, but just separate the logical functionality so it can be re-used by my timeofday patches.
thanks
-john
include/linux/timex.h | 24 ++++++ kernel/time.c | 25 ++++--- kernel/timer.c | 176 ++++++++++++++++++++++++++++++++++---------------- 3 files changed, 160 insertions(+), 65 deletions(-)
linux-2.6.14-rc4_timeofday-ntp-part2_B7.patch
============================================
include/linux/timex.h +24 -0
@@ -260,6 +260,7 @@ extern long pps_calcnt; /* calibrationextern long pps_errcnt;/* calibration errors */ extern long pps_stbcnt;/* stability limit exceeded */ +extern seqlock_t ntp_lock;/** * ntp_clear - Clears the NTP state variables *
@@ -267,10 +268,14 @@ extern long pps_stbcnt; /* stability li*/ static inline void ntp_clear (void ) { +unsigned long flags; +write_seqlock_irqsave (&ntp_lock, flags); time_adjust =0 ;/* stop active adjtime() */ time_status |=STA_UNSYNC ; time_maxerror =NTP_PHASE_LIMIT ; time_esterror =NTP_PHASE_LIMIT ; +write_sequnlock_irqrestore (&ntp_lock, flags); + }/**
@@ -282,6 +287,25 @@ static inline int ntp_synced(void)return !(time_status &STA_UNSYNC ); } +/** +* ntp_get_ppm_adjustment - Returns Shifted PPM adjustment +* +*/ +long ntp_get_ppm_adjustment (void ); + +/** +* ntp_advance - Advances the NTP state machine by interval_ns +* +*/ +void ntp_advance (unsigned long interval_ns); + +/** +* ntp_leapsecond - NTP leapsecond processing code. +* +*/ +int ntp_leapsecond (struct timespec now); + +/* Required to safely shift negative values */ #define shift_right (x, s) ({ \ __typeof__(x) __x = (x); \
kernel/time.c +15 -10
@@ -231,7 +231,9 @@ int do_adjtimex(struct timex *txc) {long ltemp, mtemp, save_adjust;int result; - +unsigned long flags; +struct timespec now_ts; +unsigned long seq;/* In order to modify anything, you gotta be super-user! */ if (txc->modes && !capable (CAP_SYS_TIME ))return -EPERM ;
@@ -254,7 +256,13 @@ int do_adjtimex(struct timex *txc) txc->tick > 1100000/USER_HZ)return -EINVAL ; -write_seqlock_irq (&xtime_lock); +do {/* save off current xtime */ + seq =read_seqbegin (&xtime_lock); + now_ts = xtime; + }while (read_seqretry (&xtime_lock, seq)); + +write_seqlock_irqsave (&ntp_lock, flags); + result = time_state;/* mostly `TIME_OK' */ /* Save for later - semantics of adjtime is to return old value */
@@ -331,9 +339,9 @@ int do_adjtimex(struct timex *txc)*/ if (time_status &STA_FREQHOLD || time_reftime ==0 ) - time_reftime = xtime.tv_sec; - mtemp = xtime.tv_sec - time_reftime; - time_reftime = xtime.tv_sec; + time_reftime = now_ts.tv_sec; + mtemp = now_ts.tv_sec - time_reftime; + time_reftime = now_ts.tv_sec;if (time_status &STA_FLL ) {if (mtemp >=MINSEC ) { ltemp = (time_offset / mtemp) << (SHIFT_USEC -
@@ -392,7 +400,7 @@ leave: if ((time_status & (STA_UNSYNC|ST txc->calcnt = pps_calcnt; txc->errcnt = pps_errcnt; txc->stbcnt = pps_stbcnt; -write_sequnlock_irq (&xtime_lock); +write_sequnlock_irqrestore (&ntp_lock, flags);do_gettimeofday (&txc->time);notify_arch_cmos_timer ();return (result);
@@ -509,10 +517,7 @@ int do_settimeofday (struct timespec *tvset_normalized_timespec (&xtime, sec, nsec);set_normalized_timespec (&wall_to_monotonic, wtm_sec, wtm_nsec); - time_adjust =0 ;/* stop active adjtime() */ - time_status |=STA_UNSYNC ; - time_maxerror =NTP_PHASE_LIMIT ; - time_esterror =NTP_PHASE_LIMIT ; +ntp_clear ();time_interpolator_reset (); }write_sequnlock_irq (&xtime_lock);
kernel/timer.c +121 -55
234 lines not on this page · raw message
RFC PATCH 3/12 clocksource management code
All,
This patch introduces the clocksource management infrastructure. A
clocksource is a driver-like architecture generic abstraction of a freerunning counter. This patch defines the clocksource structure, and provides management code for registering, selecting, accessing and scaling clocksources. The clocksource structure is influenced by the time_interpolator code, although I feel it has a cleaner interface and avoids preserving system state in the clocksource structure.
Additionally, this patch includes the trivial jiffies clocksource, a lowest common denominator clocksource, provided mainly for use as an example.
This patch applies ontop of my part 2 of my ntp changes.
Since this patch provides the groundwork for the generic timeofday core, it will not function without the generic timeofday patches to follow.
thanks
-john
Documentation/kernel-parameters.txt | 11 + drivers/Makefile | 1 drivers/clocksource/Makefile | 1 drivers/clocksource/jiffies.c | 74 +++++++++ include/linux/clocksource.h | 269 ++++++++++++++++++++++++++++++++++ kernel/clocksource.c | 279 ++++++++++++++++++++++++++++++++++++ 6 files changed, 632 insertions(+), 3 deletions(-)
linux-2.6.14-rc4_timeofday-clocksource-core_B7.patch
============================================
Documentation/kernel-parameters.txt +8 -3
@@ -52,6 +52,7 @@ restrictions referred to are that the re MTD MTD support is enabled. NET Appropriate network support is enabled. NUMA NUMA support is enabled. + GENERIC_TOD The generic timeofday code is enabled. NFS Appropriate NFS support is enabled. OSS OSS sound support is enabled. PARIDE The ParIDE subsystem is enabled.
@@ -323,9 +324,9 @@ running once the system is up. Default value is set via a kernel config option. Value can be changed at runtime via /selinux/checkreqprot. - clock= [BUGS=IA-32, HW] gettimeofday timesource override. - Forces specified timesource (if avaliable) to be used - when calculating gettimeofday(). If specicified timesource + clock= [BUGS=IA-32, HW] gettimeofday clocksource override. [Deprecated] + Forces specified clocksource (if avaliable) to be used + when calculating gettimeofday(). If specicified clocksource is not avalible, it defaults to PIT. Format: { pit | tsc | cyclone | pmtmr }
@@ -1462,6 +1463,10 @@ running once the system is up. time Show timing data prefixed to each printk message line + clocksource= [GENERIC_TOD] Override the default clocksource + Override the default clocksource and use the clocksource + with the name specified. + tipar.timeout= [HW,PPT] Set communications timeout in tenths of a second (default 15).
drivers/Makefile +1 -0
@@ -67,3 +67,4 @@ obj-$(CONFIG_INFINIBAND) += infiniband/ obj-$(CONFIG_SGI_IOC4) += sn/ obj-y += firmware/ obj-$(CONFIG_CRYPTO) += crypto/ +obj-$(CONFIG_GENERICTOD) += clocksource/
drivers/clocksource/Makefile new file +1 -0
@@ -0,0 +1 @@ +obj-y += jiffies.o
drivers/clocksource/jiffies.c new file +74 -0
74 lines not on this page · raw message
include/linux/clocksource.h new file +269 -0
269 lines not on this page · raw message
kernel/clocksource.c new file +279 -0
279 lines not on this page · raw message
RFC PATCH 4/12 generic timeofday core subsystem
All,
This patch implements my generic timeofday framework. This common infrastructure is intended to be used by any arch to reduce code duplication. Hopefully it will allow generic bugs to be fixed once. And with many architectures sharing the same time source, this allows drivers to be written once for multiple architectures.
One major change with this code is that it delineate the lines between the soft-timer subsystem and the time-of-day subsystem, allowing for a 1:1 mapping between a hardware clocksource counter and the time of day. This allows for lost ticks or other software delays to not affect timekeeping.
Included below is timeofday.c (which includes all the time of day management and accessor functions), and minimal hooks into arch independent code. This patch does not remove the current timekeeping code, allowing architectures to move over when they are ready.
This patch applies on top of my clocksource managment patch.
The patch does nothing without at least minimal architecture specific hooks (i386, x86-64 and other architecture examples to follow), and it should be able to be applied to a tree without affecting the existing code.
thanks
-john
drivers/char/hangcheck-timer.c | 5 include/asm-generic/timeofday.h | 29 ++ include/linux/time.h | 4 include/linux/timeofday.h | 90 ++++++ include/linux/timex.h | 2 init/main.c | 2 kernel/Makefile | 1 kernel/time.c | 40 ++ kernel/timeofday.c | 558 ++++++++++++++++++++++++++++++++++++++++ kernel/timer.c | 4 10 files changed, 735 insertions(+)
linux-2.6.14-rc4_timeofday-core_B7.patch
============================================
drivers/char/hangcheck-timer.c +5 -0
@@ -49,6 +49,7 @@#include <linux/delay.h> #include <asm/uaccess.h> #include <linux/sysrq.h> +#include <linux/timeofday.h> #define VERSION_STR "0.9.0"
@@ -130,8 +131,12 @@ __setup("hcheck_dump_tasks", hangcheck_p#endif #ifdef HAVE_MONOTONIC +#ifndef CONFIG_GENERICTOD extern unsigned long long monotonic_clock (void );#else +#define monotonic_clock () do_monotonic_clock() +#endif +#else static inline unsigned long long monotonic_clock (void ) {# ifdef __s390__
include/asm-generic/timeofday.h new file +29 -0
@@ -0,0 +1,29 @@ +/* linux/include/asm-generic/timeofday.h +* +* This file contains the asm-generic interface +* to the arch specific calls used by the time of day subsystem +*/ +#ifndef _ASM_GENERIC_TIMEOFDAY_H +#define _ASM_GENERIC_TIMEOFDAY_H +#include <linux/types.h> +#include <linux/time.h> +#include <linux/timex.h> +#include <linux/timeofday.h> +#include <linux/clocksource.h> + +#include <asm/div64.h> +#ifdef CONFIG_GENERICTOD +/* Required externs */ +extern nsec_t read_persistent_clock (void ); +extern void sync_persistent_clock (struct timespec ts); + +#ifdef CONFIG_GENERICTOD_VSYSCALL +extern void arch_update_vsyscall_gtod (struct timespec wall_time, +cycle_t offset_base,struct clocksource * clock, +int ntp_adj); +#else +#define arch_update_vsyscall_gtod (x,y,z,w) {} +#endif /* CONFIG_GENERICTOD_VSYSCALL */ + +#endif /* CONFIG_GENERICTOD */ +#endif
include/linux/time.h +4 -0
@@ -27,6 +27,10 @@ struct timezone {#ifdef __KERNEL__ +/* timeofday base types */ +typedef s64 nsec_t ; +typedef unsigned long cycle_t ; +/* Parameters used to convert the timespec values */ #define MSEC_PER_SEC (1000L)#define USEC_PER_SEC (1000000L)
include/linux/timeofday.h new file +90 -0
90 lines not on this page · raw message
include/linux/timex.h +2 -0
@@ -313,6 +313,7 @@ int ntp_leapsecond(struct timespec now); __x <0 ? -(-__x >> __s) : __x >> __s; \ }) +#ifndef CONFIG_GENERICTOD #ifdef CONFIG_TIME_INTERPOLATION
@@ -368,6 +369,7 @@ time_interpolator_reset(void) }#endif /* !CONFIG_TIME_INTERPOLATION */ +#endif /* !CONFIG_GENERICTOD */ #endif /* KERNEL */
init/main.c +2 -0
@@ -47,6 +47,7 @@#include <linux/rmap.h> #include <linux/mempolicy.h> #include <linux/key.h> +#include <linux/timeofday.h> #include <net/sock.h> #include <asm/io.h>
@@ -486,6 +487,7 @@ asmlinkage void __init start_kernel(voidpidhash_init ();init_timers ();softirq_init (); +timeofday_init ();time_init ();/*
kernel/Makefile +1 -0
@@ -9,6 +9,7 @@ obj-y = sched.o fork.o exec_domain.o rcupdate.o intermodule.o extable.o params.o posix-timers.o \ kthread.o wait.o kfifo.o sys_ni.o posix-cpu-timers.o +obj-$(CONFIG_GENERICTOD) += timeofday.o clocksource.o obj-$(CONFIG_FUTEX) += futex.o obj-$(CONFIG_GENERIC_ISA_DMA) += dma.o obj-$(CONFIG_SMP) += cpu.o spinlock.o
kernel/time.c +40 -0
@@ -38,6 +38,7 @@#include <asm/uaccess.h> #include <asm/unistd.h> +#include <linux/timeofday.h> /* * The timezone where the local system is located. Used as a default by some
@@ -128,6 +129,7 @@ asmlinkage long sys_gettimeofday(struct* as real UNIX machines always do it. This avoids all headaches about * daylight saving times and warping kernel clocks. */ +#ifndef CONFIG_GENERICTOD static inline void warp_clock (void ) {write_seqlock_irq (&xtime_lock);
@@ -137,6 +139,18 @@ static inline void warp_clock(void)write_sequnlock_irq (&xtime_lock); clock_was_set(); } +#else /* !CONFIG_GENERICTOD */ +/* XXX - this is somewhat cracked out and should +be checked [email protected] +*/ +static inline void warp_clock (void ) +{ +struct timespec ts; +getnstimeofday (&ts); + ts.tv_sec += sys_tz.tz_minuteswest *60 ; +do_settimeofday (&ts); +} +#endif /* !CONFIG_GENERICTOD */ /* * In case for some reason the CMOS clock has not already been running
@@ -481,6 +495,7 @@ struct timespec timespec_trunc(struct ti }EXPORT_SYMBOL (timespec_trunc); +#ifndef CONFIG_GENERICTOD #ifdef CONFIG_TIME_INTERPOLATION void getnstimeofday (struct timespec *tv) {
@@ -564,6 +579,31 @@ void getnstimeofday(struct timespec *tv) }#endif +/** +* do_monotonic_clock - Returns monotonically increasing nanoseconds +* +* Returns the monotonically increasing number of nanoseconds +* since the system booted. +*/ +nsec_t do_monotonic_clock (void ) +{ +struct timespec ts, mo; +unsigned int seq; + +do { + seq =read_seqbegin (&xtime_lock); +getnstimeofday (&ts); + mo = wall_to_monotonic; + }while (read_seqretry (&xtime_lock, seq)); + + ts.tv_sec += mo.tv_sec; + ts.tv_nsec += mo.tv_nsec; + +return ((u64 )ts.tv_sec *NSEC_PER_SEC ) + ts.tv_nsec; +} + +#endif /* !CONFIG_GENERICTOD */ +#if (BITS_PER_LONG <64 )u64 get_jiffies_64 (void ) {
kernel/timeofday.c new file +558 -0
558 lines not on this page · raw message
kernel/timer.c +4 -0
@@ -840,6 +840,7 @@ void ntp_advance(unsigned long interval_ } +#ifndef CONFIG_GENERICTOD /* * Using a loop looks inefficient, but "ticks" is * usually just one (we shouldn't be losing ticks,
@@ -891,6 +892,9 @@ static void update_wall_time(unsigned lo } while (ticks); } +#else /* !CONFIG_GENERICTOD */ +#define update_wall_time (x) +#endif /* !CONFIG_GENERICTOD */ /* * Called from the timer interrupt handler to charge one tick to the current
RFC PATCH 5/12 generic timeofday i386 arch specific changes, part 1
All,
The conversion of i386 to use the generic timeofday subsystem has been
split into 6 parts. This patch, the first of six, is just a simple cleanup for the i386 arch in preperation of moving the the generic timeofday infrastructure. It simply moves some code from timer_pit.c to i8259.c.
It applies on top of my timeofday-core patch. This patch is part the timeofday-arch-i386 patchset, so without the following parts it is not expected to compile (although just this one should).
thanks
-john
i8259.c | 40 ++++++++++++++++++++++++++++++++++++++++ time.c | 1 - timers/timer_pit.c | 13 ------------- 3 files changed, 40 insertions(+), 14 deletions(-)
linux-2.6.14-rc4_timeofday-arch-i386-part1_B7.patch
============================================
arch/i386/kernel/i8259.c +40 -0
@@ -23,6 +23,7 @@#include <asm/apic.h> #include <asm/arch_hooks.h> #include <asm/i8259.h> +#include <asm/i8253.h> #include <io_ports.h>
@@ -396,6 +397,45 @@ void __init init_ISA_irqs (void) } } +void setup_pit_timer (void ) +{ +unsigned long flags; + +spin_lock_irqsave (&i8253_lock, flags); +outb_p (0x34 ,PIT_MODE );/* binary, mode 2, LSB/MSB, ch 0 */ +udelay (10 ); +outb_p (LATCH &0xff ,PIT_CH0 );/* LSB */ +udelay (10 ); +outb (LATCH >>8 ,PIT_CH0 );/* MSB */ +spin_unlock_irqrestore (&i8253_lock, flags); +} + +static int timer_resume (struct sys_device *dev) +{ +setup_pit_timer (); +return 0 ; +} + +static struct sysdev_class timer_sysclass = { +set_kset_name ("timer_pit" ), + .resume = timer_resume, +}; + +static struct sys_device device_timer = { + .id =0 , + .cls = &timer_sysclass, +}; + +static int __init init_timer_sysfs (void ) +{ +int error =sysdev_class_register (&timer_sysclass); +if (!error) + error =sysdev_register (&device_timer); +return error; +} + +device_initcall (init_timer_sysfs); +void __init init_IRQ (void ) {int i;
arch/i386/kernel/time.c +0 -1
@@ -404,7 +404,6 @@ static int timer_resume(struct sys_devicif (is_hpet_enabled ())hpet_reenable ();#endif -setup_pit_timer (); sec =get_cmos_time () + clock_cmos_diff; sleep_length = (get_cmos_time () - sleep_start) *HZ ;write_seqlock_irqsave (&xtime_lock, flags);
arch/i386/kernel/timers/timer_pit.c +0 -13
@@ -161,16 +161,3 @@ struct init_timer_opts __initdata timer_ .init = init_pit, .opts = &timer_pit, }; - -void setup_pit_timer (void ) -{ -unsigned long flags; - -spin_lock_irqsave (&i8253_lock, flags); -outb_p (0x34 ,PIT_MODE );/* binary, mode 2, LSB/MSB, ch 0 */ -udelay (10 ); -outb_p (LATCH &0xff ,PIT_CH0 );/* LSB */ -udelay (10 ); -outb (LATCH >>8 ,PIT_CH0 );/* MSB */ -spin_unlock_irqrestore (&i8253_lock, flags); -}
RFC PATCH 6/12 generic timeofday i386 arch specific changes, part 2
All,
The conversion of i386 to use the generic timeofday subsystem has been
split into 6 parts. This patch, the second of six, is a cleanup patch for the i386 arch in preparation of moving the the generic timeofday infrastructure. It moves some code from timer_tsc.c to a new tsc.c file.
It applies on top of my timeofday-arch-i386-part1 patch. This patch is part the timeofday-arch-i386 patchset, so without the following parts it is not expected to compile.
thanks
-john
arch/i386/kernel/Makefile | 2 arch/i386/kernel/timers/common.c | 84 ---------- arch/i386/kernel/timers/timer_tsc.c | 207 ------------------------- arch/i386/kernel/tsc.c | 298 ++++++++++++++++++++++++++++++++++++ include/asm-i386/timex.h | 34 ---- include/asm-i386/tsc.h | 44 +++++ 6 files changed, 344 insertions(+), 325 deletions(-)
linux-2.6.14-rc4_timeofday-arch-i386-part2_B7.patch
============================================
arch/i386/kernel/Makefile +1 -1
@@ -7,7 +7,7 @@ extra-y := head.o init_task.o vmlinux.ld obj-y := process.o semaphore.o signal.o entry.o traps.o irq.o vm86.o \ ptrace.o time.o ioport.o ldt.o setup.o i8259.o sys_i386.o \ pci-dma.o i386_ksyms.o i387.o dmi_scan.o bootflag.o \ - doublefault.o quirks.o i8237.o + doublefault.o quirks.o i8237.o tsc.o obj-y += cpu/ obj-y += timers/
arch/i386/kernel/timers/common.c +0 -84
93 lines not on this page · raw message
arch/i386/kernel/timers/timer_tsc.c +0 -207
237 lines not on this page · raw message
arch/i386/kernel/tsc.c new file +298 -0
298 lines not on this page · raw message
include/asm-i386/timex.h +1 -33
@@ -8,6 +8,7 @@#include <linux/config.h> #include <asm/processor.h> +#include <asm/tsc.h> #ifdef CONFIG_X86_ELAN # define CLOCK_TICK_RATE 1189200/* AMD Elan has different frequency! */
@@ -16,39 +17,6 @@#endif -/* -* Standard way to access the cycle counter on i586+ CPUs. -* Currently only used on SMP. -* -* If you really have a SMP machine with i486 chips or older, -* compile for that, and this will just always return zero. -* That's ok, it just means that the nicer scheduling heuristics -* won't work for you. -* -* We only use the low 32 bits, and we'd simply better make sure -* that we reschedule before that wraps. Scheduling at least every -* four billion cycles just basically sounds like a good idea, -* regardless of how fast the machine is. -*/ -typedef unsigned long long cycles_t ; - -static inline cycles_t get_cycles (void ) -{ -unsigned long long ret=0 ; - -#ifndef CONFIG_X86_TSC -if (!cpu_has_tsc) -return 0 ; -#endif - -#if defined(CONFIG_X86_GENERIC ) || defined(CONFIG_X86_TSC ) -rdtscll (ret); -#endif -return ret; -} - -extern unsigned int cpu_khz; -extern int read_current_timer (unsigned long *timer_value);#define ARCH_HAS_READ_CURRENT_TIMER 1
include/asm-i386/tsc.h new file +44 -0
44 lines not on this page · raw message
RFC PATCH 7/12 generic timeofday i386 arch specific changes, part 3
All,
The conversion of i386 to use the generic timeofday subsystem has been
split into 6 parts. This patch, the third of six, reworks some of the code in the new tsc.c file, adding some new interfaces and hooks to use these new interfaces appropriately.
It applies on top of my timeofday-arch-i386-part2 patch. This patch is part the timeofday-arch-i386 patchset, so without the following parts it is not expected to compile.
thanks
-john
arch/i386/kernel/setup.c | 1 arch/i386/kernel/tsc.c | 192 ++++++++++++++-------------- drivers/acpi/processor_idle.c | 6 include/asm-i386/mach-default/mach_timer.h | 4 include/asm-i386/mach-summit/mach_mpparse.h | 2 include/asm-i386/tsc.h | 6 6 files changed, 118 insertions(+), 93 deletions(-)
linux-2.6.14-rc4_timeofday-arch-i386-part3_B7.patch
============================================
arch/i386/kernel/setup.c +1 -0
@@ -1612,6 +1612,7 @@ void __init setup_arch(char **cmdline_p) conswitchp = &dummy_con;#endif #endif +tsc_init (); }#include "setup_arch_post.h"
arch/i386/kernel/tsc.c +100 -92
299 lines not on this page · raw message
drivers/acpi/processor_idle.c +6 -0
@@ -166,6 +166,7 @@ acpi_processor_power_activate(struct acpreturn ; } +extern void tsc_c3_compensate (unsigned long usecs);static atomic_t c3_cpu_count;static void acpi_processor_idle (void )
@@ -334,6 +335,11 @@ static void acpi_processor_idle(void) ACPI_MTX_DO_NOT_LOCK); } +#ifdef CONFIG_GENERICTOD +/* compensate for TSC pause */ +tsc_c3_compensate ((((t2-t1)&0xFFFFFF )*286 )>>10 ); +#endif +/* Re-enable interrupts */ local_irq_enable ();/* Compute time (ticks) that we were actually asleep */
include/asm-i386/mach-default/mach_timer.h +3 -1
@@ -15,7 +15,9 @@#ifndef _MACH_TIMER_H#define _MACH_TIMER_H -#define CALIBRATE_LATCH (5 * LATCH) +#define CALIBRATE_TIME_MSEC 30/* 30 msecs */ +#define CALIBRATE_LATCH \ + ((CLOCK_TICK_RATE * CALIBRATE_TIME_MSEC + 1000/2)/1000)static inline void mach_prepare_counter (void ) {
include/asm-i386/mach-summit/mach_mpparse.h +2 -0
@@ -30,6 +30,7 @@ static inline int mps_oem_check(struct m (!strncmp(productid, "VIGIL SMP", 9) || !strncmp(productid, "EXA", 3) || !strncmp(productid, "RUTHLESS SMP", 12))){ +mark_tsc_unstable (); use_cyclone =1 ;/*enable cyclone-timer*/ setup_summit (); usb_early_handoff =1 ;
@@ -44,6 +45,7 @@ static inline int acpi_madt_oem_check(chif (!strncmp (oem_id,"IBM" ,3 ) && (!strncmp (oem_table_id,"SERVIGIL" ,8 ) || !strncmp (oem_table_id,"EXA" ,3 ))){ +mark_tsc_unstable (); use_cyclone =1 ;/*enable cyclone-timer*/ setup_summit (); usb_early_handoff =1 ;
include/asm-i386/tsc.h +6 -0
@@ -41,4 +41,10 @@ static inline cycles_t get_cycles (void) }extern unsigned int cpu_khz; +extern unsigned int tsc_khz; +extern void tsc_init (void ); +void tsc_c3_compensate (unsigned long usecs); +u64 tsc_read_c3_time (void ); +extern int check_tsc_unstable (void ); +extern void mark_tsc_unstable (void );#endif
RFC PATCH 8/12 generic timeofday i386 arch specific changes, part 4
All,
The conversion of i386 to use the generic timeofday subsystem has been
split into 6 parts. This patch, the fourth of six, renames some ACPI PM variables.
It applies on top of my timeofday-arch-i386-part3 patch. This patch is part the timeofday-arch-i386 patchset, so without the following parts it is not expected to compile.
thanks
-john
boot.c | 14 ++++++++------ 1 files changed, 8 insertions(+), 6 deletions(-)
linux-2.6.14-rc4_timeofday-arch-i386-part4_B7.patch
============================================
arch/i386/kernel/acpi/boot.c +8 -6
@@ -612,7 +612,8 @@ static int __init acpi_parse_hpet(unsign#endif #ifdef CONFIG_X86_PM_TIMER -extern u32 pmtmr_ioport; +u32 acpi_pmtmr_ioport; +int acpi_pmtmr_buggy;#endif static int __init acpi_parse_fadt (unsigned long phys,unsigned long size)
@@ -640,14 +641,15 @@ static int __init acpi_parse_fadt(unsign ACPI_ADR_SPACE_SYSTEM_IO)return 0 ; - pmtmr_ioport = fadt->xpm_tmr_blk.address; + acpi_pmtmr_ioport = fadt->xpm_tmr_blk.address; }else {/* FADT rev. 1 */ - pmtmr_ioport = fadt->V1_pm_tmr_blk; + acpi_pmtmr_ioport = fadt->V1_pm_tmr_blk; } -if (pmtmr_ioport) - printk(KERN_INFO PREFIX "PM-Timer IO Port: %#x\n", - pmtmr_ioport); + +if (acpi_pmtmr_ioport) + printk(KERN_INFO PREFIX "PM-Timer IO Port: %#x\n", acpi_pmtmr_ioport); +#endif return 0 ; }
RFC PATCH 9/12 generic timeofday i386 arch specific changes, part 5
All,
The conversion of i386 to use the generic timeofday subsystem has been
split into 6 parts. This patch, the fifth of six, converts the i386 arch to use the generic timeofday subsystem.
It applies on top of my timeofday-arch-i386-part4 patch. This patch is the last in the the timeofday-arch-i386 patchset, so you should be able to build and boot a kernel after it has been applied.
Note that this patch does not provide any i386 clocksource, so you will only have the jiffies clocksource. To get full replacements for the code being removed here, the following timeofday-clocks-i386 patch will need to be applied.
thanks
-john
arch/i386/Kconfig | 4 arch/i386/kernel/Makefile | 1 arch/i386/kernel/time.c | 219 ++++++------------------------------------- arch/i386/lib/delay.c | 16 ++- include/asm-i386/timeofday.h | 4 include/asm-i386/timer.h | 57 ----------- 6 files changed, 55 insertions(+), 246 deletions(-)
linux-2.6.14-rc4_timeofday-arch-i386-part5_B7.patch
============================================
arch/i386/Kconfig +4 -0
@@ -14,6 +14,10 @@ config X86 486, 586, Pentiums, and various instruction-set-compatible chips by AMD, Cyrix, and others. +config GENERICTOD + bool + default y + config SEMAPHORE_SLEEPERS bool default y
arch/i386/kernel/Makefile +0 -1
@@ -10,7 +10,6 @@ obj-y := process.o semaphore.o signal.o doublefault.o quirks.o i8237.o tsc.o obj-y += cpu/ -obj-y += timers/ obj-$(CONFIG_ACPI) += acpi/ obj-$(CONFIG_X86_BIOS_REBOOT) += reboot.o obj-$(CONFIG_MCA) += mca.o
arch/i386/kernel/time.c +34 -185
321 lines not on this page · raw message
arch/i386/lib/delay.c +13 -3
@@ -13,6 +13,7 @@#include <linux/config.h> #include <linux/sched.h> #include <linux/delay.h> +#include <linux/timeofday.h> #include <linux/module.h> #include <asm/processor.h> #include <asm/delay.h>
@@ -22,11 +23,20 @@#include <asm/smp.h> #endif -extern struct timer_opts * timer; - +/* XXX - For now just use a simple loop delay +* This has cpufreq issues, but so did the old method. +*/ void __delay (unsigned long loops) { - cur_timer->delay (loops); +int d0; + __asm__ __volatile__( +"\tjmp 1f\n" +".align 16\n" +"1:\tjmp 2f\n" +".align 16\n" +"2:\tdecl %0\n\tjns 2b" + :"=&a" (d0) + :"0" (loops)); }inline void __const_udelay (unsigned long xloops)
include/asm-i386/timeofday.h new file +4 -0
@@ -0,0 +1,4 @@ +#ifndef _ASM_I386_TIMEOFDAY_H +#define _ASM_I386_TIMEOFDAY_H +#include <asm-generic/timeofday.h> +#endif
include/asm-i386/timer.h +0 -57
68 lines not on this page · raw message
RFC PATCH 10/12 generic timeofday i386 arch specific changes, part 6
All,
The conversion of i386 to use the generic timeofday subsystem has been
split into 6 parts. This patch, the final of four, removes the old timers/timer_opts infrastructure.
It applies on top of my timeofday-arch-i386-part5 patch. This patch is the last in the the timeofday-arch-i386 patchset, so you should be able to build and boot a kernel after it has been applied.
Note that this patch does not provide any i386 clocksources, so you will only have the jiffies clocksource. To get full replacements for the code being removed here, the following timeofday-clocks-i386 patch will need to be applied.
thanks
-john
Makefile | 9 - common.c | 88 ------------ timer.c | 75 ---------- timer_cyclone.c | 259 ------------------------------------- timer_hpet.c | 212 ------------------------------ timer_none.c | 39 ----- timer_pit.c | 163 ----------------------- timer_pm.c | 268 -------------------------------------- timer_tsc.c | 388 -------------------------------------------------------- 9 files changed, 1501 deletions(-)
linux-2.6.14-rc4_timeofday-arch-i386-part6_B7.patch
============================================
arch/i386/kernel/timers/Makefile deleted +0 -9
@@ -1,9 +0,0 @@ -# -# Makefile for x86 timers -# - -obj-y := timer.o timer_none.o timer_tsc.o timer_pit.o common.o - -obj-$(CONFIG_X86_CYCLONE_TIMER) += timer_cyclone.o -obj-$(CONFIG_HPET_TIMER) += timer_hpet.o -obj-$(CONFIG_X86_PM_TIMER) += timer_pm.o
arch/i386/kernel/timers/common.c deleted +0 -88
88 lines not on this page · raw message
arch/i386/kernel/timers/timer.c deleted +0 -75
75 lines not on this page · raw message
arch/i386/kernel/timers/timer_cyclone.c deleted +0 -259
259 lines not on this page · raw message
arch/i386/kernel/timers/timer_hpet.c deleted +0 -212
212 lines not on this page · raw message
arch/i386/kernel/timers/timer_none.c deleted +0 -39
@@ -1,39 +0,0 @@ -#include <linux/init.h> -#include <asm/timer.h> - -static void mark_offset_none (void ) -{ -/* nothing needed */ -} - -static unsigned long get_offset_none (void ) -{ -return 0 ; -} - -static unsigned long long monotonic_clock_none (void ) -{ -return 0 ; -} - -static void delay_none (unsigned long loops) -{ -int d0; - __asm__ __volatile__( -"\tjmp 1f\n" -".align 16\n" -"1:\tjmp 2f\n" -".align 16\n" -"2:\tdecl %0\n\tjns 2b" - :"=&a" (d0) - :"0" (loops)); -} - -/* none timer_opts struct */ -struct timer_opts timer_none = { - .name ="none" , - .mark_offset = mark_offset_none, - .get_offset = get_offset_none, - .monotonic_clock = monotonic_clock_none, - .delay = delay_none, -};
arch/i386/kernel/timers/timer_pit.c deleted +0 -163
163 lines not on this page · raw message
arch/i386/kernel/timers/timer_pm.c deleted +0 -268
268 lines not on this page · raw message
arch/i386/kernel/timers/timer_tsc.c deleted +0 -388
388 lines not on this page · raw message
RFC PATCH 11/12 generic timeofday i386/x86-64 specific clocksources
All,
This patch implements the time sources shared between i386 and x86-64
(acpi_pm, cyclone, hpet, pit, tsc and tsc-interp). The patch should apply on top of the timeofday-arch-i386-part6 patch.
The patch should be fairly straight forward, only adding the new
clocksources.
thanks
-john
Makefile | 7 ++ acpi_pm.c | 152 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ cyclone.c | 138 +++++++++++++++++++++++++++++++++++++++++++++++++++++ hpet.c | 59 ++++++++++++++++++++++ i386_pit.c | 63 ++++++++++++++++++++++++ tsc-interp.c | 112 +++++++++++++++++++++++++++++++++++++++++++ tsc.c | 79 ++++++++++++++++++++++++++++++ 7 files changed, 610 insertions(+)
linux-2.6.14-rc4_timeofday-clocks-i386_B7.patch
============================================
drivers/clocksource/Makefile +7 -0
@@ -1 +1,8 @@ obj-y += jiffies.o + +obj-$(CONFIG_X86) += tsc.o +obj-$(CONFIG_X86) += i386_pit.o +#XXX doesn't boot! obj-$(CONFIG_X86) += tsc-interp.o +obj-$(CONFIG_X86_CYCLONE_TIMER) += cyclone.o +obj-$(CONFIG_X86_PM_TIMER) += acpi_pm.o +obj-$(CONFIG_HPET_TIMER) += hpet.o
drivers/clocksource/acpi_pm.c new file +152 -0
152 lines not on this page · raw message
drivers/clocksource/cyclone.c new file +138 -0
138 lines not on this page · raw message
drivers/clocksource/hpet.c new file +59 -0
59 lines not on this page · raw message
drivers/clocksource/i386_pit.c new file +63 -0
63 lines not on this page · raw message
drivers/clocksource/tsc-interp.c new file +112 -0
112 lines not on this page · raw message
drivers/clocksource/tsc.c new file +79 -0
79 lines not on this page · raw message
RFC PATCH 12/12 generic timeofday x86-64 arch specific changes
All,
This patch converts the x86-64 arch to use the generic timeofday
infrastructure. It applies ontop of my timeofday-core patch (or ontop of my i386 cumulative patch). This is a full conversion, so most of this patch is subtractions removing the existing arch specific time keeping code. This patch does not provide any x86-64 clocksourcs, so using this patch alone on top of the timeofday-core patch will only give you the jiffies clocksource. To get full replacements for the code being removed here, the following timeofday-clocks-i386 patch (x86-64 shares the same clocksources as i386) will need to be applied as well.
thanks
-john
arch/x86_64/kernel/pmtimer.c | 101 ---------- b/arch/i386/kernel/acpi/boot.c | 9 b/arch/x86_64/Kconfig | 8 b/arch/x86_64/kernel/Makefile | 1 b/arch/x86_64/kernel/time.c | 365 ++++--------------------------------- b/arch/x86_64/kernel/vmlinux.lds.S | 7 b/arch/x86_64/kernel/vsyscall.c | 133 ++++++++++--- b/include/asm-generic/div64.h | 9 b/include/asm-x86_64/hpet.h | 3 b/include/asm-x86_64/timeofday.h | 4 b/include/asm-x86_64/timex.h | 4 b/include/asm-x86_64/vsyscall.h | 2 12 files changed, 194 insertions(+), 452 deletions(-)
linux-2.6.14-rc4_timeofday-arch-x86-64_B7.patch
============================================
arch/i386/kernel/acpi/boot.c +5 -4
@@ -570,7 +570,7 @@ static int __init acpi_parse_sbf(unsigne }#ifdef CONFIG_HPET_TIMER - +#include <asm/hpet.h> static int __init acpi_parse_hpet (unsigned long phys,unsigned long size) {struct acpi_table_hpet *hpet_tbl;
@@ -592,6 +592,7 @@ static int __init acpi_parse_hpet(unsign#ifdef CONFIG_X86_64 vxtime.hpet_address = hpet_tbl->addr.addrl | ((long )hpet_tbl->addr.addrh <<32 ); + hpet_address = vxtime.hpet_address; printk(KERN_INFO PREFIX "HPET id: %#x base: %#lx\n", hpet_tbl->id, vxtime.hpet_address);
@@ -600,10 +601,10 @@ static int __init acpi_parse_hpet(unsignextern unsigned long hpet_address; hpet_address = hpet_tbl->addr.addrl; - printk(KERN_INFO PREFIX "HPET id: %#x base: %#lx\n", - hpet_tbl->id, hpet_address); } -#endif /* X86 */ +#endif /* X86 */ + printk(KERN_INFO PREFIX "HPET id: %#x base: %#lx\n", + hpet_tbl->id, hpet_address);return 0 ; }
arch/x86_64/Kconfig +8 -0
@@ -24,6 +24,14 @@ config X86 bool default y +config GENERICTOD + bool + default y + +config GENERICTOD_VSYSCALL + bool + default y + config SEMAPHORE_SLEEPERS bool default y
arch/x86_64/kernel/Makefile +0 -1
@@ -29,7 +29,6 @@ obj-$(CONFIG_GART_IOMMU) += pci-gart.o a obj-$(CONFIG_DUMMY_IOMMU) += pci-nommu.o pci-dma.o obj-$(CONFIG_SWIOTLB) += swiotlb.o obj-$(CONFIG_KPROBES) += kprobes.o -obj-$(CONFIG_X86_PM_TIMER) += pmtimer.o obj-$(CONFIG_MODULES) += module.o
arch/x86_64/kernel/pmtimer.c deleted +0 -101
101 lines not on this page · raw message
arch/x86_64/kernel/time.c +48 -317
469 lines not on this page · raw message
arch/x86_64/kernel/vmlinux.lds.S +7 -0
@@ -99,6 +99,13 @@ SECTIONS .jiffies : AT(VLOAD(.jiffies)) { *(.jiffies) } jiffies = VVIRT(.jiffies); + .vsyscall_gtod_data : AT(VLOAD(.vsyscall_gtod_data)) { *(.vsyscall_gtod_data) } + vsyscall_gtod_data = VVIRT(.vsyscall_gtod_data); + + .vsyscall_gtod_lock : AT(VLOAD(.vsyscall_gtod_lock)) { *(.vsyscall_gtod_lock) } + vsyscall_gtod_lock = VVIRT(.vsyscall_gtod_lock); + + .vsyscall_1 ADDR(.vsyscall_0) + 1024: AT(VLOAD(.vsyscall_1)) { *(.vsyscall_1) } .vsyscall_2 ADDR(.vsyscall_0) + 2048: AT(VLOAD(.vsyscall_2)) { *(.vsyscall_2) } .vsyscall_3 ADDR(.vsyscall_0) + 3072: AT(VLOAD(.vsyscall_3)) { *(.vsyscall_3) }
arch/x86_64/kernel/vsyscall.c +105 -28
180 lines not on this page · raw message
include/asm-generic/div64.h +9 -0
@@ -55,4 +55,13 @@ extern uint32_t __div64_32(uint64_t *div#endif /* BITS_PER_LONG */ +#ifndef div_long_long_rem +#define div_long_long_rem (dividend,divisor,remainder) \ +({ \ + u64 result = dividend; \ + *remainder = do_div(result,divisor); \ + result; \ +}) +#endif +#endif /* _ASM_GENERIC_DIV64_H */
include/asm-x86_64/hpet.h +2 -1
@@ -1,6 +1,6 @@#ifndef _ASM_X8664_HPET_H#define _ASM_X8664_HPET_H 1 - +#include <asm/fixmap.h> /* * Documentation on HPET can be found at: * http://www.intel.com/ial/home/sp/pcmmspec.htm
@@ -44,6 +44,7 @@#define HPET_TN_SETVAL 0x040#define HPET_TN_32BIT 0x100 +extern unsigned long hpet_address;/* hpet memory map physical address */ extern int is_hpet_enabled (void );extern int hpet_rtc_timer_init (void );extern int oem_force_hpet_timer (void );
include/asm-x86_64/timeofday.h new file +4 -0
@@ -0,0 +1,4 @@ +#ifndef _ASM_X86_64_TIMEOFDAY_H +#define _ASM_X86_64_TIMEOFDAY_H +#include <asm-generic/timeofday.h> +#endif
include/asm-x86_64/timex.h +4 -0
@@ -24,6 +24,10 @@ static inline cycles_t get_cycles (void) }extern unsigned int cpu_khz; +extern unsigned int tsc_khz; +extern int check_tsc_unstable (void ); +extern void tsc_c3_compensate (unsigned long usecs); +extern u64 tsc_read_c3_time (void );extern int read_current_timer (unsigned long *timer_value);#define ARCH_HAS_READ_CURRENT_TIMER 1
include/asm-x86_64/vsyscall.h +2 -0
@@ -22,6 +22,8 @@ enum vsyscall_num {#define __section_sysctl_vsyscall __attribute__ ((unused, __section__ (".sysctl_vsyscall"), aligned(16)))#define __section_xtime __attribute__ ((unused, __section__ (".xtime"), aligned(16)))#define __section_xtime_lock __attribute__ ((unused, __section__ (".xtime_lock"), aligned(16))) +#define __section_vsyscall_gtod_data __attribute__ ((unused, __section__ (".vsyscall_gtod_data"),aligned(16))) +#define __section_vsyscall_gtod_lock __attribute__ ((unused, __section__ (".vsyscall_gtod_lock"),aligned(16)))#define VXTIME_TSC 1#define VXTIME_HPET 2
Quoted 1 line · john stultz
<excellent patchset>
Three cheers for John Stultz for plugging at this as long as he has! Despite the ugly code, the many requested changes and revisions, etc, he's made awesome progress. These are sorely needed changes and we should thank John (and all the rest of the participants) for their time on this particular project. Hurrah to you sirs!
Cheers,
Kyle Moffett
--
Somone asked me why I work on this free (http://www.fsf.org/philosophy/) software stuff and not get a real job. Charles Shultz had the best answer:
"Why do musicians compose symphonies and poets write poems? They do it because life wouldn't have any meaning for them if they didn't. That's why I draw cartoons. It's my life."
-- Charles Shultz