From 2ba54802daefcd0066e37343da128b74abb54ff3 Mon Sep 17 00:00:00 2001 From: Kolja Waschk Date: Sun, 21 Dec 2008 20:23:31 +0000 Subject: [PATCH] added detection of InpOut32 library and support for it (supports I/O access even in Vista) git-svn-id: https://urjtag.svn.sourceforge.net/svnroot/urjtag/trunk@1408 b68d4a1b-bc3d-0410-92ed-d4ac073336b7 --- jtag/ChangeLog | 5 ++++ jtag/configure.ac | 45 +++++++++++++++++++++++++++++++++++ jtag/src/tap/parport/direct.c | 9 ++++++- 3 files changed, 58 insertions(+), 1 deletion(-) diff --git a/jtag/ChangeLog b/jtag/ChangeLog index c0d04547..c0681339 100644 --- a/jtag/ChangeLog +++ b/jtag/ChangeLog @@ -1,3 +1,8 @@ +2008-12-21 Kolja Waschk + + * configure.ac, src/tap/parport/direct.c: added detection of InpOut32 + library and support for using it for I/O port access even under Vista + 2008-12-17 Kolja Waschk * src/tap/discovery.c: Optional (#ifdef) printf for discovery debugging diff --git a/jtag/configure.ac b/jtag/configure.ac index 5ae3e0ad..2e5f31ed 100644 --- a/jtag/configure.ac +++ b/jtag/configure.ac @@ -243,6 +243,45 @@ AS_IF([test "x$HAVELIBFTD2XX" = xyes], [ AC_SUBST(FTD2XXLIB) +dnl Use InpOut I/O library? +dnl http://www.highrez.co.uk/Downloads/InpOut32/default.htm + +AC_ARG_WITH([inpout], + [AS_HELP_STRING([--with-inpout], + [use InpOutXX for parallel port access on Windows])], + [], [with_inpout=check]) + +INPOUTXX= +AS_IF([test "x$with_inpout" = xyes -o "x$with_inpout" = xcheck], [ + AC_CHECK_LIB([inpout32], [Out32], [ + HAVEINPOUTXX=yes + LIBS="-linpout32 $LIBS" + ],[ + AC_MSG_WARN([*** InpOutXX libray not found]) + ]) +],[ + AS_IF([test "x$with_inpout" != xno], [ + HAVEINPOUTXX=yes + AS_IF([test -d "$with_inpout/Win32"], [ + INPOUTXX="$with_inpout/Win32/inpout32.lib" + CFLAGS="$CFLAGS -I$with_inpout/Win32" + ],[ + INPOUTXX="$with_inpout/inpout32.lib" + CFLAGS="$CFLAGS -I$with_inpout" + ]) + ],) +]) +AS_IF([test "x$HAVEINPOUTXX" = xyes], [ + AM_CONDITIONAL(HAVE_INPOUTXX, true) + AC_DEFINE(HAVE_INPOUTXX, 1, [define if you have libinpout]) +],[ + AM_CONDITIONAL(HAVE_INPOUTXX, false) +]) +AC_SUBST(INPOUTXX) + + + + CFLAGS="$CFLAGS -Wall" CPPFLAGS="$CPPFLAGS -I\$(top_srcdir) -I\$(top_srcdir)/include" @@ -592,6 +631,11 @@ AS_IF([test ${HAVELIBFTD2XX:-no} != no], [ ], [ FLAG_HAVELIBFTD2XX=no ]) +AS_IF([test ${HAVEINPOUTXX:-no} != no], [ + FLAG_HAVEINPOUTXX=yes +], [ + FLAG_HAVEINPOUTXX=no +]) AS_IF([test ${svf:-false} != false], [ FLAG_SVF=yes ], [ @@ -609,6 +653,7 @@ jtag is now configured for Detected libusb : $FLAG_HAVELIBUSB Detected libftdi : $FLAG_HAVELIBFTDI Detected libftd2xx : $FLAG_HAVELIBFTD2XX + Detected inpout32 : $FLAG_HAVEINPOUTXX Build SVF player : $FLAG_SVF Build BSDL subsystem : $FLAG_BSDL Bus drivers : $enabled_bus_drivers diff --git a/jtag/src/tap/parport/direct.c b/jtag/src/tap/parport/direct.c index 5927d833..92bdae69 100644 --- a/jtag/src/tap/parport/direct.c +++ b/jtag/src/tap/parport/direct.c @@ -32,7 +32,14 @@ #include "parport.h" #include "cable.h" -#if defined(HAVE_IOPERM) || defined(HAVE_I386_SET_IOPERM) +#if defined(WIN32) && defined(HAVE_INPOUTXX) +void _stdcall Out32(short PortAddress, short data); +short _stdcall Inp32(short PortAddress); + +#define inb(p) Inp32(p) +#define outb(d,p) Out32(p,d) + +#elif defined(HAVE_IOPERM) || defined(HAVE_I386_SET_IOPERM) #if defined(HAVE_IOPERM) #include