From patchwork Thu Jun 7 22:24:23 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 163680 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 7C2FBB6EF3 for ; Fri, 8 Jun 2012 08:25:01 +1000 (EST) Received: from localhost ([::1]:55535 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Scl8V-0001L5-8p for incoming@patchwork.ozlabs.org; Thu, 07 Jun 2012 18:24:59 -0400 Received: from eggs.gnu.org ([208.118.235.92]:54072) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Scl8E-0001If-RT for qemu-devel@nongnu.org; Thu, 07 Jun 2012 18:24:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Scl8C-0006Dj-Mw for qemu-devel@nongnu.org; Thu, 07 Jun 2012 18:24:42 -0400 Received: from mail-pz0-f45.google.com ([209.85.210.45]:53252) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Scl8C-0006DJ-EK for qemu-devel@nongnu.org; Thu, 07 Jun 2012 18:24:40 -0400 Received: by dadv2 with SMTP id v2so1641783dad.4 for ; Thu, 07 Jun 2012 15:24:38 -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=Dh1fT4HMUHTzGAPks/WHsZ1zxm7SRLlFS7g14jwH+yw=; b=Sl+dg//pWopHGoW6UoKWxmKGaxTpyc8G3n7xWN7GkbMIY96HJLEzaLntPsDfd7fM5C QuEUPwCAlheWq4KXGs1xqaG8Keb9tL0lIDUelQnqbMu2KhQuSS8+EAnaSm7Gax3r9yVR 0GRC+fifMHJWmgQjXYJgMs02VoG/FXLbLD7k95pdLW0347WidryxwZrPlLUKSlpypXL3 fdH3v1giF7Vg8+8Wbw5TzuKgqJbnJwajBDIbSM4iSqIyq9NYIGu0qbIsfmbrbpSFipLl PJsjOVKEn+pvii0w9DyaypQ4Tk2liJ9s1AB9RrvFXJjCAzNrgJs4eOM/kNECgByLkXQt ZzpA== Received: by 10.68.203.40 with SMTP id kn8mr12542353pbc.162.1339107878328; Thu, 07 Jun 2012 15:24:38 -0700 (PDT) Received: from anchor.twiddle.home ([173.160.232.49]) by mx.google.com with ESMTPS id u5sm5454817pbu.76.2012.06.07.15.24.37 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 07 Jun 2012 15:24:37 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Thu, 7 Jun 2012 15:24:23 -0700 Message-Id: <1339107871-4487-2-git-send-email-rth@twiddle.net> X-Mailer: git-send-email 1.7.7.6 In-Reply-To: <1339107871-4487-1-git-send-email-rth@twiddle.net> References: <1339107871-4487-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/9] 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 49108b8..e81abb2 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