Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 333875
b: refs/heads/master
c: 576094b
h: refs/heads/master
i:
  333873: bf5aeb0
  333871: e5ad334
v: v3
  • Loading branch information
John Stultz committed Sep 24, 2012
1 parent c4117c9 commit 562d227
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 21 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 706394211648117762edfaeffd6fc04bf3b1a75d
refs/heads/master: 576094b7f0aaf41aadab9b7d4e5bd85faa432711
36 changes: 29 additions & 7 deletions trunk/include/linux/timekeeper_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,16 +66,38 @@ struct timekeeper {
seqlock_t lock;
};

static inline struct timespec tk_xtime(struct timekeeper *tk)
{
struct timespec ts;

ts.tv_sec = tk->xtime_sec;
ts.tv_nsec = (long)(tk->xtime_nsec >> tk->shift);
return ts;
}


#ifdef CONFIG_GENERIC_TIME_VSYSCALL

extern void update_vsyscall(struct timekeeper *tk);
extern void update_vsyscall_tz(void);

#ifdef CONFIG_GENERIC_TIME_VSYSCALL_OLD
extern void
update_vsyscall_old(struct timespec *ts, struct timespec *wtm,
struct clocksource *c, u32 mult);
#elif defined(CONFIG_GENERIC_TIME_VSYSCALL_OLD)

extern void update_vsyscall_old(struct timespec *ts, struct timespec *wtm,
struct clocksource *c, u32 mult);
extern void update_vsyscall_tz(void);

static inline void update_vsyscall(struct timekeeper *tk)
{
struct timespec xt;

xt = tk_xtime(tk);
update_vsyscall_old(&xt, &tk->wall_to_monotonic, tk->clock, tk->mult);
}

#else
static inline void
update_vsyscall_old(struct timespec *ts, struct timespec *wtm,
struct clocksource *c, u32 mult)

static inline void update_vsyscall(struct timekeeper *tk)
{
}
static inline void update_vsyscall_tz(void)
Expand Down
4 changes: 4 additions & 0 deletions trunk/kernel/time/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ config CLOCKSOURCE_WATCHDOG
config ARCH_CLOCKSOURCE_DATA
bool

# Timekeeping vsyscall support
config GENERIC_TIME_VSYSCALL
bool

# Timekeeping vsyscall support
config GENERIC_TIME_VSYSCALL_OLD
bool
Expand Down
14 changes: 1 addition & 13 deletions trunk/kernel/time/timekeeping.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,6 @@ static inline void tk_normalize_xtime(struct timekeeper *tk)
}
}

static struct timespec tk_xtime(struct timekeeper *tk)
{
struct timespec ts;

ts.tv_sec = tk->xtime_sec;
ts.tv_nsec = (long)(tk->xtime_nsec >> tk->shift);
return ts;
}

static void tk_set_xtime(struct timekeeper *tk, const struct timespec *ts)
{
tk->xtime_sec = ts->tv_sec;
Expand Down Expand Up @@ -192,14 +183,11 @@ static inline s64 timekeeping_get_ns_raw(struct timekeeper *tk)
/* must hold write on timekeeper.lock */
static void timekeeping_update(struct timekeeper *tk, bool clearntp)
{
struct timespec xt;

if (clearntp) {
tk->ntp_error = 0;
ntp_clear();
}
xt = tk_xtime(tk);
update_vsyscall_old(&xt, &tk->wall_to_monotonic, tk->clock, tk->mult);
update_vsyscall(tk);
}

/**
Expand Down

0 comments on commit 562d227

Please sign in to comment.