2 * YAFFS: Yet another Flash File System . A NAND-flash specific file system.
4 * Copyright (C) 2002-2011 Aleph One Ltd.
5 * for Toby Churchill Ltd and Brightstar Engineering
7 * Created by Charles Manning <charles@aleph1.co.uk>
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU Lesser General Public License version 2.1 as
11 * published by the Free Software Foundation.
13 * Note: Only YAFFS headers are LGPL, YAFFS C code is covered by GPL.
17 * ydirectenv.h: Environment wrappers for YAFFS direct.
20 #ifndef __YDIRECTENV_H__
21 #define __YDIRECTENV_H__
28 #include "yaffs_osglue.h"
29 #include "yaffs_hweight.h"
32 #define BUG() assert(0)
33 //#define BUG() do { *((int *)0) =1;} while(0)
37 #define YUCHAR unsigned char
39 #define yaffs_strcat(a,b) strcat(a,b)
40 #define yaffs_strcpy(a,b) strcpy(a,b)
41 #define yaffs_strncpy(a,b,c) strncpy(a,b,c)
42 #define yaffs_strnlen(s,m) strnlen(s,m)
43 #ifdef CONFIG_YAFFS_CASE_INSENSITIVE
44 #define yaffs_strcmp(a,b) strcasecmp(a,b)
45 #define yaffs_strncmp(a,b,c) strncasecmp(a,b,c)
47 #define yaffs_strcmp(a,b) strcmp(a,b)
48 #define yaffs_strncmp(a,b,c) strncmp(a,b,c)
51 #define hweight8(x) yaffs_hweight8(x)
52 #define hweight32(x) yaffs_hweight32(x)
54 void yaffs_qsort(void *aa, size_t n, size_t es,
55 int (*cmp)(const void *, const void *));
57 #define sort(base, n, sz, cmp_fn, swp) yaffs_qsort(base, n, sz, cmp_fn)
59 #define YAFFS_PATH_DIVIDERS "/"
64 #define inline __inline__
67 #define kmalloc(x,flags) yaffsfs_malloc(x)
68 #define kfree(x) yaffsfs_free(x)
69 #define vmalloc(x) yaffsfs_malloc(x)
70 #define vfree(x) yaffsfs_free(x)
72 #define cond_resched() do {} while(0)
74 #define yaffs_trace(msk, fmt, ...) do { \
75 if(yaffs_trace_mask & (msk)) \
76 printf("yaffs: " fmt "\n", ##__VA_ARGS__); \
80 #define YAFFS_LOSTNFOUND_NAME "lost+found"
81 #define YAFFS_LOSTNFOUND_PREFIX "obj"
85 #define Y_CURRENT_TIME yaffsfs_CurrentTime()
86 #define Y_TIME_CONVERT(x) x
88 #define YAFFS_ROOT_MODE 0666
89 #define YAFFS_LOSTNFOUND_MODE 0666
91 #include "yaffs_list.h"