2 * YAFFS: Yet another Flash File System . A NAND-flash specific file system.
4 * Copyright (C) 2002-2011 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 #ifndef __YPORTENV_H__
18 #define __YPORTENV_H__
20 #include <linux/bug.h>
21 #include <linux/types.h>
23 /* Definition of types */
24 #ifdef CONFIG_YAFFS_DEFINES_TYPES
25 typedef unsigned char u8;
26 typedef unsigned short u16;
31 #ifdef CONFIG_YAFFS_PROVIDE_DEFS
48 * These are or-ed together to select what has been changed.
59 unsigned int ia_valid;
67 unsigned int ia_attr_flags;
74 #if defined CONFIG_YAFFS_WINCE
76 #include "ywinceenv.h"
79 #elif defined CONFIG_YAFFS_DIRECT
81 /* Direct interface */
82 #include "ydirectenv.h"
84 #elif defined CONFIG_YAFFS_UTIL
86 #include "yutilsenv.h"
89 /* Should have specified a configuration type */
90 #error Unknown configuration
94 #if defined(CONFIG_YAFFS_DIRECT) || defined(CONFIG_YAFFS_WINCE)
96 #ifdef CONFIG_YAFFSFS_PROVIDE_VALUES
119 #define O_TRUNC 01000
123 #define O_APPEND 02000
191 #define ENAMETOOLONG 36
222 #define S_IFMT 0170000
226 #define S_IFSOCK 0140000
230 #define S_IFIFO 0010000
234 #define S_IFCHR 0020000
238 #define S_IFBLK 0060000
242 #define S_IFLNK 0120000
246 #define S_IFDIR 0040000
250 #define S_IFREG 0100000
253 #define S_ISSOCK(m) (((m) & S_IFMT) == S_IFSOCK)
254 #define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK)
255 #define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
256 #define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
257 #define S_ISBLK(m) (((m) & S_IFMT) == S_IFBLK)
258 #define S_ISCHR(m) (((m) & S_IFMT) == S_IFCHR)
259 #define S_ISFIFO(m) (((m) & S_IFMT) == S_IFIFO)
263 #define S_IREAD 0000400
267 #define S_IWRITE 0000200
271 #define S_IEXEC 0000100
275 #define XATTR_CREATE 1
278 #ifndef XATTR_REPLACE
279 #define XATTR_REPLACE 2
291 #include <sys/stat.h>
298 #define Y_DUMP_STACK() do { } while (0)
303 yaffs_trace(YAFFS_TRACE_BUG,\
304 "==>> yaffs bug: " __FILE__ " %d",\