00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef __SYSCALLS_H__
00023 #define __SYSCALLS_H__
00024
00025 #define CMD_EXIT "DC00"
00026 #define CMD_FSTAT "DC01"
00027 #define CMD_WRITE "DD02"
00028 #define CMD_READ "DC03"
00029 #define CMD_OPEN "DC04"
00030 #define CMD_CLOSE "DC05"
00031 #define CMD_CREAT "DC06"
00032 #define CMD_LINK "DC07"
00033 #define CMD_UNLINK "DC08"
00034 #define CMD_CHDIR "DC09"
00035 #define CMD_CHMOD "DC10"
00036 #define CMD_LSEEK "DC11"
00037 #define CMD_TIME "DC12"
00038 #define CMD_STAT "DC13"
00039 #define CMD_UTIME "DC14"
00040 #define CMD_BAD "DC15"
00041 #define CMD_OPENDIR "DC16"
00042 #define CMD_CLOSEDIR "DC17"
00043 #define CMD_READDIR "DC18"
00044 #define CMD_CDFSREAD "DC19"
00045
00046 extern unsigned int syscall_retval;
00047
00048 typedef struct {
00049 unsigned char id[4] __attribute__ ((packed));
00050 unsigned int value0 __attribute__ ((packed));
00051 unsigned int value1 __attribute__ ((packed));
00052 unsigned int value2 __attribute__ ((packed));
00053 } command_3int_t;
00054
00055 typedef struct {
00056 unsigned char id[4] __attribute__ ((packed));
00057 unsigned int value0 __attribute__ ((packed));
00058 unsigned int value1 __attribute__ ((packed));
00059 unsigned char string[1] __attribute__ ((packed));
00060 } command_2int_string_t;
00061
00062 typedef struct {
00063 unsigned char id[4] __attribute__ ((packed));
00064 unsigned int value0 __attribute__ ((packed));
00065 } command_int_t;
00066
00067 typedef struct {
00068 unsigned char id[4] __attribute__ ((packed));
00069 unsigned int value0 __attribute__ ((packed));
00070 unsigned char string[1] __attribute__ ((packed));
00071 } command_int_string_t;
00072
00073 typedef struct {
00074 unsigned char id[4] __attribute__ ((packed));
00075 unsigned char string[1] __attribute__ ((packed));
00076 } command_string_t;
00077
00078 typedef struct {
00079 unsigned char id[4] __attribute__ ((packed));
00080 unsigned int value0 __attribute__ ((packed));
00081 unsigned int value1 __attribute__ ((packed));
00082 unsigned int value2 __attribute__ ((packed));
00083 unsigned char string[1] __attribute__ ((packed));
00084 } command_3int_string_t;
00085
00086 void build_send_packet(int command_len);
00087
00088
00089 struct dcload_dirent {
00090 long d_ino;
00091 off_t d_off;
00092 unsigned short d_reclen;
00093 unsigned char d_type;
00094 char d_name[256];
00095 };
00096
00097 typedef struct dcload_dirent dcload_dirent_t;
00098
00099 #define DIR dcload_dirent_t
00100
00101
00102
00103 struct dcload_stat {
00104 unsigned short st_dev;
00105 unsigned short st_ino;
00106 int st_mode;
00107 unsigned short st_nlink;
00108 unsigned short st_uid;
00109 unsigned short st_gid;
00110 unsigned short st_rdev;
00111 long st_size;
00112 long st_atime;
00113 long st_spare1;
00114 long st_mtime;
00115 long st_spare2;
00116 long st_ctime;
00117 long st_spare3;
00118 long st_blksize;
00119 long st_blocks;
00120 long st_spare4[2];
00121 };
00122
00123 typedef struct dcload_stat dcload_stat_t;
00124
00125
00126 #endif