From nobody Mon Feb 9 07:57:27 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1529931190188321.0840388670314; Mon, 25 Jun 2018 05:53:10 -0700 (PDT) Received: from localhost ([::1]:46658 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fXQzV-0000EV-Fr for importer@patchew.org; Mon, 25 Jun 2018 08:53:09 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54400) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fXQqp-0001nt-CT for qemu-devel@nongnu.org; Mon, 25 Jun 2018 08:44:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fXQqo-0007wj-50 for qemu-devel@nongnu.org; Mon, 25 Jun 2018 08:44:11 -0400 Received: from mail-qk0-x235.google.com ([2607:f8b0:400d:c09::235]:45218) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fXQqo-0007wY-0e; Mon, 25 Jun 2018 08:44:10 -0400 Received: by mail-qk0-x235.google.com with SMTP id c198-v6so7349440qkg.12; Mon, 25 Jun 2018 05:44:09 -0700 (PDT) Received: from x1.local ([138.117.48.222]) by smtp.gmail.com with ESMTPSA id m15-v6sm12549562qtm.84.2018.06.25.05.44.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 25 Jun 2018 05:44:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=J3ru3PJeV88R2BDv/Grb7IZ4WRCbtW2k8onhNGPjswY=; b=fiSV0yG4J4BxZcuioxayQznbP7VlY+Nn/pLiExc9KXJf1cvJTYHrQ6xX2GixEIq3Y/ ry5H9HFpbJL1seovmlixUw5txmbnYT6Z+9bAmiMIESTWhcYU2ppth27ayynNa1TBU32c wbdI8BJk8ML5xOXy9rxIVIBO9wKaxNw19+qcUvQH3iS7ZOl774htiexAAXLrWAf8ZlW6 I28O7FjavNw8ytKS4qWhO2y5g16Z+0ZjkP51F5L3TRHmL9wx+3Ju8SqnajebVURQUKen UyBybFD2S/nIPHkWjnlsj9StlYunkHXu/GByiyNfe0BqIWmqOlfJn8RdnSyIXXe9FXmN TbJg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references:mime-version:content-transfer-encoding; bh=J3ru3PJeV88R2BDv/Grb7IZ4WRCbtW2k8onhNGPjswY=; b=Oj+NCWOQv+IDqPTZs2nDz+gz+yAeipUlqCwP9WKc0wsfTRyvoiyISZ96E93lQ9Z78e fS2HO/Htk/PkpSdxvfE2BthKRSyrCOtcQczyYcI2kS181zrOGwVjfUySMEe6w0SExcpl 3wnCMnvljY15dOr+u7DN7es/g2MEaDHhKnrW01UIzqVi4B/pRfiIAXQAV3wjLSnmC7ih C4Bjdu9tjXqxcVJOZ2SsjIoM5oT+SlhOzpu8LNHY15NU/9b6frwi2mBVqN37ULea/17j V2DbD5vVgE24DU41mbstFRPIbwPaNLNKKk31XQCZz8Je9XsiDSVsomdHUSXP9DJ8u16r 5bsA== X-Gm-Message-State: APt69E3Se9R50EXhv24L5tauvfcdtOxBQCxPY/ssovGGfzhITCByDi0q HggWQVzwloe6BAwxPdb3DEI= X-Google-Smtp-Source: AAOMgpf0wV6UaZTa7GLR0B2p92tZTL/5alc9pNR4S3Gk4+mWWGxq6Dc8wf+qLSm3K0VVzqdvuPoq1Q== X-Received: by 2002:a37:19e3:: with SMTP id 96-v6mr10462327qkz.242.1529930649420; Mon, 25 Jun 2018 05:44:09 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Thomas Huth , Stefan Weil Date: Mon, 25 Jun 2018 09:42:13 -0300 Message-Id: <20180625124238.25339-22-f4bug@amsat.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180625124238.25339-1-f4bug@amsat.org> References: <20180625124238.25339-1-f4bug@amsat.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400d:c09::235 Subject: [Qemu-devel] [PATCH v5 21/46] hw/xtensa: Use the IEC binary prefix definitions X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-trivial@nongnu.org, Max Filippov , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) X-ZohoMail: RDKM_2 RSF_0 Z_629925259 SPT_0 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 '[<>][<>]=3D ?[1-5]0' and modified manually. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Acked-by: Max Filippov --- hw/xtensa/xtfpga.c | 9 +++++---- target/xtensa/helper.c | 5 +++-- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/hw/xtensa/xtfpga.c b/hw/xtensa/xtfpga.c index 5dc13034f9..b3161de320 100644 --- a/hw/xtensa/xtfpga.c +++ b/hw/xtensa/xtfpga.c @@ -26,6 +26,7 @@ */ =20 #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)); =20 ram =3D 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, M= achineState *machine) const char *kernel_cmdline =3D qemu_opt_get(machine_opts, "append"); const char *dtb_filename =3D qemu_opt_get(machine_opts, "dtb"); const char *initrd_filename =3D qemu_opt_get(machine_opts, "initrd"); - const unsigned system_io_size =3D 224 * 1024 * 1024; + const unsigned system_io_size =3D 224 * MiB; int n; =20 for (n =3D 0; n < smp_cpus; n++) { @@ -342,7 +343,7 @@ static void xtfpga_init(const XtfpgaBoardDesc *board, M= achineState *machine) cpu_physical_memory_write(cur_lowmem, fdt, fdt_size); cur_tagptr =3D put_tag(cur_tagptr, BP_TAG_FDT, sizeof(dtb_addr), &dtb_addr); - cur_lowmem =3D QEMU_ALIGN_UP(cur_lowmem + fdt_size, 4096); + cur_lowmem =3D QEMU_ALIGN_UP(cur_lowmem + fdt_size, 4 * KiB); } #else if (dtb_filename) { @@ -370,7 +371,7 @@ static void xtfpga_init(const XtfpgaBoardDesc *board, M= achineState *machine) initrd_location.end =3D tswap32(cur_lowmem + initrd_size); cur_tagptr =3D put_tag(cur_tagptr, BP_TAG_INITRD, sizeof(initrd_location), &initrd_location= ); - cur_lowmem =3D QEMU_ALIGN_UP(cur_lowmem + initrd_size, 4096); + cur_lowmem =3D QEMU_ALIGN_UP(cur_lowmem + initrd_size, 4 * KiB= ); } cur_tagptr =3D put_tag(cur_tagptr, BP_TAG_LAST, 0, NULL); env->regs[2] =3D tagptr; diff --git a/target/xtensa/helper.c b/target/xtensa/helper.c index 34844eead3..c9a6132700 100644 --- a/target/xtensa/helper.c +++ b/target/xtensa/helper.c @@ -26,6 +26,7 @@ */ =20 #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_fp= rintf, bool print_header =3D true; =20 if (sz >=3D 0x100000) { - sz >>=3D 20; + sz /=3D MiB; sz_text =3D "MB"; } else { - sz >>=3D 10; + sz /=3D KiB; sz_text =3D "KB"; } =20 --=20 2.18.0