Resent-Date: Mon, 16 Nov 1998 10:53:30 +0100 (MET)
To: linux-m68k@lists.linux-m68k.org
Subject: 2.1.127
X-Yow: I'm continually AMAZED at th'breathtaking effects of WIND EROSION!!
From: Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
Date: 16 Nov 1998 10:53:24 +0100
Resent-From: linux-m68k@phil.uni-sb.de

A few things for 2.1.127:

- ataflop.c: Hopefully fix all race conditions in timer handling, misc
  cleanups.
- m68kserial.c, rtc.c: Update timeout handling.
- dmasound.c: Fix goto with undefined label.
- fbcon-iplan2p?.c: Allow font height not power of two
- spinlock.h: Updated.
- uaccess.h: Add memory clobber to copy_to_user so that n_tty works.

Andreas.

----------------------------------------------------------------------
--- drivers/block/ataflop.c.~1~	Mon Aug 31 18:04:06 1998
+++ drivers/block/ataflop.c	Sat Nov  7 17:28:55 1998
@@ -214,11 +214,10 @@
  * restored upon disk change by floppy_revalidate() if valid (as seen by
  * default_params[].blocks > 0 - a bit in unit[].flags might be used for this?)
  */
-static struct atari_disk_type default_params[FD_MAX_UNITS] = {
-	{ NULL,  0, 0, 0, 0},  };
+static struct atari_disk_type default_params[FD_MAX_UNITS];
 
 static int floppy_sizes[256];
-static int floppy_blocksizes[256] = { 0, };
+static int floppy_blocksizes[256];
 
 /* current info on each unit */
 static struct atari_floppy_struct {
@@ -330,26 +329,6 @@
 					 * will give up. */
 
 
-#define	START_MOTOR_OFF_TIMER(delay)				\
-    do {							\
-        motor_off_timer.expires = jiffies + (delay);		\
-        add_timer( &motor_off_timer );				\
-        MotorOffTrys = 0;					\
-	} while(0)
-
-#define	START_CHECK_CHANGE_TIMER(delay)				\
-    do {							\
-        timer_table[FLOPPY_TIMER].expires = jiffies + (delay);	\
-        timer_active |= (1 << FLOPPY_TIMER);			\
-	} while(0)
-
-#define	START_TIMEOUT()						\
-    mod_timer(&timeout_timer, jiffies + FLOPPY_TIMEOUT)
-
-#define	STOP_TIMEOUT()						\
-    del_timer(&timeout_timer)
-
-
 /*
  * The driver is trying to determine the correct media format
  * while Probing is set. fd_rwsec_done() clears it after a
@@ -419,6 +398,31 @@
 	{ NULL, NULL, 0, 0, fd_times_out };
 
 
+static inline void
+start_motor_off_timer(void)
+{
+	mod_timer(&motor_off_timer, jiffies + FD_MOTOR_OFF_DELAY);
+	MotorOffTrys = 0;
+}
+
+static inline void
+start_check_change_timer(void)
+{
+	timer_table[FLOPPY_TIMER].expires = jiffies + CHECK_CHANGE_DELAY;
+	timer_active |= (1 << FLOPPY_TIMER);
+}
+
+static inline void
+start_timeout(void)
+{
+	mod_timer(&timeout_timer, jiffies + FLOPPY_TIMEOUT);
+}
+
+static inline void
+stop_timeout(void)
+{
+	del_timer(&timeout_timer);
+}
 
 /* Select the side to use. */
 
@@ -496,19 +500,12 @@
 
 static void fd_motor_off_timer( unsigned long dummy )
 {
-/*	unsigned long flags; */
 	unsigned char status;
-	int		      delay;
 
-	del_timer( &motor_off_timer );
-	
 	if (SelectedDrive < 0)
 		/* no drive selected, needn't deselect anyone */
 		return;
 
-/*	save_flags(flags);
-	cli(); */
-	
 	if (stdma_islocked())
 		goto retry;
 
@@ -518,21 +515,18 @@
 		/* motor already turned off by FDC -> deselect drives */
 		MotorOn = 0;
 		fd_deselect();
-/*		restore_flags(flags); */
 		return;
 	}
 	/* not yet off, try again */
 
   retry:
-/*	restore_flags(flags); */
 	/* Test again later; if tested too often, it seems there is no disk
 	 * in the drive and the FDC will leave the motor on forever (or,
 	 * at least until a disk is inserted). So we'll test only twice
 	 * per second from then on...
 	 */
-	delay = (MotorOffTrys < FD_MOTOR_OFF_MAXTRY) ?
-		        (++MotorOffTrys, HZ/20) : HZ/2;
-	START_MOTOR_OFF_TIMER( delay );
+	mod_timer(&motor_off_timer,
+		  MotorOffTrys++ < FD_MOTOR_OFF_MAXTRY ? HZ/20 : HZ/2);
 }
 
 
