Usermode/axwin3 - Commenting
[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         SYS_CHDIR,
51         
52         SYS_WAITTID,
53         SYS_SETUID,
54         SYS_SETGID,
55
56         SYS_GETTID,
57         SYS_GETPID,
58         SYS_GETUID,
59         SYS_GETGID,
60
61         // IPC
62         SYS_SLEEP,
63         SYS_AN_FORK,
64         SYS_SENDMSG,
65         SYS_GETMSG,
66         SYS_SELECT,
67         SYS_WAITEVENT,
68         
69         N_SYSCALLS
70 };
71
72 #ifndef DONT_INCLUDE_SYSCALL_NAMES
73 static const char * casSYSCALL_NAMES[] = {
74         "SYS_NULL",
75         
76         "SYS_EXIT",
77         
78         "SYS_OPEN",
79         "SYS_CLOSE",
80         "SYS_READ",
81         "SYS_WRITE",
82         "SYS_SEEK",
83         "SYS_TELL",
84         "SYS_IOCTL",
85         "SYS_FINFO",
86         "SYS_READDIR",
87         "SYS_OPENCHILD",
88         "SYS_GETACL",
89         "SYS_MOUNT",
90         "SYS_REOPEN",
91         "SYS_CHDIR",
92         
93         "SYS_WAITTID",
94         "SYS_SETUID",
95         "SYS_SETGID",
96         
97         "SYS_GETTID",
98         "SYS_GETPID",
99         "SYS_GETUID",
100         "SYS_GETGID",
101         
102         // IPC
103         "SYS_SLEEP",
104         "SYS_AN_FORK",
105         "SYS_SENDMSG",
106         "SYS_GETMSG",
107         "SYS_SELECT",
108         "SYS_WAITEVENT"
109 };
110 #endif
111
112 enum eArgumentTypes {
113         ARG_TYPE_VOID,
114         ARG_TYPE_INT32,
115         ARG_TYPE_INT64,
116         ARG_TYPE_STRING,
117         ARG_TYPE_DATA
118 };
119 enum eArgumentFlags {
120         ARG_FLAG_RETURN = 0x40, // Pass back in the return message
121         ARG_FLAG_ZEROED = 0x80  // Not present in the message, just fill with zero
122 };
123
124 #endif

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