From patchwork Wed Jun 8 13:29:48 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Riku Voipio X-Patchwork-Id: 9164699 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 BB38160467 for ; Wed, 8 Jun 2016 13:48:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AD70425D91 for ; Wed, 8 Jun 2016 13:48:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A23882810E; Wed, 8 Jun 2016 13:48:53 +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=-5.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, FSL_HELO_HOME, 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 92EE125D91 for ; Wed, 8 Jun 2016 13:48:52 +0000 (UTC) Received: from localhost ([::1]:57097 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bAdql-00048n-JG for patchwork-qemu-devel@patchwork.kernel.org; Wed, 08 Jun 2016 09:48:51 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:36790) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bAdZA-00045G-AL for qemu-devel@nongnu.org; Wed, 08 Jun 2016 09:30:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bAdZ7-0005dV-FZ for qemu-devel@nongnu.org; Wed, 08 Jun 2016 09:30:39 -0400 Received: from mail-lf0-x234.google.com ([2a00:1450:4010:c07::234]:33584) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bAdZ7-0005dO-01 for qemu-devel@nongnu.org; Wed, 08 Jun 2016 09:30:37 -0400 Received: by mail-lf0-x234.google.com with SMTP id s64so5897764lfe.0 for ; Wed, 08 Jun 2016 06:30:36 -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; bh=vZK72coNroAT3vw7Yb7qQrnvarNqXwRQVSVx3HVYfQU=; b=LI6FNxfn0YElfePHHXfisRi1HT/vuBWVPn+1bt1qdU0xQGVuInXkYRl7gXcZnIcA4v hLUn3QCXO2DzL+PqNSLCR1en5kpOZnBN8uVGnoOifvMnURGdCrcv4eakxhWxZngkCugb F/wELgbV3m8rV1v9Etbu+g6CA1EK/vb//f9yQ= 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; bh=vZK72coNroAT3vw7Yb7qQrnvarNqXwRQVSVx3HVYfQU=; b=hmxbUhw3Bx4r8GrQ/nbrg0BFEu1EOQvO0rHSutSjw4SX5XgrIIlFaQR3XGiqZjo75Q BBnUd18tPZk7u21OQwPYQuW39cowANI6pQf9Cm45Iq6Lt8k6rgvUslrsw8qGkVYAnagu UNs4APGvi/cPMDkL9TPAnZUoNwSVZK1aaAzfM09qYwnnbHUJjesdBdQd/0xQjvtbvopf zH5jIxztLfAbk8Wx72x3YKClCnCJh4JfAzZAS38swNWR7jg4PraWTuvJ6xJLGUyAUJFU RWmsf95ihhVVuePSNVpLDjvIwGRTFLAyiIb40LAELetFm7QKuSuu5tcozr9vUlgPioQ8 C0zA== X-Gm-Message-State: ALyK8tK6KkVKCngbiYhGOght7+C8ppJl4MG716sa8CgatlZQg/u3F5Elz9h8LbGypD9QC1L1 X-Received: by 10.25.214.92 with SMTP id n89mr3627493lfg.162.1465392636230; Wed, 08 Jun 2016 06:30:36 -0700 (PDT) Received: from beaming.home (91-157-170-157.elisa-laajakaista.fi. [91.157.170.157]) by smtp.gmail.com with ESMTPSA id 2sm139854lja.37.2016.06.08.06.30.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 08 Jun 2016 06:30:35 -0700 (PDT) From: riku.voipio@linaro.org To: qemu-devel@nongnu.org Date: Wed, 8 Jun 2016 16:29:48 +0300 Message-Id: X-Mailer: git-send-email 2.1.4 In-Reply-To: References: X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:4010:c07::234 Subject: [Qemu-devel] [PULL 07/44] linux-user: Move handle_pending_signal() to avoid need for declaration 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: Peter Maydell Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Peter Maydell Move the handle_pending_signal() function above process_pending_signals() to avoid the need for a forward declaration. (Whitespace only change.) Signed-off-by: Peter Maydell Reviewed-by: Laurent Vivier Signed-off-by: Riku Voipio --- linux-user/signal.c | 44 +++++++++++++++++++++----------------------- 1 file changed, 21 insertions(+), 23 deletions(-) diff --git a/linux-user/signal.c b/linux-user/signal.c index a9ac491..5f98c71 100644 --- a/linux-user/signal.c +++ b/linux-user/signal.c @@ -5765,29 +5765,6 @@ long do_rt_sigreturn(CPUArchState *env) #endif -static void handle_pending_signal(CPUArchState *cpu_env, int sig); - -void process_pending_signals(CPUArchState *cpu_env) -{ - CPUState *cpu = ENV_GET_CPU(cpu_env); - int sig; - TaskState *ts = cpu->opaque; - - if (!ts->signal_pending) - return; - - /* FIXME: This is not threadsafe. */ - for(sig = 1; sig <= TARGET_NSIG; sig++) { - if (ts->sigtab[sig - 1].pending) { - handle_pending_signal(cpu_env, sig); - return; - } - } - /* if no signal is pending, just return */ - ts->signal_pending = 0; - return; -} - static void handle_pending_signal(CPUArchState *cpu_env, int sig) { CPUState *cpu = ENV_GET_CPU(cpu_env); @@ -5876,3 +5853,24 @@ static void handle_pending_signal(CPUArchState *cpu_env, int sig) if (q != &k->info) free_sigqueue(cpu_env, q); } + +void process_pending_signals(CPUArchState *cpu_env) +{ + CPUState *cpu = ENV_GET_CPU(cpu_env); + int sig; + TaskState *ts = cpu->opaque; + + if (!ts->signal_pending) + return; + + /* FIXME: This is not threadsafe. */ + for(sig = 1; sig <= TARGET_NSIG; sig++) { + if (ts->sigtab[sig - 1].pending) { + handle_pending_signal(cpu_env, sig); + return; + } + } + /* if no signal is pending, just return */ + ts->signal_pending = 0; + return; +}