MmRpc: Remove 'base' field from MmRpc_Xlt struct 3.00.01.23_eng
authorRamsey Harris <ramsey@ti.com>
Tue, 18 Jun 2013 01:06:42 +0000 (18:06 -0700)
committerChris Ring <cring@ti.com>
Tue, 18 Jun 2013 01:30:06 +0000 (18:30 -0700)
This field was confusing and redundant. Given that the address
and offset to the embedded pointer are already available, the
base value can be derived in the MmRpc API layer.

Signed-off-by: Ramsey Harris <ramsey@ti.com>
packages/ti/ipc/mm/MmRpc.c
packages/ti/ipc/mm/MmRpc.h
packages/ti/ipc/tests/Mx.c

index e5275b725e3f78712283b49eeb4f20e390fc584b..2442218fcba484dba20f42dc29835dae8f1f3418 100644 (file)
@@ -240,9 +240,17 @@ int MmRpc_call(MmRpc_Handle handle, MmRpc_FxnCtx *ctx, int32_t *ret)
     rpfxn->num_translations = ctx->num_xlts;
 
     for (i = 0; i < ctx->num_xlts; i++) {
-        rpfxn->translations[i].index    = ctx->xltAry[i].index;
+        uint32_t index;
+        size_t ptr;
+
+        /* compute base value */
+        index = ctx->xltAry[i].index;
+        ptr = rpfxn->params[index].base + ctx->xltAry[i].offset;
+
+        /* pack the pointer translation entry */
+        rpfxn->translations[i].index    = index;
         rpfxn->translations[i].offset   = ctx->xltAry[i].offset;
-        rpfxn->translations[i].base     = ctx->xltAry[i].base;
+        rpfxn->translations[i].base     = (size_t)(*(void **)ptr);
         rpfxn->translations[i].reserved = ctx->xltAry[i].handle;
     }
 
index d6f6c7c77723e07168587100d9af9e14a35a5e83..013cad56320332cc5a65ce4d38177a9deecd77c2 100644 (file)
@@ -139,7 +139,6 @@ typedef struct {
 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 */
     size_t      handle; /*!< memory allocator handle */
 } MmRpc_Xlt;
 
index a0095ce8b0c350751c594680fbae52505f8a8639..38f95e65c506b74eb93c266603bc797719855e3e 100644 (file)
@@ -192,7 +192,6 @@ int32_t Mx_compute(Mx_Compute *compute)
 
     fxnCtx->xltAry[0].index = 0;
     fxnCtx->xltAry[0].offset = MmRpc_OFFSET(compute, &compute->inBuf);
-    fxnCtx->xltAry[0].base = (size_t)(compute->inBuf);
 #if defined(SYSLINK_BUILDOS_QNX)
     fxnCtx->xltAry[0].handle = NULL;
 #else
@@ -201,7 +200,6 @@ int32_t Mx_compute(Mx_Compute *compute)
 
     fxnCtx->xltAry[1].index = 0;
     fxnCtx->xltAry[1].offset = MmRpc_OFFSET(compute, &compute->outBuf);
-    fxnCtx->xltAry[1].base = (size_t)(compute->outBuf);
 #if defined(SYSLINK_BUILDOS_QNX)
     fxnCtx->xltAry[1].handle = NULL;
 #else