From patchwork Fri Jul 15 18:57:22 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: sergey.fedorov@linaro.org X-Patchwork-Id: 9232467 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id A203C60868 for ; Fri, 15 Jul 2016 19:11:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9362926D08 for ; Fri, 15 Jul 2016 19:11:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 86C0727F4B; Fri, 15 Jul 2016 19:11:15 +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=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 0E44226D08 for ; Fri, 15 Jul 2016 19:11:14 +0000 (UTC) Received: from localhost ([::1]:34548 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bO8W1-0004LZ-Lv for patchwork-qemu-devel@patchwork.kernel.org; Fri, 15 Jul 2016 15:11:13 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36717) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bO8QL-0006cK-5R for qemu-devel@nongnu.org; Fri, 15 Jul 2016 15:05:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bO8QH-0005CZ-1W for qemu-devel@nongnu.org; Fri, 15 Jul 2016 15:05:21 -0400 Received: from mail-lf0-x229.google.com ([2a00:1450:4010:c07::229]:36744) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bO8QG-0005CO-PN for qemu-devel@nongnu.org; Fri, 15 Jul 2016 15:05:16 -0400 Received: by mail-lf0-x229.google.com with SMTP id y184so5046783lfd.3 for ; Fri, 15 Jul 2016 12:05:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=FqaYR/8pqbhEBYGyKuIsUi2LNZAgB6kkYHjJmnLCGVU=; b=QPYCXn4Dj5Z/M3MvQ1Oic77p9Dq1s0GVyaQdaQiyydoYl81qnQ/kdpR7y1BdwipfND zO2uGqIZVovup7KNBX+KYsypu+/Ni9vZCgoeG5rNPnQsMhcLHlW7jNxY4YTNSEsBo7Zv 6Cdk6lWFJD3Ge5PcNSscGXD/IQHz59j0du7js= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=FqaYR/8pqbhEBYGyKuIsUi2LNZAgB6kkYHjJmnLCGVU=; b=DjKHcSaU1PO45mIekrjJ+LGnaCud+V0hQ6V3lufJj07Z4TRI74V9/7oKuGZIU6oqtP 2iks2VAu/FjR/mYw5rYnl4d8AebpkY51Nzch62KpjLCPYVaXIcozDlYfv2/9ePHP26Ys 4wVSIDdlxwtMjq4EYF78Gc54ofuMF68/AWeVGORUw/x7YEqcT0yd8VGXB2jsCajyKONj +yrhuz3xGjdwf2B0ZII5Xa8ivue0i6sN/qA7LL5PqR1CcU6nk3+zZ5GZATIKil+HBZWw 38DcKZ8odVJ+w3wYBXVnR4wzQF+B8ljsRBxRZGdh0n8cHqaLdftgkDE3w1YQesrqUEME SFLQ== X-Gm-Message-State: ALyK8tJr1FL4WtRVUD+w38awRWjAfL6/IHK1htoVlBnQSEjxYJ0v9yiLDQv/Q5Gf1/RVCTu3 X-Received: by 10.25.18.227 with SMTP id 96mr9840220lfs.183.1468609064354; Fri, 15 Jul 2016 11:57:44 -0700 (PDT) Received: from sergey-laptop.Dlink (broadband-46-188-120-37.2com.net. [46.188.120.37]) by smtp.gmail.com with ESMTPSA id 35sm2126381ljb.10.2016.07.15.11.57.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Fri, 15 Jul 2016 11:57:43 -0700 (PDT) From: Sergey Fedorov To: qemu-devel@nongnu.org Date: Fri, 15 Jul 2016 21:57:22 +0300 Message-Id: <20160715185726.10181-9-sergey.fedorov@linaro.org> X-Mailer: git-send-email 2.9.1 In-Reply-To: <20160715185726.10181-1-sergey.fedorov@linaro.org> References: <20160715185726.10181-1-sergey.fedorov@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:4010:c07::229 Subject: [Qemu-devel] [PATCH v4 08/12] linux-user: Add qemu_cpu_is_self() and qemu_cpu_kick() 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: MTTCG Devel , Peter Maydell , Sergey Fedorov , patches@linaro.org, Riku Voipio , Alvise Rigo , "Emilio G. Cota" , Paolo Bonzini , Sergey Fedorov , Richard Henderson , =?UTF-8?Q?Alex_Benn=c3=a9e?= , =?UTF-8?B?S09OUkFEIEZyw6lkw6lyaWM=?= Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Sergey Fedorov Signed-off-by: Sergey Fedorov Signed-off-by: Sergey Fedorov Reviewed-by: Alex Bennée --- linux-user/main.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/linux-user/main.c b/linux-user/main.c index 5ff0b20bad89..a8790ac63f68 100644 --- a/linux-user/main.c +++ b/linux-user/main.c @@ -3785,6 +3785,16 @@ void cpu_loop(CPUTLGState *env) THREAD CPUState *thread_cpu; +bool qemu_cpu_is_self(CPUState *cpu) +{ + return thread_cpu == cpu; +} + +void qemu_cpu_kick(CPUState *cpu) +{ + cpu_exit(cpu); +} + void task_settid(TaskState *ts) { if (ts->ts_tid == 0) {