X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=AcessNative%2Fsyscalls.h;h=158a6ccb7044d9a9c28bdc2419b9241b33d78921;hb=44e7e418917b0509d972b3693424a00fda9225a5;hp=2784fd02359b3f118559597e30e2ef445f22b14d;hpb=602ba046995f564d8ca4b85c873cbfcafed72d42;p=tpg%2Facess2.git diff --git a/AcessNative/syscalls.h b/AcessNative/syscalls.h index 2784fd02..158a6ccb 100644 --- a/AcessNative/syscalls.h +++ b/AcessNative/syscalls.h @@ -3,11 +3,87 @@ #ifndef _NATIVE_SYSCALLS_H_ #define _NATIVE_SYSCALLS_H_ +#define SERVER_PORT 0xACE + +/* + * Request format + * + * tRequestHeader header + * tRequestValue params[header.NParams] + * tRequestValue retvals[header.NReturn] + * uint8_t paramData[SUM(params[].Lengh)]; + */ + +typedef struct sRequestValue { + /// \see eArgumentTypes + uint16_t Type; + uint16_t Flags; + uint16_t Length; +} tRequestValue; + +typedef struct sRequestHeader { + uint16_t ClientID; + uint16_t CallID; //!< \see eSyscalls + uint16_t NParams; + + tRequestValue Params[]; +} tRequestHeader; + enum eSyscalls { SYS_NULL, - SYS_OPEN + + 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, + + 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" +}; +#endif + enum eArgumentTypes { ARG_TYPE_VOID, ARG_TYPE_INT32, @@ -15,9 +91,9 @@ enum eArgumentTypes { ARG_TYPE_STRING, ARG_TYPE_DATA }; - -#define ARG_DIR_TOSRV 0x10 -#define ARG_DIR_TOCLI 0x20 -#define ARG_DIR_BOTH 0x30 +enum eArgumentFlags { + ARG_FLAG_RETURN = 0x40, // Pass back in the return message + ARG_FLAG_ZEROED = 0x80 // Not present in the message, just fill with zero +}; #endif