IPC API  3.00.03.28
 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 */
Copyright 2013, Texas Instruments Incorporated