Merge branch 'master' of git://cadel.mutabah.net/acess2
[tpg/acess2.git] / AcessNative / syscalls.h
index 4a64474..a9768c4 100644 (file)
@@ -5,6 +5,14 @@
 
 #define        SERVER_PORT     0xACE
 
+#define SYSCALL_TRACE  1
+
+#if SYSCALL_TRACE
+#define SYSTRACE(str, x...)    do{ if(gbSyscallDebugEnabled)Debug(str, x); }while(0)
+#else
+#define SYSTRACE(...)  do{}while(0)
+#endif
+
 /*
  * Request format
  * 
  * uint8_t     paramData[SUM(params[].Lengh)];
  */
 
+typedef struct {
+       uint32_t        pid;
+       uint32_t        key;
+} tRequestAuthHdr;
+
 typedef struct sRequestValue {
        /// \see eArgumentTypes
        uint16_t        Type;
-        uint8_t        Flags;
-       uint16_t        Length;
+       uint16_t        Flags;
+       uint32_t        Length;
 }      tRequestValue;
 
 typedef struct sRequestHeader {
-       uint16_t        ClientID;
+       uint32_t        ClientID;
+       uint32_t        MessageLength;
        uint16_t        CallID; //!< \see eSyscalls
        uint16_t        NParams;
        
        tRequestValue   Params[];
-}      tRequestHeader;
+} __attribute__((packed))      tRequestHeader;
+
 
 enum eSyscalls {
-       SYS_NULL,
-       SYS_OPEN,
-       SYS_CLOSE,
-       SYS_READ,
-       SYS_WRITE,
-       SYS_SEEK,
-       SYS_TELL,
-       SYS_IOCTL,
-       SYS_FINFO,
-       SYS_READDIR,
-       SYS_OPENCHILD,
-       SYS_GETACL,
-       SYS_MOUNT,
+       #define _(n) n
+       #include "syscalls_list.h"
+       #undef _
        N_SYSCALLS
 };
 
+#ifndef DONT_INCLUDE_SYSCALL_NAMES
+static const char * casSYSCALL_NAMES[] = {
+       #define _(n) #n
+       #include "syscalls_list.h"
+       #undef _
+       "-"
+};
+#endif
+
 enum eArgumentTypes {
        ARG_TYPE_VOID,
        ARG_TYPE_INT32,

UCC git Repository :: git.ucc.asn.au