mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Paul Burton <paul.burton@imgtec.com>
To: <linux-mips@linux-mips.org>
Cc: Guenter Roeck <linux@roeck-us.net>,
	Matthew Fortune <matthew.fortune@imgtec.com>,
	Paul Burton <paul.burton@imgtec.com>,
	"Michael Ellerman" <mpe@ellerman.id.au>,
	<linux-kernel@vger.kernel.org>,
	"Richard Weinberger" <richard@nod.at>,
	James Hogan <james.hogan@imgtec.com>,
	"Andy Lutomirski" <luto@amacapital.net>,
	Ralf Baechle <ralf@linux-mips.org>,
	"Maciej W. Rozycki" <macro@codesourcery.com>
Subject: [PATCH v2 03/16] MIPS: add offsets to sigcontext FP fields to struct mips_abi
Date: Mon, 27 Jul 2015 12:58:14 -0700	[thread overview]
Message-ID: <1438027107-24420-4-git-send-email-paul.burton@imgtec.com> (raw)
In-Reply-To: <1438027107-24420-1-git-send-email-paul.burton@imgtec.com>

Add fields to struct mips_abi, which holds information regarding the
kernel-userland ABI regarding signals, to specify the offsets to the FP
related fields within the appropriate variant of struct sigcontext.

Signed-off-by: Paul Burton <paul.burton@imgtec.com>
---

Changes in v2: None

 arch/mips/include/asm/abi.h   | 4 ++++
 arch/mips/kernel/signal.c     | 6 +++++-
 arch/mips/kernel/signal32.c   | 6 +++++-
 arch/mips/kernel/signal_n32.c | 6 +++++-
 4 files changed, 19 insertions(+), 3 deletions(-)

diff --git a/arch/mips/include/asm/abi.h b/arch/mips/include/asm/abi.h
index 7186bb5..37f8407 100644
--- a/arch/mips/include/asm/abi.h
+++ b/arch/mips/include/asm/abi.h
@@ -20,6 +20,10 @@ struct mips_abi {
 				     struct pt_regs *regs, sigset_t *set);
 	const unsigned long	rt_signal_return_offset;
 	const unsigned long	restart;
+
+	unsigned	off_sc_fpregs;
+	unsigned	off_sc_fpc_csr;
+	unsigned	off_sc_used_math;
 };
 
 #endif /* _ASM_ABI_H */
diff --git a/arch/mips/kernel/signal.c b/arch/mips/kernel/signal.c
index 796c7d8..ddf8318 100644
--- a/arch/mips/kernel/signal.c
+++ b/arch/mips/kernel/signal.c
@@ -521,7 +521,11 @@ struct mips_abi mips_abi = {
 	.setup_rt_frame = setup_rt_frame,
 	.rt_signal_return_offset =
 		offsetof(struct mips_vdso, rt_signal_trampoline),
-	.restart	= __NR_restart_syscall
+	.restart	= __NR_restart_syscall,
+
+	.off_sc_fpregs = offsetof(struct sigcontext, sc_fpregs),
+	.off_sc_fpc_csr = offsetof(struct sigcontext, sc_fpc_csr),
+	.off_sc_used_math = offsetof(struct sigcontext, sc_used_math),
 };
 
 static void handle_signal(struct ksignal *ksig, struct pt_regs *regs)
diff --git a/arch/mips/kernel/signal32.c b/arch/mips/kernel/signal32.c
index 19a7705..6b65658 100644
--- a/arch/mips/kernel/signal32.c
+++ b/arch/mips/kernel/signal32.c
@@ -587,7 +587,11 @@ struct mips_abi mips_abi_32 = {
 	.setup_rt_frame = setup_rt_frame_32,
 	.rt_signal_return_offset =
 		offsetof(struct mips_vdso, o32_rt_signal_trampoline),
-	.restart	= __NR_O32_restart_syscall
+	.restart	= __NR_O32_restart_syscall,
+
+	.off_sc_fpregs = offsetof(struct sigcontext32, sc_fpregs),
+	.off_sc_fpc_csr = offsetof(struct sigcontext32, sc_fpc_csr),
+	.off_sc_used_math = offsetof(struct sigcontext32, sc_used_math),
 };
 
 static int signal32_init(void)
