IPC API  3.23.01.03
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
GateMP.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2012-2013, Texas Instruments Incorporated
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  *
9  * * Redistributions of source code must retain the above copyright
10  * notice, this list of conditions and the following disclaimer.
11  *
12  * * Redistributions in binary form must reproduce the above copyright
13  * notice, this list of conditions and the following disclaimer in the
14  * documentation and/or other materials provided with the distribution.
15  *
16  * * Neither the name of Texas Instruments Incorporated nor the names of
17  * its contributors may be used to endorse or promote products derived
18  * from this software without specific prior written permission.
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
22  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
23  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
24  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
25  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
26  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
27  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
28  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
29  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
30  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31  */
81 #ifndef ti_ipc_GateMP__include
82 #define ti_ipc_GateMP__include
83 
84 #if defined (__cplusplus)
85 extern "C" {
86 #endif
87 
88 /* =============================================================================
89  * All success and failure codes for the module
90  * =============================================================================
91  */
92 
96 #define GateMP_S_BUSY (2)
97 
101 #define GateMP_S_ALREADYSETUP (1)
102 
106 #define GateMP_S_SUCCESS (0)
107 
111 #define GateMP_E_FAIL (-1)
112 
116 #define GateMP_E_INVALIDARG (-2)
117 
121 #define GateMP_E_MEMORY (-3)
122 
126 #define GateMP_E_ALREADYEXISTS (-4)
127 
131 #define GateMP_E_NOTFOUND (-5)
132 
136 #define GateMP_E_TIMEOUT (-6)
137 
141 #define GateMP_E_INVALIDSTATE (-7)
142 
145 #define GateMP_E_OSFAILURE (-8)
146 
149 #define GateMP_E_RESOURCE (-9)
150 
153 #define GateMP_E_RESTART (-10)
154 
155 /* =============================================================================
156  * Structures & Enums
157  * =============================================================================
158  */
159 
172 typedef enum GateMP_LocalProtect {
189 
190 
204 typedef enum GateMP_RemoteProtect {
220 
224 typedef struct GateMP_Object *GateMP_Handle;
225 
229 typedef struct GateMP_Params {
230  String name;
241  UInt16 regionId;
252  Ptr sharedAddr;
277 } GateMP_Params;
278 
279 /* =============================================================================
280  * GateMP Module-wide Functions
281  * =============================================================================
282  */
283 
291 Int GateMP_close(GateMP_Handle *handlePtr);
292 
302 GateMP_Handle GateMP_create(const GateMP_Params *params);
303 
311 Int GateMP_delete(GateMP_Handle *handlePtr);
312 
318 GateMP_Handle GateMP_getDefaultRemote(Void);
319 
325 GateMP_LocalProtect GateMP_getLocalProtect(GateMP_Handle handle);
326 
332 GateMP_RemoteProtect GateMP_getRemoteProtect(GateMP_Handle handle);
333 
346 Int GateMP_open(String name, GateMP_Handle *handlePtr);
347 
349 Int GateMP_openByAddr(Ptr sharedAddr, GateMP_Handle *handlePtr);
350 
359 Void GateMP_Params_init(GateMP_Params *params);
360 
370 SizeT GateMP_sharedMemReq(const GateMP_Params *params);
371 
374 /* =============================================================================
375  * GateMP Per-instance Functions
376  * =============================================================================
377  */
378 
386 IArg GateMP_enter(GateMP_Handle handle);
387 
394 Void GateMP_leave(GateMP_Handle handle, IArg key);
395 
396 #if defined (__cplusplus)
397 }
398 #endif /* defined (__cplusplus) */
399 #endif /* ti_ipc_GateMP__include */
Structure defining parameters for the GateMP module.
Definition: GateMP.h:229
Definition: GateMP.h:205
Int GateMP_delete(GateMP_Handle *handlePtr)
Delete a created GateMP instance.
Definition: GateMP.h:173
GateMP_RemoteProtect
Type of remote Gate.
Definition: GateMP.h:204
Int GateMP_open(String name, GateMP_Handle *handlePtr)
Open a created GateMP by name.
Definition: GateMP.h:210
struct GateMP_Object * GateMP_Handle
GateMP_Handle type.
Definition: GateMP.h:224
GateMP_LocalProtect localProtect
Definition: GateMP.h:266
UInt16 regionId
Definition: GateMP.h:241
String name
Definition: GateMP.h:230
Definition: GateMP.h:185
Int GateMP_close(GateMP_Handle *handlePtr)
Close an opened gate.
Void GateMP_leave(GateMP_Handle handle, IArg key)
Leave the GateMP.
GateMP_LocalProtect
A set of local context protection levels.
Definition: GateMP.h:172
Definition: GateMP.h:179
GateMP_Handle GateMP_getDefaultRemote(Void)
Get the default remote gate.
GateMP_LocalProtect GateMP_getLocalProtect(GateMP_Handle handle)
Get the local protection level configured in a GateMP instance.
IArg GateMP_enter(GateMP_Handle handle)
Enter the GateMP.
Definition: GateMP.h:213
GateMP_RemoteProtect remoteProtect
Definition: GateMP.h:272
GateMP_RemoteProtect GateMP_getRemoteProtect(GateMP_Handle handle)
Get the remote protection level configured in a GateMP instance.
Definition: GateMP.h:176
Definition: GateMP.h:216
struct GateMP_Params GateMP_Params
Structure defining parameters for the GateMP module.
Void GateMP_Params_init(GateMP_Params *params)
Initialize a GateMP parameters struct.
GateMP_Handle GateMP_create(const GateMP_Params *params)
Create a GateMP instance.
Definition: GateMP.h:182
Copyright 2014, Texas Instruments Incorporated