LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Andi Kleen <ak@suse.de>
To: tglx@linutronix.de, mingo@elte.hu, linux-kernel@vger.kernel.org
Subject: [PATCH] [2/5] Use 2000 offset for 32bit kernels
Date: Sat,  9 Feb 2008 16:16:58 +0100 (CET)	[thread overview]
Message-ID: <20080209151658.4A3AD1B41D1@basil.firstfloor.org> (raw)
In-Reply-To: <20080209416.271135970@suse.de>


We know it is already after 2000.

This extends the effective lifetime of 32bit systems by 8 years:
from 2030 to 2038.

The only drawback is that users cannot set the cmos date to before 2000
now on 32bit with systems that don't support extended century in 
the RTC clock. 64bit systems had this limitation for some time
and nobody complained.

And they can always set it to such a date in Linux only using date -s 
if they really want.

Signed-off-by: Andi Kleen <ak@suse.de>

---
 arch/x86/kernel/rtc.c |   10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

Index: linux/arch/x86/kernel/rtc.c
===================================================================
--- linux.orig/arch/x86/kernel/rtc.c
+++ linux/arch/x86/kernel/rtc.c
@@ -9,7 +9,6 @@
 #include <asm/vsyscall.h>
 
 #ifdef CONFIG_X86_32
-# define CMOS_YEARS_OFFS 1900
 /*
  * This is a special lock that is owned by the CPU and holds the index
  * register we are working with.  It is required for NMI access to the
@@ -17,14 +16,11 @@
  */
 volatile unsigned long cmos_lock = 0;
 EXPORT_SYMBOL(cmos_lock);
-#else
-/*
- * x86-64 systems only exists since 2002.
- * This will work up to Dec 31, 2100
- */
-# define CMOS_YEARS_OFFS 2000
 #endif
 
+/* For two digit years assume time is always after that */
+#define CMOS_YEARS_OFFS 2000
+
 DEFINE_SPINLOCK(rtc_lock);
 EXPORT_SYMBOL(rtc_lock);
 

  reply	other threads:[~2008-02-09 15:17 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-09 15:16 [PATCH] [1/5] Only do century BCD conversion when we know the RTC is BCD Andi Kleen
2008-02-09 15:16 ` Andi Kleen [this message]
2008-02-16 19:24   ` [PATCH] [2/5] Use 2000 offset for 32bit kernels Thomas Gleixner
2008-02-20 10:07     ` Thomas Gleixner
2008-02-20 10:23       ` Andi Kleen
2008-02-09 15:16 ` [PATCH] [3/5] Add warning when RTC clock reports binary Andi Kleen
2008-02-16 19:38   ` Thomas Gleixner
2008-02-09 15:17 ` [PATCH] [4/5] Fix wrong comment Andi Kleen
2008-02-09 15:17 ` [PATCH] [5/5] Enable ACPI extended century handling for 32bit too v2 Andi Kleen
2008-02-16 19:38   ` Thomas Gleixner
2008-02-11  8:30 ` [PATCH] [1/5] Only do century BCD conversion when we know the RTC is BCD Thomas Gleixner
2008-02-11  8:56   ` Andi Kleen
2008-02-11 22:08     ` Thomas Gleixner
2008-02-11 22:15       ` Andi Kleen
2008-02-12 20:36         ` Thomas Gleixner
2008-02-13 13:49           ` Andi Kleen

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=20080209151658.4A3AD1B41D1@basil.firstfloor.org \
    --to=ak@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=tglx@linutronix.de \
    --subject='Re: [PATCH] [2/5] Use 2000 offset for 32bit kernels' \
    /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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).