diff options
author | Thomas Gleixner <tglx@linutronix.de> | 2008-01-30 07:30:26 -0500 |
---|---|---|
committer | Ingo Molnar <mingo@elte.hu> | 2008-01-30 07:30:26 -0500 |
commit | 6ce60b07e670e800c4c5cfe984ed5188e7a64135 (patch) | |
tree | 108c493c98bc8afa42e246c9494d59543556c8c4 /arch/x86/kernel/time_64.c | |
parent | 4ec08da02f0fda16fbc8dfa040568facaa576790 (diff) |
x86: unify mc146818rtc.h - prepare for sharing rtc code
Unify mc146818rtc.h by adding the rtc_cmos_read/write functions to
time_64.c. This is a preparatory patch to finaly share the rtc code,
which is unsurprisingly similar.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'arch/x86/kernel/time_64.c')
-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 |