aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/plat-omap/include/syslink/gatemp_ioctl.h
blob: ff99aebf2fc3f0fd88bce9d461ca09b7e1803d18 (plain) (blame)
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
/*
 *  gatemp_ioctl.h
 *
 *  Definitions of gatemp ioctl types and structures.
 *
 *  Copyright (C) 2008-2009 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 _GATEMP_IOCTL_H_
#define _GATEMP_IOCTL_H_

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

#include <ipc_ioctl.h>
#include <gatemp.h>

/* =============================================================================
 *  Macros and types
 * =============================================================================
 */
#define GATEMP_IOC_MAGIC		IPC_IOC_MAGIC
/*  IOCTL command ID definitions for GateMP */
enum CMD_GATEMP {
	GATEMP_GETCONFIG = GATEMP_BASE_CMD,
	GATEMP_SETUP,
	GATEMP_DESTROY,
	GATEMP_PARAMS_INIT,
	GATEMP_CREATE,
	GATEMP_DELETE,
	GATEMP_OPEN,
	GATEMP_CLOSE,
	GATEMP_ENTER,
	GATEMP_LEAVE,
	GATEMP_SHAREDMEMREQ,
	GATEMP_OPENBYADDR,
	GATEMP_GETDEFAULTREMOTE
};

/*
 *  IOCTL command IDs for GateMP
 */
/* Command for gatemp_get_config */
#define CMD_GATEMP_GETCONFIG		_IOWR(GATEMP_IOC_MAGIC,		\
					GATEMP_GETCONFIG,		\
					struct gatemp_cmd_args)
/* Command for gatemp_setup */
#define CMD_GATEMP_SETUP		_IOWR(GATEMP_IOC_MAGIC,		\
					GATEMP_SETUP,			\
					struct gatemp_cmd_args)
/* Command for gatemp_destroy */
#define CMD_GATEMP_DESTROY		_IOWR(GATEMP_IOC_MAGIC,		\
					GATEMP_DESTROY,			\
					struct gatemp_cmd_args)
/* Command for gatemp_params_init */
#define CMD_GATEMP_PARAMS_INIT		_IOWR(GATEMP_IOC_MAGIC,		\
					GATEMP_PARAMS_INIT,		\
					struct gatemp_cmd_args)
/* Command for gatemp_create */
#define CMD_GATEMP_CREATE		_IOWR(GATEMP_IOC_MAGIC,		\
					GATEMP_CREATE,			\
					struct gatemp_cmd_args)
/* Command for gatemp_delete */
#define CMD_GATEMP_DELETE		_IOWR(GATEMP_IOC_MAGIC,		\
					GATEMP_DELETE,			\
					struct gatemp_cmd_args)
/* Command for gatemp_open */
#define CMD_GATEMP_OPEN			_IOWR(GATEMP_IOC_MAGIC,		\
					GATEMP_OPEN,			\
					struct gatemp_cmd_args)
/* Command for gatemp_close */
#define CMD_GATEMP_CLOSE		_IOWR(GATEMP_IOC_MAGIC,		\
					GATEMP_CLOSE,			\
					struct gatemp_cmd_args)
/* Command for gatemp_enter */
#define CMD_GATEMP_ENTER		_IOWR(GATEMP_IOC_MAGIC,		\
					GATEMP_ENTER,			\
					struct gatemp_cmd_args)
/* Command for gatemp_leave */
#define CMD_GATEMP_LEAVE		_IOWR(GATEMP_IOC_MAGIC,		\
					GATEMP_LEAVE,			\
					struct gatemp_cmd_args)
/* Command for gatemp_shared_mem_req */
#define CMD_GATEMP_SHAREDMEMREQ		_IOWR(GATEMP_IOC_MAGIC,		\
					GATEMP_SHAREDMEMREQ,		\
					struct gatemp_cmd_args)
/* Command for gatemp_open_by_addr */
#define CMD_GATEMP_OPENBYADDR		_IOWR(GATEMP_IOC_MAGIC,		\
					GATEMP_OPENBYADDR,		\
					struct gatemp_cmd_args)
/* Command for gatemp_get_default_remote */
#define CMD_GATEMP_GETDEFAULTREMOTE	_IOWR(GATEMP_IOC_MAGIC,		\
					GATEMP_GETDEFAULTREMOTE,	\
					struct gatemp_cmd_args)

/* Command arguments for GateMP */
struct gatemp_cmd_args {
	union {
		struct {
			struct gatemp_params *params;
		} params_init;

		struct {
			struct gatemp_config *config;
		} get_config;

		struct {
			struct gatemp_config *config;
		} setup;

		struct {
			void *handle;
			struct gatemp_params *params;
			u32 name_len;
			u32 *shared_addr_srptr;
		} create;

		struct {
			void *handle;
		} delete_instance;

		struct {
			void *handle;
			char *name;
			u32 name_len;
			u32 *shared_addr_srptr;
		} open;

		struct {
			void *handle;
			u32 *shared_addr_srptr;
		} open_by_addr;

		struct {
			void *handle;
		} close;

		struct {
			void *handle;
			int *flags;
		} enter;

		struct {
			void *handle;
			int *flags;
		} leave;

		struct {
			struct gatemp_params *params;
			u32 ret_val;
		} shared_mem_req;

		struct {
			void *handle;
		} get_default_remote;
	} args;

	s32 api_status;
};


/*
 * ioctl interface function for gatemp
 */
int gatemp_ioctl(struct inode *inode, struct file *filp,
			unsigned int cmd, unsigned long args, bool user);

#endif /* _GATEMP_IOCTL_H_ */