diff -Nru linux-2.5.74-uc0/Makefile linux-2.5.74-uc0-develer/Makefile
--- linux-2.5.74-uc0/Makefile	2003-07-03 08:39:17.000000000 +0200
+++ linux-2.5.74-uc0-develer/Makefile	2003-07-12 12:41:58.000000000 +0200
@@ -304,9 +304,10 @@
 
 -include .config.cmd
 
-ifndef CONFIG_FRAME_POINTER
-CFLAGS		+= -fomit-frame-pointer
-endif
+#bernie
+#ifndef CONFIG_FRAME_POINTER
+#CFLAGS		+= -fomit-frame-pointer
+#endif
 
 #
 # INSTALL_PATH specifies where to place the updated kernel and system map
diff -Nru linux-2.5.74-uc0/arch/m68knommu/Kconfig linux-2.5.74-uc0-develer/arch/m68knommu/Kconfig
--- linux-2.5.74-uc0/arch/m68knommu/Kconfig	2003-07-03 08:39:17.000000000 +0200
+++ linux-2.5.74-uc0-develer/arch/m68knommu/Kconfig	2003-07-03 09:37:22.000000000 +0200
@@ -288,6 +288,29 @@
 	help
 	  Support for the Motorola M5282C3 board.
 
+config DEVELER_AMR
+	bool "ISC/Develer AMR board support"
+	depends on M5272
+	help
+	  Support for the ISC/Develer AMR board.
+
+config DEVELER_CDB4
+	bool "AEP/Develer CDB4 board support"
+	depends on M5272
+	help
+	  Support for the AEP/Develer CDB4 board.
+
+config DEVELER_SEAC
+	bool "SEAC/Develer SC board support"
+	depends on M5272
+	help
+	  Support for the SEAC/Develer SC board.
+
+config DEVELER
+	bool
+	default y
+	depends on (DEVELER_AMR || DEVELER_CDB4 || DEVELER_SEAC)
+
 config ARN5307
 	bool "Arnewsh 5307 board support"
 	depends on M5307
diff -Nru linux-2.5.74-uc0/arch/m68knommu/Makefile linux-2.5.74-uc0-develer/arch/m68knommu/Makefile
--- linux-2.5.74-uc0/arch/m68knommu/Makefile	2003-07-02 22:51:08.000000000 +0200
+++ linux-2.5.74-uc0-develer/arch/m68knommu/Makefile	2003-07-03 09:37:22.000000000 +0200
@@ -28,6 +28,7 @@
 board-$(CONFIG_DRAGEN2)		:= de2
 board-$(CONFIG_ARNEWSH)		:= ARNEWSH
 board-$(CONFIG_MOTOROLA)	:= MOTOROLA
+board-$(CONFIG_DEVELER)		:= MOTOROLA
 board-$(CONFIG_ELITE)		:= eLITE
 board-$(CONFIG_eLIA)		:= eLIA
 board-$(CONFIG_NETtel)		:= NETtel
