Resent-Date: Mon, 13 Sep 1999 10:19:22 +0200 (MET DST)
To: Roman Zippel <zippel@fh-brandenburg.de>
Cc: Linux/m68k <linux-m68k@lists.linux-m68k.org>
Subject: Re: fpu detection patch
References: <Pine.GSO.3.96.990910191630.17465A-100000@zeus>
X-Yow: He is the MELBA-BEING...  the ANGEL CAKE...
  XEROX him...  XEROX him --
From: Andreas Schwab <schwab@suse.de>
Date: 13 Sep 1999 10:19:09 +0200
In-Reply-To: Roman Zippel's message of "Fri, 10 Sep 1999 19:23:35 +0200 (MET DST)"
User-Agent: Gnus/5.070096 (Pterodactyl Gnus v0.96) Emacs/20.4
Resent-From: linux-m68k@phil.uni-sb.de

Roman Zippel <zippel@fh-brandenburg.de> writes:

|> Hi,
|> 
|> here is a simple fpu detection, the patch is against my current
|> 2.3.16 sources.

IMHO this is more robust, in case you get some weird frame format:

--- linux/arch/m68k/kernel/setup.c.~1~	Mon Sep 13 10:09:27 1999
+++ linux/arch/m68k/kernel/setup.c	Mon Sep 13 10:18:23 1999
@@ -228,14 +228,17 @@
 		vectors[VEC_LINE11] = fpu_check;
 
 		asm volatile (
+			"	movel %%sp,%%a0\n"
+			"	movew %%sr,%%d0\n"
 			"	frestore %0\n"
+			"	nop\n"
 			"	jra 1f\n"
 			SYMBOL_NAME_STR(fpu_check)":\n"
 			"	clrl "SYMBOL_NAME_STR(m68k_fputype)"\n"
-			"	movel #1f,%%sp@(2)\n"
-			"	rte\n"
+			"	movel %%a0,%%sp\n"
+			"	movew %%d0,%%sr\n"
 			"1:"
-			: : "m" (zero) : "memory");
+			: : "m" (zero) : "a0", "d0", "memory");
 
 		vectors[VEC_LINE11] = oldvec;
 	}

Andreas.

-- 
Andreas Schwab                                  "And now for something
schwab@suse.de                                   completely different."
SuSE GmbH, Schanzäckerstr. 10, D-90443 Nürnberg

