diff options
author | Jörg Frings-Fürst <debian@jff.email> | 2023-02-12 17:36:10 +0100 |
---|---|---|
committer | Jörg Frings-Fürst <debian@jff.email> | 2023-02-12 17:36:10 +0100 |
commit | e0d94cf4d39395df1e2c6bb4d967200298c13881 (patch) | |
tree | be5c7cace6697afc753c152d13ad5145d0884a42 /tools/mustek600iin-off.c | |
parent | 527bedac30eb120915718eb7997e6dacd583512e (diff) | |
parent | 84357741a6a6e6430f199b2c3f7498e0e97da9ad (diff) |
Update upstream source from tag 'upstream/1.2.1'
Update to upstream version '1.2.1'
with Debian dir a9bb43f754a5c9a361b076af3635cc767b7e652e
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) |