]> git.proxmox.com Git - mirror_edk2.git/blobdiff - StdLib/Include/sys/stat.h
Add device abstraction code for the UEFI Console and UEFI Shell-based file systems.
[mirror_edk2.git] / StdLib / Include / sys / stat.h
index adc61ecf8067f1f190abe953301a3813395b3b1b..47e993b8bea6fc0e8ae9f24fd2b2aa5ec062df26 100644 (file)
@@ -1,6 +1,6 @@
 /** @file\r
 \r
-    Copyright (c) 2010, Intel Corporation. All rights reserved.<BR>\r
+    Copyright (c) 2010 - 2011, Intel Corporation. All rights reserved.<BR>\r
     This program and the accompanying materials are licensed and made\r
     available under  the terms and conditions of the BSD License that\r
     accompanies this distribution. The full text of the license may be found at\r
@@ -54,6 +54,7 @@
 struct stat {\r
   off_t           st_size;          /* file size, in bytes */\r
   off_t           st_physsize;      /* physical space the file consumes */\r
+  off_t           st_curpos;        /* current position within the file, or XY coord. for Console */\r
   dtime_t         st_birthtime;     /* time of creation */\r
   dtime_t         st_atime;         /* time of last access */\r
   dtime_t         st_mtime;         /* time of last data modification */\r
@@ -113,7 +114,8 @@ struct stat {
     Traditionally, the remainder of the flags are specified in Octal\r
     but they are expressed in Hex here for modern clarity.\r
 */\r
-#define _S_IFMT       0x0001F000   /* type-of-file mask */\r
+#define _S_IFMT       0x000FF000   /* type-of-file mask */\r
+#define _S_IFIFO      0x00001000   /* named pipe (fifo) */\r
 #define _S_IFCHR      0x00002000   /* character special */\r
 #define _S_IFDIR      0x00004000   /* directory */\r
 #define _S_IFBLK      0x00006000   /* block special */\r
@@ -121,9 +123,10 @@ struct stat {
 #define _S_IFSOCK     0x0000C000   /* socket */\r
 #define _S_ITTY       0x00010000   /* File connects to a TTY device */\r
 #define _S_IWTTY      0x00020000   /* TTY receives Wide characters */\r
+#define _S_ICONSOLE   0x00030000    /* UEFI Console Device */\r
 \r
 /*  UEFI specific (FAT file system) File attributes.\r
-    Specifiec in Hexadecimal instead of Octal.\r
+    Specified in Hexadecimal instead of Octal.\r
     These bits correspond to the xx portion of _S_IFMT\r
 */\r
 #define S_IREADONLY   0x00100000    // Read Only File\r
@@ -133,9 +136,10 @@ struct stat {
 #define S_IARCHIVE    0x02000000    // Archive Bit\r
 #define S_IROFS       0x08000000   /* Read Only File System */\r
 \r
+#define S_EFIONLY     0xF0000000  /* Flags only used by the EFI system calls. */\r
+\r
 #define S_EFISHIFT    20            // LS bit of the UEFI attributes\r
 \r
-//#define _S_IFIFO      0010000   /* named pipe (fifo) */\r
 //#define _S_IFLNK      0120000   /* symbolic link */\r
 //#define _S_IFWHT      0160000   /* whiteout */\r
 //#define _S_ARCH1      0200000   /* Archive state 1, ls -l shows 'a' */\r
@@ -146,12 +150,12 @@ struct stat {
 #define S_IFMT   _S_IFMT\r
 #define S_IFBLK  _S_IFBLK\r
 #define S_IFREG  _S_IFREG\r
-//#define S_IFIFO  _S_IFIFO\r
-//#define S_IFCHR  _S_IFCHR\r
-//#define S_IFDIR  _S_IFDIR\r
+#define S_IFIFO  _S_IFIFO\r
+#define S_IFCHR  _S_IFCHR\r
+#define S_IFDIR  _S_IFDIR\r
 //#define S_IFLNK  _S_IFLNK\r
 //#define S_ISVTX  _S_ISVTX\r
-//#define S_IFSOCK _S_IFSOCK\r
+#define S_IFSOCK _S_IFSOCK\r
 //#define S_IFWHT  _S_IFWHT\r
 \r
 //#define S_ARCH1 _S_ARCH1\r
@@ -163,7 +167,7 @@ struct stat {
 #define S_ISBLK(m)  ((m & _S_IFMT) == _S_IFBLK) /* block special */\r
 #define S_ISSOCK(m) ((m & _S_IFMT) == _S_IFSOCK)  /* socket */\r
 \r
-//#define S_ISFIFO(m) ((m & _S_IFMT) == _S_IFIFO) /* fifo */\r
+#define S_ISFIFO(m) ((m & _S_IFMT) == _S_IFIFO) /* fifo */\r
 //#define S_ISLNK(m)  ((m & _S_IFMT) == _S_IFLNK) /* symbolic link */\r
 //#define S_ISWHT(m)  ((m & _S_IFMT) == _S_IFWHT) /* whiteout */\r
 \r