summaryrefslogtreecommitdiffstats
path: root/hwclock/cmos.c
diff options
context:
space:
mode:
authorKarel Zak2006-12-07 00:25:58 +0100
committerKarel Zak2006-12-07 00:25:58 +0100
commit63cccae4684f83d2a462bc8abf24e51d1bd6efb6 (patch)
tree433db3f0b44e0f46e4130141f4a59db9c3564557 /hwclock/cmos.c
parentImported from util-linux-2.11r tarball. (diff)
downloadkernel-qcow2-util-linux-63cccae4684f83d2a462bc8abf24e51d1bd6efb6.tar.gz
kernel-qcow2-util-linux-63cccae4684f83d2a462bc8abf24e51d1bd6efb6.tar.xz
kernel-qcow2-util-linux-63cccae4684f83d2a462bc8abf24e51d1bd6efb6.zip
Imported from util-linux-2.11t tarball.
Diffstat (limited to 'hwclock/cmos.c')
-rw-r--r--hwclock/cmos.c34
1 files changed, 19 insertions, 15 deletions
diff --git a/hwclock/cmos.c b/hwclock/cmos.c
index aed122cb1..a5eec0372 100644
--- a/hwclock/cmos.c
+++ b/hwclock/cmos.c
@@ -65,15 +65,18 @@ int inb(int c){ return 0; }
#define BCD_TO_BIN(val) ((val)=((val)&15) + ((val)>>4)*10)
#define BIN_TO_BCD(val) ((val)=(((val)/10)<<4) + (val)%10)
-/* The epoch.
- Unix uses 1900 as epoch for a struct tm, and 1970 for a time_t.
- But what was written to CMOS?
- Digital DECstations use 1928 - this is on a mips
- Digital Unix uses 1952.
- Windows NT uses 1980.
- The ARC console expects to boot Windows NT and uses 1980.
- (But a Ruffian uses 1900, just like SRM.)
- It is reported that ALPHA_PRE_V1_2_SRM_CONSOLE uses 1958. */
+/*
+ * The epoch.
+ *
+ * Unix uses 1900 as epoch for a struct tm, and 1970 for a time_t.
+ * But what was written to CMOS?
+ * Digital DECstations use 1928 - this is on a mips or alpha
+ * Digital Unix uses 1952, e.g. on AXPpxi33
+ * Windows NT uses 1980.
+ * The ARC console expects to boot Windows NT and uses 1980.
+ * (But a Ruffian uses 1900, just like SRM.)
+ * It is reported that ALPHA_PRE_V1_2_SRM_CONSOLE uses 1958.
+ */
#define TM_EPOCH 1900
int cmos_epoch = 1900;
@@ -154,12 +157,13 @@ set_cmos_epoch(int ARCconsole, int SRM) {
return;
}
- /* The kernel source today says: read the year. If it is
- in 11-43 then the epoch is 1980 (this covers 1991-2023).
- Otherwise, if it is less than 96 then the epoch is 1952
- (this covers 1952-1962 and 1996-2047). Otherwise, the epoch
- is 1900 (this covers 1996-1999, or rather 1996-2155). */
-
+ /* The kernel source today says: read the year.
+ If it is in 0-19 then the epoch is 2000.
+ If it is in 20-47 then the epoch is 1980.
+ If it is in 48-69 then the epoch is 1952.
+ If it is in 70-99 then the epoch is 1928.
+ Otherwise the epoch is 1900.
+ Clearly, this must be changed before 2019. */
/* See whether we are dealing with SRM or MILO, as they have
different "epoch" ideas. */