Date: Fri, 21 Mar 1997 10:24:04 +0100 (MET)
From: Geert Uytterhoeven <Geert.Uytterhoeven@cs.kuleuven.ac.be>
To: linux-m68k@phil.uni-sb.de
Subject: Re: L68K: Patches for 2.1.29
In-Reply-To: <Pine.LNX.3.95q.970320173320.22873f-100000@mercator.cs.kuleuven.ac.be>
Sender: owner-linux-m68k@phil.uni-sb.de
Reply-To: linux-m68k@phil.uni-sb.de

On Thu, 20 Mar 1997, I wrote:
>OK, I'll change that.

And so I did...

Replace my diffs for drivers/char/keyboard.c and kernel/ksyms.c with the
following.

BTW, since this affects the SPARC guys too, to whom should I send them?

Here's another small fix for fbcon (got lost?) too.

--- linux-2.1.29/arch/i386/kernel/setup.c.orig	Sun Feb 16 22:23:56 1997
+++ linux-2.1.29/arch/i386/kernel/setup.c	Thu Mar 20 20:27:51 1997
@@ -73,7 +73,9 @@
 	unsigned char table[0];
 };
 
+#if defined(CONFIG_PSMOUSE) || defined(CONFIG_PSMOUSE_MODULE)
 unsigned char aux_device_present;
+#endif
 
 #ifdef CONFIG_BLK_DEV_RAM
 extern int rd_doload;		/* 1 = load ramdisk, 0 = don't load */
@@ -141,7 +143,9 @@
 		machine_submodel_id = SYS_DESC_TABLE.table[1];
 		BIOS_revision = SYS_DESC_TABLE.table[2];
 	}
+#if defined(CONFIG_PSMOUSE) || defined(CONFIG_PSMOUSE_MODULE)
 	aux_device_present = AUX_DEVICE_INFO;
+#endif
 #ifdef STANDARD_MEMORY_BIOS_CALL
 	memory_end = (1<<20) + (EXT_MEM_K<<10);
 #else
--- linux-2.1.29/arch/alpha/kernel/setup.c.orig	Thu Jan  9 20:53:06 1997
+++ linux-2.1.29/arch/alpha/kernel/setup.c	Thu Mar 20 20:28:10 1997
@@ -36,7 +36,9 @@
 
 struct hwrpb_struct *hwrpb;
 
+#if defined(CONFIG_PSMOUSE) || defined(CONFIG_PSMOUSE_MODULE)
 unsigned char aux_device_present = 0xaa;
+#endif
 
 /*
  * This is setup by the secondary bootstrap loader.  Because
--- linux-2.1.29/arch/mips/kernel/setup.c.orig	Thu Dec 21 11:05:17 1995
+++ linux-2.1.29/arch/mips/kernel/setup.c	Thu Mar 20 20:28:35 1997
@@ -193,7 +193,9 @@
 struct drive_info_struct drive_info;
 struct screen_info screen_info = SCREEN_INFO;
 
+#if defined(CONFIG_PSMOUSE) || defined(CONFIG_PSMOUSE_MODULE)
 unsigned char aux_device_present;
+#endif
 extern int ramdisk_size;
 extern int root_mountflags;
 extern int _end;
--- linux-2.1.29/arch/ppc/kernel/setup.c.orig	Thu Jan  9 21:01:36 1997
+++ linux-2.1.29/arch/ppc/kernel/setup.c	Thu Mar 20 20:28:57 1997
@@ -35,7 +35,9 @@
 extern int probingmem;
 unsigned long empty_zero_page[1024];
 
+#if defined(CONFIG_PSMOUSE) || defined(CONFIG_PSMOUSE_MODULE)
 unsigned char aux_device_present;
+#endif
 #ifdef CONFIG_BLK_DEV_RAM
 extern int rd_doload;		/* 1 = load ramdisk, 0 = don't load */
 extern int rd_prompt;		/* 1 = prompt for ramdisk, 0 = don't prompt */
@@ -227,7 +229,9 @@
         ROOT_DEV = to_kdev_t(0x0801); /* sda1 */
         break;
   }
+#if defined(CONFIG_PSMOUSE) || defined(CONFIG_PSMOUSE_MODULE)
   aux_device_present = 0xaa;
+#endif
 
   panic_timeout = 300;		/* reboot on panic */
   
--- linux-2.1.29/drivers/char/keyboard.c.orig	Tue Mar 18 23:50:21 1997
+++ linux-2.1.29/drivers/char/keyboard.c	Thu Mar 20 20:32:13 1997
@@ -1,4 +1,3 @@
-extern void allow_interrupts(void);
 /*
  * linux/drivers/char/keyboard.c
  *
@@ -74,7 +73,9 @@
 extern void scrollback(int);
 extern void scrollfront(int);
 
+#if defined(CONFIG_PSMOUSE) || defined(CONFIG_PSMOUSE_MODULE)
 unsigned char kbd_read_mask = 0x01;	/* modified by psaux.c */
+#endif
 
 /*
  * global state includes the following, and various static variables
@@ -609,9 +610,11 @@
 	do {
 		unsigned char scancode;
 
+#if defined(CONFIG_PSMOUSE) || defined(CONFIG_PSMOUSE_MODULE)
 		/* mouse data? */
 		if (status & kbd_read_mask & 0x20)
 			break;
+#endif
 
 		scancode = inb(0x60);
 		if (status & 0x01)
@@ -629,6 +632,9 @@
  * for an acknowledge, possibly retrying if asked to. Returns
  * the success status.
  */
+
+extern void allow_interrupts(void);
+
 static int send_data(unsigned char data)
 {
 	int retries = 3;
--- linux-2.1.29/drivers/sbus/char/sunkbd.c.orig	Sun Feb 16 22:22:38 1997
+++ linux-2.1.29/drivers/sbus/char/sunkbd.c	Thu Mar 20 20:22:51 1997
@@ -63,9 +63,6 @@
 extern void scrollback(int);
 extern void scrollfront(int);
 
-unsigned char kbd_read_mask = 0x01;	  /* modified by psaux.c */
-unsigned char aux_device_present = 0x00;  /* To make kernel/ksyms.c happy */
-
 /*
  * global state includes the following, and various static variables
  * in this module: prev_scancode, shift_state, diacr, npadch, dead_key_next.
--- linux-2.1.29/kernel/ksyms.c.orig	Thu Mar 20 20:18:43 1997
+++ linux-2.1.29/kernel/ksyms.c	Thu Mar 20 20:26:25 1997
@@ -53,7 +53,9 @@
 extern struct drive_info_struct drive_info;
 #endif
 
+#ifdef CONFIG_PSMOUSE_MODULE
 extern unsigned char aux_device_present, kbd_read_mask;
+#endif
 
 #ifdef CONFIG_PCI
 #include <linux/bios32.h>
@@ -349,7 +351,7 @@
 EXPORT_SYMBOL(add_mouse_randomness);
 EXPORT_SYMBOL(fasync_helper);
 
-#ifndef __mc68000__
+#ifdef CONFIG_PSMOUSE_MODULE
 /* psaux mouse */
 EXPORT_SYMBOL(aux_device_present);
 EXPORT_SYMBOL(kbd_read_mask);



--- ./arch/m68k/console/fbcon.c.orig	Tue Mar 18 23:50:11 1997
+++ ./arch/m68k/console/fbcon.c	Thu Mar 20 20:53:43 1997
@@ -1960,8 +1960,8 @@
    u_char *src, *dest;
    u_int rows;
 
-   if (sx == 0 && sy == 0 && width == p->next_line) {
-      src = p->screen_base;
+   if (sx == 0 && dx == 0 && width == p->next_line) {
+      src = p->screen_base+sy*p->fontheight*width;
       dest = p->screen_base+dy*p->fontheight*width;
       mymemmove(dest, src, height*p->fontheight*width);
    } else if (dy <= sy) {
@@ -2095,8 +2095,9 @@
 static void bmove_ilbm(struct display *p, int sy, int sx, int dy, int dx,
                        int height, int width)
 {
-   if (sx == 0 && sy == 0 && width == p->next_plane)
-      mymemmove(p->screen_base+dy*p->fontheight*p->next_line, p->screen_base,
+   if (sx == 0 && dx == 0 && width == p->next_plane)
+      mymemmove(p->screen_base+dy*p->fontheight*p->next_line,
+      		p->screen_base+sy*p->fontheight*p->next_line,
                 height*p->fontheight*p->next_line);
    else {
       u_char *src, *dest;
@@ -2317,8 +2318,8 @@
    u_char *src, *dest, *src0, *dest0;
    u_int i, rows;
 
-   if (sx == 0 && sy == 0 && width == p->next_line) {
-      src = p->screen_base;
+   if (sx == 0 && dx == 0 && width == p->next_line) {
+      src = p->screen_base+sy*p->fontheight*width;
       dest = p->screen_base+dy*p->fontheight*width;
       for (i = p->var.bits_per_pixel; i--;) {
          mymemmove(dest, src, height*p->fontheight*width);

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

