lkml.org 
[lkml]   [2008]   [Feb]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] [2/3] Use 2000 offset for 32bit kernels
Date

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);


\
 
 \ /
  Last update: 2008-02-08 13:19    [W:0.048 / U:0.032 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site