Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 8 Sep 2020 23:22:11 +0000 (UTC)
From:      Brandon Bergren <bdragon@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r365483 - head/stand/libofw
Message-ID:  <202009082322.088NMBPr064059@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: bdragon
Date: Tue Sep  8 23:22:11 2020
New Revision: 365483
URL: https://svnweb.freebsd.org/changeset/base/365483

Log:
  Fix 64-bit build of libofw.
  
  Adjust a couple of printf() lines that deal with dumping out addresses
  to cast to uintmax_t.
  
  This allows building a 64-bit libofw for use in things like a future
  Petitboot loader for PowerPC64, and other FDT platforms that require
  a 64-bit loader binary and want to use forth.
  
  Sponsored by:	Tag1 Consulting, Inc.

Modified:
  head/stand/libofw/ofw_memory.c

Modified: head/stand/libofw/ofw_memory.c
==============================================================================
--- head/stand/libofw/ofw_memory.c	Tue Sep  8 23:19:59 2020	(r365482)
+++ head/stand/libofw/ofw_memory.c	Tue Sep  8 23:22:11 2020	(r365483)
@@ -80,11 +80,11 @@ ofw_memmap(int acells)
 		    "Physical Range", "#Pages", "Mode");
 
 		for (i = 0; i < nmapping; i++) {
-			sprintf(lbuf, "%08x-%08x\t%08x-%08x\t%8d\t%6x\n",
-				mapptr[i].va,
-				mapptr[i].va + mapptr[i].len,
-				mapptr[i].pa,
-				mapptr[i].pa + mapptr[i].len,
+			sprintf(lbuf, "%08jx-%08jx\t%08jx-%08jx\t%8d\t%6x\n",
+				(uintmax_t)mapptr[i].va,
+				(uintmax_t)mapptr[i].va + mapptr[i].len,
+				(uintmax_t)mapptr[i].pa,
+				(uintmax_t)mapptr[i].pa + mapptr[i].len,
 				mapptr[i].len / 0x1000,
 				mapptr[i].mode);
 			if (pager_output(lbuf))
@@ -98,11 +98,11 @@ ofw_memmap(int acells)
 		       "Physical Range", "#Pages", "Mode");
 
 		for (i = 0; i < nmapping; i++) {
-			sprintf(lbuf, "%08x-%08x\t%08x-%08x\t%8d\t%6x\n",
-				mapptr2[i].va,
-				mapptr2[i].va + mapptr2[i].len,
-				mapptr2[i].pa_lo,
-				mapptr2[i].pa_lo + mapptr2[i].len,
+			sprintf(lbuf, "%08jx-%08jx\t%08jx-%08jx\t%8d\t%6x\n",
+				(uintmax_t)mapptr2[i].va,
+				(uintmax_t)mapptr2[i].va + mapptr2[i].len,
+				(uintmax_t)mapptr2[i].pa_lo,
+				(uintmax_t)mapptr2[i].pa_lo + mapptr2[i].len,
 				mapptr2[i].len / 0x1000,
 				mapptr2[i].mode);
 			if (pager_output(lbuf))



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