summaryrefslogtreecommitdiffstats
path: root/hwclock
diff options
context:
space:
mode:
authorJosiah Worcester2011-06-09 00:52:48 +0200
committerKarel Zak2011-06-14 14:16:07 +0200
commit363ce07137ca8e5be1ff24763e34679b9dd9c3e2 (patch)
tree684336f58a2b9f81a7d47b65a090433519831cc7 /hwclock
parenttest_sysinfo: Use CHAR_BIT*sizeof(void*) instead of __WORDSIZE. (diff)
downloadkernel-qcow2-util-linux-363ce07137ca8e5be1ff24763e34679b9dd9c3e2.tar.gz
kernel-qcow2-util-linux-363ce07137ca8e5be1ff24763e34679b9dd9c3e2.tar.xz
kernel-qcow2-util-linux-363ce07137ca8e5be1ff24763e34679b9dd9c3e2.zip
hwclock: Don't use asm/io.h if sys/io.h can't be found
[kzak@redhat.com: - check for obsolete asm/io.h in configure.ac] Signed-off-by: Josiah Worcester <josiahw@gmail.com> Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'hwclock')
-rw-r--r--hwclock/cmos.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/hwclock/cmos.c b/hwclock/cmos.c
index 947b21bea..0178ef7d3 100644
--- a/hwclock/cmos.c
+++ b/hwclock/cmos.c
@@ -50,11 +50,19 @@
#include "nls.h"
#if defined(__i386__)
-#ifdef HAVE_SYS_IO_H
-#include <sys/io.h>
-#else
-#include <asm/io.h> /* for inb, outb */
-#endif
+
+# ifdef HAVE_SYS_IO_H
+# include <sys/io.h>
+# elif defined(HAVE_ASM_IO_H)
+# include <asm/io.h> /* for inb, outb */
+# else
+/* Disable cmos access; we can no longer use asm/io.h, since
+ * the kernel does not export that header. */
+# undef __i386__
+void outb(int a, int b){}
+int inb(int c){ return 0; }
+# endif
+
#elif defined(__alpha__)
/* <asm/io.h> fails to compile, probably because of u8 etc */
extern unsigned int inb(unsigned long port);