From owner-svn-src-all@FreeBSD.ORG Thu Mar 19 19:22:12 2009 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 54E1E106566B; Thu, 19 Mar 2009 19:22:12 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 421FA8FC13; Thu, 19 Mar 2009 19:22:12 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n2JJMClH073185; Thu, 19 Mar 2009 19:22:12 GMT (envelope-from jhb@svn.freebsd.org) Received: (from jhb@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n2JJMCF5073184; Thu, 19 Mar 2009 19:22:12 GMT (envelope-from jhb@svn.freebsd.org) Message-Id: <200903191922.n2JJMCF5073184@svn.freebsd.org> From: John Baldwin Date: Thu, 19 Mar 2009 19:22:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-6@freebsd.org X-SVN-Group: stable-6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r190095 - in stable/6/sys: . contrib/pf dev/cxgb dev/pci X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 19 Mar 2009 19:22:13 -0000 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.