From fc4dd33f8d49666c18cd2204f3d952bc9e800b99 Mon Sep 17 00:00:00 2001 From: John Stultz Date: Mon, 26 Nov 2007 20:42:19 +0100 Subject: [PATCH] --- yaml --- r: 74158 b: refs/heads/master c: 52bfb36050c8529d9031d2c2513b281a360922ec h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/include/linux/timex.h | 1 + trunk/kernel/time/ntp.c | 9 ++++++--- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/[refs] b/[refs] index ade6a625ca3f..b5126c065bc7 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 8232fd625217dc641ed05dd238a8bb5c82828082 +refs/heads/master: 52bfb36050c8529d9031d2c2513b281a360922ec diff --git a/trunk/include/linux/timex.h b/trunk/include/linux/timex.h index 37ac3ff90faf..24c6a2b59511 100644 --- a/trunk/include/linux/timex.h +++ b/trunk/include/linux/timex.h @@ -137,6 +137,7 @@ struct timex { #define ADJ_TIMECONST 0x0020 /* pll time constant */ #define ADJ_TICK 0x4000 /* tick value */ #define ADJ_OFFSET_SINGLESHOT 0x8001 /* old-fashioned adjtime */ +#define ADJ_OFFSET_SS_READ 0xa001 /* read-only adjtime */ /* xntp 3.4 compatibility names */ #define MOD_OFFSET ADJ_OFFSET diff --git a/trunk/kernel/time/ntp.c b/trunk/kernel/time/ntp.c index 14a2ecf2b318..e64efaf957e8 100644 --- a/trunk/kernel/time/ntp.c +++ b/trunk/kernel/time/ntp.c @@ -249,10 +249,12 @@ int do_adjtimex(struct timex *txc) /* Now we validate the data before disabling interrupts */ - if ((txc->modes & ADJ_OFFSET_SINGLESHOT) == ADJ_OFFSET_SINGLESHOT) + if ((txc->modes & ADJ_OFFSET_SINGLESHOT) == ADJ_OFFSET_SINGLESHOT) { /* singleshot must not be used with any other mode bits */ - if (txc->modes != ADJ_OFFSET_SINGLESHOT) + if (txc->modes != ADJ_OFFSET_SINGLESHOT && + txc->modes != ADJ_OFFSET_SS_READ) return -EINVAL; + } if (txc->modes != ADJ_OFFSET_SINGLESHOT && (txc->modes & ADJ_OFFSET)) /* adjustment Offset limited to +- .512 seconds */ @@ -372,7 +374,8 @@ int do_adjtimex(struct timex *txc) leave: if ((time_status & (STA_UNSYNC|STA_CLOCKERR)) != 0) result = TIME_ERROR; - if ((txc->modes & ADJ_OFFSET_SINGLESHOT) == ADJ_OFFSET_SINGLESHOT) + if ((txc->modes == ADJ_OFFSET_SINGLESHOT) || + (txc->modes == ADJ_OFFSET_SS_READ)) txc->offset = save_adjust; else txc->offset = ((long)shift_right(time_offset, SHIFT_UPDATE)) *