2 * YAFFS: Yet another Flash File System . A NAND-flash specific file system.
4 * Copyright (C) 2002-2010 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 YBUG() assert(0)
33 //#define YBUG() do { *((int *)0) =1;} while(0)
37 #define YUCHAR unsigned char
40 #define hweight8(x) yaffs_hweight8(x)
41 #define hweight32(x) yaffs_hweight32(x)
43 void yaffs_qsort(void *aa, size_t n, size_t es,
44 int (*cmp)(const void *, const void *));
46 #define sort(base, n, sz, cmp_fn, swp) yaffs_qsort(base, n, sz, cmp_fn)
48 #define YAFFS_PATH_DIVIDERS "/"
53 #define Y_INLINE __inline__
56 #define kmalloc(x,flags) yaffs_malloc(x)
57 #define kfree(x) yaffs_free(x)
58 #define vmalloc(x) yaffs_malloc(x)
59 #define vfree(x) yaffs_free(x)
61 #define cond_resched() do {} while(0)
65 //#define YINFO(s) YPRINTF(( __FILE__ " %d %s\n",__LINE__,s))
66 //#define YALERT(s) YINFO(s)
72 #define TOUT(p) printf p
75 #define YAFFS_LOSTNFOUND_NAME "lost+found"
76 #define YAFFS_LOSTNFOUND_PREFIX "obj"
77 //#define YPRINTF(x) printf x
81 #define Y_CURRENT_TIME yaffsfs_CurrentTime()
82 #define Y_TIME_CONVERT(x) x
84 #define YAFFS_ROOT_MODE 0666
85 #define YAFFS_LOSTNFOUND_MODE 0666
87 #include "yaffs_list.h"