blob: 8183425448cde06732aa5499156c661fe1314e90 [file] [log] [blame]
Arve Hjønnevåg82379112010-05-18 20:35:30 -07001/*
2 * YAFFS: Yet another Flash File System . A NAND-flash specific file system.
3 *
4 * Copyright (C) 2002-2010 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_LINUX_H__
17#define __YPORTENV_LINUX_H__
18
19#include <linux/version.h>
20#include <linux/kernel.h>
21#include <linux/mm.h>
22#include <linux/sched.h>
23#include <linux/string.h>
24#include <linux/slab.h>
25#include <linux/vmalloc.h>
26#include <linux/xattr.h>
27#include <linux/list.h>
28#include <linux/types.h>
29#include <linux/fs.h>
30#include <linux/stat.h>
31#include <linux/sort.h>
32#include <linux/bitops.h>
33
34#define YCHAR char
35#define YUCHAR unsigned char
36#define _Y(x) x
37
38#define YAFFS_LOSTNFOUND_NAME "lost+found"
39#define YAFFS_LOSTNFOUND_PREFIX "obj"
40
41
42#define YAFFS_ROOT_MODE 0755
43#define YAFFS_LOSTNFOUND_MODE 0700
44
45#define Y_CURRENT_TIME CURRENT_TIME.tv_sec
46#define Y_TIME_CONVERT(x) (x).tv_sec
47
48#define compile_time_assertion(assertion) \
49 ({ int x = __builtin_choose_expr(assertion, 0, (void)0); (void) x; })
50
51
52#ifndef Y_DUMP_STACK
53#define Y_DUMP_STACK() dump_stack()
54#endif
55
56#define yaffs_trace(msk, fmt, ...) do { \
Dima Zavin22e9cd92011-01-05 16:03:21 -080057 if(yaffs_trace_mask & (msk)) \
Arve Hjønnevåg82379112010-05-18 20:35:30 -070058 printk(KERN_DEBUG "yaffs: " fmt "\n", ##__VA_ARGS__); \
59} while(0)
60
61#ifndef YBUG
62#define YBUG() do {\
63 yaffs_trace(YAFFS_TRACE_BUG,\
64 "bug " __FILE__ " %d",\
65 __LINE__);\
66 Y_DUMP_STACK();\
67} while (0)
68#endif
69
70#endif