aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/x86_64/kernel/time.c22
1 files changed, 17 insertions, 5 deletions
diff --git a/arch/x86_64/kernel/time.c b/arch/x86_64/kernel/time.c
index 86039baaaf18..2f7c21206574 100644
--- a/arch/x86_64/kernel/time.c
+++ b/arch/x86_64/kernel/time.c
@@ -517,6 +517,7 @@ static unsigned long get_cmos_time(void)
517 unsigned int timeout = 1000000, year, mon, day, hour, min, sec; 517 unsigned int timeout = 1000000, year, mon, day, hour, min, sec;
518 unsigned char uip = 0, this = 0; 518 unsigned char uip = 0, this = 0;
519 unsigned long flags; 519 unsigned long flags;
520 unsigned extyear = 0;
520 521
521/* 522/*
522 * The Linux interpretation of the CMOS clock register contents: When the 523 * The Linux interpretation of the CMOS clock register contents: When the
@@ -545,6 +546,11 @@ static unsigned long get_cmos_time(void)
545 mon = CMOS_READ(RTC_MONTH); 546 mon = CMOS_READ(RTC_MONTH);
546 year = CMOS_READ(RTC_YEAR); 547 year = CMOS_READ(RTC_YEAR);
547 548
549#ifdef CONFIG_ACPI
550 if (acpi_fadt.revision >= FADT2_REVISION_ID && acpi_fadt.century)
551 extyear = CMOS_READ(acpi_fadt.century);
552#endif
553
548 spin_unlock_irqrestore(&rtc_lock, flags); 554 spin_unlock_irqrestore(&rtc_lock, flags);
549 555
550 /* 556 /*
@@ -559,11 +565,17 @@ static unsigned long get_cmos_time(void)
559 BCD_TO_BIN(mon); 565 BCD_TO_BIN(mon);
560 BCD_TO_BIN(year); 566 BCD_TO_BIN(year);
561 567
562 /* 568 if (extyear) {
563 * x86-64 systems only exists since 2002. 569 BCD_TO_BIN(extyear);
564 * This will work up to Dec 31, 2100 570 year += extyear;
565 */ 571 printk(KERN_INFO "Extended CMOS year: %d\n", extyear);
566 year += 2000; 572 } else {
573 /*
574 * x86-64 systems only exists since 2002.
575 * This will work up to Dec 31, 2100
576 */
577 year += 2000;
578 }
567 579
568 return mktime(year, mon, day, hour, min, sec); 580 return mktime(year, mon, day, hour, min, sec);
569} 581}