Merge libpciaccess 0.10.5. No functionnal change on OpenBSD.

This commit is contained in:
matthieu 2009-04-14 20:14:23 +00:00
parent 2b54a7b79e
commit c1e1a9267a
23 changed files with 2590 additions and 708 deletions

View File

@ -1,4 +1,5 @@
(C) Copyright IBM Corporation 2006
(C) Copyright IBM Corporation 2006, 2007
(C) Copyright Eric Anholt 2006
All Rights Reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy
@ -19,3 +20,49 @@ IBM AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
IN THE SOFTWARE.
------------------------------------------------------------------------------
Copyright 2007, 2008 Sun Microsystems, Inc. All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the
"Software"), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, and/or sell copies of the Software, and to permit persons
to whom the Software is furnished to do so, provided that the above
copyright notice(s) and this permission notice appear in all copies of
the Software and that both the above copyright notice(s) and this
permission notice appear in supporting documentation.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
Except as contained in this notice, the name of a copyright holder
shall not be used in advertising or otherwise to promote the sale, use
or other dealings in this Software without prior written authorization
of the copyright holder.
------------------------------------------------------------------------------
Copyright (c) 2008 Juan Romero Pardines
Copyright (c) 2008 Mark Kettenis
Permission to use, copy, modify, and distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

View File

@ -136,6 +136,169 @@ Date: Thu Oct 18 15:59:14 2007 -0700
Update bug reporting link.
commit 7aca9465a61934d57781352f4fcc42b779392cd0
Author: Julien Cristau <jcristau@debian.org>
Date: Fri Oct 31 18:07:52 2008 +0100
Bump to 0.10.5
commit 8b0be8751279f9bc8f15ced4e5384fa2b0f78711
Author: Julien Cristau <jcristau@debian.org>
Date: Fri Oct 31 17:33:50 2008 +0100
Make --without-zlib work
commit 7a5ed759f13c3fc5f379cce2ca02c9ebfae5eae9
Author: Robert Noland <rnoland@2hip.net>
Date: Wed Oct 29 22:20:35 2008 -0400
Fix FreeBSD systems which support pci domains.
Support for FreeBSD based systems which support pci domains was broken
in the commit to support kFreeBSD. Include config.h so that things are
happy again.
commit 067f979cbd410ddb82aee702d8434552e35c7154
Author: Alan Coopersmith <alan.coopersmith@sun.com>
Date: Fri Oct 17 14:09:52 2008 -0700
Version 0.10.4
commit 714fef70e66b651e9a535d3d3cb20d055595a12d
Author: Alan Coopersmith <alan.coopersmith@sun.com>
Date: Fri Oct 17 14:09:43 2008 -0700
Add scanpci.man to EXTRA_DIST
commit 77f274b6386301cb31c074061a8c947a78b49da9
Author: Alan Coopersmith <alan.coopersmith@sun.com>
Date: Fri Oct 17 13:51:28 2008 -0700
Update COPYING with the rest of the copyright/license notices from the code
commit 482d1da02498a6a31a6d829a5be41727f6333f94
Author: Alan Coopersmith <alan.coopersmith@sun.com>
Date: Fri Oct 17 13:48:46 2008 -0700
Add scanpci man page from Xorg
commit f537fc50e014063d1a1297bfd82680ae3f170281
Author: Alan Coopersmith <alan.coopersmith@sun.com>
Date: Thu Oct 16 21:17:24 2008 -0700
More minor Solaris cleanups
commit 9a5565c72c13aa107167c9c4a4469dd11ac13714
Author: Alan Coopersmith <alan.coopersmith@sun.com>
Date: Thu Oct 16 18:18:09 2008 -0700
Clean up formatting of solx_devfs.c
commit de97e7e4c63146032c0badb9e0f0b1899dc8debf
Author: Alan Coopersmith <alan.coopersmith@sun.com>
Date: Thu Oct 16 16:55:27 2008 -0700
Fix bus probing on Solaris/SPARC
commit 110cdac97ca1bca3ec811ce0a71b2b24c1f80525
Author: Alan Coopersmith <alan.coopersmith@sun.com>
Date: Thu Oct 16 13:33:01 2008 -0700
Correct Sun license notice
commit 4c0d050c72a38e66a7b4ccb134e7e872eb0bf557
Author: Alan Coopersmith <alan.coopersmith@sun.com>
Date: Wed Oct 15 18:23:03 2008 -0700
scanpci: add -v flag to enable verbose mode like old scanpci
commit 64d0c836d547847b752da6539792b94c803f206b
Author: Alan Coopersmith <alan.coopersmith@sun.com>
Date: Wed Oct 15 16:14:18 2008 -0700
Correct comment about devices used on Solaris
commit d43d21c8cb0f917b65228852a03a7d501636f227
Author: Alan Coopersmith <alan.coopersmith@sun.com>
Date: Wed Oct 15 15:35:25 2008 -0700
Fix various typos (mostly in comments)
commit 4c1c607c602e5e8d9277b9c01edfa7a8d10333cd
Author: Juan RP <xtraeme@gmail.com>
Date: Sat Oct 11 20:28:03 2008 +0200
Add NetBSD support
It's based in the OpenBSD code, but with differences because on NetBSD,
to set MTRRs we have to use i386/x86_64_set_mtrr() and link to libi386
or libx86_64.
X.Org bug#17931 <http://bugs.freedesktop.org/show_bug.cgi?id=17931>
commit 6ae378611bb4caaf57311734d3adcb7e10ac3622
Author: Petr Salinger <petr.salinger@seznam.cz>
Date: Sat Oct 11 20:22:28 2008 +0200
Add support for GNU/kFreeBSD
We need to initialize the FreeBSD backend on GNU/kFreeBSD and detect
whether pci_io.pi_sel.pc_domain member exists.
X.Org bug#17882 <http://bugs.freedesktop.org/show_bug.cgi?id=17882>
commit 968289fc3137ac0863c62d3c343153fa3e4aeb10
Author: John Tapsell <johnflux@gmail.com>
Date: Tue Sep 23 17:26:09 2008 +0300
configure.ac: Make mtrr.h test more portable
Use the standard AC_CHECK_HEADERS, which works for cross-compiling as
well as in various other locations.
commit 79ed41882fd721a15c8b0bea7efeb98864d85dfb
Author: Matthieu Herrb <matthieu.herrb@laas.fr>
Date: Sat Sep 20 18:28:59 2008 +0200
OpenBSD: allow 2 successives calls to pci_system_init().
And fix pci_system_cleanup() to make it possible to call pci_system_init()
again.
ok kettenis at openbsd.
commit 45015ab30b36bdaefd3f3aeab73d287023928826
Author: Kel Modderman <kel@otaku42.de>
Date: Tue Jul 8 13:09:52 2008 +0200
Handle compressed pci.ids
Add an option to build with zlib support so we can find
vendor/device information if the pci.ids file is gzipped.
Signed-off-by: Julien Cristau <jcristau@debian.org>
commit 32c64bb2386c55d5c7a3878ae9e3f95577f00875
Author: Julien Cristau <jcristau@debian.org>
Date: Wed Mar 12 15:00:26 2008 +0100
Hide one more private symbol
commit 7282b53c47c2435c1ea23948272c9ccf1798178a
Author: Jesse Barnes <jbarnes@hobbes.(none)>
Date: Mon Jun 23 11:24:04 2008 -0700
Support write combine resource files in Linux sysfs
Starting with version 2.6.26, Linux will support resourceN_wc files which
export write combining mappings of PCI resource ranges, so support them if
present in libpciaccess.
commit f49f66710b6c3cc5edfd0681cf7b69063cb4b893
Author: Stefan Dirsch <sndirsch@suse.de>
Date: Mon Jun 23 10:50:30 2008 +0200
Fixed typo in output ("performace" --> "performance").
commit ed0555e4225aec26aaaa40f4f3c15fd914390817
Author: Adam Jackson <ajax@redhat.com>
Date: Tue Jun 10 15:24:56 2008 -0400

View File

@ -26,7 +26,7 @@ SUBDIRS = src
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = pciaccess.pc
EXTRA_DIST = pciaccess.pc.in autogen.sh src/scanpci.c
EXTRA_DIST = pciaccess.pc.in autogen.sh src/scanpci.c src/scanpci.man
EXTRA_DIST += ChangeLog
MAINTAINERCLEANFILES = ChangeLog

View File

@ -153,6 +153,8 @@ MAINT = @MAINT@
MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
MAKEINFO = @MAKEINFO@
NETBSD_FALSE = @NETBSD_FALSE@
NETBSD_TRUE = @NETBSD_TRUE@
NMEDIT = @NMEDIT@
OBJEXT = @OBJEXT@
OPENBSD_FALSE = @OPENBSD_FALSE@
@ -223,7 +225,8 @@ target_alias = @target_alias@
SUBDIRS = src
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = pciaccess.pc
EXTRA_DIST = pciaccess.pc.in autogen.sh src/scanpci.c ChangeLog
EXTRA_DIST = pciaccess.pc.in autogen.sh src/scanpci.c src/scanpci.man \
ChangeLog
MAINTAINERCLEANFILES = ChangeLog
all: config.h
$(MAKE) $(AM_MAKEFLAGS) all-recursive

View File

