Date: Thu, 19 Mar 2009 19:22:12 +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-6@freebsd.org Subject: svn commit: r190095 - in stable/6/sys: . contrib/pf dev/cxgb dev/pci Message-ID: <200903191922.n2JJMCF5073184@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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.
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200903191922.n2JJMCF5073184>