From nobody Mon Feb 9 10:28:48 2026 Delivered-To: importer@patchew.org Received-SPF: none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1582204064; cv=none; d=zohomail.com; s=zohoarc; b=Zecr5ny2iMCQJoK4iUCsNf6EIqf1ofrIK4Uwn1bhqRxMWdeIB2TaMK3uMu1J7Kf3ZBXInQKOYEYWnqGC+QlnFlyDJj3uYZzOR05meaNWfB9yIT8/8ntsT+K8eqFswyfFkHBcUqqp4u0ZQhjQLCDmFlkfP27JpfFeGEdgF/5zjEY= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1582204064; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=suFsuZ+jkt5JbjBnWTqfbezj5k+rautFXUO5tkUW+ic=; b=Ccm3Cm+o/i+5UcekgjnWULddxzHPf+rBQa2Pcb4OqrR/p0ZpYL37IYBFxIHbcEf1pa2Q4JsnrjmYkmZ6J79Uw32PRzbQJwJ5AA+adgvdvsSp1KBrqdvSSzum4vLQ9ZGFVd7k7R73yT6Zzm6rH8jqVX3AylMSpnpBiqLDBNgO5Ks= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=none (zohomail.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1582204064319343.9157564836373; Thu, 20 Feb 2020 05:07:44 -0800 (PST) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1j4lXx-000201-Pc; Thu, 20 Feb 2020 13:07:17 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1j4lXw-0001yq-63 for xen-devel@lists.xenproject.org; Thu, 20 Feb 2020 13:07:16 +0000 Received: from us-smtp-1.mimecast.com (unknown [205.139.110.61]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTP id e423bf78-53e1-11ea-8526-12813bfff9fa; Thu, 20 Feb 2020 13:07:05 +0000 (UTC) Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-368-3gVD0Ri_Pwq1CUcNrF41AQ-1; Thu, 20 Feb 2020 08:07:03 -0500 Received: by mail-wm1-f70.google.com with SMTP id t17so798525wmi.7 for ; Thu, 20 Feb 2020 05:07:02 -0800 (PST) Received: from localhost.localdomain (78.red-88-21-202.staticip.rima-tde.net. [88.21.202.78]) by smtp.gmail.com with ESMTPSA id b67sm4594690wmc.38.2020.02.20.05.06.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Feb 2020 05:07:01 -0800 (PST) X-Inumbo-ID: e423bf78-53e1-11ea-8526-12813bfff9fa DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1582204024; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=MwD83MRmvk9U4szTuvQnf8dMN/lBsu/ps/CgrjG/jog=; b=AuITvZ+Nps5lmurVgIAuEObN9X8ceztUdaRkZpru/lLXOBxm1f9lGBGEHWQVJid4YwYt6f Op+Gw4w8tMqRFEI5kik/IQFOO5NdP0WZ1MvYP5WtTL4M/HreQd3vPkuoZumUZOFXss083r eVxbF5mMKvt4hVaL4ejwM3mG/z+v1V0= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=3GOpiWMITxx9TtgKrEdUBt5MYBhcyKxmOeh0GtNqL3Q=; b=FKoE2FsIvp80yLNMmPbmDB0Rk9ruNhTZGR7ztbAaZZIyybTW28z1QgY1qljk1bs+eA CIJ8OMzL99GmpxqZCgXNLlS/STz69FFplLYwb7xp6M5yFKHHfSbq6nkpeiCcIXttdrK3 Er1RxtQ1tWucyEjTXRRKorwwjJyWb7dquseJE+5ST/2zjuVhxRuCElCcRWj8+5bSa5+r zRfANjaYw04ZcU6qx8lNnV5uSo/djiDkT9mg8llphW9VAKsWCo/0JYyZCOASXqSm6rhh +6B1SV8Lj/YWDRZLuB0FQwx47oIkwUt1tRRMCDgpCZxenW4xWpTHAm/PWa704jmReuzI bBkA== X-Gm-Message-State: APjAAAXwCjF2vHxGxjKYYlrKI4C1m+9Shab9JQUT/jBj/hCpHKu2Tq1M 7J8RbJvoh5yCaNyZIYWf7hOiqXHK5I43RlIqTuk6RTQMdaFVdXVKzl2mGMbqZS4+5f9Q0ttuMjf Nc9RZrJpRxS8zj1lSgb2Fp6jGNEQ= X-Received: by 2002:a1c:a78b:: with SMTP id q133mr4438680wme.28.1582204021859; Thu, 20 Feb 2020 05:07:01 -0800 (PST) X-Google-Smtp-Source: APXvYqy5fs9il9OncKFrjhrarKjFKFUysaRlKljcdDwQycfDDjjbJaA7nUH+Kd8+rszknwLmOaxWsA== X-Received: by 2002:a1c:a78b:: with SMTP id q133mr4438660wme.28.1582204021604; Thu, 20 Feb 2020 05:07:01 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: Peter Maydell , qemu-devel@nongnu.org Date: Thu, 20 Feb 2020 14:05:46 +0100 Message-Id: <20200220130548.29974-19-philmd@redhat.com> X-Mailer: git-send-email 2.21.1 In-Reply-To: <20200220130548.29974-1-philmd@redhat.com> References: <20200220130548.29974-1-philmd@redhat.com> MIME-Version: 1.0 X-MC-Unique: 3gVD0Ri_Pwq1CUcNrF41AQ-1 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Subject: [Xen-devel] [PATCH v3 18/20] exec: Let cpu_[physical]_memory API use a boolean 'is_write' argument X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Fam Zheng , Dmitry Fleytman , kvm@vger.kernel.org, "Michael S. Tsirkin" , Jason Wang , Gerd Hoffmann , "Edgar E. Iglesias" , Stefano Stabellini , Matthew Rosato , qemu-block@nongnu.org, David Hildenbrand , Halil Pasic , Christian Borntraeger , =?UTF-8?q?Herv=C3=A9=20Poussineau?= , Marcel Apfelbaum , Anthony Perard , xen-devel@lists.xenproject.org, Aleksandar Rikalo , Richard Henderson , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Laurent Vivier , Thomas Huth , Eduardo Habkost , Stefan Weil , Alistair Francis , Richard Henderson , Paul Durrant , Eric Auger , qemu-s390x@nongnu.org, qemu-arm@nongnu.org, =?UTF-8?q?C=C3=A9dric=20Le=20Goater?= , John Snow , David Gibson , Igor Mitsyanko , Cornelia Huck , Michael Walle , qemu-ppc@nongnu.org, Paolo Bonzini Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) The 'is_write' argument is either 0 or 1. Convert it to a boolean type. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- include/exec/cpu-all.h | 2 +- include/exec/cpu-common.h | 6 +++--- exec.c | 10 +++++----- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/include/exec/cpu-all.h b/include/exec/cpu-all.h index 49e96caa3f..49384bb66a 100644 --- a/include/exec/cpu-all.h +++ b/include/exec/cpu-all.h @@ -388,7 +388,7 @@ void dump_opcount_info(void); #endif /* !CONFIG_USER_ONLY */ =20 int cpu_memory_rw_debug(CPUState *cpu, target_ulong addr, - void *ptr, target_ulong len, int is_write); + void *ptr, target_ulong len, bool is_write); =20 int cpu_exec(CPUState *cpu); =20 diff --git a/include/exec/cpu-common.h b/include/exec/cpu-common.h index 165f8fb621..6bfe201779 100644 --- a/include/exec/cpu-common.h +++ b/include/exec/cpu-common.h @@ -70,7 +70,7 @@ size_t qemu_ram_pagesize(RAMBlock *block); size_t qemu_ram_pagesize_largest(void); =20 void cpu_physical_memory_rw(hwaddr addr, void *buf, - hwaddr len, int is_write); + hwaddr len, bool is_write); static inline void cpu_physical_memory_read(hwaddr addr, void *buf, hwaddr len) { @@ -83,9 +83,9 @@ static inline void cpu_physical_memory_write(hwaddr addr, } void *cpu_physical_memory_map(hwaddr addr, hwaddr *plen, - int is_write); + bool is_write); void cpu_physical_memory_unmap(void *buffer, hwaddr len, - int is_write, hwaddr access_len); + bool is_write, hwaddr access_len); void cpu_register_map_client(QEMUBH *bh); void cpu_unregister_map_client(QEMUBH *bh); =20 diff --git a/exec.c b/exec.c index b79919a4f7..6c39b43155 100644 --- a/exec.c +++ b/exec.c @@ -3019,7 +3019,7 @@ MemoryRegion *get_system_io(void) /* physical memory access (slow version, mainly for debug) */ #if defined(CONFIG_USER_ONLY) int cpu_memory_rw_debug(CPUState *cpu, target_ulong addr, - void *ptr, target_ulong len, int is_write) + void *ptr, target_ulong len, bool is_write) { int flags; target_ulong l, page; @@ -3313,7 +3313,7 @@ MemTxResult address_space_rw(AddressSpace *as, hwaddr= addr, MemTxAttrs attrs, } =20 void cpu_physical_memory_rw(hwaddr addr, void *buf, - hwaddr len, int is_write) + hwaddr len, bool is_write) { address_space_rw(&address_space_memory, addr, MEMTXATTRS_UNSPECIFIED, buf, len, is_write); @@ -3632,14 +3632,14 @@ void address_space_unmap(AddressSpace *as, void *bu= ffer, hwaddr len, =20 void *cpu_physical_memory_map(hwaddr addr, hwaddr *plen, - int is_write) + bool is_write) { return address_space_map(&address_space_memory, addr, plen, is_write, MEMTXATTRS_UNSPECIFIED); } =20 void cpu_physical_memory_unmap(void *buffer, hwaddr len, - int is_write, hwaddr access_len) + bool is_write, hwaddr access_len) { return address_space_unmap(&address_space_memory, buffer, len, is_writ= e, access_len); } @@ -3790,7 +3790,7 @@ address_space_write_cached_slow(MemoryRegionCache *ca= che, hwaddr addr, =20 /* virtual memory access for debug (includes writing to ROM) */ int cpu_memory_rw_debug(CPUState *cpu, target_ulong addr, - void *ptr, target_ulong len, int is_write) + void *ptr, target_ulong len, bool is_write) { hwaddr phys_addr; target_ulong l, page; --=20 2.21.1 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel