diff options
author | Jörg Frings-Fürst <debian@jff.email> | 2023-02-12 17:35:53 +0100 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff.email> | 2023-02-12 17:35:53 +0100 |
commit | 84357741a6a6e6430f199b2c3f7498e0e97da9ad (patch) | |
tree | 23e8d66ede9506b94c76fb36910ca3c7dd15c74e /tools/mustek600iin-off.c | |
parent | 302276dc1b90cfc972fb726ca94a23b18f4b0088 (diff) |
New upstream version 1.2.1upstream/1.2.1
Diffstat (limited to 'tools/mustek600iin-off.c')
-rw-r--r-- | tools/mustek600iin-off.c | 27 |
1 files changed, 3 insertions, 24 deletions
diff --git a/tools/mustek600iin-off.c b/tools/mustek600iin-off.c index 4d89bdd..5fb7a61 100644 --- a/tools/mustek600iin-off.c +++ b/tools/mustek600iin-off.c @@ -26,6 +26,7 @@ #include "../include/sane/config.h" #include "../include/sane/sanei.h" +#include "../include/sane/sanei_directio.h" #define MUSTEK_CONF STRINGIFY(PATH_SANE_CONFIG_DIR) "/mustek.conf" #define PORT_DEV "/dev/port" @@ -39,28 +40,6 @@ #include <sys/types.h> #include <sys/stat.h> -#ifdef HAVE_SYS_IO_H -# include <sys/io.h> /* use where available (glibc 2.x, for example) */ -#elif HAVE_ASM_IO_H -# include <asm/io.h> /* ugly, but backwards compatible */ -#elif defined(__i386__) && defined (__GNUC__) - -static __inline__ void -outb (u_char value, u_long port) -{ - __asm__ __volatile__ ("outb %0,%1"::"a" (value), "d" ((u_short) port)); -} - -static __inline__ u_char -inb (u_long port) -{ - u_char value; - - __asm__ __volatile__ ("inb %1,%0":"=a" (value):"d" ((u_short) port)); - return value; -} -#endif - char *Mustek_Conf = MUSTEK_CONF; int allowed_ports[] = @@ -165,9 +144,9 @@ main (int argc, char **argv) fprintf (stderr, "using control port address 0x%03x\n", portaddr); /* try to get I/O permission from the kernel */ - if (ioperm (portaddr, 1, 1) == 0) + if (sanei_ioperm (portaddr, 1, 1) == 0) { - outb (0x00, portaddr); + sanei_outb (portaddr, 0x00); } /* else try to open /dev/port to access the I/O port */ else if ((pfd = open (PORT_DEV, O_RDWR, 0666)) >= 0) |