index 844246328da8ae242d743212ae245474969da137..ed8f000e50c699e7853d677142d1ee5b9707fd48 100644 (file)
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-/** ============================================================================
- * @file MmRpc.h
+/**
+ * @file ti/ipc/mm/MmRpc.h
*
* @brief Multi-Media derived Remote Procedure Call
*
- * ============================================================================
+ * @note MmRpc is currently only available for Linux and QNX.
+ *
+ *
*/
#ifndef ti_ipc_mm_MmRpc__include
#include <stddef.h>
#include <stdint.h>
-#if defined (__cplusplus)
+#if defined(__cplusplus)
extern "C" {
#endif
*/
#define MmRpc_E_FAIL (-1)
+/*!
+ * @brief Invalid parameter type
+ */
+#define MmRpc_E_INVALIDPARAM (-2)
+
/*!
* @brief Size of parameter array in function context structure
*/
-#define MmRpc_MAX_PARAMETERS (10)
+#define MmRpc_MAX_PARAMS (10)
/*!
* @brief Maximum size of translation array in function context structure
*/
#define MmRpc_MAX_TRANSLATIONS (1024)
+/*!
+ * @brief Macro for computing offset to a field of a structure.
+ *
+ * @code
+ * struct foobar {
+ * int a;
+ * int *p;
+ * };
+ *
+ * struct foobar *sp = ...;
+ * offset = MmRpc_OFFSET(sp, &sp->p);
+ * struct foobar st = ...;
+ * offset = MmRpc_OFFSET(&st, &st.p);
+ * @endcode
+ */
+#define MmRpc_OFFSET(base, field) ((unsigned int)(field)-(unsigned int)(base))
+
/*!
* @brief MmRpc_Handle type
*/
* @brief MmRpc_ParamType enum
*/
typedef enum {
- MmRpc_ParamType_Atomic = 1, /*!< atomic data type */
+ MmRpc_ParamType_Scalar = 1, /*!< pass by value */
MmRpc_ParamType_Ptr, /*!< data pointer */
- MmRpc_ParamType_PtrOffset /*!< pointer offset */
+ MmRpc_ParamType_OffPtr, /*!< buffer at offset in memory block */
+ MmRpc_ParamType_Elem /*!< array element */
} MmRpc_ParamType;
/*!
union {
struct {
size_t size; /*!< size of the data */
- size_t data; /*!< atomic data */
- } atomic;
+ size_t data; /*!< data (pass by value)*/
+ } scalar;
struct {
- size_t size; /*!< size of the data */
+ size_t size; /*!< size of the data referenced */
size_t addr; /*!< pointer value */
size_t handle; /*!< memory allocator handle */
} ptr;
struct {
- size_t size; /*!< size of the data */
- size_t offset; /*!< offset value */
- size_t base; /*!< base pointer value */
+ size_t size; /*!< size (bytes) of memory block */
+ size_t base; /*!< base address of memory block */
+ size_t offset; /*!< offset (bytes) from base to data */
size_t handle; /*!< memory allocator handle */
- } ptrOffset;
+ } offPtr;
+
+#if 0 /* TBD */
+ struct {
+ size_t size; /*!< size of the array element */
+ size_t offset; /*!< offset to current array element */
+ size_t base; /*!< base address of array */
+ size_t handle; /*!< memory allocator handle */
+ } elem;
+#endif
} param;
} MmRpc_Param;
typedef struct {
uint32_t index; /*!< parameter index to base pointer */
ptrdiff_t offset; /*!< offset from the base address to pointer */
- size_t base; /*!< user virtual address */
-} MmRpc_Txlt;
+ size_t handle; /*!< memory allocator handle */
+} MmRpc_Xlt;
/*!
* @brief Function call context structure
*/
typedef struct {
- uint32_t fxn_id; /*!< The function to call. */
- uint32_t num_params; /*!< Number of elements in param array. */
- MmRpc_Param params[MmRpc_MAX_PARAMETERS];
- /*!< The array of parameters */
- uint32_t num_translations;
- /*!< The number of translations needed
- * in the offsets array */
- MmRpc_Txlt *translations; /*!< array of translations */
+ uint32_t fxn_id; /*!< function id to call */
+ uint32_t num_params; /*!< number of parameters in params array */
+ MmRpc_Param params[MmRpc_MAX_PARAMS];
+ /*!< the array of parameters */
+ uint32_t num_xlts; /*!< number of translations in xltAry */
+ MmRpc_Xlt * xltAry; /*!< array of translations */
} MmRpc_FxnCtx;
/*!
* @brief Create an MmRpc instance
*
*/
-int MmRpc_create(const char *proc, const char *service,
- const MmRpc_Params *params, MmRpc_Handle *handlPtr);
+int MmRpc_create(const char *service, const MmRpc_Params *params,
+ MmRpc_Handle *handlPtr);
/*!
* @brief Delete an MmRpc instance
-#if defined (__cplusplus)
+#if defined(__cplusplus)
}
#endif
#endif /* ti_ipc_mm_MmRpc__include */