From patchwork Wed Jul 25 22:10:29 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 173294 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 5BF5D2C0097 for ; Thu, 26 Jul 2012 08:11:07 +1000 (EST) Received: from localhost ([::1]:48601 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Su9nN-0007fY-7N for incoming@patchwork.ozlabs.org; Wed, 25 Jul 2012 18:11:05 -0400 Received: from eggs.gnu.org ([208.118.235.92]:42305) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Su9n7-0007ai-DB for qemu-devel@nongnu.org; Wed, 25 Jul 2012 18:10:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Su9n5-00010x-W2 for qemu-devel@nongnu.org; Wed, 25 Jul 2012 18:10:49 -0400 Received: from mail-pb0-f45.google.com ([209.85.160.45]:44694) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Su9n5-00010i-Km for qemu-devel@nongnu.org; Wed, 25 Jul 2012 18:10:47 -0400 Received: by mail-pb0-f45.google.com with SMTP id ro12so2018027pbb.4 for ; Wed, 25 Jul 2012 15:10:47 -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=P1i6AAYyWKTjV8VH3cTB8LG4FasBjAfHr1I7vkFUHG0=; b=ulxiMoDu8deyjdCU2JzDxt6ZWXfrIspgzeXizHkpsuqUtrxZHMMC7OuOOD69rgVMj6 +Rp5ISKQ7b2Crxw6EYJcce4A0RhybamwQuzBx5Wfc6qE4wl0+IbgmChSOu8oEmvHCATI RoPtZWM4yMmG1TQrVny1to0K7oCpclNZSw8rXLv4vUjfZ6glKfeeRa7Bew2hLZiCFi8f 1vBFcfuwghy8yltQCAjXxdPTjQZhS759X+JvCpSEDybxX8vtRvvPh3Ya5NAsf3hOm7bA xXxKBf4lsdgyq5Qxq/Mtxd4qDwYec39e4vrjiNhfu5O/fwAc3sDDehWt5ETUjBVasXNg yqyQ== Received: by 10.68.219.226 with SMTP id pr2mr56897242pbc.1.1343254247326; Wed, 25 Jul 2012 15:10:47 -0700 (PDT) Received: from anchor.twiddle.home.com ([173.160.232.49]) by mx.google.com with ESMTPS id oo6sm15136761pbc.22.2012.07.25.15.10.46 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 25 Jul 2012 15:10:46 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Wed, 25 Jul 2012 15:10:29 -0700 Message-Id: <1343254238-4727-2-git-send-email-rth@twiddle.net> X-Mailer: git-send-email 1.7.7.6 In-Reply-To: <1343254238-4727-1-git-send-email-rth@twiddle.net> References: <1343254238-4727-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.160.45 Cc: riku.voipio@iki.fi Subject: [Qemu-devel] [PATCH 01/10] 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 Reviewed-by: Peter Maydell --- 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 d0e0e4f..5787432 100644 --- a/linux-user/main.c +++ b/linux-user/main.c @@ -2834,6 +2834,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