]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - ipc/ipcdev.git/commitdiff
Added offset pointer support to MmRcp.
authorRamsey Harris <ramsey@ti.com>
Thu, 8 Aug 2013 01:26:51 +0000 (18:26 -0700)
committerRamsey Harris <ramsey@ti.com>
Thu, 8 Aug 2013 16:47:04 +0000 (09:47 -0700)
New parameter type to support data pointers into managed memory
allocations such that the data pointer is offset from the base
address.

packages/ti/ipc/mm/MmRpc.c
packages/ti/ipc/mm/MmRpc.h

index 2442218fcba484dba20f42dc29835dae8f1f3418..d1ba031e92f4cb50489f2124eee30f95e4f6c7d8 100644 (file)
@@ -219,6 +219,15 @@ int MmRpc_call(MmRpc_Handle handle, MmRpc_FxnCtx *ctx, int32_t *ret)
                 rpfxn->params[i].reserved = param->param.ptr.handle;
                 break;
 
+            case MmRpc_ParamType_OffPtr:
+                rpfxn->params[i].type = RPPC_PARAM_TYPE_PTR;
+                rpfxn->params[i].size = param->param.offPtr.size;
+                rpfxn->params[i].data = param->param.offPtr.base +
+                        param->param.offPtr.offset;
+                rpfxn->params[i].base = param->param.offPtr.base;
+                rpfxn->params[i].reserved = param->param.offPtr.handle;
+                break;
+
 #if 0 /* TBD */
             case MmRpc_ParamType_Elem:
                 rpfxn->params[i].type = RPPC_PARAM_TYPE_PTR;
index 013cad56320332cc5a65ce4d38177a9deecd77c2..ed8f000e50c699e7853d677142d1ee5b9707fd48 100644 (file)
@@ -104,6 +104,7 @@ typedef struct MmRpc_Object *MmRpc_Handle;
 typedef enum {
     MmRpc_ParamType_Scalar = 1, /*!< pass by value */
     MmRpc_ParamType_Ptr,        /*!< data pointer */
+    MmRpc_ParamType_OffPtr,     /*!< buffer at offset in memory block */
     MmRpc_ParamType_Elem        /*!< array element */
 } MmRpc_ParamType;
 
@@ -125,6 +126,13 @@ typedef struct {
             size_t      handle; /*!< memory allocator handle */
         } ptr;
 
+        struct {
+            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 */
+        } offPtr;
+
 #if 0 /* TBD */
         struct {
             size_t      size;   /*!< size of the array element */