X-Git-Url: http://www.aleph1.co.uk/gitweb/?p=yaffs2.git;a=blobdiff_plain;f=yportenv.h;h=e5e3dbe8e245326d794592c68e7fc8bea1be9b00;hp=b46b9a9367d3202f129018ac401ae90db81685da;hb=7b7ff60a62448da4850791aa986c2c19354e93f2;hpb=6f1de4473200f31d1ca1cf4672baf7afcdec2db0 diff --git a/yportenv.h b/yportenv.h index b46b9a9..e5e3dbe 100644 --- a/yportenv.h +++ b/yportenv.h @@ -41,6 +41,7 @@ #define _Y(x) x #define yaffs_strcpy(a,b) strcpy(a,b) #define yaffs_strncpy(a,b,c) strncpy(a,b,c) +#define yaffs_strncmp(a,b,c) strncmp(a,b,c) #define yaffs_strlen(s) strlen(s) #define yaffs_sprintf sprintf #define yaffs_toupper(a) toupper(a) @@ -60,7 +61,7 @@ // KR - added for use in scan so processes aren't blocked indefinitely. #define YYIELD() schedule() -#define YAFFS_ROOT_MODE 0666 +#define YAFFS_ROOT_MODE 0666 #define YAFFS_LOSTNFOUND_MODE 0666 #if (LINUX_VERSION_CODE > KERNEL_VERSION(2,5,0)) @@ -78,6 +79,14 @@ #define TSTR(x) KERN_WARNING x #define TOUT(p) printk p +#define yaffs_trace(mask, fmt, args...) \ + do { if ((mask) & (yaffs_traceMask|YAFFS_TRACE_ERROR)) \ + printk(KERN_WARNING "yaffs: " fmt, ## args); \ + } while (0) + +#define compile_time_assertion(assertion) \ + ({ int x = __builtin_choose_expr(assertion, 0, (void)0); (void) x; }) + #elif defined CONFIG_YAFFS_DIRECT /* Direct interface */ @@ -132,9 +141,15 @@ #endif -extern unsigned yaffs_traceMask; +/* see yaffs_fs.c */ +extern unsigned int yaffs_traceMask; +extern unsigned int yaffs_wr_attempts; -#define YAFFS_TRACE_ERROR 0x00000001 +/* + * Tracing flags. + * The flags masked in YAFFS_TRACE_ALWAYS are always traced. + */ + #define YAFFS_TRACE_OS 0x00000002 #define YAFFS_TRACE_ALLOCATE 0x00000004 #define YAFFS_TRACE_SCAN 0x00000008 @@ -150,10 +165,19 @@ extern unsigned yaffs_traceMask; #define YAFFS_TRACE_SCAN_DEBUG 0x00002000 #define YAFFS_TRACE_MTD 0x00004000 #define YAFFS_TRACE_CHECKPOINT 0x00008000 -#define YAFFS_TRACE_ALWAYS 0x40000000 + +#define YAFFS_TRACE_VERIFY 0x00010000 +#define YAFFS_TRACE_VERIFY_NAND 0x00020000 +#define YAFFS_TRACE_VERIFY_FULL 0x00040000 +#define YAFFS_TRACE_VERIFY_ALL 0x000F0000 + + +#define YAFFS_TRACE_ERROR 0x40000000 #define YAFFS_TRACE_BUG 0x80000000 +#define YAFFS_TRACE_ALWAYS 0xF0000000 + -#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_ALWAYS)) TOUT(p);} while(0) #ifndef CONFIG_YAFFS_WINCE #define YBUG() T(YAFFS_TRACE_BUG,(TSTR("==>> yaffs bug: " __FILE__ " %d" TENDSTR),__LINE__))