From patchwork Thu Oct 22 20:17:47 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aurelien Jarno X-Patchwork-Id: 36753 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 927C2B7C12 for ; Fri, 23 Oct 2009 08:17:00 +1100 (EST) Received: from localhost ([127.0.0.1]:36807 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N151l-0000Fw-Em for incoming@patchwork.ozlabs.org; Thu, 22 Oct 2009 17:16:57 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1N14q2-0003sM-P9 for qemu-devel@nongnu.org; Thu, 22 Oct 2009 17:04:50 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1N14q0-0003rb-Gu for qemu-devel@nongnu.org; Thu, 22 Oct 2009 17:04:48 -0400 Received: from [199.232.76.173] (port=48146 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1N14q0-0003rC-19 for qemu-devel@nongnu.org; Thu, 22 Oct 2009 17:04:48 -0400 Received: from hall.aurel32.net ([88.191.82.174]:47908) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1N14py-0001sU-O7 for qemu-devel@nongnu.org; Thu, 22 Oct 2009 17:04:47 -0400 Received: from aurel32 by hall.aurel32.net with local (Exim 4.69) (envelope-from ) id 1N14px-0006yJ-D7; Thu, 22 Oct 2009 23:04:45 +0200 Resent-From: Aurelien Jarno Resent-Date: Thu, 22 Oct 2009 23:04:45 +0200 Resent-Message-ID: <20091022210445.GT1883@hall.aurel32.net> Resent-To: qemu-devel@nongnu.org, arnaud.patard@rtp-net.org Message-Id: X-OfflineIMAP-1849569045-52656d6f7465617572656c3332-494e424f58: 1256242145-0796851287444-v6.0.3 In-Reply-To: References: From: Aurelien Jarno To: qemu-devel@nongnu.org Date: Thu, 22 Oct 2009 22:17:47 +0200 Resent-Sender: Aurelien Jarno Resent-Date: Thu, 22 Oct 2009 23:04:45 +0200 X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 3) Cc: Riku Voipio , Arnaud Patard Subject: [Qemu-devel] [PATCH 1/5] linux-user: remove hardcoded value of _NSIG in signal.c X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org From: Arnaud Patard In a bunch of places, 64 is used as value of _NSIG but it's wrong at least on MIPS were _NSIG is 128. Signed-off-by: Arnaud Patard Signed-off-by: Aurelien Jarno --- linux-user/signal.c | 12 ++++++------ 1 files changed, 6 insertions(+), 6 deletions(-) diff --git a/linux-user/signal.c b/linux-user/signal.c index 2df17aa..6620ce3 100644 --- a/linux-user/signal.c +++ b/linux-user/signal.c @@ -44,7 +44,7 @@ static struct target_sigaction sigact_table[TARGET_NSIG]; static void host_signal_handler(int host_signum, siginfo_t *info, void *puc); -static uint8_t host_to_target_signal_table[65] = { +static uint8_t host_to_target_signal_table[_NSIG+1] = { [SIGHUP] = TARGET_SIGHUP, [SIGINT] = TARGET_SIGINT, [SIGQUIT] = TARGET_SIGQUIT, @@ -87,7 +87,7 @@ static uint8_t host_to_target_signal_table[65] = { [__SIGRTMIN] = __SIGRTMAX, [__SIGRTMAX] = __SIGRTMIN, }; -static uint8_t target_to_host_signal_table[65]; +static uint8_t target_to_host_signal_table[_NSIG+1]; static inline int on_sig_stack(unsigned long sp) { @@ -103,14 +103,14 @@ static inline int sas_ss_flags(unsigned long sp) int host_to_target_signal(int sig) { - if (sig > 64) + if (sig > _NSIG) return sig; return host_to_target_signal_table[sig]; } int target_to_host_signal(int sig) { - if (sig > 64) + if (sig > _NSIG) return sig; return target_to_host_signal_table[sig]; } @@ -311,11 +311,11 @@ void signal_init(void) int host_sig; /* generate signal conversion tables */ - for(i = 1; i <= 64; i++) { + for(i = 1; i <= _NSIG; i++) { if (host_to_target_signal_table[i] == 0) host_to_target_signal_table[i] = i; } - for(i = 1; i <= 64; i++) { + for(i = 1; i <= _NSIG; i++) { j = host_to_target_signal_table[i]; target_to_host_signal_table[j] = i; }