From 363ce07137ca8e5be1ff24763e34679b9dd9c3e2 Mon Sep 17 00:00:00 2001 From: Josiah Worcester Date: Wed, 8 Jun 2011 16:52:48 -0600 Subject: [PATCH] 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 Signed-off-by: Karel Zak --- configure.ac | 1 + hwclock/cmos.c | 18 +++++++++++++----- 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/configure.ac b/configure.ac index 3524623e67..52eade9e11 100644 --- a/configure.ac +++ b/configure.ac @@ -135,6 +135,7 @@ AC_CHECK_HEADERS( netinet/in.h \ rpcsvc/nfs_prot.h \ stdlib.h \ + asm/io.h \ sys/disk.h \ sys/disklabel.h \ sys/ioctl.h \ diff --git a/hwclock/cmos.c b/hwclock/cmos.c index 947b21bea2..0178ef7d30 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 -#else -#include /* for inb, outb */ -#endif + +# ifdef HAVE_SYS_IO_H +# include +# elif defined(HAVE_ASM_IO_H) +# include /* 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__) /* fails to compile, probably because of u8 etc */ extern unsigned int inb(unsigned long port); -- 2.47.3