From nobody Tue Feb 10 21:59:56 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; 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 1539912258659568.8779520428034; Thu, 18 Oct 2018 18:24:18 -0700 (PDT) Received: from localhost ([::1]:45974 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gDJWP-0003FR-0q for importer@patchew.org; Thu, 18 Oct 2018 21:24:13 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58938) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gDJFc-0004eg-76 for qemu-devel@nongnu.org; Thu, 18 Oct 2018 21:06:53 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gDJFZ-000369-U0 for qemu-devel@nongnu.org; Thu, 18 Oct 2018 21:06:51 -0400 Received: from out5-smtp.messagingengine.com ([66.111.4.29]:50609) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gDJFZ-0002nF-29 for qemu-devel@nongnu.org; Thu, 18 Oct 2018 21:06:49 -0400 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 5334B22969; Thu, 18 Oct 2018 21:06:31 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Thu, 18 Oct 2018 21:06:31 -0400 Received: from localhost (flamenco.cs.columbia.edu [128.59.20.216]) by mail.messagingengine.com (Postfix) with ESMTPA id 09F27102DE; Thu, 18 Oct 2018 21:06:31 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=braap.org; h= from:to:cc:subject:date:message-id:in-reply-to:references; s= mesmtp; bh=Guw/J2UTlk6Afu6U2HIBRljn1dEDjlX+VWpk5oNx6Jo=; b=eRUrV +SxbVi33ysIt9aQGXUWP9E8i5Fnrq8a7eCDr9Tp7WyjmpdUHqQnwwU30+1Gws2DS Bl7s5yMaTF66cadwF56gY6bH1LpQY1mQ5mlHVnnMIsNYbJaj2f3Id94GIzsySXmu jNOgZiS/QINRWEuZYnAJo3T5rnNQ8FDRW2Ll8Q= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:date:from:in-reply-to:message-id :references:subject:to:x-me-proxy:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm1; bh=Guw/J2UTlk6Afu6U2HIBRljn1dEDj lX+VWpk5oNx6Jo=; b=PD0y0CA7aAD+lyktPvJjMXE5zxlfyYoPypNP1HXYjmOdu wj6evLmMo3pGoMPudxXTfwrPdWYoRvGjPnI/ZtIpE0Z4SLsOjK3ugvZmGeQNPDNp lK5Hnq1nW0IA9C2cVytcbWP+VSC3+WlLxPGnqe5lZndk+tSQrO4IRpSXTffZcePZ /k6g4Y5lntkweo175tsgjDWCtowwtfv75K71lE/OMUPdCs/T6AInoZVONYC+NAbX j6ZwwjFvTmCcOuDkRDoPaKTJFHJcsD94XpTn143X6MBQT/DN+Om/EBS/zdtfG6MV uCeoudUpGPYuEj1qFirjWfMlhlusE539Fvp+hRxTw== X-ME-Sender: X-ME-Proxy: From: "Emilio G. Cota" To: qemu-devel@nongnu.org Date: Thu, 18 Oct 2018 21:05:52 -0400 Message-Id: <20181019010625.25294-24-cota@braap.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181019010625.25294-1-cota@braap.org> References: <20181019010625.25294-1-cota@braap.org> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 66.111.4.29 Subject: [Qemu-devel] [RFC v3 23/56] cpu: define cpu_interrupt_request helpers 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: Paolo Bonzini Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Signed-off-by: Emilio G. Cota --- include/qom/cpu.h | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/include/qom/cpu.h b/include/qom/cpu.h index 3bf6767cb0..cd66b8828a 100644 --- a/include/qom/cpu.h +++ b/include/qom/cpu.h @@ -504,6 +504,41 @@ static inline void cpu_halted_set(CPUState *cpu, uint3= 2_t val) cpu_mutex_unlock(cpu); } =20 +static inline uint32_t cpu_interrupt_request(CPUState *cpu) +{ + uint32_t ret; + + if (cpu_mutex_locked(cpu)) { + return cpu->interrupt_request; + } + cpu_mutex_lock(cpu); + ret =3D cpu->interrupt_request; + cpu_mutex_unlock(cpu); + return ret; +} + +static inline void cpu_interrupt_request_or(CPUState *cpu, uint32_t mask) +{ + if (cpu_mutex_locked(cpu)) { + cpu->interrupt_request |=3D mask; + return; + } + cpu_mutex_lock(cpu); + cpu->interrupt_request |=3D mask; + cpu_mutex_unlock(cpu); +} + +static inline void cpu_interrupt_request_set(CPUState *cpu, uint32_t val) +{ + if (cpu_mutex_locked(cpu)) { + cpu->interrupt_request =3D val; + return; + } + cpu_mutex_lock(cpu); + cpu->interrupt_request =3D val; + cpu_mutex_unlock(cpu); +} + static inline void cpu_tb_jmp_cache_clear(CPUState *cpu) { unsigned int i; --=20 2.17.1