Date: Mon, 2 Jun 1997 09:48:44 +0200 (MET DST)
From: Geert Uytterhoeven <Geert.Uytterhoeven@cs.kuleuven.ac.be>
To: linux-m68k@phil.uni-sb.de
Subject: Re: L68K: 2.1.42
In-Reply-To: <199705301550.RAA39988@sp054.cern.ch>
Sender: owner-linux-m68k@phil.uni-sb.de
Reply-To: linux-m68k@phil.uni-sb.de

On Fri, 30 May 1997, Jes Sorensen wrote:
>I have released 2.1.42 which seems pretty nice to me.
>
>The -native patch has shrunk again, but still I need to apply some of
>the stuff from Geert.

And here they are for the list:

  - make `debug=mem' work again

  - IMHO the call to amiga_init_sound() doesn't belong in amifb.c. You should
    be able to compile a kernel for a graphics board only (without amifb).

There's also a bug in drivers/char/selection.c: Jes, you forgot to replace two
more references to video_size_row, causing a division by zero error if you
select anything on the screen. at_edge() should look like:

    static inline int atedge(const int p)  
    {
	    unsigned long size_row = get_video_size_row(fg_console);
	    return (!(p % size_row) || !((p + 2) % size_row));
    }

    (this is untested due to long Amiga compile times, my test kernel was
     cross-compiled at home).

The following patch are tested :-)

--- linux-2.1.42/fs/nfsd/nfsctl.c.orig	Sat Apr 26 21:07:09 1997
+++ linux-2.1.42/fs/nfsd/nfsctl.c	Sat May 31 16:15:23 1997
@@ -35,8 +35,8 @@
 # define copy_to_user		memcpy_tofs
 # define access_ok		!verify_area
 #endif
-#include <asm/smp.h>
-#include <asm/smp_lock.h>
+#include <linux/smp.h>
+#include <linux/smp_lock.h>
 
 extern long sys_call_table[];
 
--- linux-2.1.42/arch/m68k/amiga/config.c.orig	Sat May 31 15:48:41 1997
+++ linux-2.1.42/arch/m68k/amiga/config.c	Sat May 31 16:18:05 1997
@@ -359,6 +359,16 @@
   /* initialize chipram allocator */
   amiga_chip_init ();
 
+  /* debugging using chipram */
+  if (!strcmp( m68k_debug_device, "mem" ))
+      if (!AMIGAHW_PRESENT(CHIP_RAM))
+	  printk("Warning: no chipram present for debugging\n");
+      else {
+	  amiga_savekmsg_init();
+	  amiga_console_driver.write = amiga_mem_console_write;
+	  register_console(&amiga_console_driver);
+      }
+
   /*
    * if it is an A3000, set the magic bit that forces
    * a hard rekick
@@ -802,11 +812,8 @@
     if (!strcmp( m68k_debug_device, "ser" )) {
         /* no initialization required (?) */
 	amiga_console_driver.write = amiga_serial_console_write;
-    } else if (!strcmp( m68k_debug_device, "mem" )) {
-	amiga_savekmsg_init();
-	amiga_console_driver.write = amiga_mem_console_write;
+	register_console(&amiga_console_driver);
     }
-    register_console(&amiga_console_driver);
 }
 
 
--- linux-2.1.42/arch/m68k/amiga/amifb.c.orig	Sat May 31 15:48:41 1997
+++ linux-2.1.42/arch/m68k/amiga/amifb.c	Sat May 31 20:09:49 1997
@@ -1307,7 +1307,6 @@
 	 */
 
 extern unsigned short ami_intena_vals[];
-extern void amiga_init_sound(void);
 
 	/*
 	 * Support for Graphics Boards
@@ -1809,11 +1808,6 @@
 {
 	int err, tag, i;
 	u_long chipptr;
-
-	/*
-	 * Our beloved beeper
-	 */
-	amiga_init_sound();
 
 	/*
 	 * Check for a Graphics Board
--- linux-2.1.42/arch/m68k/amiga/config.c.orig	Sat May 31 15:48:41 1997
+++ linux-2.1.42/arch/m68k/amiga/config.c	Sat May 31 20:13:29 1997
@@ -85,6 +85,7 @@
 static void amiga_debug_init(void);
 
 extern void amiga_video_setup(char *, int *);
+extern void amiga_init_sound(void);
 
 static struct console amiga_console_driver = {
     NULL, NULL, amiga_wait_key
@@ -368,6 +369,10 @@
 	  amiga_console_driver.write = amiga_mem_console_write;
 	  register_console(&amiga_console_driver);
       }
+
+  /* our beloved beeper */
+  if (AMIGAHW_PRESENT(AMI_AUDIO))
+    amiga_init_sound();
 
   /*
    * if it is an A3000, set the magic bit that forces

Greetings,

						Geert

--
Geert Uytterhoeven                     Geert.Uytterhoeven@cs.kuleuven.ac.be
Wavelets, Linux/m68k on Amiga          http://www.cs.kuleuven.ac.be/~geert/
Department of Computer Science -- Katholieke Universiteit Leuven -- Belgium