diff -Nru linux-2.5.74-uc0/arch/m68knommu/vmlinux.lds.S linux-2.5.74-uc0-develer/arch/m68knommu/vmlinux.lds.S
--- linux-2.5.74-uc0/arch/m68knommu/vmlinux.lds.S	2003-07-03 08:39:17.000000000 +0200
+++ linux-2.5.74-uc0-develer/arch/m68knommu/vmlinux.lds.S	2003-07-03 09:37:22.000000000 +0200
@@ -128,6 +128,15 @@
 #endif
 
 /*
+ *	Develer boards are similar to M5272C3, but we can grab some
+ *	more RAM because we're using colilo instead of dBUG.
+ */
+#if defined(CONFIG_DEVELER)
+#define	RAM_START	0x400
+#define	RAM_LENGTH	0x3ffc00
+#endif
+
+/*
  *	These flash boot boards use all of ram for operation. Again the
  *	actual memory size is not important here, assume at least 4MiB.
  *	They currently have no support for running in flash.
diff -Nru linux-2.5.74-uc0/drivers/mtd/chips/Kconfig linux-2.5.74-uc0-develer/drivers/mtd/chips/Kconfig
--- linux-2.5.74-uc0/drivers/mtd/chips/Kconfig	2003-07-02 22:44:00.000000000 +0200
+++ linux-2.5.74-uc0-develer/drivers/mtd/chips/Kconfig	2003-07-03 09:37:22.000000000 +0200
@@ -168,6 +168,17 @@
 	  sets which a CFI-compliant chip may claim to implement. This code
 	  provides support for one of those command sets.
 
+config MTD_CFI_BLOCKERASE
+	bool "Use BLOCK ERASE command"
+	depends on MTD_CFI_AMDSTD
+	default n
+	help
+	  Some flash chips such as the SST S71145, have two different erase
+	  commands, one for sectors (4KB) and one for blocks (64KB). Using
+	  larger erase units might be faster and reduce memory usage of JFFS2
+	  for such chips. Note that the chip mapping must be adjusted to
+	  reflect this change.
+
 config MTD_RAM
 	tristate "Support for RAM chips in bus mapping"
 	depends on MTD
diff -Nru linux-2.5.74-uc0/drivers/mtd/chips/cfi_cmdset_0002.c linux-2.5.74-uc0-develer/drivers/mtd/chips/cfi_cmdset_0002.c
--- linux-2.5.74-uc0/drivers/mtd/chips/cfi_cmdset_0002.c	2003-07-02 22:46:45.000000000 +0200
+++ linux-2.5.74-uc0-develer/drivers/mtd/chips/cfi_cmdset_0002.c	2003-07-03 09:37:22.000000000 +0200
@@ -1035,8 +1035,12 @@
 	cfi_send_gen_cmd(0xAA, cfi->addr_unlock1, chip->start, map, cfi, CFI_DEVICETYPE_X8, NULL);
 	cfi_send_gen_cmd(0x55, cfi->addr_unlock2, chip->start, map, cfi, CFI_DEVICETYPE_X8, NULL);
 
-	cfi_write(map, CMD(0x30), adr);
-	
+#if defined(CONFIG_MTD_CFI_BLOCKERASE)
+	cfi_write(map, CMD(0x50), adr);
+#else
+ 	cfi_write(map, CMD(0x30), adr);
+#endif
+
 	timeo = jiffies + (HZ*20);
 
 	/* Wait for the end of programing/erasure by using the toggle method.
diff -Nru linux-2.5.74-uc0/drivers/mtd/chips/jedec_probe.c linux-2.5.74-uc0-develer/drivers/mtd/chips/jedec_probe.c
--- linux-2.5.74-uc0/drivers/mtd/chips/jedec_probe.c	2003-07-02 22:57:42.000000000 +0200
+++ linux-2.5.74-uc0-develer/drivers/mtd/chips/jedec_probe.c	2003-07-03 09:37:22.000000000 +0200
@@ -10,6 +10,7 @@
 #include <linux/module.h>
 #include <linux/types.h>
 #include <linux/kernel.h>
+#include <linux/init.h>
 #include <asm/io.h>
 #include <asm/byteorder.h>
 #include <linux/errno.h>
@@ -1114,6 +1115,25 @@
 		}
 	}, {
 		.mfr_id		= MANUFACTURER_SST,
+		.dev_id		= SST39LF160,
+		.name		= "SST SST39LF/VF160",
+		.DevSize	= SIZE_2MiB,
+		.CmdSet		= P_ID_AMD_STD,
+#if CONFIG_MTD_CFI_BLOCKERASE 
+		.NumEraseRegions= 1,
+		.regions = {
+			ERASEINFO(0x10000,32)
+		}
+#else
+		/* Split flash in two regions to work around 256 blocks limit */
+		.NumEraseRegions= 2,
+		.regions = {
+			ERASEINFO(0x01000,256),
+			ERASEINFO(0x01000,256)
+		} 
+#endif
+	}, {
+		.mfr_id		= MANUFACTURER_SST,
 		.dev_id		= SST49LF030A,
 		.name		= "SST 49LF030A",
  		.uaddr		= {
diff -Nru linux-2.5.74-uc0/drivers/mtd/maps/Kconfig linux-2.5.74-uc0-develer/drivers/mtd/maps/Kconfig
--- linux-2.5.74-uc0/drivers/mtd/maps/Kconfig	2003-07-02 22:57:16.000000000 +0200
+++ linux-2.5.74-uc0-develer/drivers/mtd/maps/Kconfig	2003-07-03 09:37:22.000000000 +0200
@@ -419,6 +419,15 @@
 	  This enables access to the Flash on the FortuNet board.  If you
 	  have such a board, say 'Y'.
 
+config MTD_M5272C3_JFFS2
+	tristate "CFI Flash device on Motorola M5272C3 for JFFS2 usage"
+	depends on M5272 && MTD_CFI
+	help
+	  This enables MTD access to CFI and JEDEC compatible flash devices
+	  on board designs derived from the Motorola M5272C3. The partition
+	  map is suitable for using a JFFS2 root filesystem and a bootloader
+	  such as CoLilo.
+
 config MTD_AUTCPU12
 	tristate "NV-RAM mapping AUTCPU12 board"
 	depends on ARM && ARCH_AUTCPU12
diff -Nru linux-2.5.74-uc0/drivers/mtd/maps/Makefile linux-2.5.74-uc0-develer/drivers/mtd/maps/Makefile
--- linux-2.5.74-uc0/drivers/mtd/maps/Makefile	2003-07-02 22:39:15.000000000 +0200
+++ linux-2.5.74-uc0-develer/drivers/mtd/maps/Makefile	2003-07-03 09:37:22.000000000 +0200
@@ -50,6 +50,7 @@
 obj-$(CONFIG_MTD_REDWOOD)	+= redwood.o
 obj-$(CONFIG_MTD_UCLINUX)	+= uclinux.o
 obj-$(CONFIG_MTD_NETtel)	+= nettel.o
+obj-$(CONFIG_MTD_M5272C3_JFFS2)	+= m5272c3_jffs2.o
 obj-$(CONFIG_MTD_SCB2_FLASH)	+= scb2_flash.o
 obj-$(CONFIG_MTD_EBONY)		+= ebony.o
 obj-$(CONFIG_MTD_BEECH)		+= beech-mtd.o
diff -Nru linux-2.5.74-uc0/drivers/mtd/maps/m5272c3_jffs2.c linux-2.5.74-uc0-develer/drivers/mtd/maps/m5272c3_jffs2.c
--- linux-2.5.74-uc0/drivers/mtd/maps/m5272c3_jffs2.c	1970-01-01 01:00:00.000000000 +0100
+++ linux-2.5.74-uc0-develer/drivers/mtd/maps/m5272c3_jffs2.c	2003-07-03 09:37:22.000000000 +0200
@@ -0,0 +1,109 @@
+/*
+ * Copyright (C) 2003 Bernardo Innocenti <bernie@develer.com>
+ *
+ * Based on physmap.c by David Woodhouse <dwmw2@infradead.org>
+ * Based on m5272c3.c
+ *
+ * MTD partition map for M5272C3 and similar boards.
+ */
+
+#include <linux/config.h>
+#include <linux/module.h>
+#include <linux/init.h>
+#include <linux/types.h>
+#include <linux/kernel.h>
+#include <linux/fs.h>
+#include <linux/major.h>
+#include <linux/root_dev.h>
+#include <linux/mtd/mtd.h>
+#include <linux/mtd/map.h>
+#include <linux/mtd/partitions.h>
+
+
+#define WINDOW_ADDR 0xffe00000
+#define WINDOW_SIZE 0x200000
+#define BUSWIDTH 2
+
+static struct mtd_info *mymtd;
+
+static struct map_info m5272c3_jffs2_map = {
+	.name = "M5272C3 flash device",
+	.size = WINDOW_SIZE,
+	.buswidth = BUSWIDTH,
+	.phys = WINDOW_ADDR
+};
+
+/*
+ * MTD 'PARTITIONING' STUFF 
+ */
+static struct mtd_partition m5272c3_jffs2_partitions[] = {
+	{
+		.name	= "boot (32K)",
+		.size	= 0x8000,
+		.offset	= 0
+	}, {
+		.name	= "kernel (480K)",
+		.size	= 0x78000,
+		.offset	= MTDPART_OFS_APPEND /* 0x8000 */
+	}, {
+		.name	= "rootfs (1536K)",
+		.size	= MTDPART_SIZ_FULL, /* 0x180000 */
+		.offset	= MTDPART_OFS_APPEND /* 0x80000 */
+	}
+};
+
+#define	NUM_PARTITIONS	(sizeof(m5272c3_jffs2_partitions) / sizeof(m5272c3_jffs2_partitions[0]))
+
+
+int __init init_m5272c3_jffs2(void)
+{
+	printk(KERN_NOTICE "m5272c3[mtd] flash device: %x at %x\n", WINDOW_SIZE, WINDOW_ADDR);
+	m5272c3_jffs2_map.virt = (unsigned long)ioremap(WINDOW_ADDR, WINDOW_SIZE);
+
+	if (!m5272c3_jffs2_map.virt) {
+		printk("Failed to ioremap\n");
+		return -EIO;
+	}
+
+	simple_map_init(&m5272c3_jffs2_map);
+
+	if (!(mymtd = do_map_probe("cfi_probe", &m5272c3_jffs2_map)))
+		mymtd = do_map_probe("jedec_probe", &m5272c3_jffs2_map);
+
+	if (mymtd) {
+		mymtd->owner = THIS_MODULE;
+
+		printk(KERN_NOTICE 
+		       "Using physmap partition definition\n");
+		add_mtd_partitions(mymtd, m5272c3_jffs2_partitions, NUM_PARTITIONS);
+
+		printk("m5272c3[mtd]: set '%s' to be root filesystem\n",
+		     	m5272c3_jffs2_partitions[2].name);
+		ROOT_DEV = MKDEV(MTD_BLOCK_MAJOR, 2);
+
+		return 0;
+	}
+
+	iounmap((void *)m5272c3_jffs2_map.virt);
+	return -ENXIO;
+}
+
+static void __exit cleanup_m5272c3_jffs2(void)
+{
+	if (mymtd) {
+		del_mtd_partitions(mymtd);
+		map_destroy(mymtd);
+	}
+	if (m5272c3_jffs2_map.map_priv_1) {
+		iounmap((void *)m5272c3_jffs2_map.map_priv_1);
+		m5272c3_jffs2_map.map_priv_1 = 0;
+	}
+}
+
+module_init(init_m5272c3_jffs2);
+module_exit(cleanup_m5272c3_jffs2);
+
+MODULE_LICENSE("GPL");
+MODULE_AUTHOR("Bernardo Innocenti <bernie@develer>");
+MODULE_DESCRIPTION("Develer MTD map driver");
+
diff -Nru linux-2.5.74-uc0/drivers/mtd/maps/physmap.c linux-2.5.74-uc0-develer/drivers/mtd/maps/physmap.c
--- linux-2.5.74-uc0/drivers/mtd/maps/physmap.c	2003-07-02 22:50:03.000000000 +0200
+++ linux-2.5.74-uc0-develer/drivers/mtd/maps/physmap.c	2003-07-03 09:37:22.000000000 +0200
@@ -23,7 +23,7 @@
 
 
 struct map_info physmap_map = {
-	.name = "Physically mapped flash",
+	.name = "physmap",
 	.size = WINDOW_SIZE,
 	.buswidth = BUSWIDTH,
 	.phys = WINDOW_ADDR,
diff -Nru linux-2.5.74-uc0/fs/Kconfig linux-2.5.74-uc0-develer/fs/Kconfig
--- linux-2.5.74-uc0/fs/Kconfig	2003-07-02 22:49:16.000000000 +0200
+++ linux-2.5.74-uc0-develer/fs/Kconfig	2003-07-03 09:37:22.000000000 +0200
@@ -1094,6 +1094,17 @@
 	  Say 'N' unless you have NAND flash and you are willing to test and
 	  develop JFFS2 support for it.
 
+config JFFS2_FS_GC_TWEAKS
+	bool "Tweak JFFS2 garbage collector for Am29PL160 flash (EXPERIMENTAL)"
+	depends on JFFS2_FS && EXPERIMENTAL
+	default n
+	help
+	  The Am29PL160 flash device used some embedded boards such as Motorola's
+	  M5272C3 EVM is a 2MB device with just 7 big blocks of 256KB.
+
+	  By enabling this option, the GC parameters will be dangerously tweaked
+	  to allow writing to a device with very few blocks.
+
 config CRAMFS
 	tristate "Compressed ROM file system support"
 	help
diff -Nru linux-2.5.74-uc0/fs/Kconfig.binfmt linux-2.5.74-uc0-develer/fs/Kconfig.binfmt
--- linux-2.5.74-uc0/fs/Kconfig.binfmt	2003-07-02 22:56:05.000000000 +0200
+++ linux-2.5.74-uc0-develer/fs/Kconfig.binfmt	2003-07-03 09:37:22.000000000 +0200
@@ -41,6 +41,12 @@
 	help
 	  Support FLAT format compressed binaries
 
+config BINFMT_SHARED_FLAT
+	bool "Enable shared FLAT support"
+	depends on BINFMT_FLAT
+	help
+	  Support FLAT shared libraries
+
 config BINFMT_AOUT
 	tristate "Kernel support for a.out and ECOFF binaries"
 	depends on (X86 && !X86_64) || ALPHA || ARM || M68K || MIPS || SPARC
diff -Nru linux-2.5.74-uc0/fs/jffs2/nodelist.h linux-2.5.74-uc0-develer/fs/jffs2/nodelist.h
--- linux-2.5.74-uc0/fs/jffs2/nodelist.h	2003-07-02 22:58:23.000000000 +0200
+++ linux-2.5.74-uc0-develer/fs/jffs2/nodelist.h	2003-07-03 09:37:22.000000000 +0200
@@ -240,6 +240,20 @@
 #define ALLOC_DELETION	1	/* Deletion node. Best to allow it */
 #define ALLOC_GC	2	/* Space requested for GC. Give it or die */
 
+
+/* Settings for Am29PL160 flash device, with big 256k blocks */
+#ifdef CONFIG_JFFS2_FS_GC_TWEAKS
+
+#define JFFS2_RESERVED_BLOCKS_BASE 1						/* Number of free blocks there must be before we... */
+#define JFFS2_RESERVED_BLOCKS_WRITE (JFFS2_RESERVED_BLOCKS_BASE + 1)		/* ... allow a normal filesystem write */
+#define JFFS2_RESERVED_BLOCKS_DELETION (JFFS2_RESERVED_BLOCKS_BASE)		/* ... allow a normal filesystem deletion */
+#define JFFS2_RESERVED_BLOCKS_GCTRIGGER (JFFS2_RESERVED_BLOCKS_BASE + 1)	/* ... wake up the GC thread */
+#define JFFS2_RESERVED_BLOCKS_GCBAD (JFFS2_RESERVED_BLOCKS_BASE)                /* ... pick a block from the bad_list to GC */
+#define JFFS2_RESERVED_BLOCKS_GCMERGE (JFFS2_RESERVED_BLOCKS_BASE)	        /* ... merge pages when garbage collecting */
+
+#else /* !CONFIG_JFFS2_FS_GC_TWEAKS */
+
+/* Sane settings */
 #define JFFS2_RESERVED_BLOCKS_BASE 3						/* Number of free blocks there must be before we... */
 #define JFFS2_RESERVED_BLOCKS_WRITE (JFFS2_RESERVED_BLOCKS_BASE + 2)		/* ... allow a normal filesystem write */
 #define JFFS2_RESERVED_BLOCKS_DELETION (JFFS2_RESERVED_BLOCKS_BASE)		/* ... allow a normal filesystem deletion */
@@ -247,6 +261,8 @@
 #define JFFS2_RESERVED_BLOCKS_GCBAD (JFFS2_RESERVED_BLOCKS_BASE + 1)		/* ... pick a block from the bad_list to GC */
 #define JFFS2_RESERVED_BLOCKS_GCMERGE (JFFS2_RESERVED_BLOCKS_BASE)		/* ... merge pages when garbage collecting */
 
+#endif /* !CONFIG_JFFS2_FS_GC_TWEAKS */
+
 
 /* How much dirty space before it goes on the very_dirty_list */
 #define VERYDIRTY(c, size) ((size) >= ((c)->sector_size / 2))
diff -Nru linux-2.5.74-uc0/include/asm-alpha/div64.h linux-2.5.74-uc0-develer/include/asm-alpha/div64.h
--- linux-2.5.74-uc0/include/asm-alpha/div64.h	2003-07-02 22:54:43.000000000 +0200
+++ linux-2.5.74-uc0-develer/include/asm-alpha/div64.h	2003-07-03 09:37:22.000000000 +0200
@@ -1,14 +1 @@
-#ifndef __ALPHA_DIV64
-#define __ALPHA_DIV64
-
-/*
- * Hey, we're already 64-bit, no
- * need to play games..
- */
-#define do_div(n,base) ({ \
-	int __res; \
-	__res = ((unsigned long) (n)) % (unsigned) (base); \
-	(n) = ((unsigned long) (n)) / (unsigned) (base); \
-	__res; })
-
-#endif
+#include <asm-generic/div64.h>
diff -Nru linux-2.5.74-uc0/include/asm-arm26/div64.h linux-2.5.74-uc0-develer/include/asm-arm26/div64.h
--- linux-2.5.74-uc0/include/asm-arm26/div64.h	2003-07-02 22:42:11.000000000 +0200
+++ linux-2.5.74-uc0-develer/include/asm-arm26/div64.h	2003-07-03 09:37:22.000000000 +0200
@@ -1,14 +1 @@
-#ifndef __ASM_ARM_DIV64
-#define __ASM_ARM_DIV64
-
-/* We're not 64-bit, but... */
-#define do_div(n,base)						\
-({								\
-	int __res;						\
-	__res = ((unsigned long)n) % (unsigned int)base;	\
-	n = ((unsigned long)n) / (unsigned int)base;		\
-	__res;							\
-})
-
-#endif
-
+#include <asm-generic/div64.h>
diff -Nru linux-2.5.74-uc0/include/asm-cris/div64.h linux-2.5.74-uc0-develer/include/asm-cris/div64.h
--- linux-2.5.74-uc0/include/asm-cris/div64.h	2003-07-02 22:42:06.000000000 +0200
+++ linux-2.5.74-uc0-develer/include/asm-cris/div64.h	2003-07-03 09:37:22.000000000 +0200
@@ -1,16 +1 @@
-#ifndef __ASM_CRIS_DIV64
-#define __ASM_CRIS_DIV64
-
-/* copy from asm-arm */
-
-/* We're not 64-bit, but... */
-#define do_div(n,base)						\
-({								\
-	int __res;						\
-	__res = ((unsigned long)n) % (unsigned int)base;	\
-	n = ((unsigned long)n) / (unsigned int)base;		\
-	__res;							\
-})
-
-#endif
-
+#include <asm-generic/div64.h>
diff -Nru linux-2.5.74-uc0/include/asm-generic/div64.h linux-2.5.74-uc0-develer/include/asm-generic/div64.h
--- linux-2.5.74-uc0/include/asm-generic/div64.h	2003-07-08 19:25:13.000000000 +0200
+++ linux-2.5.74-uc0-develer/include/asm-generic/div64.h	2003-07-12 14:26:19.000000000 +0200
@@ -18,6 +18,7 @@
  */
 
 #include <linux/types.h>
+#include <linux/compiler.h>
 
 #if BITS_PER_LONG == 64
 
@@ -31,11 +32,15 @@
 
 #elif BITS_PER_LONG == 32
 
-extern uint32_t __div64_32(uint64_t *dividend, uint32_t divisor) __attribute_pure__;
+extern uint32_t __div64_32(uint64_t *dividend, uint32_t divisor);
 
+/* The unnecessary pointer compare is there
+ * to check for type safety (n must be 64bit)
+ */
 # define do_div(n,base) ({				\
 	uint32_t __base = (base);			\
 	uint32_t __rem;					\
+	(void)(((typeof((n)) *)0) == ((uint64_t *)0));	\
 	if (likely(((n) >> 32) == 0)) {			\
 		__rem = (uint32_t)(n) % __base;		\
 		(n) = (uint32_t)(n) / __base;		\
diff -Nru linux-2.5.74-uc0/include/asm-h8300/div64.h linux-2.5.74-uc0-develer/include/asm-h8300/div64.h
--- linux-2.5.74-uc0/include/asm-h8300/div64.h	2003-07-02 22:39:25.000000000 +0200
+++ linux-2.5.74-uc0-develer/include/asm-h8300/div64.h	2003-07-03 09:37:22.000000000 +0200
@@ -1,13 +1 @@
-#ifndef H8300_DIV64_H
-#define H8300_DIV64_H
-
-/* n = n / base; return rem; */
-
-#define do_div(n,base) ({					\
-	int __res;						\
-	__res = ((unsigned long) n) % (unsigned) base;		\
-	n = ((unsigned long) n) / (unsigned) base;		\
-	__res;							\
-})
-
-#endif /* _H8300_DIV64_H */
+#include <asm-generic/div64.h>
diff -Nru linux-2.5.74-uc0/include/asm-ia64/div64.h linux-2.5.74-uc0-develer/include/asm-ia64/div64.h
--- linux-2.5.74-uc0/include/asm-ia64/div64.h	2003-07-02 22:58:14.000000000 +0200
+++ linux-2.5.74-uc0-develer/include/asm-ia64/div64.h	2003-07-03 09:37:22.000000000 +0200
@@ -1,20 +1 @@
-#ifndef _ASM_IA64_DIV64_H
-#define _ASM_IA64_DIV64_H
-
-/*
- * Copyright (C) 1999 Hewlett-Packard Co
- * Copyright (C) 1999 David Mosberger-Tang <davidm@hpl.hp.com>
- *
- * vsprintf uses this to divide a 64-bit integer N by a small integer BASE.
- * This is incredibly hard on IA-64...
- */
-
-#define do_div(n,base)						\
-({								\
-	int _res;						\
-	_res = ((unsigned long) (n)) % (unsigned) (base);	\
-	(n) = ((unsigned long) (n)) / (unsigned) (base);	\
-	_res;							\
-})
-
-#endif /* _ASM_IA64_DIV64_H */
+#include <asm-generic/div64.h>
diff -Nru linux-2.5.74-uc0/include/asm-m68k/div64.h linux-2.5.74-uc0-develer/include/asm-m68k/div64.h
--- linux-2.5.74-uc0/include/asm-m68k/div64.h	2003-07-02 22:55:53.000000000 +0200
+++ linux-2.5.74-uc0-develer/include/asm-m68k/div64.h	2003-07-03 09:37:22.000000000 +0200
@@ -3,7 +3,6 @@
 
 /* n = n / base; return rem; */
 
