removed - more testing
[yaffs/.git] / yportenv.h
1 /*
2  * YAFFS: Yet another FFS. A NAND-flash specific file system. 
3  * yportenv.h: Portable services used by yaffs. This is done to allow
4  * simple migration from kernel space into app space for testing.
5  *
6  * Copyright (C) 2002 Aleph One Ltd.
7  *   for Toby Churchill Ltd and Brightstar Engineering
8  *
9  * Created by Charles Manning <charles@aleph1.co.uk>
10  *
11  * This program is free software; you can redistribute it and/or modify
12  * it under the terms of the GNU General Public License version 2 as
13  * published by the Free Software Foundation.
14  *
15  */
16  
17 #ifndef __PORTENV_H__
18 #define __PORTENV_H__
19
20 #ifndef __KERNEL__
21
22 #include "stdlib.h"
23 #include "stdio.h"
24 #include "string.h"
25
26 #define YPRINTF(x) printf x
27 #define YMALLOC(x) malloc(x)
28 #define YFREE(x)   free(x)
29
30
31 #define YINFO(s) YPRINTF(( __FILE__ " %d %s\n",__LINE__,s))
32 #define YALERT(s) YINFO(s)
33
34 #else
35
36 #include "linux/kernel.h"
37 #include "linux/mm.h"
38 #include "linux/string.h"
39 #include "linux/slab.h"
40
41 #define YPRINTF(x) printk x
42 #define YMALLOC(x) kmalloc(x,GFP_KERNEL)
43 #define YFREE(x)   kfree(x)
44
45 #endif
46
47
48
49 #define YINFO(s) YPRINTF((KERN_DEBUG __FILE__ " %d %s\n",__LINE__,s))
50 #define YALERT(s) YINFO(s)
51
52 #endif
53
54
55
56