From patchwork Sat Jun 2 19:29:52 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 162442 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id A2949B6FAB for ; Sun, 3 Jun 2012 05:30:31 +1000 (EST) Received: from localhost ([::1]:46857 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sau1t-0007Fm-CV for incoming@patchwork.ozlabs.org; Sat, 02 Jun 2012 15:30:29 -0400 Received: from eggs.gnu.org ([208.118.235.92]:39878) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sau1Z-000788-DK for qemu-devel@nongnu.org; Sat, 02 Jun 2012 15:30:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Sau1W-00015H-It for qemu-devel@nongnu.org; Sat, 02 Jun 2012 15:30:08 -0400 Received: from mail-pz0-f45.google.com ([209.85.210.45]:58847) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sau1W-0000yI-8u for qemu-devel@nongnu.org; Sat, 02 Jun 2012 15:30:06 -0400 Received: by dadv2 with SMTP id v2so4554032dad.4 for ; Sat, 02 Jun 2012 12:30:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references; bh=NFZhvMy70Z35m4+MA49a7WrcTfupuW2EfSf05hB4oJE=; b=Ydy4aFrA440fk3tIG0h5ltBADv07H4AG/FKb67mdG9Zt4oy2QjbB0W/zcdYsJF+tBv UHEsgWxR9UZRlR5bvBTznLDAqSMiopDFYFCx9bvGQwO9qs2W6fQGA5ub+CDNSZNxpxiV 1lMGmfQuXpBb6+Uv6ADW1yjBX7NW/Gv5/AIyiHN8vEeaAhElRf6Q/ZPG0DBDwGy10U8M CVUNdl1R8RJx65A+W6Gch1BZ0ruyZSpT9ynHO2uTDIiNoyJfGGJlvG1KCp1VxvbYhMrF 4Na6HL5b01nOVPBf5QlZdUdwTU441/XiNHOmj19zYcC3MX/5tRUzKxlv2sBVwXDEn136 rGLA== Received: by 10.68.232.232 with SMTP id tr8mr23090220pbc.73.1338665403564; Sat, 02 Jun 2012 12:30:03 -0700 (PDT) Received: from anchor.twiddle.home ([173.160.232.49]) by mx.google.com with ESMTPS id z2sm7176147pbv.34.2012.06.02.12.30.02 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 02 Jun 2012 12:30:03 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Sat, 2 Jun 2012 12:29:52 -0700 Message-Id: <1338665397-20917-2-git-send-email-rth@twiddle.net> X-Mailer: git-send-email 1.7.7.6 In-Reply-To: <1338665397-20917-1-git-send-email-rth@twiddle.net> References: <1338665397-20917-1-git-send-email-rth@twiddle.net> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 209.85.210.45 Cc: Riku Voipio Subject: [Qemu-devel] [PATCH 1/6] alpha-linux-user: Fix signal handling X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Proper signal numbers were not defined, and EXCP_INTERRUPT was unhandled, leading to all sorts of subtle confusion. Signed-off-by: Richard Henderson --- linux-user/main.c | 3 +++ linux-user/syscall_defs.h | 41 ++++++++++++++++++++++++++++++++++++++++- 2 files changed, 43 insertions(+), 1 deletions(-) diff --git a/linux-user/main.c b/linux-user/main.c index 191b750..f507a32 100644 --- a/linux-user/main.c +++ b/linux-user/main.c @@ -2833,6 +2833,9 @@ void cpu_loop(CPUAlphaState *env) case EXCP_STQ_C: do_store_exclusive(env, env->error_code, trapnr - EXCP_STL_C); break; + case EXCP_INTERRUPT: + /* Just indicate that signals should be handled asap. */ + break; default: printf ("Unhandled trap: 0x%x\n", trapnr); cpu_dump_state(env, stderr, fprintf, 0); diff --git a/linux-user/syscall_defs.h b/linux-user/syscall_defs.h index a79b67d..02fe4f6 100644 --- a/linux-user/syscall_defs.h +++ b/linux-user/syscall_defs.h @@ -363,7 +363,46 @@ int do_sigaction(int sig, const struct target_sigaction *act, #define TARGET_SA_RESTORER 0x04000000 #endif -#if defined(TARGET_SPARC) +#if defined(TARGET_ALPHA) + +#define TARGET_SIGHUP 1 +#define TARGET_SIGINT 2 +#define TARGET_SIGQUIT 3 +#define TARGET_SIGILL 4 +#define TARGET_SIGTRAP 5 +#define TARGET_SIGABRT 6 +#define TARGET_SIGSTKFLT 7 /* actually SIGEMT */ +#define TARGET_SIGFPE 8 +#define TARGET_SIGKILL 9 +#define TARGET_SIGBUS 10 +#define TARGET_SIGSEGV 11 +#define TARGET_SIGSYS 12 +#define TARGET_SIGPIPE 13 +#define TARGET_SIGALRM 14 +#define TARGET_SIGTERM 15 +#define TARGET_SIGURG 16 +#define TARGET_SIGSTOP 17 +#define TARGET_SIGTSTP 18 +#define TARGET_SIGCONT 19 +#define TARGET_SIGCHLD 20 +#define TARGET_SIGTTIN 21 +#define TARGET_SIGTTOU 22 +#define TARGET_SIGIO 23 +#define TARGET_SIGXCPU 24 +#define TARGET_SIGXFSZ 25 +#define TARGET_SIGVTALRM 26 +#define TARGET_SIGPROF 27 +#define TARGET_SIGWINCH 28 +#define TARGET_SIGPWR 29 /* actually SIGINFO */ +#define TARGET_SIGUSR1 30 +#define TARGET_SIGUSR2 31 +#define TARGET_SIGRTMIN 32 + +#define TARGET_SIG_BLOCK 1 +#define TARGET_SIG_UNBLOCK 2 +#define TARGET_SIG_SETMASK 3 + +#elif defined(TARGET_SPARC) #define TARGET_SIGHUP 1 #define TARGET_SIGINT 2