-#if 1
 #define do_div(n, base) ({					\
 	union {							\
 		unsigned long n32[2];				\
@@ -23,13 +22,5 @@
 	(n) = __n.n64;						\
 	__rem;							\
 })
-#else
-#define do_div(n,base) ({					\
-	int __res;						\
-	__res = ((unsigned long) n) % (unsigned) base;		\
-	n = ((unsigned long) n) / (unsigned) base;		\
-	__res;							\
-})
-#endif
 
 #endif /* _M68K_DIV64_H */
diff -Nru linux-2.5.74-uc0/include/asm-m68knommu/asm-offsets.h linux-2.5.74-uc0-develer/include/asm-m68knommu/asm-offsets.h
--- linux-2.5.74-uc0/include/asm-m68knommu/asm-offsets.h	2003-07-02 22:52:58.000000000 +0200
+++ linux-2.5.74-uc0-develer/include/asm-m68knommu/asm-offsets.h	2003-07-12 12:43:40.000000000 +0200
@@ -10,11 +10,12 @@
 #define TASK_STATE 0 /* offsetof(struct task_struct, state) */
 #define TASK_FLAGS 12 /* offsetof(struct task_struct, flags) */
 #define TASK_PTRACE 16 /* offsetof(struct task_struct, ptrace) */
