XenevaOS
Loading...
Searching...
No Matches
auipc.h
Go to the documentation of this file.
1
20#ifndef __AUIPC_H__
21#define __AUIPC_H__
22
23#include <stdint.h>
24
25#define IPC_MAX_MSG 8192
26#define IPC_NAME_MAX 24
27
28#define IPC_IOC_CREATE 0x5601 /* IpcCreate -> handle */
29#define IPC_IOC_DESTROY 0x5602 /* IpcHandle */
30#define IPC_IOC_CONNECT 0x5603 /* IpcConnect -> handle */
31#define IPC_IOC_CALL 0x5604 /* IpcCall (sleeps) */
32#define IPC_IOC_FETCH 0x5605 /* IpcFetch */
33#define IPC_IOC_WAIT 0x5606 /* IpcWait (sleeps) */
34#define IPC_IOC_RECV 0x5607 /* IpcRecv */
35#define IPC_IOC_REPLY 0x5608 /* IpcReply */
36
37#define IPC_ACL_ANY 0 /* any process may call */
38#define IPC_ACL_DAEMONS 1 /* only MISC_DAEMONS processes may call */
39
40#define IPC_OK 0
41#define IPC_E_PERM -1
42#define IPC_E_INVAL -2
43#define IPC_E_NOENT -3
44#define IPC_E_BUSY -4 /* endpoint queue full / name taken */
45#define IPC_E_TIMEOUT -5
46#define IPC_E_DEAD -6 /* the server went away */
47#define IPC_E_EMPTY -7
48#define IPC_E_TOOBIG -8
49
50typedef struct { char name[IPC_NAME_MAX]; uint32_t acl; int32_t handle; } IpcCreate;
51typedef struct { char name[IPC_NAME_MAX]; int32_t handle; uint32_t reserved; } IpcConnect;
52typedef struct { int32_t handle; uint32_t reserved; } IpcHandle;
53
54typedef struct {
56 uint32_t timeout_ms; /* 1..5000 */
57 const void* req;
59 int32_t status; /* IPC_OK once the reply is in; else IPC_E_* */
60 int32_t call_id; /* out: pass to FETCH */
62} IpcCall;
63
64typedef struct {
66 int32_t status; /* out: IPC_OK, or why there is no reply */
67 void* resp;
69 uint32_t resp_len; /* out */
70 int32_t server_status; /* out: the status the server put in its REPLY */
72} IpcFetch;
73
74typedef struct { int32_t handle; uint32_t timeout_ms; int32_t status; uint32_t reserved; } IpcWait;
75
76typedef struct {
78 int32_t call_id; /* out */
79 void* buf;
81 uint32_t len; /* out: request length */
82 int32_t sender_pid, sender_uid, sender_gid; /* out: from the kernel */
83 int32_t status; /* out: IPC_OK / IPC_E_EMPTY / IPC_E_TOOBIG */
84} IpcRecv;
85
86typedef struct {
89 const void* resp;
91 int32_t server_status; /* delivered to the caller as IpcFetch.server_status */
93} IpcReply;
94
95#endif
int int32_t
Definition acefiex.h:160
unsigned int uint32_t
Definition acefiex.h:163
#define IPC_NAME_MAX
Definition auipc.h:26
struct drm_crtc struct drm_plane struct drm_plane const struct drm_crtc_funcs const char * name
Definition drm_crtc.h:1242
Definition auipc.h:54
int32_t status
Definition auipc.h:59
int32_t handle
Definition auipc.h:55
uint32_t timeout_ms
Definition auipc.h:56
const void * req
Definition auipc.h:57
uint32_t req_len
Definition auipc.h:58
int32_t call_id
Definition auipc.h:60
uint32_t reserved
Definition auipc.h:61
Definition auipc.h:51
int32_t handle
Definition auipc.h:51
Definition auipc.h:50
uint32_t acl
Definition auipc.h:50
Definition auipc.h:64
uint32_t resp_cap
Definition auipc.h:68
int32_t status
Definition auipc.h:66
void * resp
Definition auipc.h:67
int32_t server_status
Definition auipc.h:70
uint32_t reserved
Definition auipc.h:71
int32_t call_id
Definition auipc.h:65
uint32_t resp_len
Definition auipc.h:69
Definition auipc.h:52
int32_t handle
Definition auipc.h:52
Definition auipc.h:76
int32_t call_id
Definition auipc.h:78
uint32_t len
Definition auipc.h:81
int32_t status
Definition auipc.h:83
uint32_t cap
Definition auipc.h:80
int32_t handle
Definition auipc.h:77
int32_t sender_gid
Definition auipc.h:82
void * buf
Definition auipc.h:79
Definition auipc.h:86
uint32_t reserved
Definition auipc.h:92
const void * resp
Definition auipc.h:89
int32_t call_id
Definition auipc.h:88
int32_t server_status
Definition auipc.h:91
uint32_t len
Definition auipc.h:90
int32_t handle
Definition auipc.h:87
Definition auipc.h:74
int32_t handle
Definition auipc.h:74