On Mon, 2005-12-05 at 18:21 -0800, Matt Helsley wrote:
> +static inline void get_timestamp(struct timespec *ts)
> +{
> + unsigned int seq;
> + struct timespec wall2mono;
> +
> + /* synchronize with settimeofday() changes */
> + do {
> + seq = read_seqbegin(&xtime_lock);
> + getnstimeofday(ts);
> + wall2mono = wall_to_monotonic;
> + } while(read_seqretry(&xtime_lock, seq));
> +
> + /* adjust to monotonicaly-increasing values */
> + ts += wall2mono.tv_sec;
> + ts += wall2mono.tv_nsec;
> + while ((ts->tv_nsec - NSEC_PER_SEC) >= 0) {
> + ts->tv_nsec -= NSEC_PER_SEC;
> + ts->tv_sec++;
> + }
> +}
This seems like something a bit too generic to have in your
drivers/connector/cn_proc.c file. Is there a generic timekeeping
function that should be used instead? Or, should this go into one of
the timekeeping files?
-- Dave
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[Index of Archives]
[Kernel Newbies]
[Netfilter]
[Bugtraq]
[Photo]
[Stuff]
[Gimp]
[Yosemite News]
[MIPS Linux]
[ARM Linux]
[Linux Security]
[Linux RAID]
[Video 4 Linux]
[Linux for the blind]
[Linux Resources]