From: Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
Date: Wed, 16 Apr 97 10:46:00 +0200
To: linux-m68k@phil.uni-sb.de
Subject: L68K: Linux 2.1.33
X-Yow: Now, I think it would be GOOD to buy FIVE or SIX STUDEBAKERS
 and CRUISE for ARTIFICIAL FLAVORING!!
Sender: owner-linux-m68k@phil.uni-sb.de
Reply-To: linux-m68k@phil.uni-sb.de

Hi!

Here are some comments on the patch for 2.1.33:

- use of intr_count: This is now restricted to the software interrupts,
  for hardware interrupts local_irq_count should be used.  All tests of
  intr_count should be replaced by in_interrupt(), which yields now what
  it is supposed to do.  The return_from_interrupt code will again leave
  the hardware interrupts locked around the call to do_bottom_half, so
  that hardirq_trylock can be left empty.
- register_console: It is now a no-no to register a console more than
  once, thus i have removed the mach_debug_init code (which also removes
  some ugly ifdefs), replacing it with similar code that registers the
  serial output as the first thing in config_xxx() if debug=foo was given.
  Also i have removed the mach_waitbut code, this is now superceded by
  console.wait_key.
- drivers/char/Makefile: Logic changed to bring it closer to the original.
- arch/m68k/console/fbcon.c: Inline function updatescrollmode moved before
  first use.

The rest are mostly simple bug fixes.

Andreas.