-#define TASK_BLOCKED 922 /* offsetof(struct task_struct, blocked) */
-#define TASK_THREAD 772 /* offsetof(struct task_struct, thread) */
+#define TASK_BLOCKED 928 /* offsetof(struct task_struct, blocked) */
+#define TASK_THREAD 774 /* offsetof(struct task_struct, thread) */
 #define TASK_THREAD_INFO 4 /* offsetof(struct task_struct, thread_info) */
 #define TASK_MM 92 /* offsetof(struct task_struct, mm) */
 #define TASK_ACTIVE_MM 96 /* offsetof(struct task_struct, active_mm) */
+#define STAT_IRQ 20 /* offsetof(struct kernel_stat, irqs) */
 #define CPUSTAT_SOFTIRQ_PENDING 0 /* offsetof(irq_cpustat_t, __softirq_pending) */
 #define THREAD_KSP 0 /* offsetof(struct thread_struct, ksp) */
 #define THREAD_USP 4 /* offsetof(struct thread_struct, usp) */
@@ -38,7 +39,7 @@
 #define PT_PC 48 /* offsetof(struct pt_regs, pc) */
 #define PT_SR 46 /* offsetof(struct pt_regs, sr) */
 #define PT_VECTOR 52 /* offsetof(struct pt_regs, pc) + 4 */
