diff options
Diffstat (limited to 'arch')
-rw-r--r-- | arch/x86/kernel/time_64.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/arch/x86/kernel/time_64.c b/arch/x86/kernel/time_64.c index 368b1942b39a..0a01504586a5 100644 --- a/arch/x86/kernel/time_64.c +++ b/arch/x86/kernel/time_64.c | |||
@@ -69,6 +69,27 @@ unsigned long profile_pc(struct pt_regs *regs) | |||
69 | } | 69 | } |
70 | EXPORT_SYMBOL(profile_pc); | 70 | EXPORT_SYMBOL(profile_pc); |
71 | 71 | ||
72 | /* Routines for accessing the CMOS RAM/RTC. */ | ||
73 | unsigned char rtc_cmos_read(unsigned char addr) | ||
74 | { | ||
75 | unsigned char val; | ||
76 | lock_cmos_prefix(addr); | ||
77 | outb_p(addr, RTC_PORT(0)); | ||
78 | val = inb_p(RTC_PORT(1)); | ||
79 | lock_cmos_suffix(addr); | ||
80 | return val; | ||
81 | } | ||
82 | EXPORT_SYMBOL(rtc_cmos_read); | ||
83 | |||
84 | void rtc_cmos_write(unsigned char val, unsigned char addr) | ||
85 | { | ||
86 | lock_cmos_prefix(addr); | ||
87 | outb_p(addr, RTC_PORT(0)); | ||
88 | outb_p(val, RTC_PORT(1)); | ||
89 | lock_cmos_suffix(addr); | ||
90 | } | ||
91 | EXPORT_SYMBOL(rtc_cmos_write); | ||
92 | |||
72 | /* | 93 | /* |
73 | * In order to set the CMOS clock precisely, set_rtc_mmss has to be called 500 | 94 | * In order to set the CMOS clock precisely, set_rtc_mmss has to be called 500 |
74 | * ms after the second nowtime has started, because when nowtime is written | 95 | * ms after the second nowtime has started, because when nowtime is written |