Date: 	Fri, 17 Jan 1997 13:04:53 +0100 (MEZ)
From: Andreas Bussjaeger <bussjaeg@informatik.tu-muenchen.de>
To: linux-m68k@phil.uni-sb.de
Subject: L68K: Compiling kernel 2.0.28 !!!
Sender: owner-linux-m68k@phil.uni-sb.de
Reply-To: linux-m68k@phil.uni-sb.de

Hy all,

why does nobody compile this source tree BEFORE uploading it on the ftp
sites ???

I found two bugs and I made the patchfiles:

--------------------------- cut ----------------------------------

--- linux-2.0.28/arch/m68k/mm/memory.c.orig	Fri Jan 17 08:50:07 1997
+++ linux-2.0.28/arch/m68k/mm/memory.c	Fri Jan 17 08:55:55 1997
@@ -305,27 +305,39 @@
 
 	if (CPU_IS_030) {
 	    unsigned long ttreg;
-	    unsigned long *ttregptr __asm__( "a2" ) = &ttreg;
 
-	    asm volatile( ".long 0xf0120a00;" /* pmove %/tt0,%a0@ */
-			  : "=g" (ttreg) : "a" (ttregptr) );
+            asm volatile( ".chip 68030\n\t"
+                          "pmove %/tt0,%0@\n\t"
+                          ".chip 68k"
+                          : : "a" (&ttreg) );
+
 	    if (transp_transl_matches( ttreg, vaddr ))
 		return vaddr;
 
-	    asm volatile( ".long 0xf0120a00" /* pmove %/tt1,%a0@ */
-			  : "=g" (ttreg) : "a" (ttregptr) );
+            asm volatile( ".chip 68030\n\t"
+                          "pmove %/tt1,%0@\n\t"
+                          ".chip 68k"
+                          : : "a" (&ttreg) );
+
 	    if (transp_transl_matches( ttreg, vaddr ))
 		return vaddr;
 	}
 	else if (CPU_IS_040_OR_060) {
-	    unsigned long ttreg __asm__( "d0" );
-	    
-	    asm volatile( ".long 0x4e740006" /* movec %dtt0,%d0 */
-			  : "=d" (ttreg) );
+            unsigned long ttreg;
+            	    
+            asm volatile( ".chip 68040\n\t"
+                          "movec %%dtt0,%0\n\t"
+                          ".chip 68k"
+                          : "=d" (ttreg) );
+
 	    if (transp_transl_matches( ttreg, vaddr ))
 		return vaddr;
-	    asm volatile( ".long 0x4e740007" /* movec %dtt1,%d0 */
-			  : "=d" (ttreg) );
+
+            asm volatile( ".chip 68040\n\t"
+                          "movec %%dtt1,%0\n\t"
+                          ".chip 68k"
+                          : "=d" (ttreg) );
+
 	    if (transp_transl_matches( ttreg, vaddr ))
 		return vaddr;
 	}

--------------------------- cut ----------------------------------

and the second:

--------------------------- cut ----------------------------------

--- linux-2.0.28/include/asm-m68k/string.h.orig	Fri Jan 17 10:30:12 1997
+++ linux-2.0.28/include/asm-m68k/string.h	Fri Jan 17 10:30:32 1997
@@ -326,7 +326,9 @@
 	  *((unsigned long *)(s))++ = data;
 
 	  __asm__ __volatile__("1:\t"
+			       ".chip 68040\n\t"
 			       "move16 %2@+,%0@+\n\t"
+			       ".chip 68k\n\t"
 			       "subqw  #8,%2\n\t"
 			       "subqw  #8,%2\n\t"
 			       "dbra   %1,1b\n\t"
@@ -390,8 +392,10 @@
 	  return memcpy(to, from, count);
 
   __asm__ __volatile__("1:\t"
+		       ".chip 68040\n\t"
 		       "move16 %1@+,%0@+\n\t"
 		       "move16 %1@+,%0@+\n\t"
+		       ".chip 68k\n\t"
 		       "dbra  %2,1b\n\t"
 		       : "=a" (to), "=a" (from), "=d" (tmp)
 		       : "0" (to), "1" (from) , "2" (count / 32 - 1)

--------------------------- cut ----------------------------------

Regards,

Andreas Bussjaeger

***********************************************************************
* A2000 / 060 / 50 Mhz / 64 MB / 1,2 GB Quantum FB / 240 MB Quantum   *
* 2,1 GB Quantum / 2 x 1,2 GB IBM / Picasso II / CyberGraphX / MFC-III*
* 2060 Fast SCSI / Supra SCSI / Tandem-AT / 4-Speed Sanyo SCSI-CD-ROM * 
***********************************************************************