-#define STAT_IRQ 5140 /* offsetof(struct kernel_stat, irqs) */
+#define STAT_IRQ 20 /* offsetof(struct kernel_stat, irqs) */
 #define SIGSEGV 11 /* SIGSEGV */
 #define SEGV_MAPERR 196609 /* SEGV_MAPERR */
 #define SIGTRAP 5 /* SIGTRAP */
diff -Nru linux-2.5.74-uc0/include/asm-m68knommu/div64.h linux-2.5.74-uc0-develer/include/asm-m68knommu/div64.h
--- linux-2.5.74-uc0/include/asm-m68knommu/div64.h	2003-07-03 10:40:36.000000000 +0200
+++ linux-2.5.74-uc0-develer/include/asm-m68knommu/div64.h	2003-07-03 09:37:22.000000000 +0200
@@ -1,13 +1 @@
-#ifndef _M68KNOMMU_DIV64_H
-#define _M68KNOMMU_DIV64_H
-
-/* n = n / base; return rem; */
-
-#define do_div(n,base) ({					\
-	int __res;						\
-	__res = ((unsigned long) n) % (unsigned) base;		\
-	n = ((unsigned long) n) / (unsigned) base;		\
-	__res;							\
-})
-
-#endif /* _M68K_DIV64_H */
+#include <asm-generic/div64.h>
diff -Nru linux-2.5.74-uc0/include/asm-m68knommu/system.h linux-2.5.74-uc0-develer/include/asm-m68knommu/system.h
--- linux-2.5.74-uc0/include/asm-m68knommu/system.h	2003-07-02 22:50:03.000000000 +0200
+++ linux-2.5.74-uc0-develer/include/asm-m68knommu/system.h	2003-07-03 09:37:22.000000000 +0200
@@ -232,7 +232,9 @@
 #endif
 
 #ifdef CONFIG_COLDFIRE
