X-Git-Url: http://pilppa.org/gitweb/?a=blobdiff_plain;f=include%2Flinux%2Ftime.h;h=d32ef0ad4c0aaf8964d94abe215c5dbf4dde8aaf;hb=29e92f483603d97dd1d2bafcb32101287dfac4ad;hp=b04136d60a2f79c5293ddc641e664afa18820ee0;hpb=0b776eb5426752d4e53354ac89e3710d857e09a7;p=linux-2.6-omap-h63xx.git diff --git a/include/linux/time.h b/include/linux/time.h index b04136d60a2..d32ef0ad4c0 100644 --- a/include/linux/time.h +++ b/include/linux/time.h @@ -120,8 +120,9 @@ extern void getboottime(struct timespec *ts); extern void monotonic_to_bootbased(struct timespec *ts); extern struct timespec timespec_trunc(struct timespec t, unsigned gran); -extern int timekeeping_is_continuous(void); +extern int timekeeping_valid_for_hres(void); extern void update_wall_time(void); +extern void update_xtime_cache(u64 nsec); /** * timespec_to_ns - Convert timespec to nanoseconds @@ -173,6 +174,10 @@ static inline void timespec_add_ns(struct timespec *a, u64 ns) { ns += a->tv_nsec; while(unlikely(ns >= NSEC_PER_SEC)) { + /* The following asm() prevents the compiler from + * optimising this loop into a modulo operation. */ + asm("" : "+r"(ns)); + ns -= NSEC_PER_SEC; a->tv_sec++; }