Update to libpciaccess 0.13. Tested by shadchin@
This commit is contained in:
parent
2dc64e37e0
commit
37b152092c
@ -1,6 +1,6 @@
|
||||
(C) Copyright IBM Corporation 2006, 2007
|
||||
(C) Copyright Eric Anholt 2006
|
||||
Copyright (c) 2007, 2008, 2009, Oracle and/or its affiliates.
|
||||
Copyright (c) 2007, 2008, 2009, 2011, Oracle and/or its affiliates.
|
||||
Copyright 2009 Red Hat, Inc.
|
||||
All Rights Reserved.
|
||||
|
||||
|
@ -219,6 +219,316 @@ Date: Fri Sep 25 21:19:41 2009 +0200
|
||||
|
||||
Merge remote branch 'origin/master' into obsd
|
||||
|
||||
commit bf705561d347bc5459bc0af033595c66541cac3e
|
||||
Author: Jeremy Huddleston <jeremyhu@apple.com>
|
||||
Date: Sat Mar 3 18:19:11 2012 -0800
|
||||
|
||||
configure.ac: Bump to 0.13
|
||||
|
||||
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
|
||||
|
||||
commit f550c1347d3518874fe1c1d417a57322ee6b52db
|
||||
Author: Adam Jackson <ajax@redhat.com>
|
||||
Date: Mon Feb 27 10:43:20 2012 -0500
|
||||
|
||||
linux: Don't use /dev/port
|
||||
|
||||
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
|
||||
Signed-off-by: Adam Jackson <ajax@redhat.com>
|
||||
|
||||
commit 2a58cd13c3d14cd2ea57826b56e9906ecfc5648a
|
||||
Author: Mathias Krause <mathias.krause@secunet.com>
|
||||
Date: Fri Feb 24 09:39:31 2012 +0100
|
||||
|
||||
Use correct type for pci_id file accessor functions
|
||||
|
||||
This fixes the compiler warning of using the wrong type for gzgets() and
|
||||
gzclose() as they want a gzFile argument, not a pointer to gzFile. The
|
||||
abstraction layer pci_id_file should just abstract the full type.
|
||||
|
||||
Signed-off-by: Mathias Krause <mathias.krause@secunet.com>
|
||||
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
|
||||
|
||||
commit 167ffb1c4e431763e30c894131e704bb3599c7c1
|
||||
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
|
||||
Date: Wed Feb 8 22:14:08 2012 -0800
|
||||
|
||||
solx_devfs.c: fix gcc warnings about casting away const when reading data
|
||||
|
||||
solx_devfs.c: In function `pci_device_solx_devfs_write':
|
||||
solx_devfs.c:1085: warning: cast discards qualifiers from pointer target type
|
||||
solx_devfs.c:1089: warning: cast discards qualifiers from pointer target type
|
||||
solx_devfs.c:1093: warning: cast discards qualifiers from pointer target type
|
||||
solx_devfs.c:1097: warning: cast discards qualifiers from pointer target type
|
||||
|
||||
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
||||
|
||||
commit 573b25ecd34dd69ee14c58f752bffdb5709654b9
|
||||
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
|
||||
Date: Wed Feb 8 22:08:08 2012 -0800
|
||||
|
||||
Close pci.ids file when bailing out because realloc failed
|
||||
|
||||
Error: File Leak
|
||||
Leaked File f
|
||||
at line 272 of src/common_device_name.c in function 'populate_vendor'.
|
||||
f initialized at line 204 with fopen("/usr/share/hwdata/pci.ids", "r").
|
||||
|
||||
[ This bug was found by the Parfait 0.5.0 bug checking tool.
|
||||
For more information see http://labs.oracle.com/projects/parfait/ ]
|
||||
|
||||
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
||||
|
||||
commit ed6c6157bc94283ce0a8526eeff668094cf3992d
|
||||
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
|
||||
Date: Wed Feb 8 21:40:54 2012 -0800
|
||||
|
||||
Solaris: reorder functions to remove need for lots of static prototypes
|
||||
|
||||
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
||||
|
||||
commit b56f9a84f3dff995a6901ffec6bcc161ec0245ad
|
||||
Author: Mark Kettenis <kettenis@openbsd.org>
|
||||
Date: Thu Dec 29 21:14:44 2011 +0100
|
||||
|
||||
OpenBSD: Implement map_legacy and legacy_io
|
||||
|
||||
Signed-off-by: Mark Kettenis <kettenis@openbsd.org>
|
||||
Reviewed-by: Matthieu Herrb <matthieu.herrb@laas.fr>
|
||||
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
|
||||
Tested-by: Matthieu Herrb <matthieu.herrb@laas.fr>
|
||||
|
||||
commit a798395a1bfd9d06d40e2d8d14377a156c94429a
|
||||
Author: Daniel Drake <dsd@laptop.org>
|
||||
Date: Fri Nov 25 12:28:48 2011 -0600
|
||||
|
||||
delete_io_handle: fix deletion of last handle
|
||||
|
||||
When num_ios goes from 1 to 0, a realloc(ios, 0); call is made.
|
||||
This is equivalent to free(ios) and NULL is returned.
|
||||
|
||||
However, the previous logic in the code incorrectly discards this NULL
|
||||
return value. When we next call new_io_handle(), realloc(ios, X) is
|
||||
called with "ios" pointing to freed memory. This causes glibc to abort.
|
||||
|
||||
Correct this logic to detect the 1-to-0 case and handle it correctly.
|
||||
Other cases are unchanged; there is still value in checking the
|
||||
return value from realloc() as it also returns NULL on error.
|
||||
|
||||
Signed-off-by: Daniel Drake <dsd@laptop.org>
|
||||
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
||||
|
||||
commit 2601ddd02d608c16b0022fe342e0a3f4bf6cadeb
|
||||
Author: Mark Kettenis <mark.kettenis@xs4all.nl>
|
||||
Date: Sun Nov 6 17:34:29 2011 +0000
|
||||
|
||||
Add VGA Arbiter support for OpenBSD.
|
||||
|
||||
Signed-off-by: Matthieu Herrb <matthieu.herrb@laas.fr>
|
||||
|
||||
commit e64ee4ee2b23dba147d144aacead3cb61c744854
|
||||
Author: Mark Kettenis <mark.kettenis@xs4all.nl>
|
||||
Date: Sun Nov 6 17:32:51 2011 +0000
|
||||
|
||||
OpenBSD: Indicate that devices need access to legacy VGA resources.
|
||||
|
||||
Makes sure xserver disables DRI if the VGA arbiter is in use.
|
||||
|
||||
Signed-off-by: Matthieu Herrb <matthieu.herrb@laas.fr>
|
||||
|
||||
commit cfae4096835fe569edb03cd12d4580fc912a0e61
|
||||
Author: Henry Zhao <henry.zhao@oracle.com>
|
||||
Date: Mon Nov 14 18:53:21 2011 -0800
|
||||
|
||||
Solaris: improve support for sparc platform
|
||||
|
||||
(1) added prom property retrieval on sparc
|
||||
(2) added multiple domain support on sparc
|
||||
(3) use kernel device as mapping device
|
||||
(4) performance improvements by removing redundant ioctl
|
||||
|
||||
Signed-off-by: Henry Zhao <henry.zhao@oracle.com>
|
||||
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
||||
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
||||
|
||||
commit 78eed07d599ff9e30c075aa7c8d1795e125ffc4b
|
||||
Author: Jeremy Huddleston <jeremyhu@apple.com>
|
||||
Date: Wed Nov 9 09:27:49 2011 -0800
|
||||
|
||||
configure.ac: Bump to 0.12.902
|
||||
|
||||
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
|
||||
|
||||
commit cbb3c63affc1792ade0433691aa67f0edad52b0b
|
||||
Author: Jeremy Huddleston <jeremyhu@apple.com>
|
||||
Date: Wed Nov 9 09:46:30 2011 -0800
|
||||
|
||||
Fix some -Wformat errors in scanpci
|
||||
|
||||
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
|
||||
|
||||
commit a0a53a67c91c698007dcac3e7aba27c999c4f6ed
|
||||
Author: Nithin Nayak Sujir <nsujir@broadcom.com>
|
||||
Date: Mon Oct 24 12:15:15 2011 -0700
|
||||
|
||||
libpciaccess: close mtrr fd on pci_cleanup
|
||||
|
||||
Since the fd is not closed, calling pci_system_init and
|
||||
pci_system_cleanup more than 1024 times results in "too many files open"
|
||||
error.
|
||||
|
||||
Signed-off-by: Nithin Nayak Sujir <nsujir@broadcom.com>
|
||||
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
|
||||
|
||||
commit 803bf3aa28de0f1260e479e2036159d4fead0a87
|
||||
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
|
||||
Date: Tue Oct 4 21:46:05 2011 -0700
|
||||
|
||||
Solaris: Give better error on realloc failure
|
||||
|
||||
commit a18460b385ae03 converted from a fixed maximum number of devices
|
||||
to dynamically growing the list via realloc, but didn't update the
|
||||
error message shown on failure.
|
||||
|
||||
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
||||
Reviewed-by: Dirk Wallenstein <halsmit@t-online.de>
|
||||
Reviewed-by: Mark Kettenis <kettenis@openbsd.org>
|
||||
|
||||
commit af4478c52c960bee08209293aa14b784ac30dc05
|
||||
Author: Jeremy Huddleston <jeremyhu@apple.com>
|
||||
Date: Tue Oct 11 10:22:49 2011 -0700
|
||||
|
||||
linux sysfs: Fix read-write access in map_legacy
|
||||
|
||||
O_RDONLY | O_WRONLY != O_RDWR
|
||||
|
||||
><
|
||||
|
||||
Reported-by: Javier Pello <javier.pello@urjc.es>
|
||||
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
|
||||
|
||||
commit b9c5ce8083be53ea017bd15a63b173b4476fff23
|
||||
Author: Jeremy Huddleston <jeremyhu@apple.com>
|
||||
Date: Sun Oct 9 03:53:05 2011 -0700
|
||||
|
||||
scanpci: Build fix for systems without <err.h>
|
||||
|
||||
https://bugs.freedesktop.org/show_bug.cgi?id=31133
|
||||
|
||||
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
|
||||
|
||||
commit 30e9ec91107791835d722f99498d659dec048922
|
||||
Author: Jeremy Huddleston <jeremyhu@apple.com>
|
||||
Date: Fri Oct 7 11:57:26 2011 -0700
|
||||
|
||||
configure.ac: Bump version to 0.12.901
|
||||
|
||||
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
|
||||
|
||||
commit 12dbf6d2d346cfe7ba8b2a1697c56af3f9876be7
|
||||
Author: Jeremy Huddleston <jeremyhu@apple.com>
|
||||
Date: Fri Oct 7 11:56:06 2011 -0700
|
||||
|
||||
Update library version to reflect new API
|
||||
|
||||
Signed-off-by: Jeremy Huddleston <jeremyhu@apple.com>
|
||||
|
||||
commit 58e87933b3286f33cdeedd3a6b21f4ea795bea47
|
||||
Author: Adam Jackson <ajax@redhat.com>
|
||||
Date: Tue May 10 17:56:35 2011 -0400
|
||||
|
||||
linux: Implement map_legacy
|
||||
|
||||
Signed-off-by: Adam Jackson <ajax@redhat.com>
|
||||
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
|
||||
|
||||
commit 8cc9a8fe57adfb52abaa90a8a2ac2316de8eb898
|
||||
Author: Adam Jackson <ajax@redhat.com>
|
||||
Date: Tue May 10 17:56:34 2011 -0400
|
||||
|
||||
Add map_legacy interface
|
||||
|
||||
This allows platforms to hand back mmaps of the low 1M (ISA) address
|
||||
space on a per-domain basis.
|
||||
|
||||
Signed-off-by: Adam Jackson <ajax@redhat.com>
|
||||
Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
|
||||
|
||||
commit e1a0240a3d6840b497845680c2bf6753415ba20f
|
||||
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
|
||||
Date: Fri Sep 16 22:11:38 2011 -0700
|
||||
|
||||
Strip trailing whitespace
|
||||
|
||||
Performed with: find * -type f | xargs perl -i -p -e 's{[ \t]+$}{}'
|
||||
git diff -w & git diff -b show no diffs from this change
|
||||
|
||||
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
||||
|
||||
commit 7bfc4f806d51b85e7ae069dd6deaf0b48326ed22
|
||||
Author: Adam Jackson <ajax@redhat.com>
|
||||
Date: Wed Aug 3 18:35:11 2011 -0400
|
||||
|
||||
linux: Fix a crash in populate_devices
|
||||
|
||||
If scandir returns -1, the 'devices' array won't be initialized, and
|
||||
attempting to free() it will crash.
|
||||
|
||||
Signed-off-by: Adam Jackson <ajax@redhat.com>
|
||||
|
||||
commit f9159b97834ba4b4e42a07953a33866e7ac90dbd
|
||||
Author: Chris Wilson <chris@chris-wilson.co.uk>
|
||||
Date: Sat Jun 4 12:30:06 2011 +0100
|
||||
|
||||
linux: Only set errno after an error
|
||||
|
||||
errno is only valid after an error, and was being filled with a garbage
|
||||
value upon eof.
|
||||
|
||||
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
|
||||
|
||||
commit a18460b385ae034830e4efbaaed7e0665c53ad9f
|
||||
Author: John Martin <John.M.Martin@Oracle.COM>
|
||||
Date: Mon Mar 28 17:51:19 2011 -0700
|
||||
|
||||
Solaris support for multiple PCI segments (domains)
|
||||
|
||||
1. Removed hardcoded maximum size of 256 PCI devices, which is
|
||||
too small for large systems. The number of devices is dynamically
|
||||
resized as needed.
|
||||
|
||||
2. pci_device_solx_devfs_probe() no longer walks the device tree
|
||||
from the very top ("/") but instead starts at the nexus which
|
||||
owns the bus. Performance optimization for systems with multiple
|
||||
bus nodes (including systems with just one segment/domain).
|
||||
|
||||
3. Added support for multiple domains/segments. Code tested
|
||||
on kernels with and without multiple segment support so it should
|
||||
be safe to integrate independent of the kernel version.
|
||||
|
||||
Signed-off-by: John Martin <John.M.Martin@Oracle.COM>
|
||||
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
|
||||
Reviewed-by: Adam Jackson <ajax@redhat.com>
|
||||
|
||||
commit f3e283a25f5fca4f750bb9538d69c4f36641cca5
|
||||
Author: Gaetan Nadon <memsize@videotron.ca>
|
||||
Date: Thu Feb 3 17:38:32 2011 -0500
|
||||
|
||||
config: comment, minor upgrade, quote and layout configure.ac
|
||||
|
||||
Group statements per section as per Autoconf standard layout
|
||||
Quote statements where appropriate.
|
||||
Autoconf recommends not using dnl instead of # for comments
|
||||
|
||||
Use AC_CONFIG_FILES to replace the deprecated AC_OUTPUT with parameters.
|
||||
Add AC_CONFIG_SRCDIR([Makefile.am])
|
||||
Update X.Org util-macros to version 1.8
|
||||
|
||||
This helps automated maintenance and release activities.
|
||||
Details can be found in http://wiki.x.org/wiki/NewModuleGuidelines
|
||||
|
||||
Signed-off-by: Gaetan Nadon <memsize@videotron.ca>
|
||||
|
||||
commit d05ed57216726811388f17d7e87d7b6c7b8580ee
|
||||
Author: Alan Coopersmith <alan.coopersmith@oracle.com>
|
||||
Date: Wed Feb 2 20:50:17 2011 -0800
|
||||
|
@ -1,6 +1,6 @@
|
||||
# $OpenBSD: Makefile.bsd-wrapper,v 1.4 2010/07/10 18:56:27 matthieu Exp $
|
||||
# $OpenBSD: Makefile.bsd-wrapper,v 1.5 2012/03/09 21:02:09 matthieu Exp $
|
||||
|
||||
SHARED_LIBS= pciaccess 1.0
|
||||
SHARED_LIBS= pciaccess 1.1
|
||||
|
||||
CONFIGURE_ARGS+= --with-pciids-path=${X11BASE}/share
|
||||
|
||||
|
@ -67,7 +67,9 @@ DIST_COMMON = README $(am__configure_deps) $(srcdir)/Makefile.am \
|
||||
subdir = .
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/m4/ax_define_dir.m4 \
|
||||
$(top_srcdir)/configure.ac
|
||||
$(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
|
||||
$(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
|
||||
$(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac
|
||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||
$(ACLOCAL_M4)
|
||||
am__CONFIG_DISTCLEAN_FILES = config.status config.cache config.log \
|
||||
@ -120,6 +122,7 @@ AUTOCONF = @AUTOCONF@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AWK = @AWK@
|
||||
BASE_CFLAGS = @BASE_CFLAGS@
|
||||
CC = @CC@
|
||||
CCDEPMODE = @CCDEPMODE@
|
||||
CFLAGS = @CFLAGS@
|
||||
@ -127,24 +130,20 @@ CHANGELOG_CMD = @CHANGELOG_CMD@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CWARNFLAGS = @CWARNFLAGS@
|
||||
CXX = @CXX@
|
||||
CXXCPP = @CXXCPP@
|
||||
CXXDEPMODE = @CXXDEPMODE@
|
||||
CXXFLAGS = @CXXFLAGS@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
DEFS = @DEFS@
|
||||
DEPDIR = @DEPDIR@
|
||||
DLLTOOL = @DLLTOOL@
|
||||
DRIVER_MAN_DIR = @DRIVER_MAN_DIR@
|
||||
DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@
|
||||
DSYMUTIL = @DSYMUTIL@
|
||||
ECHO = @ECHO@
|
||||
DUMPBIN = @DUMPBIN@
|
||||
ECHO_C = @ECHO_C@
|
||||
ECHO_N = @ECHO_N@
|
||||
ECHO_T = @ECHO_T@
|
||||
EGREP = @EGREP@
|
||||
EXEEXT = @EXEEXT@
|
||||
F77 = @F77@
|
||||
FFLAGS = @FFLAGS@
|
||||
FGREP = @FGREP@
|
||||
FILE_MAN_DIR = @FILE_MAN_DIR@
|
||||
FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@
|
||||
FREEBSD_FALSE = @FREEBSD_FALSE@
|
||||
@ -157,6 +156,7 @@ INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
||||
LD = @LD@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LIBOBJS = @LIBOBJS@
|
||||
LIBS = @LIBS@
|
||||
@ -165,21 +165,27 @@ LIB_MAN_DIR = @LIB_MAN_DIR@
|
||||
LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@
|
||||
LINUX_FALSE = @LINUX_FALSE@
|
||||
LINUX_TRUE = @LINUX_TRUE@
|
||||
LIPO = @LIPO@
|
||||
LN_S = @LN_S@
|
||||
LTLIBOBJS = @LTLIBOBJS@
|
||||
MAINT = @MAINT@
|
||||
MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
|
||||
MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
MANIFEST_TOOL = @MANIFEST_TOOL@
|
||||
MAN_SUBSTS = @MAN_SUBSTS@
|
||||
MISC_MAN_DIR = @MISC_MAN_DIR@
|
||||
MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@
|
||||
NETBSD_FALSE = @NETBSD_FALSE@
|
||||
NETBSD_TRUE = @NETBSD_TRUE@
|
||||
NM = @NM@
|
||||
NMEDIT = @NMEDIT@
|
||||
OBJDUMP = @OBJDUMP@
|
||||
OBJEXT = @OBJEXT@
|
||||
OPENBSD_FALSE = @OPENBSD_FALSE@
|
||||
OPENBSD_TRUE = @OPENBSD_TRUE@
|
||||
OTOOL = @OTOOL@
|
||||
OTOOL64 = @OTOOL64@
|
||||
PACKAGE = @PACKAGE@
|
||||
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
|
||||
PACKAGE_NAME = @PACKAGE_NAME@
|
||||
@ -201,13 +207,11 @@ STRICT_CFLAGS = @STRICT_CFLAGS@
|
||||
STRIP = @STRIP@
|
||||
VERSION = @VERSION@
|
||||
XORG_MAN_PAGE = @XORG_MAN_PAGE@
|
||||
ac_ct_AR = @ac_ct_AR@
|
||||
ac_ct_CC = @ac_ct_CC@
|
||||
ac_ct_CXX = @ac_ct_CXX@
|
||||
ac_ct_F77 = @ac_ct_F77@
|
||||
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
|
||||
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
|
||||
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
|
||||
am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
|
||||
am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
|
||||
am__include = @am__include@
|
||||
am__leading_dot = @am__leading_dot@
|
||||
am__quote = @am__quote@
|
||||
|
6931
lib/libpciaccess/aclocal.m4
vendored
6931
lib/libpciaccess/aclocal.m4
vendored
File diff suppressed because it is too large
Load Diff
@ -3,6 +3,9 @@
|
||||
/* Define to 1 if you have the <dlfcn.h> header file. */
|
||||
#undef HAVE_DLFCN_H
|
||||
|
||||
/* Define to 1 if you have the <err.h> header file. */
|
||||
#undef HAVE_ERR_H
|
||||
|
||||
/* Define to 1 if you have the <inttypes.h> header file. */
|
||||
#undef HAVE_INTTYPES_H
|
||||
|
||||
@ -42,6 +45,10 @@
|
||||
/* Linux ROM read fallback */
|
||||
#undef LINUX_ROM
|
||||
|
||||
/* Define to the sub-directory in which libtool stores uninstalled libraries.
|
||||
*/
|
||||
#undef LT_OBJDIR
|
||||
|
||||
/* Name of package */
|
||||
#undef PACKAGE
|
||||
|
||||
|
28429
lib/libpciaccess/configure
vendored
28429
lib/libpciaccess/configure
vendored
File diff suppressed because it is too large
Load Diff
@ -1,30 +1,29 @@
|
||||
dnl (C) Copyright IBM Corporation 2006
|
||||
dnl 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 "Software"),
|
||||
dnl to deal in the Software without restriction, including without limitation
|
||||
dnl on the rights to use, copy, modify, merge, publish, distribute, sub
|
||||
dnl license, and/or sell copies of the Software, and to permit persons to whom
|
||||
dnl the Software is furnished to do so, subject to the following conditions:
|
||||
dnl
|
||||
dnl The above copyright notice and this permission notice (including the next
|
||||
dnl paragraph) shall be included in all copies or substantial portions of the
|
||||
dnl Software.
|
||||
dnl
|
||||
dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
dnl IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
dnl FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
|
||||
dnl IBM AND/OR THEIR SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
dnl LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
|
||||
dnl FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||
dnl DEALINGS IN THE SOFTWARE.
|
||||
dnl
|
||||
dnl Process this file with autoconf to create configure.
|
||||
# (C) Copyright IBM Corporation 2006
|
||||
# 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.
|
||||
#
|
||||
|
||||
# Initialize Autoconf
|
||||
AC_PREREQ([2.60])
|
||||
AC_INIT([libpciaccess],[0.12.1],
|
||||
AC_INIT([libpciaccess],[0.13],
|
||||
[https://bugs.freedesktop.org/enter_bug.cgi?product=xorg&component=libpciaccess],[libpciaccess])
|
||||
AC_CONFIG_SRCDIR([Makefile.am])
|
||||
AC_CONFIG_HEADERS([config.h])
|
||||
@ -33,15 +32,15 @@ AC_CONFIG_HEADERS([config.h])
|
||||
AM_INIT_AUTOMAKE([foreign dist-bzip2])
|
||||
AM_MAINTAINER_MODE
|
||||
|
||||
# Require xorg-macros: XORG_DEFAULT_OPTIONS
|
||||
m4_ifndef([XORG_MACROS_VERSION],
|
||||
[m4_fatal([must install xorg-macros 1.3 or later before running autoconf/autogen])])
|
||||
XORG_MACROS_VERSION(1.3)
|
||||
XORG_DEFAULT_OPTIONS
|
||||
|
||||
# Check for progs
|
||||
# Initialize libtool
|
||||
AC_PROG_LIBTOOL
|
||||
|
||||
# Require X.Org macros 1.8 or later
|
||||
m4_ifndef([XORG_MACROS_VERSION],
|
||||
[m4_fatal([must install xorg-macros 1.8 or later before running autoconf/autogen])])
|
||||
XORG_MACROS_VERSION(1.8)
|
||||
XORG_DEFAULT_OPTIONS
|
||||
|
||||
pciids_path=/usr/share/hwdata
|
||||
AC_ARG_WITH(pciids-path, AS_HELP_STRING([--with-pciids-path=PCIIDS_PATH],
|
||||
[Path to pci.ids file]), [pciids_path="$withval"])
|
||||
@ -107,13 +106,15 @@ AM_CONDITIONAL(GNU, [test "x$gnu" = xyes])
|
||||
|
||||
AC_SYS_LARGEFILE
|
||||
|
||||
AC_CHECK_HEADERS([err.h])
|
||||
|
||||
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
|
||||
# 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.])],
|
||||
[],
|
||||
@ -124,11 +125,10 @@ AC_CHECK_MEMBER([struct pci_io.pi_sel.pc_domain],
|
||||
AC_SUBST(PCIACCESS_CFLAGS)
|
||||
AC_SUBST(PCIACCESS_LIBS)
|
||||
|
||||
|
||||
AC_CONFIG_FILES([Makefile
|
||||
include/Makefile
|
||||
man/Makefile
|
||||
src/Makefile
|
||||
scanpci/Makefile
|
||||
pciaccess.pc])
|
||||
include/Makefile
|
||||
man/Makefile
|
||||
src/Makefile
|
||||
scanpci/Makefile
|
||||
pciaccess.pc])
|
||||
AC_OUTPUT
|
||||
|
@ -41,7 +41,9 @@ DIST_COMMON = $(include_HEADERS) $(srcdir)/Makefile.am \
|
||||
$(srcdir)/Makefile.in
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/m4/ax_define_dir.m4 \
|
||||
$(top_srcdir)/configure.ac
|
||||
$(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
|
||||
$(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
|
||||
$(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac
|
||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||
$(ACLOCAL_M4)
|
||||
mkinstalldirs = $(SHELL) $(install_sh) -d
|
||||
@ -75,6 +77,7 @@ AUTOCONF = @AUTOCONF@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AWK = @AWK@
|
||||
BASE_CFLAGS = @BASE_CFLAGS@
|
||||
CC = @CC@
|
||||
CCDEPMODE = @CCDEPMODE@
|
||||
CFLAGS = @CFLAGS@
|
||||
@ -82,24 +85,20 @@ CHANGELOG_CMD = @CHANGELOG_CMD@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CWARNFLAGS = @CWARNFLAGS@
|
||||
CXX = @CXX@
|
||||
CXXCPP = @CXXCPP@
|
||||
CXXDEPMODE = @CXXDEPMODE@
|
||||
CXXFLAGS = @CXXFLAGS@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
DEFS = @DEFS@
|
||||
DEPDIR = @DEPDIR@
|
||||
DLLTOOL = @DLLTOOL@
|
||||
DRIVER_MAN_DIR = @DRIVER_MAN_DIR@
|
||||
DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@
|
||||
DSYMUTIL = @DSYMUTIL@
|
||||
ECHO = @ECHO@
|
||||
DUMPBIN = @DUMPBIN@
|
||||
ECHO_C = @ECHO_C@
|
||||
ECHO_N = @ECHO_N@
|
||||
ECHO_T = @ECHO_T@
|
||||
EGREP = @EGREP@
|
||||
EXEEXT = @EXEEXT@
|
||||
F77 = @F77@
|
||||
FFLAGS = @FFLAGS@
|
||||
FGREP = @FGREP@
|
||||
FILE_MAN_DIR = @FILE_MAN_DIR@
|
||||
FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@
|
||||
FREEBSD_FALSE = @FREEBSD_FALSE@
|
||||
@ -112,6 +111,7 @@ INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
||||
LD = @LD@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LIBOBJS = @LIBOBJS@
|
||||
LIBS = @LIBS@
|
||||
@ -120,21 +120,27 @@ LIB_MAN_DIR = @LIB_MAN_DIR@
|
||||
LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@
|
||||
LINUX_FALSE = @LINUX_FALSE@
|
||||
LINUX_TRUE = @LINUX_TRUE@
|
||||
LIPO = @LIPO@
|
||||
LN_S = @LN_S@
|
||||
LTLIBOBJS = @LTLIBOBJS@
|
||||
MAINT = @MAINT@
|
||||
MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
|
||||
MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
MANIFEST_TOOL = @MANIFEST_TOOL@
|
||||
MAN_SUBSTS = @MAN_SUBSTS@
|
||||
MISC_MAN_DIR = @MISC_MAN_DIR@
|
||||
MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@
|
||||
NETBSD_FALSE = @NETBSD_FALSE@
|
||||
NETBSD_TRUE = @NETBSD_TRUE@
|
||||
NM = @NM@
|
||||
NMEDIT = @NMEDIT@
|
||||
OBJDUMP = @OBJDUMP@
|
||||
OBJEXT = @OBJEXT@
|
||||
OPENBSD_FALSE = @OPENBSD_FALSE@
|
||||
OPENBSD_TRUE = @OPENBSD_TRUE@
|
||||
OTOOL = @OTOOL@
|
||||
OTOOL64 = @OTOOL64@
|
||||
PACKAGE = @PACKAGE@
|
||||
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
|
||||
PACKAGE_NAME = @PACKAGE_NAME@
|
||||
@ -156,13 +162,11 @@ STRICT_CFLAGS = @STRICT_CFLAGS@
|
||||
STRIP = @STRIP@
|
||||
VERSION = @VERSION@
|
||||
XORG_MAN_PAGE = @XORG_MAN_PAGE@
|
||||
ac_ct_AR = @ac_ct_AR@
|
||||
ac_ct_CC = @ac_ct_CC@
|
||||
ac_ct_CXX = @ac_ct_CXX@
|
||||
ac_ct_F77 = @ac_ct_F77@
|
||||
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
|
||||
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
|
||||
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
|
||||
am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
|
||||
am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
|
||||
am__include = @am__include@
|
||||
am__leading_dot = @am__leading_dot@
|
||||
am__quote = @am__quote@
|
||||
|
@ -526,4 +526,12 @@ void pci_io_write32(struct pci_io_handle *handle, uint32_t reg, uint32_t data);
|
||||
void pci_io_write16(struct pci_io_handle *handle, uint32_t reg, uint16_t data);
|
||||
void pci_io_write8(struct pci_io_handle *handle, uint32_t reg, uint8_t data);
|
||||
|
||||
/*
|
||||
* Legacy memory access
|
||||
*/
|
||||
|
||||
int pci_device_map_legacy(struct pci_device *dev, pciaddr_t base,
|
||||
pciaddr_t size, unsigned map_flags, void **addr);
|
||||
int pci_device_unmap_legacy(struct pci_device *dev, void *addr, pciaddr_t size);
|
||||
|
||||
#endif /* PCIACCESS_H */
|
||||
|
File diff suppressed because it is too large
Load Diff
7982
lib/libpciaccess/m4/libtool.m4
vendored
Normal file
7982
lib/libpciaccess/m4/libtool.m4
vendored
Normal file
File diff suppressed because it is too large
Load Diff
384
lib/libpciaccess/m4/ltoptions.m4
vendored
Normal file
384
lib/libpciaccess/m4/ltoptions.m4
vendored
Normal file
@ -0,0 +1,384 @@
|
||||
# Helper functions for option handling. -*- Autoconf -*-
|
||||
#
|
||||
# Copyright (C) 2004, 2005, 2007, 2008, 2009 Free Software Foundation,
|
||||
# Inc.
|
||||
# Written by Gary V. Vaughan, 2004
|
||||
#
|
||||
# This file is free software; the Free Software Foundation gives
|
||||
# unlimited permission to copy and/or distribute it, with or without
|
||||
# modifications, as long as this notice is preserved.
|
||||
|
||||
# serial 7 ltoptions.m4
|
||||
|
||||
# This is to help aclocal find these macros, as it can't see m4_define.
|
||||
AC_DEFUN([LTOPTIONS_VERSION], [m4_if([1])])
|
||||
|
||||
|
||||
# _LT_MANGLE_OPTION(MACRO-NAME, OPTION-NAME)
|
||||
# ------------------------------------------
|
||||
m4_define([_LT_MANGLE_OPTION],
|
||||
[[_LT_OPTION_]m4_bpatsubst($1__$2, [[^a-zA-Z0-9_]], [_])])
|
||||
|
||||
|
||||
# _LT_SET_OPTION(MACRO-NAME, OPTION-NAME)
|
||||
# ---------------------------------------
|
||||
# Set option OPTION-NAME for macro MACRO-NAME, and if there is a
|
||||
# matching handler defined, dispatch to it. Other OPTION-NAMEs are
|
||||
# saved as a flag.
|
||||
m4_define([_LT_SET_OPTION],
|
||||
[m4_define(_LT_MANGLE_OPTION([$1], [$2]))dnl
|
||||
m4_ifdef(_LT_MANGLE_DEFUN([$1], [$2]),
|
||||
_LT_MANGLE_DEFUN([$1], [$2]),
|
||||
[m4_warning([Unknown $1 option `$2'])])[]dnl
|
||||
])
|
||||
|
||||
|
||||
# _LT_IF_OPTION(MACRO-NAME, OPTION-NAME, IF-SET, [IF-NOT-SET])
|
||||
# ------------------------------------------------------------
|
||||
# Execute IF-SET if OPTION is set, IF-NOT-SET otherwise.
|
||||
m4_define([_LT_IF_OPTION],
|
||||
[m4_ifdef(_LT_MANGLE_OPTION([$1], [$2]), [$3], [$4])])
|
||||
|
||||
|
||||
# _LT_UNLESS_OPTIONS(MACRO-NAME, OPTION-LIST, IF-NOT-SET)
|
||||
# -------------------------------------------------------
|
||||
# Execute IF-NOT-SET unless all options in OPTION-LIST for MACRO-NAME
|
||||
# are set.
|
||||
m4_define([_LT_UNLESS_OPTIONS],
|
||||
[m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
|
||||
[m4_ifdef(_LT_MANGLE_OPTION([$1], _LT_Option),
|
||||
[m4_define([$0_found])])])[]dnl
|
||||
m4_ifdef([$0_found], [m4_undefine([$0_found])], [$3
|
||||
])[]dnl
|
||||
])
|
||||
|
||||
|
||||
# _LT_SET_OPTIONS(MACRO-NAME, OPTION-LIST)
|
||||
# ----------------------------------------
|
||||
# OPTION-LIST is a space-separated list of Libtool options associated
|
||||
# with MACRO-NAME. If any OPTION has a matching handler declared with
|
||||
# LT_OPTION_DEFINE, dispatch to that macro; otherwise complain about
|
||||
# the unknown option and exit.
|
||||
m4_defun([_LT_SET_OPTIONS],
|
||||
[# Set options
|
||||
m4_foreach([_LT_Option], m4_split(m4_normalize([$2])),
|
||||
[_LT_SET_OPTION([$1], _LT_Option)])
|
||||
|
||||
m4_if([$1],[LT_INIT],[
|
||||
dnl
|
||||
dnl Simply set some default values (i.e off) if boolean options were not
|
||||
dnl specified:
|
||||
_LT_UNLESS_OPTIONS([LT_INIT], [dlopen], [enable_dlopen=no
|
||||
])
|
||||
_LT_UNLESS_OPTIONS([LT_INIT], [win32-dll], [enable_win32_dll=no
|
||||
])
|
||||
dnl
|
||||
dnl If no reference was made to various pairs of opposing options, then
|
||||
dnl we run the default mode handler for the pair. For example, if neither
|
||||
dnl `shared' nor `disable-shared' was passed, we enable building of shared
|
||||
dnl archives by default:
|
||||
_LT_UNLESS_OPTIONS([LT_INIT], [shared disable-shared], [_LT_ENABLE_SHARED])
|
||||
_LT_UNLESS_OPTIONS([LT_INIT], [static disable-static], [_LT_ENABLE_STATIC])
|
||||
_LT_UNLESS_OPTIONS([LT_INIT], [pic-only no-pic], [_LT_WITH_PIC])
|
||||
_LT_UNLESS_OPTIONS([LT_INIT], [fast-install disable-fast-install],
|
||||
[_LT_ENABLE_FAST_INSTALL])
|
||||
])
|
||||
])# _LT_SET_OPTIONS
|
||||
|
||||
|
||||
## --------------------------------- ##
|
||||
## Macros to handle LT_INIT options. ##
|
||||
## --------------------------------- ##
|
||||
|
||||
# _LT_MANGLE_DEFUN(MACRO-NAME, OPTION-NAME)
|
||||
# -----------------------------------------
|
||||
m4_define([_LT_MANGLE_DEFUN],
|
||||
[[_LT_OPTION_DEFUN_]m4_bpatsubst(m4_toupper([$1__$2]), [[^A-Z0-9_]], [_])])
|
||||
|
||||
|
||||
# LT_OPTION_DEFINE(MACRO-NAME, OPTION-NAME, CODE)
|
||||
# -----------------------------------------------
|
||||
m4_define([LT_OPTION_DEFINE],
|
||||
[m4_define(_LT_MANGLE_DEFUN([$1], [$2]), [$3])[]dnl
|
||||
])# LT_OPTION_DEFINE
|
||||
|
||||
|
||||
# dlopen
|
||||
# ------
|
||||
LT_OPTION_DEFINE([LT_INIT], [dlopen], [enable_dlopen=yes
|
||||
])
|
||||
|
||||
AU_DEFUN([AC_LIBTOOL_DLOPEN],
|
||||
[_LT_SET_OPTION([LT_INIT], [dlopen])
|
||||
AC_DIAGNOSE([obsolete],
|
||||
[$0: Remove this warning and the call to _LT_SET_OPTION when you
|
||||
put the `dlopen' option into LT_INIT's first parameter.])
|
||||
])
|
||||
|
||||
dnl aclocal-1.4 backwards compatibility:
|
||||
dnl AC_DEFUN([AC_LIBTOOL_DLOPEN], [])
|
||||
|
||||
|
||||
# win32-dll
|
||||
# ---------
|
||||
# Declare package support for building win32 dll's.
|
||||
LT_OPTION_DEFINE([LT_INIT], [win32-dll],
|
||||
[enable_win32_dll=yes
|
||||
|
||||
case $host in
|
||||
*-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-cegcc*)
|
||||
AC_CHECK_TOOL(AS, as, false)
|
||||
AC_CHECK_TOOL(DLLTOOL, dlltool, false)
|
||||
AC_CHECK_TOOL(OBJDUMP, objdump, false)
|
||||
;;
|
||||
esac
|
||||
|
||||
test -z "$AS" && AS=as
|
||||
_LT_DECL([], [AS], [1], [Assembler program])dnl
|
||||
|
||||
test -z "$DLLTOOL" && DLLTOOL=dlltool
|
||||
_LT_DECL([], [DLLTOOL], [1], [DLL creation program])dnl
|
||||
|
||||
test -z "$OBJDUMP" && OBJDUMP=objdump
|
||||
_LT_DECL([], [OBJDUMP], [1], [Object dumper program])dnl
|
||||
])# win32-dll
|
||||
|
||||
AU_DEFUN([AC_LIBTOOL_WIN32_DLL],
|
||||
[AC_REQUIRE([AC_CANONICAL_HOST])dnl
|
||||
_LT_SET_OPTION([LT_INIT], [win32-dll])
|
||||
AC_DIAGNOSE([obsolete],
|
||||
[$0: Remove this warning and the call to _LT_SET_OPTION when you
|
||||
put the `win32-dll' option into LT_INIT's first parameter.])
|
||||
])
|
||||
|
||||
dnl aclocal-1.4 backwards compatibility:
|
||||
dnl AC_DEFUN([AC_LIBTOOL_WIN32_DLL], [])
|
||||
|
||||
|
||||
# _LT_ENABLE_SHARED([DEFAULT])
|
||||
# ----------------------------
|
||||
# implement the --enable-shared flag, and supports the `shared' and
|
||||
# `disable-shared' LT_INIT options.
|
||||
# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
|
||||
m4_define([_LT_ENABLE_SHARED],
|
||||
[m4_define([_LT_ENABLE_SHARED_DEFAULT], [m4_if($1, no, no, yes)])dnl
|
||||
AC_ARG_ENABLE([shared],
|
||||
[AS_HELP_STRING([--enable-shared@<:@=PKGS@:>@],
|
||||
[build shared libraries @<:@default=]_LT_ENABLE_SHARED_DEFAULT[@:>@])],
|
||||
[p=${PACKAGE-default}
|
||||
case $enableval in
|
||||
yes) enable_shared=yes ;;
|
||||
no) enable_shared=no ;;
|
||||
*)
|
||||
enable_shared=no
|
||||
# Look at the argument we got. We use all the common list separators.
|
||||
lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
|
||||
for pkg in $enableval; do
|
||||
IFS="$lt_save_ifs"
|
||||
if test "X$pkg" = "X$p"; then
|
||||
enable_shared=yes
|
||||
fi
|
||||
done
|
||||
IFS="$lt_save_ifs"
|
||||
;;
|
||||
esac],
|
||||
[enable_shared=]_LT_ENABLE_SHARED_DEFAULT)
|
||||
|
||||
_LT_DECL([build_libtool_libs], [enable_shared], [0],
|
||||
[Whether or not to build shared libraries])
|
||||
])# _LT_ENABLE_SHARED
|
||||
|
||||
LT_OPTION_DEFINE([LT_INIT], [shared], [_LT_ENABLE_SHARED([yes])])
|
||||
LT_OPTION_DEFINE([LT_INIT], [disable-shared], [_LT_ENABLE_SHARED([no])])
|
||||
|
||||
# Old names:
|
||||
AC_DEFUN([AC_ENABLE_SHARED],
|
||||
[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[shared])
|
||||
])
|
||||
|
||||
AC_DEFUN([AC_DISABLE_SHARED],
|
||||
[_LT_SET_OPTION([LT_INIT], [disable-shared])
|
||||
])
|
||||
|
||||
AU_DEFUN([AM_ENABLE_SHARED], [AC_ENABLE_SHARED($@)])
|
||||
AU_DEFUN([AM_DISABLE_SHARED], [AC_DISABLE_SHARED($@)])
|
||||
|
||||
dnl aclocal-1.4 backwards compatibility:
|
||||
dnl AC_DEFUN([AM_ENABLE_SHARED], [])
|
||||
dnl AC_DEFUN([AM_DISABLE_SHARED], [])
|
||||
|
||||
|
||||
|
||||
# _LT_ENABLE_STATIC([DEFAULT])
|
||||
# ----------------------------
|
||||
# implement the --enable-static flag, and support the `static' and
|
||||
# `disable-static' LT_INIT options.
|
||||
# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
|
||||
m4_define([_LT_ENABLE_STATIC],
|
||||
[m4_define([_LT_ENABLE_STATIC_DEFAULT], [m4_if($1, no, no, yes)])dnl
|
||||
AC_ARG_ENABLE([static],
|
||||
[AS_HELP_STRING([--enable-static@<:@=PKGS@:>@],
|
||||
[build static libraries @<:@default=]_LT_ENABLE_STATIC_DEFAULT[@:>@])],
|
||||
[p=${PACKAGE-default}
|
||||
case $enableval in
|
||||
yes) enable_static=yes ;;
|
||||
no) enable_static=no ;;
|
||||
*)
|
||||
enable_static=no
|
||||
# Look at the argument we got. We use all the common list separators.
|
||||
lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
|
||||
for pkg in $enableval; do
|
||||
IFS="$lt_save_ifs"
|
||||
if test "X$pkg" = "X$p"; then
|
||||
enable_static=yes
|
||||
fi
|
||||
done
|
||||
IFS="$lt_save_ifs"
|
||||
;;
|
||||
esac],
|
||||
[enable_static=]_LT_ENABLE_STATIC_DEFAULT)
|
||||
|
||||
_LT_DECL([build_old_libs], [enable_static], [0],
|
||||
[Whether or not to build static libraries])
|
||||
])# _LT_ENABLE_STATIC
|
||||
|
||||
LT_OPTION_DEFINE([LT_INIT], [static], [_LT_ENABLE_STATIC([yes])])
|
||||
LT_OPTION_DEFINE([LT_INIT], [disable-static], [_LT_ENABLE_STATIC([no])])
|
||||
|
||||
# Old names:
|
||||
AC_DEFUN([AC_ENABLE_STATIC],
|
||||
[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[static])
|
||||
])
|
||||
|
||||
AC_DEFUN([AC_DISABLE_STATIC],
|
||||
[_LT_SET_OPTION([LT_INIT], [disable-static])
|
||||
])
|
||||
|
||||
AU_DEFUN([AM_ENABLE_STATIC], [AC_ENABLE_STATIC($@)])
|
||||
AU_DEFUN([AM_DISABLE_STATIC], [AC_DISABLE_STATIC($@)])
|
||||
|
||||
dnl aclocal-1.4 backwards compatibility:
|
||||
dnl AC_DEFUN([AM_ENABLE_STATIC], [])
|
||||
dnl AC_DEFUN([AM_DISABLE_STATIC], [])
|
||||
|
||||
|
||||
|
||||
# _LT_ENABLE_FAST_INSTALL([DEFAULT])
|
||||
# ----------------------------------
|
||||
# implement the --enable-fast-install flag, and support the `fast-install'
|
||||
# and `disable-fast-install' LT_INIT options.
|
||||
# DEFAULT is either `yes' or `no'. If omitted, it defaults to `yes'.
|
||||
m4_define([_LT_ENABLE_FAST_INSTALL],
|
||||
[m4_define([_LT_ENABLE_FAST_INSTALL_DEFAULT], [m4_if($1, no, no, yes)])dnl
|
||||
AC_ARG_ENABLE([fast-install],
|
||||
[AS_HELP_STRING([--enable-fast-install@<:@=PKGS@:>@],
|
||||
[optimize for fast installation @<:@default=]_LT_ENABLE_FAST_INSTALL_DEFAULT[@:>@])],
|
||||
[p=${PACKAGE-default}
|
||||
case $enableval in
|
||||
yes) enable_fast_install=yes ;;
|
||||
no) enable_fast_install=no ;;
|
||||
*)
|
||||
enable_fast_install=no
|
||||
# Look at the argument we got. We use all the common list separators.
|
||||
lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
|
||||
for pkg in $enableval; do
|
||||
IFS="$lt_save_ifs"
|
||||
if test "X$pkg" = "X$p"; then
|
||||
enable_fast_install=yes
|
||||
fi
|
||||
done
|
||||
IFS="$lt_save_ifs"
|
||||
;;
|
||||
esac],
|
||||
[enable_fast_install=]_LT_ENABLE_FAST_INSTALL_DEFAULT)
|
||||
|
||||
_LT_DECL([fast_install], [enable_fast_install], [0],
|
||||
[Whether or not to optimize for fast installation])dnl
|
||||
])# _LT_ENABLE_FAST_INSTALL
|
||||
|
||||
LT_OPTION_DEFINE([LT_INIT], [fast-install], [_LT_ENABLE_FAST_INSTALL([yes])])
|
||||
LT_OPTION_DEFINE([LT_INIT], [disable-fast-install], [_LT_ENABLE_FAST_INSTALL([no])])
|
||||
|
||||
# Old names:
|
||||
AU_DEFUN([AC_ENABLE_FAST_INSTALL],
|
||||
[_LT_SET_OPTION([LT_INIT], m4_if([$1], [no], [disable-])[fast-install])
|
||||
AC_DIAGNOSE([obsolete],
|
||||
[$0: Remove this warning and the call to _LT_SET_OPTION when you put
|
||||
the `fast-install' option into LT_INIT's first parameter.])
|
||||
])
|
||||
|
||||
AU_DEFUN([AC_DISABLE_FAST_INSTALL],
|
||||
[_LT_SET_OPTION([LT_INIT], [disable-fast-install])
|
||||
AC_DIAGNOSE([obsolete],
|
||||
[$0: Remove this warning and the call to _LT_SET_OPTION when you put
|
||||
the `disable-fast-install' option into LT_INIT's first parameter.])
|
||||
])
|
||||
|
||||
dnl aclocal-1.4 backwards compatibility:
|
||||
dnl AC_DEFUN([AC_ENABLE_FAST_INSTALL], [])
|
||||
dnl AC_DEFUN([AM_DISABLE_FAST_INSTALL], [])
|
||||
|
||||
|
||||
# _LT_WITH_PIC([MODE])
|
||||
# --------------------
|
||||
# implement the --with-pic flag, and support the `pic-only' and `no-pic'
|
||||
# LT_INIT options.
|
||||
# MODE is either `yes' or `no'. If omitted, it defaults to `both'.
|
||||
m4_define([_LT_WITH_PIC],
|
||||
[AC_ARG_WITH([pic],
|
||||
[AS_HELP_STRING([--with-pic@<:@=PKGS@:>@],
|
||||
[try to use only PIC/non-PIC objects @<:@default=use both@:>@])],
|
||||
[lt_p=${PACKAGE-default}
|
||||
case $withval in
|
||||
yes|no) pic_mode=$withval ;;
|
||||
*)
|
||||
pic_mode=default
|
||||
# Look at the argument we got. We use all the common list separators.
|
||||
lt_save_ifs="$IFS"; IFS="${IFS}$PATH_SEPARATOR,"
|
||||
for lt_pkg in $withval; do
|
||||
IFS="$lt_save_ifs"
|
||||
if test "X$lt_pkg" = "X$lt_p"; then
|
||||
pic_mode=yes
|
||||
fi
|
||||
done
|
||||
IFS="$lt_save_ifs"
|
||||
;;
|
||||
esac],
|
||||
[pic_mode=default])
|
||||
|
||||
test -z "$pic_mode" && pic_mode=m4_default([$1], [default])
|
||||
|
||||
_LT_DECL([], [pic_mode], [0], [What type of objects to build])dnl
|
||||
])# _LT_WITH_PIC
|
||||
|
||||
LT_OPTION_DEFINE([LT_INIT], [pic-only], [_LT_WITH_PIC([yes])])
|
||||
LT_OPTION_DEFINE([LT_INIT], [no-pic], [_LT_WITH_PIC([no])])
|
||||
|
||||
# Old name:
|
||||
AU_DEFUN([AC_LIBTOOL_PICMODE],
|
||||
[_LT_SET_OPTION([LT_INIT], [pic-only])
|
||||
AC_DIAGNOSE([obsolete],
|
||||
[$0: Remove this warning and the call to _LT_SET_OPTION when you
|
||||
put the `pic-only' option into LT_INIT's first parameter.])
|
||||
])
|
||||
|
||||
dnl aclocal-1.4 backwards compatibility:
|
||||
dnl AC_DEFUN([AC_LIBTOOL_PICMODE], [])
|
||||
|
||||
## ----------------- ##
|
||||
## LTDL_INIT Options ##
|
||||
## ----------------- ##
|
||||
|
||||
m4_define([_LTDL_MODE], [])
|
||||
LT_OPTION_DEFINE([LTDL_INIT], [nonrecursive],
|
||||
[m4_define([_LTDL_MODE], [nonrecursive])])
|
||||
LT_OPTION_DEFINE([LTDL_INIT], [recursive],
|
||||
[m4_define([_LTDL_MODE], [recursive])])
|
||||
LT_OPTION_DEFINE([LTDL_INIT], [subproject],
|
||||
[m4_define([_LTDL_MODE], [subproject])])
|
||||
|
||||
m4_define([_LTDL_TYPE], [])
|
||||
LT_OPTION_DEFINE([LTDL_INIT], [installable],
|
||||
[m4_define([_LTDL_TYPE], [installable])])
|
||||
LT_OPTION_DEFINE([LTDL_INIT], [convenience],
|
||||
[m4_define([_LTDL_TYPE], [convenience])])
|
123
lib/libpciaccess/m4/ltsugar.m4
vendored
Normal file
123
lib/libpciaccess/m4/ltsugar.m4
vendored
Normal file
@ -0,0 +1,123 @@
|
||||
# ltsugar.m4 -- libtool m4 base layer. -*-Autoconf-*-
|
||||
#
|
||||
# Copyright (C) 2004, 2005, 2007, 2008 Free Software Foundation, Inc.
|
||||
# Written by Gary V. Vaughan, 2004
|
||||
#
|
||||
# This file is free software; the Free Software Foundation gives
|
||||
# unlimited permission to copy and/or distribute it, with or without
|
||||
# modifications, as long as this notice is preserved.
|
||||
|
||||
# serial 6 ltsugar.m4
|
||||
|
||||
# This is to help aclocal find these macros, as it can't see m4_define.
|
||||
AC_DEFUN([LTSUGAR_VERSION], [m4_if([0.1])])
|
||||
|
||||
|
||||
# lt_join(SEP, ARG1, [ARG2...])
|
||||
# -----------------------------
|
||||
# Produce ARG1SEPARG2...SEPARGn, omitting [] arguments and their
|
||||
# associated separator.
|
||||
# Needed until we can rely on m4_join from Autoconf 2.62, since all earlier
|
||||
# versions in m4sugar had bugs.
|
||||
m4_define([lt_join],
|
||||
[m4_if([$#], [1], [],
|
||||
[$#], [2], [[$2]],
|
||||
[m4_if([$2], [], [], [[$2]_])$0([$1], m4_shift(m4_shift($@)))])])
|
||||
m4_define([_lt_join],
|
||||
[m4_if([$#$2], [2], [],
|
||||
[m4_if([$2], [], [], [[$1$2]])$0([$1], m4_shift(m4_shift($@)))])])
|
||||
|
||||
|
||||
# lt_car(LIST)
|
||||
# lt_cdr(LIST)
|
||||
# ------------
|
||||
# Manipulate m4 lists.
|
||||
# These macros are necessary as long as will still need to support
|
||||
# Autoconf-2.59 which quotes differently.
|
||||
m4_define([lt_car], [[$1]])
|
||||
m4_define([lt_cdr],
|
||||
[m4_if([$#], 0, [m4_fatal([$0: cannot be called without arguments])],
|
||||
[$#], 1, [],
|
||||
[m4_dquote(m4_shift($@))])])
|
||||
m4_define([lt_unquote], $1)
|
||||
|
||||
|
||||
# lt_append(MACRO-NAME, STRING, [SEPARATOR])
|
||||
# ------------------------------------------
|
||||
# Redefine MACRO-NAME to hold its former content plus `SEPARATOR'`STRING'.
|
||||
# Note that neither SEPARATOR nor STRING are expanded; they are appended
|
||||
# to MACRO-NAME as is (leaving the expansion for when MACRO-NAME is invoked).
|
||||
# No SEPARATOR is output if MACRO-NAME was previously undefined (different
|
||||
# than defined and empty).
|
||||
#
|
||||
# This macro is needed until we can rely on Autoconf 2.62, since earlier
|
||||
# versions of m4sugar mistakenly expanded SEPARATOR but not STRING.
|
||||
m4_define([lt_append],
|
||||
[m4_define([$1],
|
||||
m4_ifdef([$1], [m4_defn([$1])[$3]])[$2])])
|
||||
|
||||
|
||||
|
||||
# lt_combine(SEP, PREFIX-LIST, INFIX, SUFFIX1, [SUFFIX2...])
|
||||
# ----------------------------------------------------------
|
||||
# Produce a SEP delimited list of all paired combinations of elements of
|
||||
# PREFIX-LIST with SUFFIX1 through SUFFIXn. Each element of the list
|
||||
# has the form PREFIXmINFIXSUFFIXn.
|
||||
# Needed until we can rely on m4_combine added in Autoconf 2.62.
|
||||
m4_define([lt_combine],
|
||||
[m4_if(m4_eval([$# > 3]), [1],
|
||||
[m4_pushdef([_Lt_sep], [m4_define([_Lt_sep], m4_defn([lt_car]))])]]dnl
|
||||
[[m4_foreach([_Lt_prefix], [$2],
|
||||
[m4_foreach([_Lt_suffix],
|
||||
]m4_dquote(m4_dquote(m4_shift(m4_shift(m4_shift($@)))))[,
|
||||
[_Lt_sep([$1])[]m4_defn([_Lt_prefix])[$3]m4_defn([_Lt_suffix])])])])])
|
||||
|
||||
|
||||
# lt_if_append_uniq(MACRO-NAME, VARNAME, [SEPARATOR], [UNIQ], [NOT-UNIQ])
|
||||
# -----------------------------------------------------------------------
|
||||
# Iff MACRO-NAME does not yet contain VARNAME, then append it (delimited
|
||||
# by SEPARATOR if supplied) and expand UNIQ, else NOT-UNIQ.
|
||||
m4_define([lt_if_append_uniq],
|
||||
[m4_ifdef([$1],
|
||||
[m4_if(m4_index([$3]m4_defn([$1])[$3], [$3$2$3]), [-1],
|
||||
[lt_append([$1], [$2], [$3])$4],
|
||||
[$5])],
|
||||
[lt_append([$1], [$2], [$3])$4])])
|
||||
|
||||
|
||||
# lt_dict_add(DICT, KEY, VALUE)
|
||||
# -----------------------------
|
||||
m4_define([lt_dict_add],
|
||||
[m4_define([$1($2)], [$3])])
|
||||
|
||||
|
||||
# lt_dict_add_subkey(DICT, KEY, SUBKEY, VALUE)
|
||||
# --------------------------------------------
|
||||
m4_define([lt_dict_add_subkey],
|
||||
[m4_define([$1($2:$3)], [$4])])
|
||||
|
||||
|
||||
# lt_dict_fetch(DICT, KEY, [SUBKEY])
|
||||
# ----------------------------------
|
||||
m4_define([lt_dict_fetch],
|
||||
[m4_ifval([$3],
|
||||
m4_ifdef([$1($2:$3)], [m4_defn([$1($2:$3)])]),
|
||||
m4_ifdef([$1($2)], [m4_defn([$1($2)])]))])
|
||||
|
||||
|
||||
# lt_if_dict_fetch(DICT, KEY, [SUBKEY], VALUE, IF-TRUE, [IF-FALSE])
|
||||
# -----------------------------------------------------------------
|
||||
m4_define([lt_if_dict_fetch],
|
||||
[m4_if(lt_dict_fetch([$1], [$2], [$3]), [$4],
|
||||
[$5],
|
||||
[$6])])
|
||||
|
||||
|
||||
# lt_dict_filter(DICT, [SUBKEY], VALUE, [SEPARATOR], KEY, [...])
|
||||
# --------------------------------------------------------------
|
||||
m4_define([lt_dict_filter],
|
||||
[m4_if([$5], [], [],
|
||||
[lt_join(m4_quote(m4_default([$4], [[, ]])),
|
||||
lt_unquote(m4_split(m4_normalize(m4_foreach(_Lt_key, lt_car([m4_shiftn(4, $@)]),
|
||||
[lt_if_dict_fetch([$1], _Lt_key, [$2], [$3], [_Lt_key ])])))))])[]dnl
|
||||
])
|
23
lib/libpciaccess/m4/ltversion.m4
vendored
Normal file
23
lib/libpciaccess/m4/ltversion.m4
vendored
Normal file
@ -0,0 +1,23 @@
|
||||
# ltversion.m4 -- version numbers -*- Autoconf -*-
|
||||
#
|
||||
# Copyright (C) 2004 Free Software Foundation, Inc.
|
||||
# Written by Scott James Remnant, 2004
|
||||
#
|
||||
# This file is free software; the Free Software Foundation gives
|
||||
# unlimited permission to copy and/or distribute it, with or without
|
||||
# modifications, as long as this notice is preserved.
|
||||
|
||||
# @configure_input@
|
||||
|
||||
# serial 3337 ltversion.m4
|
||||
# This file is part of GNU Libtool
|
||||
|
||||
m4_define([LT_PACKAGE_VERSION], [2.4.2])
|
||||
m4_define([LT_PACKAGE_REVISION], [1.3337])
|
||||
|
||||
AC_DEFUN([LTVERSION_VERSION],
|
||||
[macro_version='2.4.2'
|
||||
macro_revision='1.3337'
|
||||
_LT_DECL(, macro_version, 0, [Which release of libtool.m4 was used?])
|
||||
_LT_DECL(, macro_revision, 0)
|
||||
])
|
98
lib/libpciaccess/m4/lt~obsolete.m4
vendored
Normal file
98
lib/libpciaccess/m4/lt~obsolete.m4
vendored
Normal file
@ -0,0 +1,98 @@
|
||||
# lt~obsolete.m4 -- aclocal satisfying obsolete definitions. -*-Autoconf-*-
|
||||
#
|
||||
# Copyright (C) 2004, 2005, 2007, 2009 Free Software Foundation, Inc.
|
||||
# Written by Scott James Remnant, 2004.
|
||||
#
|
||||
# This file is free software; the Free Software Foundation gives
|
||||
# unlimited permission to copy and/or distribute it, with or without
|
||||
# modifications, as long as this notice is preserved.
|
||||
|
||||
# serial 5 lt~obsolete.m4
|
||||
|
||||
# These exist entirely to fool aclocal when bootstrapping libtool.
|
||||
#
|
||||
# In the past libtool.m4 has provided macros via AC_DEFUN (or AU_DEFUN)
|
||||
# which have later been changed to m4_define as they aren't part of the
|
||||
# exported API, or moved to Autoconf or Automake where they belong.
|
||||
#
|
||||
# The trouble is, aclocal is a bit thick. It'll see the old AC_DEFUN
|
||||
# in /usr/share/aclocal/libtool.m4 and remember it, then when it sees us
|
||||
# using a macro with the same name in our local m4/libtool.m4 it'll
|
||||
# pull the old libtool.m4 in (it doesn't see our shiny new m4_define
|
||||
# and doesn't know about Autoconf macros at all.)
|
||||
#
|
||||
# So we provide this file, which has a silly filename so it's always
|
||||
# included after everything else. This provides aclocal with the
|
||||
# AC_DEFUNs it wants, but when m4 processes it, it doesn't do anything
|
||||
# because those macros already exist, or will be overwritten later.
|
||||
# We use AC_DEFUN over AU_DEFUN for compatibility with aclocal-1.6.
|
||||
#
|
||||
# Anytime we withdraw an AC_DEFUN or AU_DEFUN, remember to add it here.
|
||||
# Yes, that means every name once taken will need to remain here until
|
||||
# we give up compatibility with versions before 1.7, at which point
|
||||
# we need to keep only those names which we still refer to.
|
||||
|
||||
# This is to help aclocal find these macros, as it can't see m4_define.
|
||||
AC_DEFUN([LTOBSOLETE_VERSION], [m4_if([1])])
|
||||
|
||||
m4_ifndef([AC_LIBTOOL_LINKER_OPTION], [AC_DEFUN([AC_LIBTOOL_LINKER_OPTION])])
|
||||
m4_ifndef([AC_PROG_EGREP], [AC_DEFUN([AC_PROG_EGREP])])
|
||||
m4_ifndef([_LT_AC_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_AC_PROG_ECHO_BACKSLASH])])
|
||||
m4_ifndef([_LT_AC_SHELL_INIT], [AC_DEFUN([_LT_AC_SHELL_INIT])])
|
||||
m4_ifndef([_LT_AC_SYS_LIBPATH_AIX], [AC_DEFUN([_LT_AC_SYS_LIBPATH_AIX])])
|
||||
m4_ifndef([_LT_PROG_LTMAIN], [AC_DEFUN([_LT_PROG_LTMAIN])])
|
||||
m4_ifndef([_LT_AC_TAGVAR], [AC_DEFUN([_LT_AC_TAGVAR])])
|
||||
m4_ifndef([AC_LTDL_ENABLE_INSTALL], [AC_DEFUN([AC_LTDL_ENABLE_INSTALL])])
|
||||
m4_ifndef([AC_LTDL_PREOPEN], [AC_DEFUN([AC_LTDL_PREOPEN])])
|
||||
m4_ifndef([_LT_AC_SYS_COMPILER], [AC_DEFUN([_LT_AC_SYS_COMPILER])])
|
||||
m4_ifndef([_LT_AC_LOCK], [AC_DEFUN([_LT_AC_LOCK])])
|
||||
m4_ifndef([AC_LIBTOOL_SYS_OLD_ARCHIVE], [AC_DEFUN([AC_LIBTOOL_SYS_OLD_ARCHIVE])])
|
||||
m4_ifndef([_LT_AC_TRY_DLOPEN_SELF], [AC_DEFUN([_LT_AC_TRY_DLOPEN_SELF])])
|
||||
m4_ifndef([AC_LIBTOOL_PROG_CC_C_O], [AC_DEFUN([AC_LIBTOOL_PROG_CC_C_O])])
|
||||
m4_ifndef([AC_LIBTOOL_SYS_HARD_LINK_LOCKS], [AC_DEFUN([AC_LIBTOOL_SYS_HARD_LINK_LOCKS])])
|
||||
m4_ifndef([AC_LIBTOOL_OBJDIR], [AC_DEFUN([AC_LIBTOOL_OBJDIR])])
|
||||
m4_ifndef([AC_LTDL_OBJDIR], [AC_DEFUN([AC_LTDL_OBJDIR])])
|
||||
m4_ifndef([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH], [AC_DEFUN([AC_LIBTOOL_PROG_LD_HARDCODE_LIBPATH])])
|
||||
m4_ifndef([AC_LIBTOOL_SYS_LIB_STRIP], [AC_DEFUN([AC_LIBTOOL_SYS_LIB_STRIP])])
|
||||
m4_ifndef([AC_PATH_MAGIC], [AC_DEFUN([AC_PATH_MAGIC])])
|
||||
m4_ifndef([AC_PROG_LD_GNU], [AC_DEFUN([AC_PROG_LD_GNU])])
|
||||
m4_ifndef([AC_PROG_LD_RELOAD_FLAG], [AC_DEFUN([AC_PROG_LD_RELOAD_FLAG])])
|
||||
m4_ifndef([AC_DEPLIBS_CHECK_METHOD], [AC_DEFUN([AC_DEPLIBS_CHECK_METHOD])])
|
||||
m4_ifndef([AC_LIBTOOL_PROG_COMPILER_NO_RTTI], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_NO_RTTI])])
|
||||
m4_ifndef([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE], [AC_DEFUN([AC_LIBTOOL_SYS_GLOBAL_SYMBOL_PIPE])])
|
||||
m4_ifndef([AC_LIBTOOL_PROG_COMPILER_PIC], [AC_DEFUN([AC_LIBTOOL_PROG_COMPILER_PIC])])
|
||||
m4_ifndef([AC_LIBTOOL_PROG_LD_SHLIBS], [AC_DEFUN([AC_LIBTOOL_PROG_LD_SHLIBS])])
|
||||
m4_ifndef([AC_LIBTOOL_POSTDEP_PREDEP], [AC_DEFUN([AC_LIBTOOL_POSTDEP_PREDEP])])
|
||||
m4_ifndef([LT_AC_PROG_EGREP], [AC_DEFUN([LT_AC_PROG_EGREP])])
|
||||
m4_ifndef([LT_AC_PROG_SED], [AC_DEFUN([LT_AC_PROG_SED])])
|
||||
m4_ifndef([_LT_CC_BASENAME], [AC_DEFUN([_LT_CC_BASENAME])])
|
||||
m4_ifndef([_LT_COMPILER_BOILERPLATE], [AC_DEFUN([_LT_COMPILER_BOILERPLATE])])
|
||||
m4_ifndef([_LT_LINKER_BOILERPLATE], [AC_DEFUN([_LT_LINKER_BOILERPLATE])])
|
||||
m4_ifndef([_AC_PROG_LIBTOOL], [AC_DEFUN([_AC_PROG_LIBTOOL])])
|
||||
m4_ifndef([AC_LIBTOOL_SETUP], [AC_DEFUN([AC_LIBTOOL_SETUP])])
|
||||
m4_ifndef([_LT_AC_CHECK_DLFCN], [AC_DEFUN([_LT_AC_CHECK_DLFCN])])
|
||||
m4_ifndef([AC_LIBTOOL_SYS_DYNAMIC_LINKER], [AC_DEFUN([AC_LIBTOOL_SYS_DYNAMIC_LINKER])])
|
||||
m4_ifndef([_LT_AC_TAGCONFIG], [AC_DEFUN([_LT_AC_TAGCONFIG])])
|
||||
m4_ifndef([AC_DISABLE_FAST_INSTALL], [AC_DEFUN([AC_DISABLE_FAST_INSTALL])])
|
||||
m4_ifndef([_LT_AC_LANG_CXX], [AC_DEFUN([_LT_AC_LANG_CXX])])
|
||||
m4_ifndef([_LT_AC_LANG_F77], [AC_DEFUN([_LT_AC_LANG_F77])])
|
||||
m4_ifndef([_LT_AC_LANG_GCJ], [AC_DEFUN([_LT_AC_LANG_GCJ])])
|
||||
m4_ifndef([AC_LIBTOOL_LANG_C_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_C_CONFIG])])
|
||||
m4_ifndef([_LT_AC_LANG_C_CONFIG], [AC_DEFUN([_LT_AC_LANG_C_CONFIG])])
|
||||
m4_ifndef([AC_LIBTOOL_LANG_CXX_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_CXX_CONFIG])])
|
||||
m4_ifndef([_LT_AC_LANG_CXX_CONFIG], [AC_DEFUN([_LT_AC_LANG_CXX_CONFIG])])
|
||||
m4_ifndef([AC_LIBTOOL_LANG_F77_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_F77_CONFIG])])
|
||||
m4_ifndef([_LT_AC_LANG_F77_CONFIG], [AC_DEFUN([_LT_AC_LANG_F77_CONFIG])])
|
||||
m4_ifndef([AC_LIBTOOL_LANG_GCJ_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_GCJ_CONFIG])])
|
||||
m4_ifndef([_LT_AC_LANG_GCJ_CONFIG], [AC_DEFUN([_LT_AC_LANG_GCJ_CONFIG])])
|
||||
m4_ifndef([AC_LIBTOOL_LANG_RC_CONFIG], [AC_DEFUN([AC_LIBTOOL_LANG_RC_CONFIG])])
|
||||
m4_ifndef([_LT_AC_LANG_RC_CONFIG], [AC_DEFUN([_LT_AC_LANG_RC_CONFIG])])
|
||||
m4_ifndef([AC_LIBTOOL_CONFIG], [AC_DEFUN([AC_LIBTOOL_CONFIG])])
|
||||
m4_ifndef([_LT_AC_FILE_LTDLL_C], [AC_DEFUN([_LT_AC_FILE_LTDLL_C])])
|
||||
m4_ifndef([_LT_REQUIRED_DARWIN_CHECKS], [AC_DEFUN([_LT_REQUIRED_DARWIN_CHECKS])])
|
||||
m4_ifndef([_LT_AC_PROG_CXXCPP], [AC_DEFUN([_LT_AC_PROG_CXXCPP])])
|
||||
m4_ifndef([_LT_PREPARE_SED_QUOTE_VARS], [AC_DEFUN([_LT_PREPARE_SED_QUOTE_VARS])])
|
||||
m4_ifndef([_LT_PROG_ECHO_BACKSLASH], [AC_DEFUN([_LT_PROG_ECHO_BACKSLASH])])
|
||||
m4_ifndef([_LT_PROG_F77], [AC_DEFUN([_LT_PROG_F77])])
|
||||
m4_ifndef([_LT_PROG_FC], [AC_DEFUN([_LT_PROG_FC])])
|
||||
m4_ifndef([_LT_PROG_CXX], [AC_DEFUN([_LT_PROG_CXX])])
|
@ -63,7 +63,9 @@ subdir = man
|
||||
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/m4/ax_define_dir.m4 \
|
||||
$(top_srcdir)/configure.ac
|
||||
$(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
|
||||
$(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
|
||||
$(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac
|
||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||
$(ACLOCAL_M4)
|
||||
mkinstalldirs = $(SHELL) $(install_sh) -d
|
||||
@ -87,6 +89,7 @@ AUTOCONF = @AUTOCONF@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AWK = @AWK@
|
||||
BASE_CFLAGS = @BASE_CFLAGS@
|
||||
CC = @CC@
|
||||
CCDEPMODE = @CCDEPMODE@
|
||||
CFLAGS = @CFLAGS@
|
||||
@ -94,24 +97,20 @@ CHANGELOG_CMD = @CHANGELOG_CMD@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CWARNFLAGS = @CWARNFLAGS@
|
||||
CXX = @CXX@
|
||||
CXXCPP = @CXXCPP@
|
||||
CXXDEPMODE = @CXXDEPMODE@
|
||||
CXXFLAGS = @CXXFLAGS@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
DEFS = @DEFS@
|
||||
DEPDIR = @DEPDIR@
|
||||
DLLTOOL = @DLLTOOL@
|
||||
DRIVER_MAN_DIR = @DRIVER_MAN_DIR@
|
||||
DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@
|
||||
DSYMUTIL = @DSYMUTIL@
|
||||
ECHO = @ECHO@
|
||||
DUMPBIN = @DUMPBIN@
|
||||
ECHO_C = @ECHO_C@
|
||||
ECHO_N = @ECHO_N@
|
||||
ECHO_T = @ECHO_T@
|
||||
EGREP = @EGREP@
|
||||
EXEEXT = @EXEEXT@
|
||||
F77 = @F77@
|
||||
FFLAGS = @FFLAGS@
|
||||
FGREP = @FGREP@
|
||||
FILE_MAN_DIR = @FILE_MAN_DIR@
|
||||
FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@
|
||||
FREEBSD_FALSE = @FREEBSD_FALSE@
|
||||
@ -124,6 +123,7 @@ INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
||||
LD = @LD@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LIBOBJS = @LIBOBJS@
|
||||
LIBS = @LIBS@
|
||||
@ -132,21 +132,27 @@ LIB_MAN_DIR = @LIB_MAN_DIR@
|
||||
LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@
|
||||
LINUX_FALSE = @LINUX_FALSE@
|
||||
LINUX_TRUE = @LINUX_TRUE@
|
||||
LIPO = @LIPO@
|
||||
LN_S = @LN_S@
|
||||
LTLIBOBJS = @LTLIBOBJS@
|
||||
MAINT = @MAINT@
|
||||
MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
|
||||
MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
MANIFEST_TOOL = @MANIFEST_TOOL@
|
||||
MAN_SUBSTS = @MAN_SUBSTS@
|
||||
MISC_MAN_DIR = @MISC_MAN_DIR@
|
||||
MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@
|
||||
NETBSD_FALSE = @NETBSD_FALSE@
|
||||
NETBSD_TRUE = @NETBSD_TRUE@
|
||||
NM = @NM@
|
||||
NMEDIT = @NMEDIT@
|
||||
OBJDUMP = @OBJDUMP@
|
||||
OBJEXT = @OBJEXT@
|
||||
OPENBSD_FALSE = @OPENBSD_FALSE@
|
||||
OPENBSD_TRUE = @OPENBSD_TRUE@
|
||||
OTOOL = @OTOOL@
|
||||
OTOOL64 = @OTOOL64@
|
||||
PACKAGE = @PACKAGE@
|
||||
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
|
||||
PACKAGE_NAME = @PACKAGE_NAME@
|
||||
@ -168,13 +174,11 @@ STRICT_CFLAGS = @STRICT_CFLAGS@
|
||||
STRIP = @STRIP@
|
||||
VERSION = @VERSION@
|
||||
XORG_MAN_PAGE = @XORG_MAN_PAGE@
|
||||
ac_ct_AR = @ac_ct_AR@
|
||||
ac_ct_CC = @ac_ct_CC@
|
||||
ac_ct_CXX = @ac_ct_CXX@
|
||||
ac_ct_F77 = @ac_ct_F77@
|
||||
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
|
||||
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
|
||||
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
|
||||
am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
|
||||
am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
|
||||
am__include = @am__include@
|
||||
am__leading_dot = @am__leading_dot@
|
||||
am__quote = @am__quote@
|
||||
|
@ -64,7 +64,9 @@ subdir = scanpci
|
||||
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/m4/ax_define_dir.m4 \
|
||||
$(top_srcdir)/configure.ac
|
||||
$(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
|
||||
$(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
|
||||
$(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac
|
||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||
$(ACLOCAL_M4)
|
||||
mkinstalldirs = $(SHELL) $(install_sh) -d
|
||||
@ -105,6 +107,7 @@ AUTOCONF = @AUTOCONF@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AWK = @AWK@
|
||||
BASE_CFLAGS = @BASE_CFLAGS@
|
||||
CC = @CC@
|
||||
CCDEPMODE = @CCDEPMODE@
|
||||
CFLAGS = @CFLAGS@
|
||||
@ -112,24 +115,20 @@ CHANGELOG_CMD = @CHANGELOG_CMD@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CWARNFLAGS = @CWARNFLAGS@
|
||||
CXX = @CXX@
|
||||
CXXCPP = @CXXCPP@
|
||||
CXXDEPMODE = @CXXDEPMODE@
|
||||
CXXFLAGS = @CXXFLAGS@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
DEFS = @DEFS@
|
||||
DEPDIR = @DEPDIR@
|
||||
DLLTOOL = @DLLTOOL@
|
||||
DRIVER_MAN_DIR = @DRIVER_MAN_DIR@
|
||||
DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@
|
||||
DSYMUTIL = @DSYMUTIL@
|
||||
ECHO = @ECHO@
|
||||
DUMPBIN = @DUMPBIN@
|
||||
ECHO_C = @ECHO_C@
|
||||
ECHO_N = @ECHO_N@
|
||||
ECHO_T = @ECHO_T@
|
||||
EGREP = @EGREP@
|
||||
EXEEXT = @EXEEXT@
|
||||
F77 = @F77@
|
||||
FFLAGS = @FFLAGS@
|
||||
FGREP = @FGREP@
|
||||
FILE_MAN_DIR = @FILE_MAN_DIR@
|
||||
FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@
|
||||
FREEBSD_FALSE = @FREEBSD_FALSE@
|
||||
@ -142,6 +141,7 @@ INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
||||
LD = @LD@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LIBOBJS = @LIBOBJS@
|
||||
LIBS = @LIBS@
|
||||
@ -150,21 +150,27 @@ LIB_MAN_DIR = @LIB_MAN_DIR@
|
||||
LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@
|
||||
LINUX_FALSE = @LINUX_FALSE@
|
||||
LINUX_TRUE = @LINUX_TRUE@
|
||||
LIPO = @LIPO@
|
||||
LN_S = @LN_S@
|
||||
LTLIBOBJS = @LTLIBOBJS@
|
||||
MAINT = @MAINT@
|
||||
MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
|
||||
MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
MANIFEST_TOOL = @MANIFEST_TOOL@
|
||||
MAN_SUBSTS = @MAN_SUBSTS@
|
||||
MISC_MAN_DIR = @MISC_MAN_DIR@
|
||||
MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@
|
||||
NETBSD_FALSE = @NETBSD_FALSE@
|
||||
NETBSD_TRUE = @NETBSD_TRUE@
|
||||
NM = @NM@
|
||||
NMEDIT = @NMEDIT@
|
||||
OBJDUMP = @OBJDUMP@
|
||||
OBJEXT = @OBJEXT@
|
||||
OPENBSD_FALSE = @OPENBSD_FALSE@
|
||||
OPENBSD_TRUE = @OPENBSD_TRUE@
|
||||
OTOOL = @OTOOL@
|
||||
OTOOL64 = @OTOOL64@
|
||||
PACKAGE = @PACKAGE@
|
||||
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
|
||||
PACKAGE_NAME = @PACKAGE_NAME@
|
||||
@ -186,13 +192,11 @@ STRICT_CFLAGS = @STRICT_CFLAGS@
|
||||
STRIP = @STRIP@
|
||||
VERSION = @VERSION@
|
||||
XORG_MAN_PAGE = @XORG_MAN_PAGE@
|
||||
ac_ct_AR = @ac_ct_AR@
|
||||
ac_ct_CC = @ac_ct_CC@
|
||||
ac_ct_CXX = @ac_ct_CXX@
|
||||
ac_ct_F77 = @ac_ct_F77@
|
||||
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
|
||||
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
|
||||
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
|
||||
am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
|
||||
am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
|
||||
am__include = @am__include@
|
||||
am__leading_dot = @am__leading_dot@
|
||||
am__quote = @am__quote@
|
||||
|
@ -22,10 +22,29 @@
|
||||
* DEALINGS IN THE SOFTWARE.
|
||||
*/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include "config.h"
|
||||
#endif
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <err.h>
|
||||
#include <unistd.h>
|
||||
#include <inttypes.h>
|
||||
|
||||
#ifdef HAVE_ERR_H
|
||||
#include <err.h>
|
||||
#else
|
||||
# include <errno.h>
|
||||
# include <string.h>
|
||||
# define err(exitcode, format, args...) \
|
||||
errx(exitcode, format ": %s", ## args, strerror(errno))
|
||||
# define errx(exitcode, format, args...) \
|
||||
{ warnx(format, ## args); exit(exitcode); }
|
||||
# define warn(format, args...) \
|
||||
warnx(format ": %s", ## args, strerror(errno))
|
||||
# define warnx(format, args...) \
|
||||
fprintf(stderr, format "\n", ## args)
|
||||
#endif
|
||||
|
||||
#include "pciaccess.h"
|
||||
|
||||
@ -33,19 +52,19 @@
|
||||
static void
|
||||
print_pci_bridge( const struct pci_bridge_info * info )
|
||||
{
|
||||
printf( " Bus: primary=%02x, secondary=%02x, subordinate=%02x, "
|
||||
"sec-latency=%u\n",
|
||||
printf( " Bus: primary=%02"PRIx8", secondary=%02"PRIx8", subordinate=%02"PRIx8", "
|
||||
"sec-latency=%"PRIu8"\n",
|
||||
info->primary_bus,
|
||||
info->secondary_bus,
|
||||
info->subordinate_bus,
|
||||
info->secondary_latency_timer );
|
||||
printf( " I/O behind bridge: %08x-%08x\n",
|
||||
printf( " I/O behind bridge: %08"PRIx32"-%08"PRIx32"\n",
|
||||
info->io_base,
|
||||
info->io_limit );
|
||||
printf( " Memory behind bridge: %08x-%08x\n",
|
||||
printf( " Memory behind bridge: %08"PRIx32"-%08"PRIx32"\n",
|
||||
info->mem_base,
|
||||
info->mem_limit );
|
||||
printf( " Prefetchable memory behind bridge: %08llx-%08llx\n",
|
||||
printf( " Prefetchable memory behind bridge: %08"PRIx64"-%08"PRIx64"\n",
|
||||
info->prefetch_mem_base,
|
||||
info->prefetch_mem_limit );
|
||||
}
|
||||
@ -132,7 +151,7 @@ print_pci_device( struct pci_device * dev, int verbose )
|
||||
pci_device_probe( dev );
|
||||
for ( i = 0 ; i < 6 ; i++ ) {
|
||||
if ( dev->regions[i].base_addr != 0 ) {
|
||||
printf( " BASE%u 0x%08x SIZE %d %s",
|
||||
printf( " BASE%u 0x%08"PRIxPTR" SIZE %zu %s",
|
||||
i,
|
||||
(intptr_t) dev->regions[i].base_addr,
|
||||
(size_t) dev->regions[i].size,
|
||||
|
@ -43,6 +43,7 @@ endif
|
||||
|
||||
if OPENBSD
|
||||
OS_SUPPORT = openbsd_pci.c
|
||||
# VGA Arbiter code is included in openbsd_pci.c
|
||||
endif
|
||||
|
||||
if SOLARIS
|
||||
@ -69,4 +70,4 @@ libpciaccess_la_SOURCES = common_bridge.c \
|
||||
|
||||
libpciaccess_la_LIBADD = $(PCIACCESS_LIBS)
|
||||
|
||||
libpciaccess_la_LDFLAGS = -version-number 0:10:8 -no-undefined
|
||||
libpciaccess_la_LDFLAGS = -version-number 0:11:0 -no-undefined
|
||||
|
@ -63,7 +63,9 @@ subdir = src
|
||||
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
|
||||
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
|
||||
am__aclocal_m4_deps = $(top_srcdir)/m4/ax_define_dir.m4 \
|
||||
$(top_srcdir)/configure.ac
|
||||
$(top_srcdir)/m4/libtool.m4 $(top_srcdir)/m4/ltoptions.m4 \
|
||||
$(top_srcdir)/m4/ltsugar.m4 $(top_srcdir)/m4/ltversion.m4 \
|
||||
$(top_srcdir)/m4/lt~obsolete.m4 $(top_srcdir)/configure.ac
|
||||
am__configure_deps = $(am__aclocal_m4_deps) $(CONFIGURE_DEPENDENCIES) \
|
||||
$(ACLOCAL_M4)
|
||||
mkinstalldirs = $(SHELL) $(install_sh) -d
|
||||
@ -135,6 +137,7 @@ AUTOCONF = @AUTOCONF@
|
||||
AUTOHEADER = @AUTOHEADER@
|
||||
AUTOMAKE = @AUTOMAKE@
|
||||
AWK = @AWK@
|
||||
BASE_CFLAGS = @BASE_CFLAGS@
|
||||
CC = @CC@
|
||||
CCDEPMODE = @CCDEPMODE@
|
||||
CFLAGS = @CFLAGS@
|
||||
@ -142,24 +145,20 @@ CHANGELOG_CMD = @CHANGELOG_CMD@
|
||||
CPP = @CPP@
|
||||
CPPFLAGS = @CPPFLAGS@
|
||||
CWARNFLAGS = @CWARNFLAGS@
|
||||
CXX = @CXX@
|
||||
CXXCPP = @CXXCPP@
|
||||
CXXDEPMODE = @CXXDEPMODE@
|
||||
CXXFLAGS = @CXXFLAGS@
|
||||
CYGPATH_W = @CYGPATH_W@
|
||||
DEFS = @DEFS@
|
||||
DEPDIR = @DEPDIR@
|
||||
DLLTOOL = @DLLTOOL@
|
||||
DRIVER_MAN_DIR = @DRIVER_MAN_DIR@
|
||||
DRIVER_MAN_SUFFIX = @DRIVER_MAN_SUFFIX@
|
||||
DSYMUTIL = @DSYMUTIL@
|
||||
ECHO = @ECHO@
|
||||
DUMPBIN = @DUMPBIN@
|
||||
ECHO_C = @ECHO_C@
|
||||
ECHO_N = @ECHO_N@
|
||||
ECHO_T = @ECHO_T@
|
||||
EGREP = @EGREP@
|
||||
EXEEXT = @EXEEXT@
|
||||
F77 = @F77@
|
||||
FFLAGS = @FFLAGS@
|
||||
FGREP = @FGREP@
|
||||
FILE_MAN_DIR = @FILE_MAN_DIR@
|
||||
FILE_MAN_SUFFIX = @FILE_MAN_SUFFIX@
|
||||
FREEBSD_FALSE = @FREEBSD_FALSE@
|
||||
@ -172,6 +171,7 @@ INSTALL_DATA = @INSTALL_DATA@
|
||||
INSTALL_PROGRAM = @INSTALL_PROGRAM@
|
||||
INSTALL_SCRIPT = @INSTALL_SCRIPT@
|
||||
INSTALL_STRIP_PROGRAM = @INSTALL_STRIP_PROGRAM@
|
||||
LD = @LD@
|
||||
LDFLAGS = @LDFLAGS@
|
||||
LIBOBJS = @LIBOBJS@
|
||||
LIBS = @LIBS@
|
||||
@ -180,21 +180,27 @@ LIB_MAN_DIR = @LIB_MAN_DIR@
|
||||
LIB_MAN_SUFFIX = @LIB_MAN_SUFFIX@
|
||||
LINUX_FALSE = @LINUX_FALSE@
|
||||
LINUX_TRUE = @LINUX_TRUE@
|
||||
LIPO = @LIPO@
|
||||
LN_S = @LN_S@
|
||||
LTLIBOBJS = @LTLIBOBJS@
|
||||
MAINT = @MAINT@
|
||||
MAINTAINER_MODE_FALSE = @MAINTAINER_MODE_FALSE@
|
||||
MAINTAINER_MODE_TRUE = @MAINTAINER_MODE_TRUE@
|
||||
MAKEINFO = @MAKEINFO@
|
||||
MANIFEST_TOOL = @MANIFEST_TOOL@
|
||||
MAN_SUBSTS = @MAN_SUBSTS@
|
||||
MISC_MAN_DIR = @MISC_MAN_DIR@
|
||||
MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@
|
||||
NETBSD_FALSE = @NETBSD_FALSE@
|
||||
NETBSD_TRUE = @NETBSD_TRUE@
|
||||
NM = @NM@
|
||||
NMEDIT = @NMEDIT@
|
||||
OBJDUMP = @OBJDUMP@
|
||||
OBJEXT = @OBJEXT@
|
||||
OPENBSD_FALSE = @OPENBSD_FALSE@
|
||||
OPENBSD_TRUE = @OPENBSD_TRUE@
|
||||
OTOOL = @OTOOL@
|
||||
OTOOL64 = @OTOOL64@
|
||||
PACKAGE = @PACKAGE@
|
||||
PACKAGE_BUGREPORT = @PACKAGE_BUGREPORT@
|
||||
PACKAGE_NAME = @PACKAGE_NAME@
|
||||
@ -216,13 +222,11 @@ STRICT_CFLAGS = @STRICT_CFLAGS@
|
||||
STRIP = @STRIP@
|
||||
VERSION = @VERSION@
|
||||
XORG_MAN_PAGE = @XORG_MAN_PAGE@
|
||||
ac_ct_AR = @ac_ct_AR@
|
||||
ac_ct_CC = @ac_ct_CC@
|
||||
ac_ct_CXX = @ac_ct_CXX@
|
||||
ac_ct_F77 = @ac_ct_F77@
|
||||
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
|
||||
am__fastdepCC_FALSE = @am__fastdepCC_FALSE@
|
||||
am__fastdepCC_TRUE = @am__fastdepCC_TRUE@
|
||||
am__fastdepCXX_FALSE = @am__fastdepCXX_FALSE@
|
||||
am__fastdepCXX_TRUE = @am__fastdepCXX_TRUE@
|
||||
am__include = @am__include@
|
||||
am__leading_dot = @am__leading_dot@
|
||||
am__quote = @am__quote@
|
||||
@ -271,6 +275,7 @@ lib_LTLIBRARIES = libpciaccess.la
|
||||
@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
|
||||
# VGA Arbiter code is included in openbsd_pci.c
|
||||
@SOLARIS_TRUE@OS_SUPPORT = solx_devfs.c pci_tools.h
|
||||
@FREEBSD_TRUE@VGA_ARBITER = common_vgaarb_stub.c
|
||||
@GNU_TRUE@VGA_ARBITER = common_vgaarb_stub.c
|
||||
@ -290,7 +295,7 @@ libpciaccess_la_SOURCES = common_bridge.c \
|
||||
$(OS_SUPPORT)
|
||||
|
||||
libpciaccess_la_LIBADD = $(PCIACCESS_LIBS)
|
||||
libpciaccess_la_LDFLAGS = -version-number 0:10:8 -no-undefined
|
||||
libpciaccess_la_LDFLAGS = -version-number 0:11:0 -no-undefined
|
||||
all: all-am
|
||||
|
||||
.SUFFIXES:
|
||||
|
@ -69,7 +69,7 @@ pci_id_file_open(void)
|
||||
#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;
|
||||
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)
|
||||
@ -189,7 +189,7 @@ insert( uint16_t vendor )
|
||||
static void
|
||||
populate_vendor( struct pci_id_leaf * vend, int fill_device_data )
|
||||
{
|
||||
pci_id_file * f;
|
||||
pci_id_file f;
|
||||
char buf[128];
|
||||
unsigned vendor = PCI_MATCH_ANY;
|
||||
|
||||
@ -269,7 +269,7 @@ populate_vendor( struct pci_id_leaf * vend, int fill_device_data )
|
||||
d = realloc( vend->devices, (vend->num_devices + 1)
|
||||
* sizeof( struct pci_device_leaf ) );
|
||||
if ( d == NULL ) {
|
||||
return;
|
||||
goto cleanup;
|
||||
}
|
||||
|
||||
last_dev = & d[ vend->num_devices - 1 ];
|
||||
@ -302,6 +302,7 @@ populate_vendor( struct pci_id_leaf * vend, int fill_device_data )
|
||||
}
|
||||
}
|
||||
|
||||
cleanup:
|
||||
pci_id_file_close( f );
|
||||
}
|
||||
|
||||
|
@ -654,3 +654,47 @@ pci_device_enable(struct pci_device *dev)
|
||||
if (pci_sys->methods->enable)
|
||||
pci_sys->methods->enable(dev);
|
||||
}
|
||||
|
||||
/**
|
||||
* Map the legacy memory space for the PCI domain containing \c dev.
|
||||
*
|
||||
* \param dev Device whose memory region is to be mapped.
|
||||
* \param base Base address of the range to be mapped.
|
||||
* \param size Size of the range to be mapped.
|
||||
* \param map_flags Flag bits controlling how the mapping is accessed.
|
||||
* \param addr Location to store the mapped address.
|
||||
*
|
||||
* \returns
|
||||
* Zero on success or an \c errno value on failure.
|
||||
*/
|
||||
int
|
||||
pci_device_map_legacy(struct pci_device *dev, pciaddr_t base, pciaddr_t size,
|
||||
unsigned map_flags, void **addr)
|
||||
{
|
||||
if (base > 0x100000 || base + size > 0x100000)
|
||||
return EINVAL;
|
||||
|
||||
if (!pci_sys->methods->map_legacy)
|
||||
return ENOSYS;
|
||||
|
||||
return pci_sys->methods->map_legacy(dev, base, size, map_flags, addr);
|
||||
}
|
||||
|
||||
/**
|
||||
* Unmap the legacy memory space for the PCI domain containing \c dev.
|
||||
*
|
||||
* \param dev Device whose memory region is to be unmapped.
|
||||
* \param addr Location of the mapped address.
|
||||
* \param size Size of the range to be unmapped.
|
||||
*
|
||||
* \returns
|
||||
* Zero on success or an \c errno value on failure.
|
||||
*/
|
||||
int
|
||||
pci_device_unmap_legacy(struct pci_device *dev, void *addr, pciaddr_t size)
|
||||
{
|
||||
if (!pci_sys->methods->unmap_legacy)
|
||||
return ENOSYS;
|
||||
|
||||
return pci_sys->methods->unmap_legacy(dev, addr, size);
|
||||
}
|
||||
|
@ -64,10 +64,15 @@ delete_io_handle(struct pci_io_handle *handle)
|
||||
}
|
||||
}
|
||||
|
||||
new = realloc(ios, sizeof(struct pci_io_handle) * (num_ios - 1));
|
||||
if (new)
|
||||
ios = new;
|
||||
num_ios--;
|
||||
if (num_ios) {
|
||||
new = realloc(ios, sizeof(struct pci_io_handle) * num_ios);
|
||||
if (new)
|
||||
ios = new;
|
||||
} else {
|
||||
free(ios);
|
||||
ios = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
_pci_hidden void
|
||||
|
@ -1,6 +1,7 @@
|
||||
/*
|
||||
* (C) Copyright IBM Corporation 2006
|
||||
* All Rights Reserved.
|
||||
* Copyright 2012 Red Hat, Inc.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
* copy of this software and associated documentation files (the "Software"),
|
||||
@ -44,6 +45,18 @@
|
||||
#include <dirent.h>
|
||||
#include <errno.h>
|
||||
|
||||
#if defined(__i386__) || defined(__x86_64__) || defined(__arm__)
|
||||
#include <sys/io.h>
|
||||
#else
|
||||
#define inb(x) -1
|
||||
#define inw(x) -1
|
||||
#define inl(x) -1
|
||||
#define outb(x) do {} while (0)
|
||||
#define outw(x) do {} while (0)
|
||||
#define outl(x) do {} while (0)
|
||||
#define iopl(x) -1
|
||||
#endif
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#ifdef HAVE_MTRR
|
||||
@ -122,7 +135,7 @@ scan_sys_pci_filter( const struct dirent * d )
|
||||
int
|
||||
populate_entries( struct pci_system * p )
|
||||
{
|
||||
struct dirent ** devices;
|
||||
struct dirent ** devices = NULL;
|
||||
int n;
|
||||
int i;
|
||||
int err = 0;
|
||||
@ -387,7 +400,9 @@ pci_device_linux_sysfs_read( struct pci_device * dev, void * data,
|
||||
/* If zero bytes were read, then we assume it's the end of the
|
||||
* config file.
|
||||
*/
|
||||
if ( bytes <= 0 ) {
|
||||
if (bytes == 0)
|
||||
break;
|
||||
if ( bytes < 0 ) {
|
||||
err = errno;
|
||||
break;
|
||||
}
|
||||
@ -445,7 +460,9 @@ pci_device_linux_sysfs_write( struct pci_device * dev, const void * data,
|
||||
/* If zero bytes were written, then we assume it's the end of the
|
||||
* config file.
|
||||
*/
|
||||
if ( bytes <= 0 ) {
|
||||
if ( bytes == 0 )
|
||||
break;
|
||||
if ( bytes < 0 ) {
|
||||
err = errno;
|
||||
break;
|
||||
}
|
||||
@ -765,12 +782,17 @@ pci_device_linux_sysfs_open_legacy_io(struct pci_io_handle *ret,
|
||||
dev = pci_device_get_parent_bridge(dev);
|
||||
}
|
||||
|
||||
/* If not, /dev/port is the best we can do */
|
||||
if (!dev)
|
||||
ret->fd = open("/dev/port", O_RDWR);
|
||||
/*
|
||||
* You would think you'd want to use /dev/port here. Don't make that
|
||||
* mistake, /dev/port only does byte-wide i/o cycles which means it
|
||||
* doesn't work. If you think this is stupid, well, you're right.
|
||||
*/
|
||||
|
||||
if (ret->fd < 0)
|
||||
return NULL;
|
||||
/* If we've no other choice, iopl */
|
||||
if (ret->fd < 0) {
|
||||
if (iopl(3))
|
||||
return NULL;
|
||||
}
|
||||
|
||||
ret->base = base;
|
||||
ret->size = size;
|
||||
@ -782,7 +804,8 @@ static void
|
||||
pci_device_linux_sysfs_close_io(struct pci_device *dev,
|
||||
struct pci_io_handle *handle)
|
||||
{
|
||||
close(handle->fd);
|
||||
if (handle->fd > -1)
|
||||
close(handle->fd);
|
||||
}
|
||||
|
||||
static uint32_t
|
||||
@ -790,7 +813,10 @@ pci_device_linux_sysfs_read32(struct pci_io_handle *handle, uint32_t port)
|
||||
{
|
||||
uint32_t ret;
|
||||
|
||||
pread(handle->fd, &ret, 4, port + handle->base);
|
||||
if (handle->fd > -1)
|
||||
pread(handle->fd, &ret, 4, port + handle->base);
|
||||
else
|
||||
ret = inl(port + handle->base);
|
||||
|
||||
return ret;
|
||||
}
|
||||
@ -800,7 +826,10 @@ pci_device_linux_sysfs_read16(struct pci_io_handle *handle, uint32_t port)
|
||||
{
|
||||
uint16_t ret;
|
||||
|
||||
pread(handle->fd, &ret, 2, port + handle->base);
|
||||
if (handle->fd > -1)
|
||||
pread(handle->fd, &ret, 2, port + handle->base);
|
||||
else
|
||||
ret = inw(port + handle->base);
|
||||
|
||||
return ret;
|
||||
}
|
||||
@ -810,7 +839,10 @@ pci_device_linux_sysfs_read8(struct pci_io_handle *handle, uint32_t port)
|
||||
{
|
||||
uint8_t ret;
|
||||
|
||||
pread(handle->fd, &ret, 1, port + handle->base);
|
||||
if (handle->fd > -1)
|
||||
pread(handle->fd, &ret, 1, port + handle->base);
|
||||
else
|
||||
ret = inb(port + handle->base);
|
||||
|
||||
return ret;
|
||||
}
|
||||
@ -819,25 +851,93 @@ static void
|
||||
pci_device_linux_sysfs_write32(struct pci_io_handle *handle, uint32_t port,
|
||||
uint32_t data)
|
||||
{
|
||||
pwrite(handle->fd, &data, 4, port + handle->base);
|
||||
if (handle->fd > -1)
|
||||
pwrite(handle->fd, &data, 4, port + handle->base);
|
||||
else
|
||||
outl(data, port + handle->base);
|
||||
}
|
||||
|
||||
static void
|
||||
pci_device_linux_sysfs_write16(struct pci_io_handle *handle, uint32_t port,
|
||||
uint16_t data)
|
||||
{
|
||||
pwrite(handle->fd, &data, 2, port + handle->base);
|
||||
if (handle->fd > -1)
|
||||
pwrite(handle->fd, &data, 2, port + handle->base);
|
||||
else
|
||||
outw(data, port + handle->base);
|
||||
}
|
||||
|
||||
static void
|
||||
pci_device_linux_sysfs_write8(struct pci_io_handle *handle, uint32_t port,
|
||||
uint8_t data)
|
||||
{
|
||||
pwrite(handle->fd, &data, 1, port + handle->base);
|
||||
if (handle->fd > -1)
|
||||
pwrite(handle->fd, &data, 1, port + handle->base);
|
||||
else
|
||||
outb(data, port + handle->base);
|
||||
}
|
||||
|
||||
static int
|
||||
pci_device_linux_sysfs_map_legacy(struct pci_device *dev, pciaddr_t base,
|
||||
pciaddr_t size, unsigned map_flags, void **addr)
|
||||
{
|
||||
char name[PATH_MAX];
|
||||
int flags = O_RDONLY;
|
||||
int prot = PROT_READ;
|
||||
int fd;
|
||||
int ret=0;
|
||||
|
||||
if (map_flags & PCI_DEV_MAP_FLAG_WRITABLE) {
|
||||
flags = O_RDWR; /* O_RDWR != O_WRONLY | O_RDONLY */;
|
||||
prot |= PROT_WRITE;
|
||||
}
|
||||
|
||||
/* First check if there's a legacy memory method for the device */
|
||||
while (dev) {
|
||||
snprintf(name, PATH_MAX, "/sys/class/pci_bus/%04x:%02x/legacy_mem",
|
||||
dev->domain, dev->bus);
|
||||
|
||||
fd = open(name, flags);
|
||||
if (fd >= 0)
|
||||
break;
|
||||
|
||||
dev = pci_device_get_parent_bridge(dev);
|
||||
}
|
||||
|
||||
/* If not, /dev/mem is the best we can do */
|
||||
if (!dev)
|
||||
fd = open("/dev/mem", flags);
|
||||
|
||||
if (fd < 0)
|
||||
return errno;
|
||||
|
||||
*addr = mmap(NULL, size, prot, MAP_SHARED, fd, base);
|
||||
if (*addr == MAP_FAILED) {
|
||||
ret = errno;
|
||||
}
|
||||
|
||||
close(fd);
|
||||
return ret;
|
||||
}
|
||||
|
||||
static int
|
||||
pci_device_linux_sysfs_unmap_legacy(struct pci_device *dev, void *addr, pciaddr_t size)
|
||||
{
|
||||
return munmap(addr, size);
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
pci_system_linux_destroy(void)
|
||||
{
|
||||
#ifdef HAVE_MTRR
|
||||
if (pci_sys->mtrr_fd != -1)
|
||||
close(pci_sys->mtrr_fd);
|
||||
#endif
|
||||
}
|
||||
|
||||
static const struct pci_system_methods linux_sysfs_methods = {
|
||||
.destroy = NULL,
|
||||
.destroy = pci_system_linux_destroy,
|
||||
.destroy_device = NULL,
|
||||
.read_rom = pci_device_linux_sysfs_read_rom,
|
||||
.probe = pci_device_linux_sysfs_probe,
|
||||
@ -861,4 +961,7 @@ static const struct pci_system_methods linux_sysfs_methods = {
|
||||
.write32 = pci_device_linux_sysfs_write32,
|
||||
.write16 = pci_device_linux_sysfs_write16,
|
||||
.write8 = pci_device_linux_sysfs_write8,
|
||||
|
||||
.map_legacy = pci_device_linux_sysfs_map_legacy,
|
||||
.unmap_legacy = pci_device_linux_sysfs_unmap_legacy,
|
||||
};
|
||||
|
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 2008 Mark Kettenis
|
||||
* Copyright (c) 2008, 2011 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
|
||||
@ -192,7 +192,8 @@ pci_device_openbsd_map_range(struct pci_device *dev,
|
||||
mo.mo_arg[0] = MEMRANGE_SET_UPDATE;
|
||||
|
||||
if (ioctl(aperturefd, MEMRANGE_SET, &mo))
|
||||
(void)fprintf(stderr, "mtrr set failed: %s\n",
|
||||
(void)fprintf(stderr, "mtrr set %lx %lx failed: %s\n",
|
||||
(intptr_t)map->base, (intptr_t)map->size,
|
||||
strerror(errno));
|
||||
}
|
||||
#endif
|
||||
@ -394,6 +395,141 @@ pci_device_openbsd_probe(struct pci_device *device)
|
||||
return 0;
|
||||
}
|
||||
|
||||
#if defined(__i386__) || defined(__amd64__)
|
||||
#include <machine/sysarch.h>
|
||||
#include <machine/pio.h>
|
||||
#endif
|
||||
|
||||
static struct pci_io_handle *
|
||||
pci_device_openbsd_open_legacy_io(struct pci_io_handle *ret,
|
||||
struct pci_device *dev, pciaddr_t base, pciaddr_t size)
|
||||
{
|
||||
#if defined(__i386__)
|
||||
struct i386_iopl_args ia;
|
||||
|
||||
ia.iopl = 1;
|
||||
if (sysarch(I386_IOPL, &ia))
|
||||
return NULL;
|
||||
|
||||
ret->base = base;
|
||||
ret->size = size;
|
||||
return ret;
|
||||
#elif defined(__amd64__)
|
||||
struct amd64_iopl_args ia;
|
||||
|
||||
ia.iopl = 1;
|
||||
if (sysarch(AMD64_IOPL, &ia))
|
||||
return NULL;
|
||||
|
||||
ret->base = base;
|
||||
ret->size = size;
|
||||
return ret;
|
||||
#elif defined(PCI_MAGIC_IO_RANGE)
|
||||
ret->memory = mmap(NULL, size, PROT_READ | PROT_WRITE, MAP_SHARED,
|
||||
aperturefd, PCI_MAGIC_IO_RANGE + base);
|
||||
if (ret->memory == MAP_FAILED)
|
||||
return NULL;
|
||||
|
||||
ret->base = base;
|
||||
ret->size = size;
|
||||
return ret;
|
||||
#else
|
||||
return NULL;
|
||||
#endif
|
||||
}
|
||||
|
||||
static uint32_t
|
||||
pci_device_openbsd_read32(struct pci_io_handle *handle, uint32_t reg)
|
||||
{
|
||||
#if defined(__i386__) || defined(__amd64__)
|
||||
return inl(handle->base + reg);
|
||||
#else
|
||||
return *(uint32_t *)((uintptr_t)handle->memory + reg);
|
||||
#endif
|
||||
}
|
||||
|
||||
static uint16_t
|
||||
pci_device_openbsd_read16(struct pci_io_handle *handle, uint32_t reg)
|
||||
{
|
||||
#if defined(__i386__) || defined(__amd64__)
|
||||
return inw(handle->base + reg);
|
||||
#else
|
||||
return *(uint16_t *)((uintptr_t)handle->memory + reg);
|
||||
#endif
|
||||
}
|
||||
|
||||
static uint8_t
|
||||
pci_device_openbsd_read8(struct pci_io_handle *handle, uint32_t reg)
|
||||
{
|
||||
#if defined(__i386__) || defined(__amd64__)
|
||||
return inb(handle->base + reg);
|
||||
#else
|
||||
return *(uint8_t *)((uintptr_t)handle->memory + reg);
|
||||
#endif
|
||||
}
|
||||
|
||||
static void
|
||||
pci_device_openbsd_write32(struct pci_io_handle *handle, uint32_t reg,
|
||||
uint32_t data)
|
||||
{
|
||||
#if defined(__i386__) || defined(__amd64__)
|
||||
outl(handle->base + reg, data);
|
||||
#else
|
||||
*(uint16_t *)((uintptr_t)handle->memory + reg) = data;
|
||||
#endif
|
||||
}
|
||||
|
||||
static void
|
||||
pci_device_openbsd_write16(struct pci_io_handle *handle, uint32_t reg,
|
||||
uint16_t data)
|
||||
{
|
||||
#if defined(__i386__) || defined(__amd64__)
|
||||
outw(handle->base + reg, data);
|
||||
#else
|
||||
*(uint8_t *)((uintptr_t)handle->memory + reg) = data;
|
||||
#endif
|
||||
}
|
||||
|
||||
static void
|
||||
pci_device_openbsd_write8(struct pci_io_handle *handle, uint32_t reg,
|
||||
uint8_t data)
|
||||
{
|
||||
#if defined(__i386__) || defined(__amd64__)
|
||||
outb(handle->base + reg, data);
|
||||
#else
|
||||
*(uint32_t *)((uintptr_t)handle->memory + reg) = data;
|
||||
#endif
|
||||
}
|
||||
|
||||
static int
|
||||
pci_device_openbsd_map_legacy(struct pci_device *dev, pciaddr_t base,
|
||||
pciaddr_t size, unsigned map_flags, void **addr)
|
||||
{
|
||||
struct pci_device_mapping map;
|
||||
int err;
|
||||
|
||||
map.base = base;
|
||||
map.size = size;
|
||||
map.flags = map_flags;
|
||||
map.memory = NULL;
|
||||
err = pci_device_openbsd_map_range(dev, &map);
|
||||
*addr = map.memory;
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
static int
|
||||
pci_device_openbsd_unmap_legacy(struct pci_device *dev, void *addr,
|
||||
pciaddr_t size)
|
||||
{
|
||||
struct pci_device_mapping map;
|
||||
|
||||
map.memory = addr;
|
||||
map.size = size;
|
||||
map.flags = 0;
|
||||
return pci_device_openbsd_unmap_range(dev, &map);
|
||||
}
|
||||
|
||||
static const struct pci_system_methods openbsd_pci_methods = {
|
||||
pci_system_openbsd_destroy,
|
||||
NULL,
|
||||
@ -403,7 +539,21 @@ static const struct pci_system_methods openbsd_pci_methods = {
|
||||
pci_device_openbsd_unmap_range,
|
||||
pci_device_openbsd_read,
|
||||
pci_device_openbsd_write,
|
||||
pci_fill_capabilities_generic
|
||||
pci_fill_capabilities_generic,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
NULL,
|
||||
pci_device_openbsd_open_legacy_io,
|
||||
NULL,
|
||||
pci_device_openbsd_read32,
|
||||
pci_device_openbsd_read16,
|
||||
pci_device_openbsd_read8,
|
||||
pci_device_openbsd_write32,
|
||||
pci_device_openbsd_write16,
|
||||
pci_device_openbsd_write8,
|
||||
pci_device_openbsd_map_legacy,
|
||||
pci_device_openbsd_unmap_legacy
|
||||
};
|
||||
|
||||
int
|
||||
@ -584,7 +734,6 @@ int
|
||||
pci_device_vgaarb_set_target(struct pci_device *dev)
|
||||
{
|
||||
pci_sys->vga_target = dev;
|
||||
return 0;
|
||||
}
|
||||
|
||||
int
|
||||
|
@ -77,6 +77,10 @@ struct pci_system_methods {
|
||||
void (*write16)( struct pci_io_handle *handle, uint32_t reg,
|
||||
uint16_t data );
|
||||
void (*write8)( struct pci_io_handle *handle, uint32_t reg, uint8_t data );
|
||||
|
||||
int (*map_legacy)(struct pci_device *dev, pciaddr_t base, pciaddr_t size,
|
||||
unsigned map_flags, void **addr);
|
||||
int (*unmap_legacy)(struct pci_device *dev, void *addr, pciaddr_t size);
|
||||
};
|
||||
|
||||
struct pci_device_mapping {
|
||||
@ -90,6 +94,7 @@ struct pci_device_mapping {
|
||||
struct pci_io_handle {
|
||||
pciaddr_t base;
|
||||
pciaddr_t size;
|
||||
void *memory;
|
||||
int fd;
|
||||
};
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
/*
|
||||
* (C) Copyright IBM Corporation 2006
|
||||
* Copyright (c) 2007, 2009, Oracle and/or its affiliates.
|
||||
* Copyright (c) 2007, 2009, 2011, Oracle and/or its affiliates.
|
||||
* All Rights Reserved.
|
||||
*
|
||||
* Permission is hereby granted, free of charge, to any person obtaining a
|
||||
@ -43,7 +43,7 @@
|
||||
|
||||
/* #define DEBUG */
|
||||
|
||||
#define MAX_DEVICES 256
|
||||
#define INITIAL_NUM_DEVICES 256
|
||||
#define CELL_NUMS_1275 (sizeof(pci_regspec_t) / sizeof(uint_t))
|
||||
|
||||
typedef union {
|
||||
@ -62,12 +62,31 @@ typedef struct nexus {
|
||||
int fd;
|
||||
int first_bus;
|
||||
int last_bus;
|
||||
int domain;
|
||||
char *path; /* for errors/debugging; fd is all we need */
|
||||
char *dev_path;
|
||||
struct nexus *next;
|
||||
#ifdef __sparc
|
||||
struct pci_device **devlist;
|
||||
volatile size_t num_allocated_elems;
|
||||
volatile size_t num_devices;
|
||||
#endif
|
||||
} nexus_t;
|
||||
|
||||
typedef struct probe_info {
|
||||
volatile size_t num_allocated_elems;
|
||||
volatile size_t num_devices;
|
||||
struct pci_device_private * volatile devices;
|
||||
} probe_info_t;
|
||||
|
||||
static nexus_t *nexus_list = NULL;
|
||||
#if !defined(__sparc)
|
||||
static int xsvc_fd = -1;
|
||||
#endif
|
||||
|
||||
#ifdef __sparc
|
||||
static di_prom_handle_t di_phdl;
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Read config space in native processor endianness. Endian-neutral
|
||||
@ -83,6 +102,10 @@ static int xsvc_fd = -1;
|
||||
# error "ISA is neither __sparc nor __x86"
|
||||
#endif
|
||||
|
||||
#ifdef __sparc
|
||||
#define MAPPING_DEV_PATH(dev) (((struct pci_device_private *) dev)->device_string)
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Identify problematic southbridges. These have device id 0x5249 and
|
||||
* vendor id 0x10b9. Check for revision ID 0 and class code 060400 as well.
|
||||
@ -103,61 +126,36 @@ static int xsvc_fd = -1;
|
||||
# define U45_SB_CLASS_RID 0x06040000
|
||||
#endif
|
||||
|
||||
static int pci_device_solx_devfs_map_range(struct pci_device *dev,
|
||||
struct pci_device_mapping *map);
|
||||
|
||||
static int pci_device_solx_devfs_read_rom( struct pci_device * dev,
|
||||
void * buffer );
|
||||
|
||||
static int pci_device_solx_devfs_probe( struct pci_device * dev );
|
||||
|
||||
static int pci_device_solx_devfs_read( struct pci_device * dev, void * data,
|
||||
pciaddr_t offset, pciaddr_t size, pciaddr_t * bytes_read );
|
||||
|
||||
static int pci_device_solx_devfs_write( struct pci_device * dev,
|
||||
const void * data, pciaddr_t offset, pciaddr_t size,
|
||||
pciaddr_t * bytes_written );
|
||||
|
||||
static int probe_dev(nexus_t *nexus, pcitool_reg_t *prg_p,
|
||||
struct pci_system *pci_sys);
|
||||
|
||||
static int do_probe(nexus_t *nexus, struct pci_system *pci_sys);
|
||||
|
||||
static int probe_nexus_node(di_node_t di_node, di_minor_t minor, void *arg);
|
||||
|
||||
static void pci_system_solx_devfs_destroy( void );
|
||||
|
||||
static int get_config_header(int fd, uint8_t bus_no, uint8_t dev_no,
|
||||
uint8_t func_no, pci_conf_hdr_t *config_hdr_p);
|
||||
|
||||
int pci_system_solx_devfs_create( void );
|
||||
|
||||
static const struct pci_system_methods solx_devfs_methods = {
|
||||
.destroy = pci_system_solx_devfs_destroy,
|
||||
.destroy_device = NULL,
|
||||
.read_rom = pci_device_solx_devfs_read_rom,
|
||||
.probe = pci_device_solx_devfs_probe,
|
||||
.map_range = pci_device_solx_devfs_map_range,
|
||||
.unmap_range = pci_device_generic_unmap_range,
|
||||
|
||||
.read = pci_device_solx_devfs_read,
|
||||
.write = pci_device_solx_devfs_write,
|
||||
|
||||
.fill_capabilities = pci_fill_capabilities_generic
|
||||
};
|
||||
|
||||
#ifdef __sparc
|
||||
static nexus_t *
|
||||
find_nexus_for_bus( int bus )
|
||||
find_nexus_for_dev(struct pci_device *dev)
|
||||
{
|
||||
nexus_t *nexus;
|
||||
int i;
|
||||
|
||||
for (nexus = nexus_list ; nexus != NULL ; nexus = nexus->next) {
|
||||
for (i = 0; i < nexus->num_devices; i++) {
|
||||
if (nexus->devlist[i] == dev)
|
||||
return nexus;
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
#else
|
||||
static nexus_t *
|
||||
find_nexus_for_bus( int domain, int bus )
|
||||
{
|
||||
nexus_t *nexus;
|
||||
|
||||
for (nexus = nexus_list ; nexus != NULL ; nexus = nexus->next) {
|
||||
if ((bus >= nexus->first_bus) && (bus <= nexus->last_bus)) {
|
||||
if ((domain == nexus->domain) &&
|
||||
(bus >= nexus->first_bus) && (bus <= nexus->last_bus)) {
|
||||
return nexus;
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
#endif
|
||||
|
||||
#define GET_CONFIG_VAL_8(offset) (config_hdr.bytes[offset])
|
||||
#define GET_CONFIG_VAL_16(offset) \
|
||||
@ -186,69 +184,33 @@ pci_system_solx_devfs_destroy( void )
|
||||
next = nexus->next;
|
||||
close(nexus->fd);
|
||||
free(nexus->path);
|
||||
free(nexus->dev_path);
|
||||
#ifdef __sparc
|
||||
{
|
||||
struct pci_device *dev;
|
||||
int i;
|
||||
|
||||
for (i = 0; i < nexus->num_devices; i++) {
|
||||
dev = nexus->devlist[i];
|
||||
if (MAPPING_DEV_PATH(dev))
|
||||
di_devfs_path_free((char *) MAPPING_DEV_PATH(dev));
|
||||
}
|
||||
}
|
||||
free(nexus->devlist);
|
||||
#endif
|
||||
free(nexus);
|
||||
}
|
||||
nexus_list = NULL;
|
||||
|
||||
#ifdef __sparc
|
||||
if (di_phdl != DI_PROM_HANDLE_NIL)
|
||||
(void) di_prom_fini(di_phdl);
|
||||
#else
|
||||
if (xsvc_fd >= 0) {
|
||||
close(xsvc_fd);
|
||||
xsvc_fd = -1;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Attempt to access PCI subsystem using Solaris's devfs interface.
|
||||
* Solaris version
|
||||
*/
|
||||
_pci_hidden int
|
||||
pci_system_solx_devfs_create( void )
|
||||
{
|
||||
int err = 0;
|
||||
di_node_t di_node;
|
||||
|
||||
|
||||
if (nexus_list != NULL) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* Only allow MAX_DEVICES exists
|
||||
* I will fix it later to get
|
||||
* the total devices first
|
||||
*/
|
||||
if ((pci_sys = calloc(1, sizeof (struct pci_system))) != NULL) {
|
||||
pci_sys->methods = &solx_devfs_methods;
|
||||
|
||||
if ((pci_sys->devices =
|
||||
calloc(MAX_DEVICES, sizeof (struct pci_device_private)))
|
||||
!= NULL) {
|
||||
|
||||
if ((di_node = di_init("/", DINFOCPYALL)) == DI_NODE_NIL) {
|
||||
err = errno;
|
||||
(void) fprintf(stderr, "di_init() failed: %s\n",
|
||||
strerror(errno));
|
||||
} else {
|
||||
(void) di_walk_minor(di_node, DDI_NT_REGACC, 0, pci_sys,
|
||||
probe_nexus_node);
|
||||
di_fini(di_node);
|
||||
}
|
||||
}
|
||||
else {
|
||||
err = errno;
|
||||
}
|
||||
} else {
|
||||
err = errno;
|
||||
}
|
||||
|
||||
if (err != 0) {
|
||||
if (pci_sys != NULL) {
|
||||
free(pci_sys->devices);
|
||||
free(pci_sys);
|
||||
pci_sys = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
return (err);
|
||||
#endif
|
||||
}
|
||||
|
||||
/*
|
||||
@ -289,7 +251,7 @@ get_config_header(int fd, uint8_t bus_no, uint8_t dev_no, uint8_t func_no,
|
||||
* Probe device's functions. Modifies many fields in the prg_p.
|
||||
*/
|
||||
static int
|
||||
probe_dev(nexus_t *nexus, pcitool_reg_t *prg_p, struct pci_system *pci_sys)
|
||||
probe_dev(nexus_t *nexus, pcitool_reg_t *prg_p, probe_info_t *pinfo)
|
||||
{
|
||||
pci_conf_hdr_t config_hdr;
|
||||
boolean_t multi_function_device;
|
||||
@ -367,6 +329,10 @@ probe_dev(nexus_t *nexus, pcitool_reg_t *prg_p, struct pci_system *pci_sys)
|
||||
else if (((errno != EFAULT) ||
|
||||
(prg_p->status != PCITOOL_INVALID_ADDRESS)) &&
|
||||
(prg_p->data != 0xffffffff)) {
|
||||
#ifdef __sparc
|
||||
/* on sparc, devices can be enumerated discontiguously. Do not quit */
|
||||
rval = 0;
|
||||
#endif
|
||||
break;
|
||||
}
|
||||
|
||||
@ -412,12 +378,9 @@ probe_dev(nexus_t *nexus, pcitool_reg_t *prg_p, struct pci_system *pci_sys)
|
||||
* function number.
|
||||
*/
|
||||
|
||||
pci_base = &pci_sys->devices[pci_sys->num_devices].base;
|
||||
pci_base = &pinfo->devices[pinfo->num_devices].base;
|
||||
|
||||
/*
|
||||
* Domain is peer bus??
|
||||
*/
|
||||
pci_base->domain = 0;
|
||||
pci_base->domain = nexus->domain;
|
||||
pci_base->bus = prg_p->bus_no;
|
||||
pci_base->dev = prg_p->dev_no;
|
||||
pci_base->func = func;
|
||||
@ -436,8 +399,9 @@ probe_dev(nexus_t *nexus, pcitool_reg_t *prg_p, struct pci_system *pci_sys)
|
||||
pci_base->device_id = GET_CONFIG_VAL_16(PCI_CONF_DEVID);
|
||||
pci_base->subvendor_id = GET_CONFIG_VAL_16(PCI_CONF_SUBVENID);
|
||||
pci_base->subdevice_id = GET_CONFIG_VAL_16(PCI_CONF_SUBSYSID);
|
||||
pci_base->irq = GET_CONFIG_VAL_8(PCI_CONF_ILINE);
|
||||
|
||||
pci_sys->devices[pci_sys->num_devices].header_type
|
||||
pinfo->devices[pinfo->num_devices].header_type
|
||||
= GET_CONFIG_VAL_8(PCI_CONF_HEADER);
|
||||
|
||||
#ifdef DEBUG
|
||||
@ -446,14 +410,45 @@ probe_dev(nexus_t *nexus, pcitool_reg_t *prg_p, struct pci_system *pci_sys)
|
||||
nexus->path, prg_p->bus_no, prg_p->dev_no, func);
|
||||
#endif
|
||||
|
||||
if (pci_sys->num_devices < (MAX_DEVICES - 1)) {
|
||||
pci_sys->num_devices++;
|
||||
} else {
|
||||
(void) fprintf(stderr,
|
||||
"Maximum number of PCI devices found,"
|
||||
" discarding additional devices\n");
|
||||
pinfo->num_devices++;
|
||||
if (pinfo->num_devices == pinfo->num_allocated_elems) {
|
||||
struct pci_device_private *new_devs;
|
||||
size_t new_num_elems = pinfo->num_allocated_elems * 2;
|
||||
|
||||
new_devs = realloc(pinfo->devices,
|
||||
new_num_elems * sizeof (struct pci_device_private));
|
||||
if (new_devs == NULL) {
|
||||
(void) fprintf(stderr,
|
||||
"Error allocating memory for PCI devices:"
|
||||
" %s\n discarding additional devices\n",
|
||||
strerror(errno));
|
||||
return (rval);
|
||||
}
|
||||
(void) memset(&new_devs[pinfo->num_devices], 0,
|
||||
pinfo->num_allocated_elems *
|
||||
sizeof (struct pci_device_private));
|
||||
pinfo->num_allocated_elems = new_num_elems;
|
||||
pinfo->devices = new_devs;
|
||||
}
|
||||
|
||||
#ifdef __sparc
|
||||
nexus->devlist[nexus->num_devices++] = pci_base;
|
||||
|
||||
if (nexus->num_devices == nexus->num_allocated_elems) {
|
||||
struct pci_device **new_devs;
|
||||
size_t new_num_elems = nexus->num_allocated_elems * 2;
|
||||
|
||||
new_devs = realloc(nexus->devlist,
|
||||
new_num_elems * sizeof (struct pci_device *));
|
||||
if (new_devs == NULL)
|
||||
return (rval);
|
||||
(void) memset(&new_devs[nexus->num_devices], 0,
|
||||
nexus->num_allocated_elems *
|
||||
sizeof (struct pci_device *));
|
||||
nexus->num_allocated_elems = new_num_elems;
|
||||
nexus->devlist = new_devs;
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Accommodate devices which state their
|
||||
@ -470,113 +465,6 @@ probe_dev(nexus_t *nexus, pcitool_reg_t *prg_p, struct pci_system *pci_sys)
|
||||
return (rval);
|
||||
}
|
||||
|
||||
/*
|
||||
* This function is called from di_walk_minor() when any PROBE is processed
|
||||
*/
|
||||
static int
|
||||
probe_nexus_node(di_node_t di_node, di_minor_t minor, void *arg)
|
||||
{
|
||||
struct pci_system *pci_sys = (struct pci_system *) arg;
|
||||
char *nexus_name;
|
||||
nexus_t *nexus;
|
||||
int fd;
|
||||
char nexus_path[MAXPATHLEN];
|
||||
|
||||
di_prop_t prop;
|
||||
char *strings;
|
||||
int *ints;
|
||||
int numval;
|
||||
int pci_node = 0;
|
||||
int first_bus = 0, last_bus = PCI_REG_BUS_G(PCI_REG_BUS_M);
|
||||
|
||||
#ifdef DEBUG
|
||||
nexus_name = di_devfs_minor_path(minor);
|
||||
fprintf(stderr, "-- device name: %s\n", nexus_name);
|
||||
#endif
|
||||
|
||||
for (prop = di_prop_next(di_node, NULL); prop != NULL;
|
||||
prop = di_prop_next(di_node, prop)) {
|
||||
|
||||
const char *prop_name = di_prop_name(prop);
|
||||
|
||||
#ifdef DEBUG
|
||||
fprintf(stderr, " property: %s\n", prop_name);
|
||||
#endif
|
||||
|
||||
if (strcmp(prop_name, "device_type") == 0) {
|
||||
numval = di_prop_strings(prop, &strings);
|
||||
if (numval != 1 || strncmp(strings, "pci", 3) != 0) {
|
||||
/* not a PCI node, bail */
|
||||
return (DI_WALK_CONTINUE);
|
||||
}
|
||||
pci_node = 1;
|
||||
}
|
||||
else if (strcmp(prop_name, "class-code") == 0) {
|
||||
/* not a root bus node, bail */
|
||||
return (DI_WALK_CONTINUE);
|
||||
}
|
||||
else if (strcmp(prop_name, "bus-range") == 0) {
|
||||
numval = di_prop_ints(prop, &ints);
|
||||
if (numval == 2) {
|
||||
first_bus = ints[0];
|
||||
last_bus = ints[1];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef __x86 /* sparc pci nodes don't have the device_type set */
|
||||
if (pci_node != 1)
|
||||
return (DI_WALK_CONTINUE);
|
||||
#endif
|
||||
|
||||
/* we have a PCI root bus node. */
|
||||
nexus = calloc(1, sizeof(nexus_t));
|
||||
if (nexus == NULL) {
|
||||
(void) fprintf(stderr, "Error allocating memory for nexus: %s\n",
|
||||
strerror(errno));
|
||||
return (DI_WALK_TERMINATE);
|
||||
}
|
||||
nexus->first_bus = first_bus;
|
||||
nexus->last_bus = last_bus;
|
||||
|
||||
nexus_name = di_devfs_minor_path(minor);
|
||||
if (nexus_name == NULL) {
|
||||
(void) fprintf(stderr, "Error getting nexus path: %s\n",
|
||||
strerror(errno));
|
||||
free(nexus);
|
||||
return (DI_WALK_CONTINUE);
|
||||
}
|
||||
|
||||
snprintf(nexus_path, sizeof(nexus_path), "/devices%s", nexus_name);
|
||||
di_devfs_path_free(nexus_name);
|
||||
|
||||
#ifdef DEBUG
|
||||
fprintf(stderr, "nexus = %s, bus-range = %d - %d\n",
|
||||
nexus_path, first_bus, last_bus);
|
||||
#endif
|
||||
|
||||
if ((fd = open(nexus_path, O_RDWR)) >= 0) {
|
||||
nexus->fd = fd;
|
||||
nexus->path = strdup(nexus_path);
|
||||
if ((do_probe(nexus, pci_sys) != 0) && (errno != ENXIO)) {
|
||||
(void) fprintf(stderr, "Error probing node %s: %s\n",
|
||||
nexus_path, strerror(errno));
|
||||
(void) close(fd);
|
||||
free(nexus->path);
|
||||
free(nexus);
|
||||
} else {
|
||||
nexus->next = nexus_list;
|
||||
nexus_list = nexus;
|
||||
}
|
||||
} else {
|
||||
(void) fprintf(stderr, "Error opening %s: %s\n",
|
||||
nexus_path, strerror(errno));
|
||||
free(nexus);
|
||||
}
|
||||
|
||||
return DI_WALK_CONTINUE;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Solaris version
|
||||
@ -586,7 +474,7 @@ probe_nexus_node(di_node_t di_node, di_minor_t minor, void *arg)
|
||||
* input_args contains commandline options as specified by the user.
|
||||
*/
|
||||
static int
|
||||
do_probe(nexus_t *nexus, struct pci_system *pci_sys)
|
||||
do_probe(nexus_t *nexus, probe_info_t *pinfo)
|
||||
{
|
||||
pcitool_reg_t prg;
|
||||
uint32_t bus;
|
||||
@ -620,7 +508,7 @@ do_probe(nexus_t *nexus, struct pci_system *pci_sys)
|
||||
|
||||
for (dev = first_dev; ((dev <= last_dev) && (rval == 0)); dev++) {
|
||||
prg.dev_no = dev;
|
||||
rval = probe_dev(nexus, &prg, pci_sys);
|
||||
rval = probe_dev(nexus, &prg, pinfo);
|
||||
}
|
||||
|
||||
/*
|
||||
@ -635,6 +523,172 @@ do_probe(nexus_t *nexus, struct pci_system *pci_sys)
|
||||
return (rval);
|
||||
}
|
||||
|
||||
/*
|
||||
* This function is called from di_walk_minor() when any PROBE is processed
|
||||
*/
|
||||
static int
|
||||
probe_nexus_node(di_node_t di_node, di_minor_t minor, void *arg)
|
||||
{
|
||||
probe_info_t *pinfo = (probe_info_t *)arg;
|
||||
char *nexus_name, *nexus_dev_path;
|
||||
nexus_t *nexus;
|
||||
int fd;
|
||||
char nexus_path[MAXPATHLEN];
|
||||
|
||||
di_prop_t prop;
|
||||
char *strings;
|
||||
int *ints;
|
||||
int numval;
|
||||
int pci_node = 0;
|
||||
int first_bus = 0, last_bus = PCI_REG_BUS_G(PCI_REG_BUS_M);
|
||||
int domain = 0;
|
||||
#ifdef __sparc
|
||||
int bus_range_found = 0;
|
||||
int device_type_found = 0;
|
||||
di_prom_prop_t prom_prop;
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef DEBUG
|
||||
nexus_name = di_devfs_minor_path(minor);
|
||||
fprintf(stderr, "-- device name: %s\n", nexus_name);
|
||||
#endif
|
||||
|
||||
for (prop = di_prop_next(di_node, NULL); prop != NULL;
|
||||
prop = di_prop_next(di_node, prop)) {
|
||||
|
||||
const char *prop_name = di_prop_name(prop);
|
||||
|
||||
#ifdef DEBUG
|
||||
fprintf(stderr, " property: %s\n", prop_name);
|
||||
#endif
|
||||
|
||||
if (strcmp(prop_name, "device_type") == 0) {
|
||||
numval = di_prop_strings(prop, &strings);
|
||||
if (numval == 1) {
|
||||
if (strncmp(strings, "pci", 3) != 0)
|
||||
/* not a PCI node, bail */
|
||||
return (DI_WALK_CONTINUE);
|
||||
else {
|
||||
pci_node = 1;
|
||||
#ifdef __sparc
|
||||
device_type_found = 1;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (strcmp(prop_name, "class-code") == 0) {
|
||||
/* not a root bus node, bail */
|
||||
return (DI_WALK_CONTINUE);
|
||||
}
|
||||
else if (strcmp(prop_name, "bus-range") == 0) {
|
||||
numval = di_prop_ints(prop, &ints);
|
||||
if (numval == 2) {
|
||||
first_bus = ints[0];
|
||||
last_bus = ints[1];
|
||||
#ifdef __sparc
|
||||
bus_range_found = 1;
|
||||
#endif
|
||||
}
|
||||
}
|
||||
else if (strcmp(prop_name, "pciseg") == 0) {
|
||||
numval = di_prop_ints(prop, &ints);
|
||||
if (numval == 1) {
|
||||
domain = ints[0];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef __sparc
|
||||
if ((!device_type_found) && di_phdl) {
|
||||
numval = di_prom_prop_lookup_strings(di_phdl, di_node,
|
||||
"device_type", &strings);
|
||||
if (numval == 1) {
|
||||
if (strncmp(strings, "pci", 3) != 0)
|
||||
return (DI_WALK_CONTINUE);
|
||||
else
|
||||
pci_node = 1;
|
||||
}
|
||||
}
|
||||
|
||||
if ((!bus_range_found) && di_phdl) {
|
||||
numval = di_prom_prop_lookup_ints(di_phdl, di_node,
|
||||
"bus-range", &ints);
|
||||
if (numval == 2) {
|
||||
first_bus = ints[0];
|
||||
last_bus = ints[1];
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
if (pci_node != 1)
|
||||
return (DI_WALK_CONTINUE);
|
||||
|
||||
/* we have a PCI root bus node. */
|
||||
nexus = calloc(1, sizeof(nexus_t));
|
||||
if (nexus == NULL) {
|
||||
(void) fprintf(stderr, "Error allocating memory for nexus: %s\n",
|
||||
strerror(errno));
|
||||
return (DI_WALK_TERMINATE);
|
||||
}
|
||||
nexus->first_bus = first_bus;
|
||||
nexus->last_bus = last_bus;
|
||||
nexus->domain = domain;
|
||||
|
||||
#ifdef __sparc
|
||||
if ((nexus->devlist = calloc(INITIAL_NUM_DEVICES,
|
||||
sizeof (struct pci_device *))) == NULL) {
|
||||
(void) fprintf(stderr, "Error allocating memory for nexus devlist: %s\n",
|
||||
strerror(errno));
|
||||
free (nexus);
|
||||
return (DI_WALK_TERMINATE);
|
||||
}
|
||||
nexus->num_allocated_elems = INITIAL_NUM_DEVICES;
|
||||
nexus->num_devices = 0;
|
||||
#endif
|
||||
|
||||
nexus_name = di_devfs_minor_path(minor);
|
||||
if (nexus_name == NULL) {
|
||||
(void) fprintf(stderr, "Error getting nexus path: %s\n",
|
||||
strerror(errno));
|
||||
free(nexus);
|
||||
return (DI_WALK_CONTINUE);
|
||||
}
|
||||
|
||||
snprintf(nexus_path, sizeof(nexus_path), "/devices%s", nexus_name);
|
||||
di_devfs_path_free(nexus_name);
|
||||
|
||||
#ifdef DEBUG
|
||||
fprintf(stderr, "nexus = %s, bus-range = %d - %d\n",
|
||||
nexus_path, first_bus, last_bus);
|
||||
#endif
|
||||
|
||||
if ((fd = open(nexus_path, O_RDWR)) >= 0) {
|
||||
nexus->fd = fd;
|
||||
nexus->path = strdup(nexus_path);
|
||||
nexus_dev_path = di_devfs_path(di_node);
|
||||
nexus->dev_path = strdup(nexus_dev_path);
|
||||
di_devfs_path_free(nexus_dev_path);
|
||||
if ((do_probe(nexus, pinfo) != 0) && (errno != ENXIO)) {
|
||||
(void) fprintf(stderr, "Error probing node %s: %s\n",
|
||||
nexus_path, strerror(errno));
|
||||
(void) close(fd);
|
||||
free(nexus->path);
|
||||
free(nexus->dev_path);
|
||||
free(nexus);
|
||||
} else {
|
||||
nexus->next = nexus_list;
|
||||
nexus_list = nexus;
|
||||
}
|
||||
} else {
|
||||
(void) fprintf(stderr, "Error opening %s: %s\n",
|
||||
nexus_path, strerror(errno));
|
||||
free(nexus);
|
||||
}
|
||||
|
||||
return DI_WALK_CONTINUE;
|
||||
}
|
||||
|
||||
static int
|
||||
find_target_node(di_node_t node, void *arg)
|
||||
{
|
||||
@ -667,6 +721,11 @@ find_target_node(di_node_t node, void *arg)
|
||||
|
||||
len = di_prop_lookup_ints(DDI_DEV_T_ANY, node, "reg", ®buf);
|
||||
|
||||
#ifdef __sparc
|
||||
if ((len <= 0) && di_phdl)
|
||||
len = di_prom_prop_lookup_ints(di_phdl, node, "reg", ®buf);
|
||||
#endif
|
||||
|
||||
if (len <= 0) {
|
||||
#ifdef DEBUG
|
||||
fprintf(stderr, "error = %x\n", errno);
|
||||
@ -696,55 +755,50 @@ find_target_node(di_node_t node, void *arg)
|
||||
static int
|
||||
pci_device_solx_devfs_probe( struct pci_device * dev )
|
||||
{
|
||||
uint8_t config[256];
|
||||
int err;
|
||||
int err = 0;
|
||||
di_node_t rnode = DI_NODE_NIL;
|
||||
i_devnode_t args = { 0, 0, 0, DI_NODE_NIL };
|
||||
int *regbuf;
|
||||
pci_regspec_t *reg;
|
||||
int i;
|
||||
pciaddr_t bytes;
|
||||
int len = 0;
|
||||
uint ent = 0;
|
||||
nexus_t *nexus;
|
||||
|
||||
err = pci_device_solx_devfs_read( dev, config, 0, 256, & bytes );
|
||||
#ifdef __sparc
|
||||
if ( (nexus = find_nexus_for_dev(dev)) == NULL )
|
||||
#else
|
||||
if ( (nexus = find_nexus_for_bus(dev->domain, dev->bus)) == NULL )
|
||||
#endif
|
||||
return ENODEV;
|
||||
|
||||
if ( bytes >= 64 ) {
|
||||
struct pci_device_private *priv =
|
||||
(struct pci_device_private *) dev;
|
||||
|
||||
dev->vendor_id = (uint16_t)config[0] + ((uint16_t)config[1] << 8);
|
||||
dev->device_id = (uint16_t)config[2] + ((uint16_t)config[3] << 8);
|
||||
dev->device_class = (uint32_t)config[9] +
|
||||
((uint32_t)config[10] << 8) +
|
||||
((uint16_t)config[11] << 16);
|
||||
|
||||
/*
|
||||
* device class code is already there.
|
||||
* see probe_dev function.
|
||||
*/
|
||||
dev->revision = config[8];
|
||||
dev->subvendor_id = (uint16_t)config[44] + ((uint16_t)config[45] << 8);
|
||||
dev->subdevice_id = (uint16_t)config[46] + ((uint16_t)config[47] << 8);
|
||||
dev->irq = config[60];
|
||||
|
||||
priv->header_type = config[14];
|
||||
/*
|
||||
* starting to find if it is MEM/MEM64/IO
|
||||
* using libdevinfo
|
||||
*/
|
||||
if ((rnode = di_init("/", DINFOCPYALL)) == DI_NODE_NIL) {
|
||||
err = errno;
|
||||
(void) fprintf(stderr, "di_init failed: %s\n", strerror(errno));
|
||||
} else {
|
||||
args.bus = dev->bus;
|
||||
args.dev = dev->dev;
|
||||
args.func = dev->func;
|
||||
(void) di_walk_node(rnode, DI_WALK_CLDFIRST,
|
||||
(void *)&args, find_target_node);
|
||||
}
|
||||
/*
|
||||
* starting to find if it is MEM/MEM64/IO
|
||||
* using libdevinfo
|
||||
*/
|
||||
if ((rnode = di_init(nexus->dev_path, DINFOCPYALL)) == DI_NODE_NIL) {
|
||||
err = errno;
|
||||
(void) fprintf(stderr, "di_init failed: %s\n", strerror(errno));
|
||||
} else {
|
||||
args.bus = dev->bus;
|
||||
args.dev = dev->dev;
|
||||
args.func = dev->func;
|
||||
(void) di_walk_node(rnode, DI_WALK_CLDFIRST,
|
||||
(void *)&args, find_target_node);
|
||||
}
|
||||
|
||||
if (args.node != DI_NODE_NIL) {
|
||||
#ifdef __sparc
|
||||
di_minor_t minor;
|
||||
#endif
|
||||
|
||||
#ifdef __sparc
|
||||
if (minor = di_minor_next(args.node, DI_MINOR_NIL))
|
||||
MAPPING_DEV_PATH(dev) = di_devfs_minor_path (minor);
|
||||
else
|
||||
MAPPING_DEV_PATH(dev) = NULL;
|
||||
#endif
|
||||
|
||||
/*
|
||||
* It will succeed for sure, because it was
|
||||
* successfully called in find_target_node
|
||||
@ -753,6 +807,12 @@ pci_device_solx_devfs_probe( struct pci_device * dev )
|
||||
"assigned-addresses",
|
||||
®buf);
|
||||
|
||||
#ifdef __sparc
|
||||
if ((len <= 0) && di_phdl) {
|
||||
len = di_prom_prop_lookup_ints(di_phdl, args.node,
|
||||
"assigned-addresses", ®buf);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
if (len <= 0)
|
||||
@ -845,6 +905,70 @@ pci_device_solx_devfs_probe( struct pci_device * dev )
|
||||
return (err);
|
||||
}
|
||||
|
||||
/**
|
||||
* Map a memory region for a device using /dev/xsvc.
|
||||
*
|
||||
* \param dev Device whose memory region is to be mapped.
|
||||
* \param map Parameters of the mapping that is to be created.
|
||||
*
|
||||
* \return
|
||||
* Zero on success or an \c errno value on failure.
|
||||
*/
|
||||
static int
|
||||
pci_device_solx_devfs_map_range(struct pci_device *dev,
|
||||
struct pci_device_mapping *map)
|
||||
{
|
||||
const int prot = ((map->flags & PCI_DEV_MAP_FLAG_WRITABLE) != 0)
|
||||
? (PROT_READ | PROT_WRITE) : PROT_READ;
|
||||
int err = 0;
|
||||
|
||||
#ifdef __sparc
|
||||
char map_dev[128];
|
||||
int map_fd;
|
||||
|
||||
if (MAPPING_DEV_PATH(dev))
|
||||
snprintf(map_dev, sizeof (map_dev), "%s%s", "/devices", MAPPING_DEV_PATH(dev));
|
||||
else
|
||||
strcpy (map_dev, "/dev/fb0");
|
||||
|
||||
if ((map_fd = open(map_dev, O_RDWR)) < 0) {
|
||||
err = errno;
|
||||
(void) fprintf(stderr, "can not open %s: %s\n", map_dev,
|
||||
strerror(errno));
|
||||
return err;
|
||||
}
|
||||
|
||||
map->memory = mmap(NULL, map->size, prot, MAP_SHARED, map_fd, map->base);
|
||||
#else
|
||||
/*
|
||||
* Still used xsvc to do the user space mapping
|
||||
*/
|
||||
if (xsvc_fd < 0) {
|
||||
if ((xsvc_fd = open("/dev/xsvc", O_RDWR)) < 0) {
|
||||
err = errno;
|
||||
(void) fprintf(stderr, "can not open /dev/xsvc: %s\n",
|
||||
strerror(errno));
|
||||
return err;
|
||||
}
|
||||
}
|
||||
|
||||
map->memory = mmap(NULL, map->size, prot, MAP_SHARED, xsvc_fd, map->base);
|
||||
#endif
|
||||
|
||||
if (map->memory == MAP_FAILED) {
|
||||
err = errno;
|
||||
|
||||
(void) fprintf(stderr, "map rom region =%llx failed: %s\n",
|
||||
map->base, strerror(errno));
|
||||
}
|
||||
|
||||
#ifdef __sparc
|
||||
close (map_fd);
|
||||
#endif
|
||||
|
||||
return err;
|
||||
}
|
||||
|
||||
/*
|
||||
* Solaris version: read the VGA ROM data
|
||||
*/
|
||||
@ -880,7 +1004,13 @@ pci_device_solx_devfs_read( struct pci_device * dev, void * data,
|
||||
pcitool_reg_t cfg_prg;
|
||||
int err = 0;
|
||||
int i = 0;
|
||||
nexus_t *nexus = find_nexus_for_bus(dev->bus);
|
||||
nexus_t *nexus;
|
||||
|
||||
#ifdef __sparc
|
||||
nexus = find_nexus_for_dev(dev);
|
||||
#else
|
||||
nexus = find_nexus_for_bus(dev->domain, dev->bus);
|
||||
#endif
|
||||
|
||||
*bytes_read = 0;
|
||||
|
||||
@ -932,7 +1062,13 @@ pci_device_solx_devfs_write( struct pci_device * dev, const void * data,
|
||||
pcitool_reg_t cfg_prg;
|
||||
int err = 0;
|
||||
int cmd;
|
||||
nexus_t *nexus = find_nexus_for_bus(dev->bus);
|
||||
nexus_t *nexus;
|
||||
|
||||
#ifdef __sparc
|
||||
nexus = find_nexus_for_dev(dev);
|
||||
#else
|
||||
nexus = find_nexus_for_bus(dev->domain, dev->bus);
|
||||
#endif
|
||||
|
||||
if ( bytes_written != NULL ) {
|
||||
*bytes_written = 0;
|
||||
@ -946,15 +1082,19 @@ pci_device_solx_devfs_write( struct pci_device * dev, const void * data,
|
||||
switch (size) {
|
||||
case 1:
|
||||
cfg_prg.acc_attr = PCITOOL_ACC_ATTR_SIZE_1 + NATIVE_ENDIAN;
|
||||
cfg_prg.data = *((const uint8_t *)data);
|
||||
break;
|
||||
case 2:
|
||||
cfg_prg.acc_attr = PCITOOL_ACC_ATTR_SIZE_2 + NATIVE_ENDIAN;
|
||||
cfg_prg.data = *((const uint16_t *)data);
|
||||
break;
|
||||
case 4:
|
||||
cfg_prg.acc_attr = PCITOOL_ACC_ATTR_SIZE_4 + NATIVE_ENDIAN;
|
||||
cfg_prg.data = *((const uint32_t *)data);
|
||||
break;
|
||||
case 8:
|
||||
cfg_prg.acc_attr = PCITOOL_ACC_ATTR_SIZE_8 + NATIVE_ENDIAN;
|
||||
cfg_prg.data = *((const uint64_t *)data);
|
||||
break;
|
||||
default:
|
||||
return EINVAL;
|
||||
@ -964,7 +1104,6 @@ pci_device_solx_devfs_write( struct pci_device * dev, const void * data,
|
||||
cfg_prg.func_no = dev->func;
|
||||
cfg_prg.barnum = 0;
|
||||
cfg_prg.user_version = PCITOOL_USER_VERSION;
|
||||
cfg_prg.data = *((uint64_t *)data);
|
||||
|
||||
/*
|
||||
* Check if this device is bridge device.
|
||||
@ -984,42 +1123,72 @@ pci_device_solx_devfs_write( struct pci_device * dev, const void * data,
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Map a memory region for a device using /dev/xsvc.
|
||||
*
|
||||
* \param dev Device whose memory region is to be mapped.
|
||||
* \param map Parameters of the mapping that is to be created.
|
||||
*
|
||||
* \return
|
||||
* Zero on success or an \c errno value on failure.
|
||||
|
||||
static const struct pci_system_methods solx_devfs_methods = {
|
||||
.destroy = pci_system_solx_devfs_destroy,
|
||||
.destroy_device = NULL,
|
||||
.read_rom = pci_device_solx_devfs_read_rom,
|
||||
.probe = pci_device_solx_devfs_probe,
|
||||
.map_range = pci_device_solx_devfs_map_range,
|
||||
.unmap_range = pci_device_generic_unmap_range,
|
||||
|
||||
.read = pci_device_solx_devfs_read,
|
||||
.write = pci_device_solx_devfs_write,
|
||||
|
||||
.fill_capabilities = pci_fill_capabilities_generic
|
||||
};
|
||||
|
||||
/*
|
||||
* Attempt to access PCI subsystem using Solaris's devfs interface.
|
||||
* Solaris version
|
||||
*/
|
||||
static int
|
||||
pci_device_solx_devfs_map_range(struct pci_device *dev,
|
||||
struct pci_device_mapping *map)
|
||||
_pci_hidden int
|
||||
pci_system_solx_devfs_create( void )
|
||||
{
|
||||
const int prot = ((map->flags & PCI_DEV_MAP_FLAG_WRITABLE) != 0)
|
||||
? (PROT_READ | PROT_WRITE) : PROT_READ;
|
||||
int err = 0;
|
||||
di_node_t di_node;
|
||||
probe_info_t pinfo;
|
||||
struct pci_device_private *devices;
|
||||
|
||||
/*
|
||||
* Still used xsvc to do the user space mapping
|
||||
*/
|
||||
if (xsvc_fd < 0) {
|
||||
if ((xsvc_fd = open("/dev/xsvc", O_RDWR)) < 0) {
|
||||
err = errno;
|
||||
(void) fprintf(stderr, "can not open /dev/xsvc: %s\n",
|
||||
strerror(errno));
|
||||
return err;
|
||||
}
|
||||
if (nexus_list != NULL) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
map->memory = mmap(NULL, map->size, prot, MAP_SHARED, xsvc_fd, map->base);
|
||||
if (map->memory == MAP_FAILED) {
|
||||
if ((di_node = di_init("/", DINFOCPYALL)) == DI_NODE_NIL) {
|
||||
err = errno;
|
||||
|
||||
(void) fprintf(stderr, "map rom region =%llx failed: %s\n",
|
||||
map->base, strerror(errno));
|
||||
(void) fprintf(stderr, "di_init() failed: %s\n",
|
||||
strerror(errno));
|
||||
return (err);
|
||||
}
|
||||
|
||||
return err;
|
||||
if ((devices = calloc(INITIAL_NUM_DEVICES,
|
||||
sizeof (struct pci_device_private))) == NULL) {
|
||||
err = errno;
|
||||
di_fini(di_node);
|
||||
return (err);
|
||||
}
|
||||
|
||||
#ifdef __sparc
|
||||
if ((di_phdl = di_prom_init()) == DI_PROM_HANDLE_NIL)
|
||||
(void) fprintf(stderr, "di_prom_init failed: %s\n", strerror(errno));
|
||||
#endif
|
||||
|
||||
pinfo.num_allocated_elems = INITIAL_NUM_DEVICES;
|
||||
pinfo.num_devices = 0;
|
||||
pinfo.devices = devices;
|
||||
(void) di_walk_minor(di_node, DDI_NT_REGACC, 0, &pinfo, probe_nexus_node);
|
||||
|
||||
di_fini(di_node);
|
||||
|
||||
if ((pci_sys = calloc(1, sizeof (struct pci_system))) == NULL) {
|
||||
err = errno;
|
||||
free(devices);
|
||||
return (err);
|
||||
}
|
||||
|
||||
pci_sys->methods = &solx_devfs_methods;
|
||||
pci_sys->devices = pinfo.devices;
|
||||
pci_sys->num_devices = pinfo.num_devices;
|
||||
|
||||
return (err);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user