hw/xtensa: Use the IEC binary prefix definitions
It eases code review, unit is explicit. Patch generated using: $ git grep -E '(1024|2048|4096|8192|(<<|>>).?(10|20|30))' hw/ include/hw/ $ git grep -n '[<>][<>]= ?[1-5]0' and modified manually. Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org> Acked-by: Max Filippov <jcmvbkbc@gmail.com> Message-Id: <20180625124238.25339-22-f4bug@amsat.org> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
c108cc59dc
commit
b941329dc4
@ -26,6 +26,7 @@
|
||||
*/
|
||||
|
||||
#include "qemu/osdep.h"
|
||||
#include "qemu/units.h"
|
||||
#include "qapi/error.h"
|
||||
#include "cpu.h"
|
||||
#include "sysemu/sysemu.h"
|
||||
@ -152,7 +153,7 @@ static void xtfpga_net_init(MemoryRegion *address_space,
|
||||
sysbus_mmio_get_region(s, 1));
|
||||
|
||||
ram = g_malloc(sizeof(*ram));
|
||||
memory_region_init_ram_nomigrate(ram, OBJECT(s), "open_eth.ram", 16384,
|
||||
memory_region_init_ram_nomigrate(ram, OBJECT(s), "open_eth.ram", 16 * KiB,
|
||||
&error_fatal);
|
||||
vmstate_register_ram_global(ram);
|
||||
memory_region_add_subregion(address_space, buffers, ram);
|
||||
@ -229,7 +230,7 @@ static void xtfpga_init(const XtfpgaBoardDesc *board, MachineState *machine)
|
||||
const char *kernel_cmdline = qemu_opt_get(machine_opts, "append");
|
||||
const char *dtb_filename = qemu_opt_get(machine_opts, "dtb");
|
||||
const char *initrd_filename = qemu_opt_get(machine_opts, "initrd");
|
||||
const unsigned system_io_size = 224 * 1024 * 1024;
|
||||
const unsigned system_io_size = 224 * MiB;
|
||||
int n;
|
||||
|
||||
for (n = 0; n < smp_cpus; n++) {
|
||||
@ -342,7 +343,7 @@ static void xtfpga_init(const XtfpgaBoardDesc *board, MachineState *machine)
|
||||
cpu_physical_memory_write(cur_lowmem, fdt, fdt_size);
|
||||
cur_tagptr = put_tag(cur_tagptr, BP_TAG_FDT,
|
||||
sizeof(dtb_addr), &dtb_addr);
|
||||
cur_lowmem = QEMU_ALIGN_UP(cur_lowmem + fdt_size, 4096);
|
||||
cur_lowmem = QEMU_ALIGN_UP(cur_lowmem + fdt_size, 4 * KiB);
|
||||
}
|
||||
#else
|
||||
if (dtb_filename) {
|
||||
@ -370,7 +371,7 @@ static void xtfpga_init(const XtfpgaBoardDesc *board, MachineState *machine)
|
||||
initrd_location.end = tswap32(cur_lowmem + initrd_size);
|
||||
cur_tagptr = put_tag(cur_tagptr, BP_TAG_INITRD,
|
||||
sizeof(initrd_location), &initrd_location);
|
||||
cur_lowmem = QEMU_ALIGN_UP(cur_lowmem + initrd_size, 4096);
|
||||
cur_lowmem = QEMU_ALIGN_UP(cur_lowmem + initrd_size, 4 * KiB);
|
||||
}
|
||||
cur_tagptr = put_tag(cur_tagptr, BP_TAG_LAST, 0, NULL);
|
||||
env->regs[2] = tagptr;
|
||||
|
@ -26,6 +26,7 @@
|
||||
*/
|
||||
|
||||
#include "qemu/osdep.h"
|
||||
#include "qemu/units.h"
|
||||
#include "cpu.h"
|
||||
#include "exec/exec-all.h"
|
||||
#include "exec/gdbstub.h"
|
||||
@ -726,10 +727,10 @@ static void dump_tlb(FILE *f, fprintf_function cpu_fprintf,
|
||||
bool print_header = true;
|
||||
|
||||
if (sz >= 0x100000) {
|
||||
sz >>= 20;
|
||||
sz /= MiB;
|
||||
sz_text = "MB";
|
||||
} else {
|
||||
sz >>= 10;
|
||||
sz /= KiB;
|
||||
sz_text = "KB";
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user