From: Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
Date: Wed, 30 Jul 97 10:24:57 +0200
To: linux-m68k@phil.uni-sb.de
Subject: L68K: Linux 2.1.47
X-Yow: It's 74 degrees, 12 minutes NORTH, and 41 degrees, 3 minutes EAST!!
 Soon, it will be TUESDAY!!
Sender: owner-linux-m68k@phil.uni-sb.de
Reply-To: linux-m68k@phil.uni-sb.de

Hi!

Here's the usual patch :-)  that fixes a few problems in 2.1.47.

Andreas.

----------------------------------------------------------------------
--- linux/arch/m68k/atari/ataints.c.~1~	Sat May 24 22:06:38 1997
+++ linux/arch/m68k/atari/ataints.c	Tue Jul 29 02:08:54 1997
@@ -166,7 +166,7 @@
 asmlinkage void IRQ_NAME(n);						   \
 /* Dummy function to allow asm with operands.  */			   \
 void atari_slow_irq_##n##_dummy (void) {				   \
-__asm__ (ALIGN_STR "\n"							   \
+__asm__ (__ALIGN_STR "\n"						   \
 SYMBOL_NAME_STR(atari_slow_irq_) #n "_handler:\t"			   \
 "	addql	#1,"SYMBOL_NAME_STR(local_irq_count)"\n"		   \
 	SAVE_ALL_INT "\n"						   \
@@ -270,7 +270,7 @@
 
 /* Dummy function to allow asm with operands.  */
 void atari_fast_prio_irq_dummy (void) {
-__asm__ (ALIGN_STR "\n"
+__asm__ (__ALIGN_STR "\n"
 SYMBOL_NAME_STR(atari_fast_irq_handler) ":
 	orw 	#0x700,%%sr		/* disable all interrupts */
 "SYMBOL_NAME_STR(atari_prio_irq_handler) ":\t
@@ -304,7 +304,7 @@
  */
 asmlinkage void falcon_hblhandler(void);
 asm(".text\n"
-ALIGN_STR "\n"
+__ALIGN_STR "\n"
 SYMBOL_NAME_STR(falcon_hblhandler) ":
 	orw	#0x200,%sp@	/* set saved ipl to 2 */
 	rte");
--- linux/arch/m68k/atari/config.c.~2~	Sun Jun 15 10:50:16 1997
+++ linux/arch/m68k/atari/config.c	Mon Jul 28 20:28:39 1997
@@ -37,7 +37,6 @@
 #include <asm/bootinfo.h>
 #include <asm/setup.h>
 #include <asm/atarihw.h>
-#include <asm/atarihdreg.h>
 #include <asm/atariints.h>
 
 #include <asm/system.h>
@@ -393,7 +392,7 @@
 	ATARIHW_SET(BLITTER);
         printk( "BLITTER " );
     }
-    if (hwreg_present( (void *)(ATA_HD_BASE+ATA_HD_CMD) )) {
+    if (hwreg_present((void *)0xfff00039)) {
 	ATARIHW_SET(IDE);
         printk( "IDE " );
     }
--- linux/arch/m68k/atari/joystick.c.~1~	Wed May 14 17:42:07 1997
+++ linux/arch/m68k/atari/joystick.c	Sat Jul 19 00:39:38 1997
@@ -109,7 +109,7 @@
 
 static unsigned int joystick_poll(struct file *file, poll_table *wait)
 {
-    int minor = DEVICE_NR(file->f_inode->i_rdev);
+    int minor = DEVICE_NR(file->f_dentry->d_inode->i_rdev);
 
     poll_wait(&joystick[minor].wait, wait);
     if (joystick[minor].ready)
--- linux/arch/m68k/atari/stdma.c.~1~	Wed May 14 17:42:23 1997
+++ linux/arch/m68k/atari/stdma.c	Mon Jul 28 20:24:28 1997
@@ -37,7 +37,6 @@
 #include <asm/atari_stdma.h>
 #include <asm/atariints.h>
 #include <asm/atarihw.h>
-#include <asm/atarihdreg.h>
 #include <asm/io.h>
 #include <asm/irq.h>
 
--- linux/arch/m68k/kernel/entry.S.~1~	Mon Jul 28 17:23:19 1997
+++ linux/arch/m68k/kernel/entry.S	Mon Jul 28 18:46:12 1997
@@ -568,6 +568,8 @@
 	.long SYMBOL_NAME(sys_query_module)
 	.long SYMBOL_NAME(sys_poll)
 	.long SYMBOL_NAME(sys_nfsservctl)
+	.long SYMBOL_NAME(sys_setresgid)	/* 170 */
+	.long SYMBOL_NAME(sys_getresgid)
 	.rept NR_syscalls-(.-SYMBOL_NAME(sys_call_table))/4
 		.long SYMBOL_NAME(sys_ni_syscall)
 	.endr
--- linux/arch/m68k/mm/fault.c.~1~	Fri May 16 19:48:51 1997
+++ linux/arch/m68k/mm/fault.c	Fri Jul 18 18:12:04 1997
@@ -101,11 +101,17 @@
 bad_area:
 	up(&mm->mmap_sem);
 
-	/* Are we prepared to handle this fault?  */
+	/* User mode accesses just cause a SIGSEGV */
+	if (user_mode(regs)) {
+		force_sig (SIGSEGV, tsk);
+		return 1;
+	}
+
+	/* Are we prepared to handle this kernel fault?  */
 	if ((fixup = search_exception_table(regs->pc)) != 0) {
 		struct pt_regs *tregs;
 		printk(KERN_DEBUG "%s: Exception at [<%lx>] (%lx)\n",
-		       current->comm, regs->pc, fixup);
+		       tsk->comm, regs->pc, fixup);
 		/* Create a new four word stack frame, discarding the old
 		   one.  */
 		regs->stkadj = frame_extra_sizes[regs->format];
@@ -115,12 +121,6 @@
 		tregs->pc = fixup;
 		tregs->sr = regs->sr;
 		return -1;
-	}
-
-	if (user_mode(regs)) {
-		/* User memory access */
-		force_sig (SIGSEGV, tsk);
-		return 1;
 	}
 
 /*
--- linux/drivers/char/Makefile.~1~	Mon Jul 28 17:26:16 1997
+++ linux/drivers/char/Makefile	Mon Jul 28 18:50:40 1997
@@ -115,11 +115,6 @@
       IOEXT_OBJS += plip_ioext.o
     endif
     ifeq ($(CONFIG_GVPIOEXT_LP),m)
-ifeq ($(CONFIG_WHIPPET),y)
-L_OBJS += ser_whippet.o
-S = y
-endif
-
       IOEXT_OBJS += lp_ioext.o
       LM = y
     endif
@@ -136,6 +131,11 @@
   endif
 endif
 
+ifeq ($(CONFIG_WHIPPET),y)
+L_OBJS += ser_whippet.o
+S = y
+endif
+
 ifeq ($(ARCH),m68k)
 
 ifdef CONFIG_USERIAL
--- linux/drivers/char/nvram.c.~1~	Mon Jul 28 17:26:36 1997
+++ linux/drivers/char/nvram.c	Mon Jul 28 22:17:39 1997
@@ -156,7 +156,7 @@
  *
  * They're only built if CONFIG_ATARI is defined, because Atari drivers use
  * them. For other configurations (PC), the rest of the kernel can't rely on
- * them being present (this driver couldn't be configured at all, or as a
+ * them being present (this driver may not be configured at all, or as a
  * module), so they access config information themselves.
  */
 
@@ -413,7 +413,7 @@
 	if (!CHECK_DRIVER_INIT())
 	    return( -ENXIO );
 
-	printk( "Non-volatile memory driver v%s\n", NVRAM_VERSION );
+	printk(KERN_INFO "Non-volatile memory driver v%s\n", NVRAM_VERSION );
 	misc_register( &nvram_dev );
 #ifdef CONFIG_PROC_FS
 	if ((proc_nvram = create_proc_entry( "nvram", 0, 0 )))
@@ -620,7 +620,7 @@
 #define fieldsize(a)	(sizeof(a)/sizeof(*a))
 
 static int atari_proc_infos( unsigned char *nvram, char *buffer, int *len,
-							 off_t *begin, off_t offset, int size )
+			    off_t *begin, off_t offset, int size )
 {
 	int checksum = nvram_check_checksum();
 	int i;
@@ -647,7 +647,7 @@
 
 	/* the following entries are defined only for the Falcon */
 	if ((atari_mch_cookie >> 16) != ATARI_MCH_FALCON)
-		return;
+		return 1;
 
 	PRINT_PROC( "OS language      : " );
 	if (nvram[6] < fieldsize(languages))
--- linux/drivers/char/sysrq.c.~1~	Mon Jul 28 17:27:00 1997
+++ linux/drivers/char/sysrq.c	Tue Jul 29 02:05:00 1997
@@ -154,7 +154,8 @@
 	struct file *file;
 
 	for (file = inuse_filps; file; file = file->f_next)
-		if (file->f_inode && file->f_count && S_ISREG(file->f_inode->i_mode))
+		if (file->f_dentry && file->f_dentry->d_inode &&
+		    file->f_count && S_ISREG(file->f_dentry->d_inode->i_mode))
 			file->f_mode &= ~2;
 }
 
--- linux/drivers/char/vc_screen.c.~1~	Mon Jul 28 17:27:05 1997
+++ linux/drivers/char/vc_screen.c	Mon Jul 28 19:05:00 1997
@@ -34,6 +34,7 @@
 #include <linux/vt_kern.h>
 #include <linux/selection.h>
 #include <asm/uaccess.h>
+#include <asm/byteorder.h>
 
 #undef attr
 #undef org
@@ -150,7 +151,11 @@
 		    p -= HEADER_SIZE;
 		    org = screen_pos(currcons, p/2, viewed);
 		    if ((p & 1) && count > 0)
+#ifdef __BIG_ENDIAN
+			    { count--; put_user(func_scr_readw(org++) & 0xff, buf++); }
+#else
 			    { count--; put_user(func_scr_readw(org++) >> 8, buf++); }
+#endif
 		}
 		while (count > 1) {
 			put_user(func_scr_readw(org++), (unsigned short *) buf);
@@ -158,7 +163,11 @@
 			count -= 2;
 		}
 		if (count > 0)
+#ifdef __BIG_ENDIAN
+			put_user(func_scr_readw(org) >> 8, buf++);
+#else
 			put_user(func_scr_readw(org) & 0xff, buf++);
+#endif
 	}
 	read = buf - buf0;
 	file->f_pos += read;
@@ -219,8 +228,13 @@
 			    char c;
 				count--;
 				get_user(c,buf++);
+#ifdef __BIG_ENDIAN
+				func_scr_writew(c |
+				     (func_scr_readw(org) & 0xff00), org);
+#else
 				func_scr_writew((c << 8) |
 				     (func_scr_readw(org) & 0xff), org);
+#endif
 				org++;
 			}
 		}
@@ -234,7 +248,11 @@
 		if (count > 0) {
 			unsigned char c;
 			get_user(c, (const unsigned char*)buf++);
+#ifdef __BIG_ENDIAN
+			func_scr_writew((func_scr_readw(org) & 0xff) | (c << 8), org);
+#else
 			func_scr_writew((func_scr_readw(org) & 0xff00) | c, org);
+#endif
 		}
 	}
 	written = buf - buf0;
--- linux/fs/binfmt_aout.c.~1~	Mon Jul 28 17:29:21 1997
+++ linux/fs/binfmt_aout.c	Tue Jul 22 09:33:36 1997
@@ -128,7 +128,7 @@
 	if (get_write_access(inode))
 		goto end_coredump;
 	if (init_private_file(&file, dentry, 3))
-		goto end_coredump;
+		goto done_coredump;
 	if (!file.f_op->write)
 		goto close_coredump;
 	has_dumped = 1;
--- linux/fs/fat/inode.c.~1~	Mon Jul 28 17:29:40 1997
+++ linux/fs/fat/inode.c	Tue Jul 29 22:59:59 1997
@@ -25,6 +25,7 @@
 
 #include <asm/uaccess.h>
 #include <asm/unaligned.h>
+#include <asm/setup.h>
 
 
 
@@ -146,7 +147,7 @@
 		else if (!strcmp(this_char,"showexec")) {
 			opts->showexec = 1;
 		}
-		else if (!strcmp(this_char,"dotsOK") && value) {
+		else if (!strcmp(this_char,"dotsOK")) {
 			if (!value || !strcmp(value,"yes")) opts->dotsOK = 1;
 			else if (!strcmp(value,"no")) opts->dotsOK = 0;
 			else return 0;
@@ -303,8 +304,8 @@
 		MSDOS_SB(sb)->clusters = b->cluster_size ? data_sectors/
 		    b->cluster_size/sector_mult : 0;
 		if (!opts.atari)
-			MSDOS_SB(sb)->fat_bits = fat ? fat : MSDOS_SB(sb)->clusters >
-									 MSDOS_FAT12 ? 16 : 12;
+			MSDOS_SB(sb)->fat_bits =
+			  fat ? fat : MSDOS_SB(sb)->clusters > MSDOS_FAT12 ? 16 : 12;
 		else {
 			int sectors;
 			/* Atari GEMDOS partitions always have 16-bit fat */
--- linux/fs/msdos/namei.c.~1~	Mon Jul 28 17:29:59 1997
+++ linux/fs/msdos/namei.c	Fri Jul 25 21:10:39 1997
@@ -38,7 +38,7 @@
 static char bad_chars[] = "*?<>|\"";
 static char bad_if_strict_pc[] = "+=,; ";
 static char bad_if_strict_atari[] = " "; /* GEMDOS is less restrictive */
-#define	bad_if_strict (atari ? bad_if_strict_atari : bad_if_strict_pc)
+#define	bad_if_strict(opts) ((opts)->atari ? bad_if_strict_atari : bad_if_strict_pc)
 
 void msdos_put_super(struct super_block *sb)
 {
@@ -77,8 +77,8 @@
 
 
 /***** Formats an MS-DOS file name. Rejects invalid names. */
-static int msdos_format_name(int atari,char conv,const char *name,int len,
-	char *res,int dot_dirs,char dotsOK)
+static int msdos_format_name(const char *name,int len,
+	char *res,int dot_dirs,struct fat_mount_options *opts)
 	/* conv is relaxed/normal/strict, name is proposed name,
 	 * len is the length of the proposed name, res is the result name,
 	 * dot_dirs is . and .. are OK, dotsOK is if hidden files get dots.
@@ -96,22 +96,25 @@
 		return 0;
 	}
 	if (name[0] == '.') {  /* dotfile because . and .. already done */
-		if (dotsOK) {
+		if (opts->dotsOK) {
+			/* Get rid of dot - test for it elsewhere */
 			name++; len--;
 		}
-		else if (!atari) return -EINVAL;
-		/* Get rid of dot - test for it elsewhere */
+		else if (!opts->atari) return -EINVAL;
 	}
 	/* disallow names that _really_ start with a dot for MS-DOS, GEMDOS does
 	 * not care */
-	space = !atari;
+	space = !opts->atari;
 	c = 0;
 	for (walk = res; len && walk-res < 8; walk++) {
 	    	c = *name++;
 		len--;
-		if (conv != 'r' && strchr(bad_chars,c)) return -EINVAL;
-		if (conv == 's' && strchr(bad_if_strict,c)) return -EINVAL;
-  		if (c >= 'A' && c <= 'Z' && conv == 's') return -EINVAL;
+		if (opts->conversion != 'r' && strchr(bad_chars,c))
+			return -EINVAL;
+		if (opts->conversion == 's' && strchr(bad_if_strict(opts),c))
+			return -EINVAL;
+  		if (c >= 'A' && c <= 'Z' && opts->conversion == 's')
+			return -EINVAL;
 		if (c < ' ' || c == ':' || c == '\\') return -EINVAL;
 /*  0xE5 is legal as a first character, but we must substitute 0x05     */
 /*  because 0xE5 marks deleted files.  Yes, DOS really does this.       */
@@ -123,7 +126,7 @@
 		*walk = (c >= 'a' && c <= 'z') ? c-32 : c;
 	}
 	if (space) return -EINVAL;
-	if (conv == 's' && len && c != '.') {
+	if (opts->conversion == 's' && len && c != '.') {
 		c = *name++;
 		len--;
 		if (c != '.') return -EINVAL;
@@ -134,25 +137,28 @@
 		while (len > 0 && walk-res < MSDOS_NAME) {
 			c = *name++;
 			len--;
-			if (conv != 'r' && strchr(bad_chars,c)) return -EINVAL;
-			if (conv == 's' && strchr(bad_if_strict,c))
+			if (opts->conversion != 'r' && strchr(bad_chars,c))
+				return -EINVAL;
+			if (opts->conversion == 's' &&
+			    strchr(bad_if_strict(opts),c))
 				return -EINVAL;
 			if (c < ' ' || c == ':' || c == '\\')
 				return -EINVAL;
 			if (c == '.') {
-				if (conv == 's')
+				if (opts->conversion == 's')
 					return -EINVAL;
 				break;
 			}
-			if (c >= 'A' && c <= 'Z' && conv == 's') return -EINVAL;
+			if (c >= 'A' && c <= 'Z' && opts->conversion == 's')
+				return -EINVAL;
 			space = c == ' ';
 			*walk++ = c >= 'a' && c <= 'z' ? c-32 : c;
 		}
 		if (space) return -EINVAL;
-		if (conv == 's' && len) return -EINVAL;
+		if (opts->conversion == 's' && len) return -EINVAL;
 	}
 	while (walk-res < MSDOS_NAME) *walk++ = ' ';
-	if (!atari)
+	if (!opts->atari)
 		/* GEMDOS is less stupid and has no reserved names */
 		for (reserved = reserved_names; *reserved; reserved++)
 			if (!strncmp(res,*reserved,8)) return -EINVAL;
@@ -170,9 +176,7 @@
 	char scantype;
 
 	dotsOK = MSDOS_SB(dir->i_sb)->options.dotsOK;
-	res = msdos_format_name(MSDOS_SB(dir->i_sb)->options.atari,
-				MSDOS_SB(dir->i_sb)->options.name_check,
-				name,len, msdos_name,1,dotsOK);
+	res = msdos_format_name(name,len, msdos_name,1,&MSDOS_SB(dir->i_sb)->options);
 	if (res < 0)
 		return -ENOENT;
 	if((name[0]=='.') && dotsOK){
@@ -287,13 +291,12 @@
 	int ino,res,is_hid;
 
 	if (!dir) return -ENOENT;
-	if ((res = msdos_format_name(MSDOS_SB(dir->i_sb)->options.atari,
-				     MSDOS_SB(dir->i_sb)->options.name_check,
-				     dentry->d_name.name,dentry->d_name.len,
+	if ((res = msdos_format_name(dentry->d_name.name,dentry->d_name.len,
 				     msdos_name,0,
-				     MSDOS_SB(dir->i_sb)->options.dotsOK)) < 0)
+				     &MSDOS_SB(dir->i_sb)->options)) < 0)
 		return res;
-	is_hid = (dentry->d_name.name[0]=='.') && (msdos_name[0]!='.');
+	is_hid = MSDOS_SB(dir->i_sb)->options.dotsOK
+	  && (dentry->d_name.name[0]=='.') && (msdos_name[0]!='.');
 	fat_lock_creation();
 	/* Scan for existing file twice, so that creating a file fails
 	 * with -EINVAL if the other (dotfile/nondotfile) exists.
@@ -410,13 +413,12 @@
 	char msdos_name[MSDOS_NAME];
 	int ino,res,is_hid;
 
-	if ((res = msdos_format_name(MSDOS_SB(dir->i_sb)->options.atari,
-				     MSDOS_SB(dir->i_sb)->options.name_check,
-				     dentry->d_name.name,dentry->d_name.len,
+	if ((res = msdos_format_name(dentry->d_name.name,dentry->d_name.len,
 				     msdos_name,0,
-				     MSDOS_SB(dir->i_sb)->options.dotsOK)) < 0)
+				     &MSDOS_SB(dir->i_sb)->options)) < 0)
 		return res;
-	is_hid = (dentry->d_name.name[0]=='.') && (msdos_name[0]!='.');
+	is_hid = MSDOS_SB(dir->i_sb)->options.dotsOK
+	  && (dentry->d_name.name[0]=='.') && (msdos_name[0]!='.');
 	fat_lock_creation();
 	if (fat_scan(dir,msdos_name,&bh,&de,&ino,SCAN_ANY) >= 0) {
 		fat_unlock_creation();
@@ -703,20 +705,18 @@
 	int old_ino,error;
 	int is_hid,old_hid; /* if new file and old file are hidden */
 
-	if ((error = msdos_format_name(MSDOS_SB(old_dir->i_sb)->options.atari,
-				       MSDOS_SB(old_dir->i_sb)->options.name_check,
-				       old_dentry->d_name.name,
+	if ((error = msdos_format_name(old_dentry->d_name.name,
 				       old_dentry->d_name.len,old_msdos_name,1,
-				       MSDOS_SB(old_dir->i_sb)->options.dotsOK))
+				       &MSDOS_SB(old_dir->i_sb)->options))
 	    < 0) goto rename_done;
-	if ((error = msdos_format_name(MSDOS_SB(new_dir->i_sb)->options.atari,
-				       MSDOS_SB(new_dir->i_sb)->options.name_check,
-				       new_dentry->d_name.name,
+	if ((error = msdos_format_name(new_dentry->d_name.name,
 				       new_dentry->d_name.len,new_msdos_name,0,
-				       MSDOS_SB(new_dir->i_sb)->options.dotsOK))
+				       &MSDOS_SB(new_dir->i_sb)->options))
 	    < 0) goto rename_done;
-	is_hid = (new_dentry->d_name.name[0]=='.') && (new_msdos_name[0]!='.');
-	old_hid = (old_dentry->d_name.name[0]=='.') && (old_msdos_name[0]!='.');
+	is_hid = MSDOS_SB(new_dir->i_sb)->options.dotsOK
+	  && (new_dentry->d_name.name[0]=='.') && (new_msdos_name[0]!='.');
+	old_hid = MSDOS_SB(old_dir->i_sb)->options.dotsOK
+	  && (old_dentry->d_name.name[0]=='.') && (old_msdos_name[0]!='.');
 	if ((error = fat_scan(old_dir,old_msdos_name,&old_bh,&old_de,
 	    &old_ino,old_hid?SCAN_HID:SCAN_NOTHID)) < 0) goto rename_done;
 	fat_lock_creation();
--- linux/include/asm-m68k/unistd.h.~1~	Fri May 30 18:39:12 1997
+++ linux/include/asm-m68k/unistd.h	Fri Jun 27 20:05:39 1997
@@ -174,6 +174,8 @@
 #define __NR_query_module	167
 #define __NR_poll		168
 #define __NR_nfsservctl		169
+#define __NR_setresgid		170
+#define __NR_getresgid		171
 
 /* user-visible error numbers are in the range -1 - -122: see
    <asm-m68k/errno.h> */
--- linux/include/linux/linkage.h.~1~	Mon Jul 28 17:32:18 1997
+++ linux/include/linux/linkage.h	Tue Jul 29 00:30:07 1997
@@ -31,7 +31,7 @@
 #ifdef __ASSEMBLY__
 
 #define ALIGN __ALIGN
-#define ALIGN_STRING __ALIGN_STRING
+#define ALIGN_STR __ALIGN_STR
 
 #define ENTRY(name) \
   .globl SYMBOL_NAME(name); \
