From patchwork Fri Dec 4 13:16:32 2009 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: riku.voipio@nokia.com X-Patchwork-Id: 40374 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 80A73B7BED for ; Sat, 5 Dec 2009 09:19:42 +1100 (EST) Received: from localhost ([127.0.0.1]:59091 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NGgV1-0000Ja-Cz for incoming@patchwork.ozlabs.org; Fri, 04 Dec 2009 17:19:39 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1NGY24-0006wi-Cc for qemu-devel@nongnu.org; Fri, 04 Dec 2009 08:17:12 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1NGY1z-0006t8-9s for qemu-devel@nongnu.org; Fri, 04 Dec 2009 08:17:11 -0500 Received: from [199.232.76.173] (port=58735 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1NGY1y-0006sp-4k for qemu-devel@nongnu.org; Fri, 04 Dec 2009 08:17:06 -0500 Received: from smtp.nokia.com ([192.100.122.230]:59302 helo=mgw-mx03.nokia.com) by monty-python.gnu.org with esmtps (TLS-1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1NGY1x-0008Os-Hu for qemu-devel@nongnu.org; Fri, 04 Dec 2009 08:17:06 -0500 Received: from vaebh105.NOE.Nokia.com (vaebh105.europe.nokia.com [10.160.244.31]) by mgw-mx03.nokia.com (Switch-3.3.3/Switch-3.3.3) with ESMTP id nB4DGfBD002570 for ; Fri, 4 Dec 2009 15:17:02 +0200 Received: from vaebh104.NOE.Nokia.com ([10.160.244.30]) by vaebh105.NOE.Nokia.com with Microsoft SMTPSVC(6.0.3790.3959); Fri, 4 Dec 2009 15:17:01 +0200 Received: from mgw-da01.ext.nokia.com ([147.243.128.24]) by vaebh104.NOE.Nokia.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.3959); Fri, 4 Dec 2009 15:16:55 +0200 Received: from localhost.localdomain (esdhcp041213.research.nokia.com [172.21.41.213]) by mgw-da01.ext.nokia.com (Switch-3.3.3/Switch-3.3.3) with ESMTP id nB4DGnMv029897; Fri, 4 Dec 2009 15:16:53 +0200 From: riku.voipio@nokia.com To: qemu-devel@nongnu.org Date: Fri, 4 Dec 2009 15:16:32 +0200 Message-Id: X-Mailer: git-send-email 1.6.3.3 In-Reply-To: References: In-Reply-To: References: X-OriginalArrivalTime: 04 Dec 2009 13:16:56.0282 (UTC) FILETIME=[0D969BA0:01CA74E4] X-Nokia-AV: Clean X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6 (newer, 1) X-Mailman-Approved-At: Fri, 04 Dec 2009 17:13:01 -0500 Cc: Riku Voipio Subject: [Qemu-devel] [PATCH 3/3] linux-user: cleanup force_sig() calls 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: Riku Voipio Force_sig should be always called with TARGET_ signals. Not that it really matters with SEGV, so this patch is just for cleanup and improving consistency. Signed-off-by: Riku Voipio --- linux-user/signal.c | 40 ++++++++++++++++++++-------------------- 1 files changed, 20 insertions(+), 20 deletions(-) diff --git a/linux-user/signal.c b/linux-user/signal.c index df189c3..b0faf2e 100644 --- a/linux-user/signal.c +++ b/linux-user/signal.c @@ -366,19 +366,19 @@ static inline void free_sigqueue(CPUState *env, struct sigqueue *q) } /* abort execution with signal */ -static void QEMU_NORETURN force_sig(int sig) +static void QEMU_NORETURN force_sig(int target_sig) { TaskState *ts = (TaskState *)thread_env->opaque; int host_sig, core_dumped = 0; struct sigaction act; - host_sig = target_to_host_signal(sig); - gdb_signalled(thread_env, sig); + host_sig = target_to_host_signal(target_sig); + gdb_signalled(thread_env, target_sig); /* dump core if supported by target binary format */ - if (core_dump_signal(sig) && (ts->bprm->core_dump != NULL)) { + if (core_dump_signal(target_sig) && (ts->bprm->core_dump != NULL)) { stop_all_tasks(); core_dumped = - ((*ts->bprm->core_dump)(sig, thread_env) == 0); + ((*ts->bprm->core_dump)(target_sig, thread_env) == 0); } if (core_dumped) { /* we already dumped the core of target process, we don't want @@ -388,7 +388,7 @@ static void QEMU_NORETURN force_sig(int sig) nodump.rlim_cur=0; setrlimit(RLIMIT_CORE, &nodump); (void) fprintf(stderr, "qemu: uncaught target signal %d (%s) - %s\n", - sig, strsignal(host_sig), "core dumped" ); + target_sig, strsignal(host_sig), "core dumped" ); } /* The proper exit code for dieing from an uncaught signal is @@ -1487,7 +1487,7 @@ static long do_sigreturn_v1(CPUState *env) badframe: unlock_user_struct(frame, frame_addr, 0); - force_sig(SIGSEGV /* , current */); + force_sig(TARGET_SIGSEGV /* , current */); return 0; } @@ -1539,7 +1539,7 @@ static long do_sigreturn_v2(CPUState *env) badframe: unlock_user_struct(frame, frame_addr, 0); - force_sig(SIGSEGV /* , current */); + force_sig(TARGET_SIGSEGV /* , current */); return 0; } @@ -1589,7 +1589,7 @@ static long do_rt_sigreturn_v1(CPUState *env) badframe: unlock_user_struct(frame, frame_addr, 0); - force_sig(SIGSEGV /* , current */); + force_sig(TARGET_SIGSEGV /* , current */); return 0; } @@ -1618,7 +1618,7 @@ static long do_rt_sigreturn_v2(CPUState *env) badframe: unlock_user_struct(frame, frame_addr, 0); - force_sig(SIGSEGV /* , current */); + force_sig(TARGET_SIGSEGV /* , current */); return 0; } @@ -2160,7 +2160,7 @@ void sparc64_set_context(CPUSPARCState *env) return; do_sigsegv: unlock_user_struct(ucp, ucp_addr, 0); - force_sig(SIGSEGV); + force_sig(TARGET_SIGSEGV); } void sparc64_get_context(CPUSPARCState *env) @@ -2254,7 +2254,7 @@ void sparc64_get_context(CPUSPARCState *env) return; do_sigsegv: unlock_user_struct(ucp, ucp_addr, 1); - force_sig(SIGSEGV); + force_sig(TARGET_SIGSEGV); } #endif #elif defined(TARGET_ABI_MIPSN64) @@ -2908,7 +2908,7 @@ static void setup_frame(int sig, struct target_sigaction *ka, give_sigsegv: unlock_user_struct(frame, frame_addr, 1); - force_sig(SIGSEGV); + force_sig(TARGET_SIGSEGV); } static void setup_rt_frame(int sig, struct target_sigaction *ka, @@ -2971,7 +2971,7 @@ static void setup_rt_frame(int sig, struct target_sigaction *ka, give_sigsegv: unlock_user_struct(frame, frame_addr, 1); - force_sig(SIGSEGV); + force_sig(TARGET_SIGSEGV); } long do_sigreturn(CPUState *regs) @@ -3850,7 +3850,7 @@ sigsegv: unlock_user_struct(frame, frame_addr, 1); if (logfile) fprintf (logfile, "segfaulting from setup_frame\n"); - force_sig(SIGSEGV); + force_sig(TARGET_SIGSEGV); } static void setup_rt_frame(int sig, struct target_sigaction *ka, @@ -3919,7 +3919,7 @@ sigsegv: unlock_user_struct(rt_sf, rt_sf_addr, 1); if (logfile) fprintf (logfile, "segfaulting from setup_rt_frame\n"); - force_sig(SIGSEGV); + force_sig(TARGET_SIGSEGV); } @@ -3961,7 +3961,7 @@ sigsegv: unlock_user_struct(sc, sc_addr, 1); if (logfile) fprintf (logfile, "segfaulting from do_sigreturn\n"); - force_sig(SIGSEGV); + force_sig(TARGET_SIGSEGV); return 0; } @@ -4024,7 +4024,7 @@ sigsegv: unlock_user_struct(rt_sf, rt_sf_addr, 1); if (logfile) fprintf (logfile, "segfaulting from do_rt_sigreturn\n"); - force_sig(SIGSEGV); + force_sig(TARGET_SIGSEGV); return 0; } @@ -4194,7 +4194,7 @@ static void setup_frame(int sig, struct target_sigaction *ka, give_sigsegv: unlock_user_struct(frame, frame_addr, 1); - force_sig(SIGSEGV); + force_sig(TARGET_SIGSEGV); } static inline int target_rt_setup_ucontext(struct target_ucontext *uc, @@ -4336,7 +4336,7 @@ static void setup_rt_frame(int sig, struct target_sigaction *ka, give_sigsegv: unlock_user_struct(frame, frame_addr, 1); - force_sig(SIGSEGV); + force_sig(TARGET_SIGSEGV); } long do_sigreturn(CPUState *env)