2 * YAFFS: Yet another Flash File System . A NAND-flash specific file system.
4 * Copyright (C) 2002-2018 Aleph One Ltd.
6 * Created by Charles Manning <charles@aleph1.co.uk>
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU Lesser General Public License version 2.1 as
10 * published by the Free Software Foundation.
12 * Note: Only YAFFS headers are LGPL, YAFFS C code is covered by GPL.
16 #ifndef __YPORTENV_H__
17 #define __YPORTENV_H__
22 #include <sys/types.h>
27 #define CONFIG_YAFFS_DIRECT 1
28 #define CONFIG_YAFFS_SHORT_NAMES_IN_RAM 1
29 #define CONFIG_YAFFS_YAFFS2 1
30 #define CONFIG_YAFFS_PROVIDE_DEFS 1
31 #define CONFIG_YAFFSFS_PROVIDE_VALUES 1
32 #define CONFIG_YAFFS_DEFINES_TYPES 1
36 #endif /* __rtems__ */
38 /* Definition of types */
39 #ifdef CONFIG_YAFFS_DEFINES_TYPES
40 typedef unsigned char u8;
41 typedef unsigned short u16;
42 typedef unsigned int u32;
43 typedef unsigned long long u64;
44 typedef signed int s32;
47 #ifdef CONFIG_YAFFS_PROVIDE_DEFS
64 * These are or-ed together to select what has been changed.
75 unsigned int ia_valid;
83 unsigned int ia_attr_flags;
90 #if defined CONFIG_YAFFS_WINCE
92 #include "ywinceenv.h"
95 #elif defined CONFIG_YAFFS_DIRECT
97 /* Direct interface */
98 #include "ydirectenv.h"
100 #elif defined CONFIG_YAFFS_UTIL
102 #include "yutilsenv.h"
105 /* Should have specified a configuration type */
106 #error Unknown configuration
110 #if defined(CONFIG_YAFFS_DIRECT) || defined(CONFIG_YAFFS_WINCE)
112 #ifdef CONFIG_YAFFSFS_PROVIDE_VALUES
135 #define O_TRUNC 01000
139 #define O_APPEND 02000
207 #define ENAMETOOLONG 36
238 #define S_IFMT 0170000
242 #define S_IFSOCK 0140000
246 #define S_IFIFO 0010000
250 #define S_IFCHR 0020000
254 #define S_IFBLK 0060000
258 #define S_IFLNK 0120000
262 #define S_IFDIR 0040000
266 #define S_IFREG 0100000
270 #define S_ISSOCK(m) (((m) & S_IFMT) == S_IFSOCK)
273 #define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK)
276 #define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
279 #define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
282 #define S_ISBLK(m) (((m) & S_IFMT) == S_IFBLK)
285 #define S_ISCHR(m) (((m) & S_IFMT) == S_IFCHR)
288 #define S_ISFIFO(m) (((m) & S_IFMT) == S_IFIFO)
293 #define S_IRUSR 0000400
297 #define S_IWUSR 0000200
301 #define S_IXUSR 0000100
305 #define S_IREAD 0000400
309 #define S_IWRITE 0000200
313 #define S_IEXEC 0000100
319 #include <sys/stat.h>
325 /* Create some less common define values if they don't exist */
327 #define XATTR_CREATE 1
330 #ifndef XATTR_REPLACE
331 #define XATTR_REPLACE 2
342 #define S_ISSOCK(m) (((m) & S_IFMT) == S_IFSOCK)
346 #define Y_DUMP_STACK() do { } while (0)
351 yaffs_trace(YAFFS_TRACE_BUG,\
352 "==>> yaffs bug: " __FILE__ " %d",\