To: linux-m68k@lists.linux-m68k.org
Subject: L68K: 2.1.77
X-Yow: Boy, am I glad it's only 1971...
From: Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
Date: 12 Jan 1998 10:51:00 +0100
Sender: owner-linux-m68k@phil.uni-sb.de

Hi!

A few things are broken in 2.1.77:

- arch/m68k/atari/config.c: Attempt to improve detection of MICROWIRE
  interface.  Every now and then it fails for unknown reason.
- arch/m68k/atari/stram.c: Properly nest #if/#endif.
- arch/m68k/kernel/ptrace.c, include/asm-m68k/ptrace.h: Implement
  PTRACE_[SG]ET[FP]REGS.
- drivers/block/ataflop.c: Fix warning about redefining MAX_SECTORS.
  Another attempt to fix a race condition.
- drivers/char/atari_SCC.[ch]: Fixed to make it compile again.
- drivers/scsi/scsi_obsolete.c: Backport some m68k changes.
- drivers/video/fbcon-iplan2p[248].c: Make portable.
- fs/minix/namei.c: shrink_dcache_parent now done by VFS.
- include/asm-m68k/bitops.h: Optimize {set,clear,change}_bit with constant
  bit number (b{set,clr,chg} are much faster than bf{set,clr,chg}).
- include/linux/sched.h: An important bug fix from 2.1.78.
- include/linux/swap.h, mm/swapfile.c: swap_list is needed by stram.c.

Andreas.

----------------------------------------------------------------------
--- arch/m68k/atari/config.c.~1~	Fri Jan  9 18:09:48 1998
+++ arch/m68k/atari/config.c	Sat Jan 10 14:44:35 1998
@@ -29,6 +29,7 @@
 #include <linux/mm.h>
 #include <linux/console.h>
 #include <linux/init.h>
+#include <linux/delay.h>
 
 #include <asm/bootinfo.h>
 #include <asm/setup.h>
@@ -469,7 +470,9 @@
 	hwreg_present( &tt_microwire.data ) &&
 	hwreg_present( &tt_microwire.mask ) &&
 	(tt_microwire.mask = 0x7ff,
+	 udelay(1),
 	 tt_microwire.data = MW_LM1992_PSG_HIGH | MW_LM1992_ADDR,
+	 udelay(1),
 	 tt_microwire.data != 0)) {
 	ATARIHW_SET(MICROWIRE);
 	while (tt_microwire.mask != 0x7ff) ;
--- arch/m68k/atari/stram.c.~1~	Fri Jan  9 18:09:50 1998
+++ arch/m68k/atari/stram.c	Sat Jan 10 00:56:08 1998
@@ -152,8 +152,6 @@
 /* set if kernel is in ST-RAM */
 static int kernel_in_stram;
 
-#endif /* CONFIG_STRAM_SWAP */
-
 typedef struct stram_block {
 	struct stram_block *next;
 	unsigned long start;
@@ -212,6 +210,8 @@
 static unsigned stat_swap_move = 0;
 static unsigned stat_swap_force = 0;
 #endif /* DO_PROC */
+
+#endif /* CONFIG_STRAM_SWAP */
 
 /***************************** Prototypes *****************************/
 
--- arch/m68k/config.in.~1~	Fri Jan  9 18:09:52 1998
+++ arch/m68k/config.in	Fri Jan  9 19:06:35 1998
@@ -167,6 +167,7 @@
 bool 'Probe all LUNs on each SCSI device' CONFIG_SCSI_MULTI_LUN
 
 bool 'Verbose SCSI error reporting (kernel size +=12K)' CONFIG_SCSI_CONSTANTS
+bool 'SCSI logging facility' CONFIG_SCSI_LOGGING
 
 mainmenu_option next_comment
 comment 'SCSI low-level drivers'
--- arch/m68k/kernel/ptrace.c.~1~	Wed Dec 17 19:49:08 1997
+++ arch/m68k/kernel/ptrace.c	Sat Dec 20 00:59:44 1997
@@ -23,6 +23,7 @@
 #include <asm/page.h>
 #include <asm/pgtable.h>
 #include <asm/system.h>
+#include <asm/processor.h>
 
 /*
  * does not yet catch signals sent when the child dies.
@@ -505,6 +506,59 @@
 			tmp = get_reg(child, PT_SR) & ~(TRACE_BITS << 16);
 			put_reg(child, PT_SR, tmp);
 			ret = 0;
+			goto out;
+		}
+
+		case PTRACE_GETREGS: { /* Get all gp regs from the child. */
+		  	int i;
+			unsigned long tmp;
+			for (i = 0; i < 19; i++) {
+			    tmp = get_reg(child, i);
+			    if (i == PT_SR)
+				tmp >>= 16;
+			    if (put_user(tmp, (unsigned long *) data)) {
+				ret = -EFAULT;
+				goto out;
+			    }
+			    data += sizeof(long);
+			}
+			ret = 0;
+			goto out;
+		}
+
+		case PTRACE_SETREGS: { /* Set all gp regs in the child. */
+			int i;
+			unsigned long tmp;
+			for (i = 0; i < 19; i++) {
+			    if (get_user(tmp, (unsigned long *) data)) {
+				ret = -EFAULT;
+				goto out;
+			    }
+			    if (i == PT_SR) {
+				tmp &= SR_MASK;
+				tmp <<= 16;
+				tmp |= get_reg(child, PT_SR) & ~(SR_MASK << 16);
+			    }
+			    put_reg(child, i, tmp);
+			    data += sizeof(long);
+			}
+			ret = 0;
+			goto out;
+		}
+
+		case PTRACE_GETFPREGS: { /* Get the child FPU state. */
+			ret = 0;
+			if (copy_to_user((void *)data, &child->tss.fp,
+					 sizeof(struct user_m68kfp_struct)))
+				ret = -EFAULT;
+			goto out;
+		}
+
+		case PTRACE_SETFPREGS: { /* Set the child FPU state. */
+			ret = 0;
+			if (copy_from_user(&child->tss.fp, (void *)data,
+					   sizeof(struct user_m68kfp_struct)))
+				ret = -EFAULT;
 			goto out;
 		}
 
--- drivers/block/ataflop.c.~1~	Fri Jan  9 18:10:30 1998
+++ drivers/block/ataflop.c	Fri Jan  9 19:09:37 1998
@@ -279,7 +279,6 @@
 	15*512, 30*512, 60*512
 };
 
-#define	MAX_SECTORS	(MaxSectors[DriveType])
 #define	BUFFER_SIZE	(BufferSize[DriveType])
 
 unsigned char *DMABuffer;			  /* buffer for writes */
@@ -1003,6 +1002,7 @@
 
 	del_timer( &readtrack_timer );
 
