OSDN Git Service

Oleksandr G. Zhadan writes:
authorEric Andersen <andersen@codepoet.org>
Sat, 24 Jan 2004 08:40:27 +0000 (08:40 -0000)
committerEric Andersen <andersen@codepoet.org>
Sat, 24 Jan 2004 08:40:27 +0000 (08:40 -0000)
Hi Eric,

The attached diff file includes BUS_ISA fix for kernel since 2.4.23/

Kind regards,

Oleks

libc/sysdeps/linux/arm/ioperm.c

index 74a6dc1..2fba676 100644 (file)
@@ -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)