To: Linux/m68k <linux-m68k@lists.linux-m68k.org>
Subject: Re: L68K: 2.1.108
References: <Pine.LNX.3.96.980713002820.4159n-100000@mercator.cs.kuleuven.ac.be>
X-Yow: Disco oil bussing will create a throbbing naugahide pipeline running
 straight to the tropics from the rug producing regions
 and devalue the dollar!
From: Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
Date: 15 Jul 1998 10:15:08 +0200
Sender: owner-linux-m68k@phil.uni-sb.de

And here are some more changes:

- add sendfile syscall,
- fix deadlock in mmap syscall,
- unify SCC_ACCESS_INIT macro,
- remove some unnessary and duplicated includes,
- fix the weird and confusing cursor,
- remove useless modularisation in fbcon-*, look at *fb.c for clues,
- reinstall mach_keyboard_type,
- check screen memory allocation in atafb.c,
- remove the brain dead le32_zero in ext2fs,
- make <asm/posix_types.h> compatible with GNU libc,
- fix copy_to_user exception processing,
- acknowledge the author of the kmod fix.

Andreas.

----------------------------------------------------------------------
--- linux-2.1.108/arch/m68k/config.in.~1~	Mon Jul 13 18:38:03 1998
+++ linux-2.1.108/arch/m68k/config.in	Mon Jul 13 19:02:59 1998
@@ -241,7 +241,10 @@
 
 if [ "$CONFIG_VME" = "n" ]; then
   define_bool CONFIG_FB y
+  mainmenu_option next_comment
+  comment 'Console drivers'
   source drivers/video/Config.in
+  endmenu
 fi
 
 source fs/nls/Config.in
--- linux-2.1.108/arch/m68k/kernel/entry.S.~1~	Mon Jun 15 18:25:33 1998
+++ linux-2.1.108/arch/m68k/kernel/entry.S	Mon Jul 13 19:04:02 1998
@@ -583,6 +583,7 @@
 	.long SYMBOL_NAME(sys_capget)
 	.long SYMBOL_NAME(sys_capset)           /* 185 */
 	.long SYMBOL_NAME(sys_sigaltstack)
+	.long SYMBOL_NAME(sys_sendfile)
 	.rept NR_syscalls-(.-SYMBOL_NAME(sys_call_table))/4
 		.long SYMBOL_NAME(sys_ni_syscall)
 	.endr
--- linux-2.1.108/arch/m68k/kernel/m68k_ksyms.c.~1~	Mon Jul 13 18:38:04 1998
+++ linux-2.1.108/arch/m68k/kernel/m68k_ksyms.c	Mon May 18 17:44:13 1998
@@ -7,7 +7,6 @@
 #include <linux/elfcore.h>
 #include <linux/in6.h>
 #include <linux/interrupt.h>
-#include <linux/pci.h>
 
 #include <asm/setup.h>
 #include <asm/machdep.h>
--- linux-2.1.108/arch/m68k/kernel/sys_m68k.c.~1~	Mon Jun 15 19:12:10 1998
+++ linux-2.1.108/arch/m68k/kernel/sys_m68k.c	Mon Jul 13 19:05:39 1998
@@ -66,12 +66,11 @@
 	struct file * file = NULL;
 	struct mmap_arg_struct a;
 
-	down(&current->mm->mmap_sem);
-	lock_kernel();
-	error = -EFAULT;
 	if (copy_from_user(&a, arg, sizeof(a)))
-		goto out;
+		return -EFAULT;
 
+	down(&current->mm->mmap_sem);
+	lock_kernel();
 	if (!(a.flags & MAP_ANONYMOUS)) {
 		error = -EBADF;
 		file = fget(a.fd);
--- linux-2.1.108/drivers/char/atari_SCC.h.~1~	Wed Jun 10 17:58:52 1998
+++ linux-2.1.108/drivers/char/atari_SCC.h	Wed Jun 10 19:17:37 1998
@@ -594,27 +594,13 @@
 
 /*
  * The BVME6000 maps the two halves of the SCC 8 bytes apart rather than 4.
- * My first attempt at doing this in assembler didn't work, so I've done it
- * the easy way for now.  Richard.
  */
 
-#ifdef CONFIG_BVME6000
-
-#define SCC_ACCESS_INIT(info)					\
-	volatile struct PARTIAL_SCC *_SCC_p =			\
-		(volatile struct PARTIAL_SCC *)info->port;	\
-	unsigned char *_SCC_shadow = SCC_shadow[0] +		\
-		(MACH_IS_BVME6000 ? ((u32)_SCC_p & 8) * 2 : ((u32)_SCC_p & 4) * 4)
-
-#else
-
 #define SCC_ACCESS_INIT(info)						\
 	volatile struct PARTIAL_SCC *_SCC_p =				\
 		(volatile struct PARTIAL_SCC *)info->port;		\
 	unsigned char *_SCC_shadow =					\
-		&SCC_shadow[(info->port >> 2) & 1][0]
-
-#endif
+		&SCC_shadow[(info->port >> (MACH_IS_BVME6000 ? 3 : 2)) & 1][0]
 
 #define	SCCwrite(reg,val)		_SCCwrite(_SCC_p,_SCC_shadow,scc_del,(reg),(val),1)
 #define	SCCwrite_NB(reg,val)	_SCCwrite(_SCC_p,_SCC_shadow,scc_del,(reg),(val),0)
--- linux-2.1.108/drivers/char/console.c.~1~	Mon Jul 13 18:38:29 1998
+++ linux-2.1.108/drivers/char/console.c	Mon Jul 13 19:58:42 1998
@@ -86,7 +86,6 @@
 #include <linux/selection.h>
 #include <linux/console_struct.h>
 #include <linux/kbd_kern.h>
-#include <linux/vt_kern.h>
 #include <linux/consolemap.h>
 #include <linux/timer.h>
 #include <linux/interrupt.h>
--- linux-2.1.108/drivers/char/vt.c.~1~	Mon Jul 13 18:38:57 1998
+++ linux-2.1.108/drivers/char/vt.c	Tue Jul 14 11:40:23 1998
@@ -22,7 +22,6 @@
 #include <linux/malloc.h>
 #include <linux/major.h>
 #include <linux/fs.h>
-#include <linux/config.h>
 
 #include <asm/io.h>
 #include <asm/uaccess.h>
@@ -61,6 +60,11 @@
 
 struct vt_struct *vt_cons[MAX_NR_CONSOLES];
 
+/* Keyboard type: Default is KB_101, but can be set by machine
+ * specific code.
+ */
+unsigned char mach_keyboard_type = KB_101;
+
 #ifndef __alpha__
 asmlinkage int sys_ioperm(unsigned long from, unsigned long num, int on);
 #endif
@@ -133,6 +137,7 @@
  * comments - KDMKTONE doesn't put the process to sleep.
  */
 /* FIXME: This should go to arch-dependent code */
+#if !defined (__mc68000__)
 static void
 kd_nosound(unsigned long ignored)
 {
@@ -175,6 +180,19 @@
 
 void (*kd_mksound)(unsigned int hz, unsigned int ticks) = _kd_mksound;
 
+#else /* __mc68000__ */
+void dummy_mksound(unsigned int say, unsigned int nothing)
+{
+  /* We are real quiet in here ;-) */
+}
+
+/*
+ * Since this is machine-dependent, systems with a sound-device should
+ * change this value in arch/m68k/{amiga,atari,x}/config.c.
+ */
+void (*kd_mksound)(unsigned int hz, unsigned int ticks) = dummy_mksound;
+#endif
+
 
 #define i (tmp.kb_index)
 #define s (tmp.kb_table)
@@ -491,7 +509,7 @@
 		/*
 		 * this is naive.
 		 */
-		ucval = KB_101;
+		ucval = mach_keyboard_type;
 		goto setchar;
 
 #ifdef __mc68000__
--- linux-2.1.108/drivers/video/Config.in.~1~	Mon Jul 13 18:40:04 1998
+++ linux-2.1.108/drivers/video/Config.in	Mon Jul 13 20:32:58 1998
@@ -82,108 +82,79 @@
     tristate '4 bpp packed pixels support' CONFIG_FBCON_CFB4
     tristate '8 bpp packed pixels support' CONFIG_FBCON_CFB8
     tristate '16 bpp packed pixels support' CONFIG_FBCON_CFB16
-    tristate '24 bpp packed pixels support' CONFIG_FBCON_CFB24
-    tristate '32 bpp packed pixels support' CONFIG_FBCON_CFB32
-    tristate 'Amiga bitplanes support' CONFIG_FBCON_AFB
-    tristate 'Amiga interleaved bitplanes support' CONFIG_FBCON_ILBM
-    tristate 'Atari interleaved bitplanes (2 planes) support' CONFIG_FBCON_IPLAN2P2
-    tristate 'Atari interleaved bitplanes (4 planes) support' CONFIG_FBCON_IPLAN2P4
-    tristate 'Atari interleaved bitplanes (8 planes) support' CONFIG_FBCON_IPLAN2P8
-#   tristate 'Atari interleaved bitplanes (16 planes) support' CONFIG_FBCON_IPLAN2P16
+    bool '24 bpp packed pixels support' CONFIG_FBCON_CFB24
+    bool '32 bpp packed pixels support' CONFIG_FBCON_CFB32
+    bool 'Amiga bitplanes support' CONFIG_FBCON_AFB
+    bool 'Amiga interleaved bitplanes support' CONFIG_FBCON_ILBM
+    bool 'Atari interleaved bitplanes (2 planes) support' CONFIG_FBCON_IPLAN2P2
+    bool 'Atari interleaved bitplanes (4 planes) support' CONFIG_FBCON_IPLAN2P4
+    bool 'Atari interleaved bitplanes (8 planes) support' CONFIG_FBCON_IPLAN2P8
+#   bool 'Atari interleaved bitplanes (16 planes) support' CONFIG_FBCON_IPLAN2P16
     tristate 'Mac variable bpp packed pixels support' CONFIG_FBCON_MAC
     tristate 'VGA characters/attributes support' CONFIG_FBCON_VGA
   else
     # Guess what we need
-    if [ "$CONFIG_FB_ACORN" = "y" -o "$CONFIG_FB_AMIGA" = "y" -o \
-	 "$CONFIG_FB_ATARI" = "y" -o "$CONFIG_FB_CYBER" = "y" -o \
-	 "$CONFIG_FB_MAC" = "y" -o "$CONFIG_FB_RETINAZ3" = "y" -o \
-	 "$CONFIG_FB_VIRGE" = "y" -o "$CONFIG_FB_VIRTUAL" = "y" ]; then
+    if [ "$CONFIG_FB_ACORN" = "y" -o "$CONFIG_FB_AMIGA" != "n" -o \
+	 "$CONFIG_FB_ATARI" != "n" -o "$CONFIG_FB_CYBER" = "y" -o \
+	 "$CONFIG_FB_MAC" != "n" -o "$CONFIG_FB_RETINAZ3" = "y" -o \
+	 "$CONFIG_FB_VIRTUAL" != "n" ]; then
       define_bool CONFIG_FBCON_MFB y
     else
-      if [ "$CONFIG_FB_ACORN" = "m" -o "$CONFIG_FB_AMIGA" = "m" -o \
-	   "$CONFIG_FB_ATARI" = "m" -o "$CONFIG_FB_CYBER" = "m" -o \
-	   "$CONFIG_FB_MAC" = "m" -o "$CONFIG_FB_RETINAZ3" = "m" -o \
-	   "$CONFIG_FB_VIRGE" = "m" -o "$CONFIG_FB_VIRTUAL" = "m" ]; then
+      if [ "$CONFIG_FB_ACORN" = "m" -o "$CONFIG_FB_CYBER" = "m" -o \
+	   "$CONFIG_FB_RETINAZ3" = "m" ]; then
 	define_bool CONFIG_FBCON_MFB m
       fi
     fi
     if [ "$CONFIG_FB_ACORN" = "y" -o "$CONFIG_FB_MAC" = "y" -o \
-	 "$CONFIG_FB_VIRTUAL" = "y" ]; then
+	 "$CONFIG_FB_VIRTUAL" != "n" ]; then
       define_bool CONFIG_FBCON_CFB2 y
       define_bool CONFIG_FBCON_CFB4 y
     else
-      if [ "$CONFIG_FB_ACORN" = "m" -o "$CONFIG_FB_MAC" = "m" -o \
-	   "$CONFIG_FB_VIRTUAL" = "m" ]; then
+      if [ "$CONFIG_FB_ACORN" = "m" -o "$CONFIG_FB_MAC" = "m" ]; then
 	define_bool CONFIG_FBCON_CFB2 m
 	define_bool CONFIG_FBCON_CFB4 m
       fi
     fi
-    if [ "$CONFIG_FB_ACORN" = "y" -o "$CONFIG_FB_ATARI" = "y" -o \
-	 "$CONFIG_FB_MAC" = "y" -o  "$CONFIG_FB_OF" = "y" -o \
-	 "$CONFIG_FB_TGA" = "y" -o "$CONFIG_FB_VESA" = "y" -o \
-	 "$CONFIG_FB_VIRTUAL" = "y" ]; then
+    if [ "$CONFIG_FB_ACORN" = "y" -o "$CONFIG_FB_ATARI" != "n" -o \
+	 "$CONFIG_FB_MAC" != "n" -o  "$CONFIG_FB_OF" != "n" -o \
+	 "$CONFIG_FB_TGA" != "n" -o "$CONFIG_FB_VESA" != "n" -o \
+	 "$CONFIG_FB_VIRTUAL" != "n" ]; then
       define_bool CONFIG_FBCON_CFB8 y
     else
-      if [ "$CONFIG_FB_ACORN" = "m" -o "$CONFIG_FB_ATARI" = "m" -o \
-	   "$CONFIG_FB_MAC" = "m" -o  "$CONFIG_FB_OF" = "m" -o \
-	   "$CONFIG_FB_TGA" = "m" -o "$CONFIG_FB_VESA" = "m" -o \
-	   "$CONFIG_FB_VIRTUAL" = "m" ]; then
+      if [ "$CONFIG_FB_ACORN" = "m" ]; then
 	define_bool CONFIG_FBCON_CFB8 m
       fi
     fi
-    if [ "$CONFIG_FB_ATARI" = "y" -o "$CONFIG_FB_ATY" = "y" -o \
-	 "$CONFIG_FB_MAC" = "y" -o "$CONFIG_FB_VESA" = "y" -o \
-	 "$CONFIG_FB_VIRTUAL" = "y" -o "$CONFIG_FB_TBOX" = "y" ]; then
+    if [ "$CONFIG_FB_ATARI" != "n" -o "$CONFIG_FB_ATY" != "n" -o \
+	 "$CONFIG_FB_MAC" != "n" -o "$CONFIG_FB_VESA" != "n" -o \
+	 "$CONFIG_FB_VIRTUAL" != "n" -o "$CONFIG_FB_TBOX" = "y" ]; then
       define_bool CONFIG_FBCON_CFB16 y
     else
-      if [ "$CONFIG_FB_ATARI" = "m" -o "$CONFIG_FB_ATY" = "m" -o \
-	   "$CONFIG_FB_MAC" = "m" -o "$CONFIG_FB_VESA" = "m" -o \
-	   "$CONFIG_FB_VIRTUAL" = "m" -o "$CONFIG_FB_TBOX" = "m" ]; then
+      if [ "$CONFIG_FB_TBOX" = "m" ]; then
 	define_bool CONFIG_FBCON_CFB16 m
       fi
     fi
-    if [ "$CONFIG_FB_VIRTUAL" = "y" ]; then
+    if [ "$CONFIG_FB_VIRTUAL" != "n" ]; then
       define_bool CONFIG_FBCON_CFB24 y
-    else
-      if [ "$CONFIG_FB_VIRTUAL" = "m" ]; then
-	define_bool CONFIG_FBCON_CFB24 m
-      fi
     fi
-    if [ "$CONFIG_FB_ATARI" = "y" -o "$CONFIG_FB_ATY" = "y" -o \
-	 "$CONFIG_FB_VESA" = "y" -o "$CONFIG_FB_VIRTUAL" = "y" ]; then
+    if [ "$CONFIG_FB_ATARI" != "n" -o "$CONFIG_FB_ATY" != "n" -o \
+	 "$CONFIG_FB_VESA" != "n" -o "$CONFIG_FB_VIRTUAL" != "n" ]; then
       define_bool CONFIG_FBCON_CFB32 y
-    else
-      if [ "$CONFIG_FB_ATARI" = "m" -o "$CONFIG_FB_ATY" = "m" -o \
-	   "$CONFIG_FB_VESA" = "m" -o "$CONFIG_FB_VIRTUAL" = "m" ]; then
-	define_bool CONFIG_FBCON_CFB32 m
-      fi
     fi
-    if [ "$CONFIG_FB_AMIGA" = "y" ]; then
+    if [ "$CONFIG_FB_AMIGA" != "n" ]; then
       define_bool CONFIG_FBCON_AFB y
       define_bool CONFIG_FBCON_ILBM y
-    else
-      if [ "$CONFIG_FB_AMIGA" = "m" ]; then
-	define_bool CONFIG_FBCON_AFB m
-	define_bool CONFIG_FBCON_ILBM m
-      fi
     fi
-    if [ "$CONFIG_FB_ATARI" = "y" ]; then
+    if [ "$CONFIG_FB_ATARI" != "n" ]; then
       define_bool CONFIG_FBCON_IPLAN2P2 y
       define_bool CONFIG_FBCON_IPLAN2P4 y
       define_bool CONFIG_FBCON_IPLAN2P8 y
 #     define_bool CONFIG_FBCON_IPLAN2P16 y
-    else
-      if [ "$CONFIG_FB_ATARI" = "m" ]; then
-	define_bool CONFIG_FBCON_IPLAN2P2 m
-	define_bool CONFIG_FBCON_IPLAN2P4 m
-	define_bool CONFIG_FBCON_IPLAN2P8 m
-#	define_bool CONFIG_FBCON_IPLAN2P16 m
-      fi
     fi
-    if [ "$CONFIG_FB_MAC" = "y" -o "$CONFIG_FB_VIRTUAL" = "y" ]; then
+    if [ "$CONFIG_FB_MAC" = "y" ]; then
       define_bool CONFIG_FBCON_MAC  y
     else
-      if [ "$CONFIG_FB_MAC" = "m" -o "$CONFIG_FB_VIRTUAL" = "m" ]; then
+      if [ "$CONFIG_FB_MAC" = "m" ]; then
 	define_bool CONFIG_FBCON_MAC  m
       fi
     fi
--- linux-2.1.108/drivers/video/Makefile.~1~	Mon Jul 13 18:40:04 1998
+++ linux-2.1.108/drivers/video/Makefile	Mon Jul 13 20:32:58 1998
@@ -188,10 +188,6 @@
 
 ifeq ($(CONFIG_FBCON_AFB),y)
 OX_OBJS += fbcon-afb.o
-else
-  ifeq ($(CONFIG_FBCON_AFB),m)
-  MX_OBJS += fbcon-afb.o
-  endif
 endif
 
 ifeq ($(CONFIG_FBCON_CFB2),y)
@@ -228,58 +224,30 @@
 
 ifeq ($(CONFIG_FBCON_CFB24),y)
 OX_OBJS += fbcon-cfb24.o
-else
-  ifeq ($(CONFIG_FBCON_CFB24),m)
-  MX_OBJS += fbcon-cfb24.o
-  endif
 endif
 
 ifeq ($(CONFIG_FBCON_CFB32),y)
 OX_OBJS += fbcon-cfb32.o
-else
-  ifeq ($(CONFIG_FBCON_CFB32),m)
-  MX_OBJS += fbcon-cfb32.o
-  endif
 endif
 
 ifeq ($(CONFIG_FBCON_ILBM),y)
 OX_OBJS += fbcon-ilbm.o
-else
-  ifeq ($(CONFIG_FBCON_ILBM),m)
-  MX_OBJS += fbcon-ilbm.o
-  endif
 endif
 
 ifeq ($(CONFIG_FBCON_IPLAN2P2),y)
 OX_OBJS += fbcon-iplan2p2.o
-else
-  ifeq ($(CONFIG_FBCON_IPLAN2P2),m)
-  MX_OBJS += fbcon-iplan2p2.o
-  endif
 endif
 
 ifeq ($(CONFIG_FBCON_IPLAN2P4),y)
 OX_OBJS += fbcon-iplan2p4.o
-else
-  ifeq ($(CONFIG_FBCON_IPLAN2P4),m)
-  MX_OBJS += fbcon-iplan2p4.o
-  endif
 endif
 
 ifeq ($(CONFIG_FBCON_IPLAN2P8),y)
 OX_OBJS += fbcon-iplan2p8.o
-else
-  ifeq ($(CONFIG_FBCON_IPLAN2P8),m)
-  MX_OBJS += fbcon-iplan2p8.o
-  endif
 endif
 
 ifeq ($(CONFIG_FBCON_IPLAN2P16),y)
 OX_OBJS += fbcon-iplan2p16.o
-else
-  ifeq ($(CONFIG_FBCON_IPLAN2P16),m)
-  MX_OBJS += fbcon-iplan2p16.o
-  endif
 endif
 
 ifeq ($(CONFIG_FBCON_MAC),y)
--- linux-2.1.108/drivers/video/atafb.c.~1~	Mon Jul 13 18:40:09 1998
+++ linux-2.1.108/drivers/video/atafb.c	Mon Jul 13 19:59:38 1998
@@ -2671,7 +2671,7 @@
 			sprintf(default_name,"default%d",i);
 			default_par=get_video_mode(default_name);
 			if (! default_par)
-				panic("can't set default video mode\n");
+				panic("can't set default video mode");
 			var=atafb_predefined[default_par-1];
 			var.activate = FB_ACTIVATE_TEST;
 			if (! do_fb_set_var(&var,1))
@@ -2768,7 +2768,7 @@
 #else /* ATAFB_STE */
 		/* no default driver included */
 		/* Nobody will ever see this message :-) */
-		panic("Cannot initialize video hardware\n");
+		panic("Cannot initialize video hardware");
 #endif
 	} while (0);
 
@@ -2791,6 +2791,8 @@
 		mem_req = ((mem_req + PAGE_SIZE - 1) & PAGE_MASK) + PAGE_SIZE;
 		screen_base = (unsigned long)atari_stram_alloc(mem_req, NULL,
 							       "atafb");
+		if (!screen_base)
+			panic("Cannot allocate screen memory");
 		memset((char *) screen_base, 0, mem_req);
 		pad = ((screen_base + PAGE_SIZE-1) & PAGE_MASK) - screen_base;
 		screen_base+=pad;
--- linux-2.1.108/drivers/video/fbcon-afb.c.~1~	Mon Jul 13 18:40:15 1998
+++ linux-2.1.108/drivers/video/fbcon-afb.c	Mon Jul 13 20:13:17 1998
@@ -9,7 +9,6 @@
  *  more details.
  */
 
-#include <linux/module.h>
 #include <linux/tty.h>
 #include <linux/console.h>
 #include <linux/string.h>
@@ -414,17 +413,6 @@
     fbcon_afb_setup, fbcon_afb_bmove, fbcon_afb_clear, fbcon_afb_putc,
     fbcon_afb_putcs, fbcon_afb_revc, NULL
 };
-
-
-#ifdef MODULE
-int init_module(void)
-{
-    return 0;
-}
-
-void cleanup_module(void)
-{}
-#endif /* MODULE */
 
 
     /*
--- linux-2.1.108/drivers/video/fbcon-cfb24.c.~1~	Mon Jul 13 18:40:16 1998
+++ linux-2.1.108/drivers/video/fbcon-cfb24.c	Mon Jul 13 20:34:33 1998
@@ -9,7 +9,6 @@
  *  more details.
  */
 
-#include <linux/module.h>
 #include <linux/tty.h>
 #include <linux/console.h>
 #include <linux/string.h>
@@ -204,17 +203,6 @@
     fbcon_cfb24_setup, fbcon_cfb24_bmove, fbcon_cfb24_clear, fbcon_cfb24_putc,
     fbcon_cfb24_putcs, fbcon_cfb24_revc, NULL
 };
-
-
-#ifdef MODULE
-int init_module(void)
-{
-    return 0;
-}
-
-void cleanup_module(void)
-{}
-#endif /* MODULE */
 
 
     /*
--- linux-2.1.108/drivers/video/fbcon-cfb32.c.~1~	Mon Jul 13 18:40:17 1998
+++ linux-2.1.108/drivers/video/fbcon-cfb32.c	Mon Jul 13 20:34:44 1998
@@ -9,7 +9,6 @@
  *  more details.
  */
 
-#include <linux/module.h>
 #include <linux/tty.h>
 #include <linux/console.h>
 #include <linux/string.h>
@@ -186,17 +185,6 @@
     fbcon_cfb32_setup, fbcon_cfb32_bmove, fbcon_cfb32_clear, fbcon_cfb32_putc,
     fbcon_cfb32_putcs, fbcon_cfb32_revc, NULL
 };
-
-
-#ifdef MODULE
-int init_module(void)
-{
-    return 0;
-}
-
-void cleanup_module(void)
-{}
-#endif /* MODULE */
 
 
     /*
--- linux-2.1.108/drivers/video/fbcon-ilbm.c.~1~	Mon Jul 13 18:40:18 1998
+++ linux-2.1.108/drivers/video/fbcon-ilbm.c	Mon Jul 13 20:14:07 1998
@@ -9,7 +9,6 @@
  *  more details.
  */
 
-#include <linux/module.h>
 #include <linux/tty.h>
 #include <linux/console.h>
 #include <linux/string.h>
@@ -262,17 +261,6 @@
     fbcon_ilbm_setup, fbcon_ilbm_bmove, fbcon_ilbm_clear, fbcon_ilbm_putc,
     fbcon_ilbm_putcs, fbcon_ilbm_revc, NULL
 };
-
-
-#ifdef MODULE
-int init_module(void)
-{
-    return 0;
-}
-
-void cleanup_module(void)
-{}
-#endif /* MODULE */
 
 
     /*
--- linux-2.1.108/drivers/video/fbcon-iplan2p2.c.~1~	Fri Jul 10 22:09:25 1998
+++ linux-2.1.108/drivers/video/fbcon-iplan2p2.c	Mon Jul 13 20:11:23 1998
@@ -11,7 +11,6 @@
  */
 
 #include <linux/config.h>
-#include <linux/module.h>
 #include <linux/tty.h>
 #include <linux/console.h>
 #include <linux/string.h>
@@ -376,17 +375,6 @@
     fbcon_iplan2p2_setup, fbcon_iplan2p2_bmove, fbcon_iplan2p2_clear,
     fbcon_iplan2p2_putc, fbcon_iplan2p2_putcs, fbcon_iplan2p2_revc, NULL
 };
-
-
-#ifdef MODULE
-int init_module(void)
-{
-    return 0;
-}
-
-void cleanup_module(void)
-{}
-#endif /* MODULE */
 
 
     /*
--- linux-2.1.108/drivers/video/fbcon-iplan2p4.c.~1~	Fri Jul 10 22:10:14 1998
+++ linux-2.1.108/drivers/video/fbcon-iplan2p4.c	Mon Jul 13 20:11:47 1998
@@ -11,7 +11,6 @@
  */
 
 #include <linux/config.h>
-#include <linux/module.h>
 #include <linux/tty.h>
 #include <linux/console.h>
 #include <linux/string.h>
@@ -396,17 +395,6 @@
     fbcon_iplan2p4_setup, fbcon_iplan2p4_bmove, fbcon_iplan2p4_clear,
     fbcon_iplan2p4_putc, fbcon_iplan2p4_putcs, fbcon_iplan2p4_revc, NULL
 };
-
-
-#ifdef MODULE
-int init_module(void)
-{
-    return 0;
-}
-
-void cleanup_module(void)
-{}
-#endif /* MODULE */
 
 
     /*
--- linux-2.1.108/drivers/video/fbcon-iplan2p8.c.~1~	Fri Jul 10 22:10:48 1998
+++ linux-2.1.108/drivers/video/fbcon-iplan2p8.c	Mon Jul 13 20:12:01 1998
@@ -11,7 +11,6 @@
  */
 
 #include <linux/config.h>
-#include <linux/module.h>
 #include <linux/tty.h>
 #include <linux/console.h>
 #include <linux/string.h>
@@ -433,17 +432,6 @@
     fbcon_iplan2p8_setup, fbcon_iplan2p8_bmove, fbcon_iplan2p8_clear,
     fbcon_iplan2p8_putc, fbcon_iplan2p8_putcs, fbcon_iplan2p8_revc, NULL
 };
-
-
-#ifdef MODULE
-int init_module(void)
-{
-    return 0;
-}
-
-void cleanup_module(void)
-{}
-#endif /* MODULE */
 
 
     /*
--- linux-2.1.108/drivers/video/fbcon.c.~1~	Mon Jul 13 18:40:25 1998
+++ linux-2.1.108/drivers/video/fbcon.c	Mon Jul 13 19:37:41 1998
@@ -132,13 +132,10 @@
 static int cursor_on = 0;
 static int cursor_blink_rate;
 
-static __inline__ int CURSOR_UNDRAWN(void)
+static __inline__ void CURSOR_UNDRAWN(void)
 {
-    int cursor_was_drawn;
     vbl_cursor_cnt = 0;
-    cursor_was_drawn = cursor_drawn;
     cursor_drawn = 0;
-    return cursor_was_drawn;
 }
 #endif
 
@@ -515,6 +512,7 @@
     int unit = conp->vc_num;
     struct display *p = &fb_display[unit];
     u_int y_break;
+    int redraw_cursor = 0;
 
     if (!p->can_soft_blank && console_blanked)
 	return;
@@ -523,8 +521,10 @@
 	return;
 
     if ((sy <= p->cursor_y) && (p->cursor_y < sy+height) &&
-	(sx <= p->cursor_x) && (p->cursor_x < sx+width))
+	(sx <= p->cursor_x) && (p->cursor_x < sx+width)) {
 	CURSOR_UNDRAWN();
+	redraw_cursor = 1;
+    }
 
     /* Split blits that cross physical y_wrap boundary */
 
@@ -535,6 +535,9 @@
 	p->dispsw->clear(conp, p, real_y(p, sy+b), sx, height-b, width);
     } else
 	p->dispsw->clear(conp, p, real_y(p, sy), sx, height, width);
+
+    if (redraw_cursor)
+	vbl_cursor_cnt = CURSOR_DRAW_DELAY;
 }
 
 
@@ -542,14 +545,20 @@
 {
     int unit = conp->vc_num;
     struct display *p = &fb_display[unit];
+    int redraw_cursor = 0;
 
     if (!p->can_soft_blank && console_blanked)
 	    return;
 
-    if ((p->cursor_x == xpos) && (p->cursor_y == ypos))
+    if ((p->cursor_x == xpos) && (p->cursor_y == ypos)) {
 	    CURSOR_UNDRAWN();
+	    redraw_cursor = 1;
+    }
 
     p->dispsw->putc(conp, p, c, real_y(p, ypos), xpos);
+
+    if (redraw_cursor)
+	    vbl_cursor_cnt = CURSOR_DRAW_DELAY;
 }
 
 
@@ -558,14 +567,19 @@
 {
     int unit = conp->vc_num;
     struct display *p = &fb_display[unit];
+    int redraw_cursor = 0;
 
     if (!p->can_soft_blank && console_blanked)
 	    return;
 
     if ((p->cursor_y == ypos) && (xpos <= p->cursor_x) &&
-	(p->cursor_x < (xpos + count)))
+	(p->cursor_x < (xpos + count))) {
 	    CURSOR_UNDRAWN();
+	    redraw_cursor = 1;
+    }
     p->dispsw->putcs(conp, p, s, count, real_y(p, ypos), xpos);
+    if (redraw_cursor)
+	    vbl_cursor_cnt = CURSOR_DRAW_DELAY;
 }
 
 
@@ -613,19 +627,15 @@
 static void fbcon_vbl_handler(int irq, void *dummy, struct pt_regs *fp)
 {
     struct display *p;
-    static int _vbl_cursor_cnt = 1, _vbl_cursor_drawn;
 
-    if (!--_vbl_cursor_cnt) {
-	_vbl_cursor_cnt = cursor_blink_rate;
-	_vbl_cursor_drawn = !_vbl_cursor_drawn;
-    }
+    if (!cursor_on)
+	return;
 
-    if (cursor_on && vbl_cursor_cnt) {
-	if (cursor_drawn != _vbl_cursor_drawn) {
-	    p = &fb_display[fg_console];
-	    p->dispsw->revc(p, p->cursor_x, real_y(p, p->cursor_y));
-	}
-	cursor_drawn = _vbl_cursor_drawn;
+    if (vbl_cursor_cnt && --vbl_cursor_cnt == 0) {
+	p = &fb_display[fg_console];
+	p->dispsw->revc(p, p->cursor_x, real_y(p, p->cursor_y));
+	cursor_drawn ^= 1;
+	vbl_cursor_cnt = cursor_blink_rate;
     }
 }
 #endif
--- linux-2.1.108/fs/ext2/truncate.c.~1~	Mon Jul 13 18:40:48 1998
+++ linux-2.1.108/fs/ext2/truncate.c	Fri Jun 26 18:52:29 1998
@@ -62,8 +62,6 @@
 #define TINDIRECT_BLOCK(inode,offset) \
 	(INDIRECT_BLOCK(inode,offset) / (addr_per_block*addr_per_block))
 
-static u32 le32_zero = 0;
-
 /*
  * Truncate has the most races in the whole filesystem: coding it is
  * a pain in the a**. Especially as I don't do any locking...
@@ -128,18 +126,16 @@
 	} while (retry);
 
 	for (i = 0; i < addr_per_block; i++)
-		if (le32_to_cpu(*(ind++)))
+		if (*(ind++))
 			goto in_use;
 
 	if (bh->b_count == 1) {
 		int tmp;
-		if (ind_bh) {
+		if (ind_bh)
 			tmp = le32_to_cpu(*p);
-			*p = le32_zero;
-		} else {
+		else
 			tmp = *p;
-			*p = 0;
-		}
+		*p = 0;
 		inode->i_blocks -= (inode->i_sb->s_blocksize / 512);
 		mark_inode_dirty(inode);
 		/*
@@ -232,13 +228,11 @@
 		ext2_error(inode->i_sb, "trunc_indirect",
 			"Read failure, inode=%ld, block=%d",
 			inode->i_ino, tmp);
-		if (dind_bh) {
-			*p = le32_zero;
+		*p = 0;
+		if (dind_bh)
 			mark_buffer_dirty(dind_bh, 1);
-		} else {
-			*p = 0;
+		else
 			mark_inode_dirty(inode);
-		}
 		return 0;
 	}
 
@@ -268,7 +262,7 @@
 			}
 		}
 
-		*ind = le32_zero;
+		*ind = 0;
 		inode->i_blocks -= blocks;
 		mark_inode_dirty(inode);
 		bforget(bh);
@@ -316,13 +310,11 @@
 		ext2_error(inode->i_sb, "trunc_dindirect",
 			"Read failure, inode=%ld, block=%d",
 			inode->i_ino, tmp);
-		if (tind_bh) {
-			*p = le32_zero;
+		*p = 0;
+		if (tind_bh)
 			mark_buffer_dirty(tind_bh, 1);
-		} else {
-			*p = 0;
+		else
 			mark_inode_dirty(inode);
-		}
 		return 0;
 	}
 
--- linux-2.1.108/include/asm-m68k/bitops.h.~1~	Fri Jun 19 18:56:16 1998
+++ linux-2.1.108/include/asm-m68k/bitops.h	Mon Jun 15 20:39:55 1998
@@ -216,23 +216,6 @@
  * differs in spirit from the above ffz (man ffs).
  */
 
-#define ffs(x) generic_ffs(x)
-
-/*
- * hweightN: returns the hamming weight (i.e. the number
- * of bits set) of a N-bit word
- */
-
-#define hweight32(x) generic_hweight32(x)
-#define hweight16(x) generic_hweight16(x)
-#define hweight8(x) generic_hweight8(x)
-
-/*
- * ffs: find first bit set. This is defined the same way as
- * the libc and compiler builtin ffs routines, therefore
- * differs in spirit from the above ffz (man ffs).
- */
-
 extern __inline__ int ffs(int x)
 {
 	int cnt;
--- linux-2.1.108/include/asm-m68k/posix_types.h.~1~	Wed Dec 10 20:27:53 1997
+++ linux-2.1.108/include/asm-m68k/posix_types.h	Sat Jul 11 19:42:08 1998
@@ -37,6 +37,8 @@
 #endif /* !defined(__KERNEL__) && !defined(__USE_ALL) */
 } __kernel_fsid_t;
 
+#if defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2)
+
 #undef	__FD_SET
 #define	__FD_SET(d, set)	((set)->fds_bits[__FDELT(d)] |= __FDMASK(d))
 
@@ -48,5 +50,7 @@
 
 #undef	__FD_ZERO
 #define __FD_ZERO(fdsetp) (memset (fdsetp, 0, sizeof(*(fd_set *)fdsetp)))
+
+#endif /* defined(__KERNEL__) || !defined(__GLIBC__) || (__GLIBC__ < 2) */
 
 #endif
--- linux-2.1.108/include/asm-m68k/uaccess.h.~1~	Mon Apr 14 19:34:59 1997
+++ linux-2.1.108/include/asm-m68k/uaccess.h	Wed Jun 24 00:57:49 1998
@@ -200,6 +200,7 @@
 	 "5:\n"
 	 ".section .fixup,\"ax\"\n"
 	 "   .even\n"
+	 "60:addql #1,%2\n"
 	 "6: lsll #2,%2\n"
 	 "   addl %4,%2\n"
 	 "   jra 5b\n"
@@ -210,9 +211,11 @@
 	 ".previous\n"
 	 ".section __ex_table,\"a\"\n"
 	 "   .align 4\n"
+	 "   .long 1b,60b\n"
 	 "   .long 22b,6b\n"
 	 "   .long 2b,6b\n"
 	 "   .long 24b,7b\n"
+	 "   .long 3b,60b\n"
 	 "   .long 4b,7b\n"
 	 "   .long 25b,8b\n"
 	 "   .long 5b,8b\n"
@@ -458,16 +461,20 @@
 	 "31: movesl %%d0,(%0)+\n"			\
 	 "11: subql #1,%2\n"				\
 	 "    jne 10b\n"				\
+	 "41:\n"					\
 	 ".section .fixup,\"ax\"\n"			\
 	 "   .even\n"					\
+	 "22: addql #1,%2\n"				\
 	 "12: lsll #2,%2\n"				\
 	 fixup "\n"					\
 	 "    jra 13f\n"				\
 	 ".previous\n"					\
 	 ".section __ex_table,\"a\"\n"			\
 	 "    .align 4\n"				\
+	 "    .long 10b,22b\n"				\
 	 "    .long 31b,12b\n"				\
 	 "    .long 11b,12b\n"				\
+	 "    .long 41b,22b\n"				\
 	 ".previous\n"					\
 	 copy "\n"					\
 	 "13:"						\
@@ -803,6 +810,7 @@
 	 "5:\n"
 	 ".section .fixup,\"ax\"\n"
 	 "   .even\n"
+	 "61:addql #1,%1\n"
 	 "6: lsll #2,%1\n"
 	 "   addl %2,%1\n"
 	 "   jra 5b\n"
@@ -813,8 +821,9 @@
 	 ".previous\n"
 	 ".section __ex_table,\"a\"\n"
 	 "   .align 4\n"
-	 "   .long 1b,6b\n"
+	 "   .long 1b,61b\n"
 	 "   .long 2b,6b\n"
+	 "   .long 3b,61b\n"
 	 "   .long 24b,7b\n"
 	 "   .long 4b,7b\n"
 	 "   .long 25b,8b\n"
--- linux-2.1.108/include/asm-m68k/unistd.h.~1~	Mon Jul 13 18:41:22 1998
+++ linux-2.1.108/include/asm-m68k/unistd.h	Fri Jul  3 18:02:27 1998
@@ -191,6 +191,7 @@
 #define __NR_capget		184
 #define __NR_capset		185
 #define __NR_sigaltstack	186
+#define __NR_sendfile		187
 
 /* user-visible error numbers are in the range -1 - -122: see
    <asm-m68k/errno.h> */
--- linux-2.1.108/include/linux/vt_kern.h.~1~	Mon Jul 13 18:41:38 1998
+++ linux-2.1.108/include/linux/vt_kern.h	Mon Jul 13 19:47:15 1998
@@ -32,7 +32,7 @@
 	struct wait_queue *paste_wait;
 } *vt_cons[MAX_NR_CONSOLES];
 
-void (*kd_mksound)(unsigned int hz, unsigned int ticks);
+extern void (*kd_mksound)(unsigned int hz, unsigned int ticks);
 
 /* console.c */
 
--- linux-2.1.108/kernel/kmod.c.~1~	Mon Jul 13 18:41:41 1998
+++ linux-2.1.108/kernel/kmod.c	Mon Jul 13 20:01:14 1998
@@ -7,6 +7,10 @@
 
 	Modified to avoid chroot and file sharing problems.
 	Mikael Pettersson
+
+	Flush the MMU ATC entries in exec_modprobe - this clears up random
+	kmod crashes, especially on m68k.  Richard Hirst
+
 */
 
 #define __KERNEL_SYSCALLS__
