SDOCM00114696 Add method to return address of shared region entry
authorRamsey Harris <ramsey@ti.com>
Tue, 3 Feb 2015 17:40:54 +0000 (09:40 -0800)
committerRobert Tivy <rtivy@ti.com>
Wed, 4 Feb 2015 19:05:59 +0000 (11:05 -0800)
Added method to return the address of the in-memory shared region
entry structure; SharedRegion_getEntryPtr. Use this method from
a pre-startup hook function to configure the entry.

packages/ti/ipc/SharedRegion.h
packages/ti/sdo/ipc/SharedRegion.c

index 0df4dcfef6ad69cf2b95fe0b1f05f6199e329d8b..a9871b25ce70b9369bf4fe5e6d8693ec571f1407 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012-2013, Texas Instruments Incorporated
+ * Copyright (c) 2012-2015 Texas Instruments Incorporated - http://www.ti.com
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -317,6 +317,19 @@ SizeT SharedRegion_getCacheLineSize(UInt16 regionId);
  */
 Int SharedRegion_getEntry(UInt16 regionId, SharedRegion_Entry *entry);
 
+/*!
+ *  @brief      Return the address of the shared region entry structure
+ *
+ *  This function is to be used only for module startup configuration.
+ *  The returned address gives you direct access to the in-memory entry
+ *  structure. Use it to configure the entry just before the module
+ *  startup phase begins. It is intended to support single-image loading.
+ *
+ *  Do not use this function during normal run-time operations; use
+ *  SharedRegion_getEntry() instead.
+ */
+SharedRegion_Entry *SharedRegion_getEntryPtr(UInt16 regionId);
+
 /*!
  *  @brief      Gets the heap associated with the specified region id
  *
index 60d02f675df0590cdcd7c13ab0084118760aad28..61c6bbc3a9e89c3ac98536a3ffe5c46b4001089e 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012-2013, Texas Instruments Incorporated
+ * Copyright (c) 2012-2015 Texas Instruments Incorporated - http://www.ti.com
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
@@ -55,6 +55,7 @@
     #pragma FUNC_EXT_CALLED(SharedRegion_clearEntry);
     #pragma FUNC_EXT_CALLED(SharedRegion_getCacheLineSize);
     #pragma FUNC_EXT_CALLED(SharedRegion_getEntry);
+    #pragma FUNC_EXT_CALLED(SharedRegion_getEntryPtr);
     #pragma FUNC_EXT_CALLED(SharedRegion_getHeap);
     #pragma FUNC_EXT_CALLED(SharedRegion_getId);
     #pragma FUNC_EXT_CALLED(SharedRegion_getIdByName);
@@ -193,6 +194,17 @@ Int SharedRegion_getEntry(UInt16 id, SharedRegion_Entry *entry)
     return (SharedRegion_S_SUCCESS);
 }
 
+/*
+ *  ======== SharedRegion_getEntryPtr ========
+ */
+SharedRegion_Entry *SharedRegion_getEntryPtr(UInt16 id)
+{
+    ti_sdo_ipc_SharedRegion_Region *region;
+
+    region = &(SharedRegion_module->regions[id]);
+    return ((SharedRegion_Entry *)(&region->entry));
+}
+
 /*
  *  ======== SharedRegion_getId ========
  *  Returns the id of shared region that the pointer resides in.