diff -urN linux.store/linux/Makefile linux/Makefile
--- linux.store/linux/Makefile	Wed Mar 13 23:54:56 1996
+++ linux/Makefile	Wed Mar 27 10:22:38 1996
@@ -251,7 +251,7 @@
 	rm -f .tmp* drivers/sound/configure
 	rm -fr modules/*
 
-mrproper: clean
+mrproper:: clean
 	rm -f include/linux/autoconf.h include/linux/version.h
 	rm -f drivers/sound/local.h
 	rm -f drivers/scsi/aic7xxx_asm drivers/scsi/aic7xxx_seq.h
diff -urN linux.store/linux/README.arm linux/README.arm
--- linux.store/linux/README.arm	Wed Mar 13 23:54:56 1996
+++ linux/README.arm	Thu Mar 28 14:12:36 1996
@@ -33,3 +33,26 @@
 Name: Ian Jeffray
 Mail: ian_jeffray@MENTORG.COM
 Desc: A3/4/5xx serial and parrallel port code maintainer.
+
+
+Notes
+-----
+ST506 hard drives
+-----------------
+The ST506 hard drive controllers seem to be working fine (if
+a bit slowly).  At the moment they will only work off the
+controllers on an A4x0's motherboard, but for it to work
+off a Podule just requires someone with a podule to add the
+addresses for the IRQ mask and the HDC base to the source.
+
+Oh yes - the drive busy light seems to stay on all the time;
+suggestions welcome!
+
+1772 Floppy
+-----------
+This also seems to work OK, but hasn't been stressed much lately.
+It hasn't got any code for disc change detection in there at the
+moment which could be a bit of a problem!  Suggestions on the
+correct way to do this are welcome.
+
+
diff -urN linux.store/linux/arch/arm/Makefile linux/arch/arm/Makefile
--- linux.store/linux/arch/arm/Makefile	Wed Mar 13 23:54:57 1996
+++ linux/arch/arm/Makefile	Thu Mar 28 11:58:22 1996
@@ -14,7 +14,7 @@
 #
 # Since we are going multi-computer, I think that this ought to reflect it...
 #
-# THIS IS MY PATCHLEVEL:  PATCHLEVEL2
+# THIS IS MY PATCHLEVEL:  PATCHLEVEL3
 
 # MACHINE can be: arc a5k rpc
 # PROCESSOR can be: arm2 arm3 arm6
@@ -84,6 +84,10 @@
 	rm -f include/asm-arm/arch include/asm-arm/proc
 	(cd include/asm-arm; ln -sf arch-$(MACHINE) arch; ln -sf proc-$(PROCESSOR) proc)
 
+mrproper::
+	rm -f include/asm-arm/arch include/asm-arm/proc
+	@$(MAKE) -C arch/$(ARCH)/drivers mrproper
+
 install:
 	@$(MAKEBOOT) install
 
@@ -95,11 +99,6 @@
 
 archclean:
 	@$(MAKEBOOT) clean
-	@$(MAKE) -C arch/$(ARCH)/drivers/block LINKCLEAN
-	@$(MAKE) -C arch/$(ARCH)/drivers/char LINKCLEAN
-	@$(MAKE) -C arch/$(ARCH)/drivers/net LINKCLEAN
-	@$(MAKE) -C arch/$(ARCH)/drivers/scsi LINKCLEAN
-	rm -f include/asm-arm/arch include/asm-arm/proc
 
 archdep:
 	@$(MAKEBOOT) dep
diff -urN linux.store/linux/arch/arm/drivers/Makefile linux/arch/arm/drivers/Makefile
--- linux.store/linux/arch/arm/drivers/Makefile	Sun Feb 11 09:32:13 1996
+++ linux/arch/arm/drivers/Makefile	Thu Mar 28 11:51:08 1996
@@ -31,3 +31,7 @@
 endif
 
 include $(TOPDIR)/Rules.make
+
+mrproper:
+	set -e; for i in $(ALL_SUB_DIRS); do $(MAKE) -C $$i mrproper; done
+
diff -urN linux.store/linux/arch/arm/drivers/block/Makefile linux/arch/arm/drivers/block/Makefile
--- linux.store/linux/arch/arm/drivers/block/Makefile	Wed Mar 13 23:54:58 1996
+++ linux/arch/arm/drivers/block/Makefile	Thu Mar 28 11:52:14 1996
@@ -65,9 +65,12 @@
 	done
 	touch links
 
-LINKCLEAN:
+mrproper:
 	-@for f in $(LK); do \
-		if [ -L $$f ]; then rm -f $$f; fi; \
+		if [ -L $$f ]; then \
+			echo $(RM) $$f; \
+			$(RM) $$f; \
+		fi; \
 	done
-	rm -f links
+	$(RM) links
 
diff -urN linux.store/linux/arch/arm/drivers/block/blk.h linux/arch/arm/drivers/block/blk.h
--- linux.store/linux/arch/arm/drivers/block/blk.h	Thu Jan  1 01:00:00 1970
+++ linux/arch/arm/drivers/block/blk.h	Thu Mar 28 15:06:37 1996
@@ -0,0 +1,402 @@
+#ifndef _BLK_H
+#define _BLK_H
+
+#include <linux/blkdev.h>
+#include <linux/locks.h>
+#include <linux/config.h>
+
+/*
+ * NR_REQUEST is the number of entries in the request-queue.
+ * NOTE that writes may use only the low 2/3 of these: reads
+ * take precedence.
+ */
+#define NR_REQUEST	64
+
+/*
+ * This is used in the elevator algorithm: Note that
+ * reads always go before writes. This is natural: reads
+ * are much more time-critical than writes.
+ */
+#define IN_ORDER(s1,s2) \
+((s1)->cmd < (s2)->cmd || ((s1)->cmd == (s2)->cmd && \
+((s1)->rq_dev < (s2)->rq_dev || (((s1)->rq_dev == (s2)->rq_dev && \
+(s1)->sector < (s2)->sector)))))
+
+/*
+ * These will have to be changed to be aware of different buffer
+ * sizes etc.. It actually needs a major cleanup.
+ */
+#ifdef IDE_DRIVER
+#define SECTOR_MASK ((BLOCK_SIZE >> 9) - 1)
+#else
+#define SECTOR_MASK (blksize_size[MAJOR_NR] &&     \
+	blksize_size[MAJOR_NR][MINOR(CURRENT->rq_dev)] ? \
+	((blksize_size[MAJOR_NR][MINOR(CURRENT->rq_dev)] >> 9) - 1) :  \
+	((BLOCK_SIZE >> 9)  -  1))
+#endif /* IDE_DRIVER */
+
+#define SUBSECTOR(block) (CURRENT->current_nr_sectors > 0)
+
+#ifdef CONFIG_CDU31A
+extern int cdu31a_init(void);
+#endif CONFIG_CDU31A
+#ifdef CONFIG_MCD
+extern int mcd_init(void);
+#endif CONFIG_MCD
+#ifdef CONFIG_MCDX
+extern int mcdx_init(void);
+#endif CONFIG_MCDX
+#ifdef CONFIG_SBPCD
+extern int sbpcd_init(void);
+#endif CONFIG_SBPCD
+#ifdef CONFIG_AZTCD
+extern int aztcd_init(void);
+#endif CONFIG_AZTCD
+#ifdef CONFIG_CDU535
+extern int sony535_init(void);
+#endif CONFIG_CDU535
+#ifdef CONFIG_GSCD
+extern int gscd_init(void);
+#endif CONFIG_GSCD
+#ifdef CONFIG_CM206
+extern int cm206_init(void);
+#endif CONFIG_CM206
+#ifdef CONFIG_OPTCD
+extern int optcd_init(void);
+#endif CONFIG_OPTCD
+#ifdef CONFIG_SJCD
+extern int sjcd_init(void);
+#endif CONFIG_SJCD
+#ifdef CONFIG_BLK_DEV_HD
+extern int hd_init(void);
+#endif
+#ifdef CONFIG_BLK_DEV_IDE
+extern int ide_init(void);
+#endif
+#ifdef CONFIG_BLK_DEV_XD
+extern int xd_init(void);
+#endif
+
+extern void set_device_ro(kdev_t dev,int flag);
+
+extern int floppy_init(void);
+extern void rd_load(void);
+extern long rd_init(long mem_start, int length);
+extern int ramdisk_size;
+
+#define RO_IOCTLS(dev,where) \
+  case BLKROSET: if (!suser()) return -EACCES; \
+		 set_device_ro((dev),get_fs_long((long *) (where))); return 0; \
+  case BLKROGET: { int __err = verify_area(VERIFY_WRITE, (void *) (where), sizeof(long)); \
+		   if (!__err) put_fs_long(0!=is_read_only(dev),(long *) (where)); return __err; }
+		 
+#if defined(MAJOR_NR) || defined(IDE_DRIVER)
+
+/*
+ * Add entries as needed.
+ */
+
+#ifdef IDE_DRIVER
+
+#define DEVICE_NR(device)	(MINOR(device) >> PARTN_BITS)
+#define DEVICE_ON(device)	/* nothing */
+#define DEVICE_OFF(device)	/* nothing */
+
+#elif (MAJOR_NR == MEM_MAJOR)
+
+/* ram disk */
+#define DEVICE_NAME "ramdisk"
+#define DEVICE_REQUEST do_rd_request
+#define DEVICE_NR(device) (MINOR(device) & 7)
+#define DEVICE_ON(device) 
+#define DEVICE_OFF(device)
+
+#elif (MAJOR_NR == FLOPPY_MAJOR)
+
+static void floppy_off(unsigned int nr);
+
+#define DEVICE_NAME "floppy"
+#define DEVICE_INTR do_floppy
+#define DEVICE_REQUEST do_fd_request
+#define DEVICE_NR(device) ( (MINOR(device) & 3) | ((MINOR(device) & 0x80 ) >> 5 ))
+#define DEVICE_ON(device)
+#define DEVICE_OFF(device) floppy_off(DEVICE_NR(device))
+
+#elif (MAJOR_NR == HD_MAJOR)
+
+/* harddisk: timeout is 6 seconds.. */
+#define DEVICE_NAME "harddisk"
+#define DEVICE_INTR do_hd
+#define DEVICE_TIMEOUT HD_TIMER
+#define TIMEOUT_VALUE (6*HZ)
+#define DEVICE_REQUEST do_hd_request
+#define DEVICE_NR(device) (MINOR(device)>>6)
+#define DEVICE_ON(device)
+#define DEVICE_OFF(device)
+
+#elif (MAJOR_NR == SCSI_DISK_MAJOR)
+
+#define DEVICE_NAME "scsidisk"
+#define DEVICE_INTR do_sd  
+#define TIMEOUT_VALUE (2*HZ)
+#define DEVICE_REQUEST do_sd_request
+#define DEVICE_NR(device) (MINOR(device) >> 4)
+#define DEVICE_ON(device)
+#define DEVICE_OFF(device)
+
+#elif (MAJOR_NR == SCSI_TAPE_MAJOR)
+
+#define DEVICE_NAME "scsitape"
+#define DEVICE_INTR do_st  
+#define DEVICE_NR(device) (MINOR(device) & 0x7f)
+#define DEVICE_ON(device)
+#define DEVICE_OFF(device)
+
+#elif (MAJOR_NR == SCSI_CDROM_MAJOR)
+
+#define DEVICE_NAME "CD-ROM"
+#define DEVICE_INTR do_sr
+#define DEVICE_REQUEST do_sr_request
+#define DEVICE_NR(device) (MINOR(device))
+#define DEVICE_ON(device)
+#define DEVICE_OFF(device)
+
+#elif (MAJOR_NR == XT_DISK_MAJOR)
+
+#define DEVICE_NAME "xt disk"
+#define DEVICE_REQUEST do_xd_request
+#define DEVICE_NR(device) (MINOR(device) >> 6)
+#define DEVICE_ON(device)
+#define DEVICE_OFF(device)
+
+#elif defined(MFM_DISK_MAJOR) && (MAJOR_NR == MFM_DISK_MAJOR)
+
+#define DEVICE_NAME "mfm disk"
+#define DEVICE_INTR do_mfm
+#define DEVICE_REQUEST do_mfm_request
+#define DEVICE_NR(device) (MINOR(device) >> 6)
+#define DEVICE_ON(device)
+#define DEVICE_OFF(device)
+
+#elif (MAJOR_NR == CDU31A_CDROM_MAJOR)
+
+#define DEVICE_NAME "CDU31A"
+#define DEVICE_REQUEST do_cdu31a_request
+#define DEVICE_NR(device) (MINOR(device))
+#define DEVICE_ON(device)
+#define DEVICE_OFF(device)
+
+#elif (MAJOR_NR == MITSUMI_CDROM_MAJOR)
+
+#define DEVICE_NAME "Mitsumi CD-ROM"
+/* #define DEVICE_INTR do_mcd */
+#define DEVICE_REQUEST do_mcd_request
+#define DEVICE_NR(device) (MINOR(device))
+#define DEVICE_ON(device)
+#define DEVICE_OFF(device)
+
+#elif (MAJOR_NR == MITSUMI_X_CDROM_MAJOR)
+
+#define DEVICE_NAME "Mitsumi CD-ROM"
+/* #define DEVICE_INTR do_mcdx */
+#define DEVICE_REQUEST do_mcdx_request
+#define DEVICE_NR(device) (MINOR(device))
+#define DEVICE_ON(device)
+#define DEVICE_OFF(device)
+
+#elif (MAJOR_NR == MATSUSHITA_CDROM_MAJOR)
+
+#define DEVICE_NAME "Matsushita CD-ROM controller #1"
+#define DEVICE_REQUEST do_sbpcd_request
+#define DEVICE_NR(device) (MINOR(device))
+#define DEVICE_ON(device)
+#define DEVICE_OFF(device)
+
+#elif (MAJOR_NR == MATSUSHITA_CDROM2_MAJOR)
+
+#define DEVICE_NAME "Matsushita CD-ROM controller #2"
+#define DEVICE_REQUEST do_sbpcd2_request
+#define DEVICE_NR(device) (MINOR(device))
+#define DEVICE_ON(device)
+#define DEVICE_OFF(device)
+
+#elif (MAJOR_NR == MATSUSHITA_CDROM3_MAJOR)
+
+#define DEVICE_NAME "Matsushita CD-ROM controller #3"
+#define DEVICE_REQUEST do_sbpcd3_request
+#define DEVICE_NR(device) (MINOR(device))
+#define DEVICE_ON(device)
+#define DEVICE_OFF(device)
+
+#elif (MAJOR_NR == MATSUSHITA_CDROM4_MAJOR)
+
+#define DEVICE_NAME "Matsushita CD-ROM controller #4"
+#define DEVICE_REQUEST do_sbpcd4_request
+#define DEVICE_NR(device) (MINOR(device))
+#define DEVICE_ON(device)
+#define DEVICE_OFF(device)
+
+#elif (MAJOR_NR == AZTECH_CDROM_MAJOR)
+
+#define DEVICE_NAME "Aztech CD-ROM"
+#define DEVICE_REQUEST do_aztcd_request
+#define DEVICE_NR(device) (MINOR(device))
+#define DEVICE_ON(device)
+#define DEVICE_OFF(device)
+
+#elif (MAJOR_NR == CDU535_CDROM_MAJOR)
+
+#define DEVICE_NAME "SONY-CDU535"
+#define DEVICE_INTR do_cdu535
+#define DEVICE_REQUEST do_cdu535_request
+#define DEVICE_NR(device) (MINOR(device))
+#define DEVICE_ON(device)
+#define DEVICE_OFF(device)
+
+#elif (MAJOR_NR == GOLDSTAR_CDROM_MAJOR)
+
+#define DEVICE_NAME "Goldstar R420"
+#define DEVICE_REQUEST do_gscd_request
+#define DEVICE_NR(device) (MINOR(device))
+#define DEVICE_ON(device)
+#define DEVICE_OFF(device)
+
+#elif (MAJOR_NR == CM206_CDROM_MAJOR)
+#define DEVICE_NAME "Philips/LMS cd-rom cm206"
+#define DEVICE_REQUEST do_cm206_request
+#define DEVICE_NR(device) (MINOR(device))
+#define DEVICE_ON(device)
+#define DEVICE_OFF(device)
+
+#elif (MAJOR_NR == OPTICS_CDROM_MAJOR)
+
+#define DEVICE_NAME "DOLPHIN 8000AT CD-ROM"
+#define DEVICE_REQUEST do_optcd_request
+#define DEVICE_NR(device) (MINOR(device))
+#define DEVICE_ON(device)
+#define DEVICE_OFF(device)
+
+#elif (MAJOR_NR == SANYO_CDROM_MAJOR)
+
+#define DEVICE_NAME "Sanyo H94A CD-ROM"
+#define DEVICE_REQUEST do_sjcd_request
+#define DEVICE_NR(device) (MINOR(device))
+#define DEVICE_ON(device)
+#define DEVICE_OFF(device)
+
+#endif /* MAJOR_NR == whatever */
+
+#if (MAJOR_NR != SCSI_TAPE_MAJOR) && !defined(IDE_DRIVER)
+
+#ifndef CURRENT
+#define CURRENT (blk_dev[MAJOR_NR].current_request)
+#endif
+
+#define CURRENT_DEV DEVICE_NR(CURRENT->rq_dev)
+
+#ifdef DEVICE_INTR
+void (*DEVICE_INTR)(void) = NULL;
+#endif
+#ifdef DEVICE_TIMEOUT
+
+#define SET_TIMER \
+((timer_table[DEVICE_TIMEOUT].expires = jiffies + TIMEOUT_VALUE), \
+(timer_active |= 1<<DEVICE_TIMEOUT))
+
+#define CLEAR_TIMER \
+timer_active &= ~(1<<DEVICE_TIMEOUT)
+
+#define SET_INTR(x) \
+if ((DEVICE_INTR = (x)) != NULL) \
+	SET_TIMER; \
+else \
+	CLEAR_TIMER;
+
+#else
+
+#define SET_INTR(x) (DEVICE_INTR = (x))
+
+#endif /* DEVICE_TIMEOUT */
+
+static void (DEVICE_REQUEST)(void);
+
+#ifdef DEVICE_INTR
+#define CLEAR_INTR SET_INTR(NULL)
+#else
+#define CLEAR_INTR
+#endif
+
+#define INIT_REQUEST \
+	if (!CURRENT) {\
+		CLEAR_INTR; \
+		return; \
+	} \
+	if (MAJOR(CURRENT->rq_dev) != MAJOR_NR) \
+		panic(DEVICE_NAME ": request list destroyed"); \
+	if (CURRENT->bh) { \
+		if (!CURRENT->bh->b_lock) \
+			panic(DEVICE_NAME ": block not locked"); \
+	}
+
+#endif /* (MAJOR_NR != SCSI_TAPE_MAJOR) && !defined(IDE_DRIVER) */
+
+/* end_request() - SCSI devices have their own version */
+/*               - IDE drivers have their own copy too */
+
+#if ! SCSI_MAJOR(MAJOR_NR)
+
+#if defined(_IDE_CD_C) || defined(_TRITON_C) /* shares copy with ide.c */
+void ide_end_request(byte uptodate, ide_hwgroup_t *hwgroup);
+#else
+
+#ifdef IDE_DRIVER
+void ide_end_request(byte uptodate, ide_hwgroup_t *hwgroup) {
+	struct request *req = hwgroup->rq;
+#else
+static void end_request(int uptodate) {
+	struct request *req = CURRENT;
+#endif /* IDE_DRIVER */
+	struct buffer_head * bh;
+
+	req->errors = 0;
+	if (!uptodate) {
+		printk("end_request: I/O error, dev %s, sector %lu\n",
+			kdevname(req->rq_dev), req->sector);
+		req->nr_sectors--;
+		req->nr_sectors &= ~SECTOR_MASK;
+		req->sector += (BLOCK_SIZE / 512);
+		req->sector &= ~SECTOR_MASK;		
+	}
+
+	if ((bh = req->bh) != NULL) {
+		req->bh = bh->b_reqnext;
+		bh->b_reqnext = NULL;
+		bh->b_uptodate = uptodate;		
+		unlock_buffer(bh);
+		if ((bh = req->bh) != NULL) {
+			req->current_nr_sectors = bh->b_size >> 9;
+			if (req->nr_sectors < req->current_nr_sectors) {
+				req->nr_sectors = req->current_nr_sectors;
+				printk("end_request: buffer-list destroyed\n");
+			}
+			req->buffer = bh->b_data;
+			return;
+		}
+	}
+#ifdef IDE_DRIVER
+	hwgroup->rq = NULL;
+#else
+	DEVICE_OFF(req->rq_dev);
+	CURRENT = req->next;
+#endif /* IDE_DRIVER */
+	if (req->sem != NULL)
+		up(req->sem);
+	req->rq_status = RQ_INACTIVE;
+	wake_up(&wait_for_request);
+}
+#endif /* ndef _IDE_CD_C */
+#endif /* ! SCSI_MAJOR(MAJOR_NR) */
+
+#endif /* defined(MAJOR_NR) || defined(IDE_DRIVER) */
+
+#endif /* _BLK_H */
diff -urN linux.store/linux/arch/arm/drivers/block/fd1772.c linux/arch/arm/drivers/block/fd1772.c
--- linux.store/linux/arch/arm/drivers/block/fd1772.c	Wed Mar 13 23:54:58 1996
+++ linux/arch/arm/drivers/block/fd1772.c	Thu Mar 28 14:12:36 1996
@@ -95,7 +95,7 @@
 #include <linux/delay.h>
 #include <linux/mm.h>
 
-#include <asm/machdeps.h>
+#include <asm/arch/oldlatches.h>
 #include <asm/system.h>
 #include <asm/bitops.h>
 #include <asm/dma.h>
@@ -1387,8 +1387,8 @@
 };
 
 
-void
-fd1772_init (void)
+int
+floppy_init (void)
 
 {	int i;
 
@@ -1444,5 +1444,10 @@
 
 	config_types();
 
-	return ;
+	return 0;
+}
+
+/* Just a dummy at the moment */
+void floppy_setup(char *str, int *ints)
+{
 }
diff -urN linux.store/linux/arch/arm/drivers/block/genhd.c linux/arch/arm/drivers/block/genhd.c
--- linux.store/linux/arch/arm/drivers/block/genhd.c	Sun Mar  3 12:22:14 1996
+++ linux/arch/arm/drivers/block/genhd.c	Tue Mar 26 23:19:47 1996
@@ -416,6 +416,12 @@
 	printk(" ");
 	print_minor_name(hd, MINOR(dev));
 
+	/*
+	 * Currently there is a problem with ADFS disks having been
+	 * formatted as a DOS disk.  This leaves the old DOS partition
+	 * behind.
+	 */
+
 #ifdef CONFIG_MSDOS_PARTITION
 	if (msdos_partition(hd, dev, first_sector))
 		return;
@@ -426,15 +432,18 @@
 	printk(" unknown partition table\n");
 }
 
-/* This function is used to re-read partition tables for removable disks.
-   Much of the cleanup from the old partition tables should have already been
-   done */
-
-/* This function will re-read the partition tables for a given device,
-and set things back up again.  There are some important caveats,
-however.  You must ensure that no one is using the device, and no one
-can start using the device while this function is being executed. */
+/*
+ * This function is used to re-read partition tables for removable disks.
+ * Much of the cleanup from the old partition tables should have already been
+ * done
+ */
 
+/*
+ * This function will re-read the partition tables for a given device,
+ * and set things back up again.  There are some important caveats,
+ * however.  You must ensure that no one is using the device, and no one
+ * can start using the device while this function is being executed.
+ */
 void resetup_one_dev(struct gendisk *dev, int drive)
 {
 	int i;
diff -urN linux.store/linux/arch/arm/drivers/block/hd.c linux/arch/arm/drivers/block/hd.c
--- linux.store/linux/arch/arm/drivers/block/hd.c	Thu Mar 14 11:45:05 1996
+++ linux/arch/arm/drivers/block/hd.c	Fri Mar 22 23:51:58 1996
@@ -26,7 +26,7 @@
  */
 
 /* This is the maximum number of fragments accessed in one go */
-int no_hds;
+extern int number_ide_drives;
 #define MAX_FRAGS	16
 static unsigned long frag_start[MAX_FRAGS];	/* Start of fragments */
 static unsigned long frag_len[MAX_FRAGS];	/* Fragment length */
@@ -827,7 +827,7 @@
 int issue_request(int dev, unsigned int block, unsigned int nsect, struct request *current_req)
 {
 	unsigned int sec, track, head, cyl;
-	int d = dev;
+
 	dev >>= 6;
 	if (special_op[dev]) {
 		if (do_special_op(dev))
@@ -1111,7 +1111,7 @@
 	 * We only set this to the one that the host OS gave us
 	 * if the user has not defined any types.
 	 */
-	NR_HD = no_hds;
+	NR_HD = number_ide_drives;
     }
 
     i = NR_HD;
diff -urN linux.store/linux/arch/arm/drivers/block/hdsrch.c linux/arch/arm/drivers/block/hdsrch.c
--- linux.store/linux/arch/arm/drivers/block/hdsrch.c	Wed Mar 13 23:54:59 1996
+++ linux/arch/arm/drivers/block/hdsrch.c	Thu Mar 28 14:19:13 1996
@@ -17,8 +17,9 @@
 #include <linux/string.h>
 #include <linux/genhd.h>
 
-#define RECSIZE 60
+#define DEBUG_UNINIT
 
+#define RECSIZE 60
 #define MAX_BLK_FRAGS 64
 
 struct boot_block
@@ -89,7 +90,7 @@
 #endif
 
 #ifdef CONFIG_BLK_DEV_XD
-    case XD_MAJOR:
+    case XT_DISK_MAJOR:
 	xd_set_geometry (dev, sectspertrack, heads, disksize, sectorsize);
 	break;
 #endif
@@ -408,8 +409,17 @@
 #define MAX_HD_IMAGES	8
 #define MAX_HD_BITS	128
 
+#ifdef DEBUG_UNINIT
+static unsigned long __magic_1 = 0xf8149512;
+#endif
 static int initialised[MAX_HD_IMAGES];
+#ifdef DEBUG_UNINIT
+static unsigned long __magic_2 = 0x15f73b2c;
+#endif
 static int maxblock[MAX_HD_IMAGES];
+#ifdef DEBUG_UNINIT
+static unsigned long __magic_3 = 0x9bd4a56e;
+#endif
 static unsigned long startchk[MAX_HD_IMAGES],lengthchk[MAX_HD_IMAGES];
 #ifndef NOT_YET_TESTED
 static unsigned long startaddr[MAX_HD_IMAGES][MAX_HD_BITS],
@@ -418,7 +428,6 @@
 static unsigned long *startaddr[MAX_HD_IMAGES],
                     *lengthaddr[MAX_HD_IMAGES];
 #endif
-
 /* --------------------------------------------------------------------------------- */
 /*  Externally visible functions/variables
  * --------------------------------------------------------------------------------- */
@@ -444,7 +453,7 @@
 #ifdef CONFIG_BLK_DEV_HD
     case HD_MAJOR:	/* IDE drives */
 #elif defined(CONFIG_BLK_DEV_XD)
-    case XD_MAJOR:	/* ST506 drives (map onto IDE at the moment) */
+    case XT_DISK_MAJOR:	/* ST506 drives (map onto IDE at the moment) */
 #endif
 	if ((MINOR(dev) & 0x3f) < 1 || (MINOR(dev) & 0x3f) > 0x14) {
 	    printk ("%s: bad device %s\n", where, kdevname (dev));
@@ -476,7 +485,7 @@
 #ifdef CONFIG_BLK_DEV_HD
     case HD_MAJOR:	/* IDE drives */
 #elif defined(CONFIG_BLK_DEV_XD)
-    case XD_MAJOR:	/* ST506 drives (map onto IDE at the moment) */
+    case XT_DISK_MAJOR:	/* ST506 drives (map onto IDE at the moment) */
 #endif	
 	switch (MINOR(dev) & 0xc0) {
 	case 0x00:
@@ -521,8 +530,10 @@
     if (maxblock[devno] > MAX_HD_BITS)
 	panic ("image_allocate_list: image file is too fragmented\n");
 
-    if (!maxblock[devno])
+    if (!maxblock[devno]) {
+    	printk ("image_allocate_list: zero length image file\n");
 	return 0;
+    }
 
     for (i = 0; i < maxblock[devno]; i++) {
 	/* convert to blocks & calculate checksums */
@@ -583,8 +594,27 @@
 	return 0;
 
     if (!initialised[internal_dev]) {
-	printk ("hd%c%d: %s of uninitialised image file.\n",
-	    (dev >> 6) + 'a', dev & 0x3f, cmd == WRITE ? "write" : "read");
+	printk ("\n%s: %s of uninitialised image file.\n",
+	    kdevname (dev), cmd == WRITE ? "write" : "read");
+#ifdef DEBUG_UNINIT
+	{
+	    printk ("(id=%d", internal_dev);
+	    for (i = 0; i < 8; i++)
+	    	printk (" init[%d]=%d", i, initialised[i]);
+	    printk (")\n");
+	    printk ("__magic_1 = 0x%08lx ", __magic_1);
+	    if (__magic_1 != 0xf8149512)
+		printk ("(bad)");
+	    printk ("\n__magic_2 = 0x%08lx ", __magic_2);
+	    if (__magic_2 != 0x15f73b2c)
+		printk ("(bad)");
+	    printk ("\n__magic_3 = 0x%08lx ", __magic_3);
+	    if (__magic_3 != 0x9bd4a56e)
+	        printk ("(bad)");
+	    printk ("\n");
+	}
+	while (1);
+#endif
 	return 0;
     }
 
@@ -598,8 +628,8 @@
 	    chk2 ^= lengthaddr[internal_dev][i];
 	}
 	if (chk1 != startchk[internal_dev] || chk2 != lengthchk[internal_dev]) {
-	    printk ("hda%c%d: mapping tables corrupted on write.",
-			(dev >> 6) + 'a', dev & 0x3f);
+	    printk ("%s: mapping tables corrupted on write.",
+			kdevname (dev));
 	    return 0;
 	}
     }
@@ -644,8 +674,8 @@
 	num++;
     }
 
-    printk ("hd%c%d: attempted read for sector %ld past end if image file at %ld.\n",
-	(dev >> 6) + 'a', dev & 0x3f, blk, totlen);
+    printk ("%s: attempted read for sector %ld past end if image file at %ld.\n",
+	kdevname (dev), blk, totlen);
 	/* Should never happen! */
     return 0;
 }
@@ -655,9 +685,9 @@
 #if 0
 static inline int check_bb(unsigned char *ptr)
 {
-	unsigned int result;
+    unsigned int result;
 	
-	__asm__("
+    __asm__("
 	adds	%3, %2, %3
 	sub	%3, %3, #1
 	b	LC02
@@ -667,8 +697,8 @@
 	mov	%0, %0, lsr #24
 LC02:	teqs	%2, %3
 	bne	LC01
-	" : "=r" (result) : "0" (0), "r" (ptr), "r" (512), "r" (256));
-	return result != ptr[511];
+    " : "=r" (result) : "0" (0), "r" (ptr), "r" (512), "r" (256));
+    return result != ptr[511];
 }
 
 static struct bootblock *bb;
@@ -680,13 +710,15 @@
 
     current_minor = minor;
 
+    /*
+     * read disk address &C00 for ADFS boot sectors
+     */
     if (!(bh = bread (dev, 3, 1024))) {
 	printk (" unable to read boot sectors\n");
 	return -1;
     }
 
-    if (check_bb (bh->b_data))
-    {
+    if (check_bb (bh->b_data)) {
 	brelse (bh);
 	return 0;
     }
@@ -700,10 +732,7 @@
     mapaddr    = ((bb->nzones >> 1) * zonesize - ((bb->nzones > 1)? RECSIZE*8 : 0)) << bb->log2bpmb;
     maplen     = bb->nzones << bb->log2secsize;
 
-    
-
     brelse (bh);
     return 1;
 }
 #endif
-
diff -urN linux.store/linux/arch/arm/drivers/block/mfmhd.c linux/arch/arm/drivers/block/mfmhd.c
--- linux.store/linux/arch/arm/drivers/block/mfmhd.c	Wed Mar 13 23:55:00 1996
+++ linux/arch/arm/drivers/block/mfmhd.c	Thu Mar 28 15:05:27 1996
@@ -18,7 +18,7 @@
  *              Took interrupt handlers off task queue lists and called
  *                directly - not sure of implications.
  *
- *  18/2/96:DAG: Well its reading OK I think, well enough for image file code
+ * 18/2/96:DAG: Well its reading OK I think, well enough for image file code
  *              to find the image file; but now I've discovered that I actually
  *              have to put some code in for image files.
  *
@@ -36,6 +36,7 @@
 #include <linux/config.h>
 #include <linux/sched.h>
 #include <linux/fs.h>
+#include <linux/interrupt.h>
 #include <linux/kernel.h>
 #include <linux/timer.h>
 #include <linux/tqueue.h>
@@ -61,6 +62,7 @@
 static int frag_count;                             /* Number of fragments to go */
 static int frag_pos;                               /* Position in fragment arrays */
 static unsigned int frag_sectors;
+static unsigned Busy;                              /* We're busy if this is true */
 
 static unsigned int PartFragRead;   /* The number of sectors which have been read
                                        during a partial read split over two
@@ -91,9 +93,9 @@
 static void mfm_interrupt_handler (int, struct pt_regs *);
 static void mfm_seek (void);
 static void mfm_unexpected_interrupt (void);
+static void mfm_rerequest (void);
 static void mfm_request (void);
 static int  mfm_reread_partitions (int dev);
-static void mfm_request (void);
 static void mfm_specify (void);
 
 #define mfm_init xd_init
@@ -111,7 +113,6 @@
 static char mfm_IRQMask;    /* AND with *mfm_IRQPollLoc to find if there is an interrupt */
 static int mfm_drives = 0;	/* drives available */
 static int mfm_status = 0;	/* interrupt status */
-static char mfm_busy = 0;	/* mfm busy */
 static int *errors;
 
 static struct rawcmd
@@ -223,6 +224,27 @@
 #define STAT_POL	0x0200		/* Polling */
 
 /* ------------------------------------------------------------------------------------------ */
+static void console_printf(const char *fmt, ...) {
+  static buffer[2048]; /* Arbitary! */
+  extern void console_print(const char *);
+  va_list ap;
+  int flags;
+
+  save_flags(flags);
+  cli();
+
+  va_start(ap,fmt);
+
+  vsprintf(buffer,fmt,ap);
+
+  console_print(buffer);
+
+  va_end(fmt);
+  
+  restore_flags(flags);
+}; /* console_printf */
+
+/* ------------------------------------------------------------------------------------------ */
 
 static struct gendisk mfm_gendisk = {
 	MAJOR_NR,	/* Major number */
@@ -261,7 +283,8 @@
 /* DAG */
 #ifdef CONFIG_MFM_ONMAINBOARD
   mfm_irq = IRQ_HARDDISK;
-  mfm_addr=(0x3250000>>2); /* Motherboard HDC address  - thats probably slow - what should it be? */
+  mfm_addr=(0x32d0000>>2); /* Motherboard HDC address  - thats medium (as RiscOS)
+                              used to be slow */
   mfm_IRQPollLoc=ioc+0x20;
   mfm_IRQMask=0x08; /* IL3 pin */
 #else
@@ -305,11 +328,13 @@
 	gendisk_head = & mfm_gendisk;
 #endif
 
+  Busy=0;
+
 	return 0;
 }
 
 /* DAG: Gets called by the genhd code to set up the number of sectors etc. */
-void xt_set_geometry(int dev,unsigned char secsptrack,unsigned char heads,
+void xd_set_geometry(int dev,unsigned char secsptrack,unsigned char heads,
                    unsigned long discsize, unsigned int secsize)
 {
   dev=MINOR(dev);
@@ -329,18 +354,18 @@
     printk("mfm%c: %d cylinders, %d heads, %d sectors secsize=%d (%ld total)\n",'a'+(dev>>6),
         mfm_info[dev>>6].cylinders, heads, secsptrack, secsize, discsize);
     /* Should probably do a specify command here....*/
-    printk("mfm: at end of set_hdinfo: About to do a specify\n");
+    console_printf("mfm: at end of set_hdinfo: About to do a specify\n");
     if ((heads<1) || (mfm_drive_param[dev>>6].nocylinders>1024)) {
       /* Shouldn't be a panic - but easiest for initial debug */
       panic("xt_set_hdinfo: Invalid heads/cylinders count\n"); 
     };
     mfm_specify();
-    printk("mfm: set_hdinfo after the specify\n");
+    console_printf("mfm: set_hdinfo after the specify\n");
   };
 
   mfm[dev].start_sect=0;
   mfm[dev].nr_sects=(discsize/secsize)/2; /* This is 512 byte sectors - I want 256 but where does this get set for image files? */
-  printk("mfm set_hdinfo: mfm[%d].nr_sects=%ld\n",dev,mfm[dev].nr_sects);
+  console_printf("mfm set_hdinfo: mfm[%d].nr_sects=%ld\n",dev,mfm[dev].nr_sects);
 
 }
     
@@ -363,14 +388,14 @@
 		printk("mfm%d: heads = %d, cylinders = %d, sectors = %d\n", i,
 			 mfm_info[i].heads, mfm_info[i].cylinders, mfm_info[i].sectors);
 
-  /*printk("mfm: Before irq register\n");*/
+  /*console_printf("mfm: Before irq register\n");*/
 	if(request_irq(mfm_irq, mfm_interrupt_handler, SA_INTERRUPT, "MFM harddisk"))
 		printk("mfm: unable to get IRQ%d\n", mfm_irq);
 
-  /*printk("mfm: Before wierd write\n"); */
+  /*console_printf("mfm: Before wierd write\n"); */
 	/*outw(0x80, mfm_addr + (0x1000 >> 2)); *//* Pardon? DAG */
 
-  /*printk("mfm: Before data init\n");*/
+  /*console_printf("mfm: Before data init\n");*/
 	for(i = 0; i < mfm_drives; i++) {
 		mfm[i << 6].nr_sects = mfm_info[i].heads * mfm_info[i].cylinders *
 				mfm_info[i].sectors;
@@ -379,11 +404,11 @@
 	}
 	mfm_gendisk.nr_real = mfm_drives;
 
-  /*printk("mfm: Before init blocksizes\n");*/
+  /*console_printf("mfm: Before init blocksizes\n");*/
 	for(i=0; i<(XD_MAXDRIVES << 6); i++)
 		mfm_blocksizes[i] = 1024;
 	blksize_size[MAJOR_NR] = mfm_blocksizes;
-  /*printk("mfm: End of init\n");*/
+  /*console_printf("mfm: End of init\n");*/
 }
 
 static int mfm_open (struct inode *inode,struct file *file)
@@ -552,16 +577,16 @@
 	int status;
 #ifdef DEBUG
 	int i;
-	printk("issue_command: %02X: ",command);
+	console_printf("issue_command: %02X: ",command);
 	for(i=0; i<len; i++)
-	  printk("%02X ", cmdb[i]);
-	printk("\n");
+	  console_printf("%02X ", cmdb[i]);
+	console_printf("\n");
 #endif
 
 	do {
 		status = inw(MFM_STATUS);
 	} while(status & (STAT_BSY|STAT_POL));
-  /*printk("issue_command: status after pol/bsy loop: %02X:\n ",status>>8); */
+  /*console_printf("issue_command: status after pol/bsy loop: %02X:\n ",status>>8); */
 	if(status & (STAT_CPR|STAT_CED|STAT_SED|STAT_DER|STAT_ABN))
 	{
 		outw(CMD_RCAL, MFM_COMMAND);
@@ -569,7 +594,7 @@
 	}
 
 	status = inw(MFM_STATUS);
-  /*printk("issue_command: status before parameter issue: %02X:\n ",status>>8);*/
+  /*console_printf("issue_command: status before parameter issue: %02X:\n ",status>>8);*/
 	while(len > 0)
 	{
 		outw(cmdb[1] | (cmdb[0] << 8), MFM_DATAOUT);
@@ -577,11 +602,11 @@
 		cmdb += 2;
 	}
 	status = inw(MFM_STATUS);
-  /*printk("issue_command: status before command issue: %02X:\n ",status>>8);*/
+  /*console_printf("issue_command: status before command issue: %02X:\n ",status>>8);*/
 	outw(command, MFM_COMMAND);
 	status = inw(MFM_STATUS);
-  /*printk("issue_command: status immediatly after command issue: %02X:\n ",status>>8);*/
-  udelay(20);
+  /*console_printf("issue_command: status immediatly after command issue: %02X:\n ",status>>8);*/
+  /*udelay(20);*/
 }
 
 static void wait_for_completion (void)
@@ -593,8 +618,9 @@
 
 static void mfm_rw_intr (void)
 {
+  int old_status; /* Holds status on entry, we read to see if the command just finished */
 #ifdef DEBUG
-	printk("mfm_rw_intr...dataleft=%d\n",hdc63463_dataleft);
+	console_printf("mfm_rw_intr...dataleft=%d\n",hdc63463_dataleft);
   print_status();
 #endif
 
@@ -602,6 +628,9 @@
     /* Something has gone wrong - lets try that again */
     outw(CMD_RCAL, MFM_COMMAND);	/* Clear interrupt condition */
     if (cont) {
+#ifdef DEBUG
+      console_printf("mfm_rw_intr: DER/ABN err\n");
+#endif
       cont->error();
       cont->redo();
     };
@@ -633,20 +662,39 @@
       };
       return;
     };
