From patchwork Mon May 17 18:13:49 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Laurent Vivier X-Patchwork-Id: 440200 Delivered-To: patch@linaro.org Received: by 2002:a02:7a1b:0:0:0:0:0 with SMTP id a27csp1346921jac; Mon, 17 May 2021 11:44:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxjNk2/DXVsB61/ZjZMoArs+rnTfX6Sc3Knom6PcAY0MsmPubJfZt/wBe/bu/pA/GM4T5Ux X-Received: by 2002:a6b:b48d:: with SMTP id d135mr1126312iof.107.1621277073258; Mon, 17 May 2021 11:44:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621277073; cv=none; d=google.com; s=arc-20160816; b=wx58hmtog0ZS4w4ku3ZLW68q7fOcpFYYmzVTYBhlxowJzmmCoZ+pS4sivvPnRJ3/ot gIupd/4Wd+JACZeaUnzzzMLmD8qJYjTd/rR76uHpZUw3Igck4rs6ZZBTVoS3+ujZvf7Z YnANIkkMpG18bt2i8gkewj617K2beSzl4ZKEZK+qAAgP+mg00xZVKbtmP15zb9A5OvnC J90pchL+g5thP7avbtm9dVnpDT+w3htBj7BYGDAduakzCfA1dxQRIeoHg5LMZPkTefdl NyOCbAolwUgHdXUy4cio3xHMbn2uioYjl+m8qI98TE/1KxG/a2eDjNuQcZdKTFsQQTEe ZiYQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from; bh=61rFI5PKzcOz/G10Rq+BczzBIfY7SgPblFIfT5kjN9Q=; b=NKNaN5hW+MtTi8dfqvA8Gbp8IeoCJ1se8oPE3AnlM0rsuVraA3k+k6o3ZyKqFUUmvJ 5SPEWxqNDCOC2OORk85VXjCC5Labo/LgR9JrM/LKJASgsYgZxLQHoxzO63GKFTe9MWDi nCT6k1HF9A2G6mICd2SshQgEOSJQaMH5p2Qr31T72Kg7HYGTOnq5k5LFGpNpUdlYXO0o A4C+Z94EYduBV2x/YdveFFSDdL8sTaFkD8R8AoyAxn2hgELoYG8mt61Xdv+TfJf5Rt5o 86xFx2YasWYdj8AQmMrBekbB5Dvd62aL0PCbTdvNXwmgQLSfh/kObke8qTbYTU7lYSDB /2OA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id f4si18962153ilq.1.2021.05.17.11.44.33 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 17 May 2021 11:44:33 -0700 (PDT) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org" Received: from localhost ([::1]:42856 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1liiEC-0006dY-Nw for patch@linaro.org; Mon, 17 May 2021 14:44:32 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:34020) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lihlc-0006W9-GS for qemu-devel@nongnu.org; Mon, 17 May 2021 14:15:00 -0400 Received: from mout.kundenserver.de ([212.227.17.10]:45613) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lihlM-0004RU-OZ for qemu-devel@nongnu.org; Mon, 17 May 2021 14:15:00 -0400 Received: from quad ([82.142.31.78]) by mrelayeu.kundenserver.de (mreue107 [212.227.15.183]) with ESMTPSA (Nemesis) id 1MqJVd-1l4drQ15Vb-00nOmz; Mon, 17 May 2021 20:14:39 +0200 From: Laurent Vivier To: qemu-devel@nongnu.org Subject: [PULL 24/59] linux-user/sparc: Clean up get_sigframe Date: Mon, 17 May 2021 20:13:49 +0200 Message-Id: <20210517181424.8093-25-laurent@vivier.eu> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20210517181424.8093-1-laurent@vivier.eu> References: <20210517181424.8093-1-laurent@vivier.eu> MIME-Version: 1.0 X-Provags-ID: V03:K1:CzjXPKmQAoA2UnakUWiAOkJLwWyM9ENLxvn73I8LyshK2AcsCGn bfuSPcRRJ5c7eisIeqq/snOAr804kQQ/pe94leo70KXzYhEOlG48GpYgfdYYata55hFfTUV EpbFQNwKiFkJvfdf+/0VIXjV+5hGcWAnlvahuHNMJSd3LxRXzMQWCsy76+rxEYNnB72zGR9 zl7R8B8l/kqpVmvRwRPWg== X-UI-Out-Filterresults: notjunk:1; V03:K0:5mTBrKKH7+o=:h7jtk4oAzeexTHa0lVX9iQ A4LrFYk34YRzH/KMRtkZOmLj+OkrVUdwYTPx7VirXKSfbECoXAMDyaeDZ2dN5eU9VHpPb1Byv oY5gWuR37ytYHsxghfCOoJ8SOPrLy6U4v4uUDrUNQvyaKRcoeMBSW+6fcu6X5khSJVzbF0zxf dvH4q3uZ2Wq4AFmbMkZY4oach7jNJSfeVjyxtHKL6tgWpVn2nWVy+hBN+CX9aVZ8DCv8wJWjq Mi3CHoOwgoOGyTRFKo0bg5N8ryIafjEh2Ul0lWUeRKMktXFNrylOOg+JAMqDOOlrYCt8rWsLv 95WfYdplr5W6RmBFRcqOm44htO1w+zJf6oEu7dUm29mfq1D5zN2rRApyv3dvq9qtxAEqA9N8B sCxGjyzLtCvbtAtrtFzxfvcei/Q+3QLX0WLp57kJHER4gh+jbZjCpmA734CXvDwDWfecL86h5 XQy9mOj/KQhuGFvVSwf6+FcNcmWGhtCLqvxp9TcNYnwr2fOy+brq+0ez/Lh0PGb2xpYT54md7 z4W7f8AL2wNkXydILHA728= Received-SPF: none client-ip=212.227.17.10; envelope-from=laurent@vivier.eu; helo=mout.kundenserver.de X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Richard Henderson , Laurent Vivier Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Richard Henderson Remove inline; fix spacing and comment format. Signed-off-by: Richard Henderson Message-Id: <20210426025334.1168495-18-richard.henderson@linaro.org> Signed-off-by: Laurent Vivier --- linux-user/sparc/signal.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) -- 2.31.1 diff --git a/linux-user/sparc/signal.c b/linux-user/sparc/signal.c index 69fee5a76a8b..57dbc72c9949 100644 --- a/linux-user/sparc/signal.c +++ b/linux-user/sparc/signal.c @@ -65,24 +65,25 @@ struct target_signal_frame { qemu_siginfo_fpu_t fpu_state; }; -static inline abi_ulong get_sigframe(struct target_sigaction *sa, - CPUSPARCState *env, - unsigned long framesize) +static abi_ulong get_sigframe(struct target_sigaction *sa, + CPUSPARCState *env, + size_t framesize) { abi_ulong sp = get_sp_from_cpustate(env); /* * If we are on the alternate signal stack and would overflow it, don't. * Return an always-bogus address instead so we will die with SIGSEGV. - */ + */ if (on_sig_stack(sp) && !likely(on_sig_stack(sp - framesize))) { - return -1; + return -1; } /* This is the X/Open sanctioned signal stack switching. */ sp = target_sigsp(sp, sa) - framesize; - /* Always align the stack frame. This handles two cases. First, + /* + * Always align the stack frame. This handles two cases. First, * sigaltstack need not be mindful of platform specific stack * alignment. Second, if we took this signal because the stack * is not aligned properly, we'd like to take the signal cleanly