Package: libieee1284
Version: 0.2.10-4
Severity: important
Tags: patch

Hi,

The patch below adds support for kfreebsd-amd64 in libieee1284. The
/dev/io method is actually not limited to i386, but to all architectures
that have notion of I/O space. This should be the case of some other 
architectures (at least arm and alpha), but I leave the exercise of 
adding them to the FreeBSD porters.

Thanks,
Aurelien

--- libieee1284-0.2.10.orig/configure.in
+++ libieee1284-0.2.10/configure.in
@@ -30,8 +30,8 @@
         AC_DEFINE(HAVE_OBSD_I386,1,enable OpenBSD i386 ioperm access)
        LIBS="-li386"
 ;;
-*86-*-freebsd* | *86-*-kfreebsd*)
-        AC_DEFINE(HAVE_FBSD_I386,1,enable FreeBSD /dev/io access)
+*86-*-freebsd* | *86-*-kfreebsd* | *x86_64-*-freebsd* | *x86_64-*-kfreebsd* )
+        AC_DEFINE(HAVE_FBSD,1,enable FreeBSD /dev/io access)
 ;;
 *86-*-solaris*)
         AC_DEFINE(HAVE_SOLARIS,1,enable solaris iop access)
--- libieee1284-0.2.10.orig/include/config.h.in
+++ libieee1284-0.2.10/include/config.h.in
@@ -10,7 +10,7 @@
 #undef HAVE_DLFCN_H
 
 /* enable FreeBSD /dev/io access */
-#undef HAVE_FBSD_I386
+#undef HAVE_FBSD
 
 /* Define to 1 if you have the <inttypes.h> header file. */
 #undef HAVE_INTTYPES_H
--- libieee1284-0.2.10.orig/src/access_io.c
+++ libieee1284-0.2.10/src/access_io.c
@@ -66,7 +66,7 @@
 
 #include "io.h"
 
-#elif defined(HAVE_FBSD_I386)
+#elif defined(HAVE_FBSD)
 
 /* don't use machine/cpufunc.h here because it redefines inb and outb as 
    macros, which breaks our port->fn->inb calls */
@@ -127,7 +127,7 @@
 raw_inb (struct parport_internal *port, unsigned long addr)
 {
 #if (defined(HAVE_LINUX) && defined(HAVE_SYS_IO_H)) || defined(HAVE_CYGWIN_9X) 
\
-       || defined(HAVE_OBSD_I386) || defined(HAVE_FBSD_I386)
+       || defined(HAVE_OBSD_I386) || defined(HAVE_FBSD)
   return inb ((unsigned short)addr);
 
 #elif defined(HAVE_SOLARIS)
@@ -146,7 +146,7 @@
 raw_outb (struct parport_internal *port, unsigned char val, unsigned long addr)
 {
 #if (defined(HAVE_LINUX) && defined(HAVE_SYS_IO_H)) || defined(HAVE_CYGWIN_9X) 
\
-       || defined(HAVE_OBSD_I386) || defined(HAVE_FBSD_I386)
+       || defined(HAVE_OBSD_I386) || defined(HAVE_FBSD)
 #if defined(__i386__) || defined(__x86_64__) || defined(_MSC_VER)
   outb_p (val, (unsigned short)addr);
 #else
@@ -208,7 +208,7 @@
       return E1284_SYS; /* might not be the best error code to use */
 #endif /* HAVE_SYS_IO_H */
 
-#elif defined(HAVE_FBSD_I386)
+#elif defined(HAVE_FBSD)
        /* open the special io device which does the ioperm change for us */
       if ((port->fd = open("/dev/io", O_RDONLY)) < 0)
       {
@@ -278,7 +278,7 @@
 {
   if (port->type != IO_CAPABLE && port->fd >= 0)
     close (port->fd);
-#if defined(HAVE_FBSD_I386) || defined (HAVE_SOLARIS)
+#if defined(HAVE_FBSD) || defined (HAVE_SOLARIS)
   if (port->fd >= 0)
     close(port->fd);
 #endif
--- libieee1284-0.2.10.orig/src/ports.c
+++ libieee1284-0.2.10/src/ports.c
@@ -348,7 +348,7 @@
   add_port (list, flags, "0x378", "/dev/port", NULL, 0x378, 0, -1);
   add_port (list, flags, "0x278", "/dev/port", NULL, 0x278, 0, -1);
   add_port (list, flags, "0x3bc", "/dev/port", NULL, 0x3bc, 0, -1);
-#elif defined(HAVE_FBSD_I386)
+#elif defined(HAVE_FBSD)
   add_port (list, flags, "0x378", "/dev/io", NULL, 0x378, 0, -1);
   add_port (list, flags, "0x278", "/dev/io", NULL, 0x278, 0, -1);
   add_port (list, flags, "0x3bc", "/dev/io", NULL, 0x3bc, 0, -1);
--- libieee1284-0.2.10.orig/src/detect.c
+++ libieee1284-0.2.10/src/detect.c
@@ -162,7 +162,7 @@
     return 1;
   }
   free(iomap);
-  #elif defined(HAVE_FBSD_I386)
+  #elif defined(HAVE_FBSD)
   int fd;
   if ((fd = open("/dev/io", O_RDONLY)) >= 0) {
     capabilities |= IO_CAPABLE;
--- libieee1284-0.2.10.orig/configure
+++ libieee1284-0.2.10/configure
@@ -19516,10 +19516,10 @@
 
        LIBS="-li386"
 ;;
-*86-*-freebsd* | *86-*-kfreebsd*)
+*86-*-freebsd* | *86-*-kfreebsd* | *x86_64-*-freebsd* | *x86_64-*-kfreebsd* )
 
 cat >>confdefs.h <<\_ACEOF
-#define HAVE_FBSD_I386 1
+#define HAVE_FBSD 1
 _ACEOF
 
 ;;


-- System Information:
Debian Release: 4.0
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.18-3-xen-amd64
Locale: LANG=fr_FR.UTF-8, LC_CTYPE=fr_FR.UTF-8 (charmap=UTF-8)


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to