Add missing definition for yaffs_strcmp
[yaffs2.git] / yportenv_multi.h
1 /*
2  * YAFFS: Yet another Flash File System . A NAND-flash specific file system.
3  *
4  * Copyright (C) 2002-2011 Aleph One Ltd.
5  *   for Toby Churchill Ltd and Brightstar Engineering
6  *
7  * Created by Charles Manning <charles@aleph1.co.uk>
8  *
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.
12  *
13  * Note: Only YAFFS headers are LGPL, YAFFS C code is covered by GPL.
14  */
15
16 #ifndef __YPORTENV_H__
17 #define __YPORTENV_H__
18
19 /*
20  * Define the MTD version in terms of Linux Kernel versions
21  * This allows yaffs to be used independantly of the kernel
22  * as well as with it.
23  */
24
25 #define MTD_VERSION(a, b, c) (((a) << 16) + ((b) << 8) + (c))
26
27 #ifdef YAFFS_OUT_OF_TREE
28 #include "moduleconfig.h"
29 #endif
30
31 #include <linux/version.h>
32 #define MTD_VERSION_CODE LINUX_VERSION_CODE
33
34 #if (LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 19))
35 #include <linux/config.h>
36 #endif
37 #include <linux/version.h>
38 #include <linux/kernel.h>
39 #include <linux/mm.h>
40 #include <linux/sched.h>
41 #include <linux/string.h>
42 #include <linux/slab.h>
43 #include <linux/vmalloc.h>
44 #include <linux/xattr.h>
45 #include <linux/list.h>
46 #include <linux/types.h>
47 #include <linux/fs.h>
48 #include <linux/stat.h>
49 #include <linux/sort.h>
50 #include <linux/bitops.h>
51
52 /*  These type wrappings are used to support Unicode names in WinCE. */
53 #define YCHAR char
54 #define YUCHAR unsigned char
55 #define _Y(x)     x
56 #define yaffs_strcat(a, b)     strcat(a, b)
57 #define yaffs_strcpy(a, b)     strcpy(a, b)
58 #define yaffs_strncpy(a, b, c) strncpy(a, b, c)
59 #define yaffs_strncmp(a, b, c) strncmp(a, b, c)
60 #define yaffs_strnlen(s,m)      strnlen(s,m)
61 #define yaffs_strcmp(a,b)       strcmp(a,b)
62
63 #define YAFFS_LOSTNFOUND_NAME           "lost+found"
64 #define YAFFS_LOSTNFOUND_PREFIX         "obj"
65
66
67 #define YAFFS_ROOT_MODE                 0755
68 #define YAFFS_LOSTNFOUND_MODE           0700
69
70 #if (LINUX_VERSION_CODE > KERNEL_VERSION(2, 5, 0))
71 #define Y_CURRENT_TIME CURRENT_TIME.tv_sec
72 #define Y_TIME_CONVERT(x) (x).tv_sec
73 #else
74 #define Y_CURRENT_TIME CURRENT_TIME
75 #define Y_TIME_CONVERT(x) (x)
76 #endif
77
78 #define compile_time_assertion(assertion) \
79         ({ int x = __builtin_choose_expr(assertion, 0, (void)0); (void) x; })
80
81
82 #define yaffs_trace(msk, fmt, ...) do { \
83         if (yaffs_trace_mask & (msk)) \
84                 printk(KERN_DEBUG "yaffs: " fmt "\n", ##__VA_ARGS__); \
85 } while (0)
86
87
88 #endif