diff --git a/arch/mips/kernel/signal_n32.c b/arch/mips/kernel/signal_n32.c
index f1d4751..0d017fd 100644
--- a/arch/mips/kernel/signal_n32.c
+++ b/arch/mips/kernel/signal_n32.c
@@ -153,5 +153,9 @@ struct mips_abi mips_abi_n32 = {
 	.setup_rt_frame = setup_rt_frame_n32,
 	.rt_signal_return_offset =
 		offsetof(struct mips_vdso, n32_rt_signal_trampoline),
-	.restart	= __NR_N32_restart_syscall
+	.restart	= __NR_N32_restart_syscall,
+
+	.off_sc_fpregs = offsetof(struct sigcontext, sc_fpregs),
+	.off_sc_fpc_csr = offsetof(struct sigcontext, sc_fpc_csr),
+	.off_sc_used_math = offsetof(struct sigcontext, sc_used_math),
 };
-- 
2.4.6


  parent reply	other threads:[~2015-07-27 19:59 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-27 19:58 [PATCH v2 00/16] MSA vector context signal handling & HWCAPs Paul Burton
2015-07-27 19:58 ` [PATCH v2 01/16] MIPS: remove outdated comments in sigcontext.h Paul Burton
2015-07-28  8:39   ` Ralf Baechle
2015-07-27 19:58 ` [PATCH v2 02/16] MIPS: simplify EVA FP context handling code Paul Burton
2015-07-27 19:58 ` Paul Burton [this message]
2015-07-27 19:58 ` [PATCH v2 04/16] MIPS: use struct mips_abi offsets to save FP context Paul Burton
2015-07-27 19:58 ` [PATCH v2 05/16] MIPS: move FP usage checks into protected_{save,restore}_fp_context Paul Burton
2015-07-27 19:58 ` [PATCH v2 06/16] MIPS: skip odd double FP registers when copying FP32 sigcontext Paul Burton
2015-07-27 19:58 ` [PATCH v2 07/16] MIPS: use common FP sigcontext code for O32 compat Paul Burton
2015-07-27 19:58 ` [PATCH v2 08/16] MIPS: remove unused {get,put}_sigset functions Paul Burton
2015-07-27 19:58 ` [PATCH v2 09/16] MIPS: indicate FP mode in sigcontext sc_used_math Paul Burton
2015-07-27 19:58 ` [PATCH v2 10/16] MIPS: add definitions for extended context Paul Burton
2015-07-27 19:58 ` [PATCH v2 11/16] MIPS: save MSA extended context around signals Paul Burton
2015-07-27 19:58 ` [PATCH v2 12/16] MIPS: AT_HWCAP aux vector infrastructure Paul Burton
2015-07-27 19:58 ` [PATCH v2 13/16] MIPS: advertise MIPSr6 via HWCAP when appropriate Paul Burton
2015-07-27 19:58 ` [PATCH v2 14/16] MIPS: advertise MSA support via HWCAP when present Paul Burton
2015-07-27 19:58 ` [PATCH v2 15/16] MIPS: require O32 FP64 support for MIPS64 with O32 compat Paul Burton
2015-07-27 19:58 ` [PATCH v2 16/16] MIPS: drop EXPERIMENTAL tag from O32+FP64 & MSA Paul Burton

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1438027107-24420-4-git-send-email-paul.burton@imgtec.com \
    --to=paul.burton@imgtec.com \
    --cc=james.hogan@imgtec.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@linux-mips.org \
    --cc=linux@roeck-us.net \
    --cc=luto@amacapital.net \
    --cc=macro@codesourcery.com \
    --cc=matthew.fortune@imgtec.com \
    --cc=mpe@ellerman.id.au \
    --cc=ralf@linux-mips.org \
    --cc=richard@nod.at \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®