From patchwork Thu Jun 7 22:24:30 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 163685 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 D915EB6EF3 for ; Fri, 8 Jun 2012 08:39:09 +1000 (EST) Received: from localhost ([::1]:33519 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Scl9Y-0004ex-Nw for incoming@patchwork.ozlabs.org; Thu, 07 Jun 2012 18:26:04 -0400 Received: from eggs.gnu.org ([208.118.235.92]:56674) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Scl8N-0001by-78 for qemu-devel@nongnu.org; Thu, 07 Jun 2012 18:24:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Scl8L-0006Gk-5Q for qemu-devel@nongnu.org; Thu, 07 Jun 2012 18:24:50 -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 1Scl8K-0006DJ-Sf for qemu-devel@nongnu.org; Thu, 07 Jun 2012 18:24:49 -0400 Received: by mail-pz0-f45.google.com with SMTP id v2so1641783dad.4 for ; Thu, 07 Jun 2012 15:24: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=GcGJceElh9MrIsKhnPSQ4yuJwBweLvDSSaUKermlz+4=; b=lSJIKZS10Dqc0O2eaKccPOsguTPsKNHONwVi1XR5OxWPrMqwQhI+ZBTz4xMkys7BsY dlnM7UiKEjHYkD8vwGucHPMW8gOotaLjBckNjapTJ4+dfDUPK8VZsVSWobxaTCkA8Whi QVd/riSJsnNkFMbZu8WAuUaMFtHOipBOT8ibkXPaMeUulqsnSb8KNTVi2juaO+DyA9AQ jXReMgv3QZDdwkiM3JRFuyEn0noClcX7wA4hqYKZ1T0U6/UcOLvE+GJGADBnLN+zVaqY rrJB8LbEk7qy/5azgToYZHnlZiTM5uW1Ths9Bvm4alkfY7j6WAXCYaWfDIonfLb56Rwx ImgQ== Received: by 10.68.239.164 with SMTP id vt4mr11922778pbc.166.1339107884899; Thu, 07 Jun 2012 15:24:44 -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.44 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 07 Jun 2012 15:24:44 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Thu, 7 Jun 2012 15:24:30 -0700 Message-Id: <1339107871-4487-9-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 8/9] alpha-linux-user: Properly handle the non-rt sigprocmask syscall. 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 Name the syscall properly for QEMU, kernel source notwithstanding. Fix syntax errors in the code thus enabled within do_syscall. Signed-off-by: Richard Henderson --- linux-user/alpha/syscall_nr.h | 2 +- linux-user/syscall.c | 9 +++++---- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/linux-user/alpha/syscall_nr.h b/linux-user/alpha/syscall_nr.h index f6284db..49648a1 100644 --- a/linux-user/alpha/syscall_nr.h +++ b/linux-user/alpha/syscall_nr.h @@ -46,7 +46,7 @@ #define TARGET_NR_open 45 #define TARGET_NR_osf_old_sigaction 46 /* not implemented */ #define TARGET_NR_getxgid 47 -#define TARGET_NR_osf_sigprocmask 48 +#define TARGET_NR_sigprocmask 48 #define TARGET_NR_osf_getlogin 49 /* not implemented */ #define TARGET_NR_osf_setlogin 50 /* not implemented */ #define TARGET_NR_acct 51 diff --git a/linux-user/syscall.c b/linux-user/syscall.c index 1a12f14..bc77b79 100644 --- a/linux-user/syscall.c +++ b/linux-user/syscall.c @@ -5880,12 +5880,13 @@ abi_long do_syscall(void *cpu_env, int num, abi_long arg1, mask = arg2; target_to_host_old_sigset(&set, &mask); - ret = get_errno(sigprocmask(how, &set, &oldset)); - - if (!is_error(ret)) { + ret = sigprocmask(how, &set, &oldset); + if (is_error(ret)) { + ret = get_errno(ret); + } else { host_to_target_old_sigset(&mask, &oldset); ret = mask; - ((CPUAlphaState *)cpu_env)->[IR_V0] = 0; /* force no error */ + ((CPUAlphaState *)cpu_env)->ir[IR_V0] = 0; /* force no error */ } #else sigset_t set, oldset, *set_ptr;