From 3c0c79615934816d8867fb9b8df60b994e23f0de Mon Sep 17 00:00:00 2001 From: martin Date: Sun, 12 Oct 2008 08:29:39 +0000 Subject: [PATCH] enable flashing via the parallel port on i386; bump PKGNAME from Claus Kestel with help from sturm@ --- devel/uisp/Makefile | 6 ++++- devel/uisp/patches/patch-src_DAPA_C | 39 +++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+), 1 deletion(-) create mode 100644 devel/uisp/patches/patch-src_DAPA_C diff --git a/devel/uisp/Makefile b/devel/uisp/Makefile index af51b91c6d0..9625869701d 100644 --- a/devel/uisp/Makefile +++ b/devel/uisp/Makefile @@ -1,8 +1,9 @@ -# $OpenBSD: Makefile,v 1.3 2007/09/16 02:53:14 merdely Exp $ +# $OpenBSD: Makefile,v 1.4 2008/10/12 08:29:39 martin Exp $ COMMENT= AVR microcontroller hardware in-system programmer DISTNAME= uisp-20050207 +PKGNAME= ${DISTNAME}p0 CATEGORIES= devel HOMEPAGE= http://www.nongnu.org/uisp/ @@ -19,6 +20,9 @@ WANTLIB= c m stdc++ MASTER_SITES= http://savannah.nongnu.org/download/uisp/ CONFIGURE_STYLE= gnu +.if ${MACHINE_ARCH} == "i386" +CONFIGURE_ENV= LIBS="-li386" +.endif MAKE_FLAGS= CXX="${CXX} ${CXXFLAGS}" .include diff --git a/devel/uisp/patches/patch-src_DAPA_C b/devel/uisp/patches/patch-src_DAPA_C new file mode 100644 index 00000000000..099d2d2db14 --- /dev/null +++ b/devel/uisp/patches/patch-src_DAPA_C @@ -0,0 +1,39 @@ +$OpenBSD: patch-src_DAPA_C,v 1.1 2008/10/12 08:29:39 martin Exp $ +--- src/DAPA.C.orig Tue Dec 28 15:39:38 2004 ++++ src/DAPA.C Sun Jun 8 18:04:35 2008 +@@ -84,6 +84,35 @@ + #define ioport_enable(port, num) i386_set_ioperm(port, num, 1) + #define ioport_disable(port, num) i386_set_ioperm(port, num, 0) + ++#elif defined(__OpenBSD__) && defined(__i386__) ++ ++#include ++#include ++#include ++ ++#define IOPAGES 32 ++ ++#define ioport_read(port) inb(port) ++#define ioport_write(port, val) outb(port, val) ++#define ioport_enable(port, num) set_ioperm_obsd(port, num, 1) ++#define ioport_disable(port, num) set_ioperm_obsd(port, num, 0) ++ ++int ++set_ioperm_obsd(int parport_port, int num, int flag) ++{ ++ int i=0; ++ u_long iopermtable[IOPAGES] = {}; ++ ++ /* get current i/o permission table */ ++ i386_get_ioperm(iopermtable); ++ ++ /* request access to desired i/o port */ ++ for (i=0; i