+#if 0
 	if (!MultReadInProgress) {
 		/* This prevents a race condition that could arise if the
 		 * interrupt is triggered while the calling of this timer
@@ -1013,6 +1013,7 @@
 		restore_flags(flags);
 		return;
 	}
+#endif
 
 	/* get the current DMA address */
 	/* ++ f.a. read twice to avoid being fooled by switcher */
@@ -1061,8 +1062,6 @@
 
 	DPRINT(("fd_rwsec_done()\n"));
 
-	STOP_TIMEOUT();
-	
 	if (read_track) {
 		if (!MultReadInProgress)
 			return;
@@ -1070,6 +1069,8 @@
 		MultReadInProgress = 0;
 	}
 
+	STOP_TIMEOUT();
+	
 	/* Correct the track if stretch != 0 */
 	if (SUDT->stretch) {
 		track = FDC_READ( FDCREG_TRACK);
@@ -1154,7 +1155,7 @@
 			if (!ATARIHW_PRESENT( EXTD_DMA ))
 				copy_buffer (addr, ReqData);
 		} else {
-			dma_cache_maintenance( PhysTrackBuffer, MAX_SECTORS * 512, 0 );
+			dma_cache_maintenance( PhysTrackBuffer, MaxSectors[DriveType] * 512, 0 );
 			BufferDrive = SelectedDrive;
 			BufferSide  = ReqSide;
 			BufferTrack = ReqTrack;
--- drivers/char/atari_SCC.c.~1~	Fri Jan  9 19:15:32 1998
+++ drivers/char/atari_SCC.c	Sun Jan 11 09:01:38 1998
@@ -35,7 +35,6 @@
  *    send comments/problems to: itschere@techfak.uni-bielefeld.de
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 
 #include <linux/types.h>
@@ -55,7 +54,7 @@
 #ifdef CONFIG_MVME162_SCC
 #include <asm/mvme16xhw.h>
 #endif
-#ifdef CONFIG_ATARI_SCC
+#ifdef CONFIG_ATARI
 #include <asm/atarihw.h>
 #include <asm/atariints.h>
 #endif
@@ -65,6 +64,10 @@
 #include "atari_SCC.h"
 
 
+#if defined CONFIG_ATARI_SCC || defined CONFIG_ATARI_SCC_MODULE
+#define ENABLE_ATARI_SCC
+#endif
+
 #define	DEBUG_INT	0x01
 #define	DEBUG_INIT	0x02
 #define	DEBUG_THROTTLE	0x04
@@ -143,7 +146,7 @@
  *
  */
 
-#ifdef CONFIG_ATARI_SCC
+#ifdef ENABLE_ATARI_SCC
 /* This table is used if RTxC = 3.672 MHz. This is the case for TT's
  * channel A and for both channels on the Mega STE/Falcon. (TRxC is unused)
  */
@@ -371,7 +374,7 @@
 
 /***************************** Prototypes *****************************/
 
-#ifdef CONFIG_ATARI_SCC
+#ifdef ENABLE_ATARI_SCC
 static void SCC_init_port( struct m68k_async_struct *info, int type, int channel );
 #endif
 #ifdef CONFIG_MVME162_SCC
@@ -384,7 +387,7 @@
 static void SCC_spcond_int (int irq, void *data, struct pt_regs *fp);
 static void SCC_tx_int (int irq, void *data, struct pt_regs *fp);
 static void SCC_stat_int (int irq, void *data, struct pt_regs *fp);
-#ifdef CONFIG_ATARI_SCC
+#ifdef ENABLE_ATARI_SCC
 static void SCC_ri_int (int irq, void *data, struct pt_regs *fp);
 #endif
 static int SCC_check_open( struct m68k_async_struct *info, struct tty_struct
@@ -533,7 +536,7 @@
 
 #endif
 
-#ifdef CONFIG_ATARI_SCC
+#ifdef ENABLE_ATARI_SCC
 
 int atari_SCC_init( void )
 {
@@ -773,7 +776,7 @@
 #ifdef MODULE
 static void SCC_deinit_port( struct m68k_async_struct *info, int channel )
 {
-#ifdef CONFIG_ATARI_SCC
+#ifdef ENABLE_ATARI_SCC
 	if (MACH_IS_ATARI) {
 		free_irq(channel ? IRQ_SCCB_TX : IRQ_SCCA_TX, info);
 		free_irq(channel ? IRQ_SCCB_STAT : IRQ_SCCA_STAT, info);
@@ -1302,7 +1305,7 @@
 }
 
 
-#ifdef CONFIG_ATARI_SCC
+#ifdef ENABLE_ATARI_SCC
 static void SCC_ri_int(int irq, void *data, struct pt_regs *fp)
 {
 	struct m68k_async_struct *info = data;
@@ -1419,7 +1422,7 @@
 		SCC_chan_a_open = 1;
 		SCC_chan_a_line = info->line;
 		SCC_chan_a_info = &rs_table[info->line];
-#ifdef CONFIG_ATARI_SCC
+#ifdef ENABLE_ATARI_SCC
 		if (SCC_chan_a_switchable == SCCA_SWITCH_BOTH) {
 			unsigned long flags; 
 			unsigned char tmp;
@@ -1449,7 +1452,7 @@
 	int i, channel = CHANNR(info);
 	unsigned long	flags;
 	SCC_ACCESS_INIT(info);
-#ifdef CONFIG_ATARI_SCC
+#ifdef ENABLE_ATARI_SCC
 	static const struct {
 		unsigned reg, val;
 	} init_tab[] = {
@@ -1555,7 +1558,7 @@
 		udelay(40); /* extra delay after a reset */
 	}
 
-#ifdef CONFIG_ATARI_SCC
+#ifdef ENABLE_ATARI_SCC
 	if (MACH_IS_ATARI) {
 #ifdef CONFIG_ATARI_SCC_DMA
 		if (channel == CHANNEL_A && scca_dma) {
@@ -1994,7 +1997,7 @@
 		ri = 0;
 		dsr = sr & SR_SYNC_ABORT ? TIOCM_DSR : 0;
 	}
-#ifdef CONFIG_ATARI_SCC
+#ifdef ENABLE_ATARI_SCC
 	if (MACH_IS_ATARI) {
 		if (CHANNR (info) == 0)
 			ri = 0;
@@ -2158,7 +2161,7 @@
 	  case TIOCDATSCC:
 
 		if (!suser()) return( -EPERM );
-#ifdef CONFIG_ATARI_SCC
+#ifdef ENABLE_ATARI_SCC
 		if (ATARIHW_PRESENT(TT_MFP)) {
 			SCC_clocks[channel][CLK_RTxC] =
 				(channel == CHANNEL_A) ?
--- drivers/char/atari_SCC.h.~1~	Fri Jan  9 18:11:11 1998
+++ drivers/char/atari_SCC.h	Sun Jan 11 09:01:32 1998
@@ -13,10 +13,11 @@
 #ifndef _ATARI_SCC_H
 #define _ATARI_SCC_H
 
+#include <linux/delay.h>
 #ifdef CONFIG_MVME162_SCC
 #include <asm/mvme16xhw.h>
 #endif
-#ifdef CONFIG_ATARI_SCC
+#ifdef CONFIG_ATARI
 #include <asm/atarihw.h>
 #endif
 
@@ -358,10 +359,12 @@
  */
 
 #define scc_reg_delay() \
+    do {			\
 	if (MACH_IS_MVME16x)	\
 		udelay(1);	\
 	else			\
-		__asm__ __volatile__ ( "tstb %0" : : "g" (*_scc_del) : "cc" );
+		__asm__ __volatile__ ( "tstb %0" : : "g" (*_scc_del) : "cc" );\
+    } while (0)
 
 /* Another version with only 3 nop's for cases when some other
  * statement intervenes between the two SCC accesses
--- drivers/scsi/scsi_obsolete.c.~1~	Fri Jan  9 18:13:08 1998
+++ drivers/scsi/scsi_obsolete.c	Tue Dec 23 00:21:47 1997
@@ -87,7 +87,7 @@
 static int scsi_reset (Scsi_Cmnd *, unsigned int);
 
 extern void scsi_old_done (Scsi_Cmnd *SCpnt);
-static int update_timeout (Scsi_Cmnd *, int);
+int update_timeout (Scsi_Cmnd *, int);
 extern void scsi_old_times_out (Scsi_Cmnd * SCpnt);
 extern void internal_cmnd (Scsi_Cmnd * SCpnt);
 
@@ -182,7 +182,8 @@
         scsi_reset (SCpnt,
 		    SCSI_RESET_ASYNCHRONOUS | SCSI_RESET_SUGGEST_BUS_RESET);
         return;
-    case (IN_ABORT | IN_RESET | IN_RESET2):
+    case IN_RESET2:
+    case (IN_ABORT | IN_RESET2):
 	/* Obviously the bus reset didn't work.
 	 * Let's try even harder and call for an HBA reset.
          * Maybe the HBA itself crashed and this will shake it loose.
@@ -1080,7 +1081,7 @@
  * set the timer, we want to take this value into account.
  */
 
-static int update_timeout(Scsi_Cmnd * SCset, int timeout)
+int update_timeout(Scsi_Cmnd * SCset, int timeout)
 {
   int	rtn;
 
--- drivers/video/fbcon-iplan2p2.c.~1~	Fri Sep 26 19:15:01 1997
+++ drivers/video/fbcon-iplan2p2.c	Sat Jan 10 16:40:10 1998
@@ -17,12 +17,9 @@
 #include <linux/config.h>
 #include <linux/fb.h>
 
-#include "fbcon.h"
-
+#include <asm/byteorder.h>
 
-#ifndef __mc68000__
-#error No support for non-m68k yet
-#endif
+#include "fbcon.h"
 
 
     /*
@@ -66,8 +63,19 @@
      *  The intensity bit (b3) is shifted into b1.
      */
 
-#define	COLOR_2P(c)	(((c & 7) >= 3 && (c & 7) != 4) | (c & 8) >> 2)
+static const u8 color_2p[] = { 0, 0, 0, 1, 0, 1, 1, 1, 2, 2, 2, 3, 2, 3, 3, 3 };
+#define	COLOR_2P(c)	color_2p[c]
 
+/* Perform the m68k movepw operation.  */
+static inline void movepw(u8 *d, u16 val)
+{
+#if defined __mc68000__ && !defined CONFIG_OPTIMIZE_060
+    asm volatile ("movepw %1,%0@(0)" : : "a" (d), "d" (val));
+#else
+    d[0] = (val >> 16) & 0xff;
+    d[2] = val & 0xff;
+#endif
+}
 
 /* Sets the bytes in the visible column at d, height h, to the value
  * val for a 2 plane screen. The the bis of the color in 'color' are
@@ -78,16 +86,13 @@
  *   *(d+2) = (color & 2) ? 0xff : 0;
  */
 
-static __inline__ void memclear_2p_col(void *d, size_t h, u_short val, int bpr)
+static __inline__ void memclear_2p_col(void *d, size_t h, u16 val, int bpr)
 {
-#ifdef __mc68000__
-    __asm__ __volatile__ ("1: movepw %4,%0@(0)\n\t"
-			  "addal  %5,%0\n\t"
-			  "dbra	  %1,1b"
-			  : "=a" (d), "=d" (h)
-			  : "0" (d), "1" (h - 1), "d" (val), "r" (bpr));
-#else /* !m68k */
-#endif /* !m68k */
+    u8 *dd = d;
+    do {
+	movepw(dd, val);
+	dd += bpr;
+    } while (--h);
 }
 
 /* Sets a 2 plane region from 'd', length 'count' bytes, to the color
@@ -99,9 +104,9 @@
  *   *(d+2) = *(d+3) = (color & 2) ? 0xff : 0;
  */
 
-static __inline__ void memset_even_2p(void *d, size_t count, u_long val)
+static __inline__ void memset_even_2p(void *d, size_t count, u32 val)
 {
-    u_long *dd = d;
+    u32 *dd = d;
 
     count /= 4;
     while (count--)
@@ -112,7 +117,7 @@
 
 static __inline__ void memmove_2p_col (void *d, void *s, int h, int bpr)
 {
-    u_char *dd = d, *ss = s;
+    u8 *dd = d, *ss = s;
 
     while (h--) {
 	dd[0] = ss[0];
@@ -125,59 +130,44 @@
 
 /* This expands a 2 bit color into a short for movepw (2 plane) operations. */
 
-static __inline__ u_short expand2w(u_char c)
+static const u16 two2byte[] =
 {
-    u_short	rv;
+    0x0000, 0xff00, 0x00ff, 0xffff
+};
 
-#ifdef __mc68000__
-    __asm__ __volatile__ ("lsrb	 #1,%2\n\t"
-			  "scs	 %0\n\t"
-			  "lsll	 #8,%0\n\t"
-			  "lsrb	 #1,%2\n\t"
-			  "scs	 %0\n\t"
-			  : "=&d" (rv), "=d" (c)
-			  : "1" (c));
-#endif /* !m68k */
-    return(rv);
+static __inline__ u16 expand2w(u8 c)
+{
+    return two2byte[c];
 }
 
 /* This expands a 2 bit color into one long for a movel operation
  * (2 planes).
  */
 
-static __inline__ u_long expand2l(u_char c)
+static const u32 two2word[] =
 {
-    u_long	rv;
+#ifndef __LITTLE_ENDIAN
+    0x00000000, 0xffff0000, 0x0000ffff, 0xffffffff
+#else
+    0x00000000, 0x0000ffff, 0xffff0000, 0xffffffff
+#endif
+};
 
-#ifdef __mc68000__
-    __asm__ __volatile__ ("lsrb	 #1,%2\n\t"
-			  "scs	 %0\n\t"
-			  "extw	 %0\n\t"
-			  "swap	 %0\n\t"
-			  "lsrb	 #1,%2\n\t"
-			  "scs	 %0\n\t"
-			  "extw	 %0\n\t"
-			  : "=&d" (rv), "=d" (c)
-			  : "1" (c));
-#endif /* !m68k */
-    return rv;
+static __inline__ u32 expand2l(u8 c)
+{
+    return two2word[c];
 }
 
 
 /* This duplicates a byte 2 times into a short. */
 
-static __inline__ u_short dup2w(u_char c)
+static __inline__ u16 dup2w(u8 c)
 {
-    ushort  rv;
+    u16 rv;
 
-#ifdef __mc68000__
-    __asm__ __volatile__ ("moveb  %1,%0\n\t"
-			  "lslw   #8,%0\n\t"
-			  "moveb  %1,%0\n\t"
-			  : "=&d" (rv)
-			  : "d" (c));
-#endif /* !m68k */
-    return( rv );
+    rv = c;
+    rv |= c << 8;
+    return rv;
 }
 
 
@@ -213,7 +203,7 @@
      *  all movements by memmove_col().
      */
 
-    if (sx == 0 && dx == 0 && width == p->next_line/2) {
+    if (sx == 0 && dx == 0 && width * 2 == p->next_line) {
 	/*  Special (but often used) case: Moving whole lines can be
 	 *  done with memmove()
 	 */
@@ -222,8 +212,8 @@
 		  p->next_line * height * p->fontheight);
     } else {
 	int rows, cols;
-	u_char *src;
-	u_char *dst;
+	u8 *src;
+	u8 *dst;
 	int bytes = p->next_line;
 	int linesize = bytes * p->fontheight;
 	u_int colsize  = height * p->fontheight;
@@ -302,18 +292,18 @@
 static void clear_iplan2p2(struct vc_data *conp, struct display *p, int sy,
 			   int sx, int height, int width)
 {
-    ulong offset;
-    u_char *start;
+    u32 offset;
+    u8 *start;
     int rows;
     int bytes = p->next_line;
     int lines = height * p->fontheight;
-    ulong size;
-    u_long cval;
-    u_short pcval;
+    u32 size;
+    u32 cval;
+    u16 pcval;
 
     cval = expand2l (COLOR_2P (attr_bgcol_ec(p,conp)));
 
-    if (sx == 0 && width == bytes/2) {
+    if (sx == 0 && width * 2 == bytes) {
 	offset = sy * bytes * p->fontheight;
 	size = lines * bytes;
 	memset_even_2p(p->screen_base+offset, size, cval);
@@ -348,11 +338,11 @@
 static void putc_iplan2p2(struct vc_data *conp, struct display *p, int c,
 			  int yy, int xx)
 {
-    u_char *dest;
-    u_char *cdat;
+    u8 *dest;
+    u8 *cdat;
     int rows;
     int bytes = p->next_line;
-    ulong eorx, fgx, bgx, fdx;
+    u16 eorx, fgx, bgx, fdx;
 
     c &= 0xff;
 
@@ -365,22 +355,18 @@
 
     for (rows = p->fontheight ; rows-- ; dest += bytes) {
 	fdx = dup2w(*cdat++);
-#ifdef __mc68000__
-	__asm__ __volatile__ ("movepw %1,%0@(0)"
-			      : /* no outputs */
-			      : "a" (dest), "d" ((fdx & eorx) ^ bgx));
-#endif /* !m68k */
+	movepw(dest, (fdx & eorx) ^ bgx);
     }
 }
 
 static void putcs_iplan2p2(struct vc_data *conp, struct display *p,
 			   const char *s, int count, int yy, int xx)
 {
-    u_char *dest, *dest0;
-    u_char *cdat, c;
+    u8 *dest, *dest0;
+    u8 *cdat, c;
     int rows;
     int bytes;
-    ulong eorx, fgx, bgx, fdx;
+    u16 eorx, fgx, bgx, fdx;
 
     bytes = p->next_line;
     dest0 = p->screen_base + yy * p->fontheight * bytes + (xx>>1)*4 + (xx & 1);
@@ -394,11 +380,7 @@
 
 	for (rows = p->fontheight, dest = dest0; rows-- ; dest += bytes) {
 	    fdx = dup2w(*cdat++);
-#ifdef __mc68000__
-	    __asm__ __volatile__ ("movepw %1,%0@(0)"
-				  : /* no outputs */
-				  : "a" (dest), "d" ((fdx & eorx) ^ bgx));
-#endif /* !m68k */
+	    movepw(dest, (fdx & eorx) ^ bgx);
 	}
 	INC_2P(dest0);
     }
@@ -406,7 +388,7 @@
 
 static void rev_char_iplan2p2(struct display *p, int xx, int yy)
 {
-    u_char *dest;
+    u8 *dest;
     int j;
     int bytes;
 
--- drivers/video/fbcon-iplan2p4.c.~1~	Fri Sep 26 19:15:12 1997
+++ drivers/video/fbcon-iplan2p4.c	Sat Jan 10 16:31:09 1998
@@ -17,12 +17,9 @@
 #include <linux/config.h>
 #include <linux/fb.h>
 
-#include "fbcon.h"
-
+#include <asm/byteorder.h>
 
-#ifndef __mc68000__
-#error No support for non-m68k yet
-#endif
+#include "fbcon.h"
 
 
     /*
@@ -61,6 +58,18 @@
 #define	INC_4P(p)	do { if (!((long)(++(p)) & 1)) (p) += 6; } while(0)
 #define	DEC_4P(p)	do { if ((long)(--(p)) & 1) (p) -= 6; } while(0)
 
+/* Perform the m68k movepl operation.  */
+static inline void movepl(u8 *d, u32 val)
+{
+#if defined __mc68000__ && !defined CONFIG_OPTIMIZE_060
+    asm volatile ("movepl %1,%0@(0)" : : "a" (d), "d" (val));
+#else
+    d[0] = (val >> 24) & 0xff;
+    d[2] = (val >> 16) & 0xff;
+    d[4] = (val >> 8) & 0xff;
+    d[6] = val & 0xff;
+#endif
+}
 
 /* Sets the bytes in the visible column at d, height h, to the value
  * val for a 4 plane screen. The the bis of the color in 'color' are
@@ -73,15 +82,13 @@
  *   *(d+6) = (color & 8) ? 0xff : 0;
  */
 
-static __inline__ void memclear_4p_col(void *d, size_t h, u_long val, int bpr)
+static __inline__ void memclear_4p_col(void *d, size_t h, u32 val, int bpr)
 {
-#ifdef __mc68000__
-    __asm__ __volatile__ ("1: movepl %4,%0@(0)\n\t"
-			  "addal  %5,%0\n\t"
-			  "dbra	  %1,1b"
-			  : "=a" (d), "=d" (h)
-			  : "0" (d), "1" (h - 1), "d" (val), "r" (bpr));
-#endif /* !m68k */
+    u8 *dd = d;
+    do {
+	movepl(dd, val);
+	dd += bpr;
+    } while (--h);
 }
 
 /* Sets a 4 plane region from 'd', length 'count' bytes, to the color
@@ -95,10 +102,10 @@
  *   *(d+6) = *(d+7) = (color & 8) ? 0xff : 0;
  */
 
-static __inline__ void memset_even_4p(void *d, size_t count, u_long val1,
-                                      u_long val2)
+static __inline__ void memset_even_4p(void *d, size_t count, u32 val1,
+                                      u32 val2)
 {
-    u_long *dd = d;
+    u32 *dd = d;
 
     count /= 8;
     while (count--) {
@@ -111,7 +118,7 @@
 
 static __inline__ void memmove_4p_col (void *d, void *s, int h, int bpr)
 {
-    u_char *dd = d, *ss = s;
+    u8 *dd = d, *ss = s;
 
     while (h--) {
 	dd[0] = ss[0];
@@ -126,77 +133,49 @@
 
 /* This expands a 4 bit color into a long for movepl (4 plane) operations. */
 
-static __inline__ u_long expand4l(u_char c)
+static const u32 four2byte[] =
 {
-    u_long rv;
+    0x00000000, 0xff000000, 0x00ff0000, 0xffff0000,
+    0x0000ff00, 0xff00ff00, 0x00ffff00, 0xffffff00,
+    0x000000ff, 0xff0000ff, 0x00ff00ff, 0xffff00ff,
+    0x0000ffff, 0xff00ffff, 0x00ffffff, 0xffffffff
+};
 
-#ifdef __mc68000__
-    __asm__ __volatile__ ("lsrb	 #1,%2\n\t"
-			  "scs	 %0\n\t"
-			  "lsll	 #8,%0\n\t"
-			  "lsrb	 #1,%2\n\t"
-			  "scs	 %0\n\t"
-			  "lsll	 #8,%0\n\t"
-			  "lsrb	 #1,%2\n\t"
-			  "scs	 %0\n\t"
-			  "lsll	 #8,%0\n\t"
-			  "lsrb	 #1,%2\n\t"
-			  "scs	 %0\n\t"
-			  : "=&d" (rv), "=d" (c)
-			  : "1" (c));
-#endif /* !m68k */
-    return(rv);
+static __inline__ u32 expand4l(u8 c)
+{
+    return four2byte[c];
 }
 
 /* This expands a 4 bit color into two longs for two movel operations
  * (4 planes).
  */
 
-static __inline__ void expand4dl(u_char c, u_long *ret1, u_long *ret2)
+static const u32 two2word[] =
 {
-    u_long	rv1, rv2;
+#ifndef __LITTLE_ENDIAN
+    0x00000000, 0xffff0000, 0x0000ffff, 0xffffffff,
+#else
+    0x00000000, 0x0000ffff, 0xffff0000, 0xffffffff,
+#endif
+};
 
-#ifdef __mc68000__
-    __asm__ __volatile__ ("lsrb	 #1,%3\n\t"
-			  "scs	 %0\n\t"
-			  "extw	 %0\n\t"
-			  "swap	 %0\n\t"
-			  "lsrb	 #1,%3\n\t"
-			  "scs	 %0\n\t"
-			  "extw	 %0\n\t"
-			  "lsrb	 #1,%3\n\t"
-			  "scs	 %1\n\t"
-			  "extw	 %1\n\t"
-			  "swap	 %1\n\t"
-			  "lsrb	 #1,%3\n\t"
-			  "scs   %1\n\t"
-			  "extw	 %1"
-			  : "=&d" (rv1), "=&d" (rv2), "=d" (c)
-			  : "2" (c));
-#endif /* !m68k */
-    *ret1 = rv1;
-    *ret2 = rv2;
+static __inline__ void expand4dl(u8 c, u32 *ret1, u32 *ret2)
+{
+    *ret1 = two2word[c & 3];
+    *ret2 = two2word[c >> 2];
 }
 
 
 /* This duplicates a byte 4 times into a long. */
 
-static __inline__ u_long dup4l(u_char c)
+static __inline__ u32 dup4l(u8 c)
 {
-    ushort	tmp;
-    ulong	rv;
+    u32 rv;
 
-#ifdef __mc68000__
-    __asm__ __volatile__ ("moveb  %2,%0\n\t"
-			  "lslw   #8,%0\n\t"
-			  "moveb  %2,%0\n\t"
-			  "movew  %0,%1\n\t"
-			  "swap   %0\n\t"
-			  "movew  %1,%0"
-			  : "=&d" (rv), "=d" (tmp)
-			  : "d" (c));
-#endif /* !m68k */
-    return(rv);
+    rv = c;
+    rv |= rv << 8;
+    rv |= rv << 16;
+    return rv;
 }
 
 
@@ -232,7 +211,7 @@
      *  all movements by memmove_col().
      */
 
-    if (sx == 0 && dx == 0 && width == p->next_line/4) {
+    if (sx == 0 && dx == 0 && width * 4 == p->next_line) {
 	/*  Special (but often used) case: Moving whole lines can be
 	 *done with memmove()
 	 */
@@ -241,8 +220,8 @@
 		  p->next_line * height * p->fontheight);
     } else {
 	int rows, cols;
-	u_char *src;
-	u_char *dst;
+	u8 *src;
+	u8 *dst;
 	int bytes = p->next_line;
 	int linesize = bytes * p->fontheight;
 	u_int colsize  = height * p->fontheight;
@@ -324,17 +303,17 @@
 static void clear_iplan2p4(struct vc_data *conp, struct display *p, int sy,
 			   int sx, int height, int width)
 {
-    ulong offset;
-    u_char *start;
+    u32 offset;
+    u8 *start;
     int rows;
     int bytes = p->next_line;
     int lines = height * p->fontheight;
-    ulong size;
-    u_long cval1, cval2, pcval;
+    u32 size;
+    u32 cval1, cval2, pcval;
 
     expand4dl(attr_bgcol_ec(p,conp), &cval1, &cval2);
 
-    if (sx == 0 && width == bytes/4) {
+    if (sx == 0 && width * 4 == bytes) {
 	offset = sy * bytes * p->fontheight;
 	size = lines * bytes;
 	memset_even_4p(p->screen_base+offset, size, cval1, cval2);
@@ -369,11 +348,11 @@
 static void putc_iplan2p4(struct vc_data *conp, struct display *p, int c,
 			  int yy, int xx)
 {
-    u_char *dest;
-    u_char *cdat;
+    u8 *dest;
+    u8 *cdat;
     int rows;
     int bytes = p->next_line;
-    ulong eorx, fgx, bgx, fdx;
+    u32 eorx, fgx, bgx, fdx;
 
     c &= 0xff;
 
@@ -386,22 +365,18 @@
 
     for(rows = p->fontheight ; rows-- ; dest += bytes) {
 	fdx = dup4l(*cdat++);
-#ifdef __mc68000__
-	__asm__ __volatile__ ("movepl %1,%0@(0)"
-			      : /* no outputs */
-			      : "a" (dest), "d" ((fdx & eorx) ^ bgx));
-#endif /* !m68k */
+	movepl(dest, (fdx & eorx) ^ bgx);
     }
 }
 
 static void putcs_iplan2p4(struct vc_data *conp, struct display *p,
 			   const char *s, int count, int yy, int xx)
 {
-    u_char *dest, *dest0;
-    u_char *cdat, c;
+    u8 *dest, *dest0;
+    u8 *cdat, c;
     int rows;
     int bytes;
-    ulong eorx, fgx, bgx, fdx;
+    u32 eorx, fgx, bgx, fdx;
 
     bytes = p->next_line;
     dest0 = p->screen_base + yy * p->fontheight * bytes + (xx>>1)*8 + (xx & 1);
@@ -422,11 +397,7 @@
 
 	for(rows = p->fontheight, dest = dest0; rows-- ; dest += bytes) {
 	    fdx = dup4l(*cdat++);
-#ifdef __mc68000__
-	    __asm__ __volatile__ ("movepl %1,%0@(0)"
-				  : /* no outputs */
-				  : "a" (dest), "d" ((fdx & eorx) ^ bgx));
-#endif /* !m68k */
+	    movepl(dest, (fdx & eorx) ^ bgx);
 	}
 	INC_4P(dest0);
     }
@@ -434,7 +405,7 @@
 
 static void rev_char_iplan2p4(struct display *p, int xx, int yy)
 {
-    u_char *dest;
+    u8 *dest;
     int j;
     int bytes;
 
--- drivers/video/fbcon-iplan2p8.c.~1~	Fri Sep 26 19:15:23 1997
+++ drivers/video/fbcon-iplan2p8.c	Sat Jan 10 16:31:49 1998
@@ -17,12 +17,9 @@
 #include <linux/config.h>
 #include <linux/fb.h>
 
-#include "fbcon.h"
-
+#include <asm/byteorder.h>
 
-#ifndef __mc68000__
-#error No support for non-m68k yet
-#endif
+#include "fbcon.h"
 
 
     /*
@@ -66,9 +63,26 @@
 #define	INC_8P(p)	do { if (!((long)(++(p)) & 1)) (p) += 14; } while(0)
 #define	DEC_8P(p)	do { if ((long)(--(p)) & 1) (p) -= 14; } while(0)
 
+/* Perform the m68k movepl operation extended to 64 bits.  */
+static inline void movepl2(u8 *d, u32 val1, u32 val2)
+{
+#if defined __mc68000__ && !defined CONFIG_OPTIMIZE_060
+    asm volatile ("movepl %1,%0@(0); movepl %2,%0@(8)"
+		  : : "a" (d), "d" (val1), "d" (val2));
+#else
+    d[0] = (val1 >> 24) & 0xff;
+    d[2] = (val1 >> 16) & 0xff;
+    d[4] = (val1 >> 8) & 0xff;
+    d[6] = val1 & 0xff;
+    d[8] = (val2 >> 24) & 0xff;
+    d[10] = (val2 >> 16) & 0xff;
+    d[12] = (val2 >> 8) & 0xff;
+    d[14] = val2 & 0xff;
+#endif
+}
 
 /* Sets the bytes in the visible column at d, height h, to the value
- * val1,val2 for a 8 plane screen. The the bis of the color in 'color' are
+ * val1,val2 for a 8 plane screen. The bits of the color in 'color' are
  * moved (8 times) to the respective bytes. This means:
  *
  * for(h times; d += bpr)
@@ -82,18 +96,14 @@
  *   *(d+14) = (color & 128) ? 0xff : 0;
  */
 
-static __inline__ void memclear_8p_col(void *d, size_t h, u_long val1,
-                                       u_long val2, int bpr)
+static __inline__ void memclear_8p_col(void *d, size_t h, u32 val1,
+                                       u32 val2, int bpr)
 {
-#ifdef __mc68000__
-    __asm__ __volatile__ ("1: movepl %4,%0@(0)\n\t"
-			  "movepl %5,%0@(8)\n\t"
-			  "addal  %6,%0\n\t"
-			  "dbra	  %1,1b"
-			  : "=a" (d), "=d" (h)
-			  : "0" (d), "1" (h - 1), "d" (val1), "d" (val2),
-			    "r" (bpr));
-#endif /* !m68k */
+    u8 *dd = d;
+    do {
+	movepl2(dd, val1, val2);
+	dd += bpr;
+    } while (--h);
 }
 
 /* Sets a 8 plane region from 'd', length 'count' bytes, to the color
@@ -111,10 +121,10 @@
  *   *(d+14) = *(d+15) = (color & 128) ? 0xff : 0;
  */
 
-static __inline__ void memset_even_8p(void *d, size_t count, u_long val1,
-                                      u_long val2, u_long val3, u_long val4)
+static __inline__ void memset_even_8p(void *d, size_t count, u32 val1,
+                                      u32 val2, u32 val3, u32 val4)
 {
-    u_long *dd = d;
+    u32 *dd = d;
 
     count /= 16;
     while (count--) {
@@ -129,7 +139,7 @@
 
 static __inline__ void memmove_8p_col (void *d, void *s, int h, int bpr)
 {
-    u_char *dd = d, *ss = s;
+    u8 *dd = d, *ss = s;
 
     while (h--) {
 	dd[0] = ss[0];
@@ -150,102 +160,51 @@
  * operations.
  */
 
-static __inline__ void expand8dl(u_char c, u_long *ret1, u_long *ret2)
+static const u32 four2long[] =
 {
-    u_long	rv1, rv2;
+    0x00000000, 0xff000000, 0x00ff0000, 0xffff0000,
+    0x0000ff00, 0xff00ff00, 0x00ffff00, 0xffffff00,
+    0x000000ff, 0xff0000ff, 0x00ff00ff, 0xffff00ff,
+    0x0000ffff, 0xff00ffff, 0x00ffffff, 0xffffffff,
+};
 
-#ifdef __mc68000__
-    __asm__ __volatile__ ("lsrb	 #1,%3\n\t"
-			  "scs	 %0\n\t"
-			  "lsll	 #8,%0\n\t"
-			  "lsrb	 #1,%3\n\t"
-			  "scs	 %0\n\t"
-			  "lsll	 #8,%0\n\t"
-			  "lsrb	 #1,%3\n\t"
-			  "scs	 %0\n\t"
-			  "lsll	 #8,%0\n\t"
-			  "lsrb	 #1,%3\n\t"
-			  "scs	 %0\n\t"
-			  "lsrb	 #1,%3\n\t"
-			  "scs	 %1\n\t"
-			  "lsll	 #8,%1\n\t"
-			  "lsrb	 #1,%3\n\t"
-			  "scs	 %1\n\t"
-			  "lsll	 #8,%1\n\t"
-			  "lsrb	 #1,%3\n\t"
-			  "scs	 %1\n\t"
-			  "lsll	 #8,%1\n\t"
-			  "lsrb	 #1,%3\n\t"
-			  "scs	 %1"
-			  : "=&d" (rv1), "=&d" (rv2),"=d" (c)
-			  : "2" (c));
-#endif /* !m68k */
-    *ret1 = rv1;
-    *ret2 = rv2;
+static __inline__ void expand8dl(u8 c, u32 *ret1, u32 *ret2)
+{
+    *ret1 = four2long[c & 15];
+    *ret2 = four2long[c >> 4];
 }
 
 /* This expands a 8 bit color into four longs for four movel operations
  * (8 planes).
  */
 
-#ifdef __mc68000__
-/* ++andreas: use macro to avoid taking address of return values */
-#define expand8ql(c, rv1, rv2, rv3, rv4) \
-    do {								\
-	u_char tmp = c;							\
-	__asm__ __volatile__ ("lsrb  #1,%5\n\t"				\
-			      "scs   %0\n\t"				\
-			      "extw  %0\n\t"				\
-			      "swap  %0\n\t"				\
-			      "lsrb  #1,%5\n\t"				\
-			      "scs   %0\n\t"				\
-			      "extw  %0\n\t"				\
-			      "lsrb  #1,%5\n\t"				\
-			      "scs   %1\n\t"				\
-			      "extw  %1\n\t"				\
-			      "swap  %1\n\t"				\
-			      "lsrb  #1,%5\n\t"				\
-			      "scs   %1\n\t"				\
-			      "extw  %1\n\t"				\
-			      "lsrb  #1,%5\n\t"				\
-			      "scs   %2\n\t"				\
-			      "extw  %2\n\t"				\
-			      "swap  %2\n\t"				\
-			      "lsrb  #1,%5\n\t"				\
-			      "scs   %2\n\t"				\
-			      "extw  %2\n\t"				\
-			      "lsrb  #1,%5\n\t"				\
-			      "scs   %3\n\t"				\
-			      "extw  %3\n\t"				\
-			      "swap  %3\n\t"				\
-			      "lsrb  #1,%5\n\t"				\
-			      "scs   %3\n\t"				\
-			      "extw  %3"				\
-			      : "=&d" (rv1), "=&d" (rv2), "=&d" (rv3),	\
-				"=&d" (rv4), "=d" (tmp)			\
-			      : "4" (tmp));				\
-    } while (0)
-#endif /* !m68k */
+static const u32 two2word[] =
+{
+#ifndef __LITTLE_ENDIAN
+    0x00000000, 0xffff0000, 0x0000ffff, 0xffffffff
+#else
+    0x00000000, 0x0000ffff, 0xffff0000, 0xffffffff
+#endif
+};
 
+static inline void expand8ql(u8 c, u32 *rv1, u32 *rv2, u32 *rv3, u32 *rv4)
+{
+    *rv1 = two2word[c & 4];
+    *rv2 = two2word[(c >> 2) & 4];
+    *rv3 = two2word[(c >> 4) & 4];
+    *rv4 = two2word[c >> 6];
+}
 
 /* This duplicates a byte 4 times into a long. */
 
-static __inline__ u_long dup4l(u_char c)
+static __inline__ u32 dup4l(u8 c)
 {
-    ushort	tmp;
-    ulong	rv;
+    u32 rv;
 
-#ifdef __mc68000__
-    __asm__ __volatile__ ("moveb  %2,%0\n\t"
-			  "lslw   #8,%0\n\t"
-			  "moveb  %2,%0\n\t"
-			  "movew  %0,%1\n\t"
-			  "swap   %0\n\t"
-			  "movew  %1,%0"
-			  : "=&d" (rv), "=d" (tmp)
-			  : "d" (c));
-#endif /* !m68k */
-    return(rv);
+    rv = c;
+    rv |= rv << 8;
+    rv |= rv << 16;
+    return rv;
 }
 
 
@@ -281,7 +240,7 @@
      *  all movements by memmove_col().
      */
 
-     if (sx == 0 && dx == 0 && width == p->next_line/8) {
+     if (sx == 0 && dx == 0 && width * 8 == p->next_line) {
 	/*  Special (but often used) case: Moving whole lines can be
 	 *  done with memmove()
 	 */
@@ -290,8 +249,8 @@
 		     p->next_line * height * p->fontheight);
      } else {
 	int rows, cols;
-	u_char *src;
-	u_char *dst;
+	u8 *src;
+	u8 *dst;
 	int bytes = p->next_line;
 	int linesize = bytes * p->fontheight;
 	u_int colsize = height * p->fontheight;
@@ -373,17 +332,17 @@
 static void clear_iplan2p8(struct vc_data *conp, struct display *p, int sy,
 			   int sx, int height, int width)
 {
-    ulong offset;
-    u_char *start;
+    u32 offset;
+    u8 *start;
     int rows;
     int bytes = p->next_line;
     int lines = height * p->fontheight;
-    ulong size;
-    u_long cval1, cval2, cval3, cval4, pcval1, pcval2;
+    u32 size;
+    u32 cval1, cval2, cval3, cval4, pcval1, pcval2;
 
-    expand8ql(attr_bgcol_ec(p,conp), cval1, cval2, cval3, cval4);
+    expand8ql(attr_bgcol_ec(p,conp), &cval1, &cval2, &cval3, &cval4);
 
-    if (sx == 0 && width == bytes/8) {
+    if (sx == 0 && width * 8 == bytes) {
 	offset = sy * bytes * p->fontheight;
 	size    = lines * bytes;
 	memset_even_8p(p->screen_base+offset, size, cval1, cval2, cval3, cval4);
@@ -418,11 +377,11 @@
 static void putc_iplan2p8(struct vc_data *conp, struct display *p, int c,
 			  int yy, int xx)
 {
-    u_char *dest;
-    u_char *cdat;
+    u8 *dest;
+    u8 *cdat;
     int rows;
     int bytes = p->next_line;
-    ulong eorx1, eorx2, fgx1, fgx2, bgx1, bgx2, fdx;
+    u32 eorx1, eorx2, fgx1, fgx2, bgx1, bgx2, fdx;
 
     c &= 0xff;
 
@@ -435,24 +394,18 @@
 
     for(rows = p->fontheight ; rows-- ; dest += bytes) {
 	fdx = dup4l(*cdat++);
-#ifdef __mc68000__
-	__asm__ __volatile__ ("movepl %1,%0@(0)\n\t"
-			      "movepl %2,%0@(8)"
-			      : /* no outputs */
-			      : "a" (dest), "d" ((fdx & eorx1) ^ bgx1),
-				"d" ((fdx & eorx2) ^ bgx2) );
-#endif /* !m68k */
+	movepl2(dest, (fdx & eorx1) ^ bgx1, (fdx & eorx2) ^ bgx2);
     }
 }
 
 static void putcs_iplan2p8(struct vc_data *conp, struct display *p,
 			   const char *s, int count, int yy, int xx)
 {
-    u_char *dest, *dest0;
-    u_char *cdat, c;
+    u8 *dest, *dest0;
+    u8 *cdat, c;
     int rows;
     int bytes;
-    ulong eorx1, eorx2, fgx1, fgx2, bgx1, bgx2, fdx;
+    u32 eorx1, eorx2, fgx1, fgx2, bgx1, bgx2, fdx;
 
     bytes = p->next_line;
     dest0 = p->screen_base + yy * p->fontheight * bytes + (xx>>1)*16 +
@@ -476,13 +429,7 @@
 
 	for(rows = p->fontheight, dest = dest0; rows-- ; dest += bytes) {
 	    fdx = dup4l(*cdat++);
-#ifdef __mc68000__
-	    __asm__ __volatile__ ("movepl %1,%0@(0)\n\t"
-				  "movepl %2,%0@(8)"
-				  : /* no outputs */
-				  : "a" (dest), "d" ((fdx & eorx1) ^ bgx1),
-				    "d" ((fdx & eorx2) ^ bgx2));
-#endif /* !m68k */
+	    movepl2(dest, (fdx & eorx1) ^ bgx1, (fdx & eorx2) ^ bgx2);
 	}
 	INC_8P(dest0);
     }
@@ -490,7 +437,7 @@
 
 static void rev_char_iplan2p8(struct display *p, int xx, int yy)
 {
-    u_char *dest;
+    u8 *dest;
     int j;
     int bytes;
 
@@ -503,7 +450,7 @@
 	/*  This should really obey the individual character's
 	 *  background and foreground colors instead of simply
 	 *  inverting. For 8 plane mode, only the lower 4 bits of the
-	 *  color are inverted, because only that color registers have
+	 *  color are inverted, because only these color registers have
 	 *  been set up.
 	 */
 	dest[0] = ~dest[0];
--- fs/minix/namei.c.~1~	Fri Jan  9 18:14:35 1998
+++ fs/minix/namei.c	Fri Jan  9 21:29:51 1998
@@ -446,8 +446,6 @@
 		retval = -ENOENT;
 		goto end_rmdir;
 	}
-	if (dentry->d_count > 1)
-		shrink_dcache_parent(dentry);
 	if (dentry->d_count > 1) {
 		retval = -EBUSY;
 		goto end_rmdir;
--- fs/proc/array.c.~1~	Fri Jan  9 18:14:54 1998
+++ fs/proc/array.c	Fri Jan  9 19:30:22 1998
@@ -485,8 +485,6 @@
 	    unsigned long fp, pc;
 	    unsigned long stack_page;
 	    int count = 0;
-	    extern int sys_pause (void);
-	    extern void tqueue_bh (void);
 
 	    stack_page = PAGE_SIZE + (unsigned long)p;
 	    fp = ((struct switch_stack *)p->tss.ksp)->a6;
--- include/asm-m68k/bitops.h.~1~	Mon Nov 17 18:04:51 1997
+++ include/asm-m68k/bitops.h	Sun Jan 11 02:54:24 1998
@@ -14,7 +14,23 @@
  * They use the standard big-endian m680x0 bit ordering.
  */
 
-extern __inline__ int test_and_set_bit(int nr,void * vaddr)
+#define test_and_set_bit(nr,vaddr) \
+  (__builtin_constant_p(nr) ? \
+   __constant_test_and_set_bit(nr, vaddr) : \
+   __generic_test_and_set_bit(nr, vaddr))
+
+extern __inline__ int __constant_test_and_set_bit(int nr,void * vaddr)
+{
+	char retval;
+
+	__asm__ __volatile__ ("bset %1,%2; sne %0"
+	     : "=d" (retval)
+	     : "di" (nr & 7), "m" (((char *)vaddr)[(nr^31) >> 3]));
+
+	return retval;
+}
+
+extern __inline__ int __generic_test_and_set_bit(int nr,void * vaddr)
 {
 	char retval;
 
@@ -24,13 +40,40 @@
 	return retval;
 }
 
-extern __inline__ void set_bit(int nr, void * vaddr)
+#define set_bit(nr,vaddr) \
+  (__builtin_constant_p(nr) ? \
+   __constant_set_bit(nr, vaddr) : \
+   __generic_set_bit(nr, vaddr))
+
+extern __inline__ void __constant_set_bit(int nr, void * vaddr)
+{
+	__asm__ __volatile__ ("bset %0,%1"
+	     : : "di" (nr & 7), "m" (((char *)vaddr)[(nr^31) >> 3]));
+}
+
+extern __inline__ void __generic_set_bit(int nr, void * vaddr)
 {
 	__asm__ __volatile__ ("bfset %1@{%0:#1}"
 	     : : "d" (nr^31), "a" (vaddr));
 }
 
-extern __inline__ int test_and_clear_bit(int nr, void * vaddr)
+#define test_and_clear_bit(nr,vaddr) \
+  (__builtin_constant_p(nr) ? \
+   __constant_test_and_clear_bit(nr, vaddr) : \
+   __generic_test_and_clear_bit(nr, vaddr))
+
+extern __inline__ int __constant_test_and_clear_bit(int nr, void * vaddr)
+{
+	char retval;
+
+	__asm__ __volatile__ ("bclr %1,%2; sne %0"
+	     : "=d" (retval)
+	     : "di" (nr & 7), "m" (((char *)vaddr)[(nr^31) >> 3]));
+
+	return retval;
+}
+
+extern __inline__ int __generic_test_and_clear_bit(int nr, void * vaddr)
 {
 	char retval;
 
@@ -40,13 +83,40 @@
 	return retval;
 }
 
-extern __inline__ void clear_bit(int nr, void * vaddr)
+#define clear_bit(nr,vaddr) \
+  (__builtin_constant_p(nr) ? \
+   __constant_clear_bit(nr, vaddr) : \
+   __generic_clear_bit(nr, vaddr))
+
+extern __inline__ void __constant_clear_bit(int nr, void * vaddr)
+{
+	__asm__ __volatile__ ("bclr %0,%1"
+	     : : "di" (nr & 7), "m" (((char *)vaddr)[(nr^31) >> 3]));
+}
+
+extern __inline__ void __generic_clear_bit(int nr, void * vaddr)
 {
 	__asm__ __volatile__ ("bfclr %1@{%0:#1}"
 	     : : "d" (nr^31), "a" (vaddr));
 }
 
-extern __inline__ int test_and_change_bit(int nr, void * vaddr)
+#define test_and_change_bit(nr,vaddr) \
+  (__builtin_constant_p(nr) ? \
+   __constant_test_and_change_bit(nr, vaddr) : \
+   __generic_test_and_change_bit(nr, vaddr))
+
+extern __inline__ int __constant_test_and_change_bit(int nr, void * vaddr)
+{
+	char retval;
+
+	__asm__ __volatile__ ("bchg %1,%2; sne %0"
+	     : "=d" (retval)
+	     : "di" (nr & 7), "m" (((char *)vaddr)[(nr^31) >> 3]));
+
+	return retval;
+}
+
+extern __inline__ int __generic_test_and_change_bit(int nr, void * vaddr)
 {
 	char retval;
 
@@ -56,7 +126,18 @@
 	return retval;
 }
 
-extern __inline__ void change_bit(int nr, void * vaddr)
+#define change_bit(nr,vaddr) \
+  (__builtin_constant_p(nr) ? \
+   __constant_change_bit(nr, vaddr) : \
+   __generic_change_bit(nr, vaddr))
+
+extern __inline__ void __constant_change_bit(int nr, void * vaddr)
+{
+	__asm__ __volatile__ ("bchg %0,%1"
+	     : : "di" (nr & 7), "m" (((char *)vaddr)[(nr^31) >> 3]));
+}
+
+extern __inline__ void __generic_change_bit(int nr, void * vaddr)
 {
 	__asm__ __volatile__ ("bfchg %1@{%0:#1}"
 	     : : "d" (nr^31), "a" (vaddr));
--- include/asm-m68k/ptrace.h.~1~	Thu May 15 15:24:00 1997
+++ include/asm-m68k/ptrace.h	Fri Dec 19 20:01:54 1997
@@ -58,6 +58,12 @@
 	unsigned long  retpc;
 };
 
+/* Arbitrarily choose the same ptrace numbers as used by the Sparc code. */
+#define PTRACE_GETREGS            12
+#define PTRACE_SETREGS            13
+#define PTRACE_GETFPREGS          14
+#define PTRACE_SETFPREGS          15
+
 #ifdef __KERNEL__
 
 #ifndef PS_S
--- include/asm-m68k/socket.h.~1~	Mon Dec  1 19:25:32 1997
+++ include/asm-m68k/socket.h	Mon Dec 22 18:27:55 1997
@@ -35,4 +35,8 @@
 
 #define SO_BINDTODEVICE	25
 
+/* Socket filtering */
+#define SO_ATTACH_FILTER        26
+#define SO_DETACH_FILTER        27
+
 #endif /* _ASM_SOCKET_H */
--- include/linux/sched.h.~1~	Fri Jan  9 18:15:42 1998
+++ include/linux/sched.h	Wed Jan  7 18:45:37 1998
@@ -182,14 +182,14 @@
 	long counter;
 	long priority;
 	unsigned long flags;	/* per process flags, defined below */
-	mm_segment_t addr_limit;	/* thread address space:
-					 	0-0xBFFFFFFF for user-thead
-						0-0xFFFFFFFF for kernel-thread
-					 */
 	int sigpending;
 	long debugreg[8];  /* Hardware debugging registers */
 	struct exec_domain *exec_domain;
 /* various fields */
+	mm_segment_t addr_limit;	/* thread address space:
+					 	0-0xBFFFFFFF for user-thead
+						0-0xFFFFFFFF for kernel-thread
+					 */
 	struct linux_binfmt *binfmt;
 	struct task_struct *next_task, *prev_task;
 	struct task_struct *next_run,  *prev_run;
@@ -311,9 +311,10 @@
  * your own risk!. Base=0, limit=0x1fffff (=2MB)
  */
 #define INIT_TASK \
-/* state etc */	{ 0,DEF_PRIORITY,DEF_PRIORITY,0,KERNEL_DS,0, \
+/* state etc */	{ 0,DEF_PRIORITY,DEF_PRIORITY,0,0, \
 /* debugregs */ { 0, },            \
 /* exec domain */&default_exec_domain, \
+/* mm_seg */	KERNEL_DS, \
 /* binfmt */	NULL, \
 /* schedlink */	&init_task,&init_task, &init_task, &init_task, \
 /* ec,brk... */	0,0,0,0,0,0, \
--- include/linux/swap.h.~1~	Fri Jan  9 18:15:44 1998
+++ include/linux/swap.h	Wed Dec 17 19:57:57 1997
@@ -74,6 +74,11 @@
 void si_swapinfo(struct sysinfo *);
 unsigned long get_swap_page(void);
 extern void FASTCALL(swap_free(unsigned long));
+struct swap_list_t {
+	int head;	/* head of priority-ordered swapfile list */
+	int next;	/* swapfile to be used next */
+};
+extern struct swap_list_t swap_list;
 
 /*
  * vm_ops not present page codes for shared memory.
--- mm/swapfile.c.~1~	Fri Jan  9 18:15:55 1998
+++ mm/swapfile.c	Wed Dec 17 21:37:50 1997
@@ -27,10 +27,7 @@
 
 unsigned int nr_swapfiles = 0;
 
-static struct {
-	int head;	/* head of priority-ordered swapfile list */
-	int next;	/* swapfile to be used next */
-} swap_list = {-1, -1};
+struct swap_list_t swap_list = {-1, -1};
 
 struct swap_info_struct swap_info[MAX_SWAPFILES];
 
