svn commit: r190095 - in stable/6/sys: . contrib/pf dev/cxgb dev/pci

John Baldwin jhb at FreeBSD.org
Thu Mar 19 12:22:13 PDT 2009


Author: jhb
Date: Thu Mar 19 19:22:11 2009
New Revision: 190095
URL: http://svn.freebsd.org/changeset/base/190095

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

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

Modified: stable/6/sys/dev/pci/pci.c
==============================================================================
--- stable/6/sys/dev/pci/pci.c	Thu Mar 19 18:45:37 2009	(r190094)
+++ stable/6/sys/dev/pci/pci.c	Thu Mar 19 19:22:11 2009	(r190095)
@@ -1706,9 +1706,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_maptype(map) & PCI_MAPMEM)
+	if (pci_maptype(map) & PCI_MAPMEM) {
 		type = SYS_RES_MEMORY;
-	else
+		if (pci_maptype(map) & PCI_MAPMEMP)
+			prefetch = 1;
+	} else
 		type = SYS_RES_IOPORT;
 	ln2size = pci_mapsize(testval);
 	ln2range = pci_maprange(testval);
@@ -2811,7 +2813,9 @@ pci_alloc_map(device_t dev, device_t chi
 	count = 1 << mapsize;
 	if (RF_ALIGNMENT(flags) < mapsize)
 		flags = (flags & ~RF_ALIGNMENT_MASK) | RF_ALIGNMENT_LOG2(mapsize);
-	
+	if (pci_maptype(testval) & PCI_MAPMEMP)
+		flags |= RF_PREFETCHABLE;
+
 	/*
 	 * Allocate enough resource, and then write back the
 	 * appropriate bar for that resource.


More information about the svn-src-all mailing list