]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - keystone-rtos/rm-lld.git/commitdiff
Updated Linux tests with new RM Server socket interface
authorJustin Sobota <jsobota@ti.com>
Thu, 16 Jul 2015 17:23:35 +0000 (13:23 -0400)
committerJustin Sobota <jsobota@ti.com>
Thu, 16 Jul 2015 17:23:35 +0000 (13:23 -0400)
rm_server_if.h [moved from test/armv7/linux/sockrmmsg.h with 67% similarity]
rmver.h
src/rm_policy.c
test/armv7/linux/rm_dsp_client_test.c
test/armv7/linux/rm_linux_client_test.c
test/armv7/linux/rm_linux_mt_client_test.c
test/armv7/linux/rm_server.c

similarity index 67%
rename from test/armv7/linux/sockrmmsg.h
rename to rm_server_if.h
index ca23258dacdbe8fdace18cf3097c8733d1362b75..f74d95eedf92aad29b914e84cc1edabd57f6ac0f 100644 (file)
@@ -1,53 +1,58 @@
-/*
- * Copyright (C) 2013-2015 Texas Instruments Incorporated - http://www.ti.com/
+/**
+ *   @file  rm_server_if.h
  *
+ *   @brief
+ *      RM Server interface containing socket location of RM Server.  Used by
+ *      Linux user-space applications to connect with the RM Server.
  *
- *  Redistribution and use in source and binary forms, with or without
- *  modification, are permitted provided that the following conditions
+ *  \par
+ *  ============================================================================
+ *  @n   (C) Copyright 2015, Texas Instruments, Inc.
+ * 
+ *  Redistribution and use in source and binary forms, with or without 
+ *  modification, are permitted provided that the following conditions 
  *  are met:
  *
- *    Redistributions of source code must retain the above copyright
+ *    Redistributions of source code must retain the above copyright 
  *    notice, this list of conditions and the following disclaimer.
  *
  *    Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the
+ *    notice, this list of conditions and the following disclaimer in the 
+ *    documentation and/or other materials provided with the   
  *    distribution.
  *
  *    Neither the name of Texas Instruments Incorporated nor the names of
  *    its contributors may be used to endorse or promote products derived
  *    from this software without specific prior written permission.
  *
- *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
- *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ *  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 
+ *  "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 
  *  LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
- *  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
- *  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
- *  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ *  A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 
+ *  OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 
+ *  SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 
  *  LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  *  DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
- *  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
- *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ *  THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 
+ *  (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 
  *  OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  *
- */
+ *  \par
+*/
 
-#ifndef __SOCKRMMSG_H__
-#define __SOCKRMMSG_H__
+#ifndef RM_SERVER_IF_H_
+#define RM_SERVER_IF_H_
 
-#include <stdint.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
 
+/* RM Server socket location in Linux file system */
 #define RM_SERVER_SOCKET_NAME "/var/run/rm/rm_server"
 
-#define msg_alloc(p) \
-       do { \
-               p = calloc(1, sizeof(*p)); \
-               if (p) { \
-                       p->length = sizeof(*p); \
-               } \
-       } while (0)
-               
-#define msg_length(x) ((x) ? (sizeof(*x) + x->length) : 0)
-#define msg_data(x) ((x->length) ? ((char *)x + sizeof(*x)) : NULL)
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* RM_SERVER_IF_H_ */
 