@ -7473,6 +7473,466 @@ AC_SUBST([am__tar])
AC_SUBST([am__untar])
]) # _AM_PROG_TAR
dnl xorg-macros.m4. Generated from xorg-macros.m4.in:xorgversion.m4 by configure.
dnl
dnl Copyright 2005-2006 Sun Microsystems, Inc. All rights reserved.
dnl
dnl Permission is hereby granted, free of charge, to any person obtaining a
dnl copy of this software and associated documentation files (the
dnl "Software"), to deal in the Software without restriction, including
dnl without limitation the rights to use, copy, modify, merge, publish,
dnl distribute, and/or sell copies of the Software, and to permit persons
dnl to whom the Software is furnished to do so, provided that the above
dnl copyright notice(s) and this permission notice appear in all copies of
dnl the Software and that both the above copyright notice(s) and this
dnl permission notice appear in supporting documentation.
dnl
dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
dnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
dnl OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
dnl HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
dnl INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
dnl FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
dnl NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
dnl WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
dnl
dnl Except as contained in this notice, the name of a copyright holder
dnl shall not be used in advertising or otherwise to promote the sale, use
dnl or other dealings in this Software without prior written authorization
dnl of the copyright holder.
# XORG_MACROS_VERSION(required-version)
# -------------------------------------
# Minimum version: 1.1.0
#
# If you're using a macro added in Version 1.1 or newer, include this in
# your configure.ac with the minimum required version, such as:
# XORG_MACROS_VERSION(1.1)
#
# To force at least a version with this macro defined, also add:
# m4_ifndef([XORG_MACROS_VERSION], [AC_FATAL([must install xorg-macros 1.1 or later before running autoconf/autogen])])
#
#
# See the "minimum version" comment for each macro you use to see what
# version you require.
AC_DEFUN([XORG_MACROS_VERSION],[
[XORG_MACROS_needed_version=$1
XORG_MACROS_needed_major=`echo $XORG_MACROS_needed_version | sed 's/\..*$//'`
XORG_MACROS_needed_minor=`echo $XORG_MACROS_needed_version | sed -e 's/^[0-9]*\.//' -e 's/\..*$//'`]
AC_MSG_CHECKING([if xorg-macros used to generate configure is at least ${XORG_MACROS_needed_major}.${XORG_MACROS_needed_minor}])
[XORG_MACROS_version=1.2.1
XORG_MACROS_major=`echo $XORG_MACROS_version | sed 's/\..*$//'`
XORG_MACROS_minor=`echo $XORG_MACROS_version | sed -e 's/^[0-9]*\.//' -e 's/\..*$//'`]
if test $XORG_MACROS_major -ne $XORG_MACROS_needed_major ; then
AC_MSG_ERROR([configure built with incompatible version of xorg-macros.m4 - requires version ${XORG_MACROS_major}.x])
fi
if test $XORG_MACROS_minor -lt $XORG_MACROS_needed_minor ; then
AC_MSG_ERROR([configure built with too old of a version of xorg-macros.m4 - requires version ${XORG_MACROS_major}.${XORG_MACROS_minor}.0 or newer])
fi
AC_MSG_RESULT([yes, $XORG_MACROS_version])
]) # XORG_MACROS_VERSION
# XORG_PROG_RAWCPP()
# ------------------
# Minimum version: 1.0.0
#
# Find cpp program and necessary flags for use in pre-processing text files
# such as man pages and config files
AC_DEFUN([XORG_PROG_RAWCPP],[
AC_REQUIRE([AC_PROG_CPP])
AC_PATH_PROGS(RAWCPP, [cpp], [${CPP}],
[$PATH:/bin:/usr/bin:/usr/lib:/usr/libexec:/usr/ccs/lib:/usr/ccs/lbin:/lib])
# Check for flag to avoid builtin definitions - assumes unix is predefined,
# which is not the best choice for supporting other OS'es, but covers most
# of the ones we need for now.
AC_MSG_CHECKING([if $RAWCPP requires -undef])
AC_LANG_CONFTEST([Does cpp redefine unix ?])
if test `${RAWCPP} < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
AC_MSG_RESULT([no])
else
if test `${RAWCPP} -undef < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
RAWCPPFLAGS=-undef
AC_MSG_RESULT([yes])
# under Cygwin unix is still defined even with -undef
elif test `${RAWCPP} -undef -ansi < conftest.$ac_ext | grep -c 'unix'` -eq 1 ; then
RAWCPPFLAGS="-undef -ansi"
AC_MSG_RESULT([yes, with -ansi])
else
AC_MSG_ERROR([${RAWCPP} defines unix with or without -undef. I don't know what to do.])
fi
fi
rm -f conftest.$ac_ext
AC_MSG_CHECKING([if $RAWCPP requires -traditional])
AC_LANG_CONFTEST([Does cpp preserve "whitespace"?])
if test `${RAWCPP} < conftest.$ac_ext | grep -c 'preserve \"'` -eq 1 ; then
AC_MSG_RESULT([no])
else
if test `${RAWCPP} -traditional < conftest.$ac_ext | grep -c 'preserve \"'` -eq 1 ; then
RAWCPPFLAGS="${RAWCPPFLAGS} -traditional"
AC_MSG_RESULT([yes])
else
AC_MSG_ERROR([${RAWCPP} does not preserve whitespace with or without -traditional. I don't know what to do.])
fi
fi
rm -f conftest.$ac_ext
AC_SUBST(RAWCPPFLAGS)
]) # XORG_PROG_RAWCPP
# XORG_MANPAGE_SECTIONS()
# -----------------------
# Minimum version: 1.0.0
#
# Determine which sections man pages go in for the different man page types
# on this OS - replaces *ManSuffix settings in old Imake *.cf per-os files.
# Not sure if there's any better way than just hardcoding by OS name.
# Override default settings by setting environment variables
AC_DEFUN([XORG_MANPAGE_SECTIONS],[
AC_REQUIRE([AC_CANONICAL_HOST])
if test x$APP_MAN_SUFFIX = x ; then
APP_MAN_SUFFIX=1
fi
if test x$APP_MAN_DIR = x ; then
APP_MAN_DIR='$(mandir)/man$(APP_MAN_SUFFIX)'
fi
if test x$LIB_MAN_SUFFIX = x ; then
LIB_MAN_SUFFIX=3
fi
if test x$LIB_MAN_DIR = x ; then
LIB_MAN_DIR='$(mandir)/man$(LIB_MAN_SUFFIX)'
fi
if test x$FILE_MAN_SUFFIX = x ; then
case $host_os in
solaris*) FILE_MAN_SUFFIX=4 ;;
*) FILE_MAN_SUFFIX=5 ;;
esac
fi
if test x$FILE_MAN_DIR = x ; then
FILE_MAN_DIR='$(mandir)/man$(FILE_MAN_SUFFIX)'
fi
if test x$MISC_MAN_SUFFIX = x ; then
case $host_os in
solaris*) MISC_MAN_SUFFIX=5 ;;
*) MISC_MAN_SUFFIX=7 ;;
esac
fi
if test x$MISC_MAN_DIR = x ; then
MISC_MAN_DIR='$(mandir)/man$(MISC_MAN_SUFFIX)'
fi
if test x$DRIVER_MAN_SUFFIX = x ; then
case $host_os in
solaris*) DRIVER_MAN_SUFFIX=7 ;;
*) DRIVER_MAN_SUFFIX=4 ;;
esac
fi
if test x$DRIVER_MAN_DIR = x ; then
DRIVER_MAN_DIR='$(mandir)/man$(DRIVER_MAN_SUFFIX)'
fi
if test x$ADMIN_MAN_SUFFIX = x ; then
case $host_os in
solaris*) ADMIN_MAN_SUFFIX=1m ;;
*) ADMIN_MAN_SUFFIX=8 ;;
esac
fi
if test x$ADMIN_MAN_DIR = x ; then
ADMIN_MAN_DIR='$(mandir)/man$(ADMIN_MAN_SUFFIX)'
fi
AC_SUBST([APP_MAN_SUFFIX])
AC_SUBST([LIB_MAN_SUFFIX])
AC_SUBST([FILE_MAN_SUFFIX])
AC_SUBST([MISC_MAN_SUFFIX])
AC_SUBST([DRIVER_MAN_SUFFIX])
AC_SUBST([ADMIN_MAN_SUFFIX])
AC_SUBST([APP_MAN_DIR])
AC_SUBST([LIB_MAN_DIR])
AC_SUBST([FILE_MAN_DIR])
AC_SUBST([MISC_MAN_DIR])
AC_SUBST([DRIVER_MAN_DIR])
AC_SUBST([ADMIN_MAN_DIR])
]) # XORG_MANPAGE_SECTIONS
# XORG_CHECK_LINUXDOC
# -------------------
# Minimum version: 1.0.0
#
# Defines the variable MAKE_TEXT if the necessary tools and
# files are found. $(MAKE_TEXT) blah.sgml will then produce blah.txt.
# Whether or not the necessary tools and files are found can be checked
# with the AM_CONDITIONAL "BUILD_LINUXDOC"
AC_DEFUN([XORG_CHECK_LINUXDOC],[
if test x$XORG_SGML_PATH = x ; then
XORG_SGML_PATH=$prefix/share/sgml
fi
HAVE_DEFS_ENT=
if test x"$cross_compiling" = x"yes" ; then
HAVE_DEFS_ENT=no
else
AC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
fi
AC_PATH_PROG(LINUXDOC, linuxdoc)
AC_PATH_PROG(PS2PDF, ps2pdf)
AC_MSG_CHECKING([Whether to build documentation])
if test x$HAVE_DEFS_ENT != x && test x$LINUXDOC != x ; then
BUILDDOC=yes
else
BUILDDOC=no
fi
AM_CONDITIONAL(BUILD_LINUXDOC, [test x$BUILDDOC = xyes])
AC_MSG_RESULT([$BUILDDOC])
AC_MSG_CHECKING([Whether to build pdf documentation])
if test x$PS2PDF != x && test x$BUILD_PDFDOC != xno; then
BUILDPDFDOC=yes
else
BUILDPDFDOC=no
fi
AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
AC_MSG_RESULT([$BUILDPDFDOC])
MAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH GROFF_NO_SGR=y $LINUXDOC -B txt"
MAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B latex --papersize=letter --output=ps"
MAKE_PDF="$PS2PDF"
MAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $LINUXDOC -B html --split=0"
AC_SUBST(MAKE_TEXT)
AC_SUBST(MAKE_PS)
AC_SUBST(MAKE_PDF)
AC_SUBST(MAKE_HTML)
]) # XORG_CHECK_LINUXDOC
# XORG_CHECK_DOCBOOK
# -------------------
# Minimum version: 1.0.0
#
# Checks for the ability to build output formats from SGML DocBook source.
# For XXX in {TXT, PDF, PS, HTML}, the AM_CONDITIONAL "BUILD_XXXDOC"
# indicates whether the necessary tools and files are found and, if set,
# $(MAKE_XXX) blah.sgml will produce blah.xxx.
AC_DEFUN([XORG_CHECK_DOCBOOK],[
if test x$XORG_SGML_PATH = x ; then
XORG_SGML_PATH=$prefix/share/sgml
fi
HAVE_DEFS_ENT=
BUILDTXTDOC=no
BUILDPDFDOC=no
BUILDPSDOC=no
BUILDHTMLDOC=no
AC_CHECK_FILE([$XORG_SGML_PATH/X11/defs.ent], [HAVE_DEFS_ENT=yes])
AC_PATH_PROG(DOCBOOKPS, docbook2ps)
AC_PATH_PROG(DOCBOOKPDF, docbook2pdf)
AC_PATH_PROG(DOCBOOKHTML, docbook2html)
AC_PATH_PROG(DOCBOOKTXT, docbook2txt)
AC_MSG_CHECKING([Whether to build text documentation])
if test x$HAVE_DEFS_ENT != x && test x$DOCBOOKTXT != x &&
test x$BUILD_TXTDOC != xno; then
BUILDTXTDOC=yes
fi
AM_CONDITIONAL(BUILD_TXTDOC, [test x$BUILDTXTDOC = xyes])
AC_MSG_RESULT([$BUILDTXTDOC])
AC_MSG_CHECKING([Whether to build PDF documentation])
if test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPDF != x &&
test x$BUILD_PDFDOC != xno; then
BUILDPDFDOC=yes
fi
AM_CONDITIONAL(BUILD_PDFDOC, [test x$BUILDPDFDOC = xyes])
AC_MSG_RESULT([$BUILDPDFDOC])
AC_MSG_CHECKING([Whether to build PostScript documentation])
if test x$HAVE_DEFS_ENT != x && test x$DOCBOOKPS != x &&
test x$BUILD_PSDOC != xno; then
BUILDPSDOC=yes
fi
AM_CONDITIONAL(BUILD_PSDOC, [test x$BUILDPSDOC = xyes])
AC_MSG_RESULT([$BUILDPSDOC])
AC_MSG_CHECKING([Whether to build HTML documentation])
if test x$HAVE_DEFS_ENT != x && test x$DOCBOOKHTML != x &&
test x$BUILD_HTMLDOC != xno; then
BUILDHTMLDOC=yes
fi
AM_CONDITIONAL(BUILD_HTMLDOC, [test x$BUILDHTMLDOC = xyes])
AC_MSG_RESULT([$BUILDHTMLDOC])
MAKE_TEXT="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKTXT"
MAKE_PS="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPS"
MAKE_PDF="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKPDF"
MAKE_HTML="SGML_SEARCH_PATH=$XORG_SGML_PATH $DOCBOOKHTML"
AC_SUBST(MAKE_TEXT)
AC_SUBST(MAKE_PS)
AC_SUBST(MAKE_PDF)
AC_SUBST(MAKE_HTML)
]) # XORG_CHECK_DOCBOOK
# XORG_CHECK_MALLOC_ZERO
# ----------------------
# Minimum version: 1.0.0
#
# Defines {MALLOC,XMALLOC,XTMALLOC}_ZERO_CFLAGS appropriately if
# malloc(0) returns NULL. Packages should add one of these cflags to
# their AM_CFLAGS (or other appropriate *_CFLAGS) to use them.
AC_DEFUN([XORG_CHECK_MALLOC_ZERO],[
AC_ARG_ENABLE(malloc0returnsnull,
AC_HELP_STRING([--enable-malloc0returnsnull],
[malloc(0) returns NULL (default: auto)]),
[MALLOC_ZERO_RETURNS_NULL=$enableval],
[MALLOC_ZERO_RETURNS_NULL=auto])
AC_MSG_CHECKING([whether malloc(0) returns NULL])
if test "x$MALLOC_ZERO_RETURNS_NULL" = xauto; then
AC_RUN_IFELSE([
char *malloc();
char *realloc();
char *calloc();
main() {
char *m0, *r0, *c0, *p;
m0 = malloc(0);
p = malloc(10);
r0 = realloc(p,0);
c0 = calloc(0);
exit(m0 == 0 || r0 == 0 || c0 == 0 ? 0 : 1);
}],
[MALLOC_ZERO_RETURNS_NULL=yes],
[MALLOC_ZERO_RETURNS_NULL=no])
fi
AC_MSG_RESULT([$MALLOC_ZERO_RETURNS_NULL])
if test "x$MALLOC_ZERO_RETURNS_NULL" = xyes; then
MALLOC_ZERO_CFLAGS="-DMALLOC_0_RETURNS_NULL"
XMALLOC_ZERO_CFLAGS=$MALLOC_ZERO_CFLAGS
XTMALLOC_ZERO_CFLAGS="$MALLOC_ZERO_CFLAGS -DXTMALLOC_BC"
else
MALLOC_ZERO_CFLAGS=""
XMALLOC_ZERO_CFLAGS=""
XTMALLOC_ZERO_CFLAGS=""
fi
AC_SUBST([MALLOC_ZERO_CFLAGS])
AC_SUBST([XMALLOC_ZERO_CFLAGS])
AC_SUBST([XTMALLOC_ZERO_CFLAGS])
]) # XORG_CHECK_MALLOC_ZERO
# XORG_WITH_LINT()
# ----------------
# Minimum version: 1.1.0
#
# Sets up flags for source checkers such as lint and sparse if --with-lint
# is specified. (Use --with-lint=sparse for sparse.)
# Sets $LINT to name of source checker passed with --with-lint (default: lint)
# Sets $LINT_FLAGS to flags to pass to source checker
# Sets LINT automake conditional if enabled (default: disabled)
#
AC_DEFUN([XORG_WITH_LINT],[
# Allow checking code with lint, sparse, etc.
AC_ARG_WITH(lint, [AC_HELP_STRING([--with-lint],
[Use a lint-style source code checker (default: disabled)])],
[use_lint=$withval], [use_lint=no])
if test "x$use_lint" = "xyes" ; then
LINT="lint"
else
LINT="$use_lint"
fi
if test "x$LINT_FLAGS" = "x" -a "x$LINT" != "xno" ; then
case $LINT in
lint|*/lint)
case $host_os in
solaris*)
LINT_FLAGS="-u -b -h -erroff=E_INDISTING_FROM_TRUNC2"
;;
esac
;;
esac
fi
AC_SUBST(LINT)
AC_SUBST(LINT_FLAGS)
AM_CONDITIONAL(LINT, [test x$LINT != xno])
]) # XORG_WITH_LINT
# XORG_LINT_LIBRARY(LIBNAME)
# --------------------------
# Minimum version: 1.1.0
#
# Sets up flags for building lint libraries for checking programs that call
# functions in the library.
# Disabled by default, enable with --enable-lint-library
# Sets:
# @LINTLIB@ - name of lint library file to make
# MAKE_LINT_LIB - automake conditional
#
AC_DEFUN([XORG_LINT_LIBRARY],[
AC_REQUIRE([XORG_WITH_LINT])
# Build lint "library" for more indepth checks of programs calling this library
AC_ARG_ENABLE(lint-library, [AC_HELP_STRING([--enable-lint-library],
[Create lint library (default: disabled)])],
[make_lint_lib=$enableval], [make_lint_lib=no])
if test "x$make_lint_lib" != "xno" ; then
if test "x$LINT" = "xno" ; then
AC_MSG_ERROR([Cannot make lint library without --with-lint])
fi
if test "x$make_lint_lib" = "xyes" ; then
LINTLIB=llib-l$1.ln
else
LINTLIB=$make_lint_lib
fi
fi
AC_SUBST(LINTLIB)
AM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno])
]) # XORG_LINT_LIBRARY
# XORG_CWARNFLAGS
# ---------------
# Minimum version: 1.2.0
#
# Defines CWARNFLAGS to enable C compiler warnings.
#
AC_DEFUN([XORG_CWARNFLAGS], [
AC_REQUIRE([AC_PROG_CC])
if test "x$GCC" = xyes ; then
CWARNFLAGS="-Wall -Wpointer-arith -Wstrict-prototypes -Wmissing-prototypes \
-Wmissing-declarations -Wnested-externs -fno-strict-aliasing \
-Wbad-function-cast"
case `gcc -dumpversion` in
3.4.* | 4.*)
CWARNFLAGS+=" -Wold-style-definition -Wdeclaration-after-statement"
;;
esac
else
AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
if test "x$SUNCC" = "xyes"; then
CWARNFLAGS="-v"
fi
fi
AC_SUBST(CWARNFLAGS)
]) # XORG_CWARNFLAGS
dnl Copyright 2005 Red Hat, Inc
dnl
dnl Permission to use, copy, modify, distribute, and sell this software and its
@ -7535,3 +7995,20 @@ AC_DEFUN([XORG_RELEASE_VERSION],[
[Patch version of this package])
])
# XORG_CHANGELOG()
# ----------------
# Minimum version: 1.2.0
#
# Defines the variable CHANGELOG_CMD as the command to generate
# ChangeLog from git.
#
# Arrange that distcleancheck ignores ChangeLog left over by distclean.
#
AC_DEFUN([XORG_CHANGELOG], [
CHANGELOG_CMD="(GIT_DIR=\$(top_srcdir)/.git git log > .changelog.tmp && \
mv .changelog.tmp ChangeLog) || (rm -f .changelog.tmp; touch ChangeLog; \
echo 'git directory not found: installing possibly empty changelog.' >&2)"
AC_SUBST([CHANGELOG_CMD])
AC_SUBST([distcleancheck_listfiles], ['find . -type f ! -name ChangeLog -print'])
]) # XORG_CHANGELOG

