diff -Naur linux-2.4.4-2002-03-21/include/linux/compiler.h linux-denx-2.4.4-20020321-edu/include/linux/compiler.h --- linux-2.4.4-2002-03-21/include/linux/compiler.h Wed Nov 21 01:36:23 2001 +++ linux-denx-2.4.4-20020321-edu/include/linux/compiler.h Thu Apr 25 19:06:10 2002 @@ -10,4 +10,9 @@ #define __builtin_expect(x, expected_value) (x) #endif +/* GANS from kernel-2.4.18 include/linux/compiler.h */ +/* GANS for cvs mtd code: fs/jffs2/erase.c */ +#define likely(x) __builtin_expect((x),1) +#define unlikely(x) __builtin_expect((x),0) + #endif /* __LINUX_COMPILER_H */ diff -Naur linux-2.4.4-2002-03-21/include/linux/completion.h linux-denx-2.4.4-20020321-edu/include/linux/completion.h --- linux-2.4.4-2002-03-21/include/linux/completion.h Thu Jan 1 01:00:00 1970 +++ linux-denx-2.4.4-20020321-edu/include/linux/completion.h Thu Apr 25 19:04:23 2002 @@ -0,0 +1,41 @@ +#ifndef _COMPLETION_H_ +#define _COMPLETION_H_ + +/* GANS +From: David Woodhouse +To: "regigao" +Cc: linux-mtd@lists.infradead.org, Steve_Chen@kingston.com +Subject: Re: JFFS compile error +Date: Fri, 21 Dec 2001 08:55:01 +0000 +Sender: linux-mtd-admin@lists.infradead.org +X-Mailer: exmh version 2.4 06/23/2000 with nmh-1.0.4 + +regigao@sinamail.com said: +> I know the completion.h is not included until kernel 2.4.8. How do I +> resolve the question ? + +Make an empty file called include/linux/completion.h and make sure you've +got the latest version from CVS of include/linux/mtd/compatmac.h, which +should define it for you. + +-- +dwmw2 +*/ +/* GANS: from mtd cvs code: linux/mtd/compatmac.h */ +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,7) +struct completion { + struct semaphore s; +}; + +#define complete(c) up(&(c)->s) +#define wait_for_completion(c) down(&(c)->s) +#define init_completion(c) init_MUTEX_LOCKED(&(c)->s); + +#endif + +#if LINUX_VERSION_CODE < KERNEL_VERSION(2,4,9) +/* This came later */ +#define complete_and_exit(c, r) do { complete(c); do_exit(r); } while(0) +#endif + +#endif /* _COMPLETION_H_ */ diff -Naur linux-2.4.4-2002-03-21/include/linux/fs.h linux-denx-2.4.4-20020321-edu/include/linux/fs.h --- linux-2.4.4-2002-03-21/include/linux/fs.h Mon Apr 30 01:15:31 2001 +++ linux-denx-2.4.4-20020321-edu/include/linux/fs.h Thu Apr 25 19:12:28 2002 @@ -296,6 +296,7 @@ #include #include #include +#include /* * Attribute flags. These should be or-ed together to figure out what @@ -461,6 +462,7 @@ struct proc_inode_info proc_i; struct socket socket_i; struct usbdev_inode_info usbdev_i; + struct jffs2_inode_info jffs2_i; void *generic_ip; } u; }; @@ -637,6 +639,7 @@ #include #include #include +#include extern struct list_head super_blocks; @@ -689,6 +692,7 @@ struct udf_sb_info udf_sb; struct ncp_sb_info ncpfs_sb; struct usbdev_sb_info usbdevfs_sb; + struct jffs2_sb_info jffs2_sb; void *generic_sbp; } u; /* diff -Naur linux-2.4.4-2002-03-21/init/main.c linux-denx-2.4.4-20020321-edu/init/main.c --- linux-2.4.4-2002-03-21/init/main.c Mon May 28 13:15:05 2001 +++ linux-denx-2.4.4-20020321-edu/init/main.c Thu Apr 25 19:00:17 2002 @@ -264,6 +264,9 @@ #ifdef CONFIG_NFTL { "nftla", 0x5d00 }, #endif +#ifdef CONFIG_MTD + { "mtdblock1" , 0x1F01 } , +#endif { NULL, 0 } }; diff -Naur linux-2.4.4-2002-03-21/lib/Makefile linux-denx-2.4.4-20020321-edu/lib/Makefile --- linux-2.4.4-2002-03-21/lib/Makefile Mon Apr 30 01:15:32 2001 +++ linux-denx-2.4.4-20020321-edu/lib/Makefile Thu Apr 11 19:20:19 2002 @@ -19,4 +19,8 @@ obj-y += dec_and_lock.o endif +#GANS: zlib pour fffs2 +obj-y += zlib_deflate/zlib_deflate.o zlib_inflate/zlib_inflate.o +subdir-y := zlib_deflate zlib_inflate + include $(TOPDIR)/Rules.make