Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 95650
b: refs/heads/master
c: 153b5d0
h: refs/heads/master
v: v3
  • Loading branch information
Roman Zippel authored and Linus Torvalds committed May 1, 2008
1 parent 36657b2 commit c5e3c46
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 4 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: 9f14f669d18477fe3df071e2fa4da36c00acee8e
refs/heads/master: 153b5d054ac2d98ea0d86504884326b6777f683d
3 changes: 2 additions & 1 deletion trunk/include/linux/compat.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,10 +65,11 @@ struct compat_timex {
compat_long_t calcnt;
compat_long_t errcnt;
compat_long_t stbcnt;
compat_int_t tai;

compat_int_t :32; compat_int_t :32; compat_int_t :32; compat_int_t :32;
compat_int_t :32; compat_int_t :32; compat_int_t :32; compat_int_t :32;
compat_int_t :32; compat_int_t :32; compat_int_t :32; compat_int_t :32;
compat_int_t :32; compat_int_t :32; compat_int_t :32;
};

#define _COMPAT_NSIG_WORDS (_COMPAT_NSIG / _COMPAT_NSIG_BPW)
Expand Down
5 changes: 4 additions & 1 deletion trunk/include/linux/timex.h
Original file line number Diff line number Diff line change
Expand Up @@ -121,9 +121,11 @@ struct timex {
long errcnt; /* calibration errors (ro) */
long stbcnt; /* stability limit exceeded (ro) */

int tai; /* TAI offset (ro) */

int :32; int :32; int :32; int :32;
int :32; int :32; int :32; int :32;
int :32; int :32; int :32; int :32;
int :32; int :32; int :32;
};

/*
Expand All @@ -135,6 +137,7 @@ struct timex {
#define ADJ_ESTERROR 0x0008 /* estimated time error */
#define ADJ_STATUS 0x0010 /* clock status */
#define ADJ_TIMECONST 0x0020 /* pll time constant */
#define ADJ_TAI 0x0080 /* set TAI offset */
#define ADJ_MICRO 0x1000 /* select microsecond resolution */
#define ADJ_NANO 0x2000 /* select nanosecond resolution */
#define ADJ_TICK 0x4000 /* tick value */
Expand Down
3 changes: 2 additions & 1 deletion trunk/kernel/compat.c
Original file line number Diff line number Diff line change
Expand Up @@ -955,7 +955,8 @@ asmlinkage long compat_sys_adjtimex(struct compat_timex __user *utp)
__put_user(txc.jitcnt, &utp->jitcnt) ||
__put_user(txc.calcnt, &utp->calcnt) ||
__put_user(txc.errcnt, &utp->errcnt) ||
__put_user(txc.stbcnt, &utp->stbcnt))
__put_user(txc.stbcnt, &utp->stbcnt) ||
__put_user(txc.tai, &utp->tai))
ret = -EFAULT;

return ret;
Expand Down
7 changes: 7 additions & 0 deletions trunk/kernel/time/ntp.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ static u64 tick_length, tick_length_base;
/* TIME_ERROR prevents overwriting the CMOS clock */
static int time_state = TIME_OK; /* clock synchronization status */
int time_status = STA_UNSYNC; /* clock status bits */
static long time_tai; /* TAI offset (s) */
static s64 time_offset; /* time adjustment (ns) */
static long time_constant = 2; /* pll time constant */
long time_maxerror = NTP_PHASE_LIMIT; /* maximum error (us) */
Expand Down Expand Up @@ -162,13 +163,15 @@ void second_overflow(void)
case TIME_DEL:
if ((xtime.tv_sec + 1) % 86400 == 0) {
xtime.tv_sec++;
time_tai--;
wall_to_monotonic.tv_sec--;
time_state = TIME_WAIT;
printk(KERN_NOTICE "Clock: deleting leap second "
"23:59:59 UTC\n");
}
break;
case TIME_OOP:
time_tai++;
time_state = TIME_WAIT;
break;
case TIME_WAIT:
Expand Down Expand Up @@ -340,6 +343,9 @@ int do_adjtimex(struct timex *txc)
time_constant = max(time_constant, 0l);
}

if (txc->modes & ADJ_TAI && txc->constant > 0)
time_tai = txc->constant;

if (txc->modes & ADJ_OFFSET) {
if (txc->modes == ADJ_OFFSET_SINGLESHOT)
/* adjtime() is independent from ntp_adjtime() */
Expand Down Expand Up @@ -377,6 +383,7 @@ int do_adjtimex(struct timex *txc)
txc->precision = 1;
txc->tolerance = MAXFREQ_SCALED / PPM_SCALE;
txc->tick = tick_usec;
txc->tai = time_tai;

/* PPS is not implemented, so these are zero */
txc->ppsfreq = 0;
Expand Down

0 comments on commit c5e3c46

Please sign in to comment.