Add files to hook up yaffs direct to u-boot
[yaffs2.git] / direct / yportenv.h
index 939cd3a407bd494d96ba61b0348fe383273c0809..a797c8ad0a6fc8e75ad57fb0b71bd96b7a672607 100644 (file)
 
 
 /* Definition of types */
 
 
 /* Definition of types */
+#ifdef CONFIG_YAFFS_DEFINES_TYPES
 typedef unsigned char u8;
 typedef unsigned short u16;
 typedef unsigned u32;
 typedef unsigned char u8;
 typedef unsigned short u16;
 typedef unsigned u32;
-
-
-#ifndef WIN32
-#include <sys/stat.h>
 #endif
 
 
 #endif
 
 
@@ -44,10 +41,6 @@ typedef unsigned u32;
 #define DT_WHT         14
 
 
 #define DT_WHT         14
 
 
-#ifndef WIN32
-#include <sys/stat.h>
-#endif
-
 /*
  * Attribute flags.
  * These are or-ed together to select what has been changed.
 /*
  * Attribute flags.
  * These are or-ed together to select what has been changed.
@@ -227,6 +220,22 @@ struct iattr {
 #define S_IFMT         0170000
 #endif
 
 #define S_IFMT         0170000
 #endif
 
+#ifndef S_IFSOCK
+#define S_IFSOCK       0140000
+#endif
+
+#ifndef S_IFIFO
+#define S_IFIFO                0010000
+#endif
+
+#ifndef S_IFCHR
+#define S_IFCHR                0020000
+#endif
+
+#ifndef S_IFBLK
+#define S_IFBLK                0060000
+#endif
+
 #ifndef S_IFLNK
 #define S_IFLNK                0120000
 #endif
 #ifndef S_IFLNK
 #define S_IFLNK                0120000
 #endif
@@ -239,6 +248,15 @@ struct iattr {
 #define S_IFREG                0100000
 #endif
 
 #define S_IFREG                0100000
 #endif
 
+#define S_ISSOCK(m)    (((m) & S_IFMT) == S_IFSOCK)
+#define S_ISLNK(m)     (((m) & S_IFMT) == S_IFLNK)
+#define S_ISDIR(m)     (((m) & S_IFMT) == S_IFDIR)
+#define S_ISREG(m)     (((m) & S_IFMT) == S_IFREG)
+#define S_ISBLK(m)     (((m) & S_IFMT) == S_IFBLK)
+#define S_ISCHR(m)     (((m) & S_IFMT) == S_IFCHR)
+#define S_ISFIFO(m)    (((m) & S_IFMT) == S_IFIFO)
+
+
 #ifndef S_IREAD 
 #define S_IREAD                0000400
 #endif
 #ifndef S_IREAD 
 #define S_IREAD                0000400
 #endif