summaryrefslogtreecommitdiff
path: root/arch/arm/plat-omap/include/syslink/sharedregion_ioctl.h
blob: adff03f04342ca530bc4b97fbfd8141c9d3a9948 (plain)
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
/*
 *  sharedregion_ioctl.h
 *
 *  The sharedregion module is designed to be used in a
 *  multi-processor environment where there are memory regions
 *  that are shared and accessed across different processors
 *
 *  Copyright (C) 2008-2010 Texas Instruments, Inc.
 *
 *  This package is free software; you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License version 2 as
 *  published by the Free Software Foundation.
 *
 *  THIS PACKAGE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
 *  IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
 *  WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
 *  PURPOSE.
 */

#ifndef _SHAREDREGION_IOCTL_H
#define _SHAREDREGION_IOCTL_H

#include <linux/ioctl.h>
#include <linux/types.h>

#include <ipc_ioctl.h>
#include <sharedregion.h>

enum CMD_SHAREDREGION {
	SHAREDREGION_GETCONFIG = SHAREDREGION_BASE_CMD,
	SHAREDREGION_SETUP,
	SHAREDREGION_DESTROY,
	SHAREDREGION_START,
	SHAREDREGION_STOP,
	SHAREDREGION_ATTACH,
	SHAREDREGION_DETACH,
	SHAREDREGION_GETHEAP,
	SHAREDREGION_CLEARENTRY,
	SHAREDREGION_SETENTRY,
	SHAREDREGION_RESERVEMEMORY,
	SHAREDREGION_CLEARRESERVEDMEMORY,
	SHAREDREGION_GETREGIONINFO
};

/*
 *  IOCTL command IDs for sharedregion
 *
 */

/*
 *  Command for sharedregion_get_config
 */
#define CMD_SHAREDREGION_GETCONFIG	_IOWR(IPC_IOC_MAGIC,		\
					SHAREDREGION_GETCONFIG,		\
					struct sharedregion_cmd_args)
/*
 *  Command for sharedregion_setup
 */
#define CMD_SHAREDREGION_SETUP		_IOWR(IPC_IOC_MAGIC,		\
					SHAREDREGION_SETUP,		\
					struct sharedregion_cmd_args)
/*
 *  Command for sharedregion_setup
 */
#define CMD_SHAREDREGION_DESTROY	_IOWR(IPC_IOC_MAGIC,		\
					SHAREDREGION_DESTROY,		\
					struct sharedregion_cmd_args)
/*
 *  Command for sharedregion_start
 */
#define CMD_SHAREDREGION_START		_IOWR(IPC_IOC_MAGIC,		\
					SHAREDREGION_START,		\
					struct sharedregion_cmd_args)
/*
 *  Command for sharedregion_stop
 */
#define CMD_SHAREDREGION_STOP		_IOWR(IPC_IOC_MAGIC,		\
					SHAREDREGION_STOP,		\
					struct sharedregion_cmd_args)
/*
 *  Command for sharedregion_attach
 */
#define CMD_SHAREDREGION_ATTACH		_IOWR(IPC_IOC_MAGIC,		\
					SHAREDREGION_ATTACH,		\
					struct sharedregion_cmd_args)
/*
 *  Command for sharedregion_detach
 */
#define CMD_SHAREDREGION_DETACH		_IOWR(IPC_IOC_MAGIC,		\
					SHAREDREGION_DETACH,		\
					struct sharedregion_cmd_args)
/*
 *  Command for sharedregion_get_heap
 */
#define CMD_SHAREDREGION_GETHEAP	_IOWR(IPC_IOC_MAGIC,		\
					SHAREDREGION_GETHEAP,		\
					struct sharedregion_cmd_args)
/*
 *  Command for sharedregion_clear_entry
 */
#define CMD_SHAREDREGION_CLEARENTRY	_IOWR(IPC_IOC_MAGIC,		\
					SHAREDREGION_CLEARENTRY,	\
					struct sharedregion_cmd_args)
/*
 *  Command for sharedregion_set_entry
 */
#define CMD_SHAREDREGION_SETENTRY	_IOWR(IPC_IOC_MAGIC,		\
					SHAREDREGION_SETENTRY,		\
					struct sharedregion_cmd_args)
/*
 *  Command for sharedregion_reserve_memory
 */
#define CMD_SHAREDREGION_RESERVEMEMORY	_IOWR(IPC_IOC_MAGIC,		\
					SHAREDREGION_RESERVEMEMORY,	\
					struct sharedregion_cmd_args)
/*
 *  Command for sharedregion_clear_reserved_memory
 */
#define CMD_SHAREDREGION_CLEARRESERVEDMEMORY				\
					_IOWR(IPC_IOC_MAGIC,		\
					SHAREDREGION_CLEARRESERVEDMEMORY, \
					struct sharedregion_cmd_args)
/*
 *  Command for sharedregion_get_region_info
 */
#define CMD_SHAREDREGION_GETREGIONINFO	_IOWR(IPC_IOC_MAGIC,		\
					SHAREDREGION_GETREGIONINFO,	\
					struct sharedregion_cmd_args)

/*
 *  Command arguments for sharedregion
 */
union sharedregion_arg {
	struct {
		struct sharedregion_config *config;
	} get_config;

	struct {
		struct sharedregion_region *regions;
		struct sharedregion_config *config;
	} setup;

	struct {
		struct sharedregion_region *regions;
	} get_region_info;

	struct {
		u16 remote_proc_id;
	} attach;

	struct {
		u16 remote_proc_id;
	} detach;

	struct {
		u16 id;
		void *heap_handle;
	} get_heap;

	struct {
		u16 id;
		struct sharedregion_entry entry;
	} set_entry;

	struct {
		u16 id;
	} clear_entry;

	struct {
		u16 id;
		u32 size;
	} reserve_memory;
};

/*
 *  Command arguments for sharedregion
 */
struct sharedregion_cmd_args {
	union sharedregion_arg args;
	s32 api_status;
};

/*
 *  This ioctl interface for sharedregion module
 */
int sharedregion_ioctl(struct inode *inode, struct file *filp,
			unsigned int cmd, unsigned long args, bool user);

#endif /* _SHAREDREGION_IOCTL_H */