Usenet comp.os.linux.alpha (1997-2013)
 help / color / mirror / Atom feed
From: tom_holroyd@yahoo.com
Subject: /sbin/clock patch
Date: 1998/06/12	[thread overview]
Message-ID: <6lqk6m$5np$1@nnrp1.dejanews.com> (raw)


I have an AlphaPC EB164LX, running 2.0.32.  /sbin/clock -A *sometimes* came
back with dates in the next century, but *not always*.  I tracked this down
to a problem in clock-alpha.c where the cmos_read(10) call would sometimes
give a false positive indication of the falling edge.  The following patch
fixes the problem (the patch is relative to clock-1.1-2.src.rpm, available
at your favorite RedHat mirror).  This also works with #define USE_DEV_PORT.

http://www.aist.go.jp/NIBH/~tomh/clock-alpha.patch

patch included below for reference:

*** clock-alpha.c.orig  Fri Oct 10 00:29:15 1997
--- clock-alpha.c       Fri Jun 12 15:48:44 1998
***************
*** 142,150 ****
--- 142,152 ----

  #define VERSION "1.4.3axp"

+ #define USE_DEV_PORT
  #undef USE_DEV_PORT

  #ifdef USE_DEV_PORT
+ # include <linux/types.h>
  # include <asm/fcntl.h>
  #else
  # include <asm/io.h>
***************
*** 429,435 ****

    if (readit || setit || adjustit)
      {
!       int i;

  /* read RTC exactly on falling edge of update flag */
  /* Wait for rise.... (may take upto 1 second) */
--- 431,437 ----

    if (readit || setit || adjustit)
      {
!       int i, j;

  /* read RTC exactly on falling edge of update flag */
  /* Wait for rise.... (may take upto 1 second) */
***************
*** 438,448 ****
        if (cmos_read (10) & 0x80)
          break;

! /* Wait for fall.... (must try at least 2.228 ms) */

!       for (i = 0; i < 1000000; i++)
!       if (!(cmos_read (10) & 0x80))
!         break;

  /* The purpose of the "do" loop is called "low-risk programming" */
  /* In theory it should never run more than once */
--- 440,454 ----
        if (cmos_read (10) & 0x80)
          break;

! /* Wait for fall.... (must try at least 2.228 ms), make sure it's really
off. */

!       j = 0;
!       for (i = 0; i < 1000000; i++)
!       if (!(cmos_read (10>
<input type=

-----== Posted via Deja News, The Leader in Internet Discussion ==-----
http://www.dejanews.com/   Now offering spam-free web-based newsreading



                 reply	other threads:[~1998-06-12  4:00 UTC|newest]

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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox