To: linux-m68k@lists.linux-m68k.org
Subject: L68K: Patch for 2.1.90
X-Yow: NOT fucking!! Also not a PACKAGE of LOOSE-LEAF PAPER!!
From: Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
Date: 25 Mar 1998 10:39:58 +0100
Sender: owner-linux-m68k@phil.uni-sb.de

Hi!

Here is a summary of the changes:

- add or remove <linux/config.h> as necessary
- fix rtc driver (now much closer to original version)
- cleanup SCC serial driver
- cleanup Atari mouse driver (makes <asm/atari_mouse.h> obsolete)
- cleanup DSP56k driver
- fix SCSI timeout recovery
- fix minix filesystem
- remove bitfields from struct fb_monspecs

Andreas.

----------------------------------------------------------------------
table
`!"#$%&'()*+,-./0123456789:;<=>?
@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_
--- linux-2.1.90/arch/m68k/atari/ataints.c.~1~	Fri Feb  6 20:26:11 1998
+++ linux-2.1.90/arch/m68k/atari/ataints.c	Mon Mar 23 19:06:41 1998
@@ -294,7 +294,7 @@
 	addql	#8,%%sp
 	addql	#4,%%sp
 	jbra	"SYMBOL_NAME_STR(ret_from_interrupt)
-	 : : "i" (&kstat.irqs), "n" (PT_OFF_FORMATVEC)
+	 : : "i" (&kstat.irqs[0]), "n" (PT_OFF_FORMATVEC)
 );
 }
 
--- linux-2.1.90/arch/m68k/kernel/m68k_ksyms.c.~1~	Mon Mar 23 18:21:29 1998
+++ linux-2.1.90/arch/m68k/kernel/m68k_ksyms.c	Mon Mar 23 20:11:11 1998
@@ -1,3 +1,4 @@
+#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/linkage.h>
 #include <linux/sched.h>
--- linux-2.1.90/arch/m68k/kernel/ptrace.c.~1~	Mon Mar 23 18:21:29 1998
+++ linux-2.1.90/arch/m68k/kernel/ptrace.c	Wed Mar 18 19:40:18 1998
@@ -347,9 +347,13 @@
 			goto out;
 		child->flags |= PF_PTRACED;
 		if (child->p_pptr != current) {
+			unsigned long flags;
+
+			write_lock_irqsave(&tasklist_lock, flags);
 			REMOVE_LINKS(child);
 			child->p_pptr = current;
 			SET_LINKS(child);
+			write_unlock_irqrestore(&tasklist_lock, flags);
 		}
 		send_sig(SIGSTOP, child, 1);
 		ret = 0;
@@ -491,6 +495,7 @@
 		}
 
 		case PTRACE_DETACH: { /* detach a process that was attached. */
+			unsigned long flags;
 			long tmp;
 
 			ret = -EIO;
@@ -499,9 +504,11 @@
 			child->flags &= ~(PF_PTRACED|PF_TRACESYS);
 			wake_up_process(child);
 			child->exit_code = data;
+			write_lock_irqsave(&tasklist_lock, flags);
 			REMOVE_LINKS(child);
 			child->p_pptr = child->p_opptr;
 			SET_LINKS(child);
+			write_unlock_irqrestore(&tasklist_lock, flags);
 			/* make sure the single step bit is not set. */
 			tmp = get_reg(child, PT_SR) & ~(TRACE_BITS << 16);
 			put_reg(child, PT_SR, tmp);
--- linux-2.1.90/arch/m68k/kernel/sys_m68k.c.~1~	Tue Oct  7 22:42:17 1997
+++ linux-2.1.90/arch/m68k/kernel/sys_m68k.c	Mon Mar  2 17:54:17 1998
@@ -73,11 +73,14 @@
 
 	if (!(a.flags & MAP_ANONYMOUS)) {
 		error = -EBADF;
-		if (a.fd >= NR_OPEN || !(file = current->files->fd[a.fd]))
+		file = fget(a.fd);
+		if (!file)
 			goto out;
 	}
 	a.flags &= ~(MAP_EXECUTABLE | MAP_DENYWRITE);
 	error = do_mmap(file, a.addr, a.len, a.prot, a.flags, a.offset);
+	if (file)
+		fput(file);
 out:
 	unlock_kernel();
 	return error;
--- linux-2.1.90/arch/m68k/mm/memory.c.~1~	Fri Feb  6 20:26:23 1998
+++ linux-2.1.90/arch/m68k/mm/memory.c	Sun Mar 22 11:54:35 1998
@@ -4,6 +4,7 @@
  *  Copyright (C) 1995  Hamish Macdonald
  */
 
+#include <linux/config.h>
 #include <linux/mm.h>
 #include <linux/kernel.h>
 #include <linux/string.h>
@@ -16,7 +17,9 @@
 #include <asm/pgtable.h>
 #include <asm/system.h>
 #include <asm/traps.h>
+#ifdef CONFIG_AMIGA
 #include <asm/amigahw.h>
+#endif
 
 /* Strings for `extern inline' functions in <asm/pgtable.h>.  If put
    directly into these functions, they are output for every file that
@@ -451,12 +454,14 @@
 	 *
 	 */
 
+#ifdef CONFIG_AMIGA
 	/*
 	 * if on an amiga and address is in first 16M, move it 
 	 * to the ZTWO_VADDR range
 	 */
 	if (MACH_IS_AMIGA && paddr < 16*1024*1024)
 		return ZTWO_VADDR(paddr);
+#endif
 	return paddr;
 }
 
--- linux-2.1.90/drivers/char/atari_MFPser.c.~1~	Fri Jan  9 18:11:09 1998
+++ linux-2.1.90/drivers/char/atari_MFPser.c	Sun Mar 22 11:57:55 1998
@@ -42,7 +42,6 @@
  *   o add delays for baudrate-setting to lock PLLs (RSFI, RSVE)
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 
 #include <linux/types.h>
--- linux-2.1.90/drivers/char/atari_SCC.c.~1~	Sun Jan 11 09:01:38 1998
+++ linux-2.1.90/drivers/char/atari_SCC.c	Mon Mar 23 20:11:30 1998
@@ -35,8 +35,8 @@
  *    send comments/problems to: itschere@techfak.uni-bielefeld.de
  */
 
+#include <linux/config.h>
 #include <linux/module.h>
-
 #include <linux/types.h>
 #include <linux/sched.h>
 #include <linux/delay.h>
@@ -439,7 +439,7 @@
 	struct serial_struct req;
 	int nr = 0;
 
-	if (MACH_IS_MVME16x && !(mvme16x_config & MVME16x_CONFIG_GOT_SCCA))
+	if (!MACH_IS_MVME16x || !(mvme16x_config & MVME16x_CONFIG_GOT_SCCA))
 		return (-ENODEV);
 
 	scc_del = (unsigned char *)0;
@@ -546,8 +546,7 @@
 	extern char m68k_debug_device[];
 
 	/* SCC present at all? */
-	if (!MACH_IS_ATARI ||
-	    !(ATARIHW_PRESENT(SCC) || ATARIHW_PRESENT(ST_ESCC)))
+	if (!(ATARIHW_PRESENT(SCC) || ATARIHW_PRESENT(ST_ESCC)))
 		return( -ENODEV );
 
 	scc_del = &mfp.par_dt_reg;
@@ -1993,10 +1992,12 @@
 	printk( "SCC channel %d: get info, sr=%02x tcr=%02x\n",
 			CHANNR(info), sr, tcr );
 #endif
+#ifdef CONFIG_MVME162_SCC
 	if (MACH_IS_MVME16x) {
 		ri = 0;
 		dsr = sr & SR_SYNC_ABORT ? TIOCM_DSR : 0;
 	}
+#endif
 #ifdef ENABLE_ATARI_SCC
 	if (MACH_IS_ATARI) {
 		if (CHANNR (info) == 0)
@@ -2162,6 +2163,9 @@
 
 		if (!suser()) return( -EPERM );
 #ifdef ENABLE_ATARI_SCC
+		if (!MACH_IS_ATARI)
+			return 0; /* XXX */
+
 		if (ATARIHW_PRESENT(TT_MFP)) {
 			SCC_clocks[channel][CLK_RTxC] =
 				(channel == CHANNEL_A) ?
@@ -2197,7 +2201,11 @@
 #ifdef MODULE
 int init_module(void)
 {
-	return( atari_SCC_init() );
+#ifdef ENABLE_ATARI_SCC
+	if (MACH_IS_ATARI)
+		return atari_SCC_init();
+#endif
+	return -ENODEV;
 }
 
 void cleanup_module(void)
--- linux-2.1.90/drivers/char/atari_SCC.h.~1~	Sun Jan 11 09:01:32 1998
+++ linux-2.1.90/drivers/char/atari_SCC.h	Sun Mar 22 11:59:43 1998
@@ -13,16 +13,14 @@
 #ifndef _ATARI_SCC_H
 #define _ATARI_SCC_H
 
+#include <linux/config.h>
 #include <linux/delay.h>
+
 #ifdef CONFIG_MVME162_SCC
 #include <asm/mvme16xhw.h>
 #endif
 #ifdef CONFIG_ATARI
 #include <asm/atarihw.h>
-#endif
-
-#if !defined(CONFIG_ATARI)
-#define ATARIHW_PRESENT(x)		0
 #endif
 
 /***********************************************************************/
--- linux-2.1.90/drivers/char/atarimouse.c.~1~	Mon Mar 23 18:22:44 1998
+++ linux-2.1.90/drivers/char/atarimouse.c	Mon Mar 23 20:06:56 1998
@@ -21,10 +21,10 @@
 #include <linux/random.h>
 #include <linux/poll.h>
 #include <linux/init.h>
+#include <linux/busmouse.h>
 
 #include <asm/setup.h>
 #include <asm/atarikb.h>
-#include <asm/atari_mouse.h>
 #include <asm/uaccess.h>
 
 static struct mouse_status mouse;
@@ -160,15 +160,21 @@
 
 __initfunc(int atari_mouse_init(void))
 {
-    mouse.active = 0;
-    mouse.ready = 0;
-    mouse.wait = NULL;
+	int r;
 
-    if (!MACH_IS_ATARI)
-	return -ENODEV;
-    printk(KERN_INFO "Atari mouse installed.\n");
-    misc_register(&atari_mouse);
-    return 0;
+	if (!MACH_IS_ATARI)
+		return -ENODEV;
+
+	mouse.active = 0;
+	mouse.ready = 0;
+	mouse.wait = NULL;
+
+	r = misc_register(&atari_mouse);
+	if (r)
+		return r;
+
+	printk(KERN_INFO "Atari mouse installed.\n");
+	return 0;
 }
 
 
@@ -201,8 +207,6 @@
 }
 
 #ifdef MODULE
-#include <asm/setup.h>
-
 int init_module(void)
 {
 	return atari_mouse_init();
--- linux-2.1.90/drivers/char/console.new.c.~1~	Wed Jan 14 21:38:53 1998
+++ linux-2.1.90/drivers/char/console.new.c	Wed Feb 11 20:03:16 1998
@@ -1623,6 +1623,12 @@
                                 /* If we got -4 (not found) then see if we have
                                    defined a replacement character (U+FFFD) */
                                 tc = conv_uni_to_pc(0xfffd);
+
+				/* One reason for the -4 can be that we just
+				   did a clear_unimap();
+				   try at least to show something. */
+				if (tc == -4)
+				     tc = c;
                         } else if ( tc == -3 ) {
                                 /* Bad hash table -- hope for the best */
                                 tc = c;
--- linux-2.1.90/drivers/char/dsp56k.c.~1~	Fri Feb  6 20:26:56 1998
+++ linux-2.1.90/drivers/char/dsp56k.c	Mon Mar 23 20:02:50 1998
@@ -23,7 +23,6 @@
  * for more details.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/version.h>
 #include <linux/malloc.h>	/* for kmalloc() and kfree() */
@@ -402,9 +401,7 @@
 			if (dsp56k_host_interface.isr & DSP56K_ISR_HF2) status |= 0x4;
 			if (dsp56k_host_interface.isr & DSP56K_ISR_HF3) status |= 0x8;
 
-			if(put_user(status, &hf->status) < 0)
-				return -EFAULT;
-			break;
+			return put_user(status, &hf->status);
 		}
 		case DSP56K_HOST_CMD:
 			if (arg > 31 || arg < 0)
@@ -428,27 +425,19 @@
  * Do I need this function at all???
  */
 #if 0
-static int dsp56k_select(struct inode *inode, struct file *file, int sel_type,
-			 select_table *wait)
+static unsigned int dsp56k_poll(struct file *file, poll_table *wait)
 {
-	int dev = MINOR(inode->i_rdev) & 0x0f;
+	int dev = MINOR(file->f_dentry->d_inode->i_rdev) & 0x0f;
 
 	switch(dev)
 	{
 	case DSP56K_DEV_56001:
-
-		switch(sel_type) {
-		case SEL_IN:		/* read */
-			return 1;
-		case SEL_OUT:		/* write */
-			return 1;
-		default:
-			return 1;
-		}
+		/* poll_wait(file, ???, wait); */
+		return POLLIN | POLLRDNORM | POLLOUT;
 
 	default:
 		printk("DSP56k driver: Unknown minor device: %d\n", dev);
-		return -ENXIO;
+		return 0;
 	}
 }
 #endif
@@ -531,22 +520,17 @@
 
 /****** Init and module functions ******/
 
-static int init_error = 0;
-
-__initfunc(void dsp56k_init(void))
+__initfunc(int dsp56k_init(void))
 {
-	if(!ATARIHW_PRESENT(DSP56K)) {
-		init_error = 1;
+	if(!MACH_IS_ATARI || !ATARIHW_PRESENT(DSP56K)) {
 		printk("DSP56k driver: Hardware not present\n");
-		return;
+		return -ENODEV;
 	}
 
-#ifndef MODULE
 	if(register_chrdev(DSP56K_MAJOR, "dsp56k", &dsp56k_fops)) {
 		printk("DSP56k driver: Unable to register driver\n");
-		return;
+		return -ENODEV;
 	}
-#endif /* !MODULE */
 
 	dsp56k.in_use = 0;
 
@@ -556,20 +540,7 @@
 #ifdef MODULE
 int init_module(void)
 {
-	int r;
-
-	init_error = 0;
-	dsp56k_init();
-	if(init_error)
-		return -EPERM;
-
-	r = register_chrdev(DSP56K_MAJOR, "dsp56k", &dsp56k_fops);
-	if(r) {
-		printk("DSP56k driver: Unable to register driver\n");
-		return r;
-	}
-	
-	return 0;
+	return dsp56k_init();
 }
 
 void cleanup_module(void)
--- linux-2.1.90/drivers/char/mem.c.~1~	Mon Mar 23 18:23:07 1998
+++ linux-2.1.90/drivers/char/mem.c	Mon Mar  9 17:50:01 1998
@@ -60,7 +60,7 @@
 		written+=sz;
 	}
 #endif
-	if (copy_from_user(p, buf, count) < 0) 
+	if (copy_from_user(p, buf, count)) 
 		return -EFAULT;
 	written += count;
 	*ppos += written;
@@ -101,7 +101,7 @@
 		}
 	}
 #endif
-	if (copy_to_user(buf, __va(p), count) < 0)
+	if (copy_to_user(buf, __va(p), count))
 		return -EFAULT;
 	read += count;
 	*ppos += read;
--- linux-2.1.90/drivers/char/rtc.c.~1~	Mon Mar 23 18:23:16 1998
+++ linux-2.1.90/drivers/char/rtc.c	Mon Mar 23 23:06:43 1998
@@ -72,8 +72,6 @@
 
 static struct timer_list rtc_irq_timer;
 
-RTC_MACH_VARIABLES
-
 static long long rtc_llseek(struct file *file, loff_t offset, int origin);
 
 static ssize_t rtc_read(struct file *file, char *buf,
@@ -104,6 +102,13 @@
 unsigned long rtc_freq = 0;		/* Current periodic IRQ rate	*/
 unsigned long rtc_irq_data = 0;		/* our output to the world	*/
 
+/*
+ *	If this driver ever becomes modularised, it will be really nice
+ *	to make the epoch retain its value across module reload...
+ */
+
+static unsigned long epoch = 1900;	/* year corresponding to 0x00	*/
+
 unsigned char days_in_mo[] = 
 {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
 
@@ -112,12 +117,8 @@
  *	so that there is no possibility of conflicting with the
  *	set_rtc_mmss() call that happens during some timer interrupts.
  *	(See ./arch/XXXX/kernel/time.c for the set_rtc_mmss() function.)
- *
- *	On Alpha we won't get any interrupts anyway, as they all end up
- *	in the system timer code.
  */
 
-#ifndef RTC_NEVER_HAS_IRQ
 static void rtc_interrupt(int irq, void *dev_id, struct pt_regs *regs)
 {
 	/*
@@ -151,9 +152,6 @@
 static ssize_t rtc_read(struct file *file, char *buf,
 			size_t count, loff_t *ppos)
 {
-#ifdef RTC_NEVER_HAS_IRQ
-	return -EIO;
-#else
 	struct wait_queue wait = { current, NULL };
 	unsigned long data;
 	ssize_t retval;
@@ -198,7 +196,6 @@
 	struct rtc_time wtime; 
 
 	switch (cmd) {
-#ifndef RTC_NEVER_HAS_IRQ
 	case RTC_AIE_OFF:	/* Mask alarm int. enab. bit	*/
 	{
 		if (!RTC_HAS_IRQ)
@@ -279,7 +276,8 @@
 		unsigned char hrs, min, sec;
 		struct rtc_time alm_tm;
 
-		if (copy_from_user(&alm_tm, (struct rtc_time*)arg, sizeof(struct rtc_time)))
+		if (copy_from_user(&alm_tm, (struct rtc_time*)arg,
+				   sizeof(struct rtc_time)))
 			return -EFAULT;
 
 		hrs = alm_tm.tm_hour;
@@ -346,8 +344,7 @@
 		is_bcd = (!(save_control & RTC_DM_BINARY) ||
 			  RTC_ALWAYS_BCD);
 
-		if ((yrs < RTC_MINYEAR) ||
-		    (yrs > RTC_MINYEAR + (is_bcd ? 99 : 255)))
+		if (yrs < RTC_MINYEAR)
 			return -EINVAL;
 
 		leap_yr = ((!(yrs % 4) && (yrs % 100)) || !(yrs % 400));
@@ -361,9 +358,15 @@
 		if ((hrs >= 24) || (min >= 60) || (sec >= 60))
 			return -EINVAL;
 
-		yrs -= RTC_YEAR_BASE;
-		yrs -= (yrs >= 2000 && RTC_CENTURY_SWITCH >= 0)
-		       ? 2000 : 1900;
+		yrs -= epoch;
+		if (RTC_CENTURY_SWITCH >= 0 && is_bcd) {
+			if (yrs > 100 + RTC_CENTURY_SWITCH)
+				return -EINVAL;
+			if (yrs >= 100)
+				yrs -= 100;
+		}
+		if (yrs > (is_bcd ? 99 : 255))
+			return -EINVAL;
 			
 		if (is_bcd)
 		{
@@ -419,7 +422,6 @@
 			return -EINVAL;
 		return put_user(rtc_freq, (unsigned long *)arg);
 	}
-#ifndef RTC_NEVER_HAS_IRQ
 	case RTC_IRQP_SET:	/* Set periodic IRQ rate.	*/
 	{
 		int tmp = 0;
@@ -458,7 +460,6 @@
 		restore_flags(flags);
 		return 0;
 	}
-#endif /* RTC_NEVER_HAS_IRQ */
 #ifdef __alpha__
 	case RTC_EPOCH_READ:	/* Read the epoch.	*/
 	{
@@ -489,18 +490,15 @@
  *	We enforce only one user at a time here with the open/close.
  *	Also clear the previous interrupt data on an open, and clean
  *	up things on a close.
- *	On Alpha we just open, for we don't mess with interrups anyway.
  */
 
 static int rtc_open(struct inode *inode, struct file *file)
 {
-#ifndef RTC_NEVER_HAS_IRQ
 	if(rtc_status & RTC_IS_OPEN)
 		return -EBUSY;
 
 	rtc_status |= RTC_IS_OPEN;
 	rtc_irq_data = 0;
-#endif
 	return 0;
 }
 
@@ -511,7 +509,6 @@
 	 * in use, and clear the data.
 	 */
 
-#ifndef RTC_NEVER_HAS_IRQ
 	unsigned char tmp;
 	unsigned long flags;
 
@@ -533,11 +530,9 @@
 
 	rtc_irq_data = 0;
 	rtc_status &= ~RTC_IS_OPEN;
-#endif
 	return 0;
 }
 
-#ifndef RTC_NEVER_HAS_IRQ
 static unsigned int rtc_poll(struct file *file, poll_table *wait)
 {
 	if (!RTC_HAS_IRQ)
@@ -557,11 +552,7 @@
 	rtc_read,
 	NULL,		/* No write */
 	NULL,		/* No readdir */
-#ifdef RTC_NEVER_HAS_IRQ
-	NULL,		/* No select if no interrupt */
-#else
 	rtc_poll,
-#endif
 	rtc_ioctl,
 	NULL,		/* No mmap */
 	rtc_open,
@@ -575,14 +566,34 @@
 	&rtc_fops
 };
 
-
-#ifdef __alpha__
-__initfunc(static void initialize_epoch(void))
+__initfunc(int rtc_init(void))
 {
 	unsigned long flags;
+#ifdef __alpha__
 	unsigned int year, ctrl;
 	unsigned long uip_watchdog;
 	char *guess = NULL;
+#endif
+
+	/* First test whether the driver should init at all */
+	if (!RTC_CHECK_DRIVER_INIT())
+		return -ENODEV;
+
+	printk(KERN_INFO "Real Time Clock Driver v%s\n", RTC_VERSION);
+	RTC_MACH_INIT();
+	if (RTC_HAS_IRQ) {
+		if(request_irq(RTC_IRQ, rtc_interrupt, RTC_IRQ_FLAGS, "rtc", NULL)) {
+			/* Yeah right, seeing as irq 8 doesn't even hit the bus. */
+			printk(KERN_ERR "rtc: IRQ %d is not free.\n", RTC_IRQ);
+			return -EIO;
+		}
+		init_timer(&rtc_irq_timer);
+		rtc_irq_timer.function = rtc_dropped_irq;
+		rtc_wait = NULL;
+	}
+	misc_register(&rtc_dev);
+#ifdef __alpha__
+	rtc_freq = HZ;
 
 	/* Each operating system on an Alpha uses its own epoch.
 	   Let's try to guess which one we are using now. */
@@ -609,36 +620,8 @@
 		guess = "Digital UNIX";
 	}
 	if (guess)
-		printk("rtc: %s epoch (%ld) detected\n", guess, epoch);
-}
+		printk("rtc: %s epoch (%lu) detected\n", guess, epoch);
 #endif
-
-__initfunc(int rtc_init(void))
-{
-	unsigned long flags;
-
-	/* First test whether the driver should init at all */
-	if (!RTC_CHECK_DRIVER_INIT())
-		return -ENODEV;
-
-	printk(KERN_INFO "Real Time Clock Driver v%s\n", RTC_VERSION);
-	RTC_MACH_INIT();
-	if (RTC_HAS_IRQ) {
-		if(request_irq(RTC_IRQ, rtc_interrupt, RTC_IRQ_FLAGS, "rtc", NULL)) {
-			/* Yeah right, seeing as irq 8 doesn't even hit the bus. */
-			printk(KERN_ERR "rtc: IRQ %d is not free.\n", RTC_IRQ);
-			return -EIO;
-		}
-		init_timer(&rtc_irq_timer);
-		rtc_irq_timer.function = rtc_dropped_irq;
-		rtc_wait = NULL;
-	}
-	misc_register(&rtc_dev);
-
-	/* On alpha, the RTC is used for the system clock */
-#ifdef __alpha__
-	rtc_freq = HZ;
-#else
 	save_flags(flags);
 	cli();
 	/* Initialize periodic freq. to CMOS reset default, which is 1024Hz */
@@ -660,7 +643,6 @@
  *	for something that requires a steady > 1KHz signal anyways.)
  */
 
-#ifndef RTC_NEVER_HAS_IRQ
 void rtc_dropped_irq(unsigned long data)
 {
 	unsigned long flags;
@@ -818,14 +800,11 @@
 		BCD_TO_BIN(rtc_tm->tm_year);
 	}
 
-	/* if RTC_BASE_YEAR == 0, the optimizer should do away with this */
-	rtc_tm->tm_year += RTC_YEAR_BASE;
-
 	/*
 	 * Account for differences between how the RTC uses the values
 	 * and how they are defined in a struct rtc_time;
 	 */
-	if (rtc_tm->tm_year <= RTC_CENTURY_SWITCH)
+	if ((rtc_tm->tm_year += (epoch - 1900)) <= RTC_CENTURY_SWITCH)
 		rtc_tm->tm_year += 100;
 
 	rtc_tm->tm_mon--;
@@ -866,7 +845,6 @@
  * meddles with the interrupt enable/disable bits.
  */
 
-#ifndef RTC_NEVER_HAS_IRQ
 void mask_rtc_irq_bit(unsigned char bit)
 {
 	unsigned char val;
--- linux-2.1.90/drivers/scsi/mvme16x.c.~1~	Fri Jan  9 18:12:45 1998
+++ linux-2.1.90/drivers/scsi/mvme16x.c	Mon Mar 23 20:08:41 1998
@@ -8,7 +8,6 @@
 #include <linux/blk.h>
 #include <linux/sched.h>
 #include <linux/version.h>
-#include <linux/config.h>
 #include <linux/zorro.h>
 
 #include <asm/page.h>
--- linux-2.1.90/drivers/scsi/scsi_obsolete.c.~1~	Mon Mar 23 18:26:14 1998
+++ linux-2.1.90/drivers/scsi/scsi_obsolete.c	Mon Mar 23 18:48:29 1998
@@ -143,6 +143,7 @@
 
 void scsi_old_times_out (Scsi_Cmnd * SCpnt)
 {
+    SCpnt->serial_number_at_timeout = SCpnt->serial_number;
 
     switch (SCpnt->internal_timeout & (IN_ABORT | IN_RESET | IN_RESET2 | IN_RESET3))
     {
@@ -154,12 +155,12 @@
 	}
 
 	if (!scsi_abort (SCpnt, DID_TIME_OUT))
-	    return;
+	    break;
     case IN_ABORT:
 	printk("SCSI host %d abort (pid %ld) timed out - resetting\n",
 	       SCpnt->host->host_no, SCpnt->pid);
 	if (!scsi_reset (SCpnt, SCSI_RESET_ASYNCHRONOUS))
-	    return;
+	    break;
     case IN_RESET:
     case (IN_ABORT | IN_RESET):
 	/* This might be controversial, but if there is a bus hang,
@@ -173,7 +174,7 @@
 	SCpnt->internal_timeout |= IN_RESET2;
         scsi_reset (SCpnt,
 		    SCSI_RESET_ASYNCHRONOUS | SCSI_RESET_SUGGEST_BUS_RESET);
-        return;
+        break;
     case IN_RESET2:
     case (IN_ABORT | IN_RESET2):
 	/* Obviously the bus reset didn't work.
@@ -186,16 +187,17 @@
 	SCpnt->internal_timeout |= IN_RESET3;
         scsi_reset (SCpnt,
 		    SCSI_RESET_ASYNCHRONOUS | SCSI_RESET_SUGGEST_HOST_RESET);
-	return;
+	break;
 
     default:
 	printk("SCSI host %d reset (pid %ld) timed out again -\n",
 	       SCpnt->host->host_no, SCpnt->pid);
 	printk("probably an unrecoverable SCSI bus or device hang.\n");
-	return;
+	break;
 
     }
 
+    SCpnt->serial_number_at_timeout = 0;
 }
 
 
--- linux-2.1.90/drivers/scsi/sd.c.~1~	Mon Mar 23 18:26:17 1998
+++ linux-2.1.90/drivers/scsi/sd.c	Wed Mar 18 19:52:14 1998
@@ -679,7 +679,7 @@
 	goto repeat;
     }
 
-    sd_devname(devm, nbuff);
+    sd_devname(devm >> 4, nbuff);
     SCSI_LOG_HLQUEUE(2,printk("%s : real dev = /dev/%d, block = %d\n",
 	   nbuff, dev, block));
 
--- linux-2.1.90/drivers/video/cyberfb.c.~1~	Mon Mar 23 18:27:19 1998
+++ linux-2.1.90/drivers/video/cyberfb.c	Mon Mar 23 20:10:52 1998
@@ -21,6 +21,7 @@
  */
 
 
+#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/errno.h>
--- linux-2.1.90/drivers/video/fbcon-afb.c.~1~	Wed Jan 14 21:40:57 1998
+++ linux-2.1.90/drivers/video/fbcon-afb.c	Mon Mar 23 20:11:52 1998
@@ -13,7 +13,6 @@
 #include <linux/tty.h>
 #include <linux/console.h>
 #include <linux/string.h>
-#include <linux/config.h>
 #include <linux/fb.h>
 
 #include "fbcon.h"
--- linux-2.1.90/drivers/video/fbcon-cfb16.c.~1~	Mon Mar 23 18:27:20 1998
+++ linux-2.1.90/drivers/video/fbcon-cfb16.c	Mon Mar 23 20:12:04 1998
@@ -13,7 +13,6 @@
 #include <linux/tty.h>
 #include <linux/console.h>
 #include <linux/string.h>
-#include <linux/config.h>
 #include <linux/fb.h>
 
 #include "fbcon.h"
--- linux-2.1.90/drivers/video/fbcon-cfb2.c.~1~	Mon Mar 23 18:27:21 1998
+++ linux-2.1.90/drivers/video/fbcon-cfb2.c	Mon Mar 23 20:12:14 1998
@@ -14,7 +14,6 @@
 #include <linux/tty.h>
 #include <linux/console.h>
 #include <linux/string.h>
-#include <linux/config.h>
 #include <linux/fb.h>
 
 #include "fbcon.h"
--- linux-2.1.90/drivers/video/fbcon-cfb24.c.~1~	Mon Mar 23 18:27:22 1998
+++ linux-2.1.90/drivers/video/fbcon-cfb24.c	Mon Mar 23 20:12:23 1998
@@ -13,7 +13,6 @@
 #include <linux/tty.h>
 #include <linux/console.h>
 #include <linux/string.h>
-#include <linux/config.h>
 #include <linux/fb.h>
 
 #include "fbcon.h"
--- linux-2.1.90/drivers/video/fbcon-cfb32.c.~1~	Mon Mar 23 18:27:22 1998
+++ linux-2.1.90/drivers/video/fbcon-cfb32.c	Mon Mar 23 20:12:32 1998
@@ -13,7 +13,6 @@
 #include <linux/tty.h>
 #include <linux/console.h>
 #include <linux/string.h>
-#include <linux/config.h>
 #include <linux/fb.h>
 
 #include "fbcon.h"
--- linux-2.1.90/drivers/video/fbcon-cfb4.c.~1~	Wed Jan 14 21:41:00 1998
+++ linux-2.1.90/drivers/video/fbcon-cfb4.c	Mon Mar 23 20:12:42 1998
@@ -14,7 +14,6 @@
 #include <linux/tty.h>
 #include <linux/console.h>
 #include <linux/string.h>
-#include <linux/config.h>
 #include <linux/fb.h>
 
 #include "fbcon.h"
--- linux-2.1.90/drivers/video/fbcon-cfb8.c.~1~	Mon Mar 23 18:27:23 1998
+++ linux-2.1.90/drivers/video/fbcon-cfb8.c	Mon Mar 23 20:12:51 1998
@@ -13,7 +13,6 @@
 #include <linux/tty.h>
 #include <linux/console.h>
 #include <linux/string.h>
-#include <linux/config.h>
 #include <linux/fb.h>
 
 #include "fbcon.h"
--- linux-2.1.90/drivers/video/fbcon-mac.c.~1~	Wed Jan 14 21:41:05 1998
+++ linux-2.1.90/drivers/video/fbcon-mac.c	Mon Mar 23 20:13:03 1998
@@ -16,7 +16,6 @@
 #include <linux/tty.h>
 #include <linux/console.h>
 #include <linux/string.h>
-#include <linux/config.h>
 #include <linux/fb.h>
 #include <linux/delay.h>
 
--- linux-2.1.90/drivers/video/fbcon-mfb.c.~1~	Mon Mar 23 18:27:25 1998
+++ linux-2.1.90/drivers/video/fbcon-mfb.c	Mon Mar 23 20:13:14 1998
@@ -13,7 +13,6 @@
 #include <linux/tty.h>
 #include <linux/console.h>
 #include <linux/string.h>
-#include <linux/config.h>
 #include <linux/fb.h>
 
 #include "fbcon.h"
--- linux-2.1.90/drivers/video/skeletonfb.c.~1~	Mon Mar 23 18:27:29 1998
+++ linux-2.1.90/drivers/video/skeletonfb.c	Mon Mar 23 20:13:30 1998
@@ -8,6 +8,7 @@
  * for more details.
  */
 
+#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/errno.h>
--- linux-2.1.90/fs/binfmt_elf.c.~1~	Mon Mar 23 18:27:38 1998
+++ linux-2.1.90/fs/binfmt_elf.c	Mon Mar 23 18:53:31 1998
@@ -108,6 +108,7 @@
 create_elf_tables(char *p, int argc, int envc,
 		  struct elfhdr * exec,
 		  unsigned long load_addr,
+		  unsigned long load_bias,
 		  unsigned long interp_load_addr, int ibcs)
 {
 	elf_caddr_t *argv;
@@ -173,7 +174,7 @@
 		NEW_AUX_ENT(3, AT_PAGESZ, ELF_EXEC_PAGESIZE);
 		NEW_AUX_ENT(4, AT_BASE, interp_load_addr);
 		NEW_AUX_ENT(5, AT_FLAGS, 0);
-		NEW_AUX_ENT(6, AT_ENTRY, (elf_addr_t) exec->e_entry);
+		NEW_AUX_ENT(6, AT_ENTRY, load_bias + exec->e_entry);
 		NEW_AUX_ENT(7, AT_UID, (elf_addr_t) current->uid);
 		NEW_AUX_ENT(8, AT_EUID, (elf_addr_t) current->euid);
 		NEW_AUX_ENT(9, AT_GID, (elf_addr_t) current->gid);
@@ -713,7 +714,7 @@
 			bprm->argc,
 			bprm->envc,
 			(interpreter_type == INTERPRETER_ELF ? &elf_ex : NULL),
-			load_addr,
+			load_addr, load_bias,
 			interp_load_addr,
 			(interpreter_type == INTERPRETER_AOUT ? 0 : 1));
 	/* N.B. passed_fileno might not be initialized? */
@@ -1189,8 +1190,9 @@
 	notes[1].type = NT_PRPSINFO;
 	notes[1].datasz = sizeof(psinfo);
 	notes[1].data = &psinfo;
-	psinfo.pr_state = current->state;
-	psinfo.pr_sname = (current->state < 0 || current->state > 5) ? '.' : "RSDZTD"[current->state];
+	i = current->state ? ffz(~current->state) + 1 : 0;
+	psinfo.pr_state = i;
+	psinfo.pr_sname = (i < 0 || i > 5) ? '.' : "RSDZTD"[i];
 	psinfo.pr_zomb = psinfo.pr_sname == 'Z';
 	psinfo.pr_nice = current->priority-15;
 	psinfo.pr_flag = current->flags;
--- linux-2.1.90/fs/minix/bitmap.c.~1~	Fri Jan  9 18:14:34 1998
+++ linux-2.1.90/fs/minix/bitmap.c	Fri Jan 23 22:32:20 1998
@@ -36,16 +36,17 @@
 
 	if (numblocks==0 || !(bh=map[numblocks-1]))
 		return(0);
-	i = (numbits-(numblocks-1)*BLOCK_SIZE*8)/8;
+	i = ((numbits-(numblocks-1)*BLOCK_SIZE*8)/16)*2;
 	for (j=0; j<i; j++) {
 		sum += nibblemap[bh->b_data[j] & 0xf]
 			+ nibblemap[(bh->b_data[j]>>4) & 0xf];
 	}
 
-	i = numbits%8;
+	i = numbits%16;
 	if (i!=0) {
-		i = bh->b_data[j] | ~((1<<i) - 1);
+		i = *(__u16 *)(&bh->b_data[j]) | ~((1<<i) - 1);
 		sum += nibblemap[i & 0xf] + nibblemap[(i>>4) & 0xf];
+		sum += nibblemap[(i>>8) & 0xf] + nibblemap[(i>>12) & 0xf];
 	}
 	return(sum);
 }
@@ -71,11 +72,11 @@
 	zone = block - sb->u.minix_sb.s_firstdatazone + 1;
 	bit = zone & 8191;
 	zone >>= 13;
-	bh = sb->u.minix_sb.s_zmap[zone];
-	if (!bh) {
+	if (zone >= sb->u.minix_sb.s_zmap_blocks) {
 		printk("minix_free_block: nonexistent bitmap buffer\n");
 		return;
 	}
+	bh = sb->u.minix_sb.s_zmap[zone];
 	if (!minix_clear_bit(bit,bh->b_data))
 		printk("free_block (%s:%d): bit already cleared\n",
 		       kdevname(sb->s_dev), block);
@@ -94,11 +95,13 @@
 	}
 repeat:
 	j = 8192;
-	for (i=0 ; i<64 ; i++)
-		if ((bh=sb->u.minix_sb.s_zmap[i]) != NULL)
-			if ((j=minix_find_first_zero_bit(bh->b_data, 8192)) < 8192)
-				break;
-	if (i>=64 || !bh || j>=8192)
+	bh = NULL;
+	for (i = 0; i < sb->u.minix_sb.s_zmap_blocks; i++) {
+		bh = sb->u.minix_sb.s_zmap[i];
+		if ((j = minix_find_first_zero_bit(bh->b_data, 8192)) < 8192)
+			break;
+	}
+	if (!bh || j >= 8192)
 		return 0;
 	if (minix_set_bit(j,bh->b_data)) {
 		printk("new_block: bit already set");
@@ -134,7 +137,7 @@
 	int ino, block;
 
 	ino = inode->i_ino;
-	if (!ino || ino >= inode->i_sb->u.minix_sb.s_ninodes) {
+	if (!ino || ino > inode->i_sb->u.minix_sb.s_ninodes) {
 		printk("Bad inode number on dev %s: %d is out of range\n",
 		       kdevname(inode->i_dev), ino);
 		return 0;
@@ -162,7 +165,7 @@
 	int ino, block;
 
 	ino = inode->i_ino;
-	if (!ino || ino >= inode->i_sb->u.minix_sb.s_ninodes) {
+	if (!ino || ino > inode->i_sb->u.minix_sb.s_ninodes) {
 		printk("Bad inode number on dev %s: %d is out of range\n",
 		       kdevname(inode->i_dev), ino);
 		return 0;
@@ -218,15 +221,16 @@
 		printk("free_inode: inode on nonexistent device\n");
 		return;
 	}
-	if (inode->i_ino < 1 || inode->i_ino >= inode->i_sb->u.minix_sb.s_ninodes) {
+	if (inode->i_ino < 1 || inode->i_ino > inode->i_sb->u.minix_sb.s_ninodes) {
 		printk("free_inode: inode 0 or nonexistent inode\n");
 		return;
 	}
 	ino = inode->i_ino;
-	if (!(bh=inode->i_sb->u.minix_sb.s_imap[ino >> 13])) {
+	if ((ino >> 13) >= inode->i_sb->u.minix_sb.s_imap_blocks) {
 		printk("free_inode: nonexistent imap in superblock\n");
 		return;
 	}
+	bh = inode->i_sb->u.minix_sb.s_imap[ino >> 13];
 	minix_clear_inode(inode);
 	clear_inode(inode);
 	if (!minix_clear_bit(ino & 8191, bh->b_data))
@@ -247,10 +251,12 @@
 	inode->i_sb = sb;
 	inode->i_flags = inode->i_sb->s_flags;
 	j = 8192;
-	for (i=0 ; i<8 ; i++)
-		if ((bh = inode->i_sb->u.minix_sb.s_imap[i]) != NULL)
-			if ((j=minix_find_first_zero_bit(bh->b_data, 8192)) < 8192)
-				break;
+	bh = NULL;
+	for (i = 0; i < sb->u.minix_sb.s_imap_blocks; i++) {
+		bh = inode->i_sb->u.minix_sb.s_imap[i];
+		if ((j = minix_find_first_zero_bit(bh->b_data, 8192)) < 8192)
+			break;
+	}
 	if (!bh || j >= 8192) {
 		iput(inode);
 		return NULL;
@@ -262,7 +268,7 @@
 	}
 	mark_buffer_dirty(bh, 1);
 	j += i*8192;
-	if (!j || j >= inode->i_sb->u.minix_sb.s_ninodes) {
+	if (!j || j > inode->i_sb->u.minix_sb.s_ninodes) {
 		iput(inode);
 		return NULL;
 	}
--- linux-2.1.90/fs/minix/inode.c.~1~	Fri Feb  6 20:28:52 1998
+++ linux-2.1.90/fs/minix/inode.c	Wed Feb  4 20:19:27 1998
@@ -64,9 +64,9 @@
 		sb->u.minix_sb.s_ms->s_state = sb->u.minix_sb.s_mount_state;
 		mark_buffer_dirty(sb->u.minix_sb.s_sbh, 1);
 	}
-	for(i = 0 ; i < MINIX_I_MAP_SLOTS ; i++)
+	for (i = 0; i < sb->u.minix_sb.s_imap_blocks; i++)
 		brelse(sb->u.minix_sb.s_imap[i]);
-	for(i = 0 ; i < MINIX_Z_MAP_SLOTS ; i++)
+	for (i = 0; i < sb->u.minix_sb.s_zmap_blocks; i++)
 		brelse(sb->u.minix_sb.s_zmap[i]);
 	brelse (sb->u.minix_sb.s_sbh);
 	kfree(sb->u.minix_sb.s_imap);
@@ -175,7 +175,8 @@
 	const char * errmsg;
 	struct inode *root_inode;
 	
-	/* N.B. These should be compile-time tests */
+	/* N.B. These should be compile-time tests.
+	   Unfortunately that is impossible. */
 	if (32 != sizeof (struct minix_inode))
 		panic("bad V1 i-node size");
 	if (64 != sizeof(struct minix2_inode))
@@ -205,33 +206,37 @@
 		s->u.minix_sb.s_version = MINIX_V1;
 		s->u.minix_sb.s_dirsize = 16;
 		s->u.minix_sb.s_namelen = 14;
+		s->u.minix_sb.s_link_max = MINIX_LINK_MAX;
 	} else if (s->s_magic == MINIX_SUPER_MAGIC2) {
 		s->u.minix_sb.s_version = MINIX_V1;
 		s->u.minix_sb.s_dirsize = 32;
 		s->u.minix_sb.s_namelen = 30;
+		s->u.minix_sb.s_link_max = MINIX_LINK_MAX;
 	} else if (s->s_magic == MINIX2_SUPER_MAGIC) {
 		s->u.minix_sb.s_version = MINIX_V2;
+		s->u.minix_sb.s_nzones = ms->s_zones;
 		s->u.minix_sb.s_dirsize = 16;
 		s->u.minix_sb.s_namelen = 14;
+		s->u.minix_sb.s_link_max = MINIX2_LINK_MAX;
 	} else if (s->s_magic == MINIX2_SUPER_MAGIC2) {
 		s->u.minix_sb.s_version = MINIX_V2;
+		s->u.minix_sb.s_nzones = ms->s_zones;
 		s->u.minix_sb.s_dirsize = 32;
 		s->u.minix_sb.s_namelen = 30;
+		s->u.minix_sb.s_link_max = MINIX2_LINK_MAX;
 	} else
 		goto out_no_fs;
 
-	if (s->u.minix_sb.s_zmap_blocks > MINIX_Z_MAP_SLOTS)
-		goto out_too_big;
 	/*
 	 * Allocate the buffer map to keep the superblock small.
 	 */
-	i = (MINIX_I_MAP_SLOTS + MINIX_Z_MAP_SLOTS) * sizeof(bh);
+	i = (s->u.minix_sb.s_imap_blocks + s->u.minix_sb.s_zmap_blocks) * sizeof(bh);
 	map = kmalloc(i, GFP_KERNEL);
 	if (!map)
 		goto out_no_map;
 	memset(map, 0, i);
 	s->u.minix_sb.s_imap = &map[0];
-	s->u.minix_sb.s_zmap = &map[MINIX_I_MAP_SLOTS];
+	s->u.minix_sb.s_zmap = &map[s->u.minix_sb.s_imap_blocks];
 
 	block=2;
 	for (i=0 ; i < s->u.minix_sb.s_imap_blocks ; i++) {
@@ -244,8 +249,6 @@
 			goto out_no_bitmap;
 		block++;
 	}
-	if (block != 2+s->u.minix_sb.s_imap_blocks+s->u.minix_sb.s_zmap_blocks)
-		goto out_no_bitmap;
 
 	minix_set_bit(0,s->u.minix_sb.s_imap[0]->b_data);
 	minix_set_bit(0,s->u.minix_sb.s_zmap[0]->b_data);
@@ -265,6 +268,8 @@
 	if (!s->s_root)
 		goto out_iput;
 
+	s->s_root->d_op = &minix_dentry_operations;
+
 	if (!(s->s_flags & MS_RDONLY)) {
 		ms->s_state &= ~MINIX_VALID_FS;
 		mark_buffer_dirty(bh, 1);
@@ -294,9 +299,9 @@
 out_no_bitmap:
 	printk("MINIX-fs: bad superblock or unable to read bitmaps\n");
     out_freemap:
-	for(i=0;i<MINIX_I_MAP_SLOTS;i++)
+	for (i = 0; i < s->u.minix_sb.s_imap_blocks; i++)
 		brelse(s->u.minix_sb.s_imap[i]);
-	for(i=0;i<MINIX_Z_MAP_SLOTS;i++)
+	for (i = 0; i < s->u.minix_sb.s_zmap_blocks; i++)
 		brelse(s->u.minix_sb.s_zmap[i]);
 	kfree(s->u.minix_sb.s_imap);
 	goto out_release;
@@ -306,11 +311,6 @@
 		printk ("MINIX-fs: can't allocate map\n");
 	goto out_release;
 
-out_too_big:
-	if (!silent)
-		printk ("MINIX-fs: filesystem too big\n");
-	goto out_release;
-
 out_no_fs:
 	if (!silent)
 		printk("VFS: Can't find a minix or minix V2 filesystem on dev "
@@ -731,7 +731,7 @@
 	ino = inode->i_ino;
 	inode->i_op = NULL;
 	inode->i_mode = 0;
-	if (!ino || ino >= inode->i_sb->u.minix_sb.s_ninodes) {
+	if (!ino || ino > inode->i_sb->u.minix_sb.s_ninodes) {
 		printk("Bad inode number on dev %s"
 		       ": %d is out of range\n",
 			kdevname(inode->i_dev), ino);
@@ -785,7 +785,7 @@
 	ino = inode->i_ino;
 	inode->i_op = NULL;
 	inode->i_mode = 0;
-	if (!ino || ino >= inode->i_sb->u.minix_sb.s_ninodes) {
+	if (!ino || ino > inode->i_sb->u.minix_sb.s_ninodes) {
 		printk("Bad inode number on dev %s"
 		       ": %d is out of range\n",
 			kdevname(inode->i_dev), ino);
@@ -850,7 +850,7 @@
 	int ino, block;
 
 	ino = inode->i_ino;
-	if (!ino || ino >= inode->i_sb->u.minix_sb.s_ninodes) {
+	if (!ino || ino > inode->i_sb->u.minix_sb.s_ninodes) {
 		printk("Bad inode number on dev %s"
 		       ": %d is out of range\n",
 			kdevname(inode->i_dev), ino);
@@ -888,7 +888,7 @@
 	int ino, block;
 
 	ino = inode->i_ino;
-	if (!ino || ino >= inode->i_sb->u.minix_sb.s_ninodes) {
+	if (!ino || ino > inode->i_sb->u.minix_sb.s_ninodes) {
 		printk("Bad inode number on dev %s"
 		       ": %d is out of range\n",
 			kdevname(inode->i_dev), ino);
--- linux-2.1.90/fs/minix/namei.c.~1~	Mon Mar 23 18:28:06 1998
+++ linux-2.1.90/fs/minix/namei.c	Thu Feb  5 14:06:25 1998
@@ -48,10 +48,13 @@
 	if (!dir || !dir->i_sb)
 		return NULL;
 	info = &dir->i_sb->u.minix_sb;
+	if (namelen > info->s_namelen) {
 #ifdef NO_TRUNCATE
-	if (namelen > info->s_namelen)
 		return NULL;
+#else
+		namelen = info->s_namelen;
 #endif
+	}
 	bh = NULL;
 	block = offset = 0;
 	while (block*BLOCK_SIZE+offset < dir->i_size) {
@@ -161,10 +164,13 @@
 	if (!dir || !dir->i_sb)
 		return -ENOENT;
 	info = &dir->i_sb->u.minix_sb;
+	if (namelen > info->s_namelen) {
 #ifdef NO_TRUNCATE
-	if (namelen > info->s_namelen)
 		return -ENAMETOOLONG;
+#else
+		namelen = info->s_namelen;
 #endif
+	}
 	if (!namelen)
 		return -ENOENT;
 	bh = NULL;
@@ -308,7 +314,7 @@
 		brelse(bh);
 		return -EEXIST;
 	}
-	if (dir->i_nlink >= MINIX_LINK_MAX)
+	if (dir->i_nlink >= info->s_link_max)
 		return -EMLINK;
 	inode = minix_new_inode(dir);
 	if (!inode)
@@ -585,7 +591,7 @@
 	if (S_ISDIR(inode->i_mode))
 		return -EPERM;
 
-	if (inode->i_nlink >= MINIX_LINK_MAX)
+	if (inode->i_nlink >= inode->i_sb->u.minix_sb.s_link_max)
 		return -EMLINK;
 
 	bh = minix_find_entry(dir, dentry->d_name.name,
@@ -701,7 +707,7 @@
 		if (PARENT_INO(dir_bh->b_data) != old_dir->i_ino)
 			goto end_rename;
 		retval = -EMLINK;
-		if (!new_inode && new_dir->i_nlink >= MINIX_LINK_MAX)
+		if (!new_inode && new_dir->i_nlink >= info->s_link_max)
 			goto end_rename;
 	}
 	if (!new_bh) {
--- linux-2.1.90/fs/msdos/namei.c.~1~	Mon Jan 26 18:13:21 1998
+++ linux-2.1.90/fs/msdos/namei.c	Mon Mar 23 20:14:55 1998
@@ -5,8 +5,6 @@
  *  Hidden files 1995 by Albert Cahalan <albert@ccs.neu.edu> <adc@coe.neu.edu>
  */
 
-#include <linux/config.h>
-
 #define __NO_VERSION__
 #include <linux/module.h>
 
--- linux-2.1.90/include/asm-m68k/atari_mouse.h	Wed Apr 24 18:17:15 1996
+++ linux-2.1.90/include/asm-m68k/atari_mouse.h	Thu Jan  1 01:00:00 1970
@@ -1,20 +0,0 @@
-#ifndef _LINUX_ATARI_MOUSE_H
-#define _LINUX_ATARI_MOUSE_H
-
-/*
- * linux/include/linux/atari_mouse.h
- * header file for Atari Mouse driver
- * by Robert de Vries (robert@and.nl) on 19Jul93
- */
-
-struct mouse_status {
-	char		buttons;
-	short		dx;
-	short		dy;
-	int		ready;
-	int		active;
-	struct wait_queue *wait;
-	struct fasync_struct *fasyncptr;
-};
-
-#endif
--- linux-2.1.90/include/asm-m68k/signal.h.~1~	Mon Mar 23 18:28:59 1998
+++ linux-2.1.90/include/asm-m68k/signal.h	Mon Mar 23 18:56:04 1998
@@ -142,11 +142,18 @@
 /* Here we must cater to libcs that poke about in kernel headers.  */
 
 struct sigaction {
-	__sighandler_t sa_handler;
+	union {
+	  __sighandler_t _sa_handler;
+	  void (*_sa_sigaction)(int, struct siginfo *, void *);
+	} _u;
 	sigset_t sa_mask;
 	unsigned long sa_flags;
 	void (*sa_restorer)(void);
 };
+
+#define sa_handler	_u._sa_handler
+#define sa_sigaction	_u._sa_sigaction
+
 #endif /* __KERNEL__ */
 
 typedef struct sigaltstack {
--- linux-2.1.90/include/linux/fb.h.~1~	Mon Mar 23 18:29:10 1998
+++ linux-2.1.90/include/linux/fb.h	Mon Mar 23 19:27:49 1998
@@ -154,10 +154,10 @@
 };
 
 struct fb_monspecs {
-	unsigned hfmin : 20;		/* hfreq lower limit (Hz) */
-	unsigned hfmax : 20; 		/* hfreq upper limit (Hz) */
-	unsigned vfmin : 10;		/* vfreq lower limit (Hz) */
-	unsigned vfmax : 10;		/* vfreq upper limit (Hz) */
+	unsigned int hfmin;		/* hfreq lower limit (Hz) */
+	unsigned int hfmax; 		/* hfreq upper limit (Hz) */
+	unsigned short vfmin;		/* vfreq lower limit (Hz) */
+	unsigned short vfmax;		/* vfreq upper limit (Hz) */
 	unsigned dpms : 1;		/* supports DPMS */
 };
 
--- linux-2.1.90/include/linux/mc146818rtc.h.~1~	Mon Mar 23 18:29:19 1998
+++ linux-2.1.90/include/linux/mc146818rtc.h	Mon Mar 23 21:49:41 1998
@@ -29,9 +29,9 @@
 				 * to deal with both modes */
 
 #define RTC_CHECK_DRIVER_INIT() (MACH_IS_ATARI && ATARIHW_PRESENT(TT_CLK))
-#define RTC_MACH_VARIABLES
 #define RTC_MACH_INIT()							\
     do {								\
+	epoch = atari_rtc_year_offset + 1900;				\
 	if (RTC_HAS_IRQ)						\
 	    /* select RTC int on H->L edge */				\
 	    tt_mfp.active_edge &= ~0x40;				\
@@ -40,9 +40,8 @@
 /* On Atari, the year was stored with base 1970 in old TOS versions (before
  * 3.06). Later, Atari recognized that this broke leap year recognition, and
  * changed the base to 1968. Medusa and Hades always use the new version. */
-#define RTC_YEAR_BASE 		atari_rtc_year_offset
 #define RTC_CENTURY_SWITCH	-1	/* no century switch */
-#define RTC_MINYEAR		(RTC_YEAR_BASE + 1900)
+#define RTC_MINYEAR		epoch
 
 #else
 /* RTC in a PC */
@@ -55,7 +54,6 @@
 #define RTC_ALWAYS_BCD	1
 
 #define RTC_CHECK_DRIVER_INIT() 1
-#define RTC_MACH_VARIABLES
 #define RTC_MACH_INIT()						\
     do {							\
 	request_region(RTC_PORT(0), RTC_IO_EXTENT, "rtc");	\
@@ -63,24 +61,14 @@
 
 /*
  * RTC year interpretation parameters:
- *   RTC_YEAR_BASE: the year (- 1900) that a RTC value of 0 would
- *     (virtually) correspond to. Value is added to RTC year values.
- *   RTC_CENTURY_SWITCH: year line (-1900) below which a century switch (+ 100
+ *   RTC_CENTURY_SWITCH: year line below which a century switch (+ 100
  *     years) should be a assumed
  *   RTC_MINYEAR: minimum real year that can be stored in the RTC
  */
 
-#ifdef CONFIG_RTC_ARC
-/* Adjust starting epoch if ARC console time is being used */
-#define RTC_YEAR_BASE		-20
-#define RTC_CENTURY_SWITCH	49
-#define RTC_MINYEAR		1950
-#else
 /* standard values */
-#define RTC_YEAR_BASE		0
 #define RTC_CENTURY_SWITCH	69
 #define RTC_MINYEAR		1970
-#endif
 
 #endif
 
--- linux-2.1.90/include/linux/msdos_fs.h.~1~	Mon Mar  9 18:52:31 1998
+++ linux-2.1.90/include/linux/msdos_fs.h	Mon Mar 23 20:15:33 1998
@@ -7,7 +7,6 @@
 #include <linux/fs.h>
 #include <linux/stat.h>
 #include <linux/fd.h>
-#include <linux/config.h>
 
 #include <asm/byteorder.h>
 
--- linux-2.1.90/include/linux/poll.h.~1~	Mon Mar 23 18:29:28 1998
+++ linux-2.1.90/include/linux/poll.h	Mon Mar  9 18:53:54 1998
@@ -79,8 +79,8 @@
 	if (ufdset) {
 		int error;
 		error = verify_area(VERIFY_WRITE, ufdset, nr);
-		if (!error)
-			error = __copy_from_user(fdset, ufdset, nr);
+		if (!error && __copy_from_user(fdset, ufdset, nr))
+			error = -EFAULT;
 		return error;
 	}
 	memset(fdset, 0, nr);
--- linux-2.1.90/kernel/panic.c.~1~	Mon Mar  9 18:58:42 1998
+++ linux-2.1.90/kernel/panic.c	Mon Mar 23 20:13:53 1998
@@ -10,6 +10,7 @@
  */
 #include <stdarg.h>
 
+#include <linux/config.h>
 #include <linux/kernel.h>
 #include <linux/sched.h>
 #include <linux/delay.h>
--- linux-2.1.90/kernel/sched.c.~1~	Mon Mar 23 18:29:53 1998
+++ linux-2.1.90/kernel/sched.c	Wed Mar 18 20:12:40 1998
@@ -1505,11 +1505,13 @@
 static void show_task(int nr,struct task_struct * p)
 {
 	unsigned long free = 0;
+	int state;
 	static const char * stat_nam[] = { "R", "S", "D", "Z", "T", "W" };
 
 	printk("%-8s %3d ", p->comm, (p == current) ? -nr : nr);
-	if (((unsigned) p->state) < sizeof(stat_nam)/sizeof(char *))
-		printk(stat_nam[p->state]);
+	state = p->state ? ffz(~p->state) + 1 : 0;
+	if (((unsigned) state) < sizeof(stat_nam)/sizeof(char *))
+		printk(stat_nam[state]);
 	else
 		printk(" ");
 #if ((~0UL) == 0xffffffff)
