ppc405: use RAM_ADDR_FMT instead of %08lx
PATCH 1/1 ppc405: use RAM_ADDR_FMT instead of %08lx
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 <[email protected]>
--- hw/ppc405_boards.c | 11 ++++++----- 1 files changed, 6 insertions(+), 5 deletions(-)
hw/ppc405_boards.c +6 -5
@@ -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
Signature · 1 line
1.7.5.4
Alexander Graf
AppliedQuoted 4 lines · Stefan Hajnoczi
The
RAM_ADDR_FMTmacro hides the type ofram_addr_tso that format strings can be safely used. Make sure to useRAM_ADDR_FMTso 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