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 typedef unsigned char u8;
23 typedef unsigned short u16;
27 #ifdef CONFIG_YAFFS_PROVIDE_DEFS
44 * These are or-ed together to select what has been changed.
55 unsigned int ia_valid;
63 unsigned int ia_attr_flags;
70 #if defined CONFIG_YAFFS_WINCE
72 #include "ywinceenv.h"
75 #elif defined CONFIG_YAFFS_DIRECT
77 /* Direct interface */
78 #include "ydirectenv.h"
80 #elif defined CONFIG_YAFFS_UTIL
82 #include "yutilsenv.h"
85 /* Should have specified a configuration type */
86 #error Unknown configuration
90 #if defined(CONFIG_YAFFS_DIRECT) || defined(CONFIG_YAFFS_WINCE)
92 #ifdef CONFIG_YAFFSFS_PROVIDE_VALUES
115 #define O_TRUNC 01000
119 #define O_APPEND 02000
187 #define ENAMETOOLONG 36
218 #define S_IFMT 0170000
222 #define S_IFSOCK 0140000
226 #define S_IFIFO 0010000
230 #define S_IFCHR 0020000
234 #define S_IFBLK 0060000
238 #define S_IFLNK 0120000
242 #define S_IFDIR 0040000
246 #define S_IFREG 0100000
249 #define S_ISSOCK(m) (((m) & S_IFMT) == S_IFSOCK)
250 #define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK)
251 #define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
252 #define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
253 #define S_ISBLK(m) (((m) & S_IFMT) == S_IFBLK)
254 #define S_ISCHR(m) (((m) & S_IFMT) == S_IFCHR)
255 #define S_ISFIFO(m) (((m) & S_IFMT) == S_IFIFO)
259 #define S_IREAD 0000400
263 #define S_IWRITE 0000200
267 #define S_IEXEC 0000100
271 #define XATTR_CREATE 1
274 #ifndef XATTR_REPLACE
275 #define XATTR_REPLACE 2
287 #include <sys/stat.h>
294 #define Y_DUMP_STACK() do { } while (0)
299 yaffs_trace(YAFFS_TRACE_BUG,\
300 "==>> yaffs bug: " __FILE__ " %d",\