AC_DEFINE(HAVE_MTRR, 1, [Use MTRRs on mappings])
fi
+dnl check for the pci_io.pi_sel.pc_domain
+AC_CHECK_MEMBER([struct pci_io.pi_sel.pc_domain],
+ [AC_DEFINE(HAVE_PCI_IO_PC_DOMAIN,1,[Have the pci_io.pi_sel.pc_domain member.])],
+ [],
+ [ #include <sys/types.h>
+ #include <sys/pciio.h>
+ ])
+
AC_SUBST(PCIACCESS_CFLAGS)
AC_SUBST(PCIACCESS_LIBS)
#ifdef linux
err = pci_system_linux_sysfs_create();
-#elif defined(__FreeBSD__) || defined(__DragonFly__)
+#elif defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__)
err = pci_system_freebsd_create();
#elif defined(__OpenBSD__)
err = pci_system_openbsd_create();
#include <sys/mman.h>
#include <sys/memrange.h>
-#if __FreeBSD_version >= 700053
-#define DOMAIN_SUPPORT 1
-#else
-#define DOMAIN_SUPPORT 0
-#endif
-
#include "pciaccess.h"
#include "pciaccess_private.h"
{
struct pci_io io;
-#if DOMAIN_SUPPORT
+#if HAVE_PCI_IO_PC_DOMAIN
io.pi_sel.pc_domain = dev->domain;
#endif
io.pi_sel.pc_bus = dev->bus;
{
struct pci_io io;
-#if DOMAIN_SUPPORT
+#if HAVE_PCI_IO_PC_DOMAIN
io.pi_sel.pc_domain = dev->domain;
#endif
io.pi_sel.pc_bus = dev->bus;
for ( i = 0; i < pciconfio.num_matches; i++ ) {
struct pci_conf *p = &pciconf[ i ];
-#if DOMAIN_SUPPORT
+#if HAVE_PCI_IO_PC_DOMAIN
pci_sys->devices[ i ].base.domain = p->pc_sel.pc_domain;
#else
pci_sys->devices[ i ].base.domain = 0;