2 * YAFFS: Yet another Flash File System . A NAND-flash specific file system.
4 * Copyright (C) 2002-2010 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;
32 #ifdef CONFIG_YAFFS_PROVIDE_DEFS
53 * These are or-ed together to select what has been changed.
64 unsigned int ia_valid;
72 unsigned int ia_attr_flags;
79 #if defined CONFIG_YAFFS_WINCE
81 #include "ywinceenv.h"
84 #elif defined CONFIG_YAFFS_DIRECT
86 /* Direct interface */
87 #include "ydirectenv.h"
89 #elif defined CONFIG_YAFFS_UTIL
91 #include "yutilsenv.h"
94 /* Should have specified a configuration type */
95 #error Unknown configuration
99 #if defined(CONFIG_YAFFS_DIRECT) || defined(CONFIG_YAFFS_WINCE)
101 #ifdef CONFIG_YAFFSFS_PROVIDE_VALUES
124 #define O_TRUNC 01000
128 #define O_APPEND 02000
196 #define ENAMETOOLONG 36
227 #define S_IFMT 0170000
231 #define S_IFLNK 0120000
235 #define S_IFDIR 0040000
239 #define S_IFREG 0100000
243 #define S_IREAD 0000400
247 #define S_IWRITE 0000200
251 #define S_IEXEC 0000100
255 #define XATTR_CREATE 1
258 #ifndef XATTR_REPLACE
259 #define XATTR_REPLACE 2
271 #include <sys/stat.h>
278 #define Y_DUMP_STACK() do { } while (0)
283 yaffs_trace(YAFFS_TRACE_BUG,\
284 "==>> yaffs bug: " __FILE__ " %d",\