View File

@ -12,6 +12,9 @@
/* Use MTRRs on mappings */
#undef HAVE_MTRR
/* Have the pci_io.pi_sel.pc_domain member. */
#undef HAVE_PCI_IO_PC_DOMAIN
/* Define to 1 if you have the <stdint.h> header file. */
#undef HAVE_STDINT_H
@ -33,6 +36,9 @@
/* Define to 1 if you have the <unistd.h> header file. */
#undef HAVE_UNISTD_H
/* Use zlib to read gzip compressed pci.ids */
#undef HAVE_ZLIB
/* Name of package */
#undef PACKAGE

View File

@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.59 for libpciaccess 0.10.2.
# Generated by GNU Autoconf 2.59 for libpciaccess 0.10.5.
#
# Report bugs to <https://bugs.freedesktop.org/enter_bug.cgi?product=xorg&component=libpciaccess>.
#
@ -423,8 +423,8 @@ SHELL=${CONFIG_SHELL-/bin/sh}
# Identity of this package.
PACKAGE_NAME='libpciaccess'
PACKAGE_TARNAME='libpciaccess'
PACKAGE_VERSION='0.10.2'
PACKAGE_STRING='libpciaccess 0.10.2'
PACKAGE_VERSION='0.10.5'
PACKAGE_STRING='libpciaccess 0.10.5'
PACKAGE_BUGREPORT='https://bugs.freedesktop.org/enter_bug.cgi?product=xorg&component=libpciaccess'
# Factoring default headers for most tests.
@ -464,7 +464,7 @@ ac_includes_default="\
# include <unistd.h>
#endif"
ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE build build_cpu build_vendor build_os host host_cpu host_vendor host_os SED EGREP LN_S ECHO AR ac_ct_AR RANLIB ac_ct_RANLIB DSYMUTIL ac_ct_DSYMUTIL NMEDIT ac_ct_NMEDIT CPP CXX CXXFLAGS ac_ct_CXX CXXDEPMODE am__fastdepCXX_TRUE am__fastdepCXX_FALSE CXXCPP F77 FFLAGS ac_ct_F77 LIBTOOL PCIIDS_PATH LINUX_TRUE LINUX_FALSE FREEBSD_TRUE FREEBSD_FALSE OPENBSD_TRUE OPENBSD_FALSE SOLARIS_TRUE SOLARIS_FALSE PCIACCESS_CFLAGS PCIACCESS_LIBS LIBOBJS LTLIBOBJS'
ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA CYGPATH_W PACKAGE VERSION ACLOCAL AUTOCONF AUTOMAKE AUTOHEADER MAKEINFO install_sh STRIP ac_ct_STRIP INSTALL_STRIP_PROGRAM mkdir_p AWK SET_MAKE am__leading_dot AMTAR am__tar am__untar MAINTAINER_MODE_TRUE MAINTAINER_MODE_FALSE MAINT CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT DEPDIR am__include am__quote AMDEP_TRUE AMDEP_FALSE AMDEPBACKSLASH CCDEPMODE am__fastdepCC_TRUE am__fastdepCC_FALSE build build_cpu build_vendor build_os host host_cpu host_vendor host_os SED EGREP LN_S ECHO AR ac_ct_AR RANLIB ac_ct_RANLIB DSYMUTIL ac_ct_DSYMUTIL NMEDIT ac_ct_NMEDIT CPP CXX CXXFLAGS ac_ct_CXX CXXDEPMODE am__fastdepCXX_TRUE am__fastdepCXX_FALSE CXXCPP F77 FFLAGS ac_ct_F77 LIBTOOL PCIIDS_PATH LINUX_TRUE LINUX_FALSE FREEBSD_TRUE FREEBSD_FALSE NETBSD_TRUE NETBSD_FALSE OPENBSD_TRUE OPENBSD_FALSE SOLARIS_TRUE SOLARIS_FALSE PCIACCESS_CFLAGS PCIACCESS_LIBS LIBOBJS LTLIBOBJS'
ac_subst_files=''
# Initialize some variables set by options.
@ -953,7 +953,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures libpciaccess 0.10.2 to adapt to many kinds of systems.
\`configure' configures libpciaccess 0.10.5 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@ -1019,7 +1019,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of libpciaccess 0.10.2:";;
short | recursive ) echo "Configuration of libpciaccess 0.10.5:";;
esac
cat <<\_ACEOF
@ -1048,6 +1048,7 @@ Optional Packages:
include additional configurations [automatic]
--with-pciids-path=PCIIDS_PATH
Path to pci.ids file
--with-zlib Enable zlib support to read gzip compressed pci.ids
--with-release-version=STRING
Use release version string in package name
@ -1164,7 +1165,7 @@ fi
test -n "$ac_init_help" && exit 0
if $ac_init_version; then
cat <<\_ACEOF
libpciaccess configure 0.10.2
libpciaccess configure 0.10.5
generated by GNU Autoconf 2.59
Copyright (C) 2003 Free Software Foundation, Inc.
@ -1178,7 +1179,7 @@ cat >&5 <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by libpciaccess $as_me 0.10.2, which was
It was created by libpciaccess $as_me 0.10.5, which was
generated by GNU Autoconf 2.59. Invocation command line was
$ $0 $@
@ -1776,7 +1777,7 @@ fi
# Define the identity of the package.
PACKAGE='libpciaccess'
VERSION='0.10.2'
VERSION='0.10.5'
cat >>confdefs.h <<_ACEOF
@ -3671,7 +3672,7 @@ ia64-*-hpux*)
;;
*-*-irix6*)
# Find out which ABI we are using.
echo '#line 3674 "configure"' > conftest.$ac_ext
echo '#line 3675 "configure"' > conftest.$ac_ext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>&5
ac_status=$?
@ -5281,7 +5282,7 @@ fi
# Provide some information about the compiler.
echo "$as_me:5284:" \
echo "$as_me:5285:" \
"checking for Fortran 77 compiler version" >&5
ac_compiler=`set X $ac_compile; echo $2`
{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5
@ -6630,11 +6631,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:6633: $lt_compile\"" >&5)
(eval echo "\"\$as_me:6634: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
echo "$as_me:6637: \$? = $ac_status" >&5
echo "$as_me:6638: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@ -6920,11 +6921,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:6923: $lt_compile\"" >&5)
(eval echo "\"\$as_me:6924: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
echo "$as_me:6927: \$? = $ac_status" >&5
echo "$as_me:6928: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@ -7024,11 +7025,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:7027: $lt_compile\"" >&5)
(eval echo "\"\$as_me:7028: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
echo "$as_me:7031: \$? = $ac_status" >&5
echo "$as_me:7032: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@ -9425,7 +9426,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
#line 9428 "configure"
#line 9429 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@ -9525,7 +9526,7 @@ else
lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2
lt_status=$lt_dlunknown
cat > conftest.$ac_ext <<EOF
#line 9528 "configure"
#line 9529 "configure"
#include "confdefs.h"
#if HAVE_DLFCN_H
@ -11930,11 +11931,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:11933: $lt_compile\"" >&5)
(eval echo "\"\$as_me:11934: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
echo "$as_me:11937: \$? = $ac_status" >&5
echo "$as_me:11938: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@ -12034,11 +12035,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:12037: $lt_compile\"" >&5)
(eval echo "\"\$as_me:12038: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
echo "$as_me:12041: \$? = $ac_status" >&5
echo "$as_me:12042: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@ -13617,11 +13618,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:13620: $lt_compile\"" >&5)
(eval echo "\"\$as_me:13621: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
echo "$as_me:13624: \$? = $ac_status" >&5
echo "$as_me:13625: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@ -13721,11 +13722,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:13724: $lt_compile\"" >&5)
(eval echo "\"\$as_me:13725: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
echo "$as_me:13728: \$? = $ac_status" >&5
echo "$as_me:13729: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@ -15933,11 +15934,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:15936: $lt_compile\"" >&5)
(eval echo "\"\$as_me:15937: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
echo "$as_me:15940: \$? = $ac_status" >&5
echo "$as_me:15941: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@ -16223,11 +16224,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:16226: $lt_compile\"" >&5)
(eval echo "\"\$as_me:16227: $lt_compile\"" >&5)
(eval "$lt_compile" 2>conftest.err)
ac_status=$?
cat conftest.err >&5
echo "$as_me:16230: \$? = $ac_status" >&5
echo "$as_me:16231: \$? = $ac_status" >&5
if (exit $ac_status) && test -s "$ac_outfile"; then
# The compiler can only warn and ignore the option if not recognized
# So say no if there are warnings other than the usual output.
@ -16327,11 +16328,11 @@ else
-e 's:.*FLAGS}\{0,1\} :&$lt_compiler_flag :; t' \
-e 's: [^ ]*conftest\.: $lt_compiler_flag&:; t' \
-e 's:$: $lt_compiler_flag:'`
(eval echo "\"\$as_me:16330: $lt_compile\"" >&5)
(eval echo "\"\$as_me:16331: $lt_compile\"" >&5)
(eval "$lt_compile" 2>out/conftest.err)
ac_status=$?
cat out/conftest.err >&5
echo "$as_me:16334: \$? = $ac_status" >&5
echo "$as_me:16335: \$? = $ac_status" >&5
if (exit $ac_status) && test -s out/conftest2.$ac_objext
then
# The compiler can only warn and ignore the option if not recognized
@ -19039,6 +19040,239 @@ _ACEOF
test "$exec_prefix_NONE" && exec_prefix=NONE
# Check whether --with-zlib or --without-zlib was given.
if test "${with_zlib+set}" = set; then
withval="$with_zlib"
use_zlib="$withval"
else
use_zlib="no"
fi;
if test "x$use_zlib" = xyes; then
echo "$as_me:$LINENO: checking for gzopen in -lz" >&5
echo $ECHO_N "checking for gzopen in -lz... $ECHO_C" >&6
if test "${ac_cv_lib_z_gzopen+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lz $LIBS"
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
/* Override any gcc2 internal prototype to avoid an error. */
#ifdef __cplusplus
extern "C"
#endif
/* We use char because int might match the return type of a gcc2
builtin and then its argument prototype would still apply. */
char gzopen ();
int
main ()
{
gzopen ();
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext conftest$ac_exeext
if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
(eval $ac_link) 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -z "$ac_c_werror_flag"
|| test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; } &&
{ ac_try='test -s conftest$ac_exeext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_lib_z_gzopen=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_cv_lib_z_gzopen=no
fi
rm -f conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS
fi
echo "$as_me:$LINENO: result: $ac_cv_lib_z_gzopen" >&5
echo "${ECHO_T}$ac_cv_lib_z_gzopen" >&6
if test $ac_cv_lib_z_gzopen = yes; then
PCIACCESS_LIBS="$PCIACCESS_LIBS -lz"
else
{ { echo "$as_me:$LINENO: error: Check for zlib library failed" >&5
echo "$as_me: error: Check for zlib library failed" >&2;}
{ (exit 1); exit 1; }; }
fi
if test "${ac_cv_header_zlib_h+set}" = set; then
echo "$as_me:$LINENO: checking for zlib.h" >&5
echo $ECHO_N "checking for zlib.h... $ECHO_C" >&6
if test "${ac_cv_header_zlib_h+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
fi
echo "$as_me:$LINENO: result: $ac_cv_header_zlib_h" >&5
echo "${ECHO_T}$ac_cv_header_zlib_h" >&6
else
# Is the header compilable?
echo "$as_me:$LINENO: checking zlib.h usability" >&5
echo $ECHO_N "checking zlib.h usability... $ECHO_C" >&6
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$ac_includes_default
#include <zlib.h>
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -z "$ac_c_werror_flag"
|| test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; } &&
{ ac_try='test -s conftest.$ac_objext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_header_compiler=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_header_compiler=no
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
echo "${ECHO_T}$ac_header_compiler" >&6
# Is the header present?
echo "$as_me:$LINENO: checking zlib.h presence" >&5
echo $ECHO_N "checking zlib.h presence... $ECHO_C" >&6
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <zlib.h>
_ACEOF
if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
(eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } >/dev/null; then
if test -s conftest.err; then
ac_cpp_err=$ac_c_preproc_warn_flag
ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
else
ac_cpp_err=
fi
else
ac_cpp_err=yes
fi
if test -z "$ac_cpp_err"; then
ac_header_preproc=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_header_preproc=no
fi
rm -f conftest.err conftest.$ac_ext
echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
echo "${ECHO_T}$ac_header_preproc" >&6
# So? What about this header?
case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
yes:no: )
{ echo "$as_me:$LINENO: WARNING: zlib.h: accepted by the compiler, rejected by the preprocessor!" >&5
echo "$as_me: WARNING: zlib.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
{ echo "$as_me:$LINENO: WARNING: zlib.h: proceeding with the compiler's result" >&5
echo "$as_me: WARNING: zlib.h: proceeding with the compiler's result" >&2;}
ac_header_preproc=yes
;;
no:yes:* )
{ echo "$as_me:$LINENO: WARNING: zlib.h: present but cannot be compiled" >&5
echo "$as_me: WARNING: zlib.h: present but cannot be compiled" >&2;}
{ echo "$as_me:$LINENO: WARNING: zlib.h: check for missing prerequisite headers?" >&5
echo "$as_me: WARNING: zlib.h: check for missing prerequisite headers?" >&2;}
{ echo "$as_me:$LINENO: WARNING: zlib.h: see the Autoconf documentation" >&5
echo "$as_me: WARNING: zlib.h: see the Autoconf documentation" >&2;}
{ echo "$as_me:$LINENO: WARNING: zlib.h: section \"Present But Cannot Be Compiled\"" >&5
echo "$as_me: WARNING: zlib.h: section \"Present But Cannot Be Compiled\"" >&2;}
{ echo "$as_me:$LINENO: WARNING: zlib.h: proceeding with the preprocessor's result" >&5
echo "$as_me: WARNING: zlib.h: proceeding with the preprocessor's result" >&2;}
{ echo "$as_me:$LINENO: WARNING: zlib.h: in the future, the compiler will take precedence" >&5
echo "$as_me: WARNING: zlib.h: in the future, the compiler will take precedence" >&2;}
(
cat <<\_ASBOX
## --------------------------------------------------------------------------------------------- ##
## Report this to https://bugs.freedesktop.org/enter_bug.cgi?product=xorg&component=libpciaccess ##
## --------------------------------------------------------------------------------------------- ##
_ASBOX
) |
sed "s/^/$as_me: WARNING: /" >&2
;;
esac
echo "$as_me:$LINENO: checking for zlib.h" >&5
echo $ECHO_N "checking for zlib.h... $ECHO_C" >&6
if test "${ac_cv_header_zlib_h+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_cv_header_zlib_h=$ac_header_preproc
fi
echo "$as_me:$LINENO: result: $ac_cv_header_zlib_h" >&5
echo "${ECHO_T}$ac_cv_header_zlib_h" >&6
fi
if test $ac_cv_header_zlib_h = yes; then
cat >>confdefs.h <<\_ACEOF
#define HAVE_ZLIB 1
_ACEOF
else
{ { echo "$as_me:$LINENO: error: Check for zlib.h header file failed" >&5
echo "$as_me: error: Check for zlib.h header file failed" >&2;}
{ (exit 1); exit 1; }; }
fi
fi
if test "x$GCC" = "xyes"; then
GCC_WARNINGS1="-Wall -Wpointer-arith -Wstrict-prototypes"
GCC_WARNINGS2="-Wmissing-prototypes -Wmissing-declarations"
@ -19057,6 +19291,17 @@ case $host_os in
*linux*)
linux=yes
;;
*netbsd*)
case $host in
*i386*)
PCIACCESS_LIBS="-li386"
;;
*x86_64*|*amd64*)
PCIACCESS_LIBS="-lx86_64"
;;
esac
netbsd=yes
;;
*openbsd*)
openbsd=yes
;;
@ -19088,6 +19333,16 @@ fi
if test "x$netbsd" = xyes; then
NETBSD_TRUE=
NETBSD_FALSE='#'
else
NETBSD_TRUE='#'
NETBSD_FALSE=
fi
if test "x$openbsd" = xyes; then
OPENBSD_TRUE=
OPENBSD_FALSE='#'
@ -19107,29 +19362,151 @@ else
fi
echo "$as_me:$LINENO: checking for /usr/include/asm/mtrr.h" >&5
echo $ECHO_N "checking for /usr/include/asm/mtrr.h... $ECHO_C" >&6
if test "${ac_cv_file__usr_include_asm_mtrr_h+set}" = set; then
if test "${ac_cv_header_asm_mtrr_h+set}" = set; then
echo "$as_me:$LINENO: checking for asm/mtrr.h" >&5
echo $ECHO_N "checking for asm/mtrr.h... $ECHO_C" >&6
if test "${ac_cv_header_asm_mtrr_h+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
fi
echo "$as_me:$LINENO: result: $ac_cv_header_asm_mtrr_h" >&5
echo "${ECHO_T}$ac_cv_header_asm_mtrr_h" >&6
else
# Is the header compilable?
echo "$as_me:$LINENO: checking asm/mtrr.h usability" >&5
echo $ECHO_N "checking asm/mtrr.h usability... $ECHO_C" >&6
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
$ac_includes_default
#include <asm/mtrr.h>
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -z "$ac_c_werror_flag"
|| test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; } &&
{ ac_try='test -s conftest.$ac_objext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_header_compiler=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_header_compiler=no
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
echo "${ECHO_T}$ac_header_compiler" >&6
# Is the header present?
echo "$as_me:$LINENO: checking asm/mtrr.h presence" >&5
echo $ECHO_N "checking asm/mtrr.h presence... $ECHO_C" >&6
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <asm/mtrr.h>
_ACEOF
if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5
(eval $ac_cpp conftest.$ac_ext) 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } >/dev/null; then
if test -s conftest.err; then
ac_cpp_err=$ac_c_preproc_warn_flag
ac_cpp_err=$ac_cpp_err$ac_c_werror_flag
else
ac_cpp_err=
fi
else
ac_cpp_err=yes
fi
if test -z "$ac_cpp_err"; then
ac_header_preproc=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_header_preproc=no
fi
rm -f conftest.err conftest.$ac_ext
echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
echo "${ECHO_T}$ac_header_preproc" >&6
# So? What about this header?
case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
yes:no: )
{ echo "$as_me:$LINENO: WARNING: asm/mtrr.h: accepted by the compiler, rejected by the preprocessor!" >&5
echo "$as_me: WARNING: asm/mtrr.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
{ echo "$as_me:$LINENO: WARNING: asm/mtrr.h: proceeding with the compiler's result" >&5
echo "$as_me: WARNING: asm/mtrr.h: proceeding with the compiler's result" >&2;}
ac_header_preproc=yes
;;
no:yes:* )
{ echo "$as_me:$LINENO: WARNING: asm/mtrr.h: present but cannot be compiled" >&5
echo "$as_me: WARNING: asm/mtrr.h: present but cannot be compiled" >&2;}
{ echo "$as_me:$LINENO: WARNING: asm/mtrr.h: check for missing prerequisite headers?" >&5
echo "$as_me: WARNING: asm/mtrr.h: check for missing prerequisite headers?" >&2;}
{ echo "$as_me:$LINENO: WARNING: asm/mtrr.h: see the Autoconf documentation" >&5
echo "$as_me: WARNING: asm/mtrr.h: see the Autoconf documentation" >&2;}
{ echo "$as_me:$LINENO: WARNING: asm/mtrr.h: section \"Present But Cannot Be Compiled\"" >&5
echo "$as_me: WARNING: asm/mtrr.h: section \"Present But Cannot Be Compiled\"" >&2;}
{ echo "$as_me:$LINENO: WARNING: asm/mtrr.h: proceeding with the preprocessor's result" >&5
echo "$as_me: WARNING: asm/mtrr.h: proceeding with the preprocessor's result" >&2;}
{ echo "$as_me:$LINENO: WARNING: asm/mtrr.h: in the future, the compiler will take precedence" >&5
echo "$as_me: WARNING: asm/mtrr.h: in the future, the compiler will take precedence" >&2;}
(
cat <<\_ASBOX
## --------------------------------------------------------------------------------------------- ##
## Report this to https://bugs.freedesktop.org/enter_bug.cgi?product=xorg&component=libpciaccess ##
## --------------------------------------------------------------------------------------------- ##
_ASBOX
) |
sed "s/^/$as_me: WARNING: /" >&2
;;
esac
echo "$as_me:$LINENO: checking for asm/mtrr.h" >&5
echo $ECHO_N "checking for asm/mtrr.h... $ECHO_C" >&6
if test "${ac_cv_header_asm_mtrr_h+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
test "$cross_compiling" = yes &&
{ { echo "$as_me:$LINENO: error: cannot check for file existence when cross compiling" >&5
echo "$as_me: error: cannot check for file existence when cross compiling" >&2;}
{ (exit 1); exit 1; }; }
if test -r "/usr/include/asm/mtrr.h"; then
ac_cv_file__usr_include_asm_mtrr_h=yes
else
ac_cv_file__usr_include_asm_mtrr_h=no
ac_cv_header_asm_mtrr_h=$ac_header_preproc
fi
echo "$as_me:$LINENO: result: $ac_cv_header_asm_mtrr_h" >&5
echo "${ECHO_T}$ac_cv_header_asm_mtrr_h" >&6
fi
echo "$as_me:$LINENO: result: $ac_cv_file__usr_include_asm_mtrr_h" >&5
echo "${ECHO_T}$ac_cv_file__usr_include_asm_mtrr_h" >&6
if test $ac_cv_file__usr_include_asm_mtrr_h = yes; then
if test $ac_cv_header_asm_mtrr_h = yes; then
have_mtrr_h="yes"
else
have_mtrr_h="no"
fi
if test "x$have_mtrr_h" = xyes; then
cat >>confdefs.h <<\_ACEOF
@ -19138,6 +19515,122 @@ _ACEOF
fi
echo "$as_me:$LINENO: checking for struct pci_io.pi_sel.pc_domain" >&5
echo $ECHO_N "checking for struct pci_io.pi_sel.pc_domain... $ECHO_C" >&6
if test "${ac_cv_member_struct_pci_io_pi_sel_pc_domain+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <sys/types.h>
#include <sys/pciio.h>
int
main ()
{
static struct pci_io ac_aggr;
if (ac_aggr.pi_sel.pc_domain)
return 0;
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -z "$ac_c_werror_flag"
|| test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; } &&
{ ac_try='test -s conftest.$ac_objext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_member_struct_pci_io_pi_sel_pc_domain=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */
_ACEOF
cat confdefs.h >>conftest.$ac_ext
cat >>conftest.$ac_ext <<_ACEOF
/* end confdefs.h. */
#include <sys/types.h>
#include <sys/pciio.h>
int
main ()
{
static struct pci_io ac_aggr;
if (sizeof ac_aggr.pi_sel.pc_domain)
return 0;
;
return 0;
}
_ACEOF
rm -f conftest.$ac_objext
if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5
(eval $ac_compile) 2>conftest.er1
ac_status=$?
grep -v '^ *+' conftest.er1 >conftest.err
rm -f conftest.er1
cat conftest.err >&5
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); } &&
{ ac_try='test -z "$ac_c_werror_flag"
|| test ! -s conftest.err'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; } &&
{ ac_try='test -s conftest.$ac_objext'
{ (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
(eval $ac_try) 2>&5
ac_status=$?
echo "$as_me:$LINENO: \$? = $ac_status" >&5
(exit $ac_status); }; }; then
ac_cv_member_struct_pci_io_pi_sel_pc_domain=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_cv_member_struct_pci_io_pi_sel_pc_domain=no
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
rm -f conftest.err conftest.$ac_objext conftest.$ac_ext
fi
echo "$as_me:$LINENO: result: $ac_cv_member_struct_pci_io_pi_sel_pc_domain" >&5
echo "${ECHO_T}$ac_cv_member_struct_pci_io_pi_sel_pc_domain" >&6
if test $ac_cv_member_struct_pci_io_pi_sel_pc_domain = yes; then
cat >>confdefs.h <<\_ACEOF
#define HAVE_PCI_IO_PC_DOMAIN 1
_ACEOF
fi
@ -19315,6 +19808,13 @@ echo "$as_me: error: conditional \"FREEBSD\" was never defined.
Usually this means the macro was only invoked conditionally." >&2;}
{ (exit 1); exit 1; }; }
fi
if test -z "${NETBSD_TRUE}" && test -z "${NETBSD_FALSE}"; then
{ { echo "$as_me:$LINENO: error: conditional \"NETBSD\" was never defined.
Usually this means the macro was only invoked conditionally." >&5
echo "$as_me: error: conditional \"NETBSD\" was never defined.
Usually this means the macro was only invoked conditionally." >&2;}
{ (exit 1); exit 1; }; }
fi
if test -z "${OPENBSD_TRUE}" && test -z "${OPENBSD_FALSE}"; then
{ { echo "$as_me:$LINENO: error: conditional \"OPENBSD\" was never defined.
Usually this means the macro was only invoked conditionally." >&5
@ -19600,7 +20100,7 @@ _ASBOX
} >&5
cat >&5 <<_CSEOF
This file was extended by libpciaccess $as_me 0.10.2, which was
This file was extended by libpciaccess $as_me 0.10.5, which was
generated by GNU Autoconf 2.59. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@ -19663,7 +20163,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF
ac_cs_version="\\
libpciaccess config.status 0.10.2
libpciaccess config.status 0.10.5
configured by $0, generated by GNU Autoconf 2.59,
with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\"
@ -19941,6 +20441,8 @@ s,@LINUX_TRUE@,$LINUX_TRUE,;t t
s,@LINUX_FALSE@,$LINUX_FALSE,;t t
s,@FREEBSD_TRUE@,$FREEBSD_TRUE,;t t
s,@FREEBSD_FALSE@,$FREEBSD_FALSE,;t t
s,@NETBSD_TRUE@,$NETBSD_TRUE,;t t
s,@NETBSD_FALSE@,$NETBSD_FALSE,;t t
s,@OPENBSD_TRUE@,$OPENBSD_TRUE,;t t
s,@OPENBSD_FALSE@,$OPENBSD_FALSE,;t t
s,@SOLARIS_TRUE@,$SOLARIS_TRUE,;t t

View File

@ -40,7 +40,7 @@ dnl refers to ${prefix}. Thus we have to use `eval' twice.
AC_PREREQ([2.57])
AC_INIT(libpciaccess, 0.10.3, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg&component=libpciaccess], libpciaccess)
AC_INIT(libpciaccess, 0.10.5, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg&component=libpciaccess], libpciaccess)
AM_INIT_AUTOMAKE([dist-bzip2])
AM_MAINTAINER_MODE
@ -59,6 +59,19 @@ AC_ARG_WITH(pciids-path,
[PCIIDS_PATH="$DEFAULT_PCIIDS_PATH"])
AC_DEFINE_DIR(PCIIDS_PATH, PCIIDS_PATH, [Path to pci.ids])
AC_ARG_WITH(zlib,
AS_HELP_STRING([--with-zlib], [Enable zlib support to read gzip compressed pci.ids]),
[use_zlib="$withval"],
[use_zlib="no"])
if test "x$use_zlib" = xyes; then
AC_CHECK_LIB(z, gzopen,
[PCIACCESS_LIBS="$PCIACCESS_LIBS -lz"],
[AC_MSG_ERROR(Check for zlib library failed)])
AC_CHECK_HEADER([zlib.h],
[AC_DEFINE(HAVE_ZLIB, 1, [Use zlib to read gzip compressed pci.ids])],
[AC_MSG_ERROR(Check for zlib.h header file failed)])
fi
if test "x$GCC" = "xyes"; then
GCC_WARNINGS1="-Wall -Wpointer-arith -Wstrict-prototypes"
GCC_WARNINGS2="-Wmissing-prototypes -Wmissing-declarations"
@ -77,6 +90,17 @@ case $host_os in
*linux*)
linux=yes
;;
*netbsd*)
case $host in
*i386*)
PCIACCESS_LIBS="-li386"
;;
*x86_64*|*amd64*)
PCIACCESS_LIBS="-lx86_64"
;;
esac
netbsd=yes
;;
*openbsd*)
openbsd=yes
;;
@ -88,15 +112,24 @@ esac
AM_CONDITIONAL(LINUX, [test "x$linux" = xyes])
AM_CONDITIONAL(FREEBSD, [test "x$freebsd" = xyes])
AM_CONDITIONAL(NETBSD, [test "x$netbsd" = xyes])
AM_CONDITIONAL(OPENBSD, [test "x$openbsd" = xyes])
AM_CONDITIONAL(SOLARIS, [test "x$solaris" = xyes])
AC_CHECK_FILE([/usr/include/asm/mtrr.h],
[have_mtrr_h="yes"], [have_mtrr_h="no"])
AC_CHECK_HEADER([asm/mtrr.h], [have_mtrr_h="yes"], [have_mtrr_h="no"])
if test "x$have_mtrr_h" = xyes; then
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)

View File

@ -2127,17 +2127,6 @@ EOF
;;
esac
for pass in $passes; do
# The preopen pass in lib mode reverses $deplibs; put it back here
# so that -L comes before libs that need it for instance...
if test "$linkmode,$pass" = "lib,link"; then
## FIXME: Find the place where the list is rebuilt in the wrong
## order, and fix it there properly
tmp_deplibs=
for deplib in $deplibs; do
tmp_deplibs="$deplib $tmp_deplibs"
done
deplibs="$tmp_deplibs"
fi
if test "$linkmode,$pass" = "lib,link" ||
test "$linkmode,$pass" = "prog,scan"; then
libs="$deplibs"

View File

@ -33,6 +33,10 @@ if FREEBSD
OS_SUPPORT = freebsd_pci.c
endif
if NETBSD
OS_SUPPORT = netbsd_pci.c
endif
if OPENBSD
OS_SUPPORT = openbsd_pci.c
endif

View File

@ -87,10 +87,11 @@ am__libpciaccess_la_SOURCES_DIST = common_bridge.c common_iterator.c \
common_init.c common_interface.c common_capability.c \
common_device_name.c common_map.c pciaccess_private.h \
freebsd_pci.c linux_sysfs.c linux_devmem.c linux_devmem.h \
openbsd_pci.c solx_devfs.c pci_tools.h
@FREEBSD_FALSE@@LINUX_FALSE@@OPENBSD_FALSE@@SOLARIS_TRUE@am__objects_1 = solx_devfs.lo
@FREEBSD_FALSE@@LINUX_FALSE@@OPENBSD_TRUE@am__objects_1 = \
@FREEBSD_FALSE@@LINUX_FALSE@@OPENBSD_TRUE@ openbsd_pci.lo
netbsd_pci.c openbsd_pci.c solx_devfs.c pci_tools.h
@FREEBSD_FALSE@@LINUX_FALSE@@NETBSD_FALSE@@OPENBSD_FALSE@@SOLARIS_TRUE@am__objects_1 = solx_devfs.lo
@FREEBSD_FALSE@@LINUX_FALSE@@NETBSD_FALSE@@OPENBSD_TRUE@am__objects_1 = openbsd_pci.lo
@FREEBSD_FALSE@@LINUX_FALSE@@NETBSD_TRUE@am__objects_1 = \
@FREEBSD_FALSE@@LINUX_FALSE@@NETBSD_TRUE@ netbsd_pci.lo
@FREEBSD_FALSE@@LINUX_TRUE@am__objects_1 = linux_sysfs.lo \
@FREEBSD_FALSE@@LINUX_TRUE@ linux_devmem.lo
@FREEBSD_TRUE@am__objects_1 = freebsd_pci.lo
@ -169,6 +170,8 @@ MAINT = @MAINT@
MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
MAKEINFO = @MAKEINFO@
NETBSD_FALSE = @NETBSD_FALSE@
NETBSD_TRUE = @NETBSD_TRUE@
NMEDIT = @NMEDIT@
OBJEXT = @OBJEXT@
OPENBSD_FALSE = @OPENBSD_FALSE@
@ -240,6 +243,7 @@ AM_CFLAGS = @PCIACCESS_CFLAGS@
lib_LTLIBRARIES = libpciaccess.la
@FREEBSD_TRUE@OS_SUPPORT = freebsd_pci.c
@LINUX_TRUE@OS_SUPPORT = linux_sysfs.c linux_devmem.c linux_devmem.h
@NETBSD_TRUE@OS_SUPPORT = netbsd_pci.c
@OPENBSD_TRUE@OS_SUPPORT = openbsd_pci.c
@SOLARIS_TRUE@OS_SUPPORT = solx_devfs.c pci_tools.h
libpciaccess_la_SOURCES = common_bridge.c \
@ -351,6 +355,7 @@ distclean-compile:
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/freebsd_pci.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/linux_devmem.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/linux_sysfs.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/netbsd_pci.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/openbsd_pci.Plo@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/scanpci.Po@am__quote@
@AMDEP_TRUE@@am__include@ @am__quote@./$(DEPDIR)/solx_devfs.Plo@am__quote@

View File

@ -50,6 +50,31 @@
#define DO_MATCH(a,b) (((a) == PCI_MATCH_ANY) || ((a) == (b)))
#ifdef HAVE_ZLIB
#include <zlib.h>
typedef gzFile pci_id_file;
static pci_id_file
pci_id_file_open()
{
pci_id_file result;
result = gzopen(PCIIDS_PATH "/pci.ids.gz", "rb");
if (result)
return result;
return gzopen(PCIIDS_PATH "/pci.ids", "rb");
}
#define pci_id_file_gets(l, s, f) gzgets(f, l, s)
#define pci_id_file_close(f) gzclose(f)
#else
typedef FILE pci_id_file;
#define pci_id_file_open() fopen(PCIIDS_PATH "/pci.ids", "r")
#define pci_id_file_gets(l, s, f) fgets(l, s, f)
#define pci_id_file_close(f) fclose(f)
#endif
/**
* Node for sorting vendor IDs.
*
@ -95,12 +120,6 @@ struct pci_device_leaf {
*/
_pci_hidden struct pci_id_node * tree = NULL;
/**
* Name of the file containing the PCI ID information.
*/
static const char pci_id_file[] = PCIIDS_PATH "/pci.ids";
/**
* Get a pointer to the leaf node for a vendor ID.
*
@ -170,7 +189,7 @@ insert( uint16_t vendor )
static void
populate_vendor( struct pci_id_leaf * vend, int fill_device_data )
{
FILE * f = fopen( pci_id_file, "r" );
pci_id_file * f = pci_id_file_open();
char buf[128];
unsigned vendor = PCI_MATCH_ANY;
@ -186,12 +205,12 @@ populate_vendor( struct pci_id_leaf * vend, int fill_device_data )
* anything. This avoids wasted processing and potential memory leaks.
*/
if (vend->num_devices != 0) {
fclose(f);
pci_id_file_close( f );
return;
}
while( fgets( buf, sizeof( buf ), f ) != NULL ) {
while( pci_id_file_gets( buf, sizeof( buf ), f ) != NULL ) {
unsigned num_tabs;
char * new_line;
size_t length;
@ -284,7 +303,7 @@ populate_vendor( struct pci_id_leaf * vend, int fill_device_data )
}
}
fclose( f );
pci_id_file_close( f );
}

View File

@ -54,8 +54,10 @@ pci_system_init( void )
#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(__NetBSD__)
err = pci_system_netbsd_create();
#elif defined(__OpenBSD__)
err = pci_system_openbsd_create();
#elif defined(__sun)

View File

@ -64,7 +64,7 @@
#define HTOLE_16(x) htole16(x)
#define HTOLE_32(x) htole32(x)
#if defined(__FreeBSD__) || defined(__DragonFly__)
#if defined(__FreeBSD__) || defined(__DragonFly__) || defined(__NetBSD__)
#define LETOH_16(x) le16toh(x)
#define LETOH_32(x) le32toh(x)
#else
@ -110,7 +110,7 @@ pci_device_read_rom( struct pci_device * dev, void * buffer )
* \param dev Device to be probed.
*
* \return
* Zero on succes or an \c errno value on failure.
* Zero on success or an \c errno value on failure.
*/
int
pci_device_probe( struct pci_device * dev )
@ -127,7 +127,7 @@ pci_device_probe( struct pci_device * dev )
/**
* Map the specified BAR so that it can be accessed by the CPU.
*
* Maps the specified BAR for acces by the processor. The pointer to the
* Maps the specified BAR for access by the processor. The pointer to the
* mapped region is stored in the \c pci_mem_region::memory pointer for the
* BAR.
*
@ -166,7 +166,7 @@ pci_device_map_region(struct pci_device * dev, unsigned region,
* Map the specified memory range so that it can be accessed by the CPU.
*
* Maps the specified memory range for access by the processor. The pointer
* to the mapped region is stored in \c addr. In addtion, the
* to the mapped region is stored in \c addr. In addition, the
* \c pci_mem_region::memory pointer for the BAR will be updated.
*
* \param dev Device whose memory region is to be mapped.
@ -194,7 +194,7 @@ int pci_device_map_memory_range(struct pci_device *dev,
* Map the specified memory range so that it can be accessed by the CPU.
*
* Maps the specified memory range for access by the processor. The pointer
* to the mapped region is stored in \c addr. In addtion, the
* to the mapped region is stored in \c addr. In addition, the
* \c pci_mem_region::memory pointer for the BAR will be updated.
*
* \param dev Device whose memory region is to be mapped.
@ -415,7 +415,7 @@ pci_device_unmap_range(struct pci_device *dev, void *memory,
*
* Reads data from the device's PCI configuration space. As with the system
* read command, less data may be returned, without an error, than was
* requested. This is particuarly the case if a non-root user tries to read
* requested. This is particularly the case if a non-root user tries to read
* beyond the first 64-bytes of configuration space.
*
* \param dev Device whose PCI configuration data is to be read.
@ -429,7 +429,7 @@ pci_device_unmap_range(struct pci_device *dev, void *memory,
* Zero on success or an errno value on failure.
*
* \note
* Data read from PCI configuartion space using this routine is \b not
* Data read from PCI configuration space using this routine is \b not
* byte-swapped to the host's byte order. PCI configuration data is always
* stored in little-endian order, and that is what this routine returns.
*/
@ -500,7 +500,7 @@ pci_device_cfg_read_u32( struct pci_device * dev, uint32_t * data,
/**
* Write arbitrary bytes to device's PCI config space
*
* Writess data to the device's PCI configuration space. As with the system
* Writes data to the device's PCI configuration space. As with the system
* write command, less data may be written, without an error, than was
* requested.
*
@ -515,7 +515,7 @@ pci_device_cfg_read_u32( struct pci_device * dev, uint32_t * data,
* Zero on success or an errno value on failure.
*
* \note
* Data written to PCI configuartion space using this routine is \b not
* Data written to PCI configuration space using this routine is \b not
* byte-swapped from the host's byte order. PCI configuration data is always
* stored in little-endian order, so data written with this routine should be
* put in that order in advance.

View File

@ -43,12 +43,7 @@
#include <sys/mman.h>
#include <sys/memrange.h>
#if __FreeBSD_version >= 700053
#define DOMAIN_SUPPORT 1
#else
#define DOMAIN_SUPPORT 0
#endif
#include "config.h"
#include "pciaccess.h"
#include "pciaccess_private.h"
@ -64,6 +59,7 @@
*
* It is initialized once and used as a global, just as pci_system is used.
*/
_pci_hidden
struct freebsd_pci_system {
/* This must be the first entry in the structure, as pci_system_cleanup()
* frees pci_sys.
@ -167,7 +163,7 @@ pci_device_freebsd_read( struct pci_device * dev, void * data,
{
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;
@ -207,7 +203,7 @@ pci_device_freebsd_write( struct pci_device * dev, const void * data,
{
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;
@ -487,7 +483,7 @@ pci_system_freebsd_create( void )
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;

View File

@ -145,7 +145,7 @@ pci_device_linux_devmem_read_rom(struct pci_device *dev, void *buffer)
const int tmp_err = pci_device_cfg_write_u32(& priv->base,
rom_base_tmp, 48);
/* Prefer to return the first error that occured.
/* Prefer to return the first error that occurred.
*/
if (err == 0) {
err = tmp_err;

View File

@ -26,7 +26,7 @@
* \file linux_sysfs.c
* Access PCI subsystem using Linux's sysfs interface. This interface is
* available starting somewhere in the late 2.5.x kernel phase, and is the
* prefered method on all 2.6.x kernels.
* preferred method on all 2.6.x kernels.
*
* \author Ian Romanick <idr@us.ibm.com>
*/
@ -73,7 +73,7 @@ static int pci_device_linux_sysfs_read( struct pci_device * dev, void * data,
static int pci_device_linux_sysfs_write( struct pci_device * dev,
const void * data, pciaddr_t offset, pciaddr_t size,
pciaddr_t * bytes_wrtten );
pciaddr_t * bytes_written );
static const struct pci_system_methods linux_sysfs_methods = {
.destroy = NULL,
@ -484,6 +484,40 @@ pci_device_linux_sysfs_write( struct pci_device * dev, const void * data,
return err;
}
static int
pci_device_linux_sysfs_map_range_wc(struct pci_device *dev,
struct pci_device_mapping *map)
{
char name[256];
int fd;
const int prot = ((map->flags & PCI_DEV_MAP_FLAG_WRITABLE) != 0)
? (PROT_READ | PROT_WRITE) : PROT_READ;
const int open_flags = ((map->flags & PCI_DEV_MAP_FLAG_WRITABLE) != 0)
? O_RDWR : O_RDONLY;
const off_t offset = map->base - dev->regions[map->region].base_addr;
snprintf(name, 255, "%s/%04x:%02x:%02x.%1u/resource%u_wc",
SYS_BUS_PCI,
dev->domain,
dev->bus,
dev->dev,
dev->func,
map->region);
fd = open(name, open_flags);
if (fd == -1)
return errno;
map->memory = mmap(NULL, map->size, prot, MAP_SHARED, fd, offset);
if (map->memory == MAP_FAILED) {
map->memory = NULL;
close(fd);
return errno;
}
close(fd);
return 0;
}
/**
* Map a memory region for a device using the Linux sysfs interface.
@ -521,6 +555,11 @@ pci_device_linux_sysfs_map_range(struct pci_device *dev,
};
#endif
/* For WC mappings, try sysfs resourceN_wc file first */
if ((map->flags & PCI_DEV_MAP_FLAG_WRITE_COMBINE) &&
!pci_device_linux_sysfs_map_range_wc(dev, map))
return 0;
snprintf(name, 255, "%s/%04x:%02x:%02x.%1u/resource%u",
SYS_BUS_PCI,
dev->domain,
@ -537,12 +576,11 @@ pci_device_linux_sysfs_map_range(struct pci_device *dev,
map->memory = mmap(NULL, map->size, prot, MAP_SHARED, fd, offset);
if (map->memory == MAP_FAILED) {
err = errno;
map->memory = NULL;
close(fd);
return errno;
}
close(fd);
#ifdef HAVE_MTRR
if ((map->flags & PCI_DEV_MAP_FLAG_CACHABLE) != 0) {
sentry.type = MTRR_TYPE_WRBACK;
@ -562,11 +600,27 @@ pci_device_linux_sysfs_map_range(struct pci_device *dev,
}
/* KLUDGE ALERT -- rewrite the PTEs to turn off the CD and WT bits */
mprotect (map->memory, map->size, PROT_NONE);
mprotect (map->memory, map->size, PROT_READ|PROT_WRITE);
err = mprotect (map->memory, map->size, PROT_READ|PROT_WRITE);
if (err != 0) {
fprintf(stderr, "mprotect(PROT_READ | PROT_WRITE) failed: %s\n",
strerror(errno));
fprintf(stderr, "remapping without mprotect performance kludge.\n");
munmap(map->memory, map->size);
map->memory = mmap(NULL, map->size, prot, MAP_SHARED, fd, offset);
if (map->memory == MAP_FAILED) {
map->memory = NULL;
close(fd);
return errno;
}
}
}
#endif
return err;
close(fd);
return 0;
}
/**

View File

@ -0,0 +1,409 @@
/*
* Copyright (c) 2008 Juan Romero Pardines
* Copyright (c) 2008 Mark Kettenis
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
* THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
* WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
* MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
* ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
* WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
* ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
* OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
#include <sys/param.h>
#include <sys/ioctl.h>
#include <sys/mman.h>
#include <sys/types.h>
#include <machine/sysarch.h>
#include <machine/mtrr.h>
#include <dev/pci/pciio.h>
#include <dev/pci/pcireg.h>
#include <dev/pci/pcidevs.h>
#include <errno.h>
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include "pciaccess.h"
#include "pciaccess_private.h"
static int pcifd;
static int
pci_read(int bus, int dev, int func, uint32_t reg, uint32_t *val)
{
struct pciio_bdf_cfgreg io;
int err;
bzero(&io, sizeof(io));
io.bus = bus;
io.device = dev;
io.function = func;
io.cfgreg.reg = reg;
err = ioctl(pcifd, PCI_IOC_BDF_CFGREAD, &io);
if (err)
return (err);
*val = io.cfgreg.val;
return 0;
}
static int
pci_write(int bus, int dev, int func, uint32_t reg, uint32_t val)
{
struct pciio_bdf_cfgreg io;
bzero(&io, sizeof(io));
io.bus = bus;
io.device = dev;
io.function = func;
io.cfgreg.reg = reg;
io.cfgreg.val = val;
return ioctl(pcifd, PCI_IOC_BDF_CFGWRITE, &io);
}
static int
pci_nfuncs(int bus, int dev)
{
uint32_t hdr;
if (pci_read(bus, dev, 0, PCI_BHLC_REG, &hdr) != 0)
return -1;
return (PCI_HDRTYPE_MULTIFN(hdr) ? 8 : 1);
}
static int
pci_device_netbsd_map_range(struct pci_device *dev,
struct pci_device_mapping *map)
{
struct mtrr mtrr;
int fd, error, nmtrr, prot = PROT_READ;
if ((fd = open("/dev/mem", O_RDWR)) == -1)
return errno;
if (map->flags & PCI_DEV_MAP_FLAG_WRITABLE)
prot |= PROT_WRITE;
map->memory = mmap(NULL, map->size, prot, MAP_SHARED,
fd, map->base);
if (map->memory == MAP_FAILED)
return errno;
/* No need to set an MTRR if it's the default mode. */
if ((map->flags & PCI_DEV_MAP_FLAG_CACHABLE) ||
(map->flags & PCI_DEV_MAP_FLAG_WRITE_COMBINE)) {
mtrr.base = map->base;
mtrr.len = map->size;
mtrr.flags = MTRR_VALID;
if (map->flags & PCI_DEV_MAP_FLAG_CACHABLE)
mtrr.type = MTRR_TYPE_WB;
if (map->flags & PCI_DEV_MAP_FLAG_WRITE_COMBINE)
mtrr.type = MTRR_TYPE_WC;
#ifdef __i386__
error = i386_set_mtrr(&mtrr, &nmtrr);
#endif
#ifdef __amd64__
error = x86_64_set_mtrr(&mtrr, &nmtrr);
#endif
if (error) {
close(fd);
return errno;
}
}
close(fd);
return 0;
}
static int
pci_device_netbsd_unmap_range(struct pci_device *dev,
struct pci_device_mapping *map)
{
struct mtrr mtrr;
int nmtrr, error;
if ((map->flags & PCI_DEV_MAP_FLAG_CACHABLE) ||
(map->flags & PCI_DEV_MAP_FLAG_WRITE_COMBINE)) {
mtrr.base = map->base;
mtrr.len = map->size;
mtrr.type = MTRR_TYPE_UC;
mtrr.flags = 0; /* clear/set MTRR */
#ifdef __i386__
error = i386_set_mtrr(&mtrr, &nmtrr);
#endif
#ifdef __amd64__
error = x86_64_set_mtrr(&mtrr, &nmtrr);
#endif
if (error)
return errno;
}
return pci_device_generic_unmap_range(dev, map);
}
static int
pci_device_netbsd_read(struct pci_device *dev, void *data,
pciaddr_t offset, pciaddr_t size, pciaddr_t *bytes_read)
{
struct pciio_bdf_cfgreg io;
io.bus = dev->bus;
io.device = dev->dev;
io.function = dev->func;
*bytes_read = 0;
while (size > 0) {
int toread = MIN(size, 4 - (offset & 0x3));
io.cfgreg.reg = (offset & ~0x3);
if (ioctl(pcifd, PCI_IOC_BDF_CFGREAD, &io) == -1)
return errno;
io.cfgreg.val = htole32(io.cfgreg.val);
io.cfgreg.val >>= ((offset & 0x3) * 8);
memcpy(data, &io.cfgreg.val, toread);
offset += toread;
data = (char *)data + toread;
size -= toread;
*bytes_read += toread;
}
return 0;
}
static int
pci_device_netbsd_write(struct pci_device *dev, const void *data,
pciaddr_t offset, pciaddr_t size, pciaddr_t *bytes_written)
{
struct pciio_bdf_cfgreg io;
if ((offset % 4) == 0 || (size % 4) == 0)
return EINVAL;
io.bus = dev->bus;
io.device = dev->dev;
io.function = dev->func;
*bytes_written = 0;
while (size > 0) {
io.cfgreg.reg = offset;
memcpy(&io.cfgreg.val, data, 4);
if (ioctl(pcifd, PCI_IOC_BDF_CFGWRITE, &io) == -1)
return errno;
offset += 4;
data = (char *)data + 4;
size -= 4;
*bytes_written += 4;
}
return 0;
}
static void
pci_system_netbsd_destroy(void)
{
close(pcifd);
free(pci_sys);
pci_sys = NULL;
}
static int
pci_device_netbsd_probe(struct pci_device *device)
{
struct pci_device_private *priv = (struct pci_device_private *)device;
struct pci_mem_region *region;
uint64_t reg64, size64;
uint32_t bar, reg, size;
int bus, dev, func, err;
bus = device->bus;
dev = device->dev;
func = device->func;
err = pci_read(bus, dev, func, PCI_BHLC_REG, &reg);
if (err)
return err;
priv->header_type = PCI_HDRTYPE_TYPE(reg);
if (priv->header_type != 0)
return 0;
region = device->regions;
for (bar = PCI_MAPREG_START; bar < PCI_MAPREG_END;
bar += sizeof(uint32_t), region++) {
err = pci_read(bus, dev, func, bar, &reg);
if (err)
return err;
/* Probe the size of the region. */
err = pci_write(bus, dev, func, bar, ~0);
if (err)
return err;
pci_read(bus, dev, func, bar, &size);
pci_write(bus, dev, func, bar, reg);
if (PCI_MAPREG_TYPE(reg) == PCI_MAPREG_TYPE_IO) {
region->is_IO = 1;
region->base_addr = PCI_MAPREG_IO_ADDR(reg);
region->size = PCI_MAPREG_IO_SIZE(size);
} else {
if (PCI_MAPREG_MEM_PREFETCHABLE(reg))
region->is_prefetchable = 1;
switch(PCI_MAPREG_MEM_TYPE(reg)) {
case PCI_MAPREG_MEM_TYPE_32BIT:
case PCI_MAPREG_MEM_TYPE_32BIT_1M:
region->base_addr = PCI_MAPREG_MEM_ADDR(reg);
region->size = PCI_MAPREG_MEM_SIZE(size);
break;
case PCI_MAPREG_MEM_TYPE_64BIT:
region->is_64 = 1;
reg64 = reg;
size64 = size;
bar += sizeof(uint32_t);
err = pci_read(bus, dev, func, bar, &reg);
if (err)
return err;
reg64 |= (uint64_t)reg << 32;
err = pci_write(bus, dev, func, bar, ~0);
if (err)
return err;
pci_read(bus, dev, func, bar, &size);
pci_write(bus, dev, func, bar, reg64 >> 32);
size64 |= (uint64_t)size << 32;
region->base_addr = PCI_MAPREG_MEM64_ADDR(reg64);
region->size = PCI_MAPREG_MEM64_SIZE(size64);
region++;
break;
}
}
}
return 0;
}
static const struct pci_system_methods netbsd_pci_methods = {
pci_system_netbsd_destroy,
NULL,
NULL,
pci_device_netbsd_probe,
pci_device_netbsd_map_range,
pci_device_netbsd_unmap_range,
pci_device_netbsd_read,
pci_device_netbsd_write,
pci_fill_capabilities_generic
};
int
pci_system_netbsd_create(void)
{
struct pci_device_private *device;
int bus, dev, func, ndevs, nfuncs;
uint32_t reg;
pcifd = open("/dev/pci0", O_RDWR);
if (pcifd == -1)
return ENXIO;
pci_sys = calloc(1, sizeof(struct pci_system));
if (pci_sys == NULL) {
close(pcifd);
return ENOMEM;
}
pci_sys->methods = &netbsd_pci_methods;
ndevs = 0;
for (bus = 0; bus < 256; bus++) {
for (dev = 0; dev < 32; dev++) {
nfuncs = pci_nfuncs(bus, dev);
for (func = 0; func < nfuncs; func++) {
if (pci_read(bus, dev, func, PCI_ID_REG,
&reg) != 0)
continue;
if (PCI_VENDOR(reg) == PCI_VENDOR_INVALID ||
PCI_VENDOR(reg) == 0)
continue;
ndevs++;
}
}
}
pci_sys->num_devices = ndevs;
pci_sys->devices = calloc(ndevs, sizeof(struct pci_device_private));
if (pci_sys->devices == NULL) {
free(pci_sys);
close(pcifd);
return ENOMEM;
}
device = pci_sys->devices;
for (bus = 0; bus < 256; bus++) {
for (dev = 0; dev < 32; dev++) {
nfuncs = pci_nfuncs(bus, dev);
for (func = 0; func < nfuncs; func++) {
if (pci_read(bus, dev, func, PCI_ID_REG,
&reg) != 0)
continue;
if (PCI_VENDOR(reg) == PCI_VENDOR_INVALID ||
PCI_VENDOR(reg) == 0)
continue;
device->base.domain = 0;
device->base.bus = bus;
device->base.dev = dev;
device->base.func = func;
device->base.vendor_id = PCI_VENDOR(reg);
device->base.device_id = PCI_PRODUCT(reg);
if (pci_read(bus, dev, func, PCI_CLASS_REG,
&reg) != 0)
continue;
device->base.device_class =
PCI_INTERFACE(reg) | PCI_CLASS(reg) << 16 |
PCI_SUBCLASS(reg) << 8;
device->base.revision = PCI_REVISION(reg);
if (pci_read(bus, dev, func, PCI_SUBSYS_ID_REG,
&reg) != 0)
continue;
device->base.subvendor_id = PCI_VENDOR(reg);
device->base.subdevice_id = PCI_PRODUCT(reg);
device++;
}
}
}
return 0;
}

View File

@ -1,25 +1,30 @@
/*
* Copyright (c) 2007, Sun Microsystems, Inc.
* All Rights Reserved.
*
* Copyright 2007 Sun Microsystems, Inc. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* on the rights to use, copy, modify, merge, publish, distribute, sub
* license, and/or sell copies of the Software, and to permit persons to whom
* the Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice (including the next
* paragraph) shall be included in all copies or substantial portions of the
* Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
* FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
* IBM AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
* DEALINGS IN THE SOFTWARE.
* copy of this software and associated documentation files (the
* "Software"), to deal in the Software without restriction, including
* without limitation the rights to use, copy, modify, merge, publish,
* distribute, and/or sell copies of the Software, and to permit persons
* to whom the Software is furnished to do so, provided that the above
* copyright notice(s) and this permission notice appear in all copies of
* the Software and that both the above copyright notice(s) and this
* permission notice appear in supporting documentation.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT
* OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
* HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL
* INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING
* FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT,
* NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION
* WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*
* Except as contained in this notice, the name of a copyright holder
* shall not be used in advertising or otherwise to promote the sale, use
* or other dealings in this Software without prior written authorization
* of the copyright holder.
*/
#ifndef _SYS_PCI_TOOLS_H
#define _SYS_PCI_TOOLS_H
@ -184,7 +189,7 @@ typedef struct pcitool_intr_get {
#define PCITOOL_ACC_IS_BIG_ENDIAN(x) (x & PCITOOL_ACC_ATTR_ENDN_BIG)
/*
* Data stucture to read and write to pci device registers.
* Data structure to read and write to pci device registers.
* This is the argument to the following ioctls:
* PCITOOL_DEVICE_SET/GET_REG
* PCITOOL_NEXUS_SET/GET_REG

View File

@ -136,6 +136,7 @@ extern struct pci_system * pci_sys;
extern int pci_system_linux_sysfs_create( void );
extern int pci_system_freebsd_create( void );
extern int pci_system_netbsd_create( void );
extern int pci_system_openbsd_create( void );
extern void pci_system_openbsd_init_dev_mem( int );
extern int pci_system_solx_devfs_create( void );

View File

@ -181,6 +181,23 @@ int main( int argc, char ** argv )
struct pci_device_iterator * iter;
struct pci_device * dev;
int ret;
int verbose = 0;
int c;
int errors = 0;
while ((c = getopt(argc, argv, "v")) != -1) {
switch (c) {
case 'v':
verbose = 1;
break;
case '?':
errors++;
}
}
if (errors != 0) {
fprintf(stderr, "usage: %s [-v]\n", argv[0]);
exit(2);
}
ret = pci_system_init();
if (ret != 0)
@ -189,7 +206,7 @@ int main( int argc, char ** argv )
iter = pci_slot_match_iterator_create( NULL );
while ( (dev = pci_device_next( iter )) != NULL ) {
print_pci_device( dev, 1 );
print_pci_device( dev, verbose );
}
pci_system_cleanup();

View File

@ -0,0 +1,44 @@
.\" Copyright (C) 2000 The XFree86 Project, Inc. All Rights Reserved.
.\"
.\" Permission is hereby granted, free of charge, to any person obtaining a copy
.\" of this software and associated documentation files (the "Software"), to
.\" deal in the Software without restriction, including without limitation the
.\" rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
.\" sell copies of the Software, and to permit persons to whom the Software is
.\" furnished to do so, subject to the following conditions:
.\"
.\" The above copyright notice and this permission notice shall be included in
.\" all copies or substantial portions of the Software.
.\"
.\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
.\" IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
.\" FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
.\" XFREE86 PROJECT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
.\" IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
.\" CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
.\"
.\" Except as contained in this notice, the name of the XFree86 Project shall
.\" not be used in advertising or otherwise to promote the sale, use or other
.\" dealings in this Software without prior written authorization from the
.\" XFree86 Project.
.\"
.TH SCANPCI 1 __xorgversion__
.SH NAME
scanpci - scan/probe PCI buses
.SH SYNOPSIS
.B scanpci
.RB [ \-v ]
.SH DESCRIPTION
.I Scanpci
is a utility that can be used to scan PCI buses and report information
about the configuration space settings for each PCI device.
On most platforms,
.I scanpci
can only be run by the root user.
.SH OPTIONS
.TP 8
.B \-v
Print the configuration space information for each device in a verbose
format. Without this option, only a brief description is printed for
each device.

File diff suppressed because it is too large Load Diff