-    /*printk("Going to try read dma..............status=0x%x\n",mfm_status); */
+    /*console_printf("Going to try read dma..............status=0x%x\n",mfm_status); */
     hdc63463_readdma();
   }; /* Read */
 
+  old_status=mfm_status;
 	mfm_status = inw(MFM_STATUS);
   if (mfm_status & (STAT_DER | STAT_ABN)) {
     /* Something has gone wrong - lets try that again */
     if (cont) {
+#ifdef DEBUG
+      console_printf("mfm_rw_intr: DER/ABN error\n");
+#endif
       cont->error();
       cont->redo();
     };
     return;
   };
 
+  /* If this code wasn't entered due to command_end but there is
+  now a command end we must read the command results out. If it was
+  entered like this then mfm_interrupt_handler would have done the
+  job. */
+  if ((!((old_status & (STAT_CPR|STAT_BSY)) == STAT_CPR)) &&
+      ((mfm_status & (STAT_CPR|STAT_BSY)) == STAT_CPR)) {
+    int len=0;
+    while(len<16)
+    {
+      int in;
+      in = inw(MFM_DATAIN);
+      result[len++] = in>>8;
+      result[len++] = in;
+    };
+  }; /* Result read */
   /* If end of command move on */
   if (mfm_status & (STAT_CED)) {
     outw(CMD_RCAL, MFM_COMMAND);	/* Clear interrupt condition */
@@ -657,7 +705,7 @@
     }
     /*mfm_request(); - DAG - took out because we might not have finished the whole command */
 #ifdef DEBUG
