All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Mosberger <davidm@hpl.hp.com>
To: linux-ia64@vger.kernel.org
Subject: [Linux-ia64] fix for slow running time-of-day
Date: Sat, 23 Sep 2000 06:25:03 +0000	[thread overview]
Message-ID: <marc-linux-ia64-105590678205517@msgid-missing> (raw)

This patch fixes the time drift problem that has been plaguing us for
a while.  It turns out that without it, time was running behind by
about 0.3%.  Doesn't sound like a lot, but amounts to about 5 min/day.
Linus already accepted this patch for test9-pre6.

Enjoy,

	--david

--- include/linux/timex.h~	Mon Jul 31 14:01:22 2000
+++ include/linux/timex.h	Thu Sep 21 23:45:26 2000
@@ -51,6 +51,8 @@
 #ifndef _LINUX_TIMEX_H
 #define _LINUX_TIMEX_H
 
+#include <asm/param.h>
+
 /*
  * The following defines establish the engineering parameters of the PLL
  * model. The HZ variable establishes the timer interrupt frequency, 100 Hz
@@ -58,10 +60,20 @@
  * OSF/1 kernel. The SHIFT_HZ define expresses the same value as the
  * nearest power of two in order to avoid hardware multiply operations.
  */
-#ifdef __alpha__
-# define SHIFT_HZ 10		/* log2(HZ) */
+#if HZ >= 24 && HZ < 48
+# define SHIFT_HZ	5
+#elif HZ >= 48 && HZ < 96
+# define SHIFT_HZ	6
+#elif HZ >= 96 && HZ < 192
+# define SHIFT_HZ	7
+#elif HZ >= 192 && HZ < 384
+# define SHIFT_HZ	8
+#elif HZ >= 384 && HZ < 768
+# define SHIFT_HZ	9
+#elif HZ >= 768 && HZ < 1536
+# define SHIFT_HZ	10
 #else
-# define SHIFT_HZ 7		/* log2(HZ) */
+# error You lose.
 #endif
 
 /*


                 reply	other threads:[~2000-09-23  6:25 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=marc-linux-ia64-105590678205517@msgid-missing \
    --to=davidm@hpl.hp.com \
    --cc=linux-ia64@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.