@@ -570,7 +564,7 @@
 	}
 	restore_flags(flags);
 
-	START_CHECK_CHANGE_TIMER( CHECK_CHANGE_DELAY );
+	start_check_change_timer();
 }
 
  
@@ -602,8 +596,7 @@
 	unsigned char status;
 	void (*handler)( int );
 
-	handler = FloppyIRQHandler;
-	FloppyIRQHandler = NULL;
+	handler = xchg(&FloppyIRQHandler, NULL);
 
 	if (handler) {
 		nop();
@@ -804,7 +797,7 @@
 
 	NeedSeek = 1;
 	MotorOn = 1;
-	START_TIMEOUT();
+	start_timeout();
 	/* wait for IRQ */
 }
 
@@ -812,7 +805,7 @@
 static void fd_calibrate_done( int status )
 {
 	DPRINT(("fd_calibrate_done()\n"));
-	STOP_TIMEOUT();
+	stop_timeout();
     
 	/* set the correct speed now */
 	if (ATARIHW_PRESENT(FDCSPEED))
@@ -852,7 +845,7 @@
 
 	MotorOn = 1;
 	set_head_settle_flag();
-	START_TIMEOUT();
+	start_timeout();
 	/* wait for IRQ */
 }
 
@@ -860,7 +853,7 @@
 static void fd_seek_done( int status )
 {
 	DPRINT(("fd_seek_done()\n"));
-	STOP_TIMEOUT();
+	stop_timeout();
 	
 	/* set the correct speed */
 	if (ATARIHW_PRESENT(FDCSPEED))
@@ -977,14 +970,12 @@
 		 * search for the first non-existent sector and need 1 sec to
 		 * recognise that it isn't present :-(
 		 */
-		del_timer (&readtrack_timer);
-		readtrack_timer.expires =
-		  jiffies + HZ/5 + (old_motoron ? 0 : HZ);
-		       /* 1 rot. + 5 rot.s if motor was off  */
 		MultReadInProgress = 1;
-		add_timer( &readtrack_timer );
+		mod_timer(&readtrack_timer,
+			  /* 1 rot. + 5 rot.s if motor was off  */
+			  jiffies + HZ/5 + (old_motoron ? 0 : HZ));
 	}
-	START_TIMEOUT();
+	start_timeout();
 }
 
     
@@ -995,8 +986,6 @@
 	save_flags(flags);  
 	cli();
 
-	del_timer( &readtrack_timer );
-
 	if (!MultReadInProgress) {
 		/* This prevents a race condition that could arise if the
 		 * interrupt is triggered while the calling of this timer
@@ -1044,8 +1033,7 @@
 		/* not yet finished, wait another tenth rotation */
 		restore_flags(flags);
 		DPRINT(("fd_readtrack_check(): not yet finished\n"));
-		readtrack_timer.expires = jiffies + HZ/5/10;
-		add_timer( &readtrack_timer );
+		mod_timer(&readtrack_timer, jiffies + HZ/5/10);
 	}
 }
 
@@ -1067,7 +1055,7 @@
 {
 	unsigned int track;
 
-	STOP_TIMEOUT();
+	stop_timeout();
 	
 	/* Correct the track if stretch != 0 */
 	if (SUDT->stretch) {
@@ -1236,7 +1224,7 @@
 	dma_wd.fdc_acces_seccount = FDCCMD_WRTRA | get_head_settle_flag(); 
 
 	MotorOn = 1;
-	START_TIMEOUT();
+	start_timeout();
 	/* wait for interrupt */
 }
 
@@ -1245,7 +1233,7 @@
 {
 	DPRINT(("fd_writetrack_done()\n"));
 
-	STOP_TIMEOUT();
+	stop_timeout();
 
 	if (status & FDCSTAT_WPROT) {
 		printk(KERN_NOTICE "fd%d: is write protected\n", SelectedDrive );
@@ -1303,7 +1291,7 @@
 		SET_IRQ_HANDLER( finish_fdc_done );
 		FDC_WRITE (FDCREG_CMD, FDCCMD_SEEK);
 		MotorOn = 1;
-		START_TIMEOUT();
+		start_timeout();
 		/* we must wait for the IRQ here, because the ST-DMA
 		   is released immediately afterwards and the interrupt
 		   may be delivered to the wrong driver. */
@@ -1316,7 +1304,7 @@
 	unsigned long flags;
 
 	DPRINT(("finish_fdc_done entered\n"));
-	STOP_TIMEOUT();
+	stop_timeout();
 	NeedSeek = 0;
 
 	if ((timer_active & (1 << FLOPPY_TIMER)) &&
@@ -1326,9 +1314,8 @@
 		 */
 		timer_table[FLOPPY_TIMER].expires = jiffies + 5;
 	else
-		START_CHECK_CHANGE_TIMER( CHECK_CHANGE_DELAY );
-	del_timer( &motor_off_timer );
-	START_MOTOR_OFF_TIMER( FD_MOTOR_OFF_DELAY );
+		start_check_change_timer();
+	start_motor_off_timer();
 
 	save_flags(flags);
 	cli();
@@ -1781,7 +1768,7 @@
 
 /* Initialize the 'unit' variable for drive 'drive' */
 
-__initfunc(static void fd_probe( int drive ))
+static void __init fd_probe(int drive)
 {
 	UD.connected = 0;
 	UDT  = NULL;
@@ -1824,7 +1811,7 @@
  * declared absent.
  */
 
-__initfunc(static int fd_test_drive_present( int drive ))
+static int __init fd_test_drive_present(int drive)
 {
 	unsigned long timeout;
 	unsigned char status;
@@ -1871,7 +1858,7 @@
  * floppies, additionally start the disk-change and motor-off timers.
  */
 
-__initfunc(static void config_types( void ))
+static void __init config_types(void)
 {
 	int drive, cnt = 0;
 
@@ -1902,9 +1889,9 @@
 	}
 	
 	if (cnt > 0) {
-		START_MOTOR_OFF_TIMER( FD_MOTOR_OFF_DELAY );
+		start_motor_off_timer();
 		if (cnt == 1) fd_select_drive( 0 );
-		START_CHECK_CHANGE_TIMER( CHECK_CHANGE_DELAY );
+		start_check_change_timer();
 	}
 }
 
@@ -2016,7 +2003,7 @@
 	floppy_revalidate,	/* revalidate */
 };
 
-__initfunc(int atari_floppy_init (void))
+int __init atari_floppy_init(void)
 {
 	int i;
 
@@ -2085,7 +2072,7 @@
 }
 
 
-__initfunc(void atari_floppy_setup( char *str, int *ints ))
+void __init atari_floppy_setup(char *str, int *ints)
 {
 	int i;
 	
--- drivers/char/m68kserial.c.~1~	Sun Oct  4 15:21:18 1998
+++ drivers/char/m68kserial.c	Mon Nov  9 19:16:48 1998
@@ -982,8 +982,7 @@
 		timeout = jiffies+HZ;
 		while (!(info->sw->trans_empty(info))) {
 			current->state = TASK_INTERRUPTIBLE;
-			current->timeout = jiffies + info->timeout;
-			schedule();
+			schedule_timeout(info->timeout);
 			if (signal_pending(current))
 				break;
 			if (jiffies > timeout)
@@ -1002,8 +1001,7 @@
 	if (info->blocked_open) {
 		if (info->close_delay) {
 			current->state = TASK_INTERRUPTIBLE;
-			current->timeout = jiffies + info->close_delay;
-			schedule();
+			schedule_timeout(info->close_delay);
 		}
 		wake_up_interruptible(&info->open_wait);
 	}
--- drivers/char/rtc.c.~1~	Wed Aug 26 18:45:34 1998
+++ drivers/char/rtc.c	Mon Nov  9 22:07:23 1998
@@ -392,8 +392,7 @@
 		cli();
 		while( CMOS_READ(RTC_FREQ_SELECT) & RTC_UIP ) {
 			current->state = TASK_INTERRUPTIBLE;
-			current->timeout = jiffies + 2*HZ/100;
-			schedule();
+			schedule_timeout(2*HZ/100);
 		}
 
 		CMOS_WRITE((save_control|RTC_SET), RTC_CONTROL);
--- drivers/sound/dmasound.c.~1~	Fri Nov 13 18:07:11 1998
+++ drivers/sound/dmasound.c	Mon Nov  9 19:34:22 1998
@@ -816,7 +816,7 @@
 #define ONE_SECOND	HZ	/* in jiffies (100ths of a second) */
 #define NO_TIME_LIMIT	0xffffffff
 #define SLEEP(queue, time_limit) \
-	interruptible_sleep_on(&queue, (time_limit));
+	interruptible_sleep_on_timeout(&queue, (time_limit));
 #define WAKE_UP(queue)	(wake_up_interruptible(&queue))
 
 /*
@@ -4505,8 +4505,10 @@
 		awacs_rx_irq = np->intrs[2].line;
 		awacs_tx_cmd_space = kmalloc((numBufs + 4) * sizeof(struct dbdma_cmd),
 					     GFP_KERNEL);
-		if (awacs_tx_cmd_space == NULL)
-			goto out_of_memory;
+		if (awacs_tx_cmd_space == NULL) {
+			printk("DMA sound driver: Not enough buffer memory, driver disabled!\n");
+			return;
+		}
 		awacs_tx_cmds = (volatile struct dbdma_cmd *)
 			DBDMA_ALIGN(awacs_tx_cmd_space);
 		awacs_reg[0] = MASK_MUX_CD;
--- drivers/video/fbcon-iplan2p2.c.~1~	Fri Nov 13 18:07:33 1998
+++ drivers/video/fbcon-iplan2p2.c	Thu Oct 22 19:51:48 1998
@@ -169,18 +169,25 @@
 	/*  Special (but often used) case: Moving whole lines can be
 	 *  done with memmove()
 	 */
-	mymemmove(p->screen_base + ((dy * p->next_line) << fontheightlog(p)),
-		  p->screen_base + ((sy * p->next_line) << fontheightlog(p)),
-		  (p->next_line * height) << fontheightlog(p));
+	mymemmove(p->screen_base + dy * p->next_line * fontheight(p),
+		  p->screen_base + sy * p->next_line * fontheight(p),
+		  p->next_line * height * fontheight(p));
     } else {
 	int rows, cols;
 	u8 *src;
 	u8 *dst;
 	int bytes = p->next_line;
-	int linesize = bytes << fontheightlog(p);
-	u_int colsize  = height << fontheightlog(p);
+	int linesize;
+	u_int colsize;
 	u_int upwards  = (dy < sy) || (dy == sy && dx < sx);
 
+	if (fontheightlog(p)) {
+	    linesize = bytes << fontheightlog(p);
+	    colsize = height << fontheightlog(p);
+	} else {
+	    linesize = bytes * fontheight(p);
+	    colsize = height * fontheight(p);
+	}
 	if ((sx & 1) == (dx & 1)) {
 	    /* odd->odd or even->even */
 	    if (upwards) {
@@ -258,19 +265,30 @@
     u8 *start;
     int rows;
     int bytes = p->next_line;
-    int lines = height << fontheightlog(p);
+    int lines;
     u32 size;
     u32 cval;
     u16 pcval;
 
     cval = expand2l (COLOR_2P (attr_bgcol_ec(p,conp)));
 
+    if (fontheightlog(p))
+	lines = height << fontheightlog(p);
+    else
+	lines = height * fontheight(p);
+
     if (sx == 0 && width * 2 == bytes) {
-	offset = (sy * bytes) << fontheightlog(p);
+	if (fontheightlog(p))
+	    offset = (sy * bytes) << fontheightlog(p);
+	else
+	    offset = sy * bytes * fontheight(p);
 	size = lines * bytes;
 	memset_even_2p(p->screen_base+offset, size, cval);
     } else {
-	offset = ((sy * bytes) << fontheightlog(p)) + (sx>>1)*4 + (sx & 1);
+	if (fontheightlog(p))
+	    offset = ((sy * bytes) << fontheightlog(p)) + (sx>>1)*4 + (sx & 1);
+	else
+	    offset = sy * bytes * fontheight(p) + (sx>>1)*4 + (sx & 1);
 	start = p->screen_base + offset;
 	pcval = expand2w(COLOR_2P(attr_bgcol_ec(p,conp)));
 
@@ -306,8 +324,15 @@
     int bytes = p->next_line;
     u16 eorx, fgx, bgx, fdx;
 
-    dest = p->screen_base + ((yy * bytes) << fontheightlog(p)) + (xx>>1)*4 + (xx & 1);
-    cdat = p->fontdata + ((c & p->charmask) << fontheightlog(p));
+    if (fontheightlog(p)) {
+	dest = (p->screen_base + ((yy * bytes) << fontheightlog(p)) +
+		(xx>>1)*4 + (xx & 1));
+	cdat = p->fontdata + ((c & p->charmask) << fontheightlog(p));
+    } else {
+	dest = (p->screen_base + yy * bytes * fontheight(p) +
+		(xx>>1)*4 + (xx & 1));
+	cdat = p->fontdata + (c & p->charmask) * fontheight(p);
+    }
 
     fgx = expand2w(COLOR_2P(attr_fgcol(p,c)));
     bgx = expand2w(COLOR_2P(attr_bgcol(p,c)));
@@ -330,14 +355,22 @@
     u16 eorx, fgx, bgx, fdx;
 
     bytes = p->next_line;
-    dest0 = p->screen_base + ((yy * bytes) << fontheightlog(p)) + (xx>>1)*4 + (xx & 1);
+    if (fontheightlog(p))
+	dest0 = (p->screen_base + ((yy * bytes) << fontheightlog(p)) +
+		 (xx>>1)*4 + (xx & 1));
+    else
+	dest0 = (p->screen_base + yy * bytes * fontheight(p) +
+		 (xx>>1)*4 + (xx & 1));
     fgx = expand2w(COLOR_2P(attr_fgcol(p,*s)));
     bgx = expand2w(COLOR_2P(attr_bgcol(p,*s)));
     eorx = fgx ^ bgx;
 
     while (count--) {
 	c = *s++ & p->charmask;
-	cdat  = p->fontdata + (c << fontheightlog(p));
+	if (fontheightlog(p))
+	    cdat = p->fontdata + (c << fontheightlog(p));
+	else
+	    cdat = p->fontdata + c * fontheight(p);
 
 	for (rows = fontheight(p), dest = dest0; rows-- ; dest += bytes) {
 	    fdx = dup2w(*cdat++);
@@ -353,8 +386,12 @@
     int j;
     int bytes;
 
-    dest = (p->screen_base + ((yy * p->next_line) << fontheightlog(p)) +
-	    (xx>>1)*4 + (xx & 1));
+    if (fontheightlog(p))
+	dest = (p->screen_base + ((yy * p->next_line) << fontheightlog(p)) +
+		(xx>>1)*4 + (xx & 1));
+    else
+	dest = (p->screen_base + yy * p->next_line * fontheight(p) +
+		(xx>>1)*4 + (xx & 1));
     j = fontheight(p);
     bytes = p->next_line;
     while (j--) {
--- drivers/video/fbcon-iplan2p4.c.~1~	Fri Nov 13 18:07:33 1998
+++ drivers/video/fbcon-iplan2p4.c	Thu Oct 22 19:52:13 1998
@@ -177,18 +177,25 @@
 	/*  Special (but often used) case: Moving whole lines can be
 	 *done with memmove()
 	 */
-	mymemmove(p->screen_base + ((dy * p->next_line) << fontheightlog(p)),
-		  p->screen_base + ((sy * p->next_line) << fontheightlog(p)),
-		  (p->next_line * height) << fontheightlog(p));
+	mymemmove(p->screen_base + dy * p->next_line * fontheight(p),
+		  p->screen_base + sy * p->next_line * fontheight(p),
+		  p->next_line * height * fontheight(p));
     } else {
 	int rows, cols;
 	u8 *src;
 	u8 *dst;
 	int bytes = p->next_line;
-	int linesize = bytes << fontheightlog(p);
-	u_int colsize  = height << fontheightlog(p);
+	int linesize;
+	u_int colsize;
 	u_int upwards  = (dy < sy) || (dy == sy && dx < sx);
 
+	if (fontheightlog(p)) {
+	    linesize = bytes << fontheightlog(p);
+	    colsize = height << fontheightlog(p);
+	} else {
+	    linesize = bytes * fontheight(p);
+	    colsize = height * fontheight(p);
+	}
 	if ((sx & 1) == (dx & 1)) {
 	    /* odd->odd or even->even */
 
@@ -269,18 +276,29 @@
     u8 *start;
     int rows;
     int bytes = p->next_line;
-    int lines = height << fontheightlog(p);
+    int lines;
     u32 size;
     u32 cval1, cval2, pcval;
 
     expand4dl(attr_bgcol_ec(p,conp), &cval1, &cval2);
 
+    if (fontheightlog(p))
+	lines = height << fontheightlog(p);
+    else
+	lines = height * fontheight(p);
+
     if (sx == 0 && width * 4 == bytes) {
-	offset = (sy * bytes) << fontheightlog(p);
+	if (fontheightlog(p))
+	    offset = (sy * bytes) << fontheightlog(p);
+	else
+	    offset = sy * bytes * fontheight(p);
 	size = lines * bytes;
 	memset_even_4p(p->screen_base+offset, size, cval1, cval2);
     } else {
-	offset = ((sy * bytes) << fontheightlog(p)) + (sx>>1)*8 + (sx & 1);
+	if (fontheightlog(p))
+	    offset = ((sy * bytes) << fontheightlog(p)) + (sx>>1)*8 + (sx & 1);
+	else
+	    offset = sy * bytes * fontheight(p) + (sx>>1)*8 + (sx & 1);
 	start = p->screen_base + offset;
 	pcval = expand4l(attr_bgcol_ec(p,conp));
 
@@ -316,8 +334,15 @@
     int bytes = p->next_line;
     u32 eorx, fgx, bgx, fdx;
 
-    dest = p->screen_base + ((yy * bytes) << fontheightlog(p)) + (xx>>1)*8 + (xx & 1);
-    cdat = p->fontdata + ((c & p->charmask) << fontheightlog(p));
+    if (fontheightlog(p)) {
+	dest = (p->screen_base + ((yy * bytes) << fontheightlog(p)) +
+		(xx>>1)*8 + (xx & 1));
+	cdat = p->fontdata + ((c & p->charmask) << fontheightlog(p));
+    } else {
+	dest = (p->screen_base + yy * bytes * fontheight(p) +
+		(xx>>1)*8 + (xx & 1));
+	cdat = p->fontdata + (c & p->charmask) * fontheight(p);
+    }
 
     fgx = expand4l(attr_fgcol(p,c));
     bgx = expand4l(attr_bgcol(p,c));
@@ -340,7 +365,12 @@
     u32 eorx, fgx, bgx, fdx;
 
     bytes = p->next_line;
-    dest0 = p->screen_base + ((yy * bytes) << fontheightlog(p)) + (xx>>1)*8 + (xx & 1);
+    if (fontheightlog(p))
+	dest0 = (p->screen_base + ((yy * bytes) << fontheightlog(p)) +
+		 (xx>>1)*8 + (xx & 1));
+    else
+	dest0 = (p->screen_base + yy * bytes * fontheight(p) +
+		 (xx>>1)*8 + (xx & 1));
     fgx = expand4l(attr_fgcol(p,*s));
     bgx = expand4l(attr_bgcol(p,*s));
     eorx = fgx ^ bgx;
@@ -354,7 +384,10 @@
 	*/
 
 	c = *s++ & p->charmask;
-	cdat  = p->fontdata + (c << fontheightlog(p));
+	if (fontheightlog(p))
+	    cdat = p->fontdata + (c << fontheightlog(p));
+	else
+	    cdat = p->fontdata + c * fontheight(p);
 
 	for(rows = fontheight(p), dest = dest0; rows-- ; dest += bytes) {
 	    fdx = dup4l(*cdat++);
@@ -370,8 +403,12 @@
     int j;
     int bytes;
 
-    dest = (p->screen_base + ((yy * p->next_line) << fontheightlog(p)) +
-	    (xx>>1)*8 + (xx & 1));
+    if (fontheightlog(p))
+	dest = (p->screen_base + ((yy * p->next_line) << fontheightlog(p)) +
+		(xx>>1)*8 + (xx & 1));
+    else
+	dest = (p->screen_base + yy * p->next_line * fontheight(p) +
+		(xx>>1)*8 + (xx & 1));
     j = fontheight(p);
     bytes = p->next_line;
 
--- drivers/video/fbcon-iplan2p8.c.~1~	Fri Nov 13 18:07:34 1998
+++ drivers/video/fbcon-iplan2p8.c	Thu Oct 22 19:52:37 1998
@@ -209,18 +209,25 @@
 	/*  Special (but often used) case: Moving whole lines can be
 	 *  done with memmove()
 	 */
-	fast_memmove(p->screen_base + ((dy * p->next_line) << fontheightlog(p)),
-		     p->screen_base + ((sy * p->next_line) << fontheightlog(p)),
-		     (p->next_line * height) << fontheightlog(p));
+	fast_memmove(p->screen_base + dy * p->next_line * fontheight(p),
+		     p->screen_base + sy * p->next_line * fontheight(p),
+		     p->next_line * height * fontheight(p));
      } else {
 	int rows, cols;
 	u8 *src;
 	u8 *dst;
 	int bytes = p->next_line;
-	int linesize = bytes << fontheightlog(p);
-	u_int colsize = height << fontheightlog(p);
+	int linesize;
+	u_int colsize;
 	u_int upwards = (dy < sy) || (dy == sy && dx < sx);
 
+	if (fontheightlog(p)) {
+	    linesize = bytes << fontheightlog(p);
+	    colsize = height << fontheightlog(p);
+	} else {
+	    linesize = bytes * fontheight(p);
+	    colsize = height * fontheight(p);
+	}
 	if ((sx & 1) == (dx & 1)) {
 	    /* odd->odd or even->even */
 
@@ -301,18 +308,29 @@
     u8 *start;
     int rows;
     int bytes = p->next_line;
-    int lines = height << fontheightlog(p);
+    int lines;
     u32 size;
     u32 cval1, cval2, cval3, cval4, pcval1, pcval2;
 
     expand8ql(attr_bgcol_ec(p,conp), &cval1, &cval2, &cval3, &cval4);
 
+    if (fontheightlog(p))
+	lines = height << fontheightlog(p);
+    else
+	lines = height * fontheight(p);
+
     if (sx == 0 && width * 8 == bytes) {
-	offset = (sy * bytes) << fontheightlog(p);
+	if (fontheightlog(p))
+	    offset = (sy * bytes) << fontheightlog(p);
+	else
+	    offset = sy * bytes * fontheight(p);
 	size    = lines * bytes;
 	memset_even_8p(p->screen_base+offset, size, cval1, cval2, cval3, cval4);
     } else {
-	offset = ((sy * bytes) << fontheightlog(p)) + (sx>>1)*16 + (sx & 1);
+	if (fontheightlog(p))
+	    offset = ((sy * bytes) << fontheightlog(p)) + (sx>>1)*16 + (sx & 1);
+	else
+	    offset = sy * bytes * fontheight(p) + (sx>>1)*16 + (sx & 1);
 	start = p->screen_base + offset;
 	expand8dl(attr_bgcol_ec(p,conp), &pcval1, &pcval2);
 
@@ -348,8 +366,15 @@
     int bytes = p->next_line;
     u32 eorx1, eorx2, fgx1, fgx2, bgx1, bgx2, fdx;
 
-    dest = p->screen_base + ((yy * bytes) << fontheightlog(p)) + (xx>>1)*16 + (xx & 1);
-    cdat = p->fontdata + ((c & p->charmask) << fontheightlog(p));
+    if (fontheightlog(p)) {
+	dest = (p->screen_base + ((yy * bytes) << fontheightlog(p)) +
+		(xx>>1)*16 + (xx & 1));
+	cdat = p->fontdata + ((c & p->charmask) << fontheightlog(p));
+    } else {
+	dest = (p->screen_base + yy * bytes * fontheight(p) +
+		(xx>>1)*16 + (xx & 1));
+	cdat = p->fontdata + (c & p->charmask) * fontheight(p);
+    }
 
     expand8dl(attr_fgcol(p,c), &fgx1, &fgx2);
     expand8dl(attr_bgcol(p,c), &bgx1, &bgx2);
@@ -372,8 +397,12 @@
     u32 eorx1, eorx2, fgx1, fgx2, bgx1, bgx2, fdx;
 
     bytes = p->next_line;
-    dest0 = p->screen_base + ((yy * bytes) << fontheightlog(p)) + (xx>>1)*16 +
-	    (xx & 1);
+    if (fontheightlog(p))
+	dest0 = (p->screen_base + ((yy * bytes) << fontheightlog(p)) +
+		 (xx>>1)*16 + (xx & 1));
+    else
+	dest0 = (p->screen_base + yy * bytes * fontheight(p) +
+		 (xx>>1)*16 + (xx & 1));
 
     expand8dl(attr_fgcol(p,*s), &fgx1, &fgx2);
     expand8dl(attr_bgcol(p,*s), &bgx1, &bgx2);
@@ -389,7 +418,10 @@
 	*/
 
 	c = *s++ & p->charmask;
-	cdat  = p->fontdata + (c << fontheightlog(p));
+	if (fontheightlog(p))
+	    cdat = p->fontdata + (c << fontheightlog(p));
+	else
+	    cdat = p->fontdata + c * fontheight(p);
 
 	for(rows = fontheight(p), dest = dest0; rows-- ; dest += bytes) {
 	    fdx = dup4l(*cdat++);
@@ -405,8 +437,12 @@
     int j;
     int bytes;
 
-    dest = (p->screen_base + ((yy * p->next_line) << fontheightlog(p)) +
-	    (xx>>1)*16 + (xx & 1));
+    if (fontheightlog(p))
+	dest = (p->screen_base + ((yy * p->next_line) << fontheightlog(p)) +
+		(xx>>1)*16 + (xx & 1));
+    else
+	dest = (p->screen_base + yy * p->next_line * fontheight(p) +
+		(xx>>1)*16 + (xx & 1));
     j = fontheight(p);
     bytes = p->next_line;
 
--- include/asm-m68k/spinlock.h.~1~	Mon Aug 10 19:56:34 1998
+++ include/asm-m68k/spinlock.h	Mon Nov  9 19:42:57 1998
@@ -10,10 +10,10 @@
  */
 #if (__GNUC__ > 2) || (__GNUC__ == 2 && __GNUC_MINOR__ >= 8)
 typedef struct { } spinlock_t;
-#define SPIN_LOCK_UNLOCKED { }
+#define SPIN_LOCK_UNLOCKED (spinlock_t) { }
 #else
 typedef struct { int gcc_is_buggy; } spinlock_t;
-#define SPIN_LOCK_UNLOCKED { 0 }
+#define SPIN_LOCK_UNLOCKED (spinlock_t) { 0 }
 #endif
 
 #define spin_lock_init(lock)	do { } while(0)
@@ -38,9 +38,16 @@
  * can "mix" irq-safe locks - any writer needs to get a
  * irq-safe write-lock, but readers can get non-irqsafe
  * read-locks.
+ *
+ * Gcc-2.7.x has a nasty bug with empty initializers.
  */
+#if (__GNUC__ > 2) || (__GNUC__ == 2 && __GNUC_MINOR__ >= 8)
 typedef struct { } rwlock_t;
-#define RW_LOCK_UNLOCKED { }
+#define RW_LOCK_UNLOCKED (rwlock_t) { }
+#else
+typedef struct { int gcc_is_buggy; } rwlock_t;
+#define RW_LOCK_UNLOCKED (rwlock_t) { 0 }
+#endif
 
 #define read_lock(lock)		do { } while(0)
 #define read_unlock(lock)	do { } while(0)
--- include/asm-m68k/uaccess.h.~1~	Wed Aug 26 19:31:06 1998
+++ include/asm-m68k/uaccess.h	Fri Nov 13 18:56:49 1998
@@ -233,7 +233,8 @@
 	 "   .long 5b,8b\n"
 	 ".previous"
 	 : "=a"(to), "=a"(from), "=d"(n), "=&d"(tmp)
-	 : "r"(n & 3), "0"(to), "1"(from), "2"(n / 4));
+	 : "r"(n & 3), "0"(to), "1"(from), "2"(n / 4)
+	 : "memory");
     return n;
 }
 
@@ -514,7 +515,7 @@
 	 "13:"						\
 	 : "=a"(to), "=a"(from), "=d"(n)		\
 	 : "0"(to), "1"(from), "2"(n/4)			\
-	 : "d0")
+	 : "d0", "memory")
 
 static inline unsigned long
 __constant_copy_to_user(void *to, const void *from, unsigned long n)

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

