summaryrefslogtreecommitdiffstats
path: root/sys/i386
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2008-09-11 21:42:11 +0000
committerjhb <jhb@FreeBSD.org>2008-09-11 21:42:11 +0000
commit1d4a561a281b386aeefb1c4827cf8fe6c86f21d0 (patch)
treec9d1712fe0e9f4587422020efab72df18a87a3dc /sys/i386
parent5b5d402e310bfeb84d4bc66d726e9ec45b26b6dd (diff)
downloadFreeBSD-src-1d4a561a281b386aeefb1c4827cf8fe6c86f21d0.zip
FreeBSD-src-1d4a561a281b386aeefb1c4827cf8fe6c86f21d0.tar.gz
Add a 'hw.pci.mcfg' tunable. It can be set to 0 to disable memory-mapped
PCI config access.
Diffstat (limited to 'sys/i386')
-rw-r--r--sys/i386/pci/pci_cfgreg.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/sys/i386/pci/pci_cfgreg.c b/sys/i386/pci/pci_cfgreg.c
index 50ff320..3c41ba7 100644
--- a/sys/i386/pci/pci_cfgreg.c
+++ b/sys/i386/pci/pci_cfgreg.c
@@ -36,6 +36,7 @@ __FBSDID("$FreeBSD$");
#include <sys/systm.h>
#include <sys/bus.h>
#include <sys/lock.h>
+#include <sys/kernel.h>
#include <sys/mutex.h>
#include <sys/malloc.h>
#include <sys/queue.h>
@@ -81,6 +82,8 @@ static uint32_t pcie_badslots;
static int cfgmech;
static int devmax;
static struct mtx pcicfg_mtx;
+static int mcfg_enable = 1;
+TUNABLE_INT("hw.pci.mcfg", &mcfg_enable);
static uint32_t pci_docfgregread(int bus, int slot, int func, int reg,
int bytes);
@@ -522,6 +525,9 @@ pcie_cfgregopen(uint64_t base, uint8_t minbus, uint8_t maxbus)
uint32_t val1, val2;
int i, slot;
+ if (!mcfg_enable)
+ return (0);
+
if (minbus != 0)
return (0);
OpenPOWER on IntegriCloud