-#if defined(CONFIG_M5272) && defined(CONFIG_NETtel)
+#if defined(CONFIG_M5272)
+
+#if defined(CONFIG_NETtel)
 /*
  *	Need to account for broken early mask of 5272 silicon. So don't
  *	jump through the original start address. Jump strait into the
@@ -244,6 +246,15 @@
         jmp 0xf0000400;			\
         ");				\
 })
+#elif defined(CONFIG_DEVELER_AMR) || defined(CONFIG_DEVELER_CDB4) || defined(CONFIG_DEVELER_SEAC)
+#define HARD_RESET_NOW() ({			\
+	asm(					\
+		"movew #0x2700, %sr\n\t"	\
+		"jmp 0xffe00400\n"		\
+	);					\
+})
+#endif /* CONFIG_NETtel || CONFIG_DEVELER */
+
 #elif defined(CONFIG_NETtel) || defined(CONFIG_eLIA) || defined(CONFIG_DISKtel) || defined(CONFIG_SECUREEDGEMP3) || defined(CONFIG_CLEOPATRA)
 #define HARD_RESET_NOW() ({		\
         asm("				\
diff -Nru linux-2.5.74-uc0/include/asm-m68knommu/types.h linux-2.5.74-uc0-develer/include/asm-m68knommu/types.h
--- linux-2.5.74-uc0/include/asm-m68knommu/types.h	2003-07-02 22:41:47.000000000 +0200
+++ linux-2.5.74-uc0-develer/include/asm-m68knommu/types.h	2003-07-06 06:20:43.000000000 +0200
@@ -1,66 +1 @@
-#ifndef _M68K_TYPES_H
-#define _M68K_TYPES_H
-
-/*
- * This file is never included by application software unless
- * explicitly requested (e.g., via linux/types.h) in which case the
- * application is Linux specific so (user-) name space pollution is
- * not a major issue.  However, for interoperability, libraries still
- * need to be careful to avoid a name clashes.
- */
-
-#ifndef __ASSEMBLY__
-
-typedef unsigned short umode_t;
-
-/*
- * __xx is ok: it doesn't pollute the POSIX namespace. Use these in the
- * header files exported to user space
- */
-
-typedef __signed__ char __s8;
-typedef unsigned char __u8;
-
-typedef __signed__ short __s16;
-typedef unsigned short __u16;
-
-typedef __signed__ int __s32;
-typedef unsigned int __u32;
-
-#if defined(__GNUC__) && !defined(__STRICT_ANSI__)
-typedef __signed__ long long __s64;
-typedef unsigned long long __u64;
-#endif
-
-#endif /* __ASSEMBLY__ */
-
-/*
- * These aren't exported outside the kernel to avoid name space clashes
- */
-#ifdef __KERNEL__
-
-#define BITS_PER_LONG 32
-
-#ifndef __ASSEMBLY__
-
-typedef signed char s8;
-typedef unsigned char u8;
-
-typedef signed short s16;
-typedef unsigned short u16;
-
-typedef signed int s32;
-typedef unsigned int u32;
-
-typedef signed long long s64;
-typedef unsigned long long u64;
-
-/* Dma addresses are 32-bits wide.  */
-
-typedef u32 dma_addr_t;
-
-#endif /* __ASSEMBLY__ */
-
-#endif /* __KERNEL__ */
-
-#endif /* _M68K_TYPES_H */
+#include <asm-m68k/types.h>
diff -Nru linux-2.5.74-uc0/include/asm-mips64/div64.h linux-2.5.74-uc0-develer/include/asm-mips64/div64.h
--- linux-2.5.74-uc0/include/asm-mips64/div64.h	2003-07-02 22:47:26.000000000 +0200
+++ linux-2.5.74-uc0-develer/include/asm-mips64/div64.h	2003-07-03 09:39:28.000000000 +0200
@@ -27,23 +27,6 @@
 	(res) = __quot; \
 	__mod; })
 
-/*
- * Hey, we're already 64-bit, no
- * need to play games..
- */
-#define do_div(n, base) ({ \
-	unsigned long __quot; \
-	unsigned int __mod; \
-	unsigned long __div; \
-	unsigned int __base; \
-	\
-	__div = (n); \
-	__base = (base); \
-	\
-	__mod = __div % __base; \
-	__quot = __div / __base; \
-	\
-	(n) = __quot; \
-	__mod; })
+#include <asm-generic.h>
 
 #endif /* _ASM_DIV64_H */
diff -Nru linux-2.5.74-uc0/include/asm-parisc/div64.h linux-2.5.74-uc0-develer/include/asm-parisc/div64.h
--- linux-2.5.74-uc0/include/asm-parisc/div64.h	2003-07-02 22:48:40.000000000 +0200
+++ linux-2.5.74-uc0-develer/include/asm-parisc/div64.h	2003-07-03 09:37:22.000000000 +0200
@@ -1,54 +1 @@
-#ifndef __ASM_PARISC_DIV64
-#define __ASM_PARISC_DIV64
-
-#ifdef __LP64__
-
-/*
- * Copyright (C) 1999 Hewlett-Packard Co
- * Copyright (C) 1999 David Mosberger-Tang <davidm@hpl.hp.com>
- *
- * vsprintf uses this to divide a 64-bit integer N by a small integer BASE.
- * This is incredibly hard on IA-64 and HPPA
- */
-
-#define do_div(n,base)						\
-({								\
-	int _res;						\
-	_res = ((unsigned long) (n)) % (unsigned) (base);	\
-	(n) = ((unsigned long) (n)) / (unsigned) (base);	\
-	_res;							\
-})
-
-#else
-/*
- * unsigned long long division.  Yuck Yuck!  What is Linux coming to?
- * This is 100% disgusting
- */
-#define do_div(n,base)							\
-({									\
-	unsigned long __low, __low2, __high, __rem;			\
-	__low  = (n) & 0xffffffff;					\
-	__high = (n) >> 32;						\
-	if (__high) {							\
-		__rem   = __high % (unsigned long)base;			\
-		__high  = __high / (unsigned long)base;			\
-		__low2  = __low >> 16;					\
-		__low2 += __rem << 16;					\
-		__rem   = __low2 % (unsigned long)base;			\
-		__low2  = __low2 / (unsigned long)base;			\
-		__low   = __low & 0xffff;				\
-		__low  += __rem << 16;					\
-		__rem   = __low  % (unsigned long)base;			\
-		__low   = __low  / (unsigned long)base;			\
-		n = __low  + ((long long)__low2 << 16) +		\
-			((long long) __high << 32);			\
-	} else {							\
-		__rem = __low % (unsigned long)base;			\
-		n = (__low / (unsigned long)base);			\
-	}								\
-	__rem;								\
-})
-#endif
-
-#endif
-
+#include <asm-generic/div64.h>
diff -Nru linux-2.5.74-uc0/include/asm-ppc/div64.h linux-2.5.74-uc0-develer/include/asm-ppc/div64.h
--- linux-2.5.74-uc0/include/asm-ppc/div64.h	2003-07-02 22:57:06.000000000 +0200
+++ linux-2.5.74-uc0-develer/include/asm-ppc/div64.h	2003-07-03 09:37:22.000000000 +0200
@@ -1,23 +1 @@
-#ifndef __PPC_DIV64
-#define __PPC_DIV64
-
-#include <linux/types.h>
-
-extern u32 __div64_32(u64 *dividend, u32 div);
-
-#define do_div(n, div)	({			\
-	u64 __n = (n);				\
-	u32 __d = (div);			\
-	u32 __q, __r;				\
-	if ((__n >> 32) == 0) {			\
-		__q = (u32)__n / __d;		\
-		__r = (u32)__n - __q * __d;	\
-		(n) = __q;			\
-	} else {				\
-		__r = __div64_32(&__n, __d);	\
-		(n) = __n;			\
-	}					\
-	__r;					\
-})
-
-#endif
+#include <asm-generic/div64.h>
diff -Nru linux-2.5.74-uc0/include/asm-ppc64/div64.h linux-2.5.74-uc0-develer/include/asm-ppc64/div64.h
--- linux-2.5.74-uc0/include/asm-ppc64/div64.h	2003-07-02 22:39:34.000000000 +0200
+++ linux-2.5.74-uc0-develer/include/asm-ppc64/div64.h	2003-07-03 09:37:22.000000000 +0200
@@ -1,18 +1 @@
-#ifndef __PPC_DIV64
-#define __PPC_DIV64
-
-/* Copyright 2001 PPC64 Team, IBM Corp
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License
- * as published by the Free Software Foundation; either version
- * 2 of the License, or (at your option) any later version.
- */
-
-#define do_div(n,base) ({ \
-	int __res; \
-	__res = ((unsigned long) (n)) % (unsigned) (base); \
-	(n) = ((unsigned long) (n)) / (unsigned) (base); \
-	__res; })
-
-#endif
+#include <asm-generic/div64.h>
diff -Nru linux-2.5.74-uc0/include/asm-s390/div64.h linux-2.5.74-uc0-develer/include/asm-s390/div64.h
--- linux-2.5.74-uc0/include/asm-s390/div64.h	2003-07-02 22:50:17.000000000 +0200
+++ linux-2.5.74-uc0-develer/include/asm-s390/div64.h	2003-07-03 09:37:22.000000000 +0200
@@ -43,13 +43,7 @@
 })
 
 #else /* __s390x__ */