-#endif /* __SOCKRMMSG_H__ */
diff --git a/rmver.h b/rmver.h
index 62605819660b5a3d1929493c83159a56b8b49e6c..2d0636ff7fe97e0616876554d659febdcc0516ca 100644 (file)
--- a/rmver.h
+++ b/rmver.h
@@ -14,7 +14,7 @@ extern "C" {
  *   @brief  Resource Manager Version Definitions
  *
  *  ============================================================
- *  Copyright (c) Texas Instruments Incorporated 2012-2014
+ *  Copyright (c) Texas Instruments Incorporated 2012-2015
  * 
  *  Redistribution and use in source and binary forms, with or without 
  *  modification, are permitted provided that the following conditions 
@@ -47,7 +47,8 @@ extern "C" {
 */
 
 /**
- * @brief   This is the RM Version. Versions numbers are encoded in the following 
+ * @brief   This is the RM Version. Versions numbers are encoded in the
+ *          following
  * format:
  *  0xAABBCCDD -> Arch (AA); API Changes (BB); Major (CC); Minor (DD)
  */
@@ -57,12 +58,12 @@ extern "C" {
  * @brief   This is the version string which describes the RM along with the
  * date and build information.
  */
-#define RM_VERSION_STR                  "RM Revision: 2.1.2.00"
+#define RM_VERSION_STR                  "RM Revision: 02.01.02.00"
 
 
 #ifdef __cplusplus
 }
 #endif
-  
+
 
 #endif  /* _RMVER_H */
index bce988048f3368bb419a7122db6b2bbe03a9720c..8f962f317f4969a28911d39707c30a9ba1f9323b 100644 (file)
@@ -454,8 +454,7 @@ static Rm_PolicyPermission *policyGetAssignmentPermissions(Rm_PolicyAssignment *
  *              permissions for all valid instances.  Words are packed
  *              with permissions for as many instances as can fit
  */
-static uint32_t policyGetPermBufSize(Rm_PolicyPermBits *permsPtr,
-                                     uint32_t maxValidInst)
+static uint32_t policyGetPermBufSize(uint32_t maxValidInst)
 {
     uint32_t instPerWord;
     uint32_t numWords;
@@ -465,7 +464,7 @@ static uint32_t policyGetPermBufSize(Rm_PolicyPermBits *permsPtr,
     /* Round up */
     numWords = (maxValidInst + instPerWord - 1) / instPerWord;
 
-    totalBytes = sizeof(*permsPtr) * numWords;
+    totalBytes = sizeof(Rm_PolicyPermBits) * numWords;
     return(totalBytes);
 }
 
@@ -1003,7 +1002,7 @@ int32_t rmPolicyPopulateTree(Rm_Handle rmHandle, Rm_PolicyTree *policyTree,
      * will be stored in each tree node */
     allocAlignment = policyGetDtbAllocAlign(policyDtb, resOffset);
     cdAllocSize = policyGetDtbCdAllocSize(policyDtb, resOffset);
-    permBufSizeBytes = policyGetPermBufSize(polNode->perms, rmInst->maxInstIdx);
+    permBufSizeBytes = policyGetPermBufSize(rmInst->maxInstIdx);
 
     /* Get the resource assignments - should only be one per resource node */
     propOffset = fdt_first_property_offset(policyDtb, resOffset);
index 2fcfdb16ed6ac254025ab80bd09dc7d942f24734..de264a61ffe6e834a83c83ddfab697f248d76823 100644 (file)
@@ -47,9 +47,9 @@
 
 /* Socket Includes */
 #include "sockutils.h"
-#include "sockrmmsg.h"
 
 /* RM includes */
+#include <ti/drv/rm/rm_server_if.h>
 #include <ti/drv/rm/rm_transport.h>
 
 /* App defines:  Must match on remote proc side: */
@@ -136,7 +136,7 @@ Int rmServerExchange_execute(UInt16 procId)
     /* open local sock for communication to RM Server */
     local_sock_name.type = sock_name_e;
     local_sock_name.s.name = client_ex_sock_name;
-    sock_to_server = sock_open(&local_sock_name);
+    sock_to_server = sock_open(&local_sock_name, 0, 0);
     if (!sock_to_server) {
         printf("Local socket to RM Server open failed\n");
         return(-1);
index e843d5eac80b298a7e0b95d63a50046595163319..b127442f69bd72a029616edffc2a218d907bdd71 100644 (file)
@@ -66,9 +66,9 @@
 
 /* Socket Includes */
 #include "sockutils.h"
-#include "sockrmmsg.h"
 
 /* RM Includes */
+#include <ti/drv/rm/rm_server_if.h>
 #include <ti/drv/rm/rm.h>
 #include <ti/drv/rm/rm_transport.h>
 #include <ti/drv/rm/rm_services.h>
@@ -847,7 +847,7 @@ void connection_setup(void)
     sock_name.type = sock_name_e;
     sock_name.s.name = rmClientSockName;
 
-    rmClientSocket = sock_open(&sock_name);
+    rmClientSocket = sock_open(&sock_name, 0, 0);
     if (!rmClientSocket) {
         error_msg("Client socket open failed\n");
         exit(EXIT_FAILURE);
index 9b11506ac67334bf26b8cbe98cb3f9247a656b51..55b9f4feb28a66aa42789a2db9952a1cbd7839d4 100644 (file)
@@ -66,9 +66,9 @@
 
 /* Socket Includes */
 #include "sockutils.h"
-#include "sockrmmsg.h"
 
 /* RM Includes */
+#include <ti/drv/rm/rm_server_if.h>
 #include <ti/drv/rm/rm.h>
 #include <ti/drv/rm/rm_transport.h>
 #include <ti/drv/rm/rm_services.h>
@@ -441,7 +441,7 @@ void connection_setup(void)
     sock_name.type = sock_name_e;
     sock_name.s.name = client_sock_name;
 
-    client_sock = sock_open(&sock_name);
+    client_sock = sock_open(&sock_name, 0, 0);
     if (!client_sock) {
         printf("Client socket open failed\n");
         exit(EXIT_FAILURE);
index 6d8cf447f16c94a898a4aa05793006023418f955..04990d7e8b1e5f50cdb6fac348a4f7e11edade0f 100644 (file)
 /* Socket Includes */
 #include "serverlogutil.h"
 #include "sockutils.h"
-#include "sockrmmsg.h"
 
 /* RM includes */
+#include <ti/drv/rm/rm_server_if.h>
 #include <ti/drv/rm/rm.h>
 #include <ti/drv/rm/rm_transport.h>
 
 #define RMSERVER_DAEMON_PID_FILE_NAME "/var/run/rmServer/pid"
 
-/* Error checking macro */
-#define ERROR_CHECK(checkVal, resultVal, rmInstName, printMsg)            \
-    if (resultVal != checkVal) {                                          \
-        char errorMsgToPrint[] = printMsg;                                \
-        error_msg("%s : ", rmInstName);                                      \
-        error_msg("%s with error code : %d\n", errorMsgToPrint, resultVal);  \
-        exit(EXIT_FAILURE);                                               \
-    }
-
 #define MAX_LOG_LEVEL LOG_DEBUG
 
 /* logging errors */
 /* logging debug information */
 #define debug_msg(...) rmsrv_log(LOG_DEBUG, __func__, __FILE__, __LINE__, __VA_ARGS__);
 
+/* Error checking macro */
+#define ERROR_CHECK(checkVal, resultVal, rmInstName, printMsg)            \
+    if (resultVal != checkVal) {                                          \
+        char errorMsgToPrint[] = printMsg;                                \
+        error_msg("%s : ", rmInstName);                                      \
+        error_msg("%s with error code : %d\n", errorMsgToPrint, resultVal);  \
+        exit(EXIT_FAILURE);                                               \
+    }
+
 #define LOG_APPEND(x)                                      \
     do {                                                   \
         int len;                                           \