blob: c2ffbfd56d9061ab1bcd2778c50f915064a436c8 [file] [log] [blame]
William Juulc051bbe2007-11-15 11:13:05 +01001/*
Wolfgang Denk74e0dde2008-08-14 14:41:06 +02002 * YAFFS: Yet another Flash File System . A NAND-flash specific file system.
William Juulc051bbe2007-11-15 11:13:05 +01003 *
Charles Manning3796e1f2012-05-09 16:55:17 +00004 * Copyright (C) 2002-2011 Aleph One Ltd.
William Juulc051bbe2007-11-15 11:13:05 +01005 * 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/*
17 * ydirectenv.h: Environment wrappers for YAFFS direct.
18 */
19
20#ifndef __YDIRECTENV_H__
21#define __YDIRECTENV_H__
22
Charles Manning4f28fc22012-08-14 18:26:10 +000023#include <common.h>
24#include <malloc.h>
25#include <linux/compat.h>
26
Charles Manning3796e1f2012-05-09 16:55:17 +000027#include "yaffs_osglue.h"
William Juulc051bbe2007-11-15 11:13:05 +010028
Charles Manning3796e1f2012-05-09 16:55:17 +000029void yaffs_bug_fn(const char *file_name, int line_no);
30
Charles Manning3796e1f2012-05-09 16:55:17 +000031
William Juulc051bbe2007-11-15 11:13:05 +010032
33#define YCHAR char
34#define YUCHAR unsigned char
35#define _Y(x) x
William Juulc051bbe2007-11-15 11:13:05 +010036
Charles Manning3796e1f2012-05-09 16:55:17 +000037#define yaffs_strcat(a, b) strcat(a, b)
38#define yaffs_strcpy(a, b) strcpy(a, b)
39#define yaffs_strncpy(a, b, c) strncpy(a, b, c)
40#define yaffs_strnlen(s, m) strnlen(s, m)
41#ifdef CONFIG_YAFFS_CASE_INSENSITIVE
42#define yaffs_strcmp(a, b) strcasecmp(a, b)
43#define yaffs_strncmp(a, b, c) strncasecmp(a, b, c)
William Juulc051bbe2007-11-15 11:13:05 +010044#else
Charles Manning3796e1f2012-05-09 16:55:17 +000045#define yaffs_strcmp(a, b) strcmp(a, b)
46#define yaffs_strncmp(a, b, c) strncmp(a, b, c)
William Juulc051bbe2007-11-15 11:13:05 +010047#endif
48
William Juulc051bbe2007-11-15 11:13:05 +010049
Charles Manning3796e1f2012-05-09 16:55:17 +000050void yaffs_qsort(void *aa, size_t n, size_t es,
51 int (*cmp)(const void *, const void *));
William Juulc051bbe2007-11-15 11:13:05 +010052
Charles Manning3796e1f2012-05-09 16:55:17 +000053#define sort(base, n, sz, cmp_fn, swp) yaffs_qsort(base, n, sz, cmp_fn)
William Juulc051bbe2007-11-15 11:13:05 +010054
Charles Manning3796e1f2012-05-09 16:55:17 +000055#define YAFFS_PATH_DIVIDERS "/"
William Juulc051bbe2007-11-15 11:13:05 +010056
Charles Manning3796e1f2012-05-09 16:55:17 +000057#ifdef NO_inline
58#define inline
Charles Manning3796e1f2012-05-09 16:55:17 +000059#endif
William Juulc051bbe2007-11-15 11:13:05 +010060
Charles Manning3796e1f2012-05-09 16:55:17 +000061#define cond_resched() do {} while (0)
William Juulc051bbe2007-11-15 11:13:05 +010062
Charles Manning3796e1f2012-05-09 16:55:17 +000063#define yaffs_trace(msk, fmt, ...) do { \
64 if (yaffs_trace_mask & (msk)) \
65 printf("yaffs: " fmt "\n", ##__VA_ARGS__); \
66} while (0)
William Juulc051bbe2007-11-15 11:13:05 +010067
68
69#define YAFFS_LOSTNFOUND_NAME "lost+found"
70#define YAFFS_LOSTNFOUND_PREFIX "obj"
William Juulc051bbe2007-11-15 11:13:05 +010071
72#include "yaffscfg.h"
73
74#define Y_CURRENT_TIME yaffsfs_CurrentTime()
75#define Y_TIME_CONVERT(x) x
76
Charles Manning3796e1f2012-05-09 16:55:17 +000077#define YAFFS_ROOT_MODE 0666
William Juulc051bbe2007-11-15 11:13:05 +010078#define YAFFS_LOSTNFOUND_MODE 0666
79
Charles Manning3796e1f2012-05-09 16:55:17 +000080#include "yaffs_list.h"
81
82#include "yaffsfs.h"
William Juulc051bbe2007-11-15 11:13:05 +010083
84#endif