From 84357741a6a6e6430f199b2c3f7498e0e97da9ad Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Sun, 12 Feb 2023 17:35:53 +0100 Subject: New upstream version 1.2.1 --- tools/mustek600iin-off.c | 27 +++------------------------ 1 file changed, 3 insertions(+), 24 deletions(-) (limited to 'tools/mustek600iin-off.c') 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 #include -#ifdef HAVE_SYS_IO_H -# include /* use where available (glibc 2.x, for example) */ -#elif HAVE_ASM_IO_H -# include /* 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) -- cgit v1.2.3