summaryrefslogtreecommitdiff
path: root/src/common/include/tce
diff options
context:
space:
mode:
authorAlex AUVOLAT <alexis211@gmail.com>2012-05-17 13:30:09 +0200
committerAlex AUVOLAT <alexis211@gmail.com>2012-05-17 13:30:09 +0200
commit7c9a48b4e6d66cf4f62e7bad9e22ab06923e47ef (patch)
treedf44a926f105c913c77525d35441d20a632f1440 /src/common/include/tce
parentc6d35a5f4fdda6ae2e98498f19a4adaee6d95692 (diff)
downloadTCE-7c9a48b4e6d66cf4f62e7bad9e22ab06923e47ef.tar.gz
TCE-7c9a48b4e6d66cf4f62e7bad9e22ab06923e47ef.zip
Beginning of a VFS implemented. C++ is great.
Diffstat (limited to 'src/common/include/tce')
-rw-r--r--src/common/include/tce/syscalls.h27
-rw-r--r--src/common/include/tce/vfs.h42
2 files changed, 65 insertions, 4 deletions
diff --git a/src/common/include/tce/syscalls.h b/src/common/include/tce/syscalls.h
index 3b5b68f..6c67523 100644
--- a/src/common/include/tce/syscalls.h
+++ b/src/common/include/tce/syscalls.h
@@ -9,11 +9,30 @@
#define SC_THREAD_NEW 6
#define SC_IRQ_WAIT 7
#define SC_PROC_PRIV 8
-#define SC_SBRK 9
-#define SC_BRK 10
+#define SC_SBRK 10
+#define SC_BRK 11
// NOT YET IMPLEMENTED
-#define SC_MMAP 11
-#define SC_MUNMAP 12
+#define SC_MMAP 12
+#define SC_MUNMAP 13
+
+#define SC_OPEN 20
+#define SC_OPEN_RELATIVE 21
+#define SC_STAT 22
+#define SC_STAT_RELATIVE 23
+#define SC_STATF 24
+#define SC_CLOSE 25
+#define SC_READ 26
+#define SC_WRITE 27
+#define SC_LINK 28
+
+
+// ERRORS
+#define E_NOT_IMPLEMENTED -1
+#define E_NOT_FOUND -2
+#define E_INVALID_FD -3
+#define E_TOO_SHORT -4 // not enough space for data to be copied to
+#define E_INVALID_RANGE -5
+#define E_INVALID -6 // anything went wrong - invalid parameter, usually
#endif
diff --git a/src/common/include/tce/vfs.h b/src/common/include/tce/vfs.h
new file mode 100644
index 0000000..20ea03b
--- /dev/null
+++ b/src/common/include/tce/vfs.h
@@ -0,0 +1,42 @@
+#ifndef DEF_TCE_VFS_H
+#define DEF_TCE_VFS_H
+
+#include <types.h>
+
+typedef size_t FILE;
+
+typedef struct _file_info {
+ uint32_t type;
+ uint32_t dev_type;
+ uint32_t mode;
+ uint32_t uid, gid;
+ size_t size;
+} file_info;
+
+// file open flags
+#define FM_READ 0x00000001
+#define FM_WRITE 0x00000002
+#define FM_APPEND 0x00000004
+#define FM_TRUNC 0x00000008
+#define FM_CREATE 0x00000010
+#define FM_DELETE 0x00000020
+
+// link modes
+#define LM_SYMLINK 1
+#define LM_HARDLINK 2
+#define LM_MOUNT 3
+#define LM_OUTPUT_TO 4
+
+// file type flags
+#define FT_FILE 0x00000001
+#define FT_DIR 0x00000002
+#define FT_SYMLINK 0x00000004
+#define FT_DEV 0x00000008
+#define FT_TERMINAL 0x00000010
+
+// device types
+#define DT_BLOCK 1
+#define DT_KEYBOARD 2
+#define DT_DISPLAY 3
+
+#endif