From owner-svn-src-all@FreeBSD.ORG Sun Sep 13 14:47:32 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 51A53106566B; Sun, 13 Sep 2009 14:47:32 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id 40E028FC08; Sun, 13 Sep 2009 14:47:32 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n8DElWvn023734; Sun, 13 Sep 2009 14:47:32 GMT (envelope-from marius@svn.freebsd.org) Received: (from marius@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n8DElWAo023729; Sun, 13 Sep 2009 14:47:32 GMT (envelope-from marius@svn.freebsd.org) Message-Id: <200909131447.n8DElWAo023729@svn.freebsd.org> From: Marius Strobl Date: Sun, 13 Sep 2009 14:47:32 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197164 - in head/sys/sparc64: pci sparc64 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: Sun, 13 Sep 2009 14:47:32 -0000 Author: marius Date: Sun Sep 13 14:47:31 2009 New Revision: 197164 URL: http://svn.freebsd.org/changeset/base/197164 Log: Factor out the duplicated macro for the device type used in the OFW device tree for PCI bridges and add a new one for PCI Express. While at it, take advantage of the former for the rman(9) work- around in jbusppm(4). Modified: head/sys/sparc64/pci/ofw_pci.h head/sys/sparc64/pci/psycho.c head/sys/sparc64/pci/schizo.c head/sys/sparc64/sparc64/jbusppm.c Modified: head/sys/sparc64/pci/ofw_pci.h ============================================================================== --- head/sys/sparc64/pci/ofw_pci.h Sun Sep 13 13:15:36 2009 (r197163) +++ head/sys/sparc64/pci/ofw_pci.h Sun Sep 13 14:47:31 2009 (r197164) @@ -44,6 +44,10 @@ typedef uint32_t ofw_pci_intr_t; #define OFW_PCI_CS_MEM32 0x02 #define OFW_PCI_CS_MEM64 0x03 +/* OFW device types */ +#define OFW_TYPE_PCI "pci" +#define OFW_TYPE_PCIE "pciex" + struct ofw_pci_ranges { uint32_t cspace; uint32_t child_hi; Modified: head/sys/sparc64/pci/psycho.c ============================================================================== --- head/sys/sparc64/pci/psycho.c Sun Sep 13 13:15:36 2009 (r197163) +++ head/sys/sparc64/pci/psycho.c Sun Sep 13 14:47:31 2009 (r197164) @@ -224,8 +224,6 @@ struct psycho_dma_sync { * providing two PCI buses. */ -#define OFW_PCI_TYPE "pci" - struct psycho_desc { const char *pd_string; int pd_mode; @@ -275,7 +273,7 @@ psycho_probe(device_t dev) const char *dtype; dtype = ofw_bus_get_type(dev); - if (dtype != NULL && strcmp(dtype, OFW_PCI_TYPE) == 0 && + if (dtype != NULL && strcmp(dtype, OFW_TYPE_PCI) == 0 && psycho_get_desc(dev) != NULL) { device_set_desc(dev, "U2P UPA-PCI bridge"); return (0); Modified: head/sys/sparc64/pci/schizo.c ============================================================================== --- head/sys/sparc64/pci/schizo.c Sun Sep 13 13:15:36 2009 (r197163) +++ head/sys/sparc64/pci/schizo.c Sun Sep 13 14:47:31 2009 (r197164) @@ -209,8 +209,6 @@ struct schizo_dma_sync { #define SCHIZO_ICON_WRITE_8(sc, offs, v) \ SCHIZO_SPC_WRITE_8(STX_ICON, (sc), (offs), (v)) -#define OFW_PCI_TYPE "pci" - struct schizo_desc { const char *sd_string; int sd_mode; @@ -244,7 +242,7 @@ schizo_probe(device_t dev) const char *dtype; dtype = ofw_bus_get_type(dev); - if (dtype != NULL && strcmp(dtype, OFW_PCI_TYPE) == 0 && + if (dtype != NULL && strcmp(dtype, OFW_TYPE_PCI) == 0 && schizo_get_desc(dev) != NULL) { device_set_desc(dev, "Sun Host-PCI bridge"); return (0); Modified: head/sys/sparc64/sparc64/jbusppm.c ============================================================================== --- head/sys/sparc64/sparc64/jbusppm.c Sun Sep 13 13:15:36 2009 (r197163) +++ head/sys/sparc64/sparc64/jbusppm.c Sun Sep 13 14:47:31 2009 (r197164) @@ -40,6 +40,10 @@ __FBSDID("$FreeBSD$"); #include #include +#if 1 +#include +#endif + #define JBUSPPM_NREG 2 #define JBUSPPM_DEVID 0 @@ -150,7 +154,7 @@ jbusppm_attach(device_t dev) for (j = 0; j < nchildren; j++) { if (ofw_bus_get_type(children[j]) != NULL && strcmp(ofw_bus_get_type(children[j]), - "pci") == 0 && + OFW_TYPE_PCI) == 0 && ofw_bus_get_compat(children[j]) != NULL && strcmp(ofw_bus_get_compat(children[j]), "pci108e,a801") == 0 &&