Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 23820
b: refs/heads/master
c: 6954bee
h: refs/heads/master
v: v3
  • Loading branch information
Andi Kleen authored and Linus Torvalds committed Mar 25, 2006
1 parent 9d3b399 commit 24decf4
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: eaeae0cc985fa1df753da7edc8d02635cbc1ba39
refs/heads/master: 6954bee829a037e4a3e06f7ecd7fc0466fadde41
22 changes: 17 additions & 5 deletions trunk/arch/x86_64/kernel/time.c
Original file line number Diff line number Diff line change
Expand Up @@ -517,6 +517,7 @@ static unsigned long get_cmos_time(void)
unsigned int timeout = 1000000, year, mon, day, hour, min, sec;
unsigned char uip = 0, this = 0;
unsigned long flags;
unsigned extyear = 0;

/*
* The Linux interpretation of the CMOS clock register contents: When the
Expand Down Expand Up @@ -545,6 +546,11 @@ static unsigned long get_cmos_time(void)
mon = CMOS_READ(RTC_MONTH);
year = CMOS_READ(RTC_YEAR);

#ifdef CONFIG_ACPI
if (acpi_fadt.revision >= FADT2_REVISION_ID && acpi_fadt.century)
extyear = CMOS_READ(acpi_fadt.century);
#endif

spin_unlock_irqrestore(&rtc_lock, flags);

/*
Expand All @@ -559,11 +565,17 @@ static unsigned long get_cmos_time(void)
BCD_TO_BIN(mon);
BCD_TO_BIN(year);

/*
* x86-64 systems only exists since 2002.
* This will work up to Dec 31, 2100
*/
year += 2000;
if (extyear) {
BCD_TO_BIN(extyear);
year += extyear;
printk(KERN_INFO "Extended CMOS year: %d\n", extyear);
} else {
/*
* x86-64 systems only exists since 2002.
* This will work up to Dec 31, 2100
*/
year += 2000;
}

return mktime(year, mon, day, hour, min, sec);
}
Expand Down

0 comments on commit 24decf4

Please sign in to comment.