Resent-Date: Mon, 15 Feb 1999 00:57:55 +0100 (MET)
To: Jes Sorensen <Jes.Sorensen@cern.ch>
Cc: linux-m68k@lists.linux-m68k.org
Subject: Re: Fix for vfork problem (hopefully)
References: <vyz67956cpc.fsf@issan.cs.uni-dortmund.de> <d3zp6h1bgn.fsf@valhall.cern.ch>
X-Yow: NATHAN...  your PARENTS were in a CARCRASH!!
 They're VOIDED - They COLLAPSED
 They had no CHAINSAWS...  They had no MONEY MACHINES...
 They did PILLS in SKIMPY GRASS SKIRTS...
 Nathan, I EMULATED them...  but they were OFF-KEY...
From: Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
Date: 15 Feb 1999 00:57:50 +0100
In-Reply-To: Jes Sorensen's message of "14 Feb 1999 12:17:12 +0100"
Resent-From: linux-m68k@phil.uni-sb.de

Unfortunately there is a bug in the patch for pgtable.h, here is the
correct one.

Andreas.

--- linux-2.2/include/asm-m68k/pgtable.h.~1~	Sun Jan 17 22:31:26 1999
+++ linux-2.2/include/asm-m68k/pgtable.h	Sat Feb 13 19:07:14 1999
@@ -507,6 +507,7 @@
 	if (tsk == current) {
 		if (CPU_IS_040_OR_060)
 			__asm__ __volatile__ (".chip 68040\n\t"
+					      "pflushan\n\t"
 					      "movec %0,%%urp\n\t"
 					      ".chip 68k"
 					      : : "r" (tsk->tss.crp[1]));
@@ -514,10 +515,22 @@
 			unsigned long tmp;
 			__asm__ __volatile__ ("movec  %%cacr,%0\n\t"
 					      "orw #0x0808,%0\n\t"
-					      "movec %0,%%cacr\n\t"
-					      "pmove %1,%%crp\n\t"
-					      : "=d" (tmp)
-					      : "m" (tsk->tss.crp[0]));
+					      "movec %0,%%cacr"
+					      : "=d" (tmp));
+			/* For a 030-only kernel, avoid flushing the whole
+			   ATC, we only need to flush the user entries.
+			   The 68851 does this by itself.  Avoid a runtime
+			   check here.  */
+			__asm__ __volatile__ (
+#ifdef CPU_M68030_ONLY
+					      ".chip 68030\n\t"
+					      "pmovefd %0,%%crp\n\t"
+					      ".chip 68k\n\t"
+					      "pflush #0,#4"
+#else
+					      "pmove %0,%%crp"
+#endif
+					      : : "m" (tsk->tss.crp[0]));
 		}
 	}
 }

-- 
Andreas Schwab                                      "And now for something
schwab@issan.cs.uni-dortmund.de                      completely different"
schwab@gnu.org

