X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=AcessNative%2Fsyscalls.h;h=a9768c419be17c2137e82466b1855d68d12966bb;hb=3c283c4831c40c14d308a54cefb997832a860bca;hp=158a6ccb7044d9a9c28bdc2419b9241b33d78921;hpb=3764c294f21229bdf700f436fa4884f5e76e0d3a;p=tpg%2Facess2.git diff --git a/AcessNative/syscalls.h b/AcessNative/syscalls.h index 158a6ccb..a9768c41 100644 --- a/AcessNative/syscalls.h +++ b/AcessNative/syscalls.h @@ -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 * @@ -14,73 +22,41 @@ * uint8_t paramData[SUM(params[].Lengh)]; */ +typedef struct { + uint32_t pid; + uint32_t key; +} tRequestAuthHdr; + typedef struct sRequestValue { /// \see eArgumentTypes uint16_t Type; uint16_t Flags; - uint16_t Length; + 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_EXIT, - - SYS_OPEN, - SYS_CLOSE, - SYS_READ, - SYS_WRITE, - SYS_SEEK, - SYS_TELL, - SYS_IOCTL, - SYS_FINFO, - SYS_READDIR, - SYS_OPENCHILD, - SYS_GETACL, - SYS_MOUNT, - SYS_REOPEN, - - SYS_WAITTID, - SYS_SETUID, - SYS_SETGID, - - // IPC - SYS_SLEEP, - SYS_FORK, - + #define _(n) n + #include "syscalls_list.h" + #undef _ N_SYSCALLS }; #ifndef DONT_INCLUDE_SYSCALL_NAMES static const char * casSYSCALL_NAMES[] = { - "SYS_NULL", - - "SYS_EXIT", - - "SYS_OPEN", - "SYS_CLOSE", - "SYS_READ", - "SYS_WRITE", - "SYS_SEEK", - "SYS_TELL", - "SYS_IOCTL", - "SYS_FINFO", - "SYS_READDIR", - "SYS_OPENCHILD", - "SYS_GETACL", - "SYS_MOUNT", - "SYS_REOPEN", - - // IPC - "SYS_SLEEP" + #define _(n) #n + #include "syscalls_list.h" + #undef _ + "-" }; #endif