qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] ppc405: use RAM_ADDR_FMT instead of %08lx
@ 2011-09-05 13:02 Stefan Hajnoczi
  2011-09-07 11:34 ` Alexander Graf
  0 siblings, 1 reply; 2+ messages in thread
From: Stefan Hajnoczi @ 2011-09-05 13:02 UTC (permalink / raw)
  To: qemu-devel; +Cc: Alexander Graf, Sheldon, Stefan Hajnoczi

The RAM_ADDR_FMT macro hides the type of ram_addr_t so that format
strings can be safely used.  Make sure to use RAM_ADDR_FMT so that the
build works on 32-bit hosts with Xen enabled.  Whether Xen should affect
ppc TCG targets is questionable but a separate issue.

Signed-off-by: Stefan Hajnoczi <stefanha@linux.vnet.ibm.com>
---
 hw/ppc405_boards.c |   11 ++++++-----
 1 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/hw/ppc405_boards.c b/hw/ppc405_boards.c
index dec165e4..5da26dc 100644
--- a/hw/ppc405_boards.c
+++ b/hw/ppc405_boards.c
@@ -211,7 +211,8 @@ static void ref405ep_init (ram_addr_t ram_size,
     sram_size = 512 * 1024;
     sram_offset = qemu_ram_alloc(NULL, "ef405ep.sram", sram_size);
 #ifdef DEBUG_BOARD_INIT
-    printf("%s: register SRAM at offset %08lx\n", __func__, sram_offset);
+    printf("%s: register SRAM at offset " RAM_ADDR_FMT "\n",
+           __func__, sram_offset);
 #endif
     cpu_register_physical_memory(0xFFF00000, sram_size,
                                  sram_offset | IO_MEM_RAM);
@@ -228,7 +229,7 @@ static void ref405ep_init (ram_addr_t ram_size,
         fl_sectors = (bios_size + 65535) >> 16;
 #ifdef DEBUG_BOARD_INIT
         printf("Register parallel flash %d size %lx"
-               " at offset %08lx addr %lx '%s' %d\n",
+               " at offset " RAM_ADDR_FMT " addr %lx '%s' %d\n",
                fl_idx, bios_size, bios_offset, -bios_size,
                bdrv_get_device_name(dinfo->bdrv), fl_sectors);
 #endif
@@ -353,7 +354,7 @@ static void ref405ep_init (ram_addr_t ram_size,
 #ifdef DEBUG_BOARD_INIT
     printf("%s: Done\n", __func__);
 #endif
-    printf("bdloc %016lx\n", (unsigned long)bdloc);
+    printf("bdloc " RAM_ADDR_FMT "\n", bdloc);
 }
 
 static QEMUMachine ref405ep_machine = {
@@ -547,7 +548,7 @@ static void taihu_405ep_init(ram_addr_t ram_size,
         bios_offset = qemu_ram_alloc(NULL, "taihu_405ep.bios", bios_size);
 #ifdef DEBUG_BOARD_INIT
         printf("Register parallel flash %d size %lx"
-               " at offset %08lx addr %lx '%s' %d\n",
+               " at offset " RAM_ADDR_FMT " addr %lx '%s' %d\n",
                fl_idx, bios_size, bios_offset, -bios_size,
                bdrv_get_device_name(dinfo->bdrv), fl_sectors);
 #endif
@@ -590,7 +591,7 @@ static void taihu_405ep_init(ram_addr_t ram_size,
         fl_sectors = (bios_size + 65535) >> 16;
 #ifdef DEBUG_BOARD_INIT
         printf("Register parallel flash %d size %lx"
-               " at offset %08lx  addr " TARGET_FMT_lx " '%s'\n",
+               " at offset " RAM_ADDR_FMT "  addr " TARGET_FMT_lx " '%s'\n",
                fl_idx, bios_size, bios_offset, (target_ulong)0xfc000000,
                bdrv_get_device_name(dinfo->bdrv));
 #endif
-- 
1.7.5.4

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Qemu-devel] [PATCH] ppc405: use RAM_ADDR_FMT instead of %08lx
  2011-09-05 13:02 [Qemu-devel] [PATCH] ppc405: use RAM_ADDR_FMT instead of %08lx Stefan Hajnoczi
@ 2011-09-07 11:34 ` Alexander Graf
  0 siblings, 0 replies; 2+ messages in thread
From: Alexander Graf @ 2011-09-07 11:34 UTC (permalink / raw)
  To: Stefan Hajnoczi; +Cc: qemu-ppc, QEMU Developers, Sheldon


On 05.09.2011, at 15:02, Stefan Hajnoczi wrote:

> The RAM_ADDR_FMT macro hides the type of ram_addr_t so that format
> strings can be safely used.  Make sure to use RAM_ADDR_FMT so that the
> build works on 32-bit hosts with Xen enabled.  Whether Xen should affect
> ppc TCG targets is questionable but a separate issue.

Thanks, applied.

Alex

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-09-07 11:38 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-09-05 13:02 [Qemu-devel] [PATCH] ppc405: use RAM_ADDR_FMT instead of %08lx Stefan Hajnoczi
2011-09-07 11:34 ` Alexander Graf

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).