Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 19 Mar 2009 18:04:37 +0000 (UTC)
From:      John Baldwin <jhb@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
Subject:   svn commit: r190092 - in stable/7/sys: . contrib/pf dev/ath/ath_hal dev/cxgb dev/pci
Message-ID:  <200903191804.n2JI4bZ4071402@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200903191804.n2JI4bZ4071402>