Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 23 Oct 2013 14:06:41 +0000 (UTC)
From:      Nathan Whitehorn <nwhitehorn@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r256969 - head/sys/powerpc/powerpc
Message-ID:  <201310231406.r9NE6fEA099618@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: nwhitehorn
Date: Wed Oct 23 14:06:41 2013
New Revision: 256969
URL: http://svnweb.freebsd.org/changeset/base/256969

Log:
  Use OF_getencprop() in preference to OF_getprop() for numerical quantities.
  Since all supported PowerPC systems are big-endian, this is a no-op, but
  this is preparatory work to moving this to /sys/dev/ofw.

Modified:
  head/sys/powerpc/powerpc/nexus.c

Modified: head/sys/powerpc/powerpc/nexus.c
==============================================================================
--- head/sys/powerpc/powerpc/nexus.c	Wed Oct 23 14:06:07 2013	(r256968)
+++ head/sys/powerpc/powerpc/nexus.c	Wed Oct 23 14:06:41 2013	(r256969)
@@ -248,9 +248,9 @@ nexus_attach(device_t dev)
 	 * Some important numbers
 	 */
 	sc->acells = 2;
-	OF_getprop(node, "#address-cells", &sc->acells, sizeof(sc->acells));
+	OF_getencprop(node, "#address-cells", &sc->acells, sizeof(sc->acells));
 	sc->scells = 1;
-	OF_getprop(node, "#size-cells", &sc->scells, sizeof(sc->scells));
+	OF_getencprop(node, "#size-cells", &sc->scells, sizeof(sc->scells));
 
 	/*
 	 * Now walk the OFW tree and attach top-level devices.
@@ -564,7 +564,7 @@ nexus_setup_dinfo(device_t dev, phandle_
 	}
 
 	resource_list_init(&ndi->ndi_rl);
-	nreg = OF_getprop_alloc(node, "reg", sizeof(*reg), (void **)&reg);
+	nreg = OF_getencprop_alloc(node, "reg", sizeof(*reg), (void **)&reg);
 	if (nreg == -1)
 		nreg = 0;
 	if (nreg % (sc->acells + sc->scells) != 0) {
@@ -591,7 +591,7 @@ nexus_setup_dinfo(device_t dev, phandle_
 	}
 	free(reg, M_OFWPROP);
 
-	nintr = OF_getprop_alloc(node, "interrupts",  sizeof(*intr),
+	nintr = OF_getencprop_alloc(node, "interrupts",  sizeof(*intr),
 	    (void **)&intr);
 	if (nintr > 0) {
 		iparent = 0;



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