public inbox for linux-m68k@lists.linux-m68k.org
 help / color / mirror / Atom feed
From: Greg Ungerer <gerg@linux-m68k.org>
To: linux-m68k@vger.kernel.org
Cc: Greg Ungerer <gerg@linux-m68k.org>
Subject: [PATCH 6/8] m68k: always make available dump_fpu()
Date: Mon, 29 Aug 2016 21:43:22 +1000	[thread overview]
Message-ID: <1472471004-4580-7-git-send-email-gerg@linux-m68k.org> (raw)
In-Reply-To: <1472471004-4580-1-git-send-email-gerg@linux-m68k.org>

Our local m68k architecture dump_fpu() is conditionally compiled in on
CONFIG_FPU. That is OK for all existing MMU enabled CPU types, but won't
handle the case for some ColdFire SoC CPU parts that we want to support
that have no FPU hardware.

dump_fpu() is expected to be present by the ELF loader, so we must always
have it available and exported.

Modify the position of the conditional to allow supporting the case where
CONFIG_FPU is not defined.

This change based on changes and discussion from Yannick Gicquel
<yannick.gicquel@open.eurogiciel.org>.

Signed-off-by: Greg Ungerer <gerg@linux-m68k.org>
---
 arch/m68k/kernel/process.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/arch/m68k/kernel/process.c b/arch/m68k/kernel/process.c
index c55ff71..44ec789 100644
--- a/arch/m68k/kernel/process.c
+++ b/arch/m68k/kernel/process.c
@@ -203,7 +203,6 @@ int copy_thread(unsigned long clone_flags, unsigned long usp,
 }
 
 /* Fill in the fpu structure for a core dump.  */
-#ifdef CONFIG_FPU
 int dump_fpu (struct pt_regs *regs, struct user_m68kfp_struct *fpu)
 {
 	char fpustate[216];
@@ -222,6 +221,7 @@ int dump_fpu (struct pt_regs *regs, struct user_m68kfp_struct *fpu)
 		return 1;
 	}
 
+#ifdef CONFIG_FPU
 	/* First dump the fpu context to avoid protocol violation.  */
 	asm volatile ("fsave %0" :: "m" (fpustate[0]) : "memory");
 	if (!CPU_IS_060 ? !fpustate[0] : !fpustate[2])
@@ -248,11 +248,11 @@ int dump_fpu (struct pt_regs *regs, struct user_m68kfp_struct *fpu)
 			      : "m" (fpu->fpregs[0])
 			      : "memory");
 	}
+#endif /* CONFIG_FPU */
 
 	return 1;
 }
 EXPORT_SYMBOL(dump_fpu);
-#endif /* CONFIG_FPU */
 
 unsigned long get_wchan(struct task_struct *p)
 {
-- 
1.9.1

  parent reply	other threads:[~2016-08-29 11:42 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-29 11:43 [PATCH 0/8] m68k: prepare to support ColdFire M5441x MMU enabled Greg Ungerer
2016-08-29 11:43 ` [PATCH 1/8] m68k: move CONFIG_FPU set to per-CPU configuration Greg Ungerer
2016-08-29 11:43 ` [PATCH 2/8] m68k: set appropriate machine type for m5411x SoC platforms Greg Ungerer
2016-08-29 11:43 ` [PATCH 3/8] m68k: report correct FPU type on ColdFire MMU platforms Greg Ungerer
2016-08-29 11:43 ` [PATCH 4/8] m68k: move ColdFire _bootmem_alloc code Greg Ungerer
2016-08-29 11:43 ` [PATCH 5/8] m68k: generalize io memory region setup for ColdFire ACR registers Greg Ungerer
2016-08-29 11:43 ` Greg Ungerer [this message]
2016-08-29 11:43 ` [PATCH 7/8] m68k: only generate FPU instructions of CONFIG_FPU Greg Ungerer
2016-08-29 12:53   ` Geert Uytterhoeven
2016-08-29 23:58     ` Greg Ungerer
2016-08-30  6:26       ` Geert Uytterhoeven
2016-08-30  7:30         ` Greg Ungerer
2016-08-29 11:43 ` [PATCH 8/8] m68k: don't panic if no hardware FPU defined Greg Ungerer

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=1472471004-4580-7-git-send-email-gerg@linux-m68k.org \
    --to=gerg@linux-m68k.org \
    --cc=linux-m68k@vger.kernel.org \
    /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