summaryrefslogtreecommitdiff
path: root/libc/sysdeps/linux
diff options
context:
space:
mode:
authorEric Andersen <andersen@codepoet.org>2004-01-24 08:40:27 +0000
committerEric Andersen <andersen@codepoet.org>2004-01-24 08:40:27 +0000
commiteee979719db7ba3f014fca22d9309bd7fbad2745 (patch)
treec7d93582d7f67a584a8df4242e2e10dc707795ff /libc/sysdeps/linux
parent48cfeab44c6463ab193b0efd7b61837140985dd5 (diff)
Oleksandr G. Zhadan writes:
Hi Eric, The attached diff file includes BUS_ISA fix for kernel since 2.4.23/ Kind regards, Oleks
Diffstat (limited to 'libc/sysdeps/linux')
-rw-r--r--libc/sysdeps/linux/arm/ioperm.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/libc/sysdeps/linux/arm/ioperm.c b/libc/sysdeps/linux/arm/ioperm.c
index 74a6dc1dc..2fba676b1 100644
--- a/libc/sysdeps/linux/arm/ioperm.c
+++ b/libc/sysdeps/linux/arm/ioperm.c
@@ -47,6 +47,8 @@
#include <asm/page.h>
#include <sys/sysctl.h>
+#include <linux/version.h>
+
#define PATH_ARM_SYSTYPE "/etc/arm_systype"
#define PATH_CPUINFO "/proc/cpuinfo"
@@ -93,6 +95,8 @@ static struct platform {
* 3. Lookup the "system type" field in /proc/cpuinfo. Again, if it
* matches an entry in the platform[] table, use the corresponding
* values.
+ *
+ * 4. BUS_ISA is changed to CTL_BUS_ISA (for kernel since 2.4.23).
*/
static int
@@ -100,8 +104,15 @@ init_iosys (void)
{
char systype[256];
int i, n;
+
+#if LINUX_VERSION_CODE < 132119
static int iobase_name[] = { CTL_BUS, BUS_ISA, BUS_ISA_PORT_BASE };
static int ioshift_name[] = { CTL_BUS, BUS_ISA, BUS_ISA_PORT_SHIFT };
+#else
+ static int iobase_name[] = { CTL_BUS, CTL_BUS_ISA, BUS_ISA_PORT_BASE };
+ static int ioshift_name[] = { CTL_BUS, CTL_BUS_ISA, BUS_ISA_PORT_SHIFT };
+#endif
+
size_t len = sizeof(io.base);
if (! sysctl (iobase_name, 3, &io.io_base, &len, NULL, 0)