]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - keystone-rtos/rm-lld.git/commitdiff
Minor updates
authorJustin Sobota <jsobota@ti.com>
Wed, 13 Feb 2013 20:15:05 +0000 (15:15 -0500)
committerJustin Sobota <jsobota@ti.com>
Wed, 13 Feb 2013 20:15:05 +0000 (15:15 -0500)
rm.h
rm_services.h
rm_transport.h
src/rm.c
src/rm_services.c
src/rm_transport.c
test/rm_test.c

diff --git a/rm.h b/rm.h
index 03cdd3f6b0d90407b92e6c421ad45f25c5716947..4203e0c248c1471ac2b0c706f5dbbb654816d1fd 100644 (file)
--- a/rm.h
+++ b/rm.h
@@ -390,7 +390,7 @@ typedef struct {
      *  must match an instance name defined in the "valid-instances" lists contained
      *  in the global and static policy DTS files.  Resources and privileges to the
      *  resources will be based on the name assigned to the RM instance*/
-    char *instName;
+    const char *instName;
     /** The type of RM instance that will be created. */
     Rm_InstType instType;
     /** Instance-type specific configurations */
@@ -461,7 +461,7 @@ void Rm_printInstanceStatus(Rm_Handle rmHandle);
  *  @retval
  *      Failure - NULL Rm_Handle and result < #RM_OK
  */
-Rm_Handle Rm_init(Rm_InitCfg *initCfg, int32_t *result);
+Rm_Handle Rm_init(const Rm_InitCfg *initCfg, int32_t *result);
 
 /**
  *  @b Description
index 1437be30e38fe3ff5de30dfab3c84a858862c5e2..142ea9a350a145821e05b5dbdbd2c3aafeec3a3b 100644 (file)
@@ -119,7 +119,7 @@ typedef struct {
      *  defined in the GRL and global/static policy.  The request will be
      *  denied if the resource name does not match any resource node names
      *  in the policy */
-    char *resourceName;
+    const char *resourceName;
 /** Informs RM to find the next available resource block of length
  *  resourceLength and alignment resourceAlignment for allocation.  This
  *  parameter is only valid for resource allocate service types. */
@@ -147,7 +147,7 @@ typedef struct {
      *  If the service type is #Rm_service_RESOURCE_GET_BY_NAME and the
      *  #resourceBase and #resourceLength fields are not NULL a error will
      *  occur. */
-    char *resourceNsName;
+    const char *resourceNsName;
     /** Callback function used by RM to provide responses back to application
      *  components after a service request resulted in a blocking operation. */
     Rm_ServiceCallback callback;
@@ -181,7 +181,7 @@ typedef struct {
      *  @param[out]  serviceResponse
      *      Pointer to a service response structure.
      */
-    void (*Rm_serviceHandler)(void *rmHandle, Rm_ServiceReqInfo *serviceRequest,
+    void (*Rm_serviceHandler)(void *rmHandle, const Rm_ServiceReqInfo *serviceRequest,
                               Rm_ServiceRespInfo *serviceResponse);
 } Rm_ServiceHandle;
 
index e97e8f6dc6ea49037272a37d94f2b7eb157cd42d..a98b99918ad7f3a7f2e3eb2e7faeb901b9b30fd0 100644 (file)
@@ -209,7 +209,7 @@ typedef struct {
     Rm_InstType            remoteInstType;
     /** Pointer to the remote RM instance name at other end of the 
      *  application transport "pipe". */
-    char                  *remoteInstName;
+    const char            *remoteInstName;
     /** Specifies whether the transport callouts are valid.
      *  TRUE  - Transport callouts are valid and can be stored by the RM
      *          instance.
@@ -255,7 +255,7 @@ typedef struct {
  *  @retval
  *      Failure - NULL RM_TransportHandle and result = #RM_ERROR_NULL_CALLOUTS_WHEN_VALID 
  */
-Rm_TransportHandle Rm_transportRegister(Rm_TransportCfg *transportCfg, int32_t *result);
+Rm_TransportHandle Rm_transportRegister(const Rm_TransportCfg *transportCfg, int32_t *result);
 
 /**
  *  @b Description
@@ -297,7 +297,7 @@ int32_t Rm_transportUnregister (Rm_TransportHandle transportHandle);
  *  @retval
  *      Failure - < #RM_OK 
  */
-int32_t Rm_receivePacket(Rm_TransportHandle transportHandle, Rm_Packet *pkt);
+int32_t Rm_receivePacket(Rm_TransportHandle transportHandle, const Rm_Packet *pkt);
 
 /** 
 @} 
index c4ffbd8ec9e5c82c9fba6ba79a14cbc78203201d..d66ae06494669a74a004f62e7b9aea6a431b61e0 100644 (file)
--- a/src/rm.c
+++ b/src/rm.c
@@ -99,17 +99,11 @@ static uint32_t transactionInitSequenceNum(void)
  */
 static uint32_t transactionGetSequenceNum(Rm_Inst *rmInst)
 {
-    uint32_t sequenceNum = 0;
-
-    if (rmInst->transactionSeqNum + 1 < rmInst->transactionSeqNum) {
-        /* Rollover */
-        sequenceNum = rmInst->transactionSeqNum;
-        rmInst->transactionSeqNum = transactionInitSequenceNum();
-    }
-    else {
-        sequenceNum = rmInst->transactionSeqNum++;
+    rmInst->transactionSeqNum++;
+    if (!rmInst->transactionSeqNum) {
+        rmInst->transactionSeqNum++;
     }    
-    return (sequenceNum);
+    return (rmInst->transactionSeqNum);
 }
 
 /* FUNCTION PURPOSE: Creates a resource allocator
@@ -1987,7 +1981,7 @@ void Rm_printInstanceStatus(Rm_Handle rmHandle)
  *              using the parameters provided via the initCfg
  *              structure.
  */
-Rm_Handle Rm_init(Rm_InitCfg *initCfg, int32_t *result)
+Rm_Handle Rm_init(const Rm_InitCfg *initCfg, int32_t *result)
 {
     Rm_Inst *rmInst;
     void    *globalResourceDtb = NULL;
index e06bd20f2d7ae482c088f1eed20bf006a82cbcbf..31b8f3ccdc72f7afc191b76056f252b95200834b 100644 (file)
@@ -66,7 +66,7 @@
  *              The response will be sent at a later time via the
  *              application supplied callback function.
  */
-void Rm_serviceHandler (void *rmHandle, Rm_ServiceReqInfo *serviceRequest,
+void Rm_serviceHandler (void *rmHandle, const Rm_ServiceReqInfo *serviceRequest,
                         Rm_ServiceRespInfo *serviceResponse)
 {
     Rm_Inst             *rmInst = (Rm_Inst *)rmHandle;
index af6746c5a87af48f4afab2e3f4f24272563aa0f0..48f33bec2a8ac4bb27863928c44141d79a27fe97 100644 (file)
@@ -64,7 +64,7 @@
  *              was created, initialized, and added to the \r
  *              instance transport list.\r
  */\r
-static Rm_Transport *transportAdd(Rm_TransportCfg *transportCfg)\r
+static Rm_Transport *transportAdd(const Rm_TransportCfg *transportCfg)\r
 {\r
     Rm_Inst      *rmInst = (Rm_Inst *) transportCfg->rmHandle;\r
     Rm_Transport *transports = rmInst->transports;\r
@@ -364,7 +364,7 @@ Rm_PacketHandle rmTransportCreateNsResponsePkt(Rm_Inst *rmInst, Rm_AppTransportH
  *              is returned for the transport handle if any errors\r
  *              are encountered.\r
  */\r
-Rm_TransportHandle Rm_transportRegister (Rm_TransportCfg *transportCfg, int32_t *result)\r
+Rm_TransportHandle Rm_transportRegister (const Rm_TransportCfg *transportCfg, int32_t *result)\r
 {\r
     Rm_Inst      *rmInst = (Rm_Inst *) transportCfg->rmHandle;\r
     Rm_Transport *transport = NULL;\r
@@ -445,7 +445,7 @@ int32_t Rm_transportUnregister(Rm_TransportHandle transportHandle)
  * DESCRIPTION: The application provides RM packets received on the\r
  *              application transports to RM via this API.  Function\r
  *              can be called from polling or ISR contexts. */\r
-int32_t Rm_receivePacket(Rm_TransportHandle transportHandle, Rm_Packet *pkt)\r
+int32_t Rm_receivePacket(Rm_TransportHandle transportHandle, const Rm_Packet *pkt)\r
 {\r\r\r
     Rm_Transport   *transport = (Rm_Transport *)transportHandle;\r
     Rm_Inst        *rmInst = (Rm_Inst *)transport->rmHandle;\r
index b852246d4c7fee4fd9087b07076a9a40fb1e879f..0837905826b992fd42c3712257bd6f4082f84513 100644 (file)
@@ -1,5 +1,5 @@
 /* 
- * Copyright (c) 2012, Texas Instruments Incorporated
+ * Copyright (c) 2012-2013, Texas Instruments Incorporated
  * All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  * */
 /*
  *  ======== rm_test.c ========
  *  RM multicore test example
  *
- *  This is an example program that uses MessageQ to pass a message
- *  from one processor to another.
- *
- *  Each processor creates its own MessageQ first and then will try to open
- *  a remote processor's MessageQ.  
- *
- *  See message_multicore.k file for expected output.
  */
 
 #include <c6x.h>