IPC API  3.40.00.06
GateMP.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2012-2015, 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  */
79 #ifndef ti_ipc_GateMP__include
80 #define ti_ipc_GateMP__include
81 
82 #if defined (__cplusplus)
83 extern "C" {
84 #endif
85 
86 /* =============================================================================
87  * All success and failure codes for the module
88  * =============================================================================
89  */
90 
94 #define GateMP_S_BUSY (2)
95 
99 #define GateMP_S_ALREADYSETUP (1)
100 
104 #define GateMP_S_SUCCESS (0)
105 
109 #define GateMP_E_FAIL (-1)
110 
114 #define GateMP_E_INVALIDARG (-2)
115 
119 #define GateMP_E_MEMORY (-3)
120 
124 #define GateMP_E_ALREADYEXISTS (-4)
125 
129 #define GateMP_E_NOTFOUND (-5)
130 
134 #define GateMP_E_TIMEOUT (-6)
135 
139 #define GateMP_E_INVALIDSTATE (-7)
140 
143 #define GateMP_E_OSFAILURE (-8)
144 
147 #define GateMP_E_RESOURCE (-9)
148 
151 #define GateMP_E_RESTART (-10)
152 
153 /* =============================================================================
154  * Structures & Enums
155  * =============================================================================
156  */
157 
170 typedef enum GateMP_LocalProtect {
187 
188 
202 typedef enum GateMP_RemoteProtect {
218 
222 typedef struct GateMP_Object *GateMP_Handle;
223 
227 typedef struct GateMP_Params {
228  String name;
239  UInt16 regionId;
250  Ptr sharedAddr;
275 } GateMP_Params;
276 
277 /* =============================================================================
278  * GateMP Module-wide Functions
279  * =============================================================================
280  */
281 
289 Int GateMP_close(GateMP_Handle *handlePtr);
290 
300 GateMP_Handle GateMP_create(const GateMP_Params *params);
301 
309 Int GateMP_delete(GateMP_Handle *handlePtr);
310 
316 GateMP_Handle GateMP_getDefaultRemote(Void);
317 
323 GateMP_LocalProtect GateMP_getLocalProtect(GateMP_Handle handle);
324 
330 GateMP_RemoteProtect GateMP_getRemoteProtect(GateMP_Handle handle);
331 
344 Int GateMP_open(String name, GateMP_Handle *handlePtr);
345 
347 Int GateMP_openByAddr(Ptr sharedAddr, GateMP_Handle *handlePtr);
348 
357 Void GateMP_Params_init(GateMP_Params *params);
358 
368 SizeT GateMP_sharedMemReq(const GateMP_Params *params);
369 
372 /* =============================================================================
373  * GateMP Per-instance Functions
374  * =============================================================================
375  */
376 
384 IArg GateMP_enter(GateMP_Handle handle);
385 
392 Void GateMP_leave(GateMP_Handle handle, IArg key);
393 
394 #if defined (__cplusplus)
395 }
396 #endif /* defined (__cplusplus) */
397 #endif /* ti_ipc_GateMP__include */
Structure defining parameters for the GateMP module.
Definition: GateMP.h:227
Definition: GateMP.h:203
Int GateMP_delete(GateMP_Handle *handlePtr)
Delete a created GateMP instance.
Definition: GateMP.h:171
GateMP_RemoteProtect
Type of remote Gate.
Definition: GateMP.h:202
Int GateMP_open(String name, GateMP_Handle *handlePtr)
Open a created GateMP by name.
Definition: GateMP.h:208
struct GateMP_Object * GateMP_Handle
GateMP_Handle type.
Definition: GateMP.h:222
GateMP_LocalProtect localProtect
Definition: GateMP.h:264
UInt16 regionId
Definition: GateMP.h:239
String name
Definition: GateMP.h:228
Definition: GateMP.h:183
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:170
Definition: GateMP.h:177
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:211
GateMP_RemoteProtect remoteProtect
Definition: GateMP.h:270
GateMP_RemoteProtect GateMP_getRemoteProtect(GateMP_Handle handle)
Get the remote protection level configured in a GateMP instance.
Definition: GateMP.h:174
Definition: GateMP.h:214
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:180
Copyright 2015, Texas Instruments Incorporated