summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (from parent 1: d6e1fef)
raw | patch | inline | side by side (from parent 1: d6e1fef)
author | Justin Sobota <jsobota@ti.com> | |
Wed, 13 Feb 2013 20:15:05 +0000 (15:15 -0500) | ||
committer | Justin Sobota <jsobota@ti.com> | |
Wed, 13 Feb 2013 20:15:05 +0000 (15:15 -0500) |
rm.h | patch | blob | history | |
rm_services.h | patch | blob | history | |
rm_transport.h | patch | blob | history | |
src/rm.c | patch | blob | history | |
src/rm_services.c | patch | blob | history | |
src/rm_transport.c | patch | blob | history | |
test/rm_test.c | patch | blob | history |
index 03cdd3f6b0d90407b92e6c421ad45f25c5716947..4203e0c248c1471ac2b0c706f5dbbb654816d1fd 100644 (file)
--- a/rm.h
+++ b/rm.h
* 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 */
* @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
diff --git a/rm_services.h b/rm_services.h
index 1437be30e38fe3ff5de30dfab3c84a858862c5e2..142ea9a350a145821e05b5dbdbd2c3aafeec3a3b 100644 (file)
--- a/rm_services.h
+++ b/rm_services.h
* 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. */
* 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;
* @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;
diff --git a/rm_transport.h b/rm_transport.h
index e97e8f6dc6ea49037272a37d94f2b7eb157cd42d..a98b99918ad7f3a7f2e3eb2e7faeb901b9b30fd0 100644 (file)
--- a/rm_transport.h
+++ b/rm_transport.h
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.
* @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
* @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);
/**
@}
diff --git a/src/rm.c b/src/rm.c
index c4ffbd8ec9e5c82c9fba6ba79a14cbc78203201d..d66ae06494669a74a004f62e7b9aea6a431b61e0 100644 (file)
--- a/src/rm.c
+++ b/src/rm.c
*/
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
* 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;
diff --git a/src/rm_services.c b/src/rm_services.c
index e06bd20f2d7ae482c088f1eed20bf006a82cbcbf..31b8f3ccdc72f7afc191b76056f252b95200834b 100644 (file)
--- a/src/rm_services.c
+++ b/src/rm_services.c
* 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;
diff --git a/src/rm_transport.c b/src/rm_transport.c
index af6746c5a87af48f4afab2e3f4f24272563aa0f0..48f33bec2a8ac4bb27863928c44141d79a27fe97 100644 (file)
--- a/src/rm_transport.c
+++ b/src/rm_transport.c
* 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
* 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
diff --git a/test/rm_test.c b/test/rm_test.c
index b852246d4c7fee4fd9087b07076a9a40fb1e879f..0837905826b992fd42c3712257bd6f4082f84513 100644 (file)
--- a/test/rm_test.c
+++ b/test/rm_test.c
/*
- * 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>