Message ID | 20190304181813.8075-16-cota@braap.org (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org> Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A08C6180E for <patchwork-qemu-devel@patchwork.kernel.org>; Mon, 4 Mar 2019 18:39:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8FD3F297EC for <patchwork-qemu-devel@patchwork.kernel.org>; Mon, 4 Mar 2019 18:39:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 839FE2A05B; Mon, 4 Mar 2019 18:39:02 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 297A429862 for <patchwork-qemu-devel@patchwork.kernel.org>; Mon, 4 Mar 2019 18:39:02 +0000 (UTC) Received: from localhost ([127.0.0.1]:58863 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from <qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org>) id 1h0sUP-000870-FF for patchwork-qemu-devel@patchwork.kernel.org; Mon, 04 Mar 2019 13:39:01 -0500 Received: from eggs.gnu.org ([209.51.188.92]:44431) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from <cota@braap.org>) id 1h0sAZ-0008KP-OB for qemu-devel@nongnu.org; Mon, 04 Mar 2019 13:18:32 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from <cota@braap.org>) id 1h0sAY-000102-TL for qemu-devel@nongnu.org; Mon, 04 Mar 2019 13:18:31 -0500 Received: from wout2-smtp.messagingengine.com ([64.147.123.25]:50903) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from <cota@braap.org>) id 1h0sAY-0000fj-JC for qemu-devel@nongnu.org; Mon, 04 Mar 2019 13:18:30 -0500 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.west.internal (Postfix) with ESMTP id 773D83509; Mon, 4 Mar 2019 13:18:19 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Mon, 04 Mar 2019 13:18:19 -0500 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 :mime-version:content-type:content-transfer-encoding; s=mesmtp; bh=wLWWkJ8fIfIykX+vN84dTwxeiwGf410ZjYqO9K5MaEI=; b=G+63cQFLepFF cdLHY9LHu+Iy5HbLEAk1fAuDhowP8GBWicStk7EUVX5Jkbp4wuhw3fyqho3L6YOQ DUgwfzyXcFAW0WzkKTEoAhi3yLx3AoUz73O9mw5y/hcgI7/ThVo6cVrmi0gRuf4f xlFlQsAWJJwQRs551N5h1MW2qeNIaME= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; bh=wLWWkJ8fIfIykX+vN84dTwxeiwGf410ZjYqO9K5Ma EI=; b=QfMYuariDmNnqAPm6oqieNlDIw7sx4cPsdI7EMMjyjNPola7bYxb/veu4 g1GG7x22mQKkGw895mdrtiOCOQW8S7+yirnkQARtpR6b5F/7p9JVfjvdLq/Jtw9A lWWmK0tG5+ISjFFRdFlYzgEnYEcVOdVvwuEfUC+5z8UKt+GpVaorjfSwnkpIWEfj fO3HpexvFsRMenoZOPPaDOkSpdKWJEZ+xI030zsTU1yZJtX8+QY40HSo+ApWTSDO Mw5mYxo+9mCieISbTaY2UbhJYmxe+YTCNVX9lK1IRkix6ja3lekiosPD3pGhj90J 2ZFWuKp0W6J0ST+gokg4IpB6Ksh7A== X-ME-Sender: <xms:6mt9XFYAt16i63_ubgeJ6WqKWyZETXARoG6QJphGaFO0sIvxs2uV2g> X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedutddrfedugdduuddtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffojghfgggtgfesthekredtredtjeenucfhrhhomhepfdfgmhhi lhhiohcuifdrucevohhtrgdfuceotghothgrsegsrhgrrghprdhorhhgqeenucfkphepud dvkedrheelrddvtddrvdduieenucfrrghrrghmpehmrghilhhfrhhomheptghothgrsegs rhgrrghprdhorhhgnecuvehluhhsthgvrhfuihiivgepfe X-ME-Proxy: <xmx:62t9XAyi0WnavDvIe1lhVTn0lX91OnSCGdnkweftLtQb0w8HetVslg> <xmx:62t9XF0El2NdFKI65iInVALsBVy4BsTkdn0tEKJRtgkGbGZSsH7-FQ> <xmx:62t9XBkAfweK3f4OJLytgE6z-Q4Vp2R9uNitMdjgggE3gqmLNd78GQ> <xmx:62t9XKPX8L8O0uG8yofUDWg2qNXD1yxc92pAr1yoOfQ0jSmeT77g1w> Received: from localhost (flamenco.cs.columbia.edu [128.59.20.216]) by mail.messagingengine.com (Postfix) with ESMTPA id 967ED10331; Mon, 4 Mar 2019 13:18:18 -0500 (EST) From: "Emilio G. Cota" <cota@braap.org> To: qemu-devel@nongnu.org Date: Mon, 4 Mar 2019 13:17:15 -0500 Message-Id: <20190304181813.8075-16-cota@braap.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190304181813.8075-1-cota@braap.org> References: <20190304181813.8075-1-cota@braap.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 64.147.123.25 Subject: [Qemu-devel] [PATCH v7 15/73] cpu: define cpu_halted helpers X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: <qemu-devel.nongnu.org> List-Unsubscribe: <https://lists.nongnu.org/mailman/options/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe> List-Archive: <http://lists.nongnu.org/archive/html/qemu-devel/> List-Post: <mailto:qemu-devel@nongnu.org> List-Help: <mailto:qemu-devel-request@nongnu.org?subject=help> List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=subscribe> Cc: =?utf-8?q?Alex_Benn=C3=A9e?= <alex.bennee@linaro.org>, Richard Henderson <richard.henderson@linaro.org> Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" <qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org> X-Virus-Scanned: ClamAV using ClamSMTP |
Series |
[v7,01/73] cpu: convert queued work to a QSIMPLEQ
|
expand
|
diff --git a/include/qom/cpu.h b/include/qom/cpu.h index d826a2852e..9fe74e4392 100644 --- a/include/qom/cpu.h +++ b/include/qom/cpu.h @@ -502,6 +502,30 @@ bool cpu_mutex_locked(const CPUState *cpu); */ bool no_cpu_mutex_locked(void); +static inline uint32_t cpu_halted(CPUState *cpu) +{ + uint32_t ret; + + if (cpu_mutex_locked(cpu)) { + return cpu->halted; + } + cpu_mutex_lock(cpu); + ret = cpu->halted; + cpu_mutex_unlock(cpu); + return ret; +} + +static inline void cpu_halted_set(CPUState *cpu, uint32_t val) +{ + if (cpu_mutex_locked(cpu)) { + cpu->halted = val; + return; + } + cpu_mutex_lock(cpu); + cpu->halted = val; + cpu_mutex_unlock(cpu); +} + static inline void cpu_tb_jmp_cache_clear(CPUState *cpu) { unsigned int i;