steven mestdagh wrote:
Matthieu Herrb [2006-12-16, 16:20:41]:
steven mestdagh wrote:
Matthieu Herrb [2006-12-12, 23:15:37]:
Matthieu Herrb wrote:
Don't forget to use patch -E
New version, merging Mark Kettenis recent patch for big-endian machines.
ok?
patch-lib_obsd-device_c does not apply; can you make the diff against
-current ?
Here's a new one.
+$OpenBSD$
+--- /usr/obj/ports/pciutils-2.2.4/pciutils-2.2.4/lib/obsd-device.c.orig
Tue Dec 12 22:46:18 2006
++++ /usr/obj/ports/pciutils-2.2.4/pciutils-2.2.4/lib/obsd-device.c Tue Dec
12 22:50:26 2006
+@@ -58,11 +58,6 @@
+ obsd_read(struct pci_dev *d, int pos, byte *buf, int len)
[...]
this doesn't build, you must have a relative path there.
Disclaimer: http://www.kuleuven.be/cwis/email_disclaimer.htm
Last attempt before I give up.
--
Matthieu Herrb
Index: Makefile
===================================================================
RCS file: /cvs/ports/sysutils/pciutils/Makefile,v
retrieving revision 1.2
diff -u -r1.2 Makefile
--- Makefile 12 Dec 2006 20:32:36 -0000 1.2
+++ Makefile 17 Dec 2006 23:17:22 -0000
@@ -4,8 +4,7 @@
COMMENT= "PCI bus configuration register access tools"
-DISTNAME= pciutils-2.2.1
-PKGNAME= ${DISTNAME}p0
+DISTNAME= pciutils-2.2.4
CATEGORIES= sysutils
HOMEPAGE= http://atrey.karlin.mff.cuni.cz/~mj/pciutils.shtml
@@ -24,7 +23,7 @@
USE_GMAKE= Yes
MAKE_ENV= CC="${CC}"
-FAKE_FLAGS= PREFIX=${WRKINST}${PREFIX}
+FAKE_FLAGS= PREFIX=${PREFIX}
NO_REGRESS= Yes
Index: distinfo
===================================================================
RCS file: /cvs/ports/sysutils/pciutils/distinfo,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 distinfo
--- distinfo 25 Mar 2006 21:53:35 -0000 1.1.1.1
+++ distinfo 17 Dec 2006 23:17:22 -0000
@@ -1,4 +1,4 @@
-MD5 (pciutils-2.2.1.tar.gz) = c18e2a5f04e9abae5a42439de294f086
-RMD160 (pciutils-2.2.1.tar.gz) = fc12da1261a33f03fc54e4bcc48cd0b8277990a6
-SHA1 (pciutils-2.2.1.tar.gz) = 01ae9a2c826e06d48d2b0d8f78cfddf7e1cadb4c
-SIZE (pciutils-2.2.1.tar.gz) = 194389
+MD5 (pciutils-2.2.4.tar.gz) = 5629fdb049f189fb853e7021f85553d2
+RMD160 (pciutils-2.2.4.tar.gz) = 27db4b23a07a02b28b64e01fbe1c74cefa887cc0
+SHA1 (pciutils-2.2.4.tar.gz) = c20dfa13bbd3d04ce921294c51e3da94140cea8b
+SIZE (pciutils-2.2.4.tar.gz) = 210706
Index: patches/patch-Makefile
===================================================================
RCS file: /cvs/ports/sysutils/pciutils/patches/patch-Makefile,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 patch-Makefile
--- patches/patch-Makefile 25 Mar 2006 21:53:35 -0000 1.1.1.1
+++ patches/patch-Makefile 17 Dec 2006 23:17:22 -0000
@@ -1,13 +1,13 @@
$OpenBSD: patch-Makefile,v 1.1.1.1 2006/03/25 21:53:35 matthieu Exp $
---- Makefile.orig Sat Nov 26 14:00:57 2005
-+++ Makefile Fri Mar 24 22:57:18 2006
+--- Makefile.orig Sat Sep 9 14:57:03 2006
++++ Makefile Wed Nov 22 22:43:48 2006
@@ -1,8 +1,7 @@
# Makefile for The PCI Utilities
- # (c) 1998--2005 Martin Mares <[EMAIL PROTECTED]>
+ # (c) 1998--2006 Martin Mares <[EMAIL PROTECTED]>
-OPT=-O2
--CFLAGS=$(OPT) -Wall -W -Wno-parentheses -Wstrict-prototypes
-Wmissing-prototypes -Winline
-+CFLAGS+= -Wall -W -Wno-parentheses -Wstrict-prototypes -Wmissing-prototypes
-Winline
+-CFLAGS=$(OPT) -Wall -W -Wno-parentheses -Wstrict-prototypes
-Wmissing-prototypes
++CFLAGS+= -Wall -W -Wno-parentheses -Wstrict-prototypes -Wmissing-prototypes
- VERSION=2.2.1
- DATE=2005-11-26
+ VERSION=2.2.4
+ DATE=2006-09-09
Index: patches/patch-lib_Makefile
===================================================================
RCS file: patches/patch-lib_Makefile
diff -N patches/patch-lib_Makefile
--- patches/patch-lib_Makefile 25 Mar 2006 21:53:35 -0000 1.1.1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,14 +0,0 @@
-$OpenBSD: patch-lib_Makefile,v 1.1.1.1 2006/03/25 21:53:35 matthieu Exp $
---- lib/Makefile.orig Fri Aug 13 22:29:06 2004
-+++ lib/Makefile Wed Mar 22 23:20:03 2006
-@@ -36,6 +36,10 @@ CFLAGS += -I${FREEBSD_SYS}
- endif
- endif
-
-+ifdef PCI_HAVE_PM_OBSD_DEVICE
-+OBJS += obsd-device.o
-+endif
-+
- ifdef PCI_HAVE_PM_AIX_DEVICE
- OBJS += aix-device.o
- endif
Index: patches/patch-lib_access_c
===================================================================
RCS file: patches/patch-lib_access_c
diff -N patches/patch-lib_access_c
--- patches/patch-lib_access_c 25 Mar 2006 21:53:35 -0000 1.1.1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,15 +0,0 @@
-$OpenBSD: patch-lib_access_c,v 1.1.1.1 2006/03/25 21:53:35 matthieu Exp $
---- lib/access.c.orig Fri Aug 13 22:15:11 2004
-+++ lib/access.c Tue Mar 21 22:56:47 2006
-@@ -47,6 +47,11 @@ static struct pci_methods *pci_methods[P
- #else
- NULL,
- #endif
-+#ifdef PCI_HAVE_PM_OBSD_DEVICE
-+ &pm_obsd_device,
-+#else
-+ NULL,
-+#endif
- #ifdef PCI_HAVE_PM_DUMP
- &pm_dump,
- #else
Index: patches/patch-lib_configure
===================================================================
RCS file: patches/patch-lib_configure
diff -N patches/patch-lib_configure
--- patches/patch-lib_configure 25 Mar 2006 21:53:35 -0000 1.1.1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,16 +0,0 @@
-$OpenBSD: patch-lib_configure,v 1.1.1.1 2006/03/25 21:53:35 matthieu Exp $
---- lib/configure.orig Wed Sep 21 13:42:03 2005
-+++ lib/configure Tue Mar 21 22:56:47 2006
-@@ -74,6 +74,12 @@ case $sys in
- echo >>$c '#define PCI_PATH_FBSD_DEVICE "/dev/pci"'
- ok=1
- ;;
-+ openbsd)
-+ echo_n " obsd-device"
-+ echo >>$c '#define PCI_HAVE_PM_OBSD_DEVICE'
-+ echo >>$c '#define PCI_PATH_OBSD_DEVICE "/dev/pci"'
-+ ok=1
-+ ;;
- aix)
- echo_n " aix-device"
- echo >>$c '#define PCI_HAVE_PM_AIX_DEVICE'
Index: patches/patch-lib_internal_h
===================================================================
RCS file: patches/patch-lib_internal_h
diff -N patches/patch-lib_internal_h
--- patches/patch-lib_internal_h 25 Mar 2006 21:53:35 -0000 1.1.1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,10 +0,0 @@
-$OpenBSD: patch-lib_internal_h,v 1.1.1.1 2006/03/25 21:53:35 matthieu Exp $
---- lib/internal.h.orig Fri Aug 13 22:21:22 2004
-+++ lib/internal.h Tue Mar 21 22:56:47 2006
-@@ -36,4 +36,5 @@ struct pci_dev *pci_alloc_dev(struct pci
- int pci_link_dev(struct pci_access *, struct pci_dev *);
-
- extern struct pci_methods pm_intel_conf1, pm_intel_conf2, pm_linux_proc,
-- pm_fbsd_device, pm_aix_device, pm_nbsd_libpci, pm_dump, pm_linux_sysfs;
-+ pm_fbsd_device, pm_aix_device, pm_nbsd_libpci, pm_obsd_device,
-+ pm_dump, pm_linux_sysfs;
Index: patches/patch-lib_obsd-device_c
===================================================================
RCS file: /cvs/ports/sysutils/pciutils/patches/patch-lib_obsd-device_c,v
retrieving revision 1.2
diff -u -r1.2 patch-lib_obsd-device_c
--- patches/patch-lib_obsd-device_c 12 Dec 2006 20:32:37 -0000 1.2
+++ patches/patch-lib_obsd-device_c 17 Dec 2006 23:17:22 -0000
@@ -1,164 +1,37 @@
-$OpenBSD: patch-lib_obsd-device_c,v 1.2 2006/12/12 20:32:37 kettenis Exp $
---- lib/obsd-device.c.orig Wed Nov 22 20:07:11 2006
-+++ lib/obsd-device.c Tue Dec 12 12:03:49 2006
-@@ -0,0 +1,160 @@
-+/*
-+ * The PCI Library -- FreeBSD /dev/pci access
-+ *
-+ * Copyright (c) 1999 Jari Kirma <[EMAIL PROTECTED]>
-+ * Updated in 2003 by Samy Al Bahra <[EMAIL PROTECTED]>
-+ *
-+ * Can be freely distributed and used under the terms of the GNU GPL.
-+ */
-+
-+#include <fcntl.h>
-+#include <string.h>
-+#include <unistd.h>
-+#include <errno.h>
-+#include <sys/endian.h>
-+#include <sys/types.h>
-+#include <sys/ioctl.h>
-+#include <sys/pciio.h>
-+#include "internal.h"
-+
-+static void
-+obsd_config(struct pci_access *a)
-+{
-+ a->method_params[PCI_ACCESS_OBSD_DEVICE] = PCI_PATH_OBSD_DEVICE;
-+}
-+
-+static int
-+obsd_detect(struct pci_access *a)
-+{
-+ char *name = a->method_params[PCI_ACCESS_OBSD_DEVICE];
-+
-+ if (access(name, R_OK))
-+ {
-+ a->warning("Cannot open %s", name);
-+ return 0;
-+ }
-+ a->debug("...using %s", name);
-+ return 1;
-+}
-+
-+static void
-+obsd_init(struct pci_access *a)
-+{
-+ char *name = a->method_params[PCI_ACCESS_OBSD_DEVICE];
-+
-+ a->fd = open(name, O_RDWR, 0);
-+ if (a->fd < 0)
-+ {
-+ a->error("obsd_init: %s open failed", name);
-+ }
-+}
-+
-+static void
-+obsd_cleanup(struct pci_access *a)
-+{
-+ close(a->fd);
-+}
-+
-+static int
-+obsd_read(struct pci_dev *d, int pos, byte *buf, int len)
-+{
-+ struct pci_io pi;
-+ union {
-+ u_int32_t u32;
-+ u_int16_t u16[2];
-+ u_int8_t u8[4];
-+ } u;
-+
-+ if (!(len == 1 || len == 2 || len == 4))
-+ {
-+ return pci_generic_block_read(d, pos, buf, len);
-+ }
-+
-+ if (pos >= 256)
-+ return 0;
-+
-+ pi.pi_sel.pc_bus = d->bus;
-+ pi.pi_sel.pc_dev = d->dev;
-+ pi.pi_sel.pc_func = d->func;
-+
-+ pi.pi_reg = pos - (pos % 4);
-+ pi.pi_width = 4;
-+
-+ if (ioctl(d->access->fd, PCIOCREAD, &pi) < 0) {
-+ if (errno == ENXIO) {
-+ pi.pi_data = 0xffffffff;
-+ } else {
-+ d->access->error("obsd_read: ioctl(PCIOCREAD) failed");
-+ }
-+ }
-+ u.u32 = pi.pi_data;
-+
-+ switch (len)
-+ {
-+ case 1:
+$OpenBSD$
+--- lib/obsd-device.c.orig Sat Sep 9 12:53:01 2006
++++ lib/obsd-device.c Sat Dec 16 16:13:26 2006
+@@ -58,11 +58,6 @@ static int
+ obsd_read(struct pci_dev *d, int pos, byte *buf, int len)
+ {
+ struct pci_io pi;
+- union {
+- u_int32_t u32;
+- u_int16_t u16[2];
+- u_int8_t u8[4];
+- } u;
+
+ if (!(len == 1 || len == 2 || len == 4))
+ {
+@@ -86,18 +81,16 @@ obsd_read(struct pci_dev *d, int pos, by
+ d->access->error("obsd_read: ioctl(PCIOCREAD) failed");
+ }
+ }
+- u.u32 = pi.pi_data;
+-
+ switch (len)
+ {
+ case 1:
+- buf[0] = (u8) u.u8[pos % 4];
+ buf[0] = (u8) (pi.pi_data >> ((pos % 4) * 8));
-+ break;
-+ case 2:
+ break;
+ case 2:
+- ((u16 *) buf)[0] = letoh16(u.u16[(pos % 4) / 2]);
+ ((u16 *) buf)[0] = (u16) htole16(pi.pi_data >> ((pos % 4) * 8));
-+ break;
-+ case 4:
+ break;
+ case 4:
+- ((u32 *) buf)[0] = (u32) letoh32(pi.pi_data);
+ ((u32 *) buf)[0] = (u32) htole32(pi.pi_data);
-+ break;
-+ }
-+ return 1;
-+}
-+
-+static int
-+obsd_write(struct pci_dev *d, int pos, byte *buf, int len)
-+{
-+ struct pci_io pi;
-+
-+ if (!(len == 1 || len == 2 || len == 4))
-+ {
-+ return pci_generic_block_write(d, pos, buf, len);
-+ }
-+
-+ if (pos >= 256)
-+ return 0;
-+
-+ pi.pi_sel.pc_bus = d->bus;
-+ pi.pi_sel.pc_dev = d->dev;
-+ pi.pi_sel.pc_func = d->func;
-+
-+ pi.pi_reg = pos;
-+ pi.pi_width = len;
-+
-+ switch (len)
-+ {
-+ case 1:
-+ pi.pi_data = buf[0];
-+ break;
-+ case 2:
-+ pi.pi_data = ((u16 *) buf)[0];
-+ break;
-+ case 4:
-+ pi.pi_data = ((u32 *) buf)[0];
-+ break;
-+ }
-+
-+ if (ioctl(d->access->fd, PCIOCWRITE, &pi) < 0)
-+ {
-+ d->access->error("obsd_write: ioctl(PCIOCWRITE) failed");
-+ }
-+
-+ return 1;
-+}
-+
-+struct pci_methods pm_obsd_device = {
-+ "OpenBSD-device",
-+ obsd_config,
-+ obsd_detect,
-+ obsd_init,
-+ obsd_cleanup,
-+ pci_generic_scan,
-+ pci_generic_fill_info,
-+ obsd_read,
-+ obsd_write,
-+ NULL, /* dev_init */
-+ NULL /* dev_cleanup */
-+};
+ break;
+ }
+ return 1;
Index: patches/patch-lib_pci_h
===================================================================
RCS file: patches/patch-lib_pci_h
diff -N patches/patch-lib_pci_h
--- patches/patch-lib_pci_h 25 Mar 2006 21:53:35 -0000 1.1.1.1
+++ /dev/null 1 Jan 1970 00:00:00 -0000
@@ -1,11 +0,0 @@
-$OpenBSD: patch-lib_pci_h,v 1.1.1.1 2006/03/25 21:53:35 matthieu Exp $
---- lib/pci.h.orig Sat Sep 10 14:10:54 2005
-+++ lib/pci.h Tue Mar 21 22:56:47 2006
-@@ -31,6 +31,7 @@ enum pci_access_type {
- PCI_ACCESS_FBSD_DEVICE, /* FreeBSD /dev/pci (params: path) */
- PCI_ACCESS_AIX_DEVICE, /* /dev/pci0, /dev/bus0, etc. */
- PCI_ACCESS_NBSD_LIBPCI, /* NetBSD libpci */
-+ PCI_ACCESS_OBSD_DEVICE, /* OpenBSD /dev/pci */
- PCI_ACCESS_DUMP, /* Dump file (params: filename) */
- PCI_ACCESS_MAX
- };
Index: pkg/PLIST
===================================================================
RCS file: /cvs/ports/sysutils/pciutils/pkg/PLIST,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 PLIST
--- pkg/PLIST 25 Mar 2006 21:53:35 -0000 1.1.1.1
+++ pkg/PLIST 17 Dec 2006 23:17:22 -0000
@@ -5,5 +5,4 @@
sbin/lspci
sbin/setpci
sbin/update-pciids
[EMAIL PROTECTED] no checksum
-share/pci.ids
+share/pci.ids.gz