-
-#define do_div(n,base) ({ \
-int __res; \
-__res = ((unsigned long) n) % (unsigned) base; \
-n = ((unsigned long) n) / (unsigned) base; \
-__res; })
-
+#include <asm-generic/div64.h>
 #endif /* __s390x__ */
 
 #endif
diff -Nru linux-2.5.74-uc0/include/asm-sh/div64.h linux-2.5.74-uc0-develer/include/asm-sh/div64.h
--- linux-2.5.74-uc0/include/asm-sh/div64.h	2003-07-02 22:39:36.000000000 +0200
+++ linux-2.5.74-uc0-develer/include/asm-sh/div64.h	2003-07-03 09:38:59.000000000 +0200
@@ -1,20 +1 @@
-#ifndef __ASM_SH_DIV64
-#define __ASM_SH_DIV64
-
-extern u64 __div64_32(u64 n, u32 d);
-
-#define do_div(n,base) ({ \
-u64 __n = (n), __q; \
-u32 __base = (base); \
-u32 __res; \
-if ((__n >> 32) == 0) { \
-	__res = ((unsigned long) __n) % (unsigned) __base; \
-	(n) = ((unsigned long) __n) / (unsigned) __base; \
-} else { \
-	__q = __div64_32(__n, __base); \
-	__res = __n - __q * __base; \
-	(n) = __q; \
-} \
-__res; })
-
-#endif /* __ASM_SH_DIV64 */
+#include <asm-generic/div64.h>
diff -Nru linux-2.5.74-uc0/include/asm-sparc/div64.h linux-2.5.74-uc0-develer/include/asm-sparc/div64.h
--- linux-2.5.74-uc0/include/asm-sparc/div64.h	2003-07-02 22:51:01.000000000 +0200
+++ linux-2.5.74-uc0-develer/include/asm-sparc/div64.h	2003-07-03 09:37:22.000000000 +0200
@@ -1,11 +1 @@
-#ifndef __SPARC_DIV64
-#define __SPARC_DIV64
-
-/* We're not 64-bit, but... */
-#define do_div(n,base) ({ \
-	int __res; \
-	__res = ((unsigned long) n) % (unsigned) base; \
-	n = ((unsigned long) n) / (unsigned) base; \
-	__res; })
-
-#endif /* __SPARC_DIV64 */
+#include <asm-generic/div64.h>
diff -Nru linux-2.5.74-uc0/include/asm-sparc64/div64.h linux-2.5.74-uc0-develer/include/asm-sparc64/div64.h
--- linux-2.5.74-uc0/include/asm-sparc64/div64.h	2003-07-02 22:46:06.000000000 +0200
+++ linux-2.5.74-uc0-develer/include/asm-sparc64/div64.h	2003-07-03 09:37:22.000000000 +0200
@@ -1,14 +1 @@
-#ifndef __SPARC64_DIV64
-#define __SPARC64_DIV64
-
-/*
- * Hey, we're already 64-bit, no
- * need to play games..
- */
-#define do_div(n,base) ({ \
-	int __res; \
-	__res = ((unsigned long) n) % (unsigned) base; \
-	n = ((unsigned long) n) / (unsigned) base; \
-	__res; })
-
-#endif /* __SPARC64_DIV64 */
+#include <asm-generic/div64.h>
diff -Nru linux-2.5.74-uc0/include/asm-v850/div64.h linux-2.5.74-uc0-develer/include/asm-v850/div64.h
--- linux-2.5.74-uc0/include/asm-v850/div64.h	2003-07-02 22:53:46.000000000 +0200
+++ linux-2.5.74-uc0-develer/include/asm-v850/div64.h	2003-07-03 09:37:22.000000000 +0200
@@ -1,11 +1 @@
-#ifndef __V850_DIV64_H__
-#define __V850_DIV64_H__
-
-/* We're not 64-bit, but... */
-#define do_div(n,base) ({ \
-	int __res; \
-	__res = ((unsigned long) n) % (unsigned) base; \
-	n = ((unsigned long) n) / (unsigned) base; \
-	__res; })
-
-#endif /* __V850_DIV64_H__ */
+#include <asm-generic/div64.h>
diff -Nru linux-2.5.74-uc0/include/asm-x86_64/div64.h linux-2.5.74-uc0-develer/include/asm-x86_64/div64.h
--- linux-2.5.74-uc0/include/asm-x86_64/div64.h	2003-07-02 22:54:30.000000000 +0200
+++ linux-2.5.74-uc0-develer/include/asm-x86_64/div64.h	2003-07-03 09:37:22.000000000 +0200
@@ -1,14 +1 @@
-#ifndef __X86_64_DIV64
-#define __X86_64_DIV64
-
-/*
- * Hey, we're already 64-bit, no
- * need to play games..
- */
-#define do_div(n,base) ({ \
-	int __res; \
-	__res = ((unsigned long) (n)) % (unsigned) (base); \
-	(n) = ((unsigned long) (n)) / (unsigned) (base); \
-	__res; })
-
-#endif
+#include <asm-generic/div64.h>
diff -Nru linux-2.5.74-uc0/include/linux/compiler.h linux-2.5.74-uc0-develer/include/linux/compiler.h
--- linux-2.5.74-uc0/include/linux/compiler.h	2003-07-02 22:50:12.000000000 +0200
+++ linux-2.5.74-uc0-develer/include/linux/compiler.h	2003-07-08 19:24:41.000000000 +0200
@@ -56,6 +56,24 @@
 #define __attribute_used__	__attribute__((__unused__))
 #endif
 
+/*
+ * From the GCC manual:
+ *
+ * Many functions have no effects except the return value and their
+ * return value depends only on the parameters and/or global
+ * variables.  Such a function can be subject to common subexpression
+ * elimination and loop optimization just as an arithmetic operator
+ * would be.
+ * [...]
+ * The attribute `pure' is not implemented in GCC versions earlier
+ * than 2.96.
+ */
+#if (__GNUC__ == 2 && __GNUC_MINOR >= 96) || __GNUC__ > 2
+#define __attribute_pure__	__attribute__((pure))
+#else
+#define __attribute_pure__	/* unimplemented */
+#endif
+
 /* This macro obfuscates arithmetic on a variable address so that gcc
    shouldn't recognize the original var, and make assumptions about it */
 #define RELOC_HIDE(ptr, off)					\
diff -Nru linux-2.5.74-uc0/include/linux/hfs_sysdep.h linux-2.5.74-uc0-develer/include/linux/hfs_sysdep.h
--- linux-2.5.74-uc0/include/linux/hfs_sysdep.h	2003-07-02 22:41:15.000000000 +0200
+++ linux-2.5.74-uc0-develer/include/linux/hfs_sysdep.h	2003-07-12 13:53:02.000000000 +0200
@@ -28,9 +28,6 @@
 
 extern struct timezone sys_tz;
 
-#undef offsetof
-#define offsetof(TYPE, MEMB) ((size_t) &((TYPE *)0)->MEMB)
-
 /* Typedefs for integer types by size and signedness */
 typedef __u8            hfs_u8;
 typedef __u16           hfs_u16;
diff -Nru linux-2.5.74-uc0/include/linux/sysctl.h linux-2.5.74-uc0-develer/include/linux/sysctl.h
--- linux-2.5.74-uc0/include/linux/sysctl.h	2003-07-02 22:49:05.000000000 +0200
+++ linux-2.5.74-uc0-develer/include/linux/sysctl.h	2003-07-03 09:37:22.000000000 +0200
@@ -27,6 +27,7 @@
 #include <linux/kernel.h>
 #include <linux/types.h>
 #include <linux/list.h>
+#include <linux/compiler.h>
 
 struct file;
 
diff -Nru linux-2.5.74-uc0/lib/Makefile linux-2.5.74-uc0-develer/lib/Makefile
--- linux-2.5.74-uc0/lib/Makefile	2003-07-02 22:40:29.000000000 +0200
+++ linux-2.5.74-uc0-develer/lib/Makefile	2003-07-03 09:37:22.000000000 +0200
@@ -5,7 +5,7 @@
 
 lib-y := errno.o ctype.o string.o vsprintf.o cmdline.o \
 	 bust_spinlocks.o rbtree.o radix-tree.o dump_stack.o \
-	 kobject.o idr.o
+	 kobject.o idr.o div64.o
 
 lib-$(CONFIG_RWSEM_GENERIC_SPINLOCK) += rwsem-spinlock.o
 lib-$(CONFIG_RWSEM_XCHGADD_ALGORITHM) += rwsem.o
diff -Nru linux-2.5.74-uc0/lib/div64.c linux-2.5.74-uc0-develer/lib/div64.c
--- linux-2.5.74-uc0/lib/div64.c	1970-01-01 01:00:00.000000000 +0100
+++ linux-2.5.74-uc0-develer/lib/div64.c	2003-07-06 03:10:55.000000000 +0200
@@ -0,0 +1,52 @@
+/*
+ * Copyright (C) 2003 Bernardo Innocenti <bernie@develer.com>
+ *
+ * Based on former do_div() implementation from asm-parisc/div64.h:
+ *	Copyright (C) 1999 Hewlett-Packard Co
+ *	Copyright (C) 1999 David Mosberger-Tang <davidm@hpl.hp.com>
+ *
+ *
+ * Generic C version of 64bit/32bit division and modulo, with
+ * 64bit result and 32bit remainder.
+ *
+ * The fast case for (n>>32 == 0) is handled inline by do_div(). 
+ *
+ * Code generated for this function might be very inefficient
+ * for some CPUs. __div64_32() can be overridden by linking arch-specific
+ * assembly versions such as arch/ppc/lib/div64.S and arch/sh/lib/div64.S.
+ */
+
+#include <linux/types.h>
+#include <linux/module.h>
+#include <asm/div64.h>
+
+/* Not needed on 64bit architectures */
+#if BITS_PER_LONG == 32
+
+uint32_t __div64_32(uint64_t *n, uint32_t base)
+{
+	uint32_t low, low2, high, rem;
+
+	low   = *n   & 0xffffffff;
+	high  = *n  >> 32;
+	rem   = high % (uint32_t)base;
+	high  = high / (uint32_t)base;
+	low2  = low >> 16;
+	low2 += rem << 16;
+	rem   = low2 % (uint32_t)base;
+	low2  = low2 / (uint32_t)base;
+	low   = low  & 0xffff;
+	low  += rem << 16;
+	rem   = low  % (uint32_t)base;
+	low   = low  / (uint32_t)base;
+
+	*n = low +
+		((uint64_t)low2 << 16) +
+		((uint64_t)high << 32);
+
+	return rem;
+}
+
+EXPORT_SYMBOL(__div64_32);
+
+#endif /* BITS_PER_LONG == 32 */
diff -Nru linux-2.5.74-uc0/lib/vsprintf.c linux-2.5.74-uc0-develer/lib/vsprintf.c
--- linux-2.5.74-uc0/lib/vsprintf.c	2003-07-02 22:55:16.000000000 +0200
+++ linux-2.5.74-uc0-develer/lib/vsprintf.c	2003-07-12 14:25:23.000000000 +0200
@@ -127,7 +127,7 @@
 #define SPECIAL	32		/* 0x */
 #define LARGE	64		/* use 'ABCDEF' instead of 'abcdef' */
 
-static char * number(char * buf, char * end, long long num, int base, int size, int precision, int type)
+static char * number(char * buf, char * end, unsigned long long num, int base, int size, int precision, int type)
 {
 	char c,sign,tmp[66];
 	const char *digits;
diff -Nru linux-2.5.74-uc0/mm/vmscan.c linux-2.5.74-uc0-develer/mm/vmscan.c
--- linux-2.5.74-uc0/mm/vmscan.c	2003-07-02 22:41:46.000000000 +0200
+++ linux-2.5.74-uc0-develer/mm/vmscan.c	2003-07-12 14:25:23.000000000 +0200
@@ -147,7 +147,7 @@
 
 	pages = nr_used_zone_pages();
 	list_for_each_entry(shrinker, &shrinker_list, list) {
-		long long delta;
+		uint64_t delta;
 
 		delta = scanned * shrinker->seeks;
 		delta *= (*shrinker->shrinker)(0, gfp_mask);
