Loading arch/x86/kernel/rtc.c +11 −9 Original line number Original line Diff line number Diff line /* /* * RTC related functions * RTC related functions */ */ #include <linux/platform_device.h> #include <linux/mc146818rtc.h> #include <linux/acpi.h> #include <linux/acpi.h> #include <linux/bcd.h> #include <linux/bcd.h> #include <linux/mc146818rtc.h> #include <linux/platform_device.h> #include <linux/pnp.h> #include <linux/pnp.h> #include <asm/time.h> #include <asm/vsyscall.h> #include <asm/vsyscall.h> #include <asm/time.h> #ifdef CONFIG_X86_32 #ifdef CONFIG_X86_32 /* /* Loading @@ -16,9 +16,9 @@ * register we are working with. It is required for NMI access to the * register we are working with. It is required for NMI access to the * CMOS/RTC registers. See include/asm-i386/mc146818rtc.h for details. * CMOS/RTC registers. See include/asm-i386/mc146818rtc.h for details. */ */ volatile unsigned long cmos_lock = 0; volatile unsigned long cmos_lock; EXPORT_SYMBOL(cmos_lock); EXPORT_SYMBOL(cmos_lock); #endif #endif /* CONFIG_X86_32 */ /* For two digit years assume time is always after that */ /* For two digit years assume time is always after that */ #define CMOS_YEARS_OFFS 2000 #define CMOS_YEARS_OFFS 2000 Loading @@ -38,9 +38,9 @@ EXPORT_SYMBOL(rtc_lock); */ */ int mach_set_rtc_mmss(unsigned long nowtime) int mach_set_rtc_mmss(unsigned long nowtime) { { int retval = 0; int real_seconds, real_minutes, cmos_minutes; int real_seconds, real_minutes, cmos_minutes; unsigned char save_control, save_freq_select; unsigned char save_control, save_freq_select; int retval = 0; /* tell the clock it's being set */ /* tell the clock it's being set */ save_control = CMOS_READ(RTC_CONTROL); save_control = CMOS_READ(RTC_CONTROL); Loading Loading @@ -151,6 +151,7 @@ unsigned char rtc_cmos_read(unsigned char addr) outb(addr, RTC_PORT(0)); outb(addr, RTC_PORT(0)); val = inb(RTC_PORT(1)); val = inb(RTC_PORT(1)); lock_cmos_suffix(addr); lock_cmos_suffix(addr); return val; return val; } } EXPORT_SYMBOL(rtc_cmos_read); EXPORT_SYMBOL(rtc_cmos_read); Loading @@ -166,8 +167,8 @@ EXPORT_SYMBOL(rtc_cmos_write); static int set_rtc_mmss(unsigned long nowtime) static int set_rtc_mmss(unsigned long nowtime) { { int retval; unsigned long flags; unsigned long flags; int retval; spin_lock_irqsave(&rtc_lock, flags); spin_lock_irqsave(&rtc_lock, flags); retval = set_wallclock(nowtime); retval = set_wallclock(nowtime); Loading Loading @@ -242,6 +243,7 @@ static __init int add_rtc_cmos(void) platform_device_register(&rtc_device); platform_device_register(&rtc_device); dev_info(&rtc_device.dev, dev_info(&rtc_device.dev, "registered platform RTC device (no PNP device found)\n"); "registered platform RTC device (no PNP device found)\n"); return 0; return 0; } } device_initcall(add_rtc_cmos); device_initcall(add_rtc_cmos); Loading
arch/x86/kernel/rtc.c +11 −9 Original line number Original line Diff line number Diff line /* /* * RTC related functions * RTC related functions */ */ #include <linux/platform_device.h> #include <linux/mc146818rtc.h> #include <linux/acpi.h> #include <linux/acpi.h> #include <linux/bcd.h> #include <linux/bcd.h> #include <linux/mc146818rtc.h> #include <linux/platform_device.h> #include <linux/pnp.h> #include <linux/pnp.h> #include <asm/time.h> #include <asm/vsyscall.h> #include <asm/vsyscall.h> #include <asm/time.h> #ifdef CONFIG_X86_32 #ifdef CONFIG_X86_32 /* /* Loading @@ -16,9 +16,9 @@ * register we are working with. It is required for NMI access to the * register we are working with. It is required for NMI access to the * CMOS/RTC registers. See include/asm-i386/mc146818rtc.h for details. * CMOS/RTC registers. See include/asm-i386/mc146818rtc.h for details. */ */ volatile unsigned long cmos_lock = 0; volatile unsigned long cmos_lock; EXPORT_SYMBOL(cmos_lock); EXPORT_SYMBOL(cmos_lock); #endif #endif /* CONFIG_X86_32 */ /* For two digit years assume time is always after that */ /* For two digit years assume time is always after that */ #define CMOS_YEARS_OFFS 2000 #define CMOS_YEARS_OFFS 2000 Loading @@ -38,9 +38,9 @@ EXPORT_SYMBOL(rtc_lock); */ */ int mach_set_rtc_mmss(unsigned long nowtime) int mach_set_rtc_mmss(unsigned long nowtime) { { int retval = 0; int real_seconds, real_minutes, cmos_minutes; int real_seconds, real_minutes, cmos_minutes; unsigned char save_control, save_freq_select; unsigned char save_control, save_freq_select; int retval = 0; /* tell the clock it's being set */ /* tell the clock it's being set */ save_control = CMOS_READ(RTC_CONTROL); save_control = CMOS_READ(RTC_CONTROL); Loading Loading @@ -151,6 +151,7 @@ unsigned char rtc_cmos_read(unsigned char addr) outb(addr, RTC_PORT(0)); outb(addr, RTC_PORT(0)); val = inb(RTC_PORT(1)); val = inb(RTC_PORT(1)); lock_cmos_suffix(addr); lock_cmos_suffix(addr); return val; return val; } } EXPORT_SYMBOL(rtc_cmos_read); EXPORT_SYMBOL(rtc_cmos_read); Loading @@ -166,8 +167,8 @@ EXPORT_SYMBOL(rtc_cmos_write); static int set_rtc_mmss(unsigned long nowtime) static int set_rtc_mmss(unsigned long nowtime) { { int retval; unsigned long flags; unsigned long flags; int retval; spin_lock_irqsave(&rtc_lock, flags); spin_lock_irqsave(&rtc_lock, flags); retval = set_wallclock(nowtime); retval = set_wallclock(nowtime); Loading Loading @@ -242,6 +243,7 @@ static __init int add_rtc_cmos(void) platform_device_register(&rtc_device); platform_device_register(&rtc_device); dev_info(&rtc_device.dev, dev_info(&rtc_device.dev, "registered platform RTC device (no PNP device found)\n"); "registered platform RTC device (no PNP device found)\n"); return 0; return 0; } } device_initcall(add_rtc_cmos); device_initcall(add_rtc_cmos);