X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs2.git;a=blobdiff_plain;f=yportenv.h;h=240b6b95a1d2f350d0fab21530af64c83d35794e;hp=aa211e7b2a505101da29e1e78ebe4a9c0a83c194;hb=394fcf7b50181f9f4bde6748f1870de94c9e0732;hpb=37fd9ec3587b5c4d497a7682522a9adfab682e51 diff --git a/yportenv.h b/yportenv.h index aa211e7..240b6b9 100644 --- a/yportenv.h +++ b/yportenv.h @@ -15,28 +15,29 @@ * * Note: Only YAFFS headers are LGPL, YAFFS C code is covered by GPL. * - * $Id: yportenv.h,v 1.5 2004-12-17 04:39:04 charles Exp $ + * $Id: yportenv.h,v 1.9 2005-10-07 02:46:50 charles Exp $ * */ - + #ifndef __YPORTENV_H__ #define __YPORTENV_H__ - #if defined CONFIG_YAFFS_WINCE #include "ywinceenv.h" #elif defined __KERNEL__ +#include "moduleconfig.h" - -// Linux kernel -#include "linux/kernel.h" -#include "linux/version.h" -#include "linux/mm.h" -#include "linux/string.h" -#include "linux/slab.h" +/* Linux kernel */ +#include +#include +#include +#include +#include +#include +#include #define YCHAR char #define YUCHAR unsigned char @@ -52,9 +53,11 @@ #define YAFFS_LOSTNFOUND_NAME "lost+found" #define YAFFS_LOSTNFOUND_PREFIX "obj" -//#define YPRINTF(x) printk x +/* #define YPRINTF(x) printk x */ #define YMALLOC(x) kmalloc(x,GFP_KERNEL) #define YFREE(x) kfree(x) +#define YMALLOC_ALT(x) vmalloc(x) +#define YFREE_ALT(x) vfree(x) #define YAFFS_ROOT_MODE 0666 #define YAFFS_LOSTNFOUND_MODE 0666 @@ -74,15 +77,14 @@ #define TSTR(x) KERN_WARNING x #define TOUT(p) printk p - #elif defined CONFIG_YAFFS_DIRECT -// Direct interface +/* Direct interface */ #include "ydirectenv.h" #elif defined CONFIG_YAFFS_UTIL -// Stuff for YAFFS utilities +/* Stuff for YAFFS utilities */ #include "stdlib.h" #include "stdio.h" @@ -92,7 +94,8 @@ #define YMALLOC(x) malloc(x) #define YFREE(x) free(x) - +#define YMALLOC_ALT(x) malloc(x) +#define YFREE_ALT(x) free(x) #define YCHAR char #define YUCHAR unsigned char @@ -105,19 +108,16 @@ #define Y_INLINE inline -//#define YINFO(s) YPRINTF(( __FILE__ " %d %s\n",__LINE__,s)) -//#define YALERT(s) YINFO(s) - +/* #define YINFO(s) YPRINTF(( __FILE__ " %d %s\n",__LINE__,s)) */ +/* #define YALERT(s) YINFO(s) */ #define TENDSTR "\n" #define TSTR(x) x #define TOUT(p) printf p - #define YAFFS_LOSTNFOUND_NAME "lost+found" #define YAFFS_LOSTNFOUND_PREFIX "obj" -//#define YPRINTF(x) printf x - +/* #define YPRINTF(x) printf x */ #define YAFFS_ROOT_MODE 0666 #define YAFFS_LOSTNFOUND_MODE 0666 @@ -126,11 +126,10 @@ #define yaffs_strcmp(a,b) strcmp(a,b) #else -// Should have specified a configuration type +/* Should have specified a configuration type */ #error Unknown configuration -#endif - +#endif extern unsigned yaffs_traceMask; @@ -152,13 +151,10 @@ extern unsigned yaffs_traceMask; #define YAFFS_TRACE_ALWAYS 0x40000000 #define YAFFS_TRACE_BUG 0x80000000 -#define T(mask,p) do{ if((mask) & (yaffs_traceMask | YAFFS_TRACE_ERROR)) TOUT(p);} while(0) - +#define T(mask,p) do{ if((mask) & (yaffs_traceMask | YAFFS_TRACE_ERROR)) TOUT(p);} while(0) #ifndef CONFIG_YAFFS_WINCE #define YBUG() T(YAFFS_TRACE_BUG,(TSTR("==>> yaffs bug: " __FILE__ " %d" TENDSTR),__LINE__)) #endif #endif - -