summaryrefslogtreecommitdiffstats
path: root/hwclock/cmos.c
diff options
context:
space:
mode:
authorKarel Zak2008-10-16 23:37:38 +0200
committerKarel Zak2008-10-16 23:37:38 +0200
commit433c8bea8a4047aec35d894a3283853d1a48f897 (patch)
treeef8546e25bc84daa74c4470614dafe1895c7c152 /hwclock/cmos.c
parentipcs: fix exit codes, remove tailing white-spaces (diff)
downloadkernel-qcow2-util-linux-433c8bea8a4047aec35d894a3283853d1a48f897.tar.gz
kernel-qcow2-util-linux-433c8bea8a4047aec35d894a3283853d1a48f897.tar.xz
kernel-qcow2-util-linux-433c8bea8a4047aec35d894a3283853d1a48f897.zip
hwclock: remove "cli" and "sti" from i386 CMOS code
The protection against context switch is nonsense. There is possible to optimize the access to CMOS by mlockall(MCL_CURRENT) and SCHED_FIFO. For more details see: http://lkml.org/lkml/2008/10/12/132 Reported-by: Arjan van de Ven <arjan@infradead.org> Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'hwclock/cmos.c')
-rw-r--r--hwclock/cmos.c29
1 files changed, 4 insertions, 25 deletions
diff --git a/hwclock/cmos.c b/hwclock/cmos.c
index c45a5045e..8b3495b7e 100644
--- a/hwclock/cmos.c
+++ b/hwclock/cmos.c
@@ -216,30 +216,7 @@ set_cmos_access(int Jensen, int funky_toy) {
#endif
-
-
-#ifdef __i386__
-
-/*
- * Try to do CMOS access atomically, so that no other processes
- * can get a time slice while we are reading or setting the clock.
- * (Also, if the kernel time is synchronized with an external source,
- * the kernel itself will fiddle with the RTC every 11 minutes.)
- */
-
-static unsigned long
-atomic(const char *name, unsigned long (*op)(unsigned long),
- unsigned long arg)
-{
- unsigned long v;
- __asm__ volatile ("cli");
- v = (*op)(arg);
- __asm__ volatile ("sti");
- return v;
-}
-
-#elif __alpha__
-
+#if __alpha__
/*
* The Alpha doesn't allow user-level code to disable interrupts (for
* good reasons). Instead, we ensure atomic operation by performing
@@ -267,12 +244,14 @@ atomic(const char *name, unsigned long (*op)(unsigned long),
fprintf(stderr, _("%s: atomic %s failed for 1000 iterations!"), progname, name);
exit(1);
}
-
#else
/*
* Hmmh, this isn't very atomic. Maybe we should force an error
* instead?
+ *
+ * TODO: optimize the access to CMOS by mlockall(MCL_CURRENT)
+ * and SCHED_FIFO
*/
static unsigned long
atomic(const char *name, unsigned long (*op)(unsigned long),