-    printk("mfm_rw_intr: returned from cont->done\n");
+    console_printf("mfm_rw_intr: returned from cont->done\n");
 #endif
   } else {
     /* Its going to generate another interrupt */
@@ -668,7 +716,7 @@
 static void mfm_setup_rw (void)
 {
 #ifdef DEBUG
-	printk("setting up for rw...\n");
+	console_printf("setting up for rw...\n");
 #endif
 #if 1
 	SET_INTR(mfm_rw_intr);
@@ -685,7 +733,7 @@
 static void mfm_recal_intr (void)
 {
 #ifdef DEBUG
-	printk("recal intr - status = ");
+	console_printf("recal intr - status = ");
 	print_status();
 #endif
   outw(CMD_RCAL, MFM_COMMAND);	/* Clear interrupt condition */
@@ -719,7 +767,7 @@
 static void mfm_seek_intr (void)
 {
 #ifdef DEBUG
-	printk("seek intr - status = ");
+	console_printf("seek intr - status = ");
 	print_status();  
 #endif
   outw(CMD_RCAL, MFM_COMMAND);	/* Clear interrupt condition */
@@ -753,7 +801,7 @@
   disc to - on its SECOND call to specify! */
 #define IDEA2
 	unsigned char cmdb[16];
-	printk("specify...\n");
+	console_printf("specify...\n");
 	cmdb[0] = 0x1F; /* OM0 - !SECT,!MOD,!DIF,PADP,ECD,CRCP,CRCI,ACOR */
 	cmdb[1] = 0xC3; /* OM1 - DTM,BRST,!CEDM,!SEDM,!DERM,0,AMEX,PSK */
 #ifndef IDEA2
@@ -788,14 +836,14 @@
 {
 	unsigned char cmdb[4];
 #ifdef DEBUG
-	printk("seeking...\n");
+	console_printf("seeking...\n");
 #endif
 	if(MFM_DRV_PARAM.cylinder < 0) {
 		cmdb[0] = raw_cmd.dev + 1;
 		cmdb[1] = raw_cmd.head;
 
 		SET_INTR(mfm_recal_intr);
-    printk("mfm_seek: about to call specify\n");
+    console_printf("mfm_seek: about to call specify\n");
     mfm_specify(); /* DAG added this */
 		issue_command(CMD_RCLB, cmdb, 2);
 		return;
@@ -818,7 +866,7 @@
 static void mfm_initialise (void)
 {
 #ifdef DEBUG
-	printk("init...\n");
+	console_printf("init...\n");
 #endif
 	if(raw_cmd.flags & NEED_SEEK)
 		mfm_seek();
@@ -831,14 +879,15 @@
 static void request_done(int uptodate)
 {
 	if(!CURRENT) {
-		printk("mfm: request list destroyed\n");
+		console_printf("mfm: request list destroyed\n");
 		return;
 	}
 	if(uptodate) {
     /* Apparently worked - lets check bytes left to DMA */
     if (hdc63463_dataleft!=(PartFragRead_SectorsLeft*256)) {
-      printk("mfm: request_done - dataleft=%d - should be %d\n",hdc63463_dataleft,PartFragRead_SectorsLeft*256);
+      console_printf("mfm: request_done - dataleft=%d - should be %d\n",hdc63463_dataleft,PartFragRead_SectorsLeft*256);
       end_request (0);
+      Busy=0;
     } else {
       /* Potentially this means that we've done; but we might be doing
          a partial access, (over two cylinders) or we may have a number
@@ -864,7 +913,9 @@
         unsigned int dev,block,nsect;
         dev=MINOR(CURRENT->rq_dev);
 
-        printk("mfm: Now about to issue fragment %d\n",frag_pos+1);
+#ifdef DEBUG
+        console_printf("mfm: Now about to issue fragment %d\n",frag_pos+1);
+#endif
         /* OK - time to issue another fragment */
         /* Increment the place where we are going to store the data */
         /* Move onto the next fragment */
@@ -874,13 +925,14 @@
            ask for some more fragments */
         if (frag_pos>=MAX_FRAGS)
         {
-          printk("mfm: Getting another block of fragments\n");
+          console_printf("mfm: Getting another block of fragments\n");
           block=CURRENT->sector*2;
           block+=mfm[dev].start_sect;
           nsect=CURRENT->nr_sectors*2;
           if (!image_file_check(CURRENT->rq_dev,CURRENT->cmd))
           {
             end_request(0);
+            Busy=0;
             /* Should I initiate another request here? */
             return;
           }
@@ -888,6 +940,7 @@
           if (!frag_count)
           {
             end_request(0);
+            Busy=0;
             /* Should I initiate another request here? */
             return;
           };
@@ -902,27 +955,29 @@
       } else {
         /* No - its the end of the line */
         end_request (1);
+        Busy=0;
 
 #ifdef DEBUG
-        printk("request_done: About to mfm_request\n");
+        console_printf("request_done: About to mfm_request\n");
 #endif
         /* Next one please */
         mfm_request(); /* Moved from mfm_rw_intr */
 #ifdef DEBUG
-        printk("request_done: returned from mfm_request\n");
+        console_printf("request_done: returned from mfm_request\n");
 #endif
       }; 
     };
 	}
 	else {
 		end_request (0);
+    Busy=0;
 	}
 }
 
 static void error_handler (void)
 {
 	int i;
-	printk("error detected... status = ");
+	console_printf("error detected... status = ");
 	print_status();
   /*panic("mfm error");*/ /* DAG tmp */
 	(*errors) ++;
@@ -934,13 +989,13 @@
 
 static void rw_interrupt(void)
 {
-  printk("rw_interrupt\n");
+  console_printf("rw_interrupt\n");
 }
 
 static struct cont rw_cont ={
 	rw_interrupt,
 	error_handler,
-	mfm_request,
+	mfm_rerequest,
 	request_done
 };
 
@@ -967,7 +1022,7 @@
     sectors_to_next_cyl+=(mfm_info[dev].sectors-start_sector);
 
 #ifdef DEBUG
-    printk("issue_request: mfm_info[dev].sectors=%d track=%d\n",mfm_info[dev].sectors,track);
+    console_printf("issue_request: mfm_info[dev].sectors=%d track=%d\n",mfm_info[dev].sectors,track);
 #endif
 
 		raw_cmd.flags		= NEED_SEEK;
@@ -1003,7 +1058,7 @@
 
 
 #ifdef DEBUG
-		printk("mfm%c: %sing: CHS=%d/%d/%d, sectors=%d, buffer=0x%08lx (%p)\n",
+		console_printf("mfm%c: %sing: CHS=%d/%d/%d, sectors=%d, buffer=0x%08lx (%p)\n",
 			raw_cmd.dev+'a', (CURRENT->cmd == READ)?"read":"writ",
 			raw_cmd.cylinder,
 			raw_cmd.head,
@@ -1012,41 +1067,69 @@
 		cont = &rw_cont;
 		errors = &(CURRENT->errors);
 		mfm_tq.routine = (void (*)(void *))mfm_initialise;
-		queue_task(&mfm_tq, &tq_timer);
+		queue_task(&mfm_tq, &tq_immediate);
+    mark_bh(IMMEDIATE_BH);
 }; /* issue_request */
 
+static void mfm_rerequest (void)
+{
+  /* Called when an error has just happened - need to trick mfm_request
+     into thinking we weren't busy */
+  /* Turn off ints - mfm_request expects no interrupts anyway */
+#ifdef DEBUG
+  console_printf("mfm_rerequest\n");
+#endif
+  cli();
+  Busy=0;
+  mfm_request();
+};
+
 static void mfm_request (void)
 {
 	unsigned int dev, block, nsect;
 
 #ifdef DEBUG
-  printk("mfm_request CURRENT=%p\n",CURRENT);
+  console_printf("mfm_request CURRENT=%p Busy=%d\n",CURRENT,Busy);
 #endif
+  if (!CURRENT) return;
+  /* If we are still processing then return; we will get called again */
+  if (Busy) return;
+  Busy=1;
+
 	if(CURRENT && CURRENT->rq_dev < 0) {
-    printk("mfm_request: exit due to (CURRENT && CURRENT->rq_dev < 0)\n");
+    console_printf("mfm_request: exit due to (CURRENT && CURRENT->rq_dev < 0)\n");
+    Busy=0;
 		return;
   };
 
 	while(1){
 #ifdef DEBUG
-    printk("mfm_request: loop start\n");
+    console_printf("mfm_request: loop start\n");
 #endif
     /* DAG: I wonder if there wshould be a store flags here? */
 		sti();
 
 #ifdef DEBUG
-    printk("mfm_request: before INIT_REQUEST\n");
+    console_printf("mfm_request: before INIT_REQUEST\n");
 #endif
 		INIT_REQUEST;
+
+    /* DAG: Should this be here - e.g. if we run out of valid requests */
+    if (!CURRENT) {
+      console_printf("mfm_request: Exiting due to !CURRENT\n");
+      Busy=0;
+      return;
+    };
+
 #ifdef DEBUG
-    printk("mfm_request: before arg extraction\n");
+    console_printf("mfm_request: before arg extraction\n");
 #endif
 		dev = MINOR(CURRENT->rq_dev);
 		block = CURRENT->sector;
 		nsect = CURRENT->nr_sectors;
 
 #ifdef DEBUG
-    printk("mfm_request: raw vals: dev=%d block=%d nsect=%d\n",dev,block,nsect);
+    console_printf("mfm_request: raw vals: dev=%d block=%d nsect=%d\n",dev,block,nsect);
 #endif
 
     /* DAG: Linux doesn't cope with this - even though it has an array telling
@@ -1064,6 +1147,7 @@
 				printk("mfm%c: bad access: block=%d, count=%d\n", (dev>>6)+'a',
 					block, nsect);
 			end_request(0);
+      Busy=0;
 			continue;
 		}
 		block += mfm[dev].start_sect;
@@ -1081,6 +1165,12 @@
       block=frag_start[0]*2;
       frag_sectors=nsect=frag_len[0]*2;
       frag_pos=0;
+#ifdef DEBUG
+      if (frag_count>1) {
+        console_printf("Multiple fragments rq_dev=%d block=%d nsect=%d frag_start[0]=%d frag_len[0]=%d\n",
+               CURRENT->rq_dev,block,nsect,frag_start[0],frag_len[0]);
+      };
+#endif
     } else {
       /* OK - its not an image file - lets just push it through */
       frag_pos=0;
@@ -1092,17 +1182,19 @@
          /* Stop writing to the raw drive */
          printk("mfm%d: attempted write on protected drive\n",dev);
          end_request(0);
+         Busy=0;
          continue;
       };
     }; /* image file/normal if */
 #ifdef DEBUG
-    printk("mfm_request: block after offset=%d\n",block);
+    console_printf("mfm_request: block after offset=%d\n",block);
 #endif
 
 		if(CURRENT->cmd != READ && CURRENT->cmd != WRITE)
 		{
 			printk("unknown mfm-command %d\n", CURRENT->cmd);
 			end_request(0);
+      Busy=0;
 			continue;
 		}
 
@@ -1111,14 +1203,14 @@
 		break;
 	}
 #ifdef DEBUG
-  printk("mfm_request: Dropping out bottom\n");
+  console_printf("mfm_request: Dropping out bottom\n");
 #endif
 }
 
 static void do_mfm_request (void)
 {
 #ifdef DEBUG
-  printk("do_mfm_request: about to mfm_request\n");
+  console_printf("do_mfm_request: about to mfm_request\n");
 #endif
 	mfm_request();
 }
@@ -1136,7 +1228,7 @@
 	void (*handler)(void) = DEVICE_INTR;
 
 #ifdef DEBUG
-  printk("mfm_interrupt_handler (handler=0x%p)\n",handler);
+  console_printf("mfm_interrupt_handler (handler=0x%p)\n",handler);
 #endif
 	CLEAR_INTR;
 	mfm_status = inw(MFM_STATUS);
@@ -1161,8 +1253,6 @@
 		mfm_unexpected_interrupt();
 		return;
 	}
-	/*mfm_tq.routine = (void (*)(void *))handler;
-	queue_task_irq(&mfm_tq, &tq_timer); */
   handler();
 }
 
diff -urN linux.store/linux/arch/arm/drivers/char/Makefile linux/arch/arm/drivers/char/Makefile
--- linux.store/linux/arch/arm/drivers/char/Makefile	Wed Mar 13 23:55:00 1996
+++ linux/arch/arm/drivers/char/Makefile	Thu Mar 28 14:16:17 1996
@@ -93,8 +93,12 @@
 	done
 	touch links
 
-LINKCLEAN:
+mrproper:
 	-@for f in $(LK); do \
-		if [ -L $$f ]; then rm -f $$f; fi; \
+		if [ -L $$f ]; then \
+			echo $(RM) $$f; \
+			$(RM) $$f; \
+		fi; \
 	done
-	rm -f links
+	$(RM) links
+	$(RM) conmakehash
diff -urN linux.store/linux/arch/arm/drivers/char/console.c linux/arch/arm/drivers/char/console.c
--- linux.store/linux/arch/arm/drivers/char/console.c	Wed Mar 13 23:55:01 1996
+++ linux/arch/arm/drivers/char/console.c	Thu Mar 28 14:21:29 1996
@@ -1818,7 +1818,7 @@
 	}
 }
 
-static void console_print(const char *b)
+void console_print(const char *b)
 {
 	int currcons = fg_console;
 	unsigned char c;
diff -urN linux.store/linux/arch/arm/drivers/char/iic.c linux/arch/arm/drivers/char/iic.c
--- linux.store/linux/arch/arm/drivers/char/iic.c	Sun Mar  3 12:33:06 1996
+++ linux/arch/arm/drivers/char/iic.c	Fri Mar 22 21:53:55 1996
@@ -9,8 +9,7 @@
 #include <asm/system.h>
 #include <asm/delay.h>
 #include <asm/io.h>
-
-extern unsigned char volatile *const ioc;
+#include <asm/hardware.h>
 
 #define DELAY udelay(10)
 
@@ -18,12 +17,12 @@
 {
     unsigned char out;
 
-    out = ioc[0] | 0xc2;
+    out = IOC_CONTROL | 0xc2;
 
-    ioc[0] = out;
+    IOC_CONTROL = out;
     DELAY;
 
-    ioc[0] = out ^ 1;
+    IOC_CONTROL = out ^ 1;
     DELAY;
 }
 
@@ -31,13 +30,13 @@
 {
     unsigned char out;
 
-    out = ioc[0] | 0xc3;
+    out = IOC_CONTROL | 0xc3;
 
     DELAY;
-    ioc[0] = out ^ 1;
+    IOC_CONTROL = out ^ 1;
 
     DELAY;
-    ioc[0] = out;
+    IOC_CONTROL = out;
 }
 
 static int iic_sendbyte (unsigned char b)
@@ -45,30 +44,30 @@
     unsigned char out, in;
     int i;
 
-    out = (ioc[0] & 0xFC) | 0xC0;
+    out = (IOC_CONTROL & 0xFC) | 0xC0;
 
-    ioc[0] = out;
+    IOC_CONTROL = out;
     for (i = 7; i >= 0; i--) {
-	ioc[0] = out | ((b & (1 << i)) ? 1 : 0);
+	IOC_CONTROL = out | ((b & (1 << i)) ? 1 : 0);
 	DELAY;
 
-	ioc[0] = out | ((b & (1 << i)) ? 1 : 0) | 2;
+	IOC_CONTROL = out | ((b & (1 << i)) ? 1 : 0) | 2;
 	DELAY;
 
-	ioc[0] = out | ((b & (1 << i)) ? 1 : 0);
+	IOC_CONTROL = out | ((b & (1 << i)) ? 1 : 0);
     }
-    ioc[0] = out | 1;
+    IOC_CONTROL = out | 1;
     DELAY;
 
-    ioc[0] = out | 3;
+    IOC_CONTROL = out | 3;
     DELAY;
 
-    in = ioc[0] & 1;
+    in = IOC_CONTROL & 1;
 
-    ioc[0] = out | 1;
+    IOC_CONTROL = out | 1;
     DELAY;
 
-    ioc[0] = out;
+    IOC_CONTROL = out;
     DELAY;
 
     if(in) {
@@ -83,25 +82,25 @@
     unsigned char out, in;
     int i;
 
-    out = (ioc[0] & 0xFC) | 0xC0;
+    out = (IOC_CONTROL & 0xFC) | 0xC0;
 
-    ioc[0] = out;
+    IOC_CONTROL = out;
     in = 0;
     for (i = 7; i >= 0; i--) {
-	ioc[0] = out | 1;
+	IOC_CONTROL = out | 1;
 	DELAY;
 
-	ioc[0] = out | 3;
+	IOC_CONTROL = out | 3;
 	DELAY;
 
-	in = (in << 1) | (ioc[0] & 1);
-	ioc[0] = out | 1;
+	in = (in << 1) | (IOC_CONTROL & 1);
+	IOC_CONTROL = out | 1;
 	DELAY;
     }
-    ioc[0] = out;
+    IOC_CONTROL = out;
     DELAY;
 
-    ioc[0] = out | 2;
+    IOC_CONTROL = out | 2;
     DELAY;
 
     return in;
diff -urN linux.store/linux/arch/arm/drivers/char/keyboard.c linux/arch/arm/drivers/char/keyboard.c
--- linux.store/linux/arch/arm/drivers/char/keyboard.c	Wed Mar 13 23:55:03 1996
+++ linux/arch/arm/drivers/char/keyboard.c	Fri Mar 22 21:59:21 1996
@@ -37,6 +37,7 @@
 
 #include <asm/bitops.h>
 #include <asm/irq.h>
+#include <asm/hardware.h>
 
 #include "kbd_kern.h"
 #include "diacr.h"
@@ -216,8 +217,7 @@
 static unsigned char	kbd_sendptri;
 static unsigned char	kbd_sendptro;
 static unsigned char    ledstate = 0xff;
-static unsigned char getleds(void);
-extern unsigned char	*ioc;
+static unsigned char	getleds(void);
 
 /*
  * This array converts the scancode that we get from the keyboard to the
@@ -533,7 +533,7 @@
 
     pt_regs = regs;
 
-    keyval=ioc[4];
+    keyval = IOC_KARTRX;
 
     switch(kbd_state) {
     case 0:/* initial reset condition */
@@ -656,15 +656,13 @@
 
 static void kbd_tx(int irq, struct pt_regs *regs)
 {
-  if(kbd_sendptri!=kbd_sendptro)
-  {
-    ioc[0x04]=kbd_sendvala[kbd_sendptro];
-    kbd_sendptro=(kbd_sendptro+1)&3;
+  if(kbd_sendptri != kbd_sendptro) {
+    IOC_KARTTX = kbd_sendvala[kbd_sendptro];
+    kbd_sendptro = (kbd_sendptro + 1) & 3;
   }
-  if(kbd_sendptri==kbd_sendptro)
-  {
-    disable_irq(14);
-    enable_irq(15);
+  if(kbd_sendptri == kbd_sendptro) {
+    disable_irq (14);
+    enable_irq (15);
   }
 }
 
diff -urN linux.store/linux/arch/arm/drivers/net/Makefile linux/arch/arm/drivers/net/Makefile
--- linux.store/linux/arch/arm/drivers/net/Makefile	Sat Feb 24 21:37:51 1996
+++ linux/arch/arm/drivers/net/Makefile	Thu Mar 28 12:04:14 1996
@@ -148,8 +148,12 @@
 	done
 	touch links
 
-LINKCLEAN:
+mrproper:
 	-@for f in $(LK); do \
-		if [ -L $$f ]; then rm $$f; fi; \
+		if [ -L $$f ]; then \
+			echo $(RM) $$f; \
+			$(RM) $$f; \
+		fi; \
 	done
-	rm -f links
+	$(RM) links
+	$(RM) ppp.ver
diff -urN linux.store/linux/arch/arm/drivers/net/ether1.c linux/arch/arm/drivers/net/ether1.c
--- linux.store/linux/arch/arm/drivers/net/ether1.c	Thu Mar 14 11:43:03 1996
+++ linux/arch/arm/drivers/net/ether1.c	Tue Mar 26 23:16:37 1996
@@ -15,6 +15,12 @@
  * all the time, we have to be careful when we modify the pointers etc
  * so that the buffer memory is valid all the time.
  */
+
+/*
+ * Change log:
+ * 1.00	RMK			Released
+ * 1.01	RMK	   19/03/96	Transfers the last odd byte onto/off of the card now.
+ */
 #ifdef MODULE
 #include <linux/module.h>
 #include <linux/version.h>
@@ -55,15 +61,15 @@
 #define FUNC_PROLOGUE \
 	struct ether1_priv *priv = (struct ether1_priv *)dev->priv
 
-#define BUFFER_SIZE	65536
-#define TX_AREA_START	0x0100
-#define TX_AREA_END	0x5000
-#define RX_AREA_START	0x5000
-#define RX_AREA_END	0xfc00
+#define BUFFER_SIZE	0x10000
+#define TX_AREA_START	0x00100
+#define TX_AREA_END	0x05000
+#define RX_AREA_START	0x05000
+#define RX_AREA_END	0x0fc00
 
 #define tx_done(dev) 0
 /* ------------------------------------------------------------------------- */
-static char *version = "ether1 ethernet driver (c) 1995 Russell King V1.00\n";
+static char *version = "ether1 ethernet driver (c) 1995 Russell King v1.01\n";
 
 #define BUS_16 16
 #define BUS_8  8
@@ -122,8 +128,28 @@
     "	mov	%0, %0, lsr #8\n"
     "	strb	%0, [%2], #1\n"
     "	subs	%3, %3, #2\n"
+    "	bmi	2f\n"
+    "	ldr	%0, [%1], #4\n"
+    "	strb	%0, [%2], #1\n"
+    "	mov	%0, %0, lsr #8\n"
+    "	strb	%0, [%2], #1\n"
+    "	subs	%3, %3, #2\n"
+    "	bmi	2f\n"
+    "	ldr	%0, [%1], #4\n"
+    "	strb	%0, [%2], #1\n"
+    "	mov	%0, %0, lsr #8\n"
+    "	strb	%0, [%2], #1\n"
+    "	subs	%3, %3, #2\n"
+    "	bmi	2f\n"
+    "	ldr	%0, [%1], #4\n"
+    "	strb	%0, [%2], #1\n"
+    "	mov	%0, %0, lsr #8\n"
+    "	strb	%0, [%2], #1\n"
+    "	subs	%3, %3, #2\n"
     "	bpl	1b\n"
-    "2:"
+    "2:	adds	%3, %3, #1\n"
+    "	ldreqb	%0, [%1]\n"
+    "	streqb	%0, [%2]\n"
     : "=&r" (used), "=&r" (addr), "=&r" (data), "=&r" (len)
     : "1" (addr << 2), "2" (data), "3" (len));
 
@@ -143,8 +169,28 @@
     "	orr	%0, %0, %0, lsr #16\n"
     "	str	%0, [%1], #4\n"
     "	subs	%3, %3, #2\n"
+    "	bmi	2f\n"
+    "	ldr	%0, [%2], #2\n"
+    "	mov	%0, %0, lsl #16\n"
+    "	orr	%0, %0, %0, lsr #16\n"
+    "	str	%0, [%1], #4\n"
+    "	subs	%3, %3, #2\n"
+    "	bmi	2f\n"
+    "	ldr	%0, [%2], #2\n"
+    "	mov	%0, %0, lsl #16\n"
+    "	orr	%0, %0, %0, lsr #16\n"
+    "	str	%0, [%1], #4\n"
+    "	subs	%3, %3, #2\n"
+    "	bmi	2f\n"
+    "	ldr	%0, [%2], #2\n"
+    "	mov	%0, %0, lsl #16\n"
+    "	orr	%0, %0, %0, lsr #16\n"
+    "	str	%0, [%1], #4\n"
+    "	subs	%3, %3, #2\n"
     "	bpl	1b\n"
-    "2:"
+    "2:	adds	%3, %3, #1\n"
+    "	ldreqb	%0, [%2]\n"
+    "	streqb	%0, [%1]\n"
     : "=&r" (used), "=&r" (addr), "=&r" (data), "=&r" (len)
     : "1" (addr << 2), "2" (data), "3" (len));
 
@@ -436,6 +482,7 @@
 
     /* release reset & give 586 a prod */
     priv->resetting = 1;
+    priv->initialising = 1;
     outb (CTRL_RST, REG_CONTROL);
     outb (0, REG_CONTROL);
     outb (CTRL_CA, REG_CONTROL);
@@ -490,7 +537,7 @@
     }
 
     i += HZ;
-    while (((status = ether1_inw (dev, TDR_ADDR, tdr_t, tdr_status, DISABLE_IRQS))
+    while (((status = ether1_inw (dev, TDR_ADDR, tdr_t, tdr_status, DISABLEIRQS))
 		& STAT_COMPLETE) == 0) {
 	if (jiffies > i)
 	    break;
@@ -596,7 +643,7 @@
     if ((ec = ecard_find (0, sizeof (ether1_prods) / sizeof (int), ether1_prods, ether1_manus)) == NULL)
 	return ENODEV;
 
-    dev->base_addr = (((unsigned long)ec->r_podaddr & ~0x3c0000) + 0x340000) >> 2;
+    dev->base_addr = (((unsigned long)ecard_address (ec->slot_no, ECARD_IOC, ECARD_FAST)) >> 2;
     dev->irq       = ec->irq;
 
     ecard_claim (ec);
@@ -637,15 +684,35 @@
     return start;
 }
 
+static void
+ether1_restart (struct device *dev, char *reason)
+{
+    FUNC_PROLOGUE;
+    priv->stats.tx_errors ++;
+
+    if (reason)
+	printk ("%s: %s - resetting device\n", dev->name, reason);
+    else
+	printk (" - resetting device\n");
+
+    ether1_reset (dev);
+
+    dev->start = 0;
+    dev->tbusy = 0;
+
+    if (ether1_init_for_open (dev))
+	printk ("%s: unable to restart interface\n", dev->name);
+
+    dev->start = 1;
+}
+
 static int
 ether1_open (struct device *dev)
 {
     FUNC_PROLOGUE;
 #ifdef CLAIM_IRQ_AT_OPEN
-    if (request_irq (dev->irq, ether1_interrupt, 0, "ether1")) {
-	kfree (dev->priv);
+    if (request_irq (dev->irq, ether1_interrupt, 0, "ether1"))
 	return -EAGAIN;
-    }
 
     irq2dev_map[dev->irq] = dev;
 #endif
@@ -653,7 +720,14 @@
 
     memset (&priv->stats, 0, sizeof (struct enet_statistics));
 
-    ether1_init_for_open (dev);
+    if (ether1_init_for_open (dev)) {
+#ifdef CLAIM_IRQ_AT_OPEN
+	free_irq (dev->irq);
+	irq2dev_map[dev->irq] = NULL;
+#endif
+	MOD_DEC_USE_COUNT;
+	return -EAGAIN;
+    }
 
     dev->tbusy = 0;
     dev->interrupt = 0;
@@ -677,10 +751,12 @@
 	if (tickssofar < 5)
 	    return 1;
 
-	printk ("%s: transmit timeout, network cable problem?\n", dev->name);
-
 	/* Try to restart the adapter. */
+	ether1_restart (dev, "transmit timeout, network cable problem?");
+#if 0
+	printk ("%s: transmit timeout, network cable problem?\n", dev->name);
 	dev->tbusy = 0;
+#endif
 	dev->trans_start = jiffies;
     }
 
@@ -780,7 +856,10 @@
 
     case CMD_NOP:
 	if (nop.nop_link == caddr) {
-	    printk ("%s: strange command complete with no tx command!\n", dev->name);
+	    if (priv->initialising == 0)
+		printk ("%s: strange command complete with no tx command!\n", dev->name);
+	    else
+	        priv->initialising = 0;
 	    return;
 	}
 	caddr = nop.nop_link;
@@ -789,11 +868,13 @@
     case CMD_TX:
 	if (nop.nop_status & STAT_COMPLETE)
 	    break;
-	printk ("%s: strange command complete without completed command!\n", dev->name);
+	ether1_restart (dev, "strange command complete without completed command!");
 	return;
 
     default:
-	printk ("%s: strange command %d complete!\n", dev->name, nop.nop_command & CMD_MASK);
+	printk ("%s: strange command %d complete! (offset %04X)", dev->name,
+		nop.nop_command & CMD_MASK, caddr);
+	ether1_restart (dev, NULL);
 	return;
     }
 
@@ -1031,7 +1112,7 @@
 	memset (my_ethers[i], 0, sizeof (struct device));
 
 	my_ethers[i]->irq = ec[i]->irq;
-	my_ethers[i]->base_addr = (((unsigned long)ec[i]->r_podaddr & ~0x3c0000) + 0x340000) >> 2;
+	my_ethers[i]->base_addr = (((unsigned long)ecard_address (ec[i]->slot_no, ECARD_IOC, ECARD_FAST)) >> 2;
 	my_ethers[i]->init = ether1_probe;
 	my_ethers[i]->name = ethernames[i];
 
diff -urN linux.store/linux/arch/arm/drivers/net/ether1.h linux/arch/arm/drivers/net/ether1.h
--- linux.store/linux/arch/arm/drivers/net/ether1.h	Sat Feb 17 10:05:58 1996
+++ linux/arch/arm/drivers/net/ether1.h	Wed Mar 20 10:17:11 1996
@@ -39,6 +39,7 @@
 	volatile int rx_tail;
 	char bus_type;
 	char resetting;
+	char initialising;
 };
 
 static int ether1_open (struct device *dev);
diff -urN linux.store/linux/arch/arm/drivers/net/ether3.c linux/arch/arm/drivers/net/ether3.c
--- linux.store/linux/arch/arm/drivers/net/ether3.c	Wed Mar 13 23:55:05 1996
+++ linux/arch/arm/drivers/net/ether3.c	Fri Mar 22 23:23:05 1996
@@ -407,7 +407,7 @@
     if ((ec = ecard_find (0, sizeof(ether3_prods), ether3_prods, ether3_manus)) == NULL)
 	return ENODEV;
 
-    dev->base_addr = ((unsigned long)ec->r_podaddr & ~0x003c0000UL) >> 2;
+    dev->base_addr = ((unsigned long)ecard_address (ec->slot_no, ECARD_MEMC, 0)) >> 2;
     dev->irq = ec->irq;
 
     ecard_claim (ec);
@@ -874,7 +874,7 @@
 	memset(my_ethers[i], 0, sizeof(struct device));
 
 	my_ethers[i]->irq = ec[i]->irq;
-	my_ethers[i]->base_addr= ((unsigned long)ec[i]->r_podaddr & ~0x003c0000UL)>>2;
+	my_ethers[i]->base_addr= ((unsigned long)ecard_address (ec[i]->slot_no, ECARD_MEMC, 0))>>2;
 	my_ethers[i]->init = ether3_probe1;
 	my_ethers[i]->name = ethernames[i];
 
diff -urN linux.store/linux/arch/arm/drivers/scsi/Makefile linux/arch/arm/drivers/scsi/Makefile
--- linux.store/linux/arch/arm/drivers/scsi/Makefile	Wed Mar 13 23:55:05 1996
+++ linux/arch/arm/drivers/scsi/Makefile	Thu Mar 28 11:55:16 1996
@@ -140,8 +140,11 @@
 	done
 	touch links
 
-LINKCLEAN:
+mrproper:
 	-@for f in $(LK); do \
-		if [ -L $$f ]; then rm -f $$f; fi; \
+		if [ -L $$f ]; then \
+			echo $(RM) $$f; \
+			$(RM) $$f; \
+		fi; \
 	done
-	rm -f links
+	$(RM) links
diff -urN linux.store/linux/arch/arm/drivers/scsi/acornscsi.c linux/arch/arm/drivers/scsi/acornscsi.c
--- linux.store/linux/arch/arm/drivers/scsi/acornscsi.c	Wed Mar 13 23:55:06 1996
+++ linux/arch/arm/drivers/scsi/acornscsi.c	Fri Mar 22 23:25:50 1996
@@ -1807,7 +1807,7 @@
 	    break;
 
 	instance = scsi_register (tpnt, sizeof(struct acornscsi_hostdata));
-	instance->io_port = ((int)ecs[count]->r_podaddr & ~0x003C0000) >> 2;
+	instance->io_port = ((int)ecard_address (ecs[count]->slot_no, ECARD_MEMC, 0)) >> 2;
 	instance->irq = ecs[count]->irq;
 
 	if (instance->irq != 0xff) {
diff -urN linux.store/linux/arch/arm/drivers/scsi/cumana_1.c linux/arch/arm/drivers/scsi/cumana_1.c
--- linux.store/linux/arch/arm/drivers/scsi/cumana_1.c	Sat Feb 24 09:36:55 1996
+++ linux/arch/arm/drivers/scsi/cumana_1.c	Fri Mar 22 23:27:20 1996
@@ -87,7 +87,7 @@
     		break;
 
         instance = scsi_register (tpnt, sizeof(struct NCR5380_hostdata));
-        instance->io_port = (((int)ec->r_podaddr & ~0x003c0000UL) | 0x00242000UL) >> 2;
+        instance->io_port = (((int)ecard_address (ec->slot_no, ECARD_IOC, ECARD_SLOW) + 0x2000) >> 2;
 
 	NCR5380_init(instance, 0);
 
diff -urN linux.store/linux/arch/arm/drivers/scsi/oak.c linux/arch/arm/drivers/scsi/oak.c
--- linux.store/linux/arch/arm/drivers/scsi/oak.c	Sat Feb 24 09:36:56 1996
+++ linux/arch/arm/drivers/scsi/oak.c	Fri Mar 22 23:28:17 1996
@@ -82,7 +82,7 @@
             break;
 
         instance = scsi_register (tpnt, sizeof(struct NCR5380_hostdata));
-        instance->io_port = ((int)ecs[count]->r_podaddr & ~0x003c0000)>>2;
+        instance->io_port = ((int)ecard_address (ecs[count]->slot_no, ECARD_MEMC, 0)) >> 2;
 
 	NCR5380_init(instance, 0);
 
diff -urN linux.store/linux/arch/arm/drivers/sound/Makefile linux/arch/arm/drivers/sound/Makefile
--- linux.store/linux/arch/arm/drivers/sound/Makefile	Sun Feb 11 09:32:34 1996
+++ linux/arch/arm/drivers/sound/Makefile	Thu Mar 28 11:55:43 1996
@@ -11,3 +11,4 @@
 
 include $(TOPDIR)/Rules.make
 
+mrproper:
diff -urN linux.store/linux/arch/arm/drivers/sound/arcaudio.c linux/arch/arm/drivers/sound/arcaudio.c
--- linux.store/linux/arch/arm/drivers/sound/arcaudio.c	Sun Mar  3 12:51:13 1996
+++ linux/arch/arm/drivers/sound/arcaudio.c	Fri Mar 22 22:01:59 1996
@@ -18,10 +18,10 @@
 #include "soundirq.h"
 #include "voice.h"
 
-#include "asm/segment.h"
+#include <asm/segment.h>
+#include <asm/hardware.h>
 
 static int spkr;
-extern unsigned char *ioc;
 
 static int arcaudio_write(struct inode *inode, struct file *filp, const char *buf, int nr)
 {
@@ -173,9 +173,9 @@
 {
 	spkr = get_fs_long(arg) & 1;
 	if(spkr)
-		ioc[0] = (ioc[0] & ~0x20) | 0xc0;
+		IOC_CONTROL = (IOC_CONTROL & ~0x20) | 0xc0;
 	else
-		ioc[0] = (ioc[0] | 0x20) | 0xc0;
+		IOC_CONTROL = (IOC_CONTROL | 0x20) | 0xc0;
 	return 0;
 }
 
@@ -231,5 +231,5 @@
   else
     printk("arcaudio ");
 
-  spkr = (ioc[0] & 0x20) == 0;
+  spkr = (IOC_CONTROL & 0x20) == 0;
 }
diff -urN linux.store/linux/arch/arm/kernel/dma.c linux/arch/arm/kernel/dma.c
--- linux.store/linux/arch/arm/kernel/dma.c	Wed Mar 13 23:55:06 1996
+++ linux/arch/arm/kernel/dma.c	Thu Mar 28 14:35:00 1996
@@ -8,6 +8,7 @@
 #include <asm/irq.h>
 #include <asm/dma.h>
 #include <asm/io.h>
+#include <asm/hardware.h>
 
 static unsigned long dma_address[8];
 static unsigned long dma_count[8];
@@ -16,6 +17,7 @@
 void enable_dma (unsigned int dmanr)
 {
 #ifdef CONFIG_BLK_DEV_FD
+#ifdef CONFIG_ARCH_A5K
     if (dmanr == 2) {
     	switch (dma_direction[dmanr]) {
     	case 1: /* read */
@@ -25,7 +27,7 @@
 			unsigned long port);
 		memcpy ((void *)0x1c, (void *)&floppy_fiqin_start,
 			&floppy_fiqin_end - &floppy_fiqin_start);
-		floppy_fiqsetup (dma_count[dmanr], dma_address[dmanr], io_base + 0x02a000);
+		floppy_fiqsetup (dma_count[dmanr], dma_address[dmanr], (int)PCIO_FLOPPYDMABASE);
 		enable_irq (16);
 		break;
 	    }
@@ -36,7 +38,7 @@
 			unsigned long port);
 		memcpy ((void *)0x1c, (void *)&floppy_fiqout_start,
 			&floppy_fiqout_end - &floppy_fiqout_start);
-		floppy_fiqsetup (dma_count[dmanr], dma_address[dmanr], io_base + 0x02a000);
+		floppy_fiqsetup (dma_count[dmanr], dma_address[dmanr], (int)PCIO_FLOPPYDMABASE);
 		enable_irq (16);
 		break;
 	    }
@@ -46,7 +48,7 @@
 	} /* Direction switch */
     }; /* dmanr == 2 */
 #endif
-#ifdef CONFIG_BLK_DEV_FD1772
+#ifdef CONFIG_ARCH_ARC
     switch (dmanr) {
       case 0: /* Data DMA */
 		switch (dma_direction[dmanr]) {
@@ -109,6 +111,7 @@
       break;
     } /* dma number switch */
 #endif
+#endif
 }
 
 void set_dma_mode (unsigned int dmanr, char mode)
@@ -145,14 +148,15 @@
 int get_dma_residue (unsigned int dmanr)
 {
 #ifdef CONFIG_BLK_DEV_FD
+#ifdef CONFIG_ARCH_A5K
     extern int floppy_fiqresidual (void);
     if (dmanr == 2)
 	return floppy_fiqresidual ();
 #endif
-#ifdef CONFIG_BLK_DEV_FD1772
+#ifdef CONFIG_ARCH_ARC
     extern unsigned int fdc1772_bytestogo;
     if (dmanr == 0) return fdc1772_bytestogo; 
 #endif
-
+#endif
     return -1;
 }
diff -urN linux.store/linux/arch/arm/kernel/ecard.c linux/arch/arm/kernel/ecard.c
--- linux.store/linux/arch/arm/kernel/ecard.c	Wed Mar 13 23:55:07 1996
+++ linux/arch/arm/kernel/ecard.c	Fri Mar 22 23:21:00 1996
@@ -20,6 +20,8 @@
 #include <asm/ecard.h>
 #include <asm/irq.h>
 #include <asm/io.h>
+#include <asm/hardware.h>
+
 #ifdef CONFIG_ARCH_ARC
 #include <asm/arch/oldlatches.h>
 #endif
@@ -28,13 +30,10 @@
  * from linux/arch/arm/kernel/irq.c
  */
 extern void do_fast_IRQ(int irq);
-extern unsigned char *ioc;
 int ecard_num_cards;
 
 #define MAX_ECARDS 4
 
-#define expmask ((volatile unsigned char *)(io_base + 0x360000))
-
 static struct expansion_card expcard[MAX_ECARDS];
 static char have_expmask = 0;
 static char initialised = 0;
@@ -81,7 +80,7 @@
 #endif
 
     for (i = 0; i < num_cards; i++) {
-	if (expmask[0] & (1 << i)) {
+	if (EXPMASK_STATUS & (1 << i)) {
 	    if (expcard[i].r_found && expcard[i].r_claimed) {
 		if (!expcard[i].r_irqmask || (expcard[i].r_irqaddr[0] & expcard[i].r_irqmask)) {
 		    /*
@@ -100,16 +99,16 @@
 		    cli ();
 		    oldexpmask = have_expmask;
 		    have_expmask &= (~(15 << i)) | 0xf0;
-		    expmask[4] = have_expmask;
-		    ioc[0x28] |= 1 << 5;
+		    EXPMASK_ENABLE = have_expmask;
+		    IOC_IRQMASKB |= 1 << 5;
 		    sti ();
 #endif
 		    do_fast_IRQ (expcard[i].irq);
 		    ns ++;
 #if 0
 		    cli ();
-		    ioc[0x28] &= ~(1 << 5);
-		    expmask[4] = oldexpmask;
+		    IOC_IRQMASKB &= ~(1 << 5);
+		    EXPMASK_ENABLE = oldexpmask;
 		    sti ();
 #endif
 		} else
@@ -118,7 +117,7 @@
 		printk ("card%d: interrupt from non-claimed card\n", i);
 		have_expmask &= ~(1 << i);
 		/* disable interrupt */
-		expmask[4] = have_expmask;
+		EXPMASK_ENABLE = have_expmask;
 	    }
 	}
     }
@@ -130,7 +129,7 @@
 {/*printk ("irq %d enable\n", intr_no);
     if (have_expmask && intr_no >= 24 && intr_no < 28) {
 	have_expmask |= 1 << (intr_no - 24);
-	expmask[4] = have_expmask;
+	EXPMASK_ENABLE = have_expmask;
     }*/
 }
 
@@ -138,17 +137,19 @@
 {/*printk ("irq %d disable\n", intr_no);
     if (have_expmask && intr_no >= 24 && intr_no < 28) {
 	have_expmask &= ~(1 << (intr_no - 24));
-	expmask[4] = have_expmask; 
+	EXPMASK_ENABLE = have_expmask; 
     }*/
 }
 
 static int ecard_checkirqhw (void)
 {
     int found;
-    expmask[4] = 0x00;
-    expmask[0] = 0xff;
-    found = (expmask[0] == 0xf0);
-    expmask[4] = 0xff;
+
+    EXPMASK_ENABLE = 0x00;
+    EXPMASK_STATUS = 0xff;
+    found = (EXPMASK_STATUS == 0xf0);
+    EXPMASK_ENABLE = 0xff;
+
     return found;
 }
 
@@ -255,6 +256,11 @@
 	return 1;
 }
 
+unsigned char *ecard_address (int card, int memc, int speed)
+{
+    return (unsigned char *)(memc ? MEMCECIO_BASE : IOCECIO_BASE + (speed << 19)) + (card << 14);
+}
+
 unsigned long ecard_init(unsigned long my_kmem)
 {
     int i;
@@ -293,7 +299,8 @@
 		
 	ec = &expcard[i];
 		
-	ec->r_podaddr = (volatile unsigned char *)(io_base + 0x3C0000 + 0x4000*i);
+	ec->slot_no = i;
+	ec->r_podaddr = ecard_address (i, 0, ECARD_SYNC);
 		
 	ec->ecld.r_ecld = 2;
 	ec->irq = 0;
@@ -335,19 +342,12 @@
     printk("\n");
 
     if (have_expmask)
-	expmask[4] = have_expmask;
+	EXPMASK_ENABLE = have_expmask;
 
     initialised = 1;
-    return kmem;	
-}
-
-unsigned long bios32_init(unsigned long start_mem, unsigned long end_mem)
-{
-    unsigned long mem;
-
-    mem = ecard_init(start_mem);
-
 #ifdef CONFIG_ARCH_ARC
     oldlatch_init ();
 #endif
+    return kmem;	
 }
+
diff -urN linux.store/linux/arch/arm/kernel/head.S linux/arch/arm/kernel/head.S
--- linux.store/linux/arch/arm/kernel/head.S	Sun Mar  3 13:03:43 1996
+++ linux/arch/arm/kernel/head.S	Thu Mar 14 23:26:08 1996
@@ -67,39 +67,32 @@
 @		4156025X = ARM 250
 @		4156020X = ARM 2
 @
-		adr	r0, undef_instr - 12
-		mov	r2, #4
-		mov	r3, #0xea000000
-		orr	r0, r3, r0, lsr #2
-		str	r0, [r2]
-
-		mrc	15, 0, r0, c0, c0
-
-continue:
+		adr	r3, undef_instr - 12
+		mov	r2, #0
+		mov	r0, #0xea000000
+		orr	r3, r0, r3, lsr #2
+		str	r3, [r2, #4]
+
+		ldr	r3, arm2_id
+		swp	r0, r0, [r2]		@ check for swp - if it can't do it, then it
+		ldr	r3, arm250_id		@ must be ARM2
+		mrc	15, 0, r0, c0, c0	@ check for CP#15 - if it can't do it, then ARM250
+		mov	r3, r0
+continue:	ldr	r0, [pc, #LC4 - . - 8]
+		str	r3, [r0]
 @
 @ Make undefined instr vector point to itself (endless loop)
 @
+		mov	r3, #0xeb000000
 		sub	r3, r3, #2
-		orr	r3, r3, #0xeb000000
-		str	r3, [r2]
-		ldr	r3, [pc, #LC4 - . - 8]
-		str	r0, [r3]
+		mov	r2, #0
+		str	r3, [r2, #4]
 		mov	fp, #0
 		b	_start_kernel
 @
-@ IF we come in here from the mrc instruction, then we have an ARM2/250
+@ IF we come in here then one of the swp / mrc instructions must have aborted - jum
 @
-undef_instr:	adr	r0, undef_instr2 - 12
-		orr	r0, r3, r0, lsr #2
-		str	r0, [r2], #4
-		swpb	r0, r0, [r2]
-		ldr 	r0, arm250_id
-		b	continue
-
-arm250_id:	.long	0x41560250
-
-undef_instr2:	ldr	r0, arm2_id
-		b	continue
+undef_instr:	b	continue
 
 arm2_id:	.long	0x41560200
-
+arm250_id:	.long	0x41560250
diff -urN linux.store/linux/arch/arm/kernel/irq.c linux/arch/arm/kernel/irq.c
--- linux.store/linux/arch/arm/kernel/irq.c	Wed Mar 13 23:55:07 1996
+++ linux/arch/arm/kernel/irq.c	Fri Mar 22 22:46:23 1996
@@ -31,8 +31,7 @@
 #include <linux/random.h>
 
 #include <asm/system.h>
-
-extern char *ioc;
+#include <asm/hardware.h>
 
 /*
  * Slight change here - we now keep a bit array of currently executing
@@ -61,13 +60,13 @@
     enabled_irqs &= ~(1 << irq_nr);
 
     if (irq_nr < 8)
-	ioc[0x18] &= ~(1 << irq_nr);
+	IOC_IRQMASKA &= ~(1 << irq_nr);
     else
     if (irq_nr < 16)
-	ioc[0x28] &= ~(1 << (irq_nr & 7));
+	IOC_IRQMASKB &= ~(1 << (irq_nr & 7));
     else
     if (irq_nr < 24)
-	ioc[0x38] &= ~(1 << (irq_nr & 7));
+	IOC_FIQMASK &= ~(1 << (irq_nr & 7));
     else
         ecard_disableirq (irq_nr);
 
@@ -90,13 +89,13 @@
 
     if ((executing_irqs & (1 << irq_nr)) == 0) {
 	if (irq_nr < 8)
-	    ioc[0x18] |= 1 << irq_nr;
+	    IOC_IRQMASKA |= 1 << irq_nr;
 	else
     	if (irq_nr < 16)
-	    ioc[0x28] |= 1 << (irq_nr & 7);
+	    IOC_IRQMASKB |= 1 << (irq_nr & 7);
 	else
 	if (irq_nr < 24)
-	    ioc[0x38] |= (1 << (irq_nr & 7));
+	    IOC_FIQMASK |= (1 << (irq_nr & 7));
     }
     if (irq_nr >= 24)
 	ecard_enableirq (irq_nr);
@@ -149,89 +148,89 @@
  * fast ones, then the bad ones.
  */
 static void (*interrupt[16])(void) = {
-	IRQ0_interrupt, IRQ1_interrupt, IRQ2_interrupt, IRQ3_interrupt,
-	IRQ4_interrupt, IRQ5_interrupt, IRQ6_interrupt, IRQ7_interrupt,
-	IRQ8_interrupt, IRQ9_interrupt, IRQ10_interrupt, IRQ11_interrupt,
-	IRQ12_interrupt, IRQ13_interrupt, IRQ14_interrupt, IRQ15_interrupt
+    IRQ0_interrupt, IRQ1_interrupt, IRQ2_interrupt, IRQ3_interrupt,
+    IRQ4_interrupt, IRQ5_interrupt, IRQ6_interrupt, IRQ7_interrupt,
+    IRQ8_interrupt, IRQ9_interrupt, IRQ10_interrupt, IRQ11_interrupt,
+    IRQ12_interrupt, IRQ13_interrupt, IRQ14_interrupt, IRQ15_interrupt
 };
 
 static void (*fast_interrupt[16])(void) = {
-	fast_IRQ0_interrupt, fast_IRQ1_interrupt,
-	fast_IRQ2_interrupt, fast_IRQ3_interrupt,
-	fast_IRQ4_interrupt, fast_IRQ5_interrupt,
-	fast_IRQ6_interrupt, fast_IRQ7_interrupt,
-	fast_IRQ8_interrupt, fast_IRQ9_interrupt,
-	fast_IRQ10_interrupt, fast_IRQ11_interrupt,
-	fast_IRQ12_interrupt, fast_IRQ13_interrupt,
-	fast_IRQ14_interrupt, fast_IRQ15_interrupt
+    fast_IRQ0_interrupt, fast_IRQ1_interrupt,
+    fast_IRQ2_interrupt, fast_IRQ3_interrupt,
+    fast_IRQ4_interrupt, fast_IRQ5_interrupt,
+    fast_IRQ6_interrupt, fast_IRQ7_interrupt,
+    fast_IRQ8_interrupt, fast_IRQ9_interrupt,
+    fast_IRQ10_interrupt, fast_IRQ11_interrupt,
+    fast_IRQ12_interrupt, fast_IRQ13_interrupt,
+    fast_IRQ14_interrupt, fast_IRQ15_interrupt
 };
 
 static void (*bad_interrupt[16])(void) = {
-	bad_IRQ0_interrupt, bad_IRQ1_interrupt,
-	bad_IRQ2_interrupt, bad_IRQ3_interrupt,
-	bad_IRQ4_interrupt, bad_IRQ5_interrupt,
-	bad_IRQ6_interrupt, bad_IRQ7_interrupt,
-	bad_IRQ8_interrupt, bad_IRQ9_interrupt,
-	bad_IRQ10_interrupt, bad_IRQ11_interrupt,
-	bad_IRQ12_interrupt, bad_IRQ13_interrupt,
-	bad_IRQ14_interrupt, bad_IRQ15_interrupt
+    bad_IRQ0_interrupt, bad_IRQ1_interrupt,
+    bad_IRQ2_interrupt, bad_IRQ3_interrupt,
+    bad_IRQ4_interrupt, bad_IRQ5_interrupt,
+    bad_IRQ6_interrupt, bad_IRQ7_interrupt,
+    bad_IRQ8_interrupt, bad_IRQ9_interrupt,
+    bad_IRQ10_interrupt, bad_IRQ11_interrupt,
+    bad_IRQ12_interrupt, bad_IRQ13_interrupt,
+    bad_IRQ14_interrupt, bad_IRQ15_interrupt
 };
 
 struct irqaction {
-	void (*handler)(int, struct pt_regs *);
-	unsigned long flags;
-	unsigned long mask;
-	const char *name;
+    void (*handler)(int, struct pt_regs *);
+    unsigned long flags;
+    unsigned long mask;
+    const char *name;
 };
 
 /*
  * Initial irq handlers.
  */
 struct irqaction irq_action[32] = {
-	{ NULL, 0, 0, NULL }, { NULL, 0, 0, NULL },
-	{ NULL, 0, 0, NULL }, { NULL, 0, 0, NULL },
-	{ NULL, 0, 0, NULL }, { NULL, 0, 0, NULL },
-	{ NULL, 0, 0, NULL }, { NULL, 0, 0, NULL },
-	{ NULL, 0, 0, NULL }, { NULL, 0, 0, NULL },
-	{ NULL, 0, 0, NULL }, { NULL, 0, 0, NULL },
-	{ NULL, 0, 0, NULL }, { NULL, 0, 0, NULL },
-	{ NULL, 0, 0, NULL }, { NULL, 0, 0, NULL },
-	{ NULL, 0, 0, NULL }, { NULL, 0, 0, NULL },
-	{ NULL, 0, 0, NULL }, { NULL, 0, 0, NULL },
-	{ NULL, 0, 0, NULL }, { NULL, 0, 0, NULL },
-	{ NULL, 0, 0, NULL }, { NULL, 0, 0, NULL },
-	{ NULL, 0, 0, NULL }, { NULL, 0, 0, NULL },
-	{ NULL, 0, 0, NULL }, { NULL, 0, 0, NULL },
-	{ NULL, 0, 0, NULL }, { NULL, 0, 0, NULL },
-	{ NULL, 0, 0, NULL }, { NULL, 0, 0, NULL }
+    { NULL, 0, 0, NULL }, { NULL, 0, 0, NULL },
+    { NULL, 0, 0, NULL }, { NULL, 0, 0, NULL },
+    { NULL, 0, 0, NULL }, { NULL, 0, 0, NULL },
+    { NULL, 0, 0, NULL }, { NULL, 0, 0, NULL },
+    { NULL, 0, 0, NULL }, { NULL, 0, 0, NULL },
+    { NULL, 0, 0, NULL }, { NULL, 0, 0, NULL },
+    { NULL, 0, 0, NULL }, { NULL, 0, 0, NULL },
+    { NULL, 0, 0, NULL }, { NULL, 0, 0, NULL },
+    { NULL, 0, 0, NULL }, { NULL, 0, 0, NULL },
+    { NULL, 0, 0, NULL }, { NULL, 0, 0, NULL },
+    { NULL, 0, 0, NULL }, { NULL, 0, 0, NULL },
+    { NULL, 0, 0, NULL }, { NULL, 0, 0, NULL },
+    { NULL, 0, 0, NULL }, { NULL, 0, 0, NULL },
+    { NULL, 0, 0, NULL }, { NULL, 0, 0, NULL },
+    { NULL, 0, 0, NULL }, { NULL, 0, 0, NULL },
+    { NULL, 0, 0, NULL }, { NULL, 0, 0, NULL }
 };
 
 void (*irqjump[32])(void) =
 {
-  bad_IRQ0_interrupt , bad_IRQ1_interrupt , bad_IRQ2_interrupt , bad_IRQ3_interrupt ,
-  bad_IRQ4_interrupt , bad_IRQ5_interrupt , bad_IRQ6_interrupt , bad_IRQ7_interrupt ,
-  bad_IRQ8_interrupt , bad_IRQ9_interrupt , bad_IRQ10_interrupt, bad_IRQ11_interrupt,
-  bad_IRQ12_interrupt, bad_IRQ13_interrupt, bad_IRQ14_interrupt, bad_IRQ15_interrupt,
-  bad_IRQ    , bad_IRQ    , bad_IRQ    , bad_IRQ,
-  bad_IRQ    , bad_IRQ    , bad_IRQ    , bad_IRQ,
-  bad_IRQ    , bad_IRQ    , bad_IRQ    , bad_IRQ,
-  bad_IRQ    , bad_IRQ    , bad_IRQ    , bad_IRQ,
+    bad_IRQ0_interrupt , bad_IRQ1_interrupt , bad_IRQ2_interrupt , bad_IRQ3_interrupt ,
+    bad_IRQ4_interrupt , bad_IRQ5_interrupt , bad_IRQ6_interrupt , bad_IRQ7_interrupt ,
+    bad_IRQ8_interrupt , bad_IRQ9_interrupt , bad_IRQ10_interrupt, bad_IRQ11_interrupt,
+    bad_IRQ12_interrupt, bad_IRQ13_interrupt, bad_IRQ14_interrupt, bad_IRQ15_interrupt,
+    bad_IRQ    , bad_IRQ    , bad_IRQ    , bad_IRQ,
+    bad_IRQ    , bad_IRQ    , bad_IRQ    , bad_IRQ,
+    bad_IRQ    , bad_IRQ    , bad_IRQ    , bad_IRQ,
+    bad_IRQ    , bad_IRQ    , bad_IRQ    , bad_IRQ,
 };
 
 int get_irq_list(char *buf)
 {
-	int i, len = 0;
-	struct irqaction * action = irq_action;
+    int i, len = 0;
+    struct irqaction * action = irq_action;
 
-	for (i = 0 ; i < 32 ; i++, action++) {
-		if (!action->handler)
-			continue;
-		len += sprintf(buf+len, "%2d: %8d %c %s\n",
-			i, kstat.interrupts[i],
-			(action->flags & SA_INTERRUPT) ? '+' : ' ',
-			action->name);
-	}
-	return len;
+    for (i = 0 ; i < 32 ; i++, action++) {
+	if (!action->handler)
+	    continue;
+	len += sprintf(buf+len, "%2d: %8d %c %s\n",
+		i, kstat.interrupts[i],
+		(action->flags & SA_INTERRUPT) ? '+' : ' ',
+		action->name);
+    }
+    return len;
 }
 
 /*
@@ -243,12 +242,12 @@
  */
 asmlinkage void do_IRQ(int irq, struct pt_regs * regs)
 {
-	struct irqaction * action = irq + irq_action;
+    struct irqaction * action = irq + irq_action;
 
-	kstat.interrupts[irq]++;
-	if (action->flags & SA_SAMPLE_RANDOM)
-		add_interrupt_randomness(irq);
-	action->handler(irq, regs);
+    kstat.interrupts[irq]++;
+    if (action->flags & SA_SAMPLE_RANDOM)
+	add_interrupt_randomness(irq);
+    action->handler(irq, regs);
 }
 
 /*
@@ -258,12 +257,12 @@
  */
 asmlinkage void do_fast_IRQ(int irq)
 {
-	struct irqaction * action = irq + irq_action;
+    struct irqaction * action = irq + irq_action;
 
-	kstat.interrupts[irq]++;
-	if (action->flags & SA_SAMPLE_RANDOM)
-		add_interrupt_randomness(irq);
-	action->handler(irq, NULL);
+    kstat.interrupts[irq]++;
+    if (action->flags & SA_SAMPLE_RANDOM)
+	add_interrupt_randomness(irq);
+    action->handler (irq, NULL);
 }
 
 #define SA_PROBE SA_ONESHOT
@@ -275,64 +274,62 @@
 int request_irq(unsigned int irq, void (*handler)(int, struct pt_regs *),
 		 unsigned long irq_flags, const char * devname)
 {
-	struct irqaction *action;
-	unsigned long flags;
+    struct irqaction *action;
+    unsigned long flags;
 	
-	if (irq > 32)
-		return -EINVAL;
-	action = irq_action + irq;
-	if(action->handler)
-		return -EBUSY;
-	if(!handler)
-		return -EINVAL;
+    if (irq > 32)
+	return -EINVAL;
+    action = irq_action + irq;
+    if (action->handler)
+	return -EBUSY;
+    if (!handler)
+	return -EINVAL;
 	
-	save_flags(flags);
-	cli();
-	action->handler = handler;
-	action->flags = irq_flags;
-	action->mask = 0;
-	action->name = devname;
-	if (!(action->flags & SA_PROBE)) { /* SA_ONESHOT is used by probing */
-		if (irq < 16) {
-			if (action->flags & SA_INTERRUPT)
-				irqjump[irq] = fast_interrupt[irq];
-			else
-				irqjump[irq] = interrupt[irq];
-		}
-		else
-			irqjump[irq] = (void (*)(void))handler;
-	}
-	enable_irq(irq);
-	restore_flags(flags);
-	return 0;
+    save_flags_cli (flags);
+
+    action->handler = handler;
+    action->flags = irq_flags;
+    action->mask = 0;
+    action->name = devname;
+    if (!(action->flags & SA_PROBE)) { /* SA_ONESHOT is used by probing */
+	if (irq < 16) {
+	    if (action->flags & SA_INTERRUPT)
+		irqjump[irq] = fast_interrupt[irq];
+	    else
+		irqjump[irq] = interrupt[irq];
+	} else
+	    irqjump[irq] = (void (*)(void))handler;
+    }
+    enable_irq (irq);
+    restore_flags (flags);
+    return 0;
 }
 
 void free_irq(unsigned int irq)
 {
-	struct irqaction * action = irq + irq_action;
-	unsigned long flags;
+    struct irqaction * action = irq + irq_action;
+    unsigned long flags;
 
-	if (irq > 32) {
-		printk("Trying to free IRQ%d\n",irq);
-		return;
-	}
-	if (!action->handler) {
-		printk("Trying to free free IRQ%d\n",irq);
-		return;
-	}
-	save_flags(flags);
-	cli();
-
-	disable_irq(irq);
-	if(irq < 16)
-		irqjump[irq]=bad_interrupt[irq];
-	else
-		irqjump[irq]=bad_IRQ;
-	action->handler = NULL;
-	action->flags = 0;
-	action->mask = 0;
-	action->name = NULL;
-	restore_flags(flags);
+    if (irq > 32) {
+	printk ("Trying to free IRQ%d\n",irq);
+	return;
+    }
+    if (!action->handler) {
+	printk ("Trying to free free IRQ%d\n",irq);
+	return;
+    }
+    save_flags_cli (flags);
+    disable_irq (irq);
+
+    if (irq < 16)
+	irqjump[irq] = bad_interrupt[irq];
+    else
+	irqjump[irq] = bad_IRQ;
+    action->handler = NULL;
+    action->flags = 0;
+    action->mask = 0;
+    action->name = NULL;
+    restore_flags (flags);
 }
 
 /*
@@ -349,20 +346,19 @@
 
 unsigned long probe_irq_on (void)
 {
-	return 0;
+    return 0;
 }
 
 int probe_irq_off (unsigned long irqs)
 {
-	return 0;
+    return 0;
 }
 
 void init_IRQ(void)
 {
-	ioc[0x40]=LATCH & 255;
-	ioc[0x44]=LATCH>>8;
-	ioc[0x48]=0;
-	ioc[0x18]=0;
-	ioc[0x28]=0;
-	ioc[0x38]=0;
+    IOC_T0LTCHL = LATCH & 255;
+    IOC_T0LTCHH = LATCH >> 8;
+    IOC_T0GO = 0;
+
+    IOC_IRQMASKA = IOC_IRQMASKB = IOC_FIQMASK = 0;
 }
diff -urN linux.store/linux/arch/arm/kernel/oldlatches.c linux/arch/arm/kernel/oldlatches.c
--- linux.store/linux/arch/arm/kernel/oldlatches.c	Wed Mar 13 23:55:07 1996
+++ linux/arch/arm/kernel/oldlatches.c	Thu Mar 28 14:22:32 1996
@@ -7,7 +7,6 @@
 #include <linux/config.h>
 #include <linux/kernel.h>
 
-#include <asm/machdep.h>
 #include <asm/io.h>
 
 /* They are static so that everyone who accesses them has to go through here */
diff -urN linux.store/linux/arch/arm/kernel/process.c linux/arch/arm/kernel/process.c
--- linux.store/linux/arch/arm/kernel/process.c	Wed Mar 13 23:55:07 1996
+++ linux/arch/arm/kernel/process.c	Tue Mar 26 21:29:03 1996
@@ -72,7 +72,7 @@
      * and floppy drive accesses in RiscOS.
      */
     if ((arm_id & 0xfffffff0) == 0x41560300)
-	__asm__ __volatile__ ("mcr 15, 0, %0, c2, c0": : "r" (2));
+	__asm__ __volatile__ ("mcr 15, 0, %0, c2, c0": : "r" (2) : "cc");
 
     /* Copy branch instr to reset location & call it */
     *(unsigned long *)0 = *(unsigned long *)0x03800000;
diff -urN linux.store/linux/arch/arm/kernel/setup.c linux/arch/arm/kernel/setup.c
--- linux.store/linux/arch/arm/kernel/setup.c	Thu Mar 14 23:33:06 1996
+++ linux/arch/arm/kernel/setup.c	Fri Mar 22 22:49:09 1996
@@ -26,11 +26,8 @@
 
 #include <asm/segment.h>
 #include <asm/system.h>
-
-#define F_MEMC   (1<<0)
-#define F_MMU    (1<<1)
-#define F_32BIT  (1<<2)
-#define F_IOEB   (1<<31)
+#include <asm/assembler.h>
+#include <asm/hardware.h>
 
 struct drive_info_struct { char dummy[32]; } drive_info;
 
@@ -62,22 +59,23 @@
 	unsigned long unused[256/4-11];
 	char paths[8][128];
 	char commandline[256];
-} *params = (struct param_struct *)0x0207C000;
+} *params = (struct param_struct *)PARAMS_BASE;
 
-struct armversions {
-	unsigned long id;
-	unsigned long mask;
-	unsigned long features;
-	unsigned long io_base;
-	const char *manu;
-	const char *name;
-} armidlist[] = {
-	{ 0x41560200, 0xfffffff0, F_MEMC	, 0x03000000	, "ARM",	"arm2"		},
-	{ 0x41560250, 0xfffffff0, F_MEMC	, 0x03000000	, "ARM",	"arm250"	},
-	{ 0x41560300, 0xfffffff0, F_MEMC	, 0x03000000	, "ARM",	"arm3"		},
-	{ 0x41560610, 0xfffffff0, F_MMU|F_32BIT	, 0		, "ARM",	"arm610"	},
-	{ 0x44450000, 0xffff0000, F_MMU		, 0		, "DEC",	"SA-1"		},
-	{ 0x00000000, 0x00000000, 0		, 0		, "***",	"*unknown*"	}
+struct armversions armidlist[] = {
+#ifdef __arm2__
+	{ 0x41560200, 0xfffffff0, F_MEMC	, "ARM/VLSI",	"arm2"		},
+#endif
+#ifdef __arm3__
+	{ 0x41560250, 0xfffffff0, F_MEMC	, "ARM/VLSI",	"arm250"	},
+	{ 0x41560300, 0xfffffff0, F_MEMC|F_CACHE, "ARM/VLSI",	"arm3"		},
+#endif
+#ifdef __arm6__
+	{ 0x41560610, 0xfffffff0, F_MMU|F_32BIT	, "ARM/VLSI",	"arm610"	},
+#endif
+#ifdef __sa110__
+	{ 0x44010000, 0xffff0000, F_MMU		, "DEC",	"SA-110"	},
+#endif
+	{ 0x00000000, 0x00000000, 0		, "***",	"*unknown*"	}
 };
 
 #define ISSET(bit) (armidlist[armidindex].features & bit)
@@ -85,18 +83,16 @@
 #define COMMAND_LINE_SIZE 256
 static char command_line[COMMAND_LINE_SIZE] = { 0, };
 
-unsigned char aux_device_present;
-unsigned char *ioc;
-unsigned long io_base;
 unsigned long arm_id;
 int armidindex;
 int ioebpresent;
 int memc_ctrl_reg;
+int number_ide_drives;
+int number_mfm_drives;
 
 extern int bytes_per_char_h;
 extern int bytes_per_char_v;
 extern char arc_hd_files[8][128];
-extern int no_hds;
 extern int ramdisk_size;
 extern int root_mountflags;
 extern int _etext, _edata, _end;
@@ -104,7 +100,7 @@
 
 static void check_ioeb_present(void)
 {
-	if (((*(unsigned char *)(io_base + 0x350050)) & 15) == 5)
+	if (((*IOEB_BASE) & 15) == 5)
 		armidlist[armidindex].features |= F_IOEB;
 }
 
@@ -123,53 +119,30 @@
 		armidindex += 1;
 	}
 
-#ifndef __arm6__
-	if (!(armidlist[armidindex].features & F_MEMC)) {
-		*(unsigned long *)0x02000000 = 0x11111111;
+	if (armidlist[armidindex].id == 0) {
+		for (i = 0; i < 3200; i++)
+			((unsigned long *)SCREEN_BASE)[i] = 0x77113322;
 		while (1);
 	}
-#else
-	if (!(armidlist[armidindex].features & F_MMU)) {
-		*(unsigned long *)0x02000000 = 0x22222222;
-		while (1);
-	}
-#endif
-
-	io_base = armidlist[armidindex].io_base;
-	ioc = (unsigned char *)(io_base + 0x200000);
 
 	check_ioeb_present();
+	cache_setup (armidlist[armidindex].features);
+	memory_start = GET_MEMORY_START;
 
-	if ((arm_id & 0x0000fff0) == 0x300) {
-		__asm__ __volatile__("
-		mcr	15, 0, %0, c3, c0
-		mcr	15, 0, %1, c4, c0
-		mcr	15, 0, %2, c5, c0
-		mcr	15, 0, %3, c1, c0
-		mcr	15, 0, %3, c2, c0
-		" : : "r" (0x000e7fff), "r" (0x000e7fff), "r" (0xf0000000), "r" (3));
-	} else {
-		/* ok, so this is a bit dirty... Self modifing code! */
-		extern unsigned long *arm3_flushcache;
-		arm3_flushcache[0] = arm3_flushcache[1];
-	}
-
-	memory_start = (unsigned long)&_end - 0x01800000+0x02080000;
+	bytes_per_char_h  = params->bytes_per_char_h;
+	bytes_per_char_v  = params->bytes_per_char_v;
+	from		  = params->commandline;
+	ROOT_DEV	  = params->rootdev;
+	ORIG_X		  = params->video_x;
+	ORIG_Y		  = params->video_y;
+	ORIG_VIDEO_COLS	  = params->video_num_cols;
+	ORIG_VIDEO_LINES  = params->video_num_rows;
+	memc_ctrl_reg	  = params->memc_control_reg;
+	number_ide_drives = (params->adfsdrives >> 6) & 3;
+	number_mfm_drives = (params->adfsdrives >> 4) & 3;
+	ramdisk_size	  = params->ramdisk_size;
 
-	bytes_per_char_h = params->bytes_per_char_h;
-	bytes_per_char_v = params->bytes_per_char_v;
-	from = params->commandline;
-	ROOT_DEV = params->rootdev;
-	ORIG_X = params->video_x;
-	ORIG_Y = params->video_y;
-	ORIG_VIDEO_COLS = params->video_num_cols;
-	ORIG_VIDEO_LINES = params->video_num_rows;
-	memc_ctrl_reg = params->memc_control_reg;
-	no_hds = (params->adfsdrives >> 6) & 3;
-
-	aux_device_present = 0;
-	memory_end = 0x02000000 + params->page_size * params->nr_pages;
-	ramdisk_size = params->ramdisk_size;
+	memory_end = GET_MEMORY_END(params->page_size, params->nr_pages);
 
 	if (params->mountrootrdonly)
 		root_mountflags |= MS_RDONLY;
@@ -178,9 +151,9 @@
 		strcpy(arc_hd_files[i], params->paths[i]);
 
 	init_task.mm->start_code = TASK_SIZE;
-	init_task.mm->end_code = TASK_SIZE + (unsigned long) &_etext;
-	init_task.mm->end_data = TASK_SIZE + (unsigned long) &_edata;
-	init_task.mm->brk = TASK_SIZE + (unsigned long) &_end;
+	init_task.mm->end_code	 = TASK_SIZE + (unsigned long) &_etext;
+	init_task.mm->end_data	 = TASK_SIZE + (unsigned long) &_edata;
+	init_task.mm->brk	 = TASK_SIZE + (unsigned long) &_end;
 
 	for (;;) {
 		if (c == ' ' && *(unsigned long *)from == *(unsigned long *)"mem=") {
@@ -192,7 +165,7 @@
 				memory_end = memory_end << 20;
 				from++;
 			}
-			memory_end = memory_end + 0x02000000;
+			memory_end = memory_end + GET_MEMORY_PHYSICAL;
 		}
 		c = *(from++);
 		if (!c)
diff -urN linux.store/linux/arch/arm/lib/Makefile linux/arch/arm/lib/Makefile
--- linux.store/linux/arch/arm/lib/Makefile	Wed Mar 13 23:55:07 1996
+++ linux/arch/arm/lib/Makefile	Thu Mar 28 14:38:21 1996
@@ -7,11 +7,18 @@
 O_TARGET := lib.o
 O_OBJS   := backtrace.o bitops.o delay.o irqs.o \
 	ll_char_wr.o io.o segment.o system.o traps.o ioc.o \
-	calls.o prints.o memfastset.o fp_support.o string.o \
-	floppydma.o
+	calls.o prints.o memfastset.o fp_support.o string.o
 
-ifdef CONFIG_BLK_DEV_FD1772
-O_OBJS += fd1772.o
+ifeq ($(MACHINE),a5k)
+	FLOPPY = floppydma.o
+endif
+
+ifeq ($(MACHINE),arc)
+	FLOPPY = fd1772.o
+endif
+
+ifdef CONFIG_BLK_DEV_FD
+O_OBJS += $(FLOPPY)
 endif
 
 ifdef CONFIG_BLK_DEV_XD
@@ -32,8 +39,8 @@
 	./getconstants > constants.h
 
 getconstants: getconstants.c
-	gcc -o getconstants getconstants.c -O2 -D__KERNEL__ -fomit-frame-pointer -Wl,-N
+	$(HOSTCC) -D__KERNEL__ -o getconstants getconstants.c
 
 irqs.s:	irqs.S
-	gcc -E $^ | tr ";" "\n" > $@
+	$(CPP) $^ | tr ";" "\n" > $@
 
diff -urN linux.store/linux/arch/arm/lib/backtrace.S linux/arch/arm/lib/backtrace.S
--- linux.store/linux/arch/arm/lib/backtrace.S	Sun Mar  3 13:09:12 1996
+++ linux/arch/arm/lib/backtrace.S	Thu Mar 28 10:32:30 1996
@@ -19,8 +19,8 @@
 		teq	fp, #0
 		moveq	r0, #-2
 		LOADREGS(eqfd, sp!, {r4 - r12, pc})
-loop:		tst	fp, #0xFC000003
-		bne	loop
+Lloop:		tst	fp, #0xFC000003
+		bne	Lloop
 		ldr	r1, [fp, #0]
 		sub	r1, r1, #12
 		ldr	r2, [fp, #-4]
@@ -29,12 +29,12 @@
 		ldr	fp, [fp, #-12]
 		teq	r0, fp
 		moveq	fp, #0
-		adr	r0, message
+		adr	r0, Lmessage
  		bl	_printk
 		teq	fp, #0
-		bne	loop
+		bne	Lloop
 		LOADREGS(fd, sp!, {r4 - r12, pc})
 
-message:	.ascii	"Func: entered at %p, link %p, sp %p\n"
+Lmessage:	.ascii	"Func: entered at %p, link %p, sp %p\n"
 		.byte 0
 		.align
diff -urN linux.store/linux/arch/arm/lib/bitops.S linux/arch/arm/lib/bitops.S
--- linux.store/linux/arch/arm/lib/bitops.S	Sun Mar  3 13:09:39 1996
+++ linux/arch/arm/lib/bitops.S	Thu Mar 28 10:11:59 1996
@@ -75,15 +75,15 @@
 		.global	_find_first_zero_bit
 _find_first_zero_bit:
 		mov	r2, #0			@ Initialise bit position
-findzbit1lp:	ldrb	r3, [r0, r2, lsr #3]	@ Check byte, if 0xFF, then all bits set
+Lfindzbit1lp:	ldrb	r3, [r0, r2, lsr #3]	@ Check byte, if 0xFF, then all bits set
 		teq	r3, #0xFF
-		bne	foundzbit
+		bne	Lfoundzbit
 		add	r2, r2, #8
 		cmp	r2, r1			@ Check to see if we have come to the end
-		bcc	findzbit1lp
+		bcc	Lfindzbit1lp
 		add	r0, r1, #1		@ Make sure that we flag an error
 		RETINSTR(mov,pc,lr)
-foundzbit:	tst	r3, #1			@ Check individual bits
+Lfoundzbit:	tst	r3, #1			@ Check individual bits
 		moveq	r0, r2
 		RETINSTR(moveq,pc,lr)
 		tst	r3, #2
@@ -114,7 +114,7 @@
 _find_next_zero_bit:
 		add	r2, r2, #1		@ Increment bit position
 		tst	r2, #7
-		beq	findzbit1lp		@ If new byte, goto old routine
+		beq	Lfindzbit1lp		@ If new byte, goto old routine
 		ldrb	r3, [r0, r2, lsr#3]
 		orr	r3, r3, #0xFF00		@ Set top bits so we wont get confused
 		stmfd	sp!, {r4}
@@ -125,5 +125,5 @@
 		teq	r3, #0xFF
 		orreq	r2, r2, #7
 		addeq	r2, r2, #1
-		beq	findzbit1lp		@ If all bits are set, goto old routine
-		b	foundzbit
+		beq	Lfindzbit1lp		@ If all bits are set, goto old routine
+		b	Lfoundzbit
diff -urN linux.store/linux/arch/arm/lib/constants.h linux/arch/arm/lib/constants.h
--- linux.store/linux/arch/arm/lib/constants.h	Thu Jan  1 01:00:00 1970
+++ linux/arch/arm/lib/constants.h	Thu Mar 14 08:26:41 1996
@@ -0,0 +1,20 @@
+/*
+ *  contants.h generated by getconstants
+ * DO NOT EDIT!
+ */
+#define _current	_current_set
+#define PAGE_PRESENT	1
+#define PAGE_RW	2
+#define PAGE_USER	4
+#define PAGE_ACCESSED	32
+#define PAGE_DIRTY	64
+#define TSK_MM	744
+#define MM_PGDIR	4
+#define TSS_UREGS	512
+#define TSS_SREGS	532
+#define TSS_FPESAVE	576
+#define SYS_execve	9437195
+#define SYS_sigreturn	9437303
+#define KSWI_BASE	0x900000
+#define KSWI_SYS_BASE	0x9F0000
+#define SYS_ERROR0	0x9F0000
diff -urN linux.store/linux/arch/arm/lib/fd1772.S linux/arch/arm/lib/fd1772.S
--- linux.store/linux/arch/arm/lib/fd1772.S	Wed Mar 13 23:55:08 1996
+++ linux/arch/arm/lib/fd1772.S	Fri Mar 22 22:05:27 1996
@@ -1,3 +1,5 @@
+#include <asm/hardware.h>
+
 @ Code for DMA with the 1772 fdc
 .text
 
@@ -22,11 +24,11 @@
 @ We hang this off DMA channel 1
     .global _fdc1772_comendhandler
 _fdc1772_comendhandler:
-  mov      r8,#0x3200000
+  mov      r8,#IOC_BASE
   ldrb     r9,[r8,#0x34]    @ IOC FIQ status
   tst      r9,#2
   subeqs   pc,r14,#4
-  mov      r9,#0x3200000
+  mov      r9,#IOC_BASE
   orr      r9,r9,#0x10000   @ FDC base
   adr      r8,_fdc1772_fdc_int_done
   ldrb     r10,[r9,#0]  @ FDC status
@@ -37,7 +39,7 @@
 
     .global _fdc1772_dma_read
 _fdc1772_dma_read:
-  mov      r8,#0x3200000
+  mov      r8,#IOC_BASE
   ldrb     r9,[r8,#0x34]    @ IOC FIQ status
   tst      r9,#1
   beq      _fdc1772_dma_read_notours
@@ -58,7 +60,7 @@
 
     .global _fdc1772_dma_write
 _fdc1772_dma_write:
-  mov      r8,#0x3200000
+  mov      r8,#IOC_BASE
   ldrb     r9,[r8,#0x34]    @ IOC FIQ status
   tst      r9,#1
   beq      _fdc1772_dma_write_notours
Binary files linux.store/linux/arch/arm/lib/getconstants and linux/arch/arm/lib/getconstants differ
diff -urN linux.store/linux/arch/arm/lib/io.S linux/arch/arm/lib/io.S
--- linux.store/linux/arch/arm/lib/io.S	Wed Mar 13 23:55:08 1996
+++ linux/arch/arm/lib/io.S	Thu Mar 28 10:11:19 1996
@@ -100,9 +100,9 @@
 		orrlt	r3, r3, #0x00010000
 		add	r0, r3, r0, lsl #2
 		tst	r1, #3
-		beq	pcinswok
+		beq	Linswok
 		tst	r1, #1
-		bne	pcinsw_notaligned
+		bne	Linsw_notaligned
 		cmp	r2, #1
 		ldrge	r4, [r0]
 		strgeb	r4, [r1], #1
@@ -110,10 +110,10 @@
 		strgtb	r4, [r1], #1
 		ldmleea	fp, {r4 - r10, fp, sp, pc}^
 		sub	r2, r2, #2
-pcinswok:	mov	ip, #0xFF
+Linswok:	mov	ip, #0xFF
 		orr	ip, ip, ip, lsl #8
-pcinswlp:	subs	r2, r2, #64
-		bmi	pcinsw_toosmall
+Linswlp:	subs	r2, r2, #64
+		bmi	Linsw_toosmall
 		IN(r3)
 		IN(r4)
 		IN(r5)
@@ -132,12 +132,12 @@
 		IN(r9)
 		IN(r10)
 		stmia	r1!, {r3 - r10}
-		bne	pcinswlp
+		bne	Linswlp
 		LOADREGS(ea, fp, {r4 - r10, fp, sp, pc})
-pcinsw_toosmall:
+Linsw_toosmall:
 		add	r2, r2, #32
-		bmi	pcinsw_toosmall2
-pcinsw2lp:	IN(r3)
+		bmi	Linsw_toosmall2
+Linsw2lp:	IN(r3)
 		IN(r4)
 		IN(r5)
 		IN(r6)
@@ -147,10 +147,10 @@
 		IN(r10)
 		stmia	r1!, {r3 - r10}
 		LOADREGS(eqea, fp, {r4 - r10, fp, sp, pc})
-		b	pcinsw_notaligned
-pcinsw_toosmall2:
+		b	Linsw_notaligned
+Linsw_toosmall2:
 		add	r2, r2, #32
-pcinsw_notaligned:
+Linsw_notaligned:
 		cmp	r2, #1
 		LOADREGS(ltea, fp, {r4 - r10, fp, sp, pc})
 		ldr	r4, [r0]
@@ -158,7 +158,7 @@
 		movgt	r4, r4, LSR#8
 		strgtb	r4, [r1], #1
 		subs	r2, r2, #2
-		bgt	pcinsw_notaligned
+		bgt	Linsw_notaligned
 		LOADREGS(ea, fp, {r4 - r10, fp, sp, pc})
 
 @ Purpose: write a block of data from memory to a hardware register.
@@ -177,7 +177,7 @@
 		movlt	r3, #0x03000000
 		orrlt	r3, r3, #0x00010000
 		tst	r1, #2
-		beq	pcoutsw32lp
+		beq	Loutsw32lp
 		ldr	r4, [r1], #2
 		mov	r4, r4, lsl #16
 		orr	r4, r4, r4, lsr #16
@@ -185,8 +185,8 @@
 		sub	r2, r2, #2
 		teq	r2, #0
 		LOADREGS(eqea, fp, {r4 - r8, fp, sp, pc})
-pcoutsw32lp:	subs	r2,r2,#32
-		blt	pcoutsw_toosmall
+Loutsw32lp:	subs	r2,r2,#32
+		blt	Loutsw_toosmall
 		ldmia	r1!,{r4,r5,r6,r7}
 		OUT(r4)
 		OUT(r5)
@@ -198,16 +198,16 @@
 		OUT(r6)
 		OUT(r7)
 		LOADREGS(eqea, fp, {r4 - r8, fp, sp, pc})
-		b	pcoutsw32lp
-pcoutsw_toosmall:
+		b	Loutsw32lp
+Loutsw_toosmall:
 		adds	r2,r2,#32
 		LOADREGS(eqea, fp, {r4 - r8, fp, sp, pc})
-lpx:		ldr	r4,[r1],#2
+Llpx:		ldr	r4,[r1],#2
 		mov	r4,r4,LSL#16
 		orr	r4,r4,r4,LSR#16
 		str	r4,[r3,r0,LSL#2]
 		subs	r2,r2,#2
-		bgt	lpx
+		bgt	Llpx
 		LOADREGS(ea, fp, {r4 - r8, fp, sp, pc})
 
 @ Purpose: write a vidc register.
diff -urN linux.store/linux/arch/arm/lib/iputils.S linux/arch/arm/lib/iputils.S
--- linux.store/linux/arch/arm/lib/iputils.S	Sun Mar  3 13:14:06 1996
+++ linux/arch/arm/lib/iputils.S	Thu Mar 28 10:15:10 1996
@@ -11,19 +11,19 @@
 @ r2 = sum
 		.global	_csum_partial
 _csum_partial:	tst	r0, #2
-		beq	alignok
+		beq	Lalignok
 		subs	r1, r1, #2
 		addmi	r1, r1, #2
-		bmi	nobits32
+		bmi	Lnobits32
 		bic	r0, r0, #3
 		ldr	r3, [r0], #4
 		adds	r2, r2, r3, lsr #16
 		adcs	r2, r2, #0
-alignok:	adds	r2, r2, #0
+Lalignok:	adds	r2, r2, #0
 		bics	ip, r1, #31
-		beq	nolots32
+		beq	Lnolots32
 		stmfd	sp!, {r4 - r10}
-lp32:		ldmia	r0!, {r3 - r10}
+Llp32:		ldmia	r0!, {r3 - r10}
 		adcs	r2, r2, r3
 		adcs	r2, r2, r4
 		adcs	r2, r2, r5
@@ -34,18 +34,18 @@
 		adcs	r2, r2, r10
 		sub	ip, ip, #32
 		teq	ip, #0
-		bne	lp32
+		bne	Llp32
 		adcs	r2, r2, #0
 		ldmfd	sp!, {r4 - r10}
-nolots32:	ands	ip, r1, #0x1c
-		beq	nobits32
-bits32lp:	ldr	r3, [r0], #4
+Lnolots32:	ands	ip, r1, #0x1c
+		beq	Lnobits32
+Lbits32lp:	ldr	r3, [r0], #4
 		adcs	r2, r2, r3
 		sub	ip, ip, #4
 		teq	ip, #0
-		bne	bits32lp
+		bne	Lbits32lp
 		adcs	r2, r2, #0
-nobits32:	ands	ip, r1, #3
+Lnobits32:	ands	ip, r1, #3
 		moveq	r0, r2
 		moveqs	pc, lr
 		mov	ip, ip, lsl #3
@@ -66,10 +66,10 @@
 		stmfd	sp!, {r4 - r10, fp, ip, lr, pc}
 		sub	fp, ip, #4
 		tst	r1, #2			@ Test destination alignment
-		beq	dst_aligned
+		beq	Ldst_aligned
 		subs	r2, r2, #2
 		addmi	r2, r2, #2
-		bmi	nobits32_b
+		bmi	Lnobits32_b
 		ldrt	r4, [r0], #2
 		mov	r5, r4, lsl #16
 		adds	r3, r3, r5, lsr #16
@@ -77,12 +77,12 @@
 		strb	r4, [r1], #1
 		mov	r4, r4, lsr #8
 		strb	r4, [r1], #1		@ Destination now aligned
-dst_aligned:	tst	r0, #2
-		bne	src_not_aligned
+Ldst_aligned:	tst	r0, #2
+		bne	Lsrc_not_aligned
 		adds	r3, r3, #0
 		bics	ip, r2, #31		@ Routine for src & dst aligned
-		beq	nolots32_ba
-lp32_ba:	ldrt	r4, [r0], #4
+		beq	Lnolots32_ba
+Llp32_ba:	ldrt	r4, [r0], #4
 		ldrt	r5, [r0], #4
 		ldrt	r6, [r0], #4
 		ldrt	r7, [r0], #4
@@ -108,20 +108,20 @@
 		adcs	r3, r3, r7
 		sub	ip, ip, #32
 		teq	ip, #0
-		bne	lp32_ba
+		bne	Llp32_ba
 		adcs	r3, r3, #0
-nolots32_ba:	ands	ip, r2, #0x1c
-		beq	nobits32_ba
-bits32lp_ba:	ldrt	r4, [r0], #4
+Lnolots32_ba:	ands	ip, r2, #0x1c
+		beq	Lnobits32_ba
+Lbits32lp_ba:	ldrt	r4, [r0], #4
 		str	r4, [r1], #4
 		adcs	r3, r3, r4
 		sub	ip, ip, #4
 		teq	ip, #0
-		bne	bits32lp_ba
+		bne	Lbits32lp_ba
 		adcs	r3, r3, #0
-nobits32_ba:	ands	ip, r2, #3
+Lnobits32_ba:	ands	ip, r2, #3
 		moveq	r0, r3
-		beq	alldone_ba
+		beq	Lalldone_ba
 		mov	r5, ip, lsl #3
 		rsb	r5, r5, #32
 		ldr	r4, [r0]
@@ -136,16 +136,16 @@
 		teq	ip, #3
 		moveq	r4, r4, lsr #8
 		streqb	r4, [r1], #1
-alldone_ba:	ldmea	fp, {r4 - r10, fp, sp, pc}^
+Lalldone_ba:	ldmea	fp, {r4 - r10, fp, sp, pc}^
 
-src_not_aligned:
+Lsrc_not_aligned:
 		cmp	r2, #4
 		bic	r0, r0, #3
 		ldrcst	r4, [r0], #4
 		adds	r3, r3, #0
 		bics	ip, r2, #31
-		beq	notlots32_b
-lp32_b:		ldrt	r5, [r0], #4
+		beq	Lnotlots32_b
+Llp32_b:	ldrt	r5, [r0], #4
 		ldrt	r6, [r0], #4
 		ldrt	r7, [r0], #4
 		ldrt	r8, [r0], #4
@@ -183,11 +183,11 @@
 		mov	r4, r8
 		sub	ip, ip, #32
 		teq	ip, #0
-		bne	lp32_b
+		bne	Llp32_b
 		adcs	r3, r3, #0
-notlots32_b:	ands	ip, r2, #0x1c
-		beq	nobits32_b
-bits32lp_b:	ldrt	r5, [r0], #4
+Lnotlots32_b:	ands	ip, r2, #0x1c
+		beq	Lnobits32_b
+Lbits32lp_b:	ldrt	r5, [r0], #4
 		mov	r4, r4, lsr #16
 		orr	r4, r4, r5, lsl #16
 		str	r4, [r1], #4
@@ -195,11 +195,11 @@
 		mov	r4, r5
 		sub	ip, ip, #4
 		teq	ip, #0
-		bne	bits32lp_b
+		bne	Lbits32lp_b
 		adc	r3, r3, #0
-nobits32_b:	ands	ip, r2, #3
+Lnobits32_b:	ands	ip, r2, #3
 		moveq	r0, r3
-		beq	alldone_b
+		beq	Lalldone_b
 		ldrt	r5, [r0], #4
 		mov	r4, r4, lsr #16
 		orr	r4, r4, r5, lsl #16
@@ -216,7 +216,7 @@
 		teq	ip, #3
 		moveq	r4, r4, lsr #8
 		streqb	r4, [r1], #1
-alldone_b:	ldmea	fp, {r4 - r10, fp, sp, pc}^
+Lalldone_b:	ldmea	fp, {r4 - r10, fp, sp, pc}^
 
 
 @ r0 = src
@@ -229,10 +229,10 @@
 		stmfd	sp!, {r4 - r10, fp, ip, lr, pc}
 		sub	fp, ip, #4
 		tst	r1, #2			@ Test destination alignment
-		beq	dst_aligned_2
+		beq	Ldst_aligned_2
 		subs	r2, r2, #2
 		addmi	r2, r2, #2
-		bmi	nobits32_b_2
+		bmi	Lnobits32_b_2
 		ldr	r4, [r0], #2
 		mov	r5, r4, lsl #16
 		adds	r3, r3, r5, lsr #16
@@ -240,12 +240,12 @@
 		strb	r4, [r1], #1
 		mov	r4, r4, lsr #8
 		strb	r4, [r1], #1		@ Destination now aligned
-dst_aligned_2:	tst	r0, #2
-		bne	src_not_aligned_2
+Ldst_aligned_2:	tst	r0, #2
+		bne	Lsrc_not_aligned_2
 		adds	r3, r3, #0
 		bics	ip, r2, #31		@ Routine for src & dst aligned
-		beq	nolots32_ba_2
-lp32_ba_2:	ldr	r4, [r0], #4
+		beq	Lnolots32_ba_2
+Llp32_ba_2:	ldr	r4, [r0], #4
 		ldr	r5, [r0], #4
 		ldr	r6, [r0], #4
 		ldr	r7, [r0], #4
@@ -271,20 +271,20 @@
 		adcs	r3, r3, r7
 		sub	ip, ip, #32
 		teq	ip, #0
-		bne	lp32_ba_2
+		bne	Llp32_ba_2
 		adcs	r3, r3, #0
-nolots32_ba_2:	ands	ip, r2, #0x1c
-		beq	nobits32_ba_2
-bits32lp_ba_2:	ldr	r4, [r0], #4
+Lnolots32_ba_2:	ands	ip, r2, #0x1c
+		beq	Lnobits32_ba_2
+Lbits32lp_ba_2:	ldr	r4, [r0], #4
 		str	r4, [r1], #4
 		adcs	r3, r3, r4
 		sub	ip, ip, #4
 		teq	ip, #0
-		bne	bits32lp_ba_2
+		bne	Lbits32lp_ba_2
 		adcs	r3, r3, #0
-nobits32_ba_2:	ands	ip, r2, #3
+Lnobits32_ba_2:	ands	ip, r2, #3
 		moveq	r0, r3
-		beq	alldone_ba_2
+		beq	Lalldone_ba_2
 		mov	r5, ip, lsl #3
 		rsb	r5, r5, #32
 		ldr	r4, [r0]
@@ -299,16 +299,16 @@
 		teq	ip, #3
 		moveq	r4, r4, lsr #8
 		streqb	r4, [r1], #1
-alldone_ba_2:	ldmea	fp, {r4 - r10, fp, sp, pc}^
+Lalldone_ba_2:	ldmea	fp, {r4 - r10, fp, sp, pc}^
 
-src_not_aligned_2:
+Lsrc_not_aligned_2:
 		cmp	r2, #4
 		bic	r0, r0, #3
 		ldrcs	r4, [r0], #4
 		adds	r3, r3, #0
 		bics	ip, r2, #31
-		beq	notlots32_b_2
-lp32_b_2:	ldr	r5, [r0], #4
+		beq	Lnotlots32_b_2
+Llp32_b_2:	ldr	r5, [r0], #4
 		ldr	r6, [r0], #4
 		ldr	r7, [r0], #4
 		ldr	r8, [r0], #4
@@ -346,11 +346,11 @@
 		mov	r4, r8
 		sub	ip, ip, #32
 		teq	ip, #0
-		bne	lp32_b_2
+		bne	Llp32_b_2
 		adcs	r3, r3, #0
-notlots32_b_2:	ands	ip, r2, #0x1c
-		beq	nobits32_b_2
-bits32lp_b_2:	ldr	r5, [r0], #4
+Lnotlots32_b_2:	ands	ip, r2, #0x1c
+		beq	Lnobits32_b_2
+Lbits32lp_b_2:	ldr	r5, [r0], #4
 		mov	r4, r4, lsr #16
 		orr	r4, r4, r5, lsl #16
 		str	r4, [r1], #4
@@ -358,11 +358,11 @@
 		mov	r4, r5
 		sub	ip, ip, #4
 		teq	ip, #0
-		bne	bits32lp_b_2
+		bne	Lbits32lp_b_2
 		adcs	r3, r3, #0
-nobits32_b_2:	ands	ip, r2, #3
+Lnobits32_b_2:	ands	ip, r2, #3
 		moveq	r0, r3
-		beq	alldone_b_2
+		beq	Lalldone_b_2
 		ldr	r5, [r0], #4
 		mov	r4, r4, lsr #16
 		orr	r4, r4, r5, lsl #16
@@ -379,7 +379,4 @@
 		teq	ip, #3
 		moveq	r4, r4, lsr #8
 		streqb	r4, [r1], #1
-alldone_b_2:	ldmea	fp, {r4 - r10, fp, sp, pc}^
-
-
-
+Lalldone_b_2:	ldmea	fp, {r4 - r10, fp, sp, pc}^
diff -urN linux.store/linux/arch/arm/lib/ll_char_wr.S linux/arch/arm/lib/ll_char_wr.S
--- linux.store/linux/arch/arm/lib/ll_char_wr.S	Wed Mar 13 23:55:08 1996
+++ linux/arch/arm/lib/ll_char_wr.S	Thu Mar 28 10:15:50 1996
@@ -55,8 +55,8 @@
 		mul	r6, r5, r6
 		mov	r1, r1, lsl #3
 		teq	r5, #8
-		beq	row8bpplp
-row4bpplp:
+		beq	Lrow8bpplp
+Lrow4bpplp:
 		ldrb	r9, [r7, r1]
 		and	r8, r1, #7
 		teq	r8, #7
@@ -91,10 +91,10 @@
 		str	ip, [r0], r6
 		add	r1, r1,#1
 		tst	r1, #7
-		bne	row4bpplp
+		bne	Lrow4bpplp
 		LOADREGS(ea, fp, {r4 - r9, fp, sp, pc})
 
-row8bpplp:	ldrb	r9, [r7, r1]
+Lrow8bpplp:	ldrb	r9, [r7, r1]
 		and	r8, r1, #7
 		teq	r8, #7
 		tsteq	r4, #UNDERLINE << 24
@@ -127,6 +127,6 @@
 		add	r0, r0, r6
 		add	r1,r1,#1
 		tst	r1,#7
-		bne	row8bpplp
+		bne	Lrow8bpplp
 		LOADREGS(ea, fp, {r4 - r9, fp, sp, pc})
 
diff -urN linux.store/linux/arch/arm/lib/memfastset.S linux/arch/arm/lib/memfastset.S
--- linux.store/linux/arch/arm/lib/memfastset.S	Sun Mar  3 13:15:54 1996
+++ linux/arch/arm/lib/memfastset.S	Thu Mar 28 10:16:22 1996
@@ -12,8 +12,9 @@
 
 _memfastset:	stmfd	sp!, {lr}
 		subs	r2, r2, #32
-		bmi	memfastl32
-memfast32setlp:	str	r1, [r0], #4
+		bmi	Lmemfastl32
+Lmemfast32setlp:
+		str	r1, [r0], #4
 		str	r1, [r0], #4
 		str	r1, [r0], #4
 		str	r1, [r0], #4
@@ -23,18 +24,19 @@
 		str	r1, [r0], #4
 		LOADREGS(eqfd, sp!, {pc})
 		subs	r2, r2, #32
-		bpl	memfast32setlp
-memfastl32:	adds	r2, r2, #16
-		bmi	memfastl16
-memfast16setlp:	str	r1, [r0], #4
+		bpl	Lmemfast32setlp
+Lmemfastl32:	adds	r2, r2, #16
+		bmi	Lmemfastl16
+Lmemfast16setlp:
+		str	r1, [r0], #4
 		str	r1, [r0], #4
 		str	r1, [r0], #4
 		str	r1, [r0], #4
 		LOADREGS(eqfd, sp!, {pc})
 		subs	r2, r2, #16
-		bpl	memfast16setlp
-memfastl16:	add	r2, r2, #16
-memfastsetlp:	subs	r2, r2, #4
+		bpl	Lmemfast16setlp
+Lmemfastl16:	add	r2, r2, #16
+Lmemfastsetlp:	subs	r2, r2, #4
 		strge	r1, [r0], #4
-		bgt	memfastsetlp
+		bgt	Lmemfastsetlp
 		LOADREGS(fd, sp!, {pc})
diff -urN linux.store/linux/arch/arm/lib/mfm.S linux/arch/arm/lib/mfm.S
--- linux.store/linux/arch/arm/lib/mfm.S	Wed Mar 13 23:55:08 1996
+++ linux/arch/arm/lib/mfm.S	Thu Mar 28 14:23:22 1996
@@ -38,7 +38,6 @@
   adr r5,_hdc63463_irqdata
   ldmia r5,{r0,r1,r2,r3,r4}
 
-writedma_loop:
   @ test number of remaining bytes to transfer
   cmp r4,#0
   beq writedma_end
@@ -49,6 +48,11 @@
   tst r5,r2
   beq writedma_end
 
+  @ Transfer a block of upto 256 bytes
+  cmp r4,#256
+  movlt r7,r4
+  movge r7,#256
+
   @ Check the hdc is still busy and command has not ended and no errors
   ldr r5,[r0,#32]     @ Status reg - 16 bit - its the top few bits which are status
   tst r5,#0x3c00        @ Test for things which should be off
@@ -57,6 +61,10 @@
   cmp r5,#0x8000
   bne writedma_end 
 
+  @ Bytes remaining at end
+  sub r4,r4,r7
+
+writedma_loop:
   @ OK - pretty sure we should be doing this
   @ Get two bytes - note it can be half word aligned; its easiest to read 2 bytes
   ldrb r6,[r3],#1
@@ -64,8 +72,8 @@
   orr  r6,r6,r5,lsl#8  @ Put them together, note big endian for HDC
   orr  r6,r6,r6,lsl#16    @ Both halves of word for podule write
   str  r6,[r0,#32+8]      @ Put the data out
-  subs r4,r4,#2        @ Decrement bytes to go
-  b writedma_loop
+  subs r7,r7,#2        @ Decrement bytes to go
+  bne writedma_loop
 
 writedma_end:
   adr r5,_hdc63463_irqdata+12
@@ -83,7 +91,6 @@
   adr r5,_hdc63463_irqdata
   ldmia r5,{r0,r1,r2,r3,r4}
 
-readdma_loop:
   @ test number of remaining bytes to transfer
   cmp r4,#0
   beq readdma_end
@@ -102,14 +109,23 @@
   cmp r5,#0x8000
   bne readdma_end 
 
+  @ Transfer a block of upto 256 bytes
+  cmp r4,#256
+  movlt r7,r4
+  movge r7,#256
+
+  @ Bytes remaining at end
+  sub r4,r4,r7
+
+readdma_loop:
   @ OK - pretty sure we should be doing this
   @ Get two bytes - note it can be half word aligned; its easiest to read 2 bytes
-  ldr  r6,[r0,#8]     @ Read data from hdc - its in the bottom half
+  ldr  r6,[r0,#8]      @ Read data from hdc - its in the bottom half
   mov  r5,r6,lsr#8     @ Move second byte to bottom
   strb r6,[r3],#1      @ Note endian swap in here
   strb r5,[r3],#1
-  subs r4,r4,#2        @ Decrement bytes to go
-  b readdma_loop
+  subs r7,r7,#2        @ Decrement bytes to go
+  bne readdma_loop
 
 readdma_end:
   adr r5,_hdc63463_irqdata+12
diff -urN linux.store/linux/arch/arm/lib/prints.S linux/arch/arm/lib/prints.S
--- linux.store/linux/arch/arm/lib/prints.S	Sun Mar  3 13:16:21 1996
+++ linux/arch/arm/lib/prints.S	Thu Mar 28 10:17:07 1996
@@ -22,19 +22,19 @@
 		mov	r2, #0x03000000
 		orr	r2, r2, #0x00010000
 		orr	r2, r2, #0x00000fe0
-outlp:		ldrb	r1, [r0], #1
+Loutlp:		ldrb	r1, [r0], #1
 		teq	r1, #0
-		beq	out
+		beq	Lout
 		teq	r1, #10
 		moveq	r3, #13
 		streqb	r3, [r0, #-1]!
 		strb	r1, [r2]
 		mov	r3, #0x8000
-dlylp:		sub	r3, r3, #1
+Ldlylp:		sub	r3, r3, #1
 		teq	r3, #0
-		bne	dlylp
-		b	outlp
-out:		LOADREGS(ea, fp, {fp, sp, pc})
+		bne	Ldlylp
+		b	Loutlp
+Lout:		LOADREGS(ea, fp, {fp, sp, pc})
 
 		.global	_prints
 _prints:	mov	ip, sp
@@ -43,16 +43,16 @@
 		mov	r2, #0x03000000
 		orr	r2, r2, #0x00010000
 		orr	r2, r2, #0x00000fe0
-out2lp:		LDRB	r1, [r0], #1
+Lout2lp:	LDRB	r1, [r0], #1
 		TEQ	r1, #0
-		BEQ	out
+		BEQ	Lout
 		TEQ	r1, #10
 		MOVEQ	r3, #13
 		STREQB	r3, [r0, #-1]!
 		STRB	r1, [r2]
 		MOV	r3, #0x8000
-dly2lp:		SUB	r3, r3, #1
+Ldly2lp:	SUB	r3, r3, #1
 		TEQ	r3, #0
-		BNE	dly2lp
-		B	out2lp
+		BNE	Ldly2lp
+		B	Lout2lp
 
diff -urN linux.store/linux/arch/arm/lib/segment.S linux/arch/arm/lib/segment.S
--- linux.store/linux/arch/arm/lib/segment.S	Sun Mar  3 13:20:42 1996
+++ linux/arch/arm/lib/segment.S	Thu Mar 28 10:30:46 1996
@@ -90,17 +90,17 @@
 		bge	_memcpy_fromfs
 		ENTER
 		subs	r2, r2, #4
-		blt	no_double_words
+		blt	Lno_double_words
 		ands	ip, r0, #3
-		bne	dest_not_aligned
+		bne	Ldest_not_aligned
 		ands	ip, r1, #3
-		bne	src_not_aligned
-rest:		subs	r2, r2, #8
-		blt	cpy_2_lp
+		bne	Lsrc_not_aligned
+Lrest:		subs	r2, r2, #8
+		blt	Lcpy_2_lp
 		subs	r2, r2, #0x14
-		blt	not_long_copy
+		blt	Lnot_long_copy
 
-cpy_8_lp:	ldmia	r1!, {r3 - r9, ip}
+Lcpy_8_lp:	ldmia	r1!, {r3 - r9, ip}
 		strt	r3, [r0], #4
 		strt	r4, [r0], #4
 		strt	r5, [r0], #4
@@ -110,7 +110,7 @@
 		strt	r9, [r0], #4
 		strt	ip, [r0], #4
 		subs	r2, r2, #32
-		bge	cpy_8_lp
+		bge	Lcpy_8_lp
 		cmn	r2,#16
 		ldmgeia	r1!,{r3 - r6}
 		strget	r3, [r0], #4
@@ -119,17 +119,17 @@
 		strget	r6, [r0], #4
 		subge	r2, r2, #0x10
 
-not_long_copy:	adds	r2,r2,#0x14
+Lnot_long_copy:	adds	r2,r2,#0x14
 
-cpy_3_lp:	ldmgeia	r1!, {r3 - r5}
+Lcpy_3_lp:	ldmgeia	r1!, {r3 - r5}
 		strget	r3, [r0], #4
 		strget	r4, [r0], #4
 		strget	r5, [r0], #4
 		subges	r2, r2, #12
-		bge	cpy_3_lp
+		bge	Lcpy_3_lp
 
-cpy_2_lp:	adds	r2, r2, #8
-		blt	no_double_words
+Lcpy_2_lp:	adds	r2, r2, #8
+		blt	Lno_double_words
 		subs	r2, r2, #4
 		ldrlt	r3, [r1], #4
 		strltt	r3, [r0], #4
@@ -138,7 +138,7 @@
 		strget	r4, [r0], #4
 		subge	r2, r2, #4
 
-no_double_words:
+Lno_double_words:
 		adds	r2, r2, #4
 		EXITEQ
 		cmp	r2, #2
@@ -149,7 +149,7 @@
 		ldrgtb	r3, [r1], #1
 		strgtbt	r3, [r0], #1
 		EXIT
-dest_not_aligned:
+Ldest_not_aligned:
 		rsb	ip, ip, #4
 		cmp	ip, #2
 		ldrb	r3, [r1], #1
@@ -159,20 +159,20 @@
 		ldrgtb	r3, [r1], #1
 		strgtbt	r3, [r0], #1
 		subs	r2, r2, ip
-		blt	no_double_words
+		blt	Lno_double_words
 		ands	ip, r1, #3
-		beq	rest
-src_not_aligned:
+		beq	Lrest
+Lsrc_not_aligned:
 		bic	r1, r1, #3
 		ldr	r7, [r1], #4
 		cmp	ip, #2
-		bgt	cpy_4_3
-		beq	cpy_4_2
+		bgt	Lcpy_4_3
+		beq	Lcpy_4_2
 		cmp	r2, #12
-		blt	cpy_x_1_lp
+		blt	Lcpy_x_1_lp
 		sub	r2, r2, #12
 
-cpy_4_1_lp:	mov	r3, r7, lsr #8
+Lcpy_4_1_lp:	mov	r3, r7, lsr #8
 		ldmia	r1!, {r4 - r7}
 		orr	r3, r3, r4, lsl #24
 		mov	r4, r4, lsr #8
@@ -186,25 +186,25 @@
 		strt	r5, [r0], #4
 		strt	r6, [r0], #4
 		subs	r2, r2, #16
-		bge	cpy_4_1_lp
+		bge	Lcpy_4_1_lp
 		adds	r2,r2,#12
-		blt	rest1
+		blt	Lrest1
 
-cpy_x_1_lp:	mov	r3, r7, lsr #8
+Lcpy_x_1_lp:	mov	r3, r7, lsr #8
 		ldr	r7, [r1], #4
 		orr	r3, r3, r7, lsl #24
 		strt	r3, [r0], #4
 		subs	r2, r2, #4
-		bge	cpy_x_1_lp
+		bge	Lcpy_x_1_lp
 
-rest1:		sub	r1, r1, #3
-		b	no_double_words
+Lrest1:		sub	r1, r1, #3
+		b	Lno_double_words
 
-cpy_4_2:	cmp	r2, #12
-		blt	cpy_x_2_lp
+Lcpy_4_2:	cmp	r2, #12
+		blt	Lcpy_x_2_lp
 		sub	r2, r2, #12
 
-cpy_4_2_lp:	mov	r3, r7, lsr #16
+Lcpy_4_2_lp:	mov	r3, r7, lsr #16
 		ldmia	r1!, {r4 - r7}
 		orr	r3, r3, r4, lsl #16
 		mov	r4, r4, lsr #16
@@ -218,25 +218,25 @@
 		strt	r5, [r0], #4
 		strt	r6, [r0], #4
 		subs	r2, r2, #16
-		bge	cpy_4_2_lp
+		bge	Lcpy_4_2_lp
 		adds	r2, r2, #12
-		blt	rest2
+		blt	Lrest2
 
-cpy_x_2_lp:	mov	r3, r7, lsr #16
+Lcpy_x_2_lp:	mov	r3, r7, lsr #16
 		ldr	r7, [r1], #4
 		orr	r3, r3, r7, lsl #16
 		strt	r3, [r0], #4
 		subs	r2, r2, #4
-		bge	cpy_x_2_lp
+		bge	Lcpy_x_2_lp
 
-rest2:		sub	r1, r1, #2
-		b	no_double_words
+Lrest2:		sub	r1, r1, #2
+		b	Lno_double_words
 
-cpy_4_3:	cmp	r2, #12
-		blt	cpy_x_3_lp
+Lcpy_4_3:	cmp	r2, #12
+		blt	Lcpy_x_3_lp
 		sub	r2, r2, #12
 
-cpy_4_3_lp:	mov	r3, r7, lsr #24
+Lcpy_4_3_lp:	mov	r3, r7, lsr #24
 		ldmia	r1!, {r4 - r7}
 		orr	r3, r3, r4, lsl #8
 		mov	r4, r4, lsr #24
@@ -250,19 +250,19 @@
 		strt	r5, [r0], #4
 		strt	r6, [r0], #4
 		subs	r2, r2, #16
-		bge	cpy_4_3_lp
+		bge	Lcpy_4_3_lp
 		adds	r2, r2, #12
-		blt	rest3
+		blt	Lrest3
 
-cpy_x_3_lp:	mov	r3, r7, lsr #24
+Lcpy_x_3_lp:	mov	r3, r7, lsr #24
 		ldr	r7, [r1], #4
 		orr	r3, r3, r7, lsl #8
 		strt	r3, [r0], #4
 		subs	r2, r2, #4
-		bge	cpy_x_3_lp
+		bge	Lcpy_x_3_lp
 
-rest3:		sub	r1, r1, #1
-		b	no_double_words
+Lrest3:		sub	r1, r1, #1
+		b	Lno_double_words
 
 # Prototype: void memcpy_fromfs(void *to,const void *from,unsigned long n);
 # ARM3: cant use memcopy here!!!
@@ -275,37 +275,37 @@
 _memcpy_fromfs:
 		ENTER
 		cmp	r1, r0
-		bcc	other_copy
+		bcc	Lother_copy
 		subs	r2, r2, #4
-		blt	up_no_double_words
+		blt	Lup_no_double_words
 		ands	ip, r0, #3
-		bne	up_dest_not_aligned
+		bne	Lup_dest_not_aligned
 		ands	ip, r1, #3
-		bne	up_src_not_aligned
+		bne	Lup_src_not_aligned
 
-up_rest:	subs	r2, r2, #8
-		blt	up_cpy_2_lp
+Lup_rest:	subs	r2, r2, #8
+		blt	Lup_cpy_2_lp
 		subs	r2, r2, #0x14
-		blt	up_not_long_copy
+		blt	Lup_not_long_copy
 
-up_cpy_8_lp:	ldmia	r1!,{r3 - r9, ip}
+Lup_cpy_8_lp:	ldmia	r1!,{r3 - r9, ip}
 		stmia	r0!,{r3 - r9, ip}
 		subs	r2, r2, #32
-		bge	up_cpy_8_lp
+		bge	Lup_cpy_8_lp
 		cmn	r2, #16
 		ldmgeia	r1!, {r3 - r6}
 		stmgeia	r0!, {r3 - r6}
 		subge	r2, r2, #0x10
-up_not_long_copy:
+Lup_not_long_copy:
 		adds	r2, r2, #0x14
 
-up_cpy_3_lp:	ldmgeia	r1!, {r3 - r5}
+Lup_cpy_3_lp:	ldmgeia	r1!, {r3 - r5}
 		stmgeia	r0!, {r3 - r5}
 		subges	r2, r2, #12
-		bge	up_cpy_3_lp
+		bge	Lup_cpy_3_lp
 
-up_cpy_2_lp:	adds	r2, r2, #8
-		blt	up_no_double_words
+Lup_cpy_2_lp:	adds	r2, r2, #8
+		blt	Lup_no_double_words
 		subs	r2, r2, #4
 		ldrlt	r3, [r1], #4
 		strlt	r3, [r0], #4
@@ -313,7 +313,7 @@
 		stmgeia	r0!, {r3, r4}
 		subge	r2, r2, #4
 
-up_no_double_words:
+Lup_no_double_words:
 		adds	r2, r2, #4
 		EXITEQ
 		cmp	r2, #2
@@ -324,7 +324,7 @@
 		ldrgtb	r3, [r1], #1
 		strgtb	r3, [r0], #1
 		EXIT
-up_dest_not_aligned:
+Lup_dest_not_aligned:
 		rsb	ip, ip, #4
 		cmp	ip, #2
 		ldrb	r3, [r1], #1
@@ -334,20 +334,20 @@
 		ldrgtb	r3, [r1], #1
 		strgtb	r3, [r0], #1
 		subs	r2, r2, ip
-		blt	up_no_double_words
+		blt	Lup_no_double_words
 		ands	ip, r1, #3
-		beq	up_rest
-up_src_not_aligned:
+		beq	Lup_rest
+Lup_src_not_aligned:
 		bic	r1, r1, #3
 		ldr	r7, [r1], #4
 		cmp	ip, #2
-		bgt	up_cpy_4_3
-		beq	up_cpy_4_2
+		bgt	Lup_cpy_4_3
+		beq	Lup_cpy_4_2
 		cmp	r2, #12
-		blt	up_cpy_x_1_lp
+		blt	Lup_cpy_x_1_lp
 		sub	r2, r2, #12
 
-up_cpy_4_1_lp:	mov	r3, r7, lsr #8
+Lup_cpy_4_1_lp:	mov	r3, r7, lsr #8
 		ldmia	r1!, {r4 - r7}
 		orr	r3, r3, r4, lsl #24
 		mov	r4, r4, lsr #8
@@ -358,25 +358,25 @@
 		orr	r6, r6, r7, lsl #24
 		stmia	r0!, {r3 - r6}
 		subs	r2, r2, #16
-		bge	up_cpy_4_1_lp
+		bge	Lup_cpy_4_1_lp
 		adds	r2, r2, #12
-		blt	up_rest1
+		blt	Lup_rest1
 
-up_cpy_x_1_lp:	mov	r3, r7, lsr #8
+Lup_cpy_x_1_lp:	mov	r3, r7, lsr #8
 		ldr	r7, [r1], #4
 		orr	r3, r3, r7, lsl #24
 		str	r3, [r0], #4
 		subs	r2, r2, #4
-		bge	up_cpy_x_1_lp
+		bge	Lup_cpy_x_1_lp
 
-up_rest1:	sub	r1, r1, #3
-		b	up_no_double_words
+Lup_rest1:	sub	r1, r1, #3
+		b	Lup_no_double_words
 
-up_cpy_4_2:	cmp	r2, #12
-		blt	up_cpy_x_2_lp
+Lup_cpy_4_2:	cmp	r2, #12
+		blt	Lup_cpy_x_2_lp
 		sub	r2, r2, #12
 
-up_cpy_4_2_lp:	mov	r3, r7, lsr #16
+Lup_cpy_4_2_lp:	mov	r3, r7, lsr #16
 		ldmia	r1!, {r4 - r7}
 		orr	r3, r3, r4, lsl #16
 		mov	r4, r4, lsr #16
@@ -387,25 +387,25 @@
 		orr	r6, r6, r7,LSL#16
 		stmia	r0!, {r3 - r6}
 		subs	r2, r2, #16
-		bge	up_cpy_4_2_lp
+		bge	Lup_cpy_4_2_lp
 		adds	r2, r2, #12
-		blt	up_rest2
+		blt	Lup_rest2
 
-up_cpy_x_2_lp:	mov	r3, r7, lsr #16
+Lup_cpy_x_2_lp:	mov	r3, r7, lsr #16
 		ldr	r7, [r1], #4
 		orr	r3, r3, r7, lsl #16
 		str	r3, [r0], #4
 		subs	r2, r2, #4
-		bge	up_cpy_x_2_lp
+		bge	Lup_cpy_x_2_lp
 
-up_rest2:	sub	r1, r1, #2
-		b	up_no_double_words
+Lup_rest2:	sub	r1, r1, #2
+		b	Lup_no_double_words
 
-up_cpy_4_3:	cmp	r2, #12
-		blt	up_cpy_x_3_lp
+Lup_cpy_4_3:	cmp	r2, #12
+		blt	Lup_cpy_x_3_lp
 		sub	r2, r2, #12
 
-up_cpy_4_3_lp:	mov	r3, r7, lsr #24
+Lup_cpy_4_3_lp:	mov	r3, r7, lsr #24
 		ldmia	r1!,{r4 - r7}
 		orr	r3, r3, r4, lsl #8
 		mov	r4, r4, lsr #24
@@ -416,42 +416,42 @@
 		orr	r6, r6, r7, lsl #8
 		stmia	r0!, {r3 - r6}
 		subs	r2, r2, #16
-		bge	up_cpy_4_3_lp
+		bge	Lup_cpy_4_3_lp
 		adds	r2, r2, #12
-		blt	up_rest3
+		blt	Lup_rest3
 
-up_cpy_x_3_lp:	mov	r3, r7, lsr #24
+Lup_cpy_x_3_lp:	mov	r3, r7, lsr #24
 		ldr	r7, [r1], #4
 		orr	r3, r3, r7, lsl#8
 		str	r3, [r0], #4
 		subs	r2, r2, #4
-		bge	up_cpy_x_3_lp
+		bge	Lup_cpy_x_3_lp
 
-up_rest3:	sub	r1, r1, #1
-		b	up_no_double_words
+Lup_rest3:	sub	r1, r1, #1
+		b	Lup_no_double_words
 
 
-other_copy:	add	r1, r1, r2
+Lother_copy:	add	r1, r1, r2
 		add	r0, r0, r2
 		subs	r2, r2, #4
-		blt	down_no_double_words
+		blt	Ldown_no_double_words
 		ands	ip, r0, #3
-		bne	down_dest_not_aligned
+		bne	Ldown_dest_not_aligned
 		ands	ip, r1, #3
-		bne	down_src_not_aligned
+		bne	Ldown_src_not_aligned
 
-down_rest:
+Ldown_rest:
 		subs	r2, r2, #8
-		blt	down_cpy_2_lp
+		blt	Ldown_cpy_2_lp
 		subs	r2, r2, #0x14
-		blt	down_not_long_copy
-down_cpy_8_lp:
+		blt	Ldown_not_long_copy
+Ldown_cpy_8_lp:
 		ldmdb	r1!, {r3 - r9, ip}
 		stmdb	r0!, {r3 - r9, ip}
 		subs	r2, r2, #32
-		bge	down_cpy_8_lp
+		bge	Ldown_cpy_8_lp
 
-down_not_long_copy:
+Ldown_not_long_copy:
 		cmn	r2, #16
 		ldmgedb	r1!, {r3 - r6}
 		stmgedb	r0!, {r3 - r6}
@@ -460,9 +460,9 @@
 		ldmgedb	r1!, {r3 - r5}
 		stmgedb	r0!, {r3 - r5}
 		subge	r2, r2, #12
-down_cpy_2_lp:
+Ldown_cpy_2_lp:
 		adds	r2, r2, #8
-		blt	down_no_double_words
+		blt	Ldown_no_double_words
 		subs	r2, r2, #4
 		ldrlt	r3, [r1, #-4]!
 		strlt	r3, [r0, #-4]!
@@ -470,7 +470,7 @@
 		stmgedb	r0!, {r3, r4}
 		subge	r2, r2, #4
 
-down_no_double_words:
+Ldown_no_double_words:
 		adds	r2, r2, #4
 		EXITEQ
 		cmp	r2, #2
@@ -482,7 +482,7 @@
 		strgtb	r3, [r0, #-1]!
 		EXIT
 
-down_dest_not_aligned:
+Ldown_dest_not_aligned:
 		CMP	ip,#2
 		LDRB	r3,[r1,#-1]!
 		STRB	r3,[r0,#-1]!
@@ -491,21 +491,21 @@
 		LDRGTB	r3,[r1,#-1]!
 		STRGTB	r3,[r0,#-1]!
 		SUBS	r2,r2,ip
-		BLT	down_no_double_words
+		BLT	Ldown_no_double_words
 		ANDS	ip,r1,#3
-		BEQ	down_rest
+		BEQ	Ldown_rest
 
-down_src_not_aligned:
+Ldown_src_not_aligned:
 		BIC	r1,r1,#3
 		LDR	r3,[r1],#0
 		CMP	ip,#2
-		BLT	down_cpy_4_3
-		BEQ	down_cpy_4_2
+		BLT	Ldown_cpy_4_3
+		BEQ	Ldown_cpy_4_2
 		CMP	r2,#12
-		BLT	down_cpy_x_1_lp
+		BLT	Ldown_cpy_x_1_lp
 		SUB	r2,r2,#12
 
-down_cpy_4_1_lp:
+Ldown_cpy_4_1_lp:
 		MOV	r7,r3,LSL#8
 		LDMDB	r1!,{r3,r4,r5,r6}
 		ORR	r7,r7,r6,LSR#24
@@ -517,28 +517,28 @@
 		ORR	r4,r4,r3,LSR#24
 		STMDB	r0!,{r4,r5,r6,r7}
 		SUBS	r2,r2,#16
-		BGE	down_cpy_4_1_lp
+		BGE	Ldown_cpy_4_1_lp
 		ADDS	r2,r2,#12
-		BLT	down_rest1
+		BLT	Ldown_rest1
 
-down_cpy_x_1_lp:
+Ldown_cpy_x_1_lp:
 		MOV	ip,r3,LSL#8
 		LDR	r3,[r1,#-4]!
 		ORR	ip,ip,r3,LSR#24
 		STR	ip,[r0,#-4]!
 		SUBS	r2,r2,#4
-		BGE	down_cpy_x_1_lp
+		BGE	Ldown_cpy_x_1_lp
 
-down_rest1:
+Ldown_rest1:
 		ADD	r1,r1,#3
-		B	down_no_double_words
+		B	Ldown_no_double_words
 
-down_cpy_4_2:
+Ldown_cpy_4_2:
 		CMP	r2,#12
-		BLT	down_cpy_x_2_lp
+		BLT	Ldown_cpy_x_2_lp
 		SUB	r2,r2,#12
 
-down_cpy_4_2_lp:
+Ldown_cpy_4_2_lp:
 		MOV	r7,r3,LSL#16
 		LDMDB	r1!,{r3,r4,r5,r6}
 		ORR	r7,r7,r6,LSR#16
@@ -550,28 +550,28 @@
 		ORR	r4,r4,r3,LSR#16
 		STMDB	r0!,{r4,r5,r6,r7}
 		SUBS	r2,r2,#16
-		BGE	down_cpy_4_2_lp
+		BGE	Ldown_cpy_4_2_lp
 		ADDS	r2,r2,#12
-		BLT	down_rest2
+		BLT	Ldown_rest2
 
-down_cpy_x_2_lp:
+Ldown_cpy_x_2_lp:
 		MOV	ip,r3,LSL#16
 		LDR	r3,[r1,#-4]!
 		ORR	ip,ip,r3,LSR#16
 		STR	ip,[r0,#-4]!
 		SUBS	r2,r2,#4
-		BGE	down_cpy_x_2_lp
+		BGE	Ldown_cpy_x_2_lp
 
-down_rest2:
+Ldown_rest2:
 		ADD	r1,r1,#2
-		B	down_no_double_words
+		B	Ldown_no_double_words
 
-down_cpy_4_3:
+Ldown_cpy_4_3:
 		CMP	r2,#12
-		BLT	down_cpy_x_3_lp
+		BLT	Ldown_cpy_x_3_lp
 		SUB	r2,r2,#12
 
-down_cpy_4_3_lp:
+Ldown_cpy_4_3_lp:
 		MOV	r7,r3,LSL#24
 		LDMDB	r1!,{r3,r4,r5,r6}
 		ORR	r7,r7,r6,LSR#8
@@ -583,17 +583,17 @@
 		ORR	r4,r4,r3,LSR#8
 		STMDB	r0!,{r4,r5,r6,r7}
 		SUBS	r2,r2,#16
-		BGE	down_cpy_4_3_lp
+		BGE	Ldown_cpy_4_3_lp
 		ADDS	r2,r2,#12
-		BLT	down_rest3
-down_cpy_x_3_lp:
+		BLT	Ldown_rest3
+Ldown_cpy_x_3_lp:
 		MOV	ip,r3,LSL#24
 		LDR	r3,[r1,#-4]!
 		ORR	ip,ip,r3,LSR#8
 		STR	ip,[r0,#-4]!
 		SUBS	r2,r2,#4
-		BGE	down_cpy_x_3_lp
-down_rest3:
+		BGE	Ldown_cpy_x_3_lp
+Ldown_rest3:
 		ADD	r1,r1,#1
-		B	down_no_double_words
+		B	Ldown_no_double_words
 
diff -urN linux.store/linux/arch/arm/lib/string.S linux/arch/arm/lib/string.S
--- linux.store/linux/arch/arm/lib/string.S	Sun Mar  3 13:17:16 1996
+++ linux/arch/arm/lib/string.S	Thu Mar 28 10:23:15 1996
@@ -11,11 +11,11 @@
 		.global	_strrchr
 _strrchr:	stmfd	sp!,{lr}
 		mov	r3,#0
-strrchrlp:	ldrb	r2,[r0],#1
+Lstrrchrlp:	ldrb	r2,[r0],#1
 		teq	r2,r1
 		moveq	r3,r0
 		teq	r2,#0
-		bne	strrchrlp
+		bne	Lstrrchrlp
 		mov	r0,r3
 		LOADREGS(fd, sp!, {pc})
 
@@ -25,20 +25,20 @@
 		stmfd	sp!, {lr}
 		mov	r3, r0
 		cmp	r2, #4
-		blt	memsetlp
+		blt	Lmemsetlp
 		ands	ip, r3, #3
-		beq	aligned
+		beq	Laligned
 		cmp	ip, #2
 		strltb	r1, [r3], #1
 		strleb	r1, [r3], #1
 		strb	r1, [r3], #1
 		rsb	ip, ip, #4
 		sub	r2, r2, ip
-aligned:	orr	ip, r1, r1, lsl #8
+Laligned:	orr	ip, r1, r1, lsl #8
 		orr	ip, ip, ip, lsl #16
 		subs	r2, r2, #32
-		bmi	memsetl32
-memset32lp:	str	ip, [r3], #4
+		bmi	Lmemsetl32
+Lmemset32lp:	str	ip, [r3], #4
 		str	ip, [r3], #4
 		str	ip, [r3], #4
 		str	ip, [r3], #4
@@ -48,29 +48,29 @@
 		str	ip, [r3], #4
 		LOADREGS(eqfd, sp!, {pc})
 		subs	r2, r2, #32
-		bpl	memset32lp
-memsetl32:	adds	r2, r2, #16
-		bmi	memsetl16
+		bpl	Lmemset32lp
+Lmemsetl32:	adds	r2, r2, #16
+		bmi	Lmemsetl16
 		str	ip, [r3], #4
 		str	ip, [r3], #4
 		str	ip, [r3], #4
 		str	ip, [r3], #4
 		LOADREGS(eqfd, sp!, {pc})
 		sub	r2, r2, #16
-memsetl16:	adds	r2, r2, #8
-		bmi	memsetl8
+Lmemsetl16:	adds	r2, r2, #8
+		bmi	Lmemsetl8
 		str	ip, [r3], #4
 		str	ip, [r3], #4
 		LOADREGS(eqfd, sp!, {pc})
 		sub	r2, r2, #8
-memsetl8:	adds	r2, r2, #4
-		bmi	memsetl4
+Lmemsetl8:	adds	r2, r2, #4
+		bmi	Lmemsetl4
 		str	ip, [r3], #4
 		LOADREGS(eqfd, sp!, {pc})
 		sub	r2, r2, #4
-memsetl4:	add	r2, r2, #4
-memsetlp:	subs	r2, r2, #1
+Lmemsetl4:	add	r2, r2, #4
+Lmemsetlp:	subs	r2, r2, #1
 		strgeb	r1, [r3], #1
-		bgt	memsetlp
+		bgt	Lmemsetlp
 		LOADREGS(fd, sp!, {pc})
 
diff -urN linux.store/linux/arch/arm/lib/system.S linux/arch/arm/lib/system.S
--- linux.store/linux/arch/arm/lib/system.S	Sun Mar  3 13:17:43 1996
+++ linux/arch/arm/lib/system.S	Thu Mar 28 10:25:18 1996
@@ -33,7 +33,7 @@
 LC0:
 		.word	_current
 LC1:
-		.word	_wantmap
+		.word	Lwantmap
 LC2:
 		.word	_page_nr
 LC3:
@@ -88,7 +88,7 @@
 		orr	r3, r3, #0x03F00000
 		ldr	r2, [pc, #LC2 - . - 8]
 		ldr	r2, [r2]
-removelp:	subs	r2, r2, #1
+Lremovelp:	subs	r2, r2, #1
 		orrpl	r1, r3, r2
 		strpl	r1, [r4, r2, lsl#2]
 		subpls	r2, r2, #1
@@ -100,52 +100,52 @@
 		subpls	r2, r2, #1
 		orrpl	r1, r3, r2
 		strpl	r1, [r4, r2, lsl#2]
-		bpl	removelp
+		bpl	Lremovelp
 
-		adr	r6, phystomemc32	@ Convert to logical page number
+		adr	r6, Lphystomemc32	@ Convert to logical page number
 		ldr	r1, [pc, #LC3 - . - 8]
 		ldr	r7, [r1]
 		mov	r1, #32*1024*1024	@ Top of logical memory
 		mov	r1, r1, LSR r7		@ Convert to logical page number
 		sub	r8, r1, #1		@ Max. logical page no.
 
-invalidatelp:	ldr	r1, [r0, r8, lsl#2]	@ Get map info
+Linvalidatelp:	ldr	r1, [r0, r8, lsl#2]	@ Get map info
 		tst	r1, #PAGE_PRESENT	@ Check to see if it is present
-		beq	nextpage		@ If not, try next
+		beq	Lnextpage		@ If not, try next
 		mov	r2, r1, lsr r7		@ convert entry to physical page number
 		and	r2, r2, #0xff		@ Ensure that we only have the page no.
 		ldr	r2, [r6, r2, lsl#2]	@ Convert to memc page number
 		tst	r1, #PAGE_ACCESSED	@ check accessed
 		tstne	r1, #PAGE_USER
-		beq	not_accessed
+		beq	Lnot_accessed
 		bic	r2, r2, #0x200
 		tst	r1, #PAGE_RW
 		tstne	r1,#PAGE_DIRTY
 		bicne	r2, r2, #0x300		@ Read/Write
 
-not_accessed:	mov	r1, r8, lsl r7		@ Shift logical page into correct position
+Lnot_accessed:	mov	r1, r8, lsl r7		@ Shift logical page into correct position
 		mov	r3, r1, lsl #9		@ get low bits of page number
 		orr	r2, r2, r3, lsr #9
 		and	r1, r1, #0x01800000
 		orr	r2, r2, r1, lsr #(23 - 10)
 		and	r1, r2, #255
 		str	r2, [r4, r1, lsl #2]	@ save in 'wanted' map table
-nextpage:	subs	r8,r8,#1
-		bpl	invalidatelp
+Lnextpage:	subs	r8,r8,#1
+		bpl	Linvalidatelp
 
-@ update the map to 'wantmap' - wantmap is in r11, r10 = page_nr
+@ update the map to 'Lwantmap' - wantmap is in r11, r10 = page_nr
 @ (interrupts can be enabled, and will be soon...)
-map_update:	ldr	r3, [pc, #LC2 - . - 8]
+Lmap_update:	ldr	r3, [pc, #LC2 - . - 8]
 		ldr	r3, [r3]
 		sub	r3, r3, #1
 		ldr	r5, [pc, #LC4 - . - 8]
-map_updatelp:	ldr	r1, [r4,r3,LSL#2]
+Lmap_updatelp:	ldr	r1, [r4,r3,LSL#2]
 		ldr	r2, [r5,r3,LSL#2]
 		teq	r2, r1
 		strne	r1, [r5,r3,LSL#2]
 		strneb	r1,[r1]
 		subs	r3,r3,#1
-		bpl	map_updatelp
+		bpl	Lmap_updatelp
 		ldmea	fp, {r4 - r9, fp, sp, pc}^
 
 		.align
@@ -169,7 +169,7 @@
 		.word	af | 0x03800300
 
 @ Table to map from page number to vidc page number
-phystomemc32:
+Lphystomemc32:
 		
 		PCD(	0x00,0x08,0x10,0x18,0x20,0x28,0x30,0x38,0x40,0x48,0x50,0x58,0x60,0x68,0x70,0x78)
 		PCD(	0x01,0x09,0x11,0x19,0x21,0x29,0x31,0x39,0x41,0x49,0x51,0x59,0x61,0x69,0x71,0x79)
@@ -209,7 +209,7 @@
 		.word	-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1
 		.word	-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1
 # The wanted memc mapping
-_wantmap:
+Lwantmap:
 		.word	-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1
 		.word	-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1
 		.word	-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1,-1
diff -urN linux.store/linux/arch/arm/lib/traps-arm6.S linux/arch/arm/lib/traps-arm6.S
--- linux.store/linux/arch/arm/lib/traps-arm6.S	Thu Jan  1 01:00:00 1970
+++ linux/arch/arm/lib/traps-arm6.S	Fri Mar 22 22:04:08 1996
@@ -0,0 +1,1034 @@
+/*
+ * linux/arch/arm/lib/traps-arm6.S
+ *
+ * Copyright (C) 1996 Russell King.
+ *
+ * Low-level vector interface routines
+ *
+ * Design issues:
+ *  - We have several modes that each vector can be called from,
+ *    each with its own set of registers.  On entry to any vector,
+ *    we *must* save the registers used in *that* mode.
+ *
+ *  - This code must be as fast as possible.
+ *
+ * There are a few restrictions on the vectors:
+ *  - the SWI vector cannot be called from *any* non-user mode
+ *
+ *  - the FP emulator is *never* called from *any* non-user mode undefined instruction.
+ *
+ * Ok, so this file may be a mess, but its as efficient as possible while
+ * adhering to the above criteria.
+ */
+
+#include <asm/assembler.h>
+#include <asm/errno.h>
+#include <asm/hardware.h>
+
+		.text
+
+@ Offsets into task structure
+@ ---------------------------
+@
+#define STATE		0
+#define COUNTER		4
+#define PRIORITY	8
+#define SIGNAL		12
+#define BLOCKED		16
+#define FLAGS		20
+#define ERRNO		24
+
+#define PF_TRACESYS	0x20
+
+@ Bad Abort numbers
+@ -----------------
+@
+#define BAD_PREFETCH	0
+#define BAD_DATA	1
+#define BAD_ADDREXCPTN	2
+#define BAD_IRQ		3
+#define BAD_UNDEFINSTR	4
+
+@ Number of syscalls accepted
+@
+#define NSYS_CALL	142
+
+@ OS version number used in SWIs
+@  RISC OS is 0
+@  RISC iX is 8
+@
+#define OS_NUMBER	9
+
+@
+@ Stack format (ensured by USER_* and SVC_*)
+@
+#define S_FRAME_SIZE	72
+#define S_OLD_R0	68
+#define S_PSR		64
+#define S_PC		60
+#define S_LR		56
+#define S_SP		52
+#define S_IP		48
+#define S_FP		44
+#define S_R10		40
+#define S_R9		36
+#define S_R8		32
+#define S_R7		28
+#define S_R6		24
+#define S_R5		20
+#define S_R4		16
+#define S_R3		12
+#define S_R2		8
+#define S_R1		4
+#define S_R0		0
+
+#include "constants.h"
+
+#define USER_SAVE_ALL				\
+		str	r0, [sp, #-4]!		;\
+		str	lr, [sp, #-4]!		;\
+		sub	sp, sp, #15*4		;\
+		stmia	sp, {r0 - lr}^		;\
+		mov	r0, r0			;\
+		mov	fp, #0
+
+#define SVC_SAVE_ALL				\
+		str	sp, [sp, #-16]!		;\
+		str	lr, [sp, #8]		;\
+		str	lr, [sp, #4]		;\
+		stmfd	sp!, {r0 - r12}		;\
+		mov	r0, #-1			;\
+		str	r0, [sp, #S_OLD_R0]	;\
+		mov	fp, #0
+
+#define SVC_IRQ_SAVE_ALL			\
+		str	sp, [sp, #-16]!		;\
+		str	lr, [sp, #4]		;\
+		ldr	lr, [pc, #LC4 - . - 8]	;\
+		ldr	lr, [lr]		;\
+		str	lr, [sp, #8]		;\
+		stmfd	sp!, {r0 - r12}		;\
+		mov	r0, #-1			;\
+		str	r0, [sp, #S_OLD_R0]	;\
+		mov	fp, #0
+
+#define USER_RESTORE_ALL			\
+		ldmia	sp, {r0 - lr}^		;\
+		mov	r0, r0			;\
+		add	sp, sp, #15*4		;\
+		ldr	lr, [sp], #8		;\
+		bics	pc, lr, #0x0C000003	
+
+#define SVC_RESTORE_ALL				\
+		ldmfd	sp, {r0 - pc}^
+		
+		.global	_ret_from_sys_call
+
+/*
+ *================================================================================================
+ *		Low-level interface code
+ *------------------------------------------------------------------------------------------------
+ *		Trap initialisation
+ *------------------------------------------------------------------------------------------------
+ *
+ * Note - FIQ code has changed.  The default is a couple of words in 0x1c, 0x20
+ * that call _unexp_fiq.  Nowever, we now copy the FIQ routine to 0x1c (removes
+ * some excess cycles).
+ *
+ * What we need to put into 0-0x1c are ldrs to branch to 0xC0000000
+ * (the kernel).
+ * 0x1c onwards is reserved for FIQ, so I think that I will allocate 0xe0 onwards for
+ * the actuall address to jump to.
+ */
+/*
+ * these go into 0x00
+ */
+branches:	swi	SYS_ERROR0
+		ldr	pc, branches + 0xe4
+		ldr	pc, branches + 0xe8
+		ldr	pc, branches + 0xec
+		ldr	pc, branches + 0xf0
+		ldr	pc, branches + 0xf4
+		ldr	pc, branches + 0xf8
+		ldr	pc, . + 4
+		.word	_unexp_fiq
+/*
+ * this is put into 0xe0 and above
+ */
+jump_addresses:	.word	0
+		.word	vector_undefinstr
+		.word	vector_swi
+		.word	vector_prefetch
+		.word	vector_data
+		.word	vector_addrexcptn
+		.word	vector_IRQ
+/*
+ * initialise the trap system
+ */
+		.global	_trap_init
+_trap_init:	stmfd	sp !,{r4 - r9,lr}		@ Save link register
+		mrs	r0, cpsr_all
+		bic	r0, r0, #192 | 31
+		orr	r0, r0, #0xD3
+		msr	cpsr_all, r0
+		mov	r0, #IOC_BASE
+		str	r0, [r0, #0x18]
+		str	r0, [r0, #0x28]
+		str	r0, [r0, #0x38]
+		mov	r0, #0xE0
+		adr	r1, jump_addresses
+		ldmia	r1, {r1 - r7}
+		stmia	r0, {r1 - r7}
+		mov	r0, #0				@ Lowest location
+		adr	r1, branches
+		ldmia	r1,  {r1 - r9}
+		stmia	r0!, {r1 - r9}			@ Save all into page 0 ram
+		ldmfd	sp!, {r4 - r9, pc}^
+/*
+ *------------------------------------------------------------------------------------------------
+ * Undefined FIQs
+ *------------------------------------------------------------------------------------------------
+ * Enter in FIQ mode, spsr = ANY CPSR, lr = ANY PC
+ * MUST PRESERVE SVC SPSR, but need to switch to SVC mode to show our msg.
+ * Basically to switch modes, we *HAVE* to clobber one register...  brain damage alert!
+ * I don't think that we can execute any code in here in any other mode than FIQ...  Ok
+ * you can switch to another mode, but you can't get out of that mode without clobbering one
+ * register.
+ */
+_unexp_fiq:	mov	r12, #IOC_BASE
+		strb	r12, [r12, #0x38]	@ Disable FIQ register
+		subs	pc, lr, #4
+/*
+ *------------------------------------------------------------------------------------------------
+ * Interrupt entry dispatcher - dispatches it to the correct handler for the processor mode
+ *------------------------------------------------------------------------------------------------
+ * Enter in IRQ mode, spsr = SVC/USR CPSR, lr = SVC/USR PC
+ */
+LCirq:		.word	__temp_irq
+vector_IRQ:	@
+		@ save mode specific registers
+		@
+		ldr	r13, [pc, #LCirq - . - 8]
+		sub	lr, lr, #4
+		str	lr, [r13]
+		mrs	lr, spsr_all
+		str	lr, [r13, #4]
+		@
+		@ now branch to the relevent MODE handling routine
+		@
+		and	lr, lr, #15
+		cmp	lr, #4
+		addlt	pc, pc, lr, lsl #2
+		b	__irq_invalid			@ 7, 11 (ABT) (UND)
+		b	__irq_usr			@ 0  (USR)
+		b	__irq_invalid			@ 1  (FIQ)
+		b	__irq_invalid			@ 2  (IRQ)
+		b	__irq_svc			@ 3  (SVC)
+/*
+ *------------------------------------------------------------------------------------------------
+ * Undef instr entry dispatcher - dispatches it to the correct handler for the processor mode
+ *------------------------------------------------------------------------------------------------
+ * Enter in UND mode, spsr = SVC/USR CPSR, lr = SVC/USR PC
+ */
+LCund:		.word	__temp_und
+vector_undefinstr:
+		@
+		@ save mode specific registers
+		@
+		ldr	r13, [pc, #LCund - . - 8]
+		str	lr, [r13]
+		mrs	lr, spsr_all
+		str	lr, [r13, #4]
+		@
+		@ now branch to the relevent MODE handling routine
+		@
+		and	lr, lr, #15
+		cmp	lr, #4
+		addlt	pc, pc, lr, lsl #2
+		b	__und_invalid			@ 7, 11 (ABT) (UND)
+		b	__und_usr			@ 0 (USR)
+		b	__und_invalid			@ 1 (FIQ)
+		b	__und_invalid			@ 2 (IRQ)
+		b	__und_svc			@ 3 (SVC)
+/*
+ *------------------------------------------------------------------------------------------------
+ * Prefetch abort dispatcher - dispatches it to the correct handler for the processor mode
+ *------------------------------------------------------------------------------------------------
+ * Enter in ABT mode, spsr = USR CPSR, lr = USR PC
+ */
+LCabt:		.word	__temp_abt
+vector_prefetch:
+		@
+		@ save mode specific registers
+		@
+		sub	lr, lr, #4
+		ldr	r13, [pc, #LCabt - . - 8]
+		str	lr, [r13]
+		mrs	lr, spsr_all
+		str	lr, [r13, #4]
+		@
+		@ now branch to the relevent MODE handling routine
+		@
+		and	lr, lr, #31
+		teq	lr, #16
+		beq	__pabt_usr			@ 0 (USR)
+		b	__pabt_invalid			@ 1, 2, 3, 7, 11 (FIQ)(IRQ)(SVC)(ABT)(UND)
+/*
+ *------------------------------------------------------------------------------------------------
+ * Data abort dispatcher - dispatches it to the correct handler for the processor mode
+ *------------------------------------------------------------------------------------------------
+ * Enter in ABT mode, spsr = USR CPSR, lr = USR PC
+ */
+vector_data:	@
+		@ save mode specific registers
+		@
+		sub	lr, lr, #8
+		ldr	r13, [pc, #LCabt - . - 8]
+		str	lr, [r13]
+		mrs	lr, spsr_all
+		str	lr, [r13, #4]
+		@
+		@ now branch to the relevent MODE handling routine
+		@
+		and	lr, lr, #15
+		b	__dabt_invalid			@ 7, 11 (ABT) (UND)
+		b	__dabt_usr			@ 0  (USR)
+		b	__dabt_invalid			@ 1  (FIQ)
+		b	__dabt_invalid			@ 2  (IRQ)
+		b	__dabt_svc			@ 3  (SVC)
+
+/*
+ *===============================================================================
+ * SWI handler
+ *-------------------------------------------------------------------------------
+ *
+ * We now handle sys-call tracing, and the errno in the task structure.
+ * Still have a problem with >4 arguments for functions.  Theres only
+ * a couple of functions in the code that have 5 arguments, so Im not
+ * too worried.
+ */
+LC1:		.word	_current
+LC2:		.word	_sys_call_table
+/*
+ * Enter in SVC mode, spsr_all = OLD_USER_cpsr_all, R14 = OLD_USER_PC
+ */
+vector_swi:	sub	sp, sp, #S_FRAME_SIZE
+		stmia	sp, {r0 - lr}^			@ Calling r0 - lr
+		mov	r7, r0
+		mrs	r6, spsr
+		mov	r5, lr
+		add	r4, sp, #S_PC
+		stmia	r4, {r5, r6, r7}		@ Save calling PC, CPSR, OLD_R0
+		mov	fp, #0
+		ldr	r4, [lr, #-4]			@ get swi instruction
+		mrs	r5, cpsr			@ enable irqs
+		bic	r5, r5, #128
+		msr	cpsr, r5
+		bic	r4, r4, #0xff000000		@ mask off swi op code
+		eor	r4, r4, #OS_NUMBER << 20	@ check OS number
+		tst	r4, #0x00f00000
+		bne	bad
+retry:		cmp	r4, #NSYS_CALL			@ check upper syscall limit
+		bcs	swi_bad_call
+@		bl	_arm3_flushcache
+
+		ldr	r5, [pc, #LC1 - . - 8]
+		ldr	r5, [r5]
+		mov	ip, #0				@ zero errno
+		str	ip, [r5, #ERRNO]
+
+		ldr	ip, [r5, #FLAGS]		@ check for syscall tracing
+		tst	ip, #PF_TRACESYS
+		bne	trace_this_syscall
+
+		ldr	ip, [pc, #LC2 - . - 8]
+		mov	r9, sp				@ hack for routines needing > 4 values
+		mov	lr, pc
+		ldr	pc, [ip, r4, lsl #2]		@ call sys routine
+
+		ldr	ip, [r5, #ERRNO]		@ check errno
+		rsbs	ip, ip, #0
+		movne	r0, ip
+		streq	r0, [sp, #0]			@ returned r0
+@		bl	_arm3_flushcache
+		b	_ret_from_sys_call
+
+trace_this_syscall:
+		ldr	r7, [sp, #S_IP]
+		mov	r0, #0
+		str	r0, [sp, #S_IP]
+		bl	_syscall_trace			@ trace entry [IP must = 0]
+		str	r7, [sp, #S_IP]
+		ldmia	sp, {r0 - r3}			@ have to reload r0 - r3
+
+		ldr	ip, [pc, #LC2 - . - 8]
+		mov	r9, sp				@ hack for routines needing > 4 values
+		mov	lr, pc
+		ldr	pc, [ip, r4, lsl #2]		@ call sys routine
+
+		ldr	ip, [r5, #ERRNO]
+		rsbs	ip, ip, #0
+		movne	r0, ip
+		str	r0, [sp, #0]			@ returned r0
+
+		mov	r0, #1
+		str	r0, [sp, #S_IP]
+		bl	_syscall_trace			@ trace exit [IP must != 0]
+		str	r7, [sp, #S_IP]
+@		bl	_arm3_flushcache
+		b	_ret_from_sys_call
+
+
+swi_bad_call:	cmp	r4, #(KSWI_SYS_BASE - KSWI_BASE)@ check for arm private syscalls
+		bcs	arm_sys_call
+		bl	_sys_ni_syscall
+		str	r0, [sp, #0]			@ returned r0
+		b	_ret_from_sys_call
+
+bad:		bl	_deferred
+		ldmfd	sp, {r0 - r3}
+		b	retry
+
+arm_sys_call:	bic	r0, r4, #0x000f0000
+		mov	r1, sp
+		bl	_arm_syscall
+		b	_ret_from_sys_call
+/*
+ *================================================================================================
+ * Undefined instruction handler
+ *------------------------------------------------------------------------------------------------
+ */
+LC9:		.word	_fp_enter
+		.word	_fp_save
+		.word	_fp_restore
+
+__und_usr:	mrs	lr, cpsr			@ Change to SVC mode
+		bic	lr, lr, #31
+		orr	lr, lr, #0x13
+		msr	cpsr, lr
+		mov	r0, r0
+		sub	sp, sp, #S_FRAME_SIZE		@ Allocate frame size in one go
+		stmia	sp, {r0 - lr}^			@ Save USR r0 - lr
+		mov	r7, r0				@ OLD R0
+		ldr	r4, [pc, #LCund - . - 8]
+		ldmia	r4, {r5, r6}			@ Get USR pc, cpsr
+		add	r4, sp, #S_PC
+		stmia	r4, {r5, r6, r7}		@ Save USR pc, cpsr, old_r0
+		@
+		@ Call FP module
+		@
+		ldr	r3, [pc, #LC9 - . - 8]
+		ldr	pc, [r3]			@ Call FP module (when loaded)
+
+		.global	_fpreturn
+		.global	_fpundefinstr
+_fpundefinstr:	mov	r0, lr				@ Called by FP module on undefined instr
+		mov	r1, sp
+		mov	r2, #0
+		mrs	r4, cpsr			@ Enable interrupts
+		bic	r4, r4, #128
+		msr	cpsr, r4
+		bl	_do_undefinstr
+_fpreturn:	b	_ret_from_sys_call		@ Normal FP exit
+
+/*
+ * Function to call when switching tasks to save FP state
+ */
+		.global	_fpe_save
+_fpe_save:	ldr	r1, [pc, #LC9 - . - 4]
+		ldr	pc, [r1]
+
+/*
+ * Function to call when switching tasks to restore FP state
+ */
+		.global	_fpe_restore
+_fpe_restore:	ldr	r1, [pc, #LC9 - . - 0]
+		ldr	pc, [r1]
+
+__und_svc:	mrs	lr, cpsr
+		bic	lr, lr, #31
+		orr	lr, lr, #0x13
+		msr	cpsr, lr
+		mov	r0, r0
+		sub	sp, sp, #S_FRAME_SIZE
+		stmia	sp, {r0 - lr}			@ Save SVC r0 - lr [lr *should* be intact]
+		mov	r7, r0
+		ldr	r4, [pc, #LCund - . - 8]
+		ldmia	r4, {r5, r6}			@ Get SVC pc, cpsr
+		add	r4, sp, #S_PC
+		stmia	r4, {r5, r6, r7}		@ Save SVC pc, cpsr, old_r0
+		mov	r0, r5				@ unsigned long pc
+		mov	r1, sp				@ struct pt_regs *regs
+		and	r2, r6, #31			@ mode
+		bl	_do_undefinstr
+		ldr	lr, [sp, #S_PSR]		@ Get SVC cpsr
+		msr	spsr, lr
+		ldmia	sp, {r0 - pc}^			@ Restore SVC registers
+
+__und_invalid:	mrs	lr, cpsr
+		bic	lr, lr, #31
+		orr	lr, lr, #0x13
+		msr	cpsr, lr
+		mov	r0, r0
+		sub	sp, sp, #S_FRAME_SIZE
+		stmia	sp, {r0 - lr}
+		mov	r7, r0
+		ldr	r4, [pc, #LCund - . - 8]
+		ldmia	r4, {r5, r6}			@ Get UND/IRQ/FIQ/ABT pc, cpsr
+		add	r4, sp, #S_PC
+		stmia	r4, {r5, r6, r7}		@ Save UND/IRQ/FIQ/ABT pc, cpsr, old_r0
+		mov	r0, sp				@ struct pt_regs *regs
+		mov	r1, #BAD_UNDEFINSTR		@ int reason
+		and	r2, r6, #31			@ int mode
+		b	_bad_mode			@ Does not ever return...
+/*
+ *================================================================================================
+ * Prefetch abort handler
+ *------------------------------------------------------------------------------------------------
+ */
+__pabt_usr:	mrs	lr, cpsr			@ Change to SVC mode
+		bic	lr, lr, #31
+		orr	lr, lr, #0x13
+		msr	cpsr, lr
+		mov	r0, r0
+		sub	sp, sp, #S_FRAME_SIZE		@ Allocate frame size in one go
+		stmia	sp, {r0 - lr}^			@ Save USR r0 - lr
+		mov	r7, r0				@ OLD R0
+		ldr	r4, [pc, #LCabt - . - 8]
+		ldmia	r4, {r5, r6}			@ Get USR pc, cpsr
+		add	r4, sp, #S_PC
+		stmia	r4, {r5, r6, r7}		@ Save USR pc, cpsr, old_r0
+		tst	r6, #128
+		mrseq	r7, cpsr			@ Enable interrupts if they were
+		biceq	r7, r7, #128			@ previously
+		msreq	cpsr, r7
+		mov	r0, r5				@ unsigned long min_addr
+		add	r1, r0, #4			@ unsigned long max_addr
+		mov	r2, #0x100			@ int error_code
+		mov	r3, sp				@ struct pt_regs *regs
+		bl	_do_dataabort			@ call abort handler
+		teq	r0, #0
+		bne	_ret_from_sys_call		@ Return from sys call
+#ifdef DEBUG_UNDEF
+		adr	r0, t
+		bl	_printk
+#endif
+		mov	r0, r5
+		mov	r1, sp
+		and	r2, r6, #31
+		bl	_do_undefinstr
+		ldr	lr, [sp, #S_PSR]		@ Get SVC cpsr
+		msr	spsr, lr
+		ldmia	sp, {r0 - pc}^			@ Restore SVC registers
+
+__pabt_invalid:	mrs	lr, cpsr			@ Change to SVC mode
+		bic	lr, lr, #31
+		orr	lr, lr, #0x13
+		msr	cpsr, lr
+		mov	r0, r0
+		sub	sp, sp, #S_FRAME_SIZE		@ Allocate frame size in one go
+		stmia	sp, {r0 - lr}			@ Save XXX r0 - lr
+		mov	r7, r0				@ OLD R0
+		ldr	r4, [pc, #LCabt - . - 8]
+		ldmia	r4, {r5, r6}			@ Get XXX pc, cpsr
+		add	r4, sp, #S_PC
+		stmia	r4, {r5, r6, r7}		@ Save XXX pc, cpsr, old_r0
+		mov	r0, sp				@ Prefetch aborts are definitely *not*
+		mov	r1, #BAD_PREFETCH		@ allowed in non-user modes.  We cant
+		and	r2, r6, #31			@ recover from this problem.
+		b	_bad_mode
+
+#ifdef DEBUG_UNDEF
+t:	.ascii "*** undef ***\r\n\0"
+	.align
+#endif
+/*
+ *================================================================================================
+ * Address exception handler
+ *------------------------------------------------------------------------------------------------
+ * These aren't too critical. (they're not supposed to happen, and won't happen in 32-bit mode).
+ */
+
+vector_addrexcptn:
+		b	vector_addrexcptn
+#if 0
+		sub	lr, lr, #8
+		tst	lr, #3
+		bne	addrexcptn_not_user
+		USER_SAVE_ALL
+		teq	pc, #0x00000003
+		bic	r0, lr, #0xfc000003		@ Point to instruction
+		mov	r1, sp				@ Point to registers
+		mov	r2, #0x400
+		bl	_do_excpt
+		b	_ret_from_sys_call
+
+addrexcptn_not_user:
+		SVC_SAVE_ALL
+		and	r2, lr, #3
+		teq	r2, #3
+		bne	addrexcptn_illegal_mode
+		teqp	pc, #0x00000003			@ NOT a problem - doesnt change mode
+		bic	r0, lr, #0xfc000003
+		mov	r1, sp
+		orr	r2, r2, #0x400
+		bl	_do_excpt
+		ldmia	sp, {r0 - lr}			@ I cant remember the reason I changed this...
+		add	sp, sp, #15*4
+		movs	pc, lr
+
+addrexcptn_illegal_mode:
+		mov	r0, sp
+		str	lr, [sp, #-4]!
+		orr	r1, r2, #0x0c000000
+		teqp	r1, #0				@ change into mode (wont be user mode)
+		mov	r0, r0
+		mov	r1, r8				@ Any register from r8 - r14 can be banked
+		mov	r2, r9
+		mov	r3, r10
+		mov	r4, r11
+		mov	r5, r12
+		mov	r6, r13
+		mov	r7, r14
+		teqp	pc, #0x04000003			@ back to svc
+		mov	r0, r0
+		stmfd	sp!, {r1-r7}
+		ldmia	r0, {r0-r7}
+		stmfd	sp!, {r0-r7}
+		mov	r0, sp
+		mov	r1, #BAD_ADDREXCPTN
+		b	_bad_mode
+#endif
+/*
+ *================================================================================================
+ * Interrupt (IRQ) handler (r13 points to irq temp save area)
+ * MOD: if in user mode, then *no* kernel routine is running, so dont have to
+ *      save svc lr
+ *------------------------------------------------------------------------------------------------
+ */
+LC5:		.word	_irqjump
+__irq_usr:	mrs	lr, cpsr			@ switch to SVC mode
+		bic	lr, lr, #31
+		orr	lr, lr, #0x13
+		msr	cpsr, lr
+		mov	r0, r0
+		sub	sp, sp, #S_FRAME_SIZE
+		stmia	sp, {r0 - lr}^			@ save r0 - lr
+		mov	r7, r0
+		ldr	r4, [pc, #LCirq - . - 8]
+		ldmia	r4, {r5, r6}			@ get saved PC, SPSR
+		add	r4, sp, #S_PC
+		stmia	r4, {r5, r6, r7}		@ save pc, psr, old_r0
+urepeat:	mov	r4, #IOC_BASE			@ point at IOC
+		ldrb	r1, [r4, #0x24]			@ get high priority first
+		adr	r2, irq_prio_h
+		teq	r1, #0
+		ldreqb	r1, [r4, #0x14]			@ get low priority
+		adreq	r2, irq_prio_l
+		teq	r1, #0
+		beq	_ret_from_sys_call
+		ldrb	r0, [r2, r1]			@ Get IRQ number
+		ldr	r2, [pc, #LC5 - . - 8]
+		mov	r1, sp
+		mov	lr, pc
+		@
+		@ routine gets called with r0 = interrupt number, r1 = struct pt_regs *
+		@
+		ldr	pc, [r2, r0, lsl#2]
+		mov	r2, #0
+		teq	r0, #0				@ Check to see if it is a fast IRQ
+		beq	_ret_from_sys_call
+		ldr	fp, [sp, #S_PSR]		@ Get saved SPSR
+		bic	fp, fp, #192 | 15
+		orr	fp, fp, #16			@ Force USER mode, IRQs+FIQs on
+		msr	spsr, fp			@ restore SPSR
+		ldmia	sp, {r0 - lr}^			@ Get calling r0 - lr
+		mov	r0, r0
+		add	sp, sp, #S_PC
+		ldr	lr, [sp], #12
+		movs	pc, lr
+
+LC65:
+		.word	_intr_count			@ -8
+		.word	_bh_mask			@ -4
+		.word	_bh_active			@ -0
+
+__irq_svc:	mrs	lr, cpsr			@ switch to SVC mode
+		bic	lr, lr, #31
+		orr	lr, lr, #0x13
+		msr	cpsr, lr
+		mov	r0, r0
+		sub	sp, sp, #S_FRAME_SIZE
+		stmia	sp, {r0 - lr}			@ save SVC r0 - lr
+		mov	r7, #-1
+		ldr	r4, [pc, #LCirq - . - 8]
+		ldmia	r4, {r5, r6}			@ saved pc, psr
+		add	r4, sp, #S_PC
+		stmia	r4, {r5, r6, r7}		@ save SVC PC, PSR, old_r0
+		mov	fp, #0
+srepeat:	mov	r4, #IOC_BASE		@ point at IOC
+		ldrb	r1, [r4, #0x24]		@ get high priority first
+		adr	r2, irq_prio_h
+		teq	r1, #0
+		ldreqb	r1, [r4, #0x14]		@ get low priority
+		adreq	r2, irq_prio_l
+		teq	r1, #0
+		beq	no_irq2
+		ldrb	r0, [r2, r1]		@ Get IRQ number
+		ldr	r2, [pc, #LC5 - . - 8]
+		mov	r1, sp
+		mov	lr, pc
+		@
+		@ routine gets called with r0 = interrupt number, r1 = struct pt_regs *
+		@
+		ldr	pc, [r2, r0, lsl#2]
+		mov	r2, #1
+		teq	r0, #0			@ Check to see if it is a fast IRQ
+		bne	srepeat
+		ldr	r0, [pc, #LC65 - . - 8]
+		ldr	r1, [r0]
+		teq	r1, #0
+		bne	srepeat
+		mov	r4, r0
+		mov	r5, r1
+		ldr	r6, [pc, #LC65 - . - 4]
+		ldr	r7, [pc, #LC65 - . - 0]
+recheck_bh2:	ldr	r0, [r6]
+		ldr	r1, [r7]
+		tst	r0, r1
+		beq	srepeat
+		add	r0, r5, #1
+		str	r0, [r4]
+		mov	r8, pc
+		teqp	pc, #0x00000003
+		bl	_do_bottom_half
+		teqp	r8, #0
+		str	r5, [r4]
+		b	recheck_bh2
+no_irq2:	ldr	r0, [sp, #S_PSR]
+		msr	spsr, r0
+		ldmfd	sp, {r0 - pc}^
+
+__irq_invalid:	mrs	lr, cpsr		@ switch to svc mode
+		bic	lr, lr, #31
+		orr	lr, lr, #0x13
+		msr	cpsr, lr
+		mov	r0, r0
+		sub	sp, sp, #S_FRAME_SIZE	@ Allocate space on stack for frame
+		stmfd	sp, {r0 - lr}		@ Save r0 - lr
+		mov	r7, #-1
+		ldr	r4, [pc, #LCirq - . - 8]
+		ldmia	r4, {r5, r6}		@ get saved pc, psr
+		add	r4, sp, #S_PC
+		stmia	r4, {r5, r6, r7}
+		mov	fp, #0
+		mov	r0, sp
+		mov	r1, #BAD_IRQ
+		b	_bad_mode
+/*
+ *================================================================================================
+ * Data abort handler code
+ *------------------------------------------------------------------------------------------------
+ * This needs some work ...
+ */
+__dabt_usr:	mrs	lr, cpsr			@ Change to SVC mode
+		bic	lr, lr, #31
+		orr	lr, lr, #0x13
+		msr	cpsr, lr
+		mov	r0, r0
+		sub	sp, sp, #S_FRAME_SIZE		@ Allocate frame size in one go
+		stmia	sp, {r0 - lr}^			@ Save USR r0 - lr
+		mov	r7, r0				@ OLD R0
+		ldr	r4, [pc, #LCabt - . - 8]
+		ldmia	r4, {r5, r6}			@ Get USR pc, cpsr
+		add	r4, sp, #S_PC
+		stmia	r4, {r5, r6, r7}		@ Save USR pc, cpsr, old_r0
+		tst	r6, #128
+		mrseq	r7, cpsr			@ Enable interrupts if they were
+		biceq	r7, r7, #128			@ previously
+		msreq	cpsr, r7
+
+__dabt_svc:	mrs	lr, cpsr
+		bic	lr, lr, #31
+		orr	lr, lr, #0x13
+		msr	cpsr, lr
+		mov	r0, r0
+		sub	sp, sp, #S_FRAME_SIZE
+		stmia	sp, {r0 - lr}			@ Save SVC r0 - lr [lr *should* be intact]
+		mov	r7, r0
+		ldr	r4, [pc, #LCabt - . - 8]
+		ldmia	r4, {r5, r6}			@ Get SVC pc, cpsr
+		add	r4, sp, #S_PC
+		stmia	r4, {r5, r6, r7}		@ Save SVC pc, cpsr, old_r0
+		tst	r6, #128
+		mrseq	r7, cpsr			@ Enable interrupts if they were
+		biceq	r7, r7, #128			@ previously
+		msreq	cpsr, r7
+
+__dabt_invalid:	mrs	lr, cpsr
+		bic	lr, lr, #31
+		orr	lr, lr, #0x13
+		msr	cpsr, lr
+		mov	r0, r0
+		sub	sp, sp, #S_FRAME_SIZE
+		stmia	sp, {r0 - lr}			@ Save SVC r0 - lr [lr *should* be intact]
+		mov	r7, r0
+		ldr	r4, [pc, #LCabt - . - 8]
+		ldmia	r4, {r5, r6}			@ Get SVC pc, cpsr
+		add	r4, sp, #S_PC
+		stmia	r4, {r5, r6, r7}		@ Save SVC pc, cpsr, old_r0
+		mov	r0, sp
+		mov	r1, #BAD_DATA
+		and	r2, r6, #31
+		b	_bad_mode
+#if 0
+vector_data:	b	vector_data
+		sub	lr, lr, #8		@ Correct lr
+		tst	lr, #3
+		bne	data_not_user
+		USER_SAVE_ALL
+		tst	lr, #0x08000000
+		teqeqp	pc, #0x00000003		@ NOT a problem - doesnt change mode
+		bic	r0, lr, #0xFC000003
+		mov	r2, #0
+		mov	r3, sp
+		bl	data_do
+		b	_ret_from_sys_call
+
+data_not_user:	
+		SVC_SAVE_ALL
+		and	r2,lr,#3
+		teq	r2,#3
+		bne	data_illegal_mode
+		tst	lr,#0x08000000
+		teqeqp	pc,#0x00000003		@ NOT a problem - doesnt change mode
+		bic	r0,lr,#0xFC000003
+		mov	r3,sp
+		bl	data_do
+		SVC_RESTORE_ALL
+#endif
+/*
+ * Interrupt table (incorporates priority)
+ */
+irq_prio_l:	.byte	 0, 0, 1, 0, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3
+		.byte	 4, 0, 1, 0, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3, 3
+		.byte	 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5
+		.byte	 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5
+		.byte	 6, 6, 6, 6, 6, 6, 6, 6, 3, 3, 3, 3, 3, 3, 3, 3
+		.byte	 6, 6, 6, 6, 6, 6, 6, 6, 3, 3, 3, 3, 3, 3, 3, 3
+		.byte	 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5
+		.byte	 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5
+		.byte	 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7
+		.byte	 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7
+		.byte	 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7
+		.byte	 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7
+		.byte	 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7
+		.byte	 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7
+		.byte	 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7
+		.byte	 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7, 7
+irq_prio_h:	.byte	 0, 8, 9, 8,10,10,10,10,11,11,11,11,10,10,10,10
+		.byte	12, 8, 9, 8,10,10,10,10,11,11,11,11,10,10,10,10
+		.byte	13,13,13,13,10,10,10,10,11,11,11,11,10,10,10,10
+		.byte	13,13,13,13,10,10,10,10,11,11,11,11,10,10,10,10
+		.byte	14,14,14,14,10,10,10,10,11,11,11,11,10,10,10,10
+		.byte	14,14,14,14,10,10,10,10,11,11,11,11,10,10,10,10
+		.byte	13,13,13,13,10,10,10,10,11,11,11,11,10,10,10,10
+		.byte	13,13,13,13,10,10,10,10,11,11,11,11,10,10,10,10
+		.byte	15,15,15,15,10,10,10,10,11,11,11,11,10,10,10,10
+		.byte	15,15,15,15,10,10,10,10,11,11,11,11,10,10,10,10
+		.byte	13,13,13,13,10,10,10,10,11,11,11,11,10,10,10,10
+		.byte	13,13,13,13,10,10,10,10,11,11,11,11,10,10,10,10
+		.byte	15,15,15,15,10,10,10,10,11,11,11,11,10,10,10,10
+		.byte	15,15,15,15,10,10,10,10,11,11,11,11,10,10,10,10
+		.byte	13,13,13,13,10,10,10,10,11,11,11,11,10,10,10,10
+		.byte	13,13,13,13,10,10,10,10,11,11,11,11,10,10,10,10
+#if 0
+@ ----------------------------------------------------------------------------------------------
+@
+@ This is where I wish that the ARM would tell you which address aborted.
+@
+
+data_do:	ldr	r5, [r0]		@ Get instruction
+		tst	r5, #1<<20		@ Check to see if it is a write instruction
+		orreq	r2, r2, #0x20		@ Indicate write instruction
+		tst	r5, #1 << 26		@ Check LDMSTM/LDRSTRLDCSTC
+		bne	data_ldrstrldcstc	@ If set, then it is not LDMSTM
+
+		mov	r6, #1 << 15
+		mov	r7, #0
+data_ldmstm_cr:	tst	r5, r6			@ Check this register
+		addne	r7, r7, #4		@ If set, then another register
+		movs	r6, r6, lsr#1
+		bne	data_ldmstm_cr
+		eor	r1, r5, r5, lsl#2
+		tst	r1, #1<<23		@ Check inc/dec bit ^ writeback
+		rsbeq	r7, r7, #0
+		mov	r4, r5, lsr#(16-2)	@ Get base register
+		and	r4, r4, #15*4		@ Mask out register
+		ldr	r0, [r3, r4]		@ Get reg
+		add	r7, r0, r7		@ Do correction (signed)
+		moveq	r1, r0
+		moveq	r0, r7
+		movne	r1, r7
+		tst	r5, #1<<21
+		strne	r7, [r3, r4]
+		teq	r4, #15*4		@ CHECK FOR PC
+		biceq	r1, r1, #0xfc000003
+		biceq	r0, r0, #0xfc000003
+		orr	r2, r2, #0x200
+		b	_do_dataabort
+
+data_ldrstrldcstc:
+		mov	r6, r5, lsr#(16-2)	@ Get Rn
+		and	r6, r6, #15*4		@ Mask out register
+		teq	r6, #15*4		@ CHECK FOR PC
+		ldr	r6, [r3, r6]		@ Get register
+		biceq	r6, r6, #0xfc000003
+		tst	r5, #1 << 24		@ Check index type bit
+		beq	ldrstrpost		@ Post indexing?
+		tst	r5, #1 << 27		@ Get LDRSTR/LDCSTC bit
+		bne	instrldcstc		@ If set, do LDC/STC instruction
+		tst	r5, #1 << 25		@ Check immediate bit
+		bne	ldrstrregval		@ Register is specified
+		mov	r1, #0xff
+		orr	r1, r1, #0xf00
+		and	r7, r5, r1
+ldrstrsubadd:
+		tst	r5, #1 << 23
+		addne	r1, r6, r7
+		movne	r0, r6
+		moveq	r1, r6			@ Set higher address same
+		subeq	r0, r6, r7		@ Apply correction
+		orr	r2, r2, #0x300
+		b	_do_dataabort
+
+ldrstrpost:	mov	r0, r6
+		mov	r1, r0			@ Set higher address same
+		tst	r5, #1 << 21
+		bicne	r2, r2, #3		@ If T bit is set, force user mode
+		orr	r2, r2, #0x400
+		b	_do_dataabort
+
+ldrstrregval:	and	r7, r5,#15
+		teq	r7, #15			@ CHECK FOR PC
+		ldr	r7, [r3, r7, lsl#2]	@ Get Rm
+		biceq	r7, r7, #0xfc000003
+		and	r8, r5, #0x60		@ Get shift types
+		mov	r9, r5, lsr#7
+		and	r9, r9, #31		@ Get shift amount
+		teq	r8, #0			@ LSL shift
+		moveq	r7, r7, lsl r9
+		teq	r8, #0x20		@ LSR shift
+		moveq	r7, r7, lsr r9
+		teq	r8, #0x40		@ ASR shift
+		moveq	r7, r7, asr r9
+		teq	r8, #0x60		@ ROR shift
+		moveq	r7, r7, ror r9
+		tst	r5, #1 << 23
+		addne	r0, r6, r7
+		subeq	r0, r6, r7		@ Apply correction
+		mov	r1, r0
+		orr	r2, r2, #0x500
+		b	_do_dataabort
+
+instrldcstc:	and	r7, r5, #255		@ Get offset
+		orr	r2, r2, #0x600
+		B	ldrstrsubadd
+#endif
+/*
+ *================================================================================================
+ * All exits to user mode from the kernel go through this code.
+ */
+
+LC6:
+		.word	_intr_count		@ -8
+		.word	_bh_mask		@ -4
+		.word	_bh_active		@ -0
+		.word	_need_resched		@ +4
+		.word	_current		@ +8
+		.word	_init_task		@ +12
+
+reschedule:	bl	_schedule
+
+_ret_from_sys_call:
+		ldr	r4, [pc, #LC6 - . - 8]
+		ldr	r5, [r4]
+		teq	r5, #0
+		bne	ret_no_check
+		ldr	r6, [pc, #LC6 - . - 4]
+		ldr	r7, [pc, #LC6 - . - 0]
+recheck_bh:	ldr	r0, [r6]
+		ldr	r1, [r7]
+		tst	r0, r1
+		beq	no_handle_bh
+handle_bottom_half:
+		add	r0, r5, #1
+		str	r0, [r4]
+		mov	r8, pc
+		mrs	lr, cpsr_all
+		bic	lr, lr, #128
+		msr	cpsr_all, lr
+		bl	_do_bottom_half
+		teqp	r8, #0
+		str	r5, [r4]
+		b	recheck_bh
+no_handle_bh:	mrs	lr, cpsr_all
+		bic	lr, lr, #128
+		msr	cpsr_all, lr
+		ldr	r0, [pc, #LC6 - . + 4]
+		ldr	r0, [r0]
+		teq	r0, #0
+		bne	reschedule
+		ldr	r4, [pc, #LC6 - . + 8]
+		ldr	r4, [r4]
+		ldr	r0, [pc, #LC6 - . + 12]
+		teq	r4, r0
+		beq	ret_no_check
+		ldr	r0, [r4, #STATE]
+		teq	r0, #0
+		bne	reschedule
+		ldr	r0, [r4, #COUNTER]
+		teq	r0, #0
+		beq	reschedule
+		ldr	r1, [r4, #SIGNAL]
+		ldr	r0, [r4, #BLOCKED]
+		bics	r1, r1, r0
+		movne	r1, sp
+		blne	_do_signal
+ret_no_check:	mrs	lr, cpsr_all			@ disable IRQs
+		orr	lr, lr, #128
+		msr	cpsr_all, lr
+		ldr	fp, [sp, #S_PSR]		@ Get calling cpsr
+		bic	fp, fp, #192 | 15
+		orr	fp, fp, #16			@ Force USER mode, IRQs+FIQs on
+		msr	spsr_all, fp
+		ldmia	sp, {r0 - lr}^			@ Get calling r0 - lr
+		mov	r0, r0
+		add	sp, sp, #S_PC
+		ldr	lr, [sp], #12			@ Get PC and jump over PC, PSR, OLD_R0
+		movs	pc, lr
+
+_arm3_flushcache:
+		mcr	15, 0, r0, c1, c0		@ flush cache
+		movs	pc, lr
+
+_fpnull:	mov	pc, lr
+
+		.data
+
+		.global	_fp_enter
+		.global	_fp_save
+		.global	_fp_restore
+
+_fp_enter:	.word	_fpundefinstr
+_fp_save:	.word	_fpnull
+_fp_restore:	.word	_fpnull
+
+_temp_irq:	.word	0				@ saved lr_irq
+		.word	0				@ saved spsr_irq
+
+_temp_und:	.word	0				@ Saved lr_und
+		.word	0				@ Saved spsr_und
+
+_temp_abt:	.word	0				@ Saved lr_abt
+		.word	0				@ Saved spsr_abt
diff -urN linux.store/linux/arch/arm/lib/traps.S linux/arch/arm/lib/traps.S
--- linux.store/linux/arch/arm/lib/traps.S	Sun Mar  3 13:18:51 1996
+++ linux/arch/arm/lib/traps.S	Thu Mar 28 10:32:04 1996
@@ -23,6 +23,8 @@
 
 #include <asm/assembler.h>
 #include <asm/errno.h>
+#include <asm/hardware.h>
+
 		.text
 
 @ Offsets into task structure
@@ -46,10 +48,6 @@
 #define BAD_ADDREXCPTN	2
 #define BAD_IRQ		3
 
-@ Address of start of IOC
-@
-#define IOC		0x03200000
-
 @ Number of syscalls accepted
 @
 #define NSYS_CALL	142
@@ -145,10 +143,10 @@
 		bic	r4, r4, #0xff000000		@ mask off swi op code
 		eor	r4, r4, #OS_NUMBER << 20	@ check OS number
 		tst	r4, #0x00f00000
-		bne	bad
-retry:		cmp	r4, #NSYS_CALL			@ check upper syscall limit
-		bcs	swi_bad_call
-		bl	_arm3_flushcache
+		bne	Lbad
+Lretry:		cmp	r4, #NSYS_CALL			@ check upper syscall limit
+		bcs	Lswi_bad_call
+		bl	_armcache_flush
 
 		ldr	r5, [pc, #LC1 - . - 8]
 		ldr	r5, [r5]
@@ -157,7 +155,7 @@
 
 		ldr	ip, [r5, #FLAGS]		@ check for syscall tracing
 		tst	ip, #PF_TRACESYS
-		bne	trace_this_syscall
+		bne	Ltrace_this_syscall
 
 		ldr	ip, [pc, #LC2 - . - 8]
 		mov	r9, sp				@ hack for routines needing > 4 values
@@ -168,10 +166,10 @@
 		rsbs	ip, ip, #0
 		movne	r0, ip
 		streq	r0, [sp, #0]			@ returned r0
-		bl	_arm3_flushcache
+		bl	_armcache_flush
 		b	_ret_from_sys_call
 
-trace_this_syscall:
+Ltrace_this_syscall:
 		ldr	r7, [sp, #S_IP]
 		mov	r0, #0
 		str	r0, [sp, #S_IP]
@@ -193,21 +191,21 @@
 		str	r0, [sp, #S_IP]
 		bl	_syscall_trace			@ trace exit [IP must != 0]
 		str	r7, [sp, #S_IP]
-		bl	_arm3_flushcache
+		bl	_armcache_flush
 		b	_ret_from_sys_call
 
 
-swi_bad_call:	cmp	r4, #(KSWI_SYS_BASE - KSWI_BASE)@ check for arm private syscalls
-		bcs	arm_sys_call
+Lswi_bad_call:	cmp	r4, #(KSWI_SYS_BASE - KSWI_BASE)@ check for arm private syscalls
+		bcs	Larm_sys_call
 		bl	_sys_ni_syscall
 		str	r0, [sp, #0]			@ returned r0
 		b	_ret_from_sys_call
 
-bad:		bl	_deferred
+Lbad:		bl	_deferred
 		ldmfd	sp, {r0 - r3}
-		b	retry
+		b	Lretry
 
-arm_sys_call:	bic	r0, r4, #0x000f0000
+Larm_sys_call:	bic	r0, r4, #0x000f0000
 		mov	r1, sp
 		bl	_arm_syscall
 		b	_ret_from_sys_call
@@ -368,7 +366,7 @@
 
 fiqmsg:		.ascii	"*** Unexpeced FIQ\n\0"
 
-_unexp_fiq:	mov	r12, #IOC
+_unexp_fiq:	mov	r12, #IOC_BASE
 		strb	r12, [r12, #0x38]	@ Disable FIQ register
 		teqp	pc, #0x0c000003
 		mov	r0, r0
@@ -383,7 +381,7 @@
 		.global	_trap_init
 _trap_init:	stmfd	sp !,{r4 - r9,lr}	@ Save link register
 		teqp	pc, #0x0c000003
-		mov	r0, #IOC
+		mov	r0, #IOC_BASE
 		str	r0, [r0, #0x18]
 		str	r0, [r0, #0x28]
 		str	r0, [r0, #0x38]
@@ -407,7 +405,7 @@
 		ldmfd	sp!, {r4 - r9, pc}^
 
 LC4:
-		.word	_irq_temp
+		.word	Lirq_temp
 LC5:
 		.word	_irqjump
 
@@ -426,7 +424,7 @@
 		ldr	lr, [pc, #LC4 - . - 8]
 		ldr	lr, [lr]
 		USER_SAVE_ALL
-urepeat:	mov	r4, #IOC			@ point at IOC
+urepeat:	mov	r4, #IOC_BASE		@ point at IOC
 		ldrb	r1, [r4, #0x24]		@ get high priority first
 		adr	r2, irq_prio_h
 		teq	r1, #0
@@ -458,7 +456,7 @@
                 and	r2, lr, #3
 		teq	r2, #3
 		bne	irq_illegal_mode
-srepeat:	mov	r4, #IOC		@ point at IOC
+srepeat:	mov	r4, #IOC_BASE		@ point at IOC
 		ldrb	r1, [r4, #0x24]		@ get high priority first
 		adr	r2, irq_prio_h
 		teq	r1, #0
@@ -582,14 +580,15 @@
 		tst	r5, #1<<20		@ Check to see if it is a write instruction
 		orreq	r2, r2, #0x20		@ Indicate write instruction
 		tst	r5, #1 << 26		@ Check LDMSTM/LDRSTRLDCSTC
-		bne	data_ldrstrldcstc	@ If set, then it is not LDMSTM
+		bne	Ldata_ldrstrldcstc	@ If set, then it is not LDMSTM
 
 		mov	r6, #1 << 15
 		mov	r7, #0
-data_ldmstm_cr:	tst	r5, r6			@ Check this register
+Ldata_ldmstm_cr:
+		tst	r5, r6			@ Check this register
 		addne	r7, r7, #4		@ If set, then another register
 		movs	r6, r6, lsr#1
-		bne	data_ldmstm_cr
+		bne	Ldata_ldmstm_cr
 		eor	r1, r5, r5, lsl#2
 		tst	r1, #1<<23		@ Check inc/dec bit ^ writeback
 		rsbeq	r7, r7, #0
@@ -608,22 +607,22 @@
 		orr	r2, r2, #0x200
 		b	_do_dataabort
 
-data_ldrstrldcstc:
+Ldata_ldrstrldcstc:
 		mov	r6, r5, lsr#(16-2)	@ Get Rn
 		and	r6, r6, #15*4		@ Mask out register
 		teq	r6, #15*4		@ CHECK FOR PC
 		ldr	r6, [r3, r6]		@ Get register
 		biceq	r6, r6, #0xfc000003
 		tst	r5, #1 << 24		@ Check index type bit
-		beq	ldrstrpost		@ Post indexing?
+		beq	Lldrstrpost		@ Post indexing?
 		tst	r5, #1 << 27		@ Get LDRSTR/LDCSTC bit
-		bne	instrldcstc		@ If set, do LDC/STC instruction
+		bne	Linstrldcstc		@ If set, do LDC/STC instruction
 		tst	r5, #1 << 25		@ Check immediate bit
-		bne	ldrstrregval		@ Register is specified
+		bne	Lldrstrregval		@ Register is specified
 		mov	r1, #0xff
 		orr	r1, r1, #0xf00
 		and	r7, r5, r1
-ldrstrsubadd:
+Lldrstrsubadd:
 		tst	r5, #1 << 23
 		addne	r1, r6, r7
 		movne	r0, r6
@@ -632,14 +631,14 @@
 		orr	r2, r2, #0x300
 		b	_do_dataabort
 
-ldrstrpost:	mov	r0, r6
+Lldrstrpost:	mov	r0, r6
 		mov	r1, r0			@ Set higher address same
 		tst	r5, #1 << 21
 		bicne	r2, r2, #3		@ If T bit is set, force user mode
 		orr	r2, r2, #0x400
 		b	_do_dataabort
 
-ldrstrregval:	and	r7, r5,#15
+Lldrstrregval:	and	r7, r5,#15
 		teq	r7, #15			@ CHECK FOR PC
 		ldr	r7, [r3, r7, lsl#2]	@ Get Rm
 		biceq	r7, r7, #0xfc000003
@@ -661,9 +660,9 @@
 		orr	r2, r2, #0x500
 		b	_do_dataabort
 
-instrldcstc:	and	r7, r5, #255		@ Get offset
+Linstrldcstc:	and	r7, r5, #255		@ Get offset
 		orr	r2, r2, #0x600
-		B	ldrstrsubadd
+		B	Lldrstrsubadd
 
 @ ===============================================================================
 @
@@ -678,20 +677,20 @@
 		.word	_current		@ +8
 		.word	_init_task		@ +12
 
-reschedule:	bl	_schedule
+Lreschedule:	bl	_schedule
 
 _ret_from_sys_call:
 		ldr	r4, [pc, #LC6 - . - 8]
 		ldr	r5, [r4]
 		teq	r5, #0
-		bne	ret_no_check
+		bne	Lret_no_check
 		ldr	r6, [pc, #LC6 - . - 4]
 		ldr	r7, [pc, #LC6 - . - 0]
-recheck_bh:	ldr	r0, [r6]
+Lrecheck_bh:	ldr	r0, [r6]
 		ldr	r1, [r7]
 		tst	r0, r1
-		beq	no_handle_bh
-handle_bottom_half:
+		beq	Lno_handle_bh
+Lhandle_bottom_half:
 		add	r0, r5, #1
 		str	r0, [r4]
 		mov	r8, pc
@@ -699,32 +698,32 @@
 		bl	_do_bottom_half
 		teqp	r8, #0
 		str	r5, [r4]
-		b	recheck_bh
-no_handle_bh:	teqp	pc, #0x00000003
+		b	Lrecheck_bh
+Lno_handle_bh:	teqp	pc, #0x00000003
 		ldr	r0, [pc, #LC6 - . + 4]
 		ldr	r0, [r0]
 		teq	r0, #0
-		bne	reschedule
+		bne	Lreschedule
 		ldr	r4, [pc, #LC6 - . + 8]
 		ldr	r4, [r4]
 		ldr	r0, [pc, #LC6 - . + 12]
 		teq	r4, r0
-		beq	ret_no_check
+		beq	Lret_no_check
 		ldr	r0, [r4, #STATE]
 		teq	r0, #0
-		bne	reschedule
+		bne	Lreschedule
 		ldr	r0, [r4, #COUNTER]
 		teq	r0, #0
-		beq	reschedule
+		beq	Lreschedule
 		ldr	r1, [r4, #SIGNAL]
 		ldr	r0, [r4, #BLOCKED]
 		bics	r1, r1, r0
 		movne	r1, sp
 		blne	_do_signal
-ret_no_check:	USER_RESTORE_ALL
+Lret_no_check:	USER_RESTORE_ALL
 
-		.global	_arm3_flushcache
-_arm3_flushcache:
+		.global	_armcache_flush
+_armcache_flush:
 		mcr	15, 0, r0, c1, c0	@ flush cache
 		movs	pc, lr
 
@@ -737,5 +736,5 @@
 _fp_save:	.word	_fpnull
 _fp_restore:	.word	_fpnull
 
-_irq_temp:	.word	0
+Lirq_temp:	.word	0
 
diff -urN linux.store/linux/changed linux/changed
--- linux.store/linux/changed	Thu Jan  1 01:00:00 1970
+++ linux/changed	Thu Mar 28 15:08:28 1996
@@ -0,0 +1,12 @@
+./arch/arm/drivers/block/fd1772.c.orig
+./arch/arm/drivers/block/hdsrch.c.orig
+./arch/arm/drivers/block/mfmhd.c.orig
+./arch/arm/drivers/block/blk.h.orig
+./arch/arm/drivers/char/console.c.orig
+./arch/arm/kernel/oldlatches.c.orig
+./arch/arm/kernel/dma.c.orig
+./arch/arm/lib/mfm.S.orig
+./arch/arm/lib/Makefile.orig
+./include/asm-arm/arch-arc/oldlatches.h.orig
+./include/asm-arm/arch-arc/system.h.orig
+./README.arm.orig
diff -urN linux.store/linux/drivers/char/conmakehash.c linux/drivers/char/conmakehash.c
--- linux.store/linux/drivers/char/conmakehash.c	Sat Feb 10 23:28:16 1996
+++ linux/drivers/char/conmakehash.c	Thu Mar 28 14:17:04 1996
@@ -286,7 +286,7 @@
          }
        printf("0x%04x", unitable[fp0][nent++]);
        if ( i == nuni-1 )
-         printf("\n};");
+         printf("\n};\n");
        else if ( i % 8 == 7 )
          printf(",\n\t");
        else
diff -urN linux.store/linux/include/asm-arm/arch-a5k/hardware.h linux/include/asm-arm/arch-a5k/hardware.h
--- linux.store/linux/include/asm-arm/arch-a5k/hardware.h	Thu Jan  1 01:00:00 1970
+++ linux/include/asm-arm/arch-a5k/hardware.h	Fri Mar 22 23:44:12 1996
@@ -0,0 +1,57 @@
+/*
+ * linux/include/asm-arm/arch-a5k/hardware.h
+ *
+ * Copyright (C) 1996 Russell King.
+ *
+ * This file contains the hardware definitions of the A5000 series machines.
+ */
+
+#ifndef __ASM_ARCH_HARDWARE_H
+#define __ASM_ARCH_HARDWARE_H
+
+/*
+ * What hardware must be present
+ */
+#define HAS_IOC
+#define HAS_PCIO
+#define HAS_MEMC1A
+/*
+ * Optional hardware
+ */
+#define HAS_EXPMASK
+
+#ifndef __ASSEMBLER__
+
+/*
+ * IO definitions
+ */
+#define IOCECIO_BASE		0x03240000
+#define EXPMASK_BASE		((volatile unsigned char *)0x03360000)
+#define IOEB_BASE		((volatile unsigned char *)0x03350050)
+#define IOC_BASE		((volatile unsigned char *)0x03200000)
+#define PCIO_FLOPPYDMABASE	((volatile unsigned char *)0x0302a000)
+#define PCIO_BASE		((volatile unsigned char *)0x03010000)
+#define MEMCECIO_BASE		0x03000000
+
+#else
+
+#define IOEB_BASE		0x03350050
+#define IOC_BASE		0x03200000
+#define PCIO_FLOPPYDMABASE	0x0302a000
+#define PCIO_BASE		0x03010000
+
+#endif
+
+/*
+ * RAM definitions
+ */
+#define GET_MEMORY_PHYSICAL	(0x02000000)
+#define GET_MEMORY_START	((unsigned long)&_end - 0x01800000 + KERNEL_BASE)
+#define GET_MEMORY_END(ps,np)	(GET_MEMORY_PHYSICAL + (ps) * (np))
+
+#define SCREEN_BASE		GET_MEMORY_PHYSICAL
+#define PARAMS_BASE		(GET_MEMORY_PHYSICAL + 0x7c000)
+#define KERNEL_BASE		(GET_MEMORY_PHYSICAL + 0x80000)
+
+#endif
+
diff -urN linux.store/linux/include/asm-arm/arch-a5k/shmparam.h linux/include/asm-arm/arch-a5k/shmparam.h
--- linux.store/linux/include/asm-arm/arch-a5k/shmparam.h	Thu Jan  1 01:00:00 1970
+++ linux/include/asm-arm/arch-a5k/shmparam.h	Thu Mar 28 11:30:58 1996
@@ -0,0 +1,5 @@
+/*
+ * linux/include/asm-arm/arch-a5k/shmparam.h
+ *
+ * Copyright (c) 1996 Russell King.
+ */
diff -urN linux.store/linux/include/asm-arm/arch-a5k/system.h linux/include/asm-arm/arch-a5k/system.h
--- linux.store/linux/include/asm-arm/arch-a5k/system.h	Thu Jan  1 01:00:00 1970
+++ linux/include/asm-arm/arch-a5k/system.h	Thu Mar 28 11:31:27 1996
@@ -0,0 +1,6 @@
+/*
+ * linux/include/asm-arm/arch-a5k/system.h
+ *
+ * Copyright (c) 1996 Russell King
+ */
+
diff -urN linux.store/linux/include/asm-arm/arch-arc/hardware.h linux/include/asm-arm/arch-arc/hardware.h
--- linux.store/linux/include/asm-arm/arch-arc/hardware.h	Thu Jan  1 01:00:00 1970
+++ linux/include/asm-arm/arch-arc/hardware.h	Fri Mar 22 22:32:41 1996
@@ -0,0 +1,47 @@
+/*
+ * linux/include/asm-arm/arch-a5k/hardware.h
+ *
+ * Copyright (C) 1996 Russell King.
+ *
+ * This file contains the hardware definitions of the A5000 series machines.
+ */
+
+#ifndef __ASM_ARCH_HARDWARE_H
+#define __ASM_ARCH_HARDWARE_H
+
+#define HAS_IOC
+#define HAS_MEMC1A
+#define HAS_PCIO
+
+#ifndef ASSEMBLER
+
+/*
+ * IO definitions
+ */
+#define IOEB_BASE		((volatile unsigned char *)0x03350050)
+#define IOC_BASE		((volatile unsigned char *)0x03200000)
+#define PCIO_FLOPPYDMABASE	((volatile unsigned char *)0x0302a000)
+#define PCIO_BASE		((volatile unsigned char *)0x03010000)
+
+#else
+
+#define IOEB_BASE		0x03350050
+#define IOC_BASE		0x03200000
+#define PCIO_FLOPPYDMABASE	0x0302a000
+#define PCIO_BASE		0x03010000
+
+#endif
+
+/*
+ * RAM definitions
+ */
+#define GET_MEMORY_PHYSICAL	(0x02000000)
+#define GET_MEMORY_START	((unsigned long)&_end - 0x01800000 + KERNEL_BASE)
+#define GET_MEMORY_END(ps,np)	(GET_MEMORY_PHYSICAL + (ps) * (np))
+
+#define SCREEN_BASE		GET_MEMORY_PHYSICAL
+#define PARAMS_BASE		(GET_MEMORY_PHYSICAL + 0x7c000)
+#define KERNEL_BASE		(GET_MEMORY_PHYSICAL + 0x80000)
+
+#endif
+
diff -urN linux.store/linux/include/asm-arm/arch-arc/oldlatches.h linux/include/asm-arm/arch-arc/oldlatches.h
--- linux.store/linux/include/asm-arm/arch-arc/oldlatches.h	Wed Mar 13 23:55:11 1996
+++ linux/include/asm-arm/arch-arc/oldlatches.h	Thu Mar 28 14:24:56 1996
@@ -1,5 +1,5 @@
 #ifndef _ASM_ARM_ARCHARC_OLDLATCH_H
-#define _ASN_ARM_ARCHARC_OLDLATCH_H
+#define _ASM_ARM_ARCHARC_OLDLATCH_H
 
 #define LATCHA_FDSEL0    (1<<0)
 #define LATCHA_FDSEL1    (1<<1)
diff -urN linux.store/linux/include/asm-arm/arch-arc/shmparam.h linux/include/asm-arm/arch-arc/shmparam.h
--- linux.store/linux/include/asm-arm/arch-arc/shmparam.h	Thu Jan  1 01:00:00 1970
+++ linux/include/asm-arm/arch-arc/shmparam.h	Thu Mar 28 11:45:19 1996
@@ -0,0 +1,5 @@
+/*
+ * linux/include/asm-arm/arch-arc/shmparam.h
+ *
+ * Copyright (c) 1996 Russell King.
+ */
diff -urN linux.store/linux/include/asm-arm/arch-arc/system.h linux/include/asm-arm/arch-arc/system.h
--- linux.store/linux/include/asm-arm/arch-arc/system.h	Wed Mar 13 23:55:11 1996
+++ linux/include/asm-arm/arch-arc/system.h	Thu Mar 28 14:24:56 1996
@@ -5,5 +5,7 @@
 "	mov	%0, pc\n"		\
 "	orr %0, %0, #0x0c000000\n"	\
 "	teqp	%0, #0\n"		\
-	  : "=r" (temp));
+	  : "=r" (temp)	\
+    : );	\
+  } while(0)
 
diff -urN linux.store/linux/include/asm-arm/arch-rpc/system.h linux/include/asm-arm/arch-rpc/system.h
--- linux.store/linux/include/asm-arm/arch-rpc/system.h	Thu Jan  1 01:00:00 1970
+++ linux/include/asm-arm/arch-rpc/system.h	Thu Mar 28 11:45:43 1996
@@ -0,0 +1,5 @@
+/*
+ * linux/include/asm-arm/arch-rpc/system.h
+ *
+ * Copyright (c) 1996 Russell King.
+ */
diff -urN linux.store/linux/include/asm-arm/ecard.h linux/include/asm-arm/ecard.h
--- linux.store/linux/include/asm-arm/ecard.h	Sun Feb 11 09:32:54 1996
+++ linux/include/asm-arm/ecard.h	Fri Mar 22 23:20:03 1996
@@ -64,7 +64,7 @@
 	struct ex_ecld ecld;
 	unsigned char irq;
 	unsigned char fiq;
-	unsigned char unused1;
+	unsigned char slot_no;
 	unsigned char unused2;
 	unsigned char *r_loader; /* loader program */
 	volatile unsigned char *r_podaddr;
@@ -97,3 +97,12 @@
  * num: (n+1)'th id to find.
  */
 extern int ecard_readchunk(struct chunk_dir *cd, struct expansion_card *ec, int id, int num);
+
+/*
+ * Obtain the address of a card
+ */
+#define ECARD_SLOW	0
+#define ECARD_MEDIUM	1
+#define ECARD_FAST	2
+#define ECARD_SYNC	3
+extern unsigned char *ecard_address (int card, int memc, int speed);
diff -urN linux.store/linux/include/asm-arm/hardware.h linux/include/asm-arm/hardware.h
--- linux.store/linux/include/asm-arm/hardware.h	Thu Jan  1 01:00:00 1970
+++ linux/include/asm-arm/hardware.h	Fri Mar 22 23:01:27 1996
@@ -0,0 +1,85 @@
+/*
+ * linux/include/asm-arm/hardware.h
+ *
+ * Copyright (C) 1996 Russell King
+ *
+ * Common hardware definitions
+ */
+
+#ifndef __ASM_HARDWARE_H
+#define __ASM_HARDWARE_H
+
+#include <asm/arch/hardware.h>
+#include <asm/proc/hardware.h>
+
+/*
+ * Use these macros to read/write the IOC.  All it does is perform the actual
+ * read/write.
+ */
+#ifdef HAS_IOC
+#ifndef ASSEMBER
+#define __IOC(offset)	(((volatile unsigned char *)IOC_BASE)[offset])
+#else
+#define __IOC(offset)	offset
+#endif
+
+#define IOC_CONTROL	__IOC(0x00)
+#define IOC_KARTTX	__IOC(0x04)
+#define IOC_KARTRX	__IOC(0x04)
+
+#define IOC_IRQSTATA	__IOC(0x10)
+#define IOC_IRQREQA	__IOC(0x14)
+#define IOC_IRQCLRA	__IOC(0x14)
+#define IOC_IRQMASKA	__IOC(0x18)
+
+#define IOC_IRQSTATB	__IOC(0x20)
+#define IOC_IRQREQB	__IOC(0x24)
+#define IOC_IRQMASKB	__IOC(0x28)
+
+#define IOC_FIQSTAT	__IOC(0x30)
+#define IOC_FIQREQ	__IOC(0x34)
+#define IOC_FIQMASK	__IOC(0x38)
+
+#define IOC_T0CNTL	__IOC(0x40)
+#define IOC_T0LTCHL	__IOC(0x40)
+#define IOC_T0CNTH	__IOC(0x44)
+#define IOC_T0LTCHH	__IOC(0x44)
+#define IOC_T0GO	__IOC(0x48)
+#define IOC_T0LATCH	__IOC(0x4c)
+
+#define IOC_T1CNTL	__IOC(0x50)
+#define IOC_T1LTCHL	__IOC(0x50)
+#define IOC_T1CNTH	__IOC(0x54)
+#define IOC_T1LTCHH	__IOC(0x54)
+#define IOC_T1GO	__IOC(0x58)
+#define IOC_T1LATCH	__IOC(0x5c)
+
+#define IOC_T2CNTL	__IOC(0x60)
+#define IOC_T2LTCHL	__IOC(0x60)
+#define IOC_T2CNTH	__IOC(0x64)
+#define IOC_T2LTCHH	__IOC(0x64)
+#define IOC_T2GO	__IOC(0x68)
+#define IOC_T2LATCH	__IOC(0x6c)
+
+#define IOC_T3CNTL	__IOC(0x70)
+#define IOC_T3LTCHL	__IOC(0x70)
+#define IOC_T3CNTH	__IOC(0x74)
+#define IOC_T3LTCHH	__IOC(0x74)
+#define IOC_T3GO	__IOC(0x78)
+#define IOC_T3LATCH	__IOC(0x7c)
+
+#endif
+
+#ifdef HAS_EXPMASK
+#ifndef ASSEMBER
+#define __EXPMASK(offset)	(((volatile unsigned char *)EXPMASK_BASE)[offset])
+#else
+#define __EXPMASK(offset)	offset
+#endif
+
+#define	EXPMASK_STATUS	__EXPMASK(0x00)
+#define EXPMASK_ENABLE	__EXPMASK(0x04)
+
+#endif
+
+#endif
diff -urN linux.store/linux/include/asm-arm/proc-arm2/hardware.h linux/include/asm-arm/proc-arm2/hardware.h
--- linux.store/linux/include/asm-arm/proc-arm2/hardware.h	Thu Jan  1 01:00:00 1970
+++ linux/include/asm-arm/proc-arm2/hardware.h	Fri Mar 22 22:39:08 1996
@@ -0,0 +1,15 @@
+/*
+ * linux/include/asm-arm/proc-arm2/hardware.h
+ *
+ * Copyright (C) 1996 Russell King
+ */
+
+#ifndef __ASM_PROC_HARDWARE_H
+#define __ASM_PROC_HARDWARE_H
+
+/*
+ * No cache setup required
+ */
+#define cache_setup(x)
+
+#endif
diff -urN linux.store/linux/include/asm-arm/proc-arm250/assembler.h linux/include/asm-arm/proc-arm250/assembler.h
--- linux.store/linux/include/asm-arm/proc-arm250/assembler.h	Thu Jan  1 01:00:00 1970
+++ linux/include/asm-arm/proc-arm250/assembler.h	Sun Feb 11 09:32:54 1996
@@ -0,0 +1,52 @@
+/*
+ * linux/asm-arm/proc-arm3/assembler.h
+ *
+ * This file contains arm architecture specific defines
+ * for the different processors
+ */
+
+/*
+ * LOADREGS: multiple register load (ldm) with pc in register list
+ *		(takes account of ARM6 not using ^)
+ *
+ * RETINSTR: return instruction: adds the 's' in at the end of the
+ *		instruction if this is not an ARM6
+ *
+ * SAVEIRQS: save IRQ state (not required on ARM2/ARM3 - done
+ *		implicitly
+ *
+ * RESTOREIRQS: restore IRQ state (not required on ARM2/ARM3 - done
+ *		implicitly with ldm ... ^ or movs.
+ *
+ * These next two need thinking about - can't easily use stack... (see system.S)
+ * DISABLEIRQS: disable IRQS in SVC mode
+ *
+ * ENABLEIRQS: enable IRQS in SVC mode
+ *
+ * USERMODE: switch to USER mode
+ *
+ * SVCMODE: switch to SVC mode
+ */
+
+#define LOADREGS(cond, base, reglist...)\
+	ldm##cond	base,reglist^
+
+#define RETINSTR(instr, regs...)\
+	instr##s	regs
+
+#define MODENOP
+
+#define SAVEIRQS
+#define RESTOREIRQS
+
+#define DISABLEIRQS\
+	teqp	pc, #0x08000003
+
+#define ENABLEIRQS\
+	teqp	pc, #0x00000003
+
+#define USERMODE\
+	teqp	pc, #0x00000000
+
+#define SVCMODE\
+	teqp	pc, #0x00000003
diff -urN linux.store/linux/include/asm-arm/proc-arm250/bugs.h linux/include/asm-arm/proc-arm250/bugs.h
--- linux.store/linux/include/asm-arm/proc-arm250/bugs.h	Thu Jan  1 01:00:00 1970
+++ linux/include/asm-arm/proc-arm250/bugs.h	Sun Feb 11 09:32:54 1996
@@ -0,0 +1,17 @@
+/*
+ *  include/asm-arm/bugs.h
+ *
+ *  Copyright (C) 1995  Russell King
+ */
+
+/*
+ * This is included by init/main.c to check for architecture-dependent bugs.
+ *
+ * Needs:
+ *      void check_bugs(void);
+ */
+         
+static inline void check_bugs(void)
+{
+}
+
diff -urN linux.store/linux/include/asm-arm/proc-arm250/hardware.h linux/include/asm-arm/proc-arm250/hardware.h
--- linux.store/linux/include/asm-arm/proc-arm250/hardware.h	Thu Jan  1 01:00:00 1970
+++ linux/include/asm-arm/proc-arm250/hardware.h	Fri Mar 22 23:43:01 1996
@@ -0,0 +1,36 @@
+/*
+ * linux/include/asm-arm/proc-arm3/hardware.h
+ *
+ * Copyright (C) 1996 Russell King
+ */
+
+#ifndef __ASM_PROC_HARDWARE_H
+#define __ASM_PROC_HARDWARE_H
+
+#include <asm/procinfo.h>
+
+#ifndef __ASSEMBLER__
+/*
+ * Need to setup cache on ARM3, but not the ARM250
+ */
+extern __inline__ void cache_setup (int features)
+{
+    if (features & F_CACHE) {
+	__asm__ __volatile__("
+	mcr	15, 0, %0, c3, c0
+	mcr	15, 0, %1, c4, c0
+	mcr	15, 0, %2, c5, c0
+	mcr	15, 0, %3, c1, c0
+	mcr	15, 0, %3, c2, c0
+	" : : "r" (0x000e7fff), "r" (0x000e7fff), "r" (0xf0000000), "r" (3));
+    } else {
+    	extern unsigned long armcache_flush[2];
+
+    	armcache_flush[0] = armcache_flush[1];
+    }
+}
+
+#endif
+
+#endif
+
diff -urN linux.store/linux/include/asm-arm/proc-arm250/page.h linux/include/asm-arm/proc-arm250/page.h
--- linux.store/linux/include/asm-arm/proc-arm250/page.h	Thu Jan  1 01:00:00 1970
+++ linux/include/asm-arm/proc-arm250/page.h	Wed Mar 13 22:26:56 1996
@@ -0,0 +1,105 @@
+/*
+ * linux/include/asm-arm/proc-arm3/page.h
+ *
+ * Copyright (C) 1995, 1996 Russell King
+ */
+
+#ifndef __ASM_PROC_PAGE_H
+#define __ASM_PROC_PAGE_H
+
+#include <linux/config.h>
+
+/* PAGE_SHIFT determines the page size */
+#define PAGE_SHIFT	15
+
+#define LOGICAL_END	0x02000000
+
+#define PAGE_SIZE       (1UL << PAGE_SHIFT)
+#define PAGE_MASK       (~(PAGE_SIZE-1))
+
+#ifdef __KERNEL__
+
+#define CONFIG_STRICT_MM_TYPECHECKS
+
+#ifdef CONFIG_STRICT_MM_TYPECHECKS
+/*
+ * These are used to make use of C type-checking..
+ */
+typedef struct { unsigned long pte; } pte_t;
+typedef struct { unsigned long pmd; } pmd_t;
+typedef struct { unsigned long pgd; } pgd_t;
+typedef struct { unsigned long pgprot; } pgprot_t;
+
+#define pte_val(x)      ((x).pte)
+#define pmd_val(x)      ((x).pmd)
+#define pgd_val(x)      ((x).pgd)
+#define pgprot_val(x)   ((x).pgprot)
+
+#define __pte(x)        ((pte_t) { (x) } )
+#define __pmd(x)        ((pmd_t) { (x) } )
+#define __pgd(x)        ((pgd_t) { (x) } )
+#define __pgprot(x)     ((pgprot_t) { (x) } )
+
+#else
+/*
+ * .. while these make it easier on the compiler
+ */
+typedef unsigned long pte_t;
+typedef unsigned long pmd_t;
+typedef unsigned long pgd_t;
+typedef unsigned long pgprot_t;
+
+#define pte_val(x)      (x)
+#define pmd_val(x)      (x)
+#define pgd_val(x)      (x)
+#define pgprot_val(x)   (x)
+
+#define __pte(x)        (x)
+#define __pmd(x)        (x)
+#define __pgd(x)        (x)
+#define __pgprot(x)     (x)
+
+#endif
+
+extern void remap_task (pgd_t *);
+
+/*
+ * TLB invalidation:
+ *
+ *  - invalidate() invalidates the current task TLBs
+ *  - invalidate_all() invalidates all processes TLBs
+ *  - invalidate_task(task) invalidates the specified tasks TLB's
+ *  - invalidate_page(task, vmaddr) invalidates one page
+ */
+#define invalidate() \
+	remap_task(current->mm->pgd)
+#define invalidate_all() invalidate()
+#define invalidate_task(task) \
+do { if ((task)->mm == current->mm) invalidate(); } while (0)
+#define invalidate_page(task,addr) \
+do { if ((task)->mm == current->mm) invalidate(); } while (0)
+
+/* Certain architectures need to do special things when pte's
+ * within a page table are directly modified.  Thus, the following
+ * hook is made available.
+ */
+#define set_pte(pteptr, pteval) ((*(pteptr)) = (pteval))
+
+/* to align the pointer to the (next) page boundary */
+#define PAGE_ALIGN(addr)	(((addr)+PAGE_SIZE-1)&PAGE_MASK)
+
+/* This handles the memory map.. */
+#define PAGE_OFFSET		0x02000000
+#define MAP_NR(addr)		(((unsigned long)(addr) - PAGE_OFFSET) >> PAGE_SHIFT)
+
+typedef struct {
+	unsigned count:24,
+		 age:6,
+		 dirty:1,
+		 reserved:1;
+} mem_map_t;
+
+#endif /* __KERNEL__ */
+
+#endif /* __ASM_PROC_PAGE_H */
+
diff -urN linux.store/linux/include/asm-arm/proc-arm250/param.h linux/include/asm-arm/proc-arm250/param.h
--- linux.store/linux/include/asm-arm/proc-arm250/param.h	Thu Jan  1 01:00:00 1970
+++ linux/include/asm-arm/proc-arm250/param.h	Sun Feb 11 09:32:54 1996
@@ -0,0 +1,27 @@
+/*
+ * linux/include/asm-arm/proc-arm3/param.h
+ *
+ * Copyright (C) 1995, 1996 Russell King
+ */
+
+#ifndef __ASM_PROC_PARAM_H
+#define __ASM_PROC_PARAM_H
+
+#ifndef HZ
+#define HZ 100
+#endif
+
+#define EXEC_PAGESIZE   32768
+
+#ifndef NGROUPS
+#define NGROUPS         32
+#endif
+
+#ifndef NOGROUP
+#define NOGROUP         (-1)
+#endif
+
+#define MAXHOSTNAMELEN  64      /* max length of hostname */
+
+#endif
+
diff -urN linux.store/linux/include/asm-arm/proc-arm250/pgtable.h linux/include/asm-arm/proc-arm250/pgtable.h
--- linux.store/linux/include/asm-arm/proc-arm250/pgtable.h	Thu Jan  1 01:00:00 1970
+++ linux/include/asm-arm/proc-arm250/pgtable.h	Sun Feb 11 09:32:54 1996
@@ -0,0 +1,291 @@
+/*
+ * linux/include/asm-arm/proc-arm3/pgtable.h
+ *
+ * Copyright (C) 1995, 1996 Russell King
+ */
+
+#ifndef __ASM_PROC_PGTABLE_H
+#define __ASM_PROC_PGTABLE_H
+
+/* PMD_SHIFT determines the size of the area a second-level page table can map */
+#define PMD_SHIFT       PAGE_SHIFT
+#define PMD_SIZE        (1UL << PMD_SHIFT)
+#define PMD_MASK        (~(PMD_SIZE-1))
+
+/* PGDIR_SHIFT determines what a third-level page table entry can map */
+#define PGDIR_SHIFT     PAGE_SHIFT
+#define PGDIR_SIZE      (1UL << PGDIR_SHIFT)
+#define PGDIR_MASK      (~(PGDIR_SIZE-1))
+
+/*
+ * entries per page directory level: the i386 is two-level, so
+ * we don't really have any PMD directory physically.
+ */
+#define PTRS_PER_PTE    1
+#define PTRS_PER_PMD    1
+#define PTRS_PER_PGD    1024
+
+/* Just any arbitrary offset to the start of the vmalloc VM area: the
+ * current 8MB value just means that there will be a 8MB "hole" after the
+ * physical memory until the kernel virtual memory starts.  That means that
+ * any out-of-bounds memory accesses will hopefully be caught.
+ * The vmalloc() routines leaves a hole of 4kB between each vmalloced
+ * area for the same reason. ;)
+ */
+#define VMALLOC_START	0x01A00000
+#define VMALLOC_VMADDR(x) ((unsigned long)(x))
+
+#define _PAGE_PRESENT   0x001
+#define _PAGE_RW        0x002
+#define _PAGE_USER      0x004
+#define _PAGE_PCD       0x010
+#define _PAGE_ACCESSED  0x020
+#define _PAGE_DIRTY     0x040
+#define _PAGE_COW       0x200   /* implemented in software (one of the AVL bits) */
+
+#define _PAGE_TABLE     (_PAGE_PRESENT | _PAGE_RW | _PAGE_USER | _PAGE_ACCESSED | _PAGE_DIRTY)
+#define _PAGE_CHG_MASK  (PAGE_MASK | _PAGE_ACCESSED | _PAGE_DIRTY)
+
+#define PAGE_NONE       __pgprot(_PAGE_PRESENT | _PAGE_ACCESSED)
+#define PAGE_SHARED     __pgprot(_PAGE_PRESENT | _PAGE_RW | _PAGE_USER | _PAGE_ACCESSED)
+#define PAGE_COPY       __pgprot(_PAGE_PRESENT | _PAGE_USER | _PAGE_ACCESSED | _PAGE_COW)
+#define PAGE_READONLY   __pgprot(_PAGE_PRESENT | _PAGE_USER | _PAGE_ACCESSED)
+#define PAGE_KERNEL     __pgprot(_PAGE_PRESENT | _PAGE_RW | _PAGE_DIRTY | _PAGE_ACCESSED)
+
+/*
+ * The i386 can't do page protection for execute, and considers that the same are read.
+ * Also, write permissions imply read permissions. This is the closest we can get..
+ */
+#define __P000  PAGE_NONE
+#define __P001  PAGE_READONLY
+#define __P010  PAGE_COPY
+#define __P011  PAGE_COPY
+#define __P100  PAGE_READONLY
+#define __P101  PAGE_READONLY
+#define __P110  PAGE_COPY
+#define __P111  PAGE_COPY
+
+#define __S000  PAGE_NONE
+#define __S001  PAGE_READONLY
+#define __S010  PAGE_SHARED
+#define __S011  PAGE_SHARED
+#define __S100  PAGE_READONLY
+#define __S101  PAGE_READONLY
+#define __S110  PAGE_SHARED
+#define __S111  PAGE_SHARED
+
+/*
+ * Define this if things work differently on a i386 and a i486:
+ * it will (on a i486) warn about kernel memory accesses that are
+ * done without a 'verify_area(VERIFY_WRITE,..)'
+ */
+#undef CONFIG_TEST_VERIFY_AREA
+
+#ifndef not_yet_checked
+/* page table for 0-4MB for everybody */
+extern unsigned long pg0[1024];
+#endif
+
+/*
+ * BAD_PAGE is used for a bogus page.
+ *
+ * ZERO_PAGE is a global shared page that is always zero: used
+ * for zero-mapped memory areas etc..
+ */
+extern pte_t __bad_page(void);
+extern unsigned long __zero_page(void);
+
+#define BAD_PAGE __bad_page()
+#define ZERO_PAGE __zero_page()
+
+/* number of bits that fit into a memory pointer */
+#define BITS_PER_PTR                    (8*sizeof(unsigned long))
+
+/* to align the pointer to a pointer address */
+#define PTR_MASK                        (~(sizeof(void*)-1))
+
+/* sizeof(void*)==1<<SIZEOF_PTR_LOG2 */
+/* 64-bit machines, beware!  SRB. */
+#define SIZEOF_PTR_LOG2                 2
+
+/* to set the page-dir */
+#define SET_PAGE_DIR(tsk,pgdir) \
+do { \
+	if ((tsk) == current) \
+		remap_task((pgdir)); \
+} while (0)
+
+extern unsigned long physical_start;
+extern unsigned long physical_end;
+
+extern inline int pte_none(pte_t pte)           { return !pte_val(pte); }
+extern inline int pte_present(pte_t pte)        { return pte_val(pte) & _PAGE_PRESENT; }
+extern inline int pte_inuse(pte_t *ptep)        { return mem_map[MAP_NR(ptep)].reserved || mem_map[MAP_NR(ptep)].count != 1; }
+extern inline void pte_clear(pte_t *ptep)       { pte_val(*ptep) = 0; }
+extern inline void pte_reuse(pte_t * ptep)
+{
+	if (!mem_map[MAP_NR(ptep)].reserved)
+		mem_map[MAP_NR(ptep)].count++;
+}
+
+extern inline int pmd_none(pmd_t pmd)           { return 0; }
+extern inline int pmd_bad(pmd_t pmd)            { return 0; }
+extern inline int pmd_present(pmd_t pmd)        { return 1; }
+extern inline int pmd_inuse(pmd_t *pmdp)        { return 0; }
+extern inline void pmd_clear(pmd_t * pmdp)      { }
+extern inline void pmd_reuse(pmd_t * pmdp)      { }
+
+
+/*
+ * The "pgd_xxx()" functions here are trivial for a folded two-level
+ * setup: the pgd is never bad, and a pmd always exists (as it's folded
+ * into the pgd entry)
+ */
+extern inline int pgd_none(pgd_t pgd)           { return 0; }
+extern inline int pgd_bad(pgd_t pgd)            { return 0; }
+extern inline int pgd_present(pgd_t pgd)        { return 1; }
+extern inline int pgd_inuse(pgd_t * pgdp)       { return 0; }
+extern inline void pgd_clear(pgd_t * pgdp)      { }
+
+/*
+ * The following only work if pte_present() is true.
+ * Undefined behaviour if not..
+ */
+extern inline int pte_read(pte_t pte)           { return pte_val(pte) & _PAGE_USER; }
+extern inline int pte_write(pte_t pte)          { return pte_val(pte) & _PAGE_RW; }
+extern inline int pte_exec(pte_t pte)           { return pte_val(pte) & _PAGE_USER; }
+extern inline int pte_dirty(pte_t pte)          { return pte_val(pte) & _PAGE_DIRTY; }
+extern inline int pte_young(pte_t pte)          { return pte_val(pte) & _PAGE_ACCESSED; }
+extern inline int pte_cow(pte_t pte)            { return pte_val(pte) & _PAGE_COW; }
+
+extern inline pte_t pte_wrprotect(pte_t pte)    { pte_val(pte) &= ~_PAGE_RW; return pte; }
+extern inline pte_t pte_rdprotect(pte_t pte)    { pte_val(pte) &= ~_PAGE_USER; return pte; }
+extern inline pte_t pte_exprotect(pte_t pte)    { pte_val(pte) &= ~_PAGE_USER; return pte; }
+extern inline pte_t pte_mkclean(pte_t pte)      { pte_val(pte) &= ~_PAGE_DIRTY; return pte; }
+extern inline pte_t pte_mkold(pte_t pte)        { pte_val(pte) &= ~_PAGE_ACCESSED; return pte; }
+extern inline pte_t pte_uncow(pte_t pte)        { pte_val(pte) &= ~_PAGE_COW; return pte; }
+extern inline pte_t pte_mkwrite(pte_t pte)      { pte_val(pte) |= _PAGE_RW; return pte; }
+extern inline pte_t pte_mkread(pte_t pte)       { pte_val(pte) |= _PAGE_USER; return pte; }
+extern inline pte_t pte_mkexec(pte_t pte)       { pte_val(pte) |= _PAGE_USER; return pte; }
+extern inline pte_t pte_mkdirty(pte_t pte)      { pte_val(pte) |= _PAGE_DIRTY; return pte; }
+extern inline pte_t pte_mkyoung(pte_t pte)      { pte_val(pte) |= _PAGE_ACCESSED; return pte; }
+extern inline pte_t pte_mkcow(pte_t pte)        { pte_val(pte) |= _PAGE_COW; return pte; }
+
+/*
+ * Conversion functions: convert a page and protection to a page entry,
+ * and a page entry and page directory to the page they refer to.
+ */
+extern inline pte_t mk_pte(unsigned long page, pgprot_t pgprot)
+{ pte_t pte; pte_val(pte) = page | pgprot_val(pgprot); return pte; }
+
+extern inline pte_t pte_modify(pte_t pte, pgprot_t newprot)
+{ pte_val(pte) = (pte_val(pte) & _PAGE_CHG_MASK) | pgprot_val(newprot); return pte; }
+
+extern inline unsigned long pte_page(pte_t pte)
+{ return pte_val(pte) & PAGE_MASK; }
+
+extern inline unsigned long pmd_page(pmd_t pmd)
+{ return pmd_val(pmd) & PAGE_MASK; }
+
+/* to find an entry in a page-table-directory */
+extern inline pgd_t * pgd_offset(struct mm_struct * mm, unsigned long address)
+{
+        return mm->pgd + (address >> PGDIR_SHIFT);
+}
+
+/* Find an entry in the second-level page table.. */
+extern inline pmd_t * pmd_offset(pgd_t * dir, unsigned long address)
+{
+        return (pmd_t *) dir;
+}
+
+/* Find an entry in the third-level page table.. */
+extern inline pte_t * pte_offset(pmd_t * dir, unsigned long address)
+{
+        return (pte_t *) dir;
+}
+
+/*
+ * Allocate and free page tables. The xxx_kernel() versions are
+ * used to allocate a kernel page table - this turns on ASN bits
+ * if any, and marks the page tables reserved.
+ */
+extern inline void pte_free_kernel(pte_t * pte)
+{
+	pte_val(*pte) = 0;
+}
+
+extern inline pte_t * pte_alloc_kernel(pmd_t * pmd, unsigned long address)
+{
+	return (pte_t *) pmd;
+}
+
+/*
+ * allocating and freeing a pmd is trivial: the 1-entry pmd is
+ * inside the pgd, so has no extra memory associated with it.
+ */
+extern inline void pmd_free_kernel(pmd_t * pmd)
+{
+}
+
+extern inline pmd_t * pmd_alloc_kernel(pgd_t * pgd, unsigned long address)
+{
+        return (pmd_t *) pgd;
+}
+
+extern inline void pte_free(pte_t * pte)
+{
+}
+
+extern inline pte_t * pte_alloc(pmd_t * pmd, unsigned long address)
+{
+	return (pte_t *) pmd;
+}
+
+/*
+ * allocating and freeing a pmd is trivial: the 1-entry pmd is
+ * inside the pgd, so has no extra memory associated with it.
+ */
+extern inline void pmd_free(pmd_t * pmd)
+{
+}
+
+extern inline pmd_t * pmd_alloc(pgd_t * pgd, unsigned long address)
+{
+        return (pmd_t *) pgd;
+}
+
+extern inline void pgd_free(pgd_t * pgd)
+{
+	extern void kfree(void *);
+	kfree((void *)pgd);
+}
+
+extern inline pgd_t * pgd_alloc(void)
+{
+	pgd_t *pgd;
+	extern void *kmalloc(unsigned int, int);
+	
+        pgd = (pgd_t *) kmalloc(32*1024*1024*4/PAGE_SIZE, GFP_KERNEL);
+        memset(pgd, 0, 32*1024*1024*4/PAGE_SIZE);
+
+        return pgd;
+}
+
+extern pgd_t swapper_pg_dir[1024];
+
+/*
+ * The i386 doesn't have any external MMU info: the kernel page
+ * tables contain all the necessary information.
+ */
+extern inline void update_mmu_cache(struct vm_area_struct * vma,
+        unsigned long address, pte_t pte)
+{
+}
+
+#define SWP_TYPE(entry) (((entry) >> 1) & 0x7f)
+#define SWP_OFFSET(entry) ((entry) >> 8)
+#define SWP_ENTRY(type,offset) (((type) << 1) | ((offset) <<  8))
+
+#endif /* __ASM_PROC_PAGE_H */
+
diff -urN linux.store/linux/include/asm-arm/proc-arm250/ptrace.h linux/include/asm-arm/proc-arm250/ptrace.h
--- linux.store/linux/include/asm-arm/proc-arm250/ptrace.h	Thu Jan  1 01:00:00 1970
+++ linux/include/asm-arm/proc-arm250/ptrace.h	Sun Feb 11 09:32:54 1996
@@ -0,0 +1,14 @@
+/*
+ * linux/include/asm-arm/proc-arm3/ptrace.h
+ *
+ * Copyright (C) 1996 Russell King
+ */
+
+#ifndef __ASM_PROC_PTRACE_H
+#define __ASM_PROC_PTRACE_H
+
+#define user_mode(regs)			(((regs)->ARM_pc & 3) == 0)
+#define instruction_pointer(regs)	((regs)->ARM_pc & 0x03fffffc)
+
+#endif
+
diff -urN linux.store/linux/include/asm-arm/proc-arm250/segment.h linux/include/asm-arm/proc-arm250/segment.h
--- linux.store/linux/include/asm-arm/proc-arm250/segment.h	Thu Jan  1 01:00:00 1970
+++ linux/include/asm-arm/proc-arm250/segment.h	Sun Feb 11 09:32:54 1996
@@ -0,0 +1,121 @@
+/*
+ * linux/include/asm-arm/proc-arm3/segment.h
+ *
+ * Copyright (C) 1996 Russell King
+ */
+
+#ifndef __ASM_PROC_SEGMENT_H
+#define __ASM_PROC_SEGMENT_H
+
+static inline void __put_user(unsigned long x, void * y, int size)
+{
+	if (IS_USER_SEG) {
+		switch (size) {
+			case 1:
+				__asm__(
+				" strbt	%0, [%1]\n"
+				: : "r" (x), "r" (y)
+				: "lr", "cc");
+				break;
+			case 2:
+				{ register unsigned long tmp;
+				__asm__ __volatile__(
+				" strbt %1, [%2], #1\n"
+				" mov   %0, %1, lsr #8\n"
+				" strbt %0, [%2]\n"
+				: "=&r" (tmp)
+				: "r" (x), "r" (y)
+				: "2", "lr", "cc");
+				}
+				break;
+			case 4:
+				if ((int)y & 3) {
+				register unsigned long tmp;
+				__asm__ __volatile__(
+				" strbt %1, [%2], #1\n"
+				" mov   %0, %1, lsr #8\n"
+				" strbt %0, [%2], #1\n"
+				" mov   %0, %0, lsr #8\n"
+				" strbt %0, [%2], #1\n"
+				" mov   %0, %0, lsr #8\n"
+				" strbt %0, [%2]\n"
+				: "=&r" (tmp)
+				: "r" (x), "r" (y)
+				: "2", "lr", "cc");
+				} else {
+				__asm__(
+				" strt  %0, [%1]\n"
+				: : "r" (x), "r" (y)
+				: "lr", "cc");
+				}
+				break;
+			default:
+				bad_user_access_length();
+		}
+	} else {
+		switch (size) {
+			case 1: *(unsigned char *)y = x; break;
+			case 2: *(unsigned short *)y = x; break;
+			case 4: *(unsigned long *)y = x; break;
+			default:
+				bad_user_access_length();
+		}
+	}
+}
+
+static inline unsigned long __get_user(const void *y, int size)
+{
+	unsigned long result1, result2;
+
+	if (IS_USER_SEG) {
+		switch (size) {
+			case 1:
+				__asm__(
+				" ldrbt %0, [%1]\n"
+				: "=r" (result1)
+				: "r" (y)
+				: "lr", "cc");
+				return result1;
+			case 2:
+				__asm__(
+				" ldrbt %0, [%2], #1\n"
+				" ldrbt %1, [%2]\n"
+				" orr   %0, %0, %1, lsl #8\n"
+				: "=&r" (result1), "=r" (result2)
+				: "r" (y)
+				: "lr", "cc");
+				return result1;
+			case 4:
+				if ((int)y & 3) {
+				__asm__(
+				" ldrt %0, [%2], #4\n"
+				" ldrt %1, [%2]\n"
+				: "=&r" (result1), "=r" (result2)
+				: "r" ((int)y & ~3)
+				: "lr", "cc");
+				result1 >>= ((int)y & 3)*8;
+				return result1 | (result2 << (32-((int)y & 3)*8));
+				} else {
+				__asm__(
+				" ldrt %0, [%1]\n"
+				: "=r" (result1)
+				: "r" (y)
+				: "lr", "cc");
+				return result1;
+				}
+			default:
+				return bad_user_access_length();
+		}
+	} else {
+		switch (size) {
+			case 1: return *(unsigned char *)y; break;
+			case 2: return *(unsigned short *)y; break;
+			case 4: return *(unsigned long *)y; break;
+			default:
+				return bad_user_access_length();
+		}
+	}
+}		
+
+#endif /* __ASM_PROC_SEGMENT_H */
+
diff -urN linux.store/linux/include/asm-arm/proc-arm250/shmparam.h linux/include/asm-arm/proc-arm250/shmparam.h
--- linux.store/linux/include/asm-arm/proc-arm250/shmparam.h	Thu Jan  1 01:00:00 1970
+++ linux/include/asm-arm/proc-arm250/shmparam.h	Sun Feb 11 09:32:54 1996
@@ -0,0 +1,18 @@
+/*
+ * linux/include/asm-arm/proc-arm3/shmparam.h
+ *
+ * Copyright (C) 1996 Russell King
+ *
+ * definitions for the shared process memory on the ARM3
+ */
+
+#ifndef __ASM_PROC_SHMPARAM_H
+#define __ASM_PROC_SHMPARAM_H
+ 
+#ifndef SHM_RANGE_START
+#define SHM_RANGE_START	0x00a00000
+#define SHM_RANGE_END	0x00c00000
+#endif
+
+#endif
+
diff -urN linux.store/linux/include/asm-arm/proc-arm250/system.h linux/include/asm-arm/proc-arm250/system.h
--- linux.store/linux/include/asm-arm/proc-arm250/system.h	Thu Jan  1 01:00:00 1970
+++ linux/include/asm-arm/proc-arm250/system.h	Sun Feb 11 09:32:54 1996
@@ -0,0 +1,124 @@
+/*
+ * linux/include/asm-arm/proc-arm3/system.h
+ *
+ * Copyright (C) 1995, 1996 Russell King
+ */
+
+#ifndef __ASM_PROC_SYSTEM_H
+#define __ASM_PROC_SYSTEM_H
+
+static inline unsigned long __xchg(unsigned long x, volatile void *ptr, int size)
+{
+	switch (size) {
+		case 1:
+			__asm__ __volatile__(
+			" swpb   %0, %1, [%2]\n\t"
+			: "=r" (x)
+			: "r" (x), "r" (ptr)
+			: "memory");
+			break;
+		case 2: { unsigned long temp0, temp1;
+			if (((long)ptr) & 1)
+			{
+				void *pc;
+				__asm__("mov\t%0, pc": "=r" (pc));
+				arm_malalignedptr("xchg", pc, ptr);
+			}
+			__asm__ __volatile__(
+			" mov   %0, pc\n"
+			" orr   %1, %0, #0x08000000\n"
+			" teqp  %1, #0\n"
+			" mov   %1, %3\n"
+			" ldr	%2, [%4]\n"
+			" strb  %1, [%4]\n"
+			" mov   %1, %1, lsr #8\n"
+			" strb  %1, [%4, #1]\n"
+			" teqp  %0, #0\n"
+			: "=r" (temp0), "=r" (temp1), "=r" (x)
+			: "r" (x), "r" (ptr)
+			: "memory");
+			x &= 0xffff;
+			break;
+			}
+		case 4: if (((long)ptr) & 3)
+			{
+				void *pc;
+				__asm__("mov\t%0, pc": "=r" (pc));
+				arm_malalignedptr("xchg", pc, ptr);
+			}
+			__asm__ __volatile__(
+			" swp   %0, %1, [%2]\n"
+			: "=r" (x)
+			: "r" (x), "r" (ptr)
+			: "memory");
+			break;
+		default:
+			{
+				void *pc;
+				__asm__("mov\t%0, pc": "=r" (pc));
+				arm_invalidptr("xchg", pc, size);
+				x = 0;
+			}
+	}
+	return x;
+}
+
+/*
+ * A couple of speedups for the ARM
+ */
+#define save_flags_cli(x)		\
+	do {				\
+	  unsigned long temp;		\
+	  __asm__ __volatile__(		\
+"	mov	%0, pc\n"		\
+"	orr	%1, %0, #0x08000000\n"	\
+"	and	%0, %0, #0x0c000000\n"	\
+"	teqp	%1, #0\n"		\
+	  : "=r" (x), "=r" (temp));	\
+	} while (0)
+	
+
+#define sti()				\
+	do {				\
+	  unsigned long temp;		\
+	  __asm__ __volatile__(		\
+"	mov	%0, pc\n"		\
+"	bic	%0, %0, #0x08000000\n"	\
+"	teqp	%0, #0\n"		\
+	  : "=r" (temp)			\
+	  : );				\
+	} while(0)
+
+#define cli()				\
+	do {				\
+	  unsigned long temp;		\
+	  __asm__ __volatile__(		\
+"	mov	%0, pc\n"		\
+"	orr	%0, %0, #0x08000000\n"	\
+"	teqp	%0, #0\n"		\
+	  : "=r" (temp)			\
+	  : );				\
+	} while(0)
+
+#define save_flags(x)			\
+	do {				\
+	  __asm__ __volatile__(		\
+"	mov	%0, pc\n"		\
+"	and	%0, %0, #0x0c000000\n"	\
+	  : "=r" (x) : );		\
+	} while (0)
+
+#define restore_flags(x)		\
+	do {				\
+	  unsigned long temp;		\
+	  __asm__ __volatile__(		\
+"	mov	%0, pc\n"		\
+"	bic	%0, %0, #0x0c000000\n"	\
+"	orr	%0, %0, %1\n"		\
+"	teqp	%0, #0\n"		\
+	  : "=r" (temp)			\
+	  : "r" (x)			\
+	  : "cc");			\
+	} while (0)
+
+#endif
diff -urN linux.store/linux/include/asm-arm/proc-arm3/hardware.h linux/include/asm-arm/proc-arm3/hardware.h
--- linux.store/linux/include/asm-arm/proc-arm3/hardware.h	Thu Jan  1 01:00:00 1970
+++ linux/include/asm-arm/proc-arm3/hardware.h	Fri Mar 22 23:43:01 1996
@@ -0,0 +1,36 @@
+/*
+ * linux/include/asm-arm/proc-arm3/hardware.h
+ *
+ * Copyright (C) 1996 Russell King
+ */
+
+#ifndef __ASM_PROC_HARDWARE_H
+#define __ASM_PROC_HARDWARE_H
+
+#include <asm/procinfo.h>
+
+#ifndef __ASSEMBLER__
+/*
+ * Need to setup cache on ARM3, but not the ARM250
+ */
+extern __inline__ void cache_setup (int features)
+{
+    if (features & F_CACHE) {
+	__asm__ __volatile__("
+	mcr	15, 0, %0, c3, c0
+	mcr	15, 0, %1, c4, c0
+	mcr	15, 0, %2, c5, c0
+	mcr	15, 0, %3, c1, c0
+	mcr	15, 0, %3, c2, c0
+	" : : "r" (0x000e7fff), "r" (0x000e7fff), "r" (0xf0000000), "r" (3));
+    } else {
+    	extern unsigned long armcache_flush[2];
+
+    	armcache_flush[0] = armcache_flush[1];
+    }
+}
+
+#endif
+
+#endif
+
diff -urN linux.store/linux/include/asm-arm/proc-arm6/bugs.h linux/include/asm-arm/proc-arm6/bugs.h
--- linux.store/linux/include/asm-arm/proc-arm6/bugs.h	Thu Jan  1 01:00:00 1970
+++ linux/include/asm-arm/proc-arm6/bugs.h	Sun Mar 17 16:22:43 1996
@@ -0,0 +1,18 @@
+/*
+ *  include/asm-arm/proc-arm6/bugs.h
+ *
+ *  Copyright (C) 1995  Russell King
+ */
+
+/*
+ * This is included by init/main.c to check for architecture-dependent bugs.
+ *
+ *      void check_bugs(void);
+ * For now, it just loops indefinitely...
+ */
+         
+static inline void check_bugs(void)
+{
+while (1);
+}
+
diff -urN linux.store/linux/include/asm-arm/proc-arm6/param.h linux/include/asm-arm/proc-arm6/param.h
--- linux.store/linux/include/asm-arm/proc-arm6/param.h	Wed Mar 13 23:55:17 1996
+++ linux/include/asm-arm/proc-arm6/param.h	Sun Mar 17 15:41:52 1996
@@ -5,7 +5,7 @@
 #define HZ 100
 #endif
 
-#define EXEC_PAGESIZE   32768
+#define EXEC_PAGESIZE   4096
 
 #ifndef NGROUPS
 #define NGROUPS         32
diff -urN linux.store/linux/include/asm-arm/proc-arm6/ptrace.h linux/include/asm-arm/proc-arm6/ptrace.h
--- linux.store/linux/include/asm-arm/proc-arm6/ptrace.h	Wed Mar 13 23:55:17 1996
+++ linux/include/asm-arm/proc-arm6/ptrace.h	Sun Mar 17 15:50:10 1996
@@ -7,9 +7,22 @@
 #ifndef __ASM_PROC_PTRACE_H
 #define __ASM_PROC_PTRACE_H
 
-#error Have to modify this
-#define user_mode(regs)			(((regs)->ARM_pc & 3) == 0)
-#define instruction_pointer(regs)	((regs)->ARM_pc & 0x03fffffc)
+#define USR_MODE	0x10
+#define FIQ_MODE	0x11
+#define IRQ_MODE	0x12
+#define SVC_MODE	0x13
+#define ABT_MODE	0x17
+#define UND_MODE	0x1B
+
+#define user_mode(regs)	\
+	({ unsigned long reg;
+	__asm__ __volatile__("\
+	mrs	%0, CPSR\n\
+	and	%0, %0, #31\n\"
+	: "=r" (reg));\
+	return reg == USR_MODE; })
+	
+#define instruction_pointer(regs)	((regs)->ARM_pc)
 
 #endif
 
diff -urN linux.store/linux/include/asm-arm/proc-arm6/segment.h linux/include/asm-arm/proc-arm6/segment.h
--- linux.store/linux/include/asm-arm/proc-arm6/segment.h	Thu Jan  1 01:00:00 1970
+++ linux/include/asm-arm/proc-arm6/segment.h	Sun Mar 17 15:51:14 1996
@@ -0,0 +1,121 @@
+/*
+ * linux/include/asm-arm/proc-arm6/segment.h
+ *
+ * Copyright (C) 1996 Russell King
+ */
+
+#ifndef __ASM_PROC_SEGMENT_H
+#define __ASM_PROC_SEGMENT_H
+
+static inline void __put_user(unsigned long x, void * y, int size)
+{
+	if (IS_USER_SEG) {
+		switch (size) {
+			case 1:
+				__asm__(
+				" strbt	%0, [%1]\n"
+				: : "r" (x), "r" (y)
+				: "lr", "cc");
+				break;
+			case 2:
+				{ register unsigned long tmp;
+				__asm__ __volatile__(
+				" strbt %1, [%2], #1\n"
+				" mov   %0, %1, lsr #8\n"
+				" strbt %0, [%2]\n"
+				: "=&r" (tmp)
+				: "r" (x), "r" (y)
+				: "2", "lr", "cc");
+				}
+				break;
+			case 4:
+				if ((int)y & 3) {
+				register unsigned long tmp;
+				__asm__ __volatile__(
+				" strbt %1, [%2], #1\n"
+				" mov   %0, %1, lsr #8\n"
+				" strbt %0, [%2], #1\n"
+				" mov   %0, %0, lsr #8\n"
+				" strbt %0, [%2], #1\n"
+				" mov   %0, %0, lsr #8\n"
+				" strbt %0, [%2]\n"
+				: "=&r" (tmp)
+				: "r" (x), "r" (y)
+				: "2", "lr", "cc");
+				} else {
+				__asm__(
+				" strt  %0, [%1]\n"
+				: : "r" (x), "r" (y)
+				: "lr", "cc");
+				}
+				break;
+			default:
+				bad_user_access_length();
+		}
+	} else {
+		switch (size) {
+			case 1: *(unsigned char *)y = x; break;
+			case 2: *(unsigned short *)y = x; break;
+			case 4: *(unsigned long *)y = x; break;
+			default:
+				bad_user_access_length();
+		}
+	}
+}
+
+static inline unsigned long __get_user(const void *y, int size)
+{
+	unsigned long result1, result2;
+
+	if (IS_USER_SEG) {
+		switch (size) {
+			case 1:
+				__asm__(
+				" ldrbt %0, [%1]\n"
+				: "=r" (result1)
+				: "r" (y)
+				: "lr", "cc");
+				return result1;
+			case 2:
+				__asm__(
+				" ldrbt %0, [%2], #1\n"
+				" ldrbt %1, [%2]\n"
+				" orr   %0, %0, %1, lsl #8\n"
+				: "=&r" (result1), "=r" (result2)
+				: "r" (y)
+				: "lr", "cc");
+				return result1;
+			case 4:
+				if ((int)y & 3) {
+				__asm__(
+				" ldrt %0, [%2], #4\n"
+				" ldrt %1, [%2]\n"
+				: "=&r" (result1), "=r" (result2)
+				: "r" ((int)y & ~3)
+				: "lr", "cc");
+				result1 >>= ((int)y & 3)*8;
+				return result1 | (result2 << (32-((int)y & 3)*8));
+				} else {
+				__asm__(
+				" ldrt %0, [%1]\n"
+				: "=r" (result1)
+				: "r" (y)
+				: "lr", "cc");
+				return result1;
+				}
+			default:
+				return bad_user_access_length();
+		}
+	} else {
+		switch (size) {
+			case 1: return *(unsigned char *)y; break;
+			case 2: return *(unsigned short *)y; break;
+			case 4: return *(unsigned long *)y; break;
+			default:
+				return bad_user_access_length();
+		}
+	}
+}		
+
+#endif /* __ASM_PROC_SEGMENT_H */
+
diff -urN linux.store/linux/include/asm-arm/proc-arm6/system.h linux/include/asm-arm/proc-arm6/system.h
--- linux.store/linux/include/asm-arm/proc-arm6/system.h	Thu Jan  1 01:00:00 1970
+++ linux/include/asm-arm/proc-arm6/system.h	Sun Mar 17 16:17:05 1996
@@ -0,0 +1,139 @@
+/*
+ * linux/include/asm-arm/proc-arm6/system.h
+ *
+ * Copyright (C) 1996 Russell King
+ */
+
+#ifndef __ASM_PROC_SYSTEM_H
+#define __ASM_PROC_SYSTEM_H
+
+static inline unsigned long __xchg(unsigned long x, volatile void *ptr, int size)
+{
+	switch (size) {
+		case 1:
+			__asm__ __volatile__(
+			" swpb   %0, %1, [%2]\n\t"
+			: "=r" (x)
+			: "r" (x), "r" (ptr)
+			: "memory");
+			break;
+		case 2: { unsigned long temp0, temp1;
+			if (((long)ptr) & 1)
+			{
+				void *pc;
+				__asm__("mov\t%0, pc": "=r" (pc));
+				arm_malalignedptr("xchg", pc, ptr);
+			}
+			__asm__ __volatile__(
+			" mov   %0, pc\n"
+			" orr   %1, %0, #0x08000000\n"
+			" teqp  %1, #0\n"
+			" mov   %1, %3\n"
+			" ldr	%2, [%4]\n"
+			" strb  %1, [%4]\n"
+			" mov   %1, %1, lsr #8\n"
+			" strb  %1, [%4, #1]\n"
+			" teqp  %0, #0\n"
+			: "=r" (temp0), "=r" (temp1), "=r" (x)
+			: "r" (x), "r" (ptr)
+			: "memory");
+			x &= 0xffff;
+			break;
+			}
+		case 4: if (((long)ptr) & 3)
+			{
+				void *pc;
+				__asm__("mov\t%0, pc": "=r" (pc));
+				arm_malalignedptr("xchg", pc, ptr);
+			}
+			__asm__ __volatile__(
+			" swp   %0, %1, [%2]\n"
+			: "=r" (x)
+			: "r" (x), "r" (ptr)
+			: "memory");
+			break;
+		default:
+			{
+				void *pc;
+				__asm__("mov\t%0, pc": "=r" (pc));
+				arm_invalidptr("xchg", pc, size);
+				x = 0;
+			}
+	}
+	return x;
+}
+
+/*
+ * A couple of speedups for the ARM
+ */
+
+/*
+ * Save the current interrupt enable state & disable IRQs
+ */
+#define save_flags_cli(x)		\
+	do {				\
+	  unsigned long temp;		\
+	  __asm__ __volatile__(		\
+"	mrs	%0, CPSR\n"		\
+"	orr	%1, %0, #128\n"		\
+"	and	%0, %0, #192\n"		\
+"	msr	CPSR, %0\n"		\
+	  : "=r" (x), "=r" (temp));	\
+	} while (0)
+	
+/*
+ * Enable IRQs
+ */
+#define sti()				\
+	do {				\
+	  unsigned long temp;		\
+	  __asm__ __volatile__(		\
+"	mrs	%0, CPSR\n"		\
+"	bic	%0, %0, #128\n"		\
+"	msr	CPSR, %0\n"		\
+	  : "=r" (temp)			\
+	  : );				\
+	} while(0)
+
+/*
+ * Disable IRQs
+ */	
+#define cli()				\
+	do {				\
+	  unsigned long temp;		\
+	  __asm__ __volatile__(		\
+"	mrs	%0, CPSR\n"		\
+"	orr	%0, %0, #128\n"		\
+"	msr	CPSR, %0\n"		\
+	  : "=r" (temp)			\
+	  : );				\
+	} while(0)
+
+/*
+ * save current IRQ & FIQ state
+ */
+#define save_flags(x)			\
+	do {				\
+	  __asm__ __volatile__(		\
+"	mrs	%0, CPSR"		\
+"	and	%0, %0, #192\n"	\
+	  : "=r" (x) : );		\
+	} while (0)
+
+/*
+ * restore saved IRQ & FIQ state
+ */
+#define restore_flags(x)		\
+	do {				\
+	  unsigned long temp;		\
+	  __asm__ __volatile__(		\
+"	mrs	%0, CPSR\n"		\
+"	bic	%0, %0, #192\n"		\
+"	orr	%0, %0, %1\n"		\
+"	msr	CPSR, %0\n"		\
+	  : "=r" (temp)			\
+	  : "r" (x)			\
+	  : "cc");			\
+	} while (0)
+
+#endif
diff -urN linux.store/linux/include/asm-arm/procinfo.h linux/include/asm-arm/procinfo.h
--- linux.store/linux/include/asm-arm/procinfo.h	Thu Jan  1 01:00:00 1970
+++ linux/include/asm-arm/procinfo.h	Fri Mar 22 23:42:37 1996
@@ -0,0 +1,29 @@
+/*
+ * linux/include/asm-arm/procinfo.h
+ *
+ * Copyright (C) 1996 Russell King
+ */
+
+#ifndef __ASM_PROCINFO_H
+#define __ASM_PROCINFO_H
+
+#define F_MEMC   (1<<0)
+#define F_MMU    (1<<1)
+#define F_32BIT  (1<<2)
+#define F_CACHE  (1<<3)
+#define F_IOEB   (1<<31)
+
+#ifndef __ASSEMBLER__
+
+struct armversions {
+	unsigned long id;
+	unsigned long mask;
+	unsigned long features;
+	const char *manu;
+	const char *name;
+};
+
+#endif
+
+#endif
+
diff -urN linux.store/linux/kernel/ksyms.c linux/kernel/ksyms.c
--- linux.store/linux/kernel/ksyms.c	Sun Feb 11 09:33:02 1996
+++ linux/kernel/ksyms.c	Fri Mar 22 23:29:14 1996
@@ -536,6 +536,7 @@
 	/* expansion card support */
 	X(ecard_find),
 	X(ecard_readchunk),
+	X(ecard_address),
 	X(udelay),
 
 	/* user mem (segment) */
diff -urN linux.store/linux/mm/swap.c linux/mm/swap.c
--- linux.store/linux/mm/swap.c	Thu Feb 22 23:30:57 1996
+++ linux/mm/swap.c	Fri Mar 22 23:46:49 1996
@@ -211,17 +211,17 @@
 		kstat.pswpout++;
 #if defined(__arm__) && defined (__arm3__)
 	if (rw == WRITE) {
-		extern void arm3_flushcache (void);
+		extern void armcache_flush (void);
 		/*
 		 * Seeing as we might be swapping out some memory from
 		 * physical addresses, and it is cached, and mapped into
 		 * logical addresses and cached there as well, we *must*
-		 * flush the cache so that we read the page correctly.
+		 * flush the cache so that we write the page correctly.
 		 * No need to do this when we read, since the page has
 		 * to be put into logical mem, which requires invalidating
 		 * the memory map, which in turn flushes the cache.
 		 */
-		arm3_flushcache ();
+		armcache_flush ();
 	}
 #endif
 	
