svn commit: r190092 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb dev/pci

John Baldwin jhb at FreeBSD.org
Thu Mar 19 11:04:38 PDT 2009


Author: jhb
Date: Thu Mar 19 18:04:37 2009
New Revision: 190092
URL: http://svn.freebsd.org/changeset/base/190092

Log:
  MFC: Honor the prefetchable flag in memory BARs.

Modified:
  stable/7/sys/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)
  stable/7/sys/dev/ath/ath_hal/   (props changed)
  stable/7/sys/dev/cxgb/   (props changed)
  stable/7/sys/dev/pci/pci.c

Modified: stable/7/sys/dev/pci/pci.c
==============================================================================
--- stable/7/sys/dev/pci/pci.c	Thu Mar 19 17:46:51 2009	(r190091)
+++ stable/7/sys/dev/pci/pci.c	Thu Mar 19 18:04:37 2009	(r190092)
@@ -2295,9 +2295,11 @@ pci_add_map(device_t pcib, device_t bus,
 	testval = PCIB_READ_CONFIG(pcib, b, s, f, reg, 4);
 	PCIB_WRITE_CONFIG(pcib, b, s, f, reg, map, 4);
 
-	if (PCI_BAR_MEM(map))
+	if (PCI_BAR_MEM(map)) {
 		type = SYS_RES_MEMORY;
-	else
+		if (map & PCIM_BAR_MEM_PREFETCH)
+			prefetch = 1;
+	} else
 		type = SYS_RES_IOPORT;
 	ln2size = pci_mapsize(testval);
 	ln2range = pci_maprange(testval);
@@ -3444,6 +3446,8 @@ pci_alloc_map(device_t dev, device_t chi
 	count = 1UL << mapsize;
 	if (RF_ALIGNMENT(flags) < mapsize)
 		flags = (flags & ~RF_ALIGNMENT_MASK) | RF_ALIGNMENT_LOG2(mapsize);
+	if (PCI_BAR_MEM(testval) && (testval & PCIM_BAR_MEM_PREFETCH))
+		flags |= RF_PREFETCHABLE;
 
 	/*
 	 * Allocate enough resource, and then write back the


More information about the svn-src-all mailing list