forked from waninkoko/mload-module
-
Notifications
You must be signed in to change notification settings - Fork 0
/
ipc.h
81 lines (67 loc) · 1.14 KB
/
ipc.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
#ifndef _IPC_H_
#define _IPC_H_
#include "types.h"
/* IPC error codes */
#define IPC_ENOENT -6
#define IPC_ENOMEM -22
#define IPC_EINVAL -101
#define IPC_EACCESS -102
#define IPC_EEXIST -105
#define IPC_NOENT -106
/* IOS calls */
#define IOS_OPEN 0x01
#define IOS_CLOSE 0x02
#define IOS_READ 0x03
#define IOS_WRITE 0x04
#define IOS_SEEK 0x05
#define IOS_IOCTL 0x06
#define IOS_IOCTLV 0x07
/* IOCTL vector */
typedef struct iovec {
void *data;
u32 len;
} ioctlv;
/* IPC message */
typedef struct ipcmessage {
u32 command;
u32 result;
u32 fd;
union
{
struct
{
char *device;
u32 mode;
u32 resultfd;
} open;
struct
{
void *data;
u32 length;
} read, write;
struct
{
s32 offset;
s32 origin;
} seek;
struct
{
u32 command;
u32 *buffer_in;
u32 length_in;
u32 *buffer_io;
u32 length_io;
} ioctl;
struct
{
u32 command;
u32 num_in;
u32 num_io;
ioctlv *vector;
} ioctlv;
};
} ATTRIBUTE_PACKED ipcmessage;
/* Prototypes */
void InvalidateVector(ioctlv *vector, u32 inlen, u32 iolen);
void FlushVector(ioctlv *vector, u32 inlen, u32 iolen);
#endif