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/types.h>
22
/* Definition of types */
23
#ifdef CONFIG_YAFFS_DEFINES_TYPES
24
typedef unsigned char u8;
25
typedef unsigned short u16;
30
#ifdef CONFIG_YAFFS_PROVIDE_DEFS
47
* These are or-ed together to select what has been changed.
58
unsigned int ia_valid;
66
unsigned int ia_attr_flags;
73
#if defined CONFIG_YAFFS_WINCE
75
#include "ywinceenv.h"
78
#elif defined CONFIG_YAFFS_DIRECT
80
/* Direct interface */
81
#include "ydirectenv.h"
83
#elif defined CONFIG_YAFFS_UTIL
85
#include "yutilsenv.h"
88
/* Should have specified a configuration type */
89
#error Unknown configuration
93
#if defined(CONFIG_YAFFS_DIRECT) || defined(CONFIG_YAFFS_WINCE)
95
#ifdef CONFIG_YAFFSFS_PROVIDE_VALUES
118
#define O_TRUNC 01000
122
#define O_APPEND 02000
190
#define ENAMETOOLONG 36
221
#define S_IFMT 0170000
225
#define S_IFSOCK 0140000
229
#define S_IFIFO 0010000
233
#define S_IFCHR 0020000
237
#define S_IFBLK 0060000
241
#define S_IFLNK 0120000
245
#define S_IFDIR 0040000
249
#define S_IFREG 0100000
252
#define S_ISSOCK(m) (((m) & S_IFMT) == S_IFSOCK)
253
#define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK)
254
#define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR)
255
#define S_ISREG(m) (((m) & S_IFMT) == S_IFREG)
256
#define S_ISBLK(m) (((m) & S_IFMT) == S_IFBLK)
257
#define S_ISCHR(m) (((m) & S_IFMT) == S_IFCHR)
258
#define S_ISFIFO(m) (((m) & S_IFMT) == S_IFIFO)
262
#define S_IREAD 0000400
266
#define S_IWRITE 0000200
270
#define S_IEXEC 0000100
274
#define XATTR_CREATE 1
277
#ifndef XATTR_REPLACE
278
#define XATTR_REPLACE 2
290
#include <sys/stat.h>
297
#define Y_DUMP_STACK() do { } while (0)
302
yaffs_trace(YAFFS_TRACE_BUG,\
303
"==>> yaffs bug: " __FILE__ " %d",\