----------------------------------------------------------------------
table
`!"#$%&'()*+,-./0123456789:;<=>?
@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_
--- linux-2.1.33/arch/m68k/amiga/config.c.~1~	Mon Apr 14 17:59:52 1997
+++ linux-2.1.33/arch/m68k/amiga/config.c	Mon Apr 14 19:03:51 1997
@@ -74,17 +74,21 @@
 extern void amiga_floppy_setup(char *, int *);
 #endif
 static void amiga_reset (void);
-static void amiga_waitbut(void);
+static void amiga_wait_key(void);
 extern struct consw fb_con;
 extern struct fb_info *amiga_fb_init(long *);
 extern void zorro_init(void);
 static void amiga_savekmsg_init(void);
 static void amiga_mem_console_write(const char *b, unsigned int count);
-void amiga_serial_console_write(const char *s, unsigned int count);
-static void (*amiga_debug_init(void))(const char*, unsigned int);
+static void amiga_serial_console_write(const char *s, unsigned int count);
+static void amiga_debug_init(void);
 
 extern void amiga_video_setup(char *, int *);
 
+static struct console amiga_console_driver = {
+    NULL, NULL, amiga_wait_key
+};
+
 extern void (*kd_mksound)(unsigned int, unsigned int);
 
     /*
@@ -152,6 +156,8 @@
 
   memset(&amiga_hw_present, 0, sizeof(amiga_hw_present));
 
+  amiga_debug_init();
+
   printk("Amiga hardware found: ");
   if (amiga_model >= AMI_500 && amiga_model <= AMI_DRACO)
     printk("[%s] ", amiga_models[amiga_model-AMI_500]);
@@ -335,10 +341,8 @@
   mach_floppy_setup    = amiga_floppy_setup;
 #endif
   mach_reset           = amiga_reset;
-  waitbut              = amiga_waitbut;
   conswitchp           = &fb_con;
   mach_fb_init         = amiga_fb_init;
-  mach_debug_init      = amiga_debug_init;
   mach_video_setup     = amiga_video_setup;
   kd_mksound           = amiga_mksound;
 
@@ -354,10 +358,6 @@
   /* initialize chipram allocator */
   amiga_chip_init ();
 
-  /* initialize only once here, not every time the debug level is raised */
-  if (!strcmp( m68k_debug_device, "mem" ))
-    amiga_savekmsg_init();
-
   /*
    * if it is an A3000, set the magic bit that forces
    * a hard rekick
@@ -587,7 +587,7 @@
 	return 0;
 }
 
-static void amiga_waitbut (void)
+static void amiga_wait_key (void)
 {
     int i;
 
@@ -738,7 +738,7 @@
 	;
 }
 
-void amiga_serial_console_write(const char *s, unsigned int count)
+static void amiga_serial_console_write(const char *s, unsigned int count)
 {
     while (count--) {
 	if (*s == '\n')
@@ -796,16 +796,16 @@
 }
 #endif
 
-static void (*amiga_debug_init(void))(const char*, unsigned int)
+static void amiga_debug_init(void)
 {
     if (!strcmp( m68k_debug_device, "ser" )) {
         /* no initialization required (?) */
-        return(amiga_serial_console_write);
+	amiga_console_driver.write = amiga_serial_console_write;
     } else if (!strcmp( m68k_debug_device, "mem" )) {
-        /* already initialized by config_amiga() (needed only once) */
-        return(amiga_mem_console_write);
+	amiga_savekmsg_init();
+	amiga_console_driver.write = amiga_mem_console_write;
     }
-    return(NULL);
+    register_console(&amiga_console_driver);
 }
 
 
--- linux-2.1.33/arch/m68k/atari/atafb.c.~1~	Mon Mar 24 16:47:26 1997
+++ linux-2.1.33/arch/m68k/atari/atafb.c	Mon Mar 24 17:28:38 1997
@@ -2905,7 +2905,7 @@
 		do_install_cmap(currcon);
 }
 
-static void
+static int
 atafb_setcmap(struct fb_cmap *cmap, int con)
 {
 	return(atari_fb_set_cmap(cmap, 1, con));
--- linux-2.1.33/arch/m68k/atari/ataints.c.~1~	Thu Jan 16 11:56:09 1997
+++ linux-2.1.33/arch/m68k/atari/ataints.c	Fri Apr 11 18:52:36 1997
@@ -178,7 +178,7 @@
 void atari_slow_irq_##n##_dummy (void) {				   \
 __asm__ (ALIGN_STR "\n"							   \
 SYMBOL_NAME_STR(atari_slow_irq_) #n "_handler:\t"			   \
-"	addql	#1,"SYMBOL_NAME_STR(intr_count)"\n"			   \
+"	addql	#1,"SYMBOL_NAME_STR(local_irq_count)"\n"		   \
 	SAVE_ALL "\n"							   \
 "	andb	#~(1<<(" #n "&7)),"	/* mask this interrupt */	   \
 	"("MFP_MK_BASE"+(((" #n "&8)^8)>>2)+((" #n "&16)<<3)):w\n"	   \
@@ -281,7 +281,7 @@
 SYMBOL_NAME_STR(atari_fast_irq_handler) ":
 	orw 	#0x700,%%sr		/* disable all interrupts */
 "SYMBOL_NAME_STR(atari_prio_irq_handler) ":\t
-	addql	#1,"SYMBOL_NAME_STR(intr_count)"\n"
+	addql	#1,"SYMBOL_NAME_STR(local_irq_count)"\n"
 	SAVE_ALL "
 	/* get vector number from stack frame and convert to source */
 	bfextu	%%sp@(" FORMATVEC "){#4,#10},%%d0
--- linux-2.1.33/arch/m68k/atari/atakeyb.c.~1~	Thu Feb 20 16:03:54 1997
+++ linux-2.1.33/arch/m68k/atari/atakeyb.c	Sat Apr 12 22:15:27 1997
@@ -341,7 +341,7 @@
     {
 	/* a very fast typist or a slow system, give a warning */
 	/* ...happens often if interrupts were disabled for too long */
-	printk( KERN_WARNING "Keyboard overrun\n" );
+	printk( KERN_DEBUG "Keyboard overrun\n" );
 	scancode = acia.key_data;
 	/* Turn off autorepeating in case a break code has been lost */
 	del_timer( &atakeyb_rep_timer );
--- linux-2.1.33/arch/m68k/atari/atari_ksyms.c.~1~	Mon Mar 24 16:47:27 1997
+++ linux-2.1.33/arch/m68k/atari/atari_ksyms.c	Mon Mar 24 17:29:04 1997
@@ -9,7 +9,7 @@
 #include <asm/atari_stdma.h>
 
 extern void atari_microwire_cmd( int cmd );
-
+extern int atari_SCC_reset_done;
 
 EXPORT_SYMBOL(atari_mch_cookie);
 EXPORT_SYMBOL(atari_hw_present);
@@ -25,6 +25,7 @@
 EXPORT_SYMBOL(atari_mouse_buttons);
 EXPORT_SYMBOL(atari_mouse_interrupt_hook);
 EXPORT_SYMBOL(atari_MIDI_interrupt_hook);
+EXPORT_SYMBOL(atari_SCC_reset_done);
 EXPORT_SYMBOL(ikbd_write);
 EXPORT_SYMBOL(ikbd_mouse_y0_top);
 EXPORT_SYMBOL(ikbd_mouse_thresh);
--- linux-2.1.33/arch/m68k/atari/config.c.~1~	Mon Apr 14 17:59:55 1997
+++ linux-2.1.33/arch/m68k/atari/config.c	Mon Apr 14 19:08:08 1997
@@ -83,12 +83,13 @@
 extern int atari_floppy_init (void);
 extern void atari_floppy_setup(char *, int *);
 #endif
-static void atari_waitbut (void);
 extern struct consw fb_con;
 extern struct fb_info *atari_fb_init(long *);
-static void (*atari_debug_init(void))(const char*, unsigned int);
+static void atari_debug_init(void);
 extern void atari_video_setup(char *, int *);
 
+static struct console atari_console_driver;
+
 /* Can be set somewhere, if a SCC master reset has already be done and should
  * not be repeated; used by kgdb */
 int atari_SCC_reset_done = 0;
@@ -250,6 +251,8 @@
 {
     memset(&atari_hw_present, 0, sizeof(atari_hw_present));
 
+    atari_debug_init();
+
     mach_sched_init      = atari_sched_init;
     mach_keyb_init       = atari_keyb_init;
     mach_kbdrate         = atari_kbdrate;
@@ -269,10 +272,8 @@
     mach_floppy_setup	 = atari_floppy_setup;
 #endif
     conswitchp	         = &fb_con;
-    waitbut		 = atari_waitbut;
     mach_fb_init         = atari_fb_init;
     mach_max_dma_address = 0xffffff;
-    mach_debug_init	 = atari_debug_init;
     mach_video_setup	 = atari_video_setup;
     kd_mksound		 = atari_mksound;
 
@@ -899,13 +900,6 @@
     return retval;
 }
 
-
-static void atari_waitbut (void)
-{
-    /* sorry, no-op */
-}
-
-
 static inline void ata_mfp_out (char c)
 {
     while (!(mfp.trn_stat & 0x80)) /* wait for tx buf empty */
@@ -913,7 +907,7 @@
     mfp.usart_dta = c;
 }
 
-static void ata_mfp_console_write (const char *str, unsigned int count)
+static void atari_mfp_console_write (const char *str, unsigned int count)
 {
     while (count--) {
 	if (*str == '\n')
@@ -931,9 +925,9 @@
     scc.cha_b_data = c;
 }
 
-static void ata_scc_console_write (const char *str, unsigned int count)
+static void atari_scc_console_write (const char *str, unsigned int count)
 {
-    while (cout--) {
+    while (count--) {
 	if (*str == '\n')
 	    ata_scc_out( '\r' );
 	ata_scc_out( *str++ );
@@ -961,7 +955,7 @@
     return( 1 );
 }
 
-static void ata_par_console_write (const char *str, unsigned int count)
+static void atari_par_console_write (const char *str, unsigned int count)
 {
     static int printer_present = 1;
 
@@ -982,7 +976,7 @@
 }
 
 
-static void (*atari_debug_init(void))(const char*, unsigned int)
+static void atari_debug_init(void)
 {
 #ifdef CONFIG_KGDB
 	/* if the m68k_debug_device is used by the GDB stub, do nothing here */
@@ -1006,7 +1000,7 @@
 	mfp.tim_dt_d   = 2;     /* 9600 bps */
 	mfp.tim_ct_cd |= 0x01;  /* start timer D, 1:4 */
 	mfp.trn_stat  |= 0x01;  /* enable TX */
-	return(ata_mfp_console_write);
+	atari_console_driver.write = atari_mfp_console_write;
     }
     else if (!strcmp( m68k_debug_device, "ser2" )) {
 	/* SCC Modem2 serial port */
@@ -1032,7 +1026,7 @@
 	    scc.cha_b_ctrl = *p++;
 	    MFPDELAY();
 	}
-	return(ata_scc_console_write);
+	atari_console_driver.write = atari_scc_console_write;
     }
     else if (!strcmp( m68k_debug_device, "par" )) {
 	/* parallel printer */
@@ -1043,28 +1037,10 @@
 	sound_ym.wd_data = 0;          /* no char */
 	sound_ym.rd_data_reg_sel = 14; /* select port A */
 	sound_ym.wd_data = sound_ym.rd_data_reg_sel | 0x20; /* strobe H */
-	return(ata_par_console_write);
-    }
-    return(NULL);
-}
-
-
-void ata_serial_print(const char *str)
-{
-  int c;
-
-  while (c = *str++, c != 0)
-    {
-      if (c == '\n')
-	{
-	  while (!(mfp.trn_stat & (1 << 7)))
-	    barrier ();
-	  mfp.usart_dta = '\r';
-	}
-      while (!(mfp.trn_stat & (1 << 7)))
-	barrier ();
-      mfp.usart_dta = c;
+	atari_console_driver.write = atari_par_console_write;
     }
+    if (atari_console_driver.write)
+	register_console(&atari_console_driver);
 }
 
 /* ++roman:
--- linux-2.1.33/arch/m68k/console/fbcon.c.~1~	Mon Apr 14 18:00:03 1997
+++ linux-2.1.33/arch/m68k/console/fbcon.c	Tue Apr 15 00:30:59 1997
@@ -612,6 +612,19 @@
 }
 
 
+static __inline__ void updatescrollmode(struct display *p)
+{
+   if (divides(p->ywrapstep, p->fontheight) &&
+       divides(p->fontheight, p->var.yres_virtual))
+      p->scrollmode = SCROLL_YWRAP;
+   else if (divides(p->ypanstep, p->fontheight) &&
+            p->var.yres_virtual >= p->var.yres+p->fontheight)
+      p->scrollmode = SCROLL_YPAN;
+   else
+      p->scrollmode = SCROLL_YMOVE;
+}
+
+
 static void fbcon_setup(int con, int setcol, int init)
 {
    struct display *p = &disp[con];
@@ -1568,19 +1581,6 @@
 }
 
 
-static __inline__ void updatescrollmode(struct display *p)
-{
-   if (divides(p->ywrapstep, p->fontheight) &&
-       divides(p->fontheight, p->var.yres_virtual))
-      p->scrollmode = SCROLL_YWRAP;
-   else if (divides(p->ypanstep, p->fontheight) &&
-            p->var.yres_virtual >= p->var.yres+p->fontheight)
-      p->scrollmode = SCROLL_YPAN;
-   else
-      p->scrollmode = SCROLL_YMOVE;
-}
-
-
 static __inline__ void ywrap_up(int unit, struct display *p, int count)
 {
    p->yscroll += count;
@@ -2818,7 +2818,7 @@
 
 	c &= 0xff;
 
-    dest  = p->screen_base + yy * p->fontheight * bytes + (x>>1)*4 + (xx & 1);
+    dest  = p->screen_base + yy * p->fontheight * bytes + (xx>>1)*4 + (xx & 1);
     cdat  = p->fontdata + (c * p->fontheight);
 
 	fgx   = expand2w(COLOR_2P(attr_fgcol(p,conp)));
@@ -2843,7 +2843,7 @@
 	ulong			  eorx, fgx, bgx, fdx;
 
     bytes = p->next_line;
-    dest0 = p->screen_base + yy * p->fontheight * bytes + (x>>1)*4 + (xx & 1);
+    dest0 = p->screen_base + yy * p->fontheight * bytes + (xx>>1)*4 + (xx & 1);
 	fgx   = expand2w(COLOR_2P(attr_fgcol(p,conp)));
 	bgx   = expand2w(COLOR_2P(attr_bgcol(p,conp)));
 	eorx  = fgx ^ bgx;
@@ -2869,7 +2869,7 @@
    int j;
    int bytes;
 
-   dest = p->screen_base + yy * p->fontheight * p->next_line + (x>>1)*4 + (xx & 1);
+   dest = p->screen_base + yy * p->fontheight * p->next_line + (xx>>1)*4 + (xx & 1);
    j = p->fontheight;
    bytes = p->next_line;
    while (j--)
@@ -3081,7 +3081,7 @@
 
 	c &= 0xff;
 
-    dest  = p->screen_base + yy * p->fontheight * bytes + (x>>1)*8 + (x & 1);
+    dest  = p->screen_base + yy * p->fontheight * bytes + (xx>>1)*8 + (xx & 1);
     cdat  = p->fontdata + (c * p->fontheight);
 
 	fgx   = expand4l(attr_fgcol(p,conp));
@@ -3106,7 +3106,7 @@
 	ulong			  eorx, fgx, bgx, fdx;
 
     bytes = p->next_line;
-    dest0 = p->screen_base + yy * p->fontheight * bytes + (x>>1)*8 + (x & 1);
+    dest0 = p->screen_base + yy * p->fontheight * bytes + (xx>>1)*8 + (xx & 1);
 	fgx   = expand4l(attr_fgcol(p,conp));
 	bgx   = expand4l(attr_bgcol(p,conp));
 	eorx  = fgx ^ bgx;
@@ -3139,7 +3139,7 @@
    int j;
    int bytes;
 
-   dest = p->screen_base + yy * p->fontheight * p->next_line + (x>>1)*8 + (x & 1);
+   dest = p->screen_base + yy * p->fontheight * p->next_line + (xx>>1)*8 + (xx & 1);
    j = p->fontheight;
    bytes = p->next_line;
 
@@ -3361,7 +3361,7 @@
 
 	c &= 0xff;
 
-    dest  = p->screen_base + yy * p->fontheight * bytes + (x>>1)*16 + (x & 1);
+    dest  = p->screen_base + yy * p->fontheight * bytes + (xx>>1)*16 + (xx & 1);
     cdat  = p->fontdata + (c * p->fontheight);
 
 	expand8dl(attr_fgcol(p,conp), &fgx1, &fgx2);
@@ -3391,7 +3391,7 @@
 	ulong			  eorx1, eorx2, fgx1, fgx2, bgx1, bgx2, fdx;
 
     bytes = p->next_line;
-    dest0 = p->screen_base + yy * p->fontheight * bytes + (x>>1)*16 + (x & 1);
+    dest0 = p->screen_base + yy * p->fontheight * bytes + (xx>>1)*16 + (xx & 1);
 
 	expand8dl(attr_fgcol(p,conp), &fgx1, &fgx2);
 	expand8dl(attr_bgcol(p,conp), &bgx1, &bgx2);
@@ -3430,7 +3430,7 @@
    int j;
    int bytes;
 
-   dest = p->screen_base + yy * p->fontheight * p->next_line + (x>>1)*16 + (x & 1);
+   dest = p->screen_base + yy * p->fontheight * p->next_line + (xx>>1)*16 + (xx & 1);
    j = p->fontheight;
    bytes = p->next_line;
 
--- linux-2.1.33/arch/m68k/kernel/entry.S.~1~	Mon Apr 14 18:00:07 1997
+++ linux-2.1.33/arch/m68k/kernel/entry.S	Mon Apr 14 19:10:52 1997
@@ -260,7 +260,7 @@
 	movel	%d0,%sp@(LORIG_D0)	| a -1 in the ORIG_D0 field
 					| signifies that the stack frame
 					| is NOT for syscall
-	addql	#1,SYMBOL_NAME(intr_count)
+	addql	#1,SYMBOL_NAME(local_irq_count)
 					|  put exception # in d0
 	bfextu %sp@(LFORMATVEC){#4,#10},%d0
 
@@ -271,22 +271,21 @@
 
 SYMBOL_NAME_LABEL(ret_from_interrupt)
 	/* check if we need to do software interrupts */
-1:
-	subql	#1,SYMBOL_NAME(intr_count)
+	movel	SYMBOL_NAME(local_irq_count),%d1
+	subql	#1,%d1
 	jne	4f
-	bfextu  %sp@(LSR){#5,#3},%d0    | Check for nested interrupt.
-#if MAX_NOINT_IPL > 0
-	cmpiw	#MAX_NOINT_IPL,%d0
-#endif
-	jhi	4f
-2:
+	tstl	SYMBOL_NAME(intr_count)
+	jne	3f
 	movel	SYMBOL_NAME(bh_active),%d0
 	andl	SYMBOL_NAME(bh_mask),%d0
-	jeq	SYMBOL_NAME(ret_from_exception)
+	jeq	3f
 
 	jbsr	SYMBOL_NAME(do_bottom_half)
-	jbra	2b
+3:	
+	clrl	SYMBOL_NAME(local_irq_count)
+	jra	SYMBOL_NAME(ret_from_exception)
 4:
+	movel	%d1,SYMBOL_NAME(local_irq_count)
 	RESTORE_ALL
 
 
@@ -350,8 +349,10 @@
 	/* save sr */
 	movew	%sr,%a0@(LTSS_SR)
 
+#if 0
 	/* disable interrupts */
 	oriw	#0x0700,%sr
+#endif
 
 	/* save fs (sfc,%dfc) (may be pointing to kernel memory) */
 	movec	%sfc,%d0
--- linux-2.1.33/arch/m68k/kernel/kgdb.c.~1~	Mon Feb 17 17:33:08 1997
+++ linux-2.1.33/arch/m68k/kernel/kgdb.c	Fri Apr 11 18:53:35 1997
@@ -828,7 +828,7 @@
   "		cmpb	#3,%d0\n"			/* is it C-c ? */
   "		bne		2b\n"				/* no -> just ignore  */
   "		orw		#0x700,%sr\n"		/* disable interrupts */
-  "		subql	#1,"SYMBOL_NAME_STR(intr_count)"\n"
+  "		subql	#1,"SYMBOL_NAME_STR(local_irq_count)"\n"
   "		movel	%sp@(12),%sp\n"		/* revert stack to where 'inthandler' set
 									 * it up */
   /* restore regs from frame */
--- linux-2.1.33/arch/m68k/kernel/m68k_ksyms.c.~1~	Mon Apr 14 18:00:08 1997
+++ linux-2.1.33/arch/m68k/kernel/m68k_ksyms.c	Mon Apr 14 19:12:02 1997
@@ -13,6 +13,7 @@
 #include <asm/irq.h>
 #include <asm/semaphore.h>
 #include <asm/checksum.h>
+#include <asm/hardirq.h>
 
 asmlinkage long long __ashrdi3 (long long, int);
 extern char m68k_debug_device[];
@@ -38,6 +39,7 @@
 EXPORT_SYMBOL(strnlen);
 EXPORT_SYMBOL(strrchr);
 EXPORT_SYMBOL(strstr);
+EXPORT_SYMBOL(local_irq_count);
 
 /* Networking helper routines. */
 EXPORT_SYMBOL(csum_partial_copy);
--- linux-2.1.33/arch/m68k/kernel/process.c.~1~	Mon Apr 14 18:00:09 1997
+++ linux-2.1.33/arch/m68k/kernel/process.c	Fri Apr 11 18:13:24 1997
@@ -44,6 +44,7 @@
 		goto out;
 
 	/* endless idle loop with no priority at all */
+	current->priority = -100;
 	current->counter = -100;
 	for (;;)
 		schedule();
--- linux-2.1.33/arch/m68k/kernel/setup.c.~1~	Mon Apr 14 18:00:10 1997
+++ linux-2.1.33/arch/m68k/kernel/setup.c	Tue Apr 15 17:25:26 1997
@@ -55,12 +55,6 @@
 static char m68k_command_line[CL_SIZE];
 char saved_command_line[CL_SIZE];
 
-/* setup some dummy routines */
-static void dummy_func(void)
-{}
-#define dummy_waitbut	dummy_func
-#define dummy_wait_key	dummy_func
-
 void (*mach_sched_init) (void (*handler)(int, void *, struct pt_regs *));
 /* machine dependent keyboard functions */
 int (*mach_keyb_init) (void);
@@ -79,10 +73,8 @@
 int (*mach_hwclk) (int, struct hwclk_time*) = NULL;
 int (*mach_set_clock_mmss) (unsigned long) = NULL;
 void (*mach_reset)( void );
-void (*waitbut)(void) = dummy_waitbut;
 struct fb_info *(*mach_fb_init)(long *);
 long mach_max_dma_address = 0x00ffffff; /* default set to the lower 16MB */
-void (*(*mach_debug_init)(void))(const char*, unsigned int) = NULL;
 void (*mach_video_setup) (char *, int *);
 #ifdef CONFIG_BLK_DEV_FD
 int (*mach_floppy_init) (void) = NULL;
@@ -319,25 +311,6 @@
 		   loops_per_sec));
 
 }
-
-static int debug_console_device(void)
-{
-	return 0;
-}
-
-static struct console debug_printk_console = {
-	NULL,
-	NULL,
-	dummy_wait_key,
-	debug_console_device
-};
-
-void m68k_debug_init(void)
-{
-    if (mach_debug_init && (debug_printk_console.write = mach_debug_init()))
-	    register_console(&debug_printk_console);
-}
-
 
 int get_hardware_list(char *buffer)
 {
--- linux-2.1.33/arch/m68k/kernel/traps.c.~1~	Mon Apr 14 18:00:10 1997
+++ linux-2.1.33/arch/m68k/kernel/traps.c	Thu Apr 10 10:59:25 1997
@@ -140,13 +140,10 @@
 }
 
 
-extern void m68k_debug_init(void);
-
 static inline void console_verbose(void)
 {
 	extern int console_loglevel;
 	console_loglevel = 15;
-	m68k_debug_init();
 }
 
 static char *vec_names[] = {
--- linux-2.1.33/drivers/block/ataflop.c.~1~	Mon Apr 14 18:00:52 1997
+++ linux-2.1.33/drivers/block/ataflop.c	Thu Apr 10 09:27:32 1997
@@ -410,7 +410,7 @@
 static int fd_test_drive_present( int drive );
 static void config_types( void );
 static int floppy_open( struct inode *inode, struct file *filp );
-static void floppy_release( struct inode * inode, struct file * filp );
+static int floppy_release( struct inode * inode, struct file * filp );
 
 /************************* End of Prototypes **************************/
 
--- linux-2.1.33/drivers/block/genhd.c.~1~	Mon Apr 14 18:00:56 1997
+++ linux-2.1.33/drivers/block/genhd.c	Fri Apr 11 18:15:21 1997
@@ -695,7 +695,7 @@
   int part_fmt = 0; /* 0:unknown, 1:AHDI, 2:ICD/Supra */
 #endif
 
-  bh = bread (dev, 0, 1024);
+  bh = bread (dev, 0, get_ptable_blocksize(dev));
   if (!bh)
     {
       printk (" unable to read block 0\n");
--- linux-2.1.33/drivers/block/rd.c.~1~	Mon Apr 14 18:01:14 1997
+++ linux-2.1.33/drivers/block/rd.c	Thu Apr 10 09:27:52 1997
@@ -201,7 +201,7 @@
 {
 	unsigned long i;
 
-	if (--initrd_users) return;
+	if (--initrd_users) return 0;
 	for (i = initrd_start; i < initrd_end; i += PAGE_SIZE)
 		free_page(i);
 	initrd_start = 0;
--- linux-2.1.33/drivers/char/Makefile.~1~	Mon Apr 14 18:01:39 1997
+++ linux-2.1.33/drivers/char/Makefile	Tue Apr 15 16:52:36 1997
@@ -23,19 +23,14 @@
 L_OBJS   := tty_io.o n_tty.o tty_ioctl.o pty.o mem.o random.o
 
 ifdef CONFIG_VT
-ifeq "$(ARCH)" "i386"
-L_OBJS += console.o vt.o vc_screen.o consolemap.o keyboard.o defkeymap.o
-endif
-
-ifeq "$(ARCH)" "alpha"
-L_OBJS += console.o vt.o vc_screen.o consolemap.o keyboard.o defkeymap.o
-endif
+L_OBJS += vt.o vc_screen.o consolemap.o
+LX_OBJS += selection.o
 
 ifeq "$(ARCH)" "m68k"
-L_OBJS += fbmem.o keyboard.o vt.o vc_screen.o consolemap.o defkeymap.o
+L_OBJS += fbmem.o
+else
+L_OBJS += console.o
 endif
-
-LX_OBJS += selection.o
 endif
 
 ifeq ($(CONFIG_AMIGA_GSP),y)
@@ -161,6 +156,12 @@
 
 endif
 
+ifndef CONFIG_SUN_KEYBOARD
+ifdef CONFIG_VT
+L_OBJS += keyboard.o defkeymap.o
+endif
+endif
+
 ifeq ($(CONFIG_DIGI),y)
 L_OBJS += pcxx.o
 else
--- linux-2.1.33/drivers/char/atari_SCC.c.~1~	Mon Apr 14 18:01:45 1997
+++ linux-2.1.33/drivers/char/atari_SCC.c	Tue Apr 15 00:27:41 1997
@@ -1054,8 +1054,8 @@
 			                   IPR_A_RX : IPR_B_RX;
 #ifdef CONFIG_ATARI_SCC_DMA
 	int isdma = (CHANNR(info) == CHANNEL_A) && scca_dma;
-#endif
 	ulong flags = 0;
+#endif
 
 	SETUP_INFO(info);
 
--- linux-2.1.33/drivers/char/m68kserial.c.~1~	Mon Mar 24 16:48:26 1997
+++ linux-2.1.33/drivers/char/m68kserial.c	Mon Mar 10 18:20:10 1997
@@ -151,7 +151,7 @@
 
 #ifdef CONFIG_PROC_FS
 static int rs_read_proc (char *buffer, char **start, off_t offset, int size,
-			 void *data)
+			 int *eof, void *data)
 {
     int len, i;
     off_t begin = 0;
@@ -184,13 +184,14 @@
 	len += sprintf(buffer + len, "\n");
 
 	if (len + begin > offset + size)
-	    break;
+	    goto done;
 	if (len + begin < offset) {
 	    begin += len;
 	    len = 0;
 	}
     }
-
+    *eof = 1;
+done:
     if (offset >= len + begin)
 	return 0;
     *start = buffer + (begin - offset);
--- linux-2.1.33/drivers/char/vt.c.~1~	Mon Apr 14 18:02:29 1997
+++ linux-2.1.33/drivers/char/vt.c	Fri Apr 11 18:30:23 1997
@@ -535,7 +535,7 @@
 		/*
 		 * this is naive.
 		 */
-		ucval = KB_101;
+		ucval = mach_keyboard_type;
 		goto setchar;
 
 #ifdef __mc68000__
--- linux-2.1.33/drivers/scsi/atari_NCR5380.c.~1~	Mon Feb 17 17:36:58 1997
+++ linux-2.1.33/drivers/scsi/atari_NCR5380.c	Mon Apr 14 20:03:50 1997
@@ -1026,7 +1026,7 @@
      * If we're not in an interrupt, we can call NCR5380_main()
      * unconditionally, because it cannot be already running.
      */
-    if (intr_count > 0 || ((flags >> 8) & 7) >= 6)
+    if (in_interrupt() || ((flags >> 8) & 7) >= 6)
 	queue_main();
     else
 	NCR5380_main();
--- linux-2.1.33/drivers/scsi/atari_scsi.c.~1~	Mon Mar 24 16:51:06 1997
+++ linux-2.1.33/drivers/scsi/atari_scsi.c	Tue Apr 15 16:59:31 1997
@@ -554,11 +554,11 @@
 	save_flags(oldflags);
 	cli();
 
-	while( intr_count == 0 && falcon_got_lock && stdma_others_waiting() )
+	while (!in_interrupt() && falcon_got_lock && stdma_others_waiting())
 		sleep_on( &falcon_fairness_wait );
 
 	while (!falcon_got_lock) {
-		if (intr_count > 0)
+		if (in_interrupt())
 			panic( "Falcon SCSI hasn't ST-DMA lock in interrupt" );
 		if (!falcon_trying_lock) {
 			falcon_trying_lock = 1;
--- linux-2.1.33/include/asm-m68k/machdep.h.~1~	Mon Apr 14 18:07:38 1997
+++ linux-2.1.33/include/asm-m68k/machdep.h	Mon Apr 14 19:47:20 1997
@@ -33,10 +33,8 @@
 extern int (*mach_floppy_init) (void);
 extern unsigned long (*mach_hd_init) (unsigned long, unsigned long);
 extern void (*mach_hd_setup)(char *, int *);
-extern void (*waitbut)(void);
 extern struct fb_info *(*mach_fb_init)(long *);
 extern long mach_max_dma_address;
-extern void (*(*mach_debug_init)(void))(const char*, unsigned int);
 extern void (*mach_video_setup)(char *, int *);
 extern void (*mach_floppy_setup)(char *, int *);
 extern void (*mach_floppy_eject)(void);
--- linux-2.1.33/include/asm-m68k/serial.h.~1~	Tue Mar  4 17:03:28 1997
+++ linux-2.1.33/include/asm-m68k/serial.h	Thu Mar 27 20:33:41 1997
@@ -286,7 +286,7 @@
 static __inline__ void rs_sched_event(struct async_struct *info, int event)
 {
 	info->event |= 1 << event;
-	queue_task_irq(&info->tqueue, &tq_serial);
+	queue_task(&info->tqueue, &tq_serial);
 	mark_bh(SERIAL_BH);
 }
 
@@ -305,7 +305,7 @@
 	*tty->flip.flag_buf_ptr++ = err;
 	*tty->flip.char_buf_ptr++ = ch;
 	info->icount.rx++;
-	queue_task_irq(&tty->flip.tqueue, &tq_timer);
+	queue_task(&tty->flip.tqueue, &tq_timer);
 }
 
 static __inline__ int rs_get_tx_char( struct async_struct *info )
@@ -356,8 +356,7 @@
 #ifdef SERIAL_DEBUG_OPEN
 			printk("scheduling hangup...");
 #endif
-			queue_task_irq(&info->tqueue_hangup,
-				       &tq_scheduler);
+			queue_task(&info->tqueue_hangup, &tq_scheduler);
 		}
 	}
 }
--- linux-2.1.33/include/asm-m68k/system.h.~1~	Mon Apr 14 18:07:40 1997
+++ linux-2.1.33/include/asm-m68k/system.h	Thu Mar 27 20:30:14 1997
@@ -79,8 +79,6 @@
 #define __restore_flags(x) \
 __asm__ __volatile__("movew %0,%/sr": /* no outputs */ :"d" (x) : "memory")
 
-#define iret() __asm__ __volatile__ ("rte": : :"memory", "sp", "cc")
-
 #define cli() __cli()
 #define sti() __sti()
 #define save_flags(x) __save_flags(x)
--- linux-2.1.33/include/asm-m68k/termbits.h.~1~	Mon May 13 20:32:09 1996
+++ linux-2.1.33/include/asm-m68k/termbits.h	Tue Mar  4 16:59:00 1997
@@ -123,6 +123,7 @@
 #define  B230400 0010003
 #define  B460800 0010004
 #define CIBAUD	  002003600000	/* input baud rate (not used) */
+#define CMSPAR	  010000000000		/* mark or space (stick) parity */
 #define CRTSCTS	  020000000000		/* flow control */
 
 /* c_lflag bits */
--- linux-2.1.33/include/asm-m68k/termios.h.~1~	Mon Apr 14 18:07:41 1997
+++ linux-2.1.33/include/asm-m68k/termios.h	Mon Apr 14 19:34:23 1997
@@ -53,6 +53,7 @@
 #define N_PPP		3
 #define N_STRIP		4
 #define N_AX25		5
+#define N_X25		6	/* X.25 async */
 
 #ifdef __KERNEL__
 
--- linux-2.1.33/init/main.c.~1~	Mon Apr 14 18:09:15 1997
+++ linux-2.1.33/init/main.c	Mon Apr 14 19:44:15 1997
@@ -56,10 +56,6 @@
 #error sorry, your GCC is too old. It builds incorrect kernels.
 #endif
 
-#ifdef __mc68000__
-#include <asm/machdep.h>
-#endif /* __mc68000__ */
-
 extern char _stext, _etext;
 extern char *linux_banner;
 
@@ -747,9 +743,6 @@
 		}
 		if (!strcmp(line,"debug")) {
 			console_loglevel = 10;
-#ifdef __mc68000__
-			mach_debug_init();
-#endif /* __mc68000__ */
 			continue;
 		}
 		if (!strcmp(line,"serdebug")) {
--- linux-2.1.33/ipc/msg.c.~1~	Mon Jan 27 20:19:39 1997
+++ linux-2.1.33/ipc/msg.c	Fri Apr 11 20:11:56 1997
@@ -774,7 +774,7 @@
 		return -ENODEV;
 
 	/* Do not wait for an answer at interrupt-time! */
-	if (intr_count)
+	if (in_interrupt())
 		ret_size &= ~KERNELD_WAIT;
 #ifdef NEW_KERNELD_PROTOCOL
 	else
--- linux-2.1.33/kernel/printk.c.~1~	Mon Apr 14 18:09:20 1997
+++ linux-2.1.33/kernel/printk.c	Fri Apr 11 18:41:13 1997
@@ -48,10 +48,6 @@
 int minimum_console_loglevel = MINIMUM_CONSOLE_LOGLEVEL;
 int default_console_loglevel = DEFAULT_CONSOLE_LOGLEVEL;
 
-#ifdef __mc68000__
-#include <asm/machdep.h>
-void (*debug_print_proc)(const char *) = 0;
-#endif
 struct console *console_drivers = NULL;
 static char log_buf[LOG_BUF_LEN];
 static unsigned long log_start = 0;
@@ -163,10 +159,6 @@
 		if (len < minimum_console_loglevel)
 			len = minimum_console_loglevel;
 		console_loglevel = len;
-#ifdef __mc68000__
-		if (len == 8)
-			mach_debug_init();
-#endif
 		error = 0;
 		break;
 	default:
@@ -234,14 +226,6 @@
 				c = c->next;
 			}
 		}
-#ifdef __mc68000__
-		if ((msg_level == 0 || console_loglevel >= 8) && debug_print_proc) {
-			char tmp = p[1];
-			p[1] = '\0';
-			(*debug_print_proc)(msg);
-			p[1] = tmp;
-		}
-#endif
 		if (line_feed)
 			msg_level = -1;
 	}
