From patchwork Fri Mar 4 11:22:17 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vineet Gupta X-Patchwork-Id: 591929 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 257631401C7 for ; Fri, 4 Mar 2016 22:23:09 +1100 (AEDT) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1abnp5-0002Gj-3M; Fri, 04 Mar 2016 11:23:07 +0000 Received: from us01smtprelay-2.synopsys.com ([198.182.60.111] helo=smtprelay.synopsys.com) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1abnp3-00021p-O0 for linux-snps-arc@lists.infradead.org; Fri, 04 Mar 2016 11:23:06 +0000 Received: from dc8secmta1.synopsys.com (dc8secmta1.synopsys.com [10.13.218.200]) by smtprelay.synopsys.com (Postfix) with ESMTP id 5AD3010C127D; Fri, 4 Mar 2016 03:22:44 -0800 (PST) Received: from dc8secmta1.internal.synopsys.com (dc8secmta1.internal.synopsys.com [127.0.0.1]) by dc8secmta1.internal.synopsys.com (Service) with ESMTP id 2ACB72712F; Fri, 4 Mar 2016 03:22:44 -0800 (PST) Received: from mailhost.synopsys.com (mailhost1.synopsys.com [10.12.238.239]) by dc8secmta1.internal.synopsys.com (Service) with ESMTP id 079D627123; Fri, 4 Mar 2016 03:22:44 -0800 (PST) Received: from mailhost.synopsys.com (localhost [127.0.0.1]) by mailhost.synopsys.com (Postfix) with ESMTP id E8724AFE; Fri, 4 Mar 2016 03:22:43 -0800 (PST) Received: from US01WEHTC2.internal.synopsys.com (us01wehtc2.internal.synopsys.com [10.12.239.237]) by mailhost.synopsys.com (Postfix) with ESMTP id 8979BAFC; Fri, 4 Mar 2016 03:22:43 -0800 (PST) Received: from IN01WEHTCB.internal.synopsys.com (10.144.199.106) by US01WEHTC2.internal.synopsys.com (10.12.239.237) with Microsoft SMTP Server (TLS) id 14.3.195.1; Fri, 4 Mar 2016 03:22:37 -0800 Received: from IN01WEHTCA.internal.synopsys.com (10.144.199.103) by IN01WEHTCB.internal.synopsys.com (10.144.199.105) with Microsoft SMTP Server (TLS) id 14.3.195.1; Fri, 4 Mar 2016 16:52:34 +0530 Received: from vineet-E7440.internal.synopsys.com (10.12.197.208) by IN01WEHTCA.internal.synopsys.com (10.144.199.243) with Microsoft SMTP Server (TLS) id 14.3.195.1; Fri, 4 Mar 2016 16:52:33 +0530 From: Vineet Gupta To: Subject: [PATCH] rt_sigaction.h: adjust for ARC Date: Fri, 4 Mar 2016 16:52:17 +0530 Message-ID: <1457090537-23825-1-git-send-email-vgupta@synopsys.com> X-Mailer: git-send-email 2.5.0 MIME-Version: 1.0 X-Originating-IP: [10.12.197.208] X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20160304_032305_799694_EFA84A02 X-CRM114-Status: UNSURE ( 9.58 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -1.9 (-) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-1.9 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RP_MATCHES_RCVD Envelope sender domain matches handover relay domain -0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [198.182.60.111 listed in wl.mailspike.net] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [198.182.60.111 listed in list.dnswl.org] -1.9 BAYES_00 BODY: Bayes spam probability is 0 to 1% [score: 0.0000] -0.0 RCVD_IN_MSPIKE_WL Mailspike good senders X-BeenThere: linux-snps-arc@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Linux on Synopsys ARC Processors List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Anton.Kolesov@synopsys.com, Vineet Gupta , linux-snps-arc@lists.infradead.org, yuriy.kolerov@synopsys.com Sender: "linux-snps-arc" Errors-To: linux-snps-arc-bounces+incoming=patchwork.ozlabs.org@lists.infradead.org ARC uses the no-legacy syscall ABI where there is no need for kernel_sigaction interworking. Further we rely on default SA_RESTORER in libc for sigreturn. To me all the song-and-dance in ltp_rt_sigaction() doesn't make sense. The intent it to test whatever platform libc + kernel combination provides and to that end any fixups in LTP seem odd to me. So for ARC just call what libc provides and don't claim to support more/less. e.g. rt_sigaction02 fails for ARC, since libc sigaction does following | int __libc_sigaction (int sig, const struct sigaction *act, struct sigaction *oact) | { | struct sigaction kact; | | if (act && !(act->sa_flags & SA_RESTORER)) { | kact.sa_restorer = __default_rt_sa_restorer; So we don't get the EFAULT for @act == -1 which kernel would provide. Instead we get a segv rightawat. But that's fine, that is how our system works. Signed-off-by: Vineet Gupta --- include/lapi/rt_sigaction.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/include/lapi/rt_sigaction.h b/include/lapi/rt_sigaction.h index 3a5a763ce094..12af3c3b7b27 100644 --- a/include/lapi/rt_sigaction.h +++ b/include/lapi/rt_sigaction.h @@ -155,6 +155,13 @@ static void __attribute__((used)) __sigreturn_stub(void) static int ltp_rt_sigaction(int signum, const struct sigaction *act, struct sigaction *oact, size_t sigsetsize) { +#ifdef __arc__ + /* + * No playing games with various internals of sigaction / fields + * just use whatever libc + kernel provide + */ + return sigaction(signum, act, oact); +#else int ret; struct kernel_sigaction kact, koact; struct kernel_sigaction *kact_p = NULL; @@ -218,6 +225,7 @@ static int ltp_rt_sigaction(int signum, const struct sigaction *act, } return ret; +#endif } #endif /* LTP_RT_SIGACTION_H */