PERFORCE change 94872 for review

John-Mark Gurney jmg at FreeBSD.org
Sun Apr 9 21:29:41 UTC 2006


http://perforce.freebsd.org/chv.cgi?CH=94872

Change 94872 by jmg at jmg_arlene on 2006/04/09 21:29:18

	use the ivar to properly set devhandle..

Affected files ...

.. //depot/projects/kmacy_sun4v/src/sys/sun4v/sun4v/hv_pci.c#32 edit

Differences ...

==== //depot/projects/kmacy_sun4v/src/sys/sun4v/sun4v/hv_pci.c#32 (text+ko) ====

@@ -55,10 +55,10 @@
 #include <machine/hviommu.h>
 #include <machine/vmparam.h>
 #include <machine/tlb.h>
+#include <machine/nexusvar.h>
 
 #include "pcib_if.h"
 
-#define	SUN4V_REG_SPEC2CFG_HDL(x)	((x >> 32) & ~(0xfull << 28))
 /*
  * XXX - should get this through the bus, but Sun overloaded the reg OFW
  * property, so there isn't normal resources associated w/ this device.
@@ -146,10 +146,6 @@
 	struct hviommu *himp;
 	bus_space_tag_t *btp;
 	phandle_t node;
-#if 0
-	uint32_t cell;
-#endif
-	uint64_t reg, nreg;
 	uint32_t *dvma;
 	int br[2];
 	int n, type;
@@ -170,14 +166,7 @@
 	sc->hs_busnum = br[0];
 
 	/* Setup the HyperVisor devhandle for this bus */
-#if 0
-	if (OF_getprop(node, "reg", &cell, sizeof cell) == -1)
-		panic("%s: OF_getprop failed.", __func__);
-	sc->hs_devhandle = cell & 0xfffffff;
-#else 
-	bus_get_resource(dev, SYS_RES_MEMORY, 0, &reg, &nreg);
-	sc->hs_devhandle = SUN4V_REG_SPEC2CFG_HDL(reg);
-#endif
+	sc->hs_devhandle = nexus_get_devhandle(dev);
 
 	/* initalize intr resources */
 	sc->hs_pci_intr_rman.rm_type = RMAN_ARRAY;


More information about the p4-projects mailing list