AxWin2 - Debugging and misc
[tpg/acess2.git] / AcessNative / syscalls.h
1 /**
2  */
3 #ifndef _NATIVE_SYSCALLS_H_
4 #define _NATIVE_SYSCALLS_H_
5
6 #define SERVER_PORT     0xACE
7
8 /*
9  * Request format
10  * 
11  * tRequestHeader       header
12  * tRequestValue        params[header.NParams]
13  * tRequestValue        retvals[header.NReturn]
14  * uint8_t      paramData[SUM(params[].Lengh)];
15  */
16
17 typedef struct sRequestValue {
18         /// \see eArgumentTypes
19         uint16_t        Type;
20         uint16_t        Flags;
21         uint16_t        Length;
22 }       tRequestValue;
23
24 typedef struct sRequestHeader {
25         uint16_t        ClientID;
26         uint16_t        CallID; //!< \see eSyscalls
27         uint16_t        NParams;
28         
29         tRequestValue   Params[];
30 }       tRequestHeader;
31
32 enum eSyscalls {
33         SYS_NULL,
34         
35         SYS_EXIT,
36         
37         SYS_OPEN,
38         SYS_CLOSE,
39         SYS_READ,
40         SYS_WRITE,
41         SYS_SEEK,
42         SYS_TELL,
43         SYS_IOCTL,
44         SYS_FINFO,
45         SYS_READDIR,
46         SYS_OPENCHILD,
47         SYS_GETACL,
48         SYS_MOUNT,
49         SYS_REOPEN,
50         
51         SYS_WAITTID,
52         SYS_SETUID,
53         SYS_SETGID,
54         
55         // IPC
56         SYS_SLEEP,
57         SYS_FORK,
58         
59         N_SYSCALLS
60 };
61
62 #ifndef DONT_INCLUDE_SYSCALL_NAMES
63 static const char * casSYSCALL_NAMES[] = {
64         "SYS_NULL",
65         
66         "SYS_EXIT",
67         
68         "SYS_OPEN",
69         "SYS_CLOSE",
70         "SYS_READ",
71         "SYS_WRITE",
72         "SYS_SEEK",
73         "SYS_TELL",
74         "SYS_IOCTL",
75         "SYS_FINFO",
76         "SYS_READDIR",
77         "SYS_OPENCHILD",
78         "SYS_GETACL",
79         "SYS_MOUNT",
80         "SYS_REOPEN",
81         
82         // IPC
83         "SYS_SLEEP"
84 };
85 #endif
86
87 enum eArgumentTypes {
88         ARG_TYPE_VOID,
89         ARG_TYPE_INT32,
90         ARG_TYPE_INT64,
91         ARG_TYPE_STRING,
92         ARG_TYPE_DATA
93 };
94 enum eArgumentFlags {
95         ARG_FLAG_RETURN = 0x40, // Pass back in the return message
96         ARG_FLAG_ZEROED = 0x80  // Not present in the message, just fill with zero
97 };
98
99 #endif

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