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: 69646 Delivered-To: patch@linaro.org Received: by 10.140.106.246 with SMTP id e109csp2506607qgf; Wed, 8 Jun 2016 06:50:40 -0700 (PDT) X-Received: by 10.55.113.197 with SMTP id m188mr4499525qkc.90.1465393840142; Wed, 08 Jun 2016 06:50:40 -0700 (PDT) Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id c35si723046qte.32.2016.06.08.06.50.39 for (version=TLS1 cipher=AES128-SHA bits=128/128); Wed, 08 Jun 2016 06:50:40 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dmarc=fail (p=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1]:57102 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bAdsV-0005DE-6v for patch@linaro.org; Wed, 08 Jun 2016 09:50:39 -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+patch=linaro.org@nongnu.org Sender: "Qemu-devel" 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(-) -- 2.1.4 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; +}