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__
21 /* Definition of types */
22 #ifdef CONFIG_YAFFS_DEFINES_TYPES
23 typedef unsigned char u8;
24 typedef unsigned short u16;
29 #ifdef CONFIG_YAFFS_PROVIDE_DEFS
46 * These are or-ed together to select what has been changed.
57 unsigned int ia_valid;
65 unsigned int ia_attr_flags;
72 #if defined CONFIG_YAFFS_WINCE
74 #include "ywinceenv.h"
77 #elif defined CONFIG_YAFFS_DIRECT
79 /* Direct interface */
80 #include "ydirectenv.h"
82 #elif defined CONFIG_YAFFS_UTIL
84 #include "yutilsenv.h"
87 /* Should have specified a configuration type */
88 #error Unknown configuration
92 #if defined(CONFIG_YAFFS_DIRECT) || defined(CONFIG_YAFFS_WINCE)
94 #ifdef CONFIG_YAFFSFS_PROVIDE_VALUES
117 #define O_TRUNC 01000
121 #define O_APPEND 02000
189 #define ENAMETOOLONG 36
220 #define S_IFMT 0170000
224 #define S_IFSOCK 0140000
228 #define S_IFIFO 0010000
232 #define S_IFCHR 0020000
236 #define S_IFBLK 0060000
240 #define S_IFLNK 0120000
244 #define S_IFDIR 0040000
248 #define S_IFREG 0100000
251 #define S_ISSOCK(m) (((m) & S_IFMT) == S_IFSOCK)
252 #define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK)
253 #define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
254 #define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
255 #define S_ISBLK(m) (((m) & S_IFMT) == S_IFBLK)
256 #define S_ISCHR(m) (((m) & S_IFMT) == S_IFCHR)
257 #define S_ISFIFO(m) (((m) & S_IFMT) == S_IFIFO)
261 #define S_IREAD 0000400
265 #define S_IWRITE 0000200
269 #define S_IEXEC 0000100
273 #define XATTR_CREATE 1
276 #ifndef XATTR_REPLACE
277 #define XATTR_REPLACE 2
289 #include <sys/stat.h>
296 #define Y_DUMP_STACK() do { } while (0)
301 yaffs_trace(YAFFS_TRACE_BUG,\
302 "==>> yaffs bug: " __FILE__ " %d",\