[PATCH] arch/alpha/kernel/time.c kernel 2.2.1 (ARC +20 years bug)

Alex Rhomberg (rhomberg@ife.ee.ethz.ch)
Mon, 08 Feb 1999 14:53:26 +0100


This is a multi-part message in MIME format.
--------------96460DC708BC4046A9216886
Content-Type: text/plain; charset=us-ascii
Content-Transfer-Encoding: 7bit

This is a patch for 2.2.* kernels for Alphas
With this patch, the kernel reads the correct time from BIOS when
booting from ARC/AlphaBIOS console (detection of starting epoch 1980 as
oposed to 1900 for SRM console
Please test and CC: any replies to rhomberg@ife.ee.ethz.ch

-- 
  _________________________________________________________________
 /                                                                 \
|  Alex Rhomberg                           Tel: +41 1 632 49 18     |
|  Institut fuer Elektronik                Fax: +41 1 632 12 10     |
|  ETH Zuerich                        Zentrale: +41 1 632 11 11     |
|  Gloriastrasse 35                                                 |
|  8092 Zuerich               email: rhomberg@ife.ee.ethz.ch        |
 \_________________________________________________________________/
--------------96460DC708BC4046A9216886
Content-Type: text/plain; charset=us-ascii; name="time.patch"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline; filename="time.patch"

--- linux/arch/alpha/kernel/time.c.old Mon Feb 8 13:34:29 1999 +++ linux/arch/alpha/kernel/time.c Mon Feb 8 13:40:18 1999 @@ -282,8 +282,17 @@ */ year -= 42; #endif - if ((year += 1900) < 1970) - year += 100; + /* + * set start of epoch to 1980 if running under ARC console + * This is indicated by MILO in the system serial number + */ + + if(strncmp((const char *)hwrpb->ssn, "MILO", 4) == 0) + year += 1980; /* assume ARC/AlphaBIOS */ + else + if ((year += 1900) < 1970) + year += 100; /* assume SRM */ + xtime.tv_sec = mktime(year, mon, day, hour, min, sec); xtime.tv_usec = 0;

--------------96460DC708BC4046A9216886--

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/