IPC API  3.10.02.13
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
MmRpc.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  */
32 
43 #ifndef ti_ipc_mm_MmRpc__include
44 #define ti_ipc_mm_MmRpc__include
45 
46 /* add includes here */
47 #include <stddef.h>
48 #include <stdint.h>
49 
50 #if defined(__cplusplus)
51 extern "C" {
52 #endif
53 
57 #define MmRpc_S_SUCCESS (0)
58 
62 #define MmRpc_E_FAIL (-1)
63 
67 #define MmRpc_E_INVALIDPARAM (-2)
68 
72 #define MmRpc_E_NOMEM (-3)
73 
77 #define MmRpc_E_SYS (-4)
78 
82 #define MmRpc_MAX_PARAMS (10)
83 
87 #define MmRpc_MAX_TRANSLATIONS (1024)
88 
104 #define MmRpc_OFFSET(base, field) ((unsigned int)(field)-(unsigned int)(base))
105 
109 typedef struct MmRpc_Object *MmRpc_Handle;
110 
114 typedef enum {
120 
124 typedef struct {
127  union {
128  struct {
129  size_t size;
130  size_t data;
131  } scalar;
132 
133  struct {
134  size_t size;
135  size_t addr;
136  size_t handle;
137  } ptr;
138 
139  struct {
140  size_t size;
141  size_t base;
142  size_t offset;
143  size_t handle;
144  } offPtr;
145 
146  } param;
147 } MmRpc_Param;
148 
149 typedef struct {
150  uint32_t index;
151  ptrdiff_t offset;
158  size_t base;
166  size_t handle;
167 } MmRpc_Xlt;
168 
172 typedef struct {
173  uint32_t fxn_id;
174  uint32_t num_params;
177  uint32_t num_xlts;
179 } MmRpc_FxnCtx;
180 
186 typedef enum {
189 } MmRpc_BufType;
190 
194 typedef union {
195  size_t handle;
197  struct {
198  size_t addr;
199  size_t size;
200  } ptr;
201 
202 } MmRpc_BufDesc;
203 
207 typedef struct {
208  int reserved;
209 } MmRpc_Params;
210 
215 int MmRpc_call(MmRpc_Handle handle, MmRpc_FxnCtx *ctx, int32_t *ret);
216 
221 int MmRpc_create(const char *service, const MmRpc_Params *params,
222  MmRpc_Handle *handlPtr);
223 
228 int MmRpc_delete(MmRpc_Handle *handlePtr);
229 
250 int MmRpc_release(MmRpc_Handle handle, MmRpc_BufType type, int num,
251  MmRpc_BufDesc *desc);
252 
291 int MmRpc_use(MmRpc_Handle handle, MmRpc_BufType type, int num,
292  MmRpc_BufDesc *desc);
293 
298 void MmRpc_Params_init(MmRpc_Params *params);
299 
300 
301 #if defined(__cplusplus)
302 }
303 #endif
304 #endif /* ti_ipc_mm_MmRpc__include */
Copyright 2013, Texas Instruments Incorporated