summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 6b999f2)
raw | patch | inline | side by side (parent: 6b999f2)
author | Ming Wei <mwei@ti.com> | |
Wed, 28 Jan 2015 00:09:33 +0000 (19:09 -0500) | ||
committer | Ming Wei <mwei@ti.com> | |
Wed, 28 Jan 2015 00:09:33 +0000 (19:09 -0500) |
16 files changed:
diff --git a/test/k2e/c66/bios/rmK2EC66DspMtBiosTestProject.txt b/test/k2e/c66/bios/rmK2EC66DspMtBiosTestProject.txt
index 61aa02bd67baa101400a56e9baa3c3a7383258cc..dfbf6387b562252c0b9cc18829a282e245392276 100644 (file)
-ccs.linkFile "PDK_INSTALL_PATH/ti/drv/rm/test/src/rm_dsp_mt_test.c"
-ccs.linkFile "PDK_INSTALL_PATH/ti/drv/rm/test/dts_files/global-resources.c"
--ccs.linkFile "PDK_INSTALL_PATH/ti/drv/rm/test/dts_files/linux-evm.c"
-ccs.linkFile "PDK_INSTALL_PATH/ti/drv/rm/test/dts_files/server-policy.c"
--ccs.linkFile "PDK_INSTALL_PATH/ti/drv/rm/test/dts_files/static-policy.c"
-ccs.linkFile "PDK_INSTALL_PATH/ti/drv/rm/test/k2e/c66/bios/rm_osal.c"
-ccs.linkFile "PDK_INSTALL_PATH/ti/drv/rm/test/k2e/c66/bios/rm_test_sc.cfg"
-ccs.setCompilerOptions "-mv6600 -g -DDEVICE_K2E --diag_warning=225 -I${PDK_INSTALL_PATH}/ti/drv/rm"
index 6bf0d2dc1b4a89c3912ea5262f5ec95bc5c08564..af66f27e3479ca0034554b309a853574f2605811 100644 (file)
*
* \par
* ============================================================================
- * @n (C) Copyright 2012-2013, Texas Instruments, Inc.
+ * @n (C) Copyright 2012-2015, Texas Instruments, Inc.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
index 570cfd5b3930a24a2597ebf7a32f8f8795133d55..24907c5a27b93df3b6c0d30bc34166195f22a0e0 100644 (file)
/*
- * Copyright (c) 2012-2013, Texas Instruments Incorporated
+ * Copyright (c) 2015, Texas Instruments Incorporated
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* Get the list of names that the build device supports.
* I.e. ["CORE0", "CORE1", "CORE2" ... ]
*/
-///var nameList = ["CORE0", "CORE1"];
var nameList = ["CORE0"];
/*
});
/* PDK packages */
-var devType = "k2h"
+var devType = "k2e"
var Csl = xdc.useModule('ti.csl.Settings');
Csl.deviceType = devType;
var Rm = xdc.loadPackage('ti.drv.rm');
diff --git a/test/k2g/c66/bios/rmK2GC66DspMtBiosTestProject.txt b/test/k2g/c66/bios/rmK2GC66DspMtBiosTestProject.txt
index ab2ff2f14519ef679c8ace9605583092d004abf5..39f7df3121e4bbf27400d6d63c9ea6a7f4b902f6 100644 (file)
-ccs.linkFile "PDK_INSTALL_PATH/ti/drv/rm/test/src/rm_dsp_mt_test.c"
-ccs.linkFile "PDK_INSTALL_PATH/ti/drv/rm/test/dts_files/global-resources.c"
--ccs.linkFile "PDK_INSTALL_PATH/ti/drv/rm/test/dts_files/linux-evm.c"
-ccs.linkFile "PDK_INSTALL_PATH/ti/drv/rm/test/dts_files/server-policy.c"
--ccs.linkFile "PDK_INSTALL_PATH/ti/drv/rm/test/dts_files/static-policy.c"
-ccs.linkFile "PDK_INSTALL_PATH/ti/drv/rm/test/k2g/c66/bios/rm_osal.c"
-ccs.linkFile "PDK_INSTALL_PATH/ti/drv/rm/test/k2g/c66/bios/rm_test_sc.cfg"
-ccs.setCompilerOptions "-mv6600 -g -DDEVICE_K2G --diag_warning=225 -I${PDK_INSTALL_PATH}/ti/drv/rm"
index 6bf0d2dc1b4a89c3912ea5262f5ec95bc5c08564..af66f27e3479ca0034554b309a853574f2605811 100644 (file)
*
* \par
* ============================================================================
- * @n (C) Copyright 2012-2013, Texas Instruments, Inc.
+ * @n (C) Copyright 2012-2015, Texas Instruments, Inc.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
index 570cfd5b3930a24a2597ebf7a32f8f8795133d55..dc33652d93f46991711e09e7974eaa39c28335d7 100644 (file)
/*
- * Copyright (c) 2012-2013, Texas Instruments Incorporated
+ * Copyright (c) 2015, Texas Instruments Incorporated
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* Get the list of names that the build device supports.
* I.e. ["CORE0", "CORE1", "CORE2" ... ]
*/
-///var nameList = ["CORE0", "CORE1"];
var nameList = ["CORE0"];
/*
});
/* PDK packages */
-var devType = "k2h"
+var devType = "k2g"
var Csl = xdc.useModule('ti.csl.Settings');
Csl.deviceType = devType;
var Rm = xdc.loadPackage('ti.drv.rm');
diff --git a/test/k2h/c66/bios/rmK2HC66DspMtBiosTestProject.txt b/test/k2h/c66/bios/rmK2HC66DspMtBiosTestProject.txt
index ddfd444629e5b39f8cd2030ce5b3e39b019dfab1..40001221cda0da7fd2de312c8413346c4f6720eb 100644 (file)
-ccs.linkFile "PDK_INSTALL_PATH/ti/drv/rm/test/src/rm_dsp_mt_test.c"
-ccs.linkFile "PDK_INSTALL_PATH/ti/drv/rm/test/dts_files/global-resources.c"
--ccs.linkFile "PDK_INSTALL_PATH/ti/drv/rm/test/dts_files/linux-evm.c"
-ccs.linkFile "PDK_INSTALL_PATH/ti/drv/rm/test/dts_files/server-policy.c"
--ccs.linkFile "PDK_INSTALL_PATH/ti/drv/rm/test/dts_files/static-policy.c"
-ccs.linkFile "PDK_INSTALL_PATH/ti/drv/rm/test/k2h/c66/bios/rm_osal.c"
-ccs.linkFile "PDK_INSTALL_PATH/ti/drv/rm/test/k2h/c66/bios/rm_test_sc.cfg"
-ccs.setCompilerOptions "-mv6600 -g -DDEVICE_K2H --diag_warning=225 -I${PDK_INSTALL_PATH}/ti/drv/rm"
index 6bf0d2dc1b4a89c3912ea5262f5ec95bc5c08564..af66f27e3479ca0034554b309a853574f2605811 100644 (file)
*
* \par
* ============================================================================
- * @n (C) Copyright 2012-2013, Texas Instruments, Inc.
+ * @n (C) Copyright 2012-2015, Texas Instruments, Inc.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
index 570cfd5b3930a24a2597ebf7a32f8f8795133d55..4693f75999798ce59ffa34b4ae0eede8d4d460bb 100644 (file)
/*
- * Copyright (c) 2012-2013, Texas Instruments Incorporated
+ * Copyright (c) 2015, Texas Instruments Incorporated
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* Get the list of names that the build device supports.
* I.e. ["CORE0", "CORE1", "CORE2" ... ]
*/
-///var nameList = ["CORE0", "CORE1"];
var nameList = ["CORE0"];
/*
diff --git a/test/k2k/c66/bios/rmK2KC66DspMtBiosTestProject.txt b/test/k2k/c66/bios/rmK2KC66DspMtBiosTestProject.txt
index b71fc98163c770e6557842a2e257fb47a474be1a..be2bf9f1eaa71acb9d8f18bd8c6246ebaaeb776b 100644 (file)
-ccs.linkFile "PDK_INSTALL_PATH/ti/drv/rm/test/src/rm_dsp_mt_test.c"
-ccs.linkFile "PDK_INSTALL_PATH/ti/drv/rm/test/dts_files/global-resources.c"
--ccs.linkFile "PDK_INSTALL_PATH/ti/drv/rm/test/dts_files/linux-evm.c"
-ccs.linkFile "PDK_INSTALL_PATH/ti/drv/rm/test/dts_files/server-policy.c"
--ccs.linkFile "PDK_INSTALL_PATH/ti/drv/rm/test/dts_files/static-policy.c"
-ccs.linkFile "PDK_INSTALL_PATH/ti/drv/rm/test/k2k/c66/bios/rm_osal.c"
-ccs.linkFile "PDK_INSTALL_PATH/ti/drv/rm/test/k2k/c66/bios/rm_test_sc.cfg"
-ccs.setCompilerOptions "-mv6600 -g -DDEVICE_K2K --diag_warning=225 -I${PDK_INSTALL_PATH}/ti/drv/rm"
index 6bf0d2dc1b4a89c3912ea5262f5ec95bc5c08564..af66f27e3479ca0034554b309a853574f2605811 100644 (file)
*
* \par
* ============================================================================
- * @n (C) Copyright 2012-2013, Texas Instruments, Inc.
+ * @n (C) Copyright 2012-2015, Texas Instruments, Inc.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
index 570cfd5b3930a24a2597ebf7a32f8f8795133d55..cb0e94de5db4d88aee6243e149fa43257efb8007 100644 (file)
/*
- * Copyright (c) 2012-2013, Texas Instruments Incorporated
+ * Copyright (c) 2015, Texas Instruments Incorporated
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
/*
* Get the list of names that the build device supports.
* I.e. ["CORE0", "CORE1", "CORE2" ... ]
- */
-///var nameList = ["CORE0", "CORE1"];
+ */;
var nameList = ["CORE0"];
/*
});
/* PDK packages */
-var devType = "k2h"
+var devType = "k2k"
var Csl = xdc.useModule('ti.csl.Settings');
Csl.deviceType = devType;
var Rm = xdc.loadPackage('ti.drv.rm');
diff --git a/test/k2l/c66/bios/rmK2LC66DspMtBiosTestProject.txt b/test/k2l/c66/bios/rmK2LC66DspMtBiosTestProject.txt
index 5168c0b55c443e6800fb85422c60ce4aafb13af7..6c13611af320309d600e43366b3f24d7f3734466 100644 (file)
-ccs.linkFile "PDK_INSTALL_PATH/ti/drv/rm/test/src/rm_dsp_mt_test.c"
-ccs.linkFile "PDK_INSTALL_PATH/ti/drv/rm/test/dts_files/global-resources.c"
--ccs.linkFile "PDK_INSTALL_PATH/ti/drv/rm/test/dts_files/linux-evm.c"
-ccs.linkFile "PDK_INSTALL_PATH/ti/drv/rm/test/dts_files/server-policy.c"
--ccs.linkFile "PDK_INSTALL_PATH/ti/drv/rm/test/dts_files/static-policy.c"
-ccs.linkFile "PDK_INSTALL_PATH/ti/drv/rm/test/k2l/c66/bios/rm_osal.c"
-ccs.linkFile "PDK_INSTALL_PATH/ti/drv/rm/test/k2l/c66/bios/rm_test_sc.cfg"
-ccs.setCompilerOptions "-mv6600 -g -DDEVICE_K2L --diag_warning=225 -I${PDK_INSTALL_PATH}/ti/drv/rm"
index 6bf0d2dc1b4a89c3912ea5262f5ec95bc5c08564..af66f27e3479ca0034554b309a853574f2605811 100644 (file)
*
* \par
* ============================================================================
- * @n (C) Copyright 2012-2013, Texas Instruments, Inc.
+ * @n (C) Copyright 2012-2015, Texas Instruments, Inc.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
index 570cfd5b3930a24a2597ebf7a32f8f8795133d55..4eacf479df42d1d42b198ff5a6ab31f469db26d5 100644 (file)
/*
- * Copyright (c) 2012-2013, Texas Instruments Incorporated
+ * Copyright (c) 2012-2015, Texas Instruments Incorporated
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* Get the list of names that the build device supports.
* I.e. ["CORE0", "CORE1", "CORE2" ... ]
*/
-///var nameList = ["CORE0", "CORE1"];
var nameList = ["CORE0"];
/*
});
/* PDK packages */
-var devType = "k2h"
+var devType = "k2l"
var Csl = xdc.useModule('ti.csl.Settings');
Csl.deviceType = devType;
var Rm = xdc.loadPackage('ti.drv.rm');
index 57cab204465f1be0ec52fea0df538201347333c8..bb10a827f81853d53fe51cc664e1ab4bb1bdeb4b 100644 (file)
*
* ============================================================================
*
- * Copyright (c) 2012-2013, Texas Instruments Incorporated
+ * Copyright (c) 2015, Texas Instruments Incorporated
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
#define RM_PKT_HEAP_NAME "rmHeapBuf"
/* Application's core 0 registered RM transport indices */
-#define SERVER_TO_CLIENT_MAP_ENTRY 0
-#define CLIENT_TO_SERVER_MAP_ENTRY 1
+#define SERVER_TO_CLIENT_MAP_ENTRY 0
+#define CLIENT_TO_SERVER_MAP_ENTRY 1
/* Maximum number of registered RM transports */
-#define MAX_MAPPING_ENTRIES 2
+#define MAX_MAPPING_ENTRIES 2
/* Size of RM static allocation response queue. Must be greater than number of APPROVED
* static allocations */
-#define MAX_STATIC_ALLOCATION_RESPS 5
+#define MAX_STATIC_ALLOCATION_RESPS 5
/* Size of RM service response queue */
-#define MAX_QUEUED_SERVICE_RESPONSES 10
+#define MAX_QUEUED_SERVICE_RESPONSES 10
/* Error checking macro */
#define ERROR_CHECK(checkVal, resultVal, rmInstName, printMsg) \
/* RM test Global Resource List (GRL) */
extern const char rmGRL[];
-/* Example Linux DTB file provided to RM Server for automatic Linux Kernel resource extraction */
-extern const char rmLinuxDtb[];
/* RM test Global Policy provided to RM Server */
extern const char rmGlobalPolicy[];
-/* RM test Static Policy provided to RM Client Delegate and Client */
-extern const char rmStaticPolicy[];
/**********************************************************************
********************** Global Variables ******************************
/* RM client test task 2 */
Task_Handle rmClientTskHandle2 = NULL;
// task completion count
-int taskCompleteCount = 0;
+int taskCompleteCount = 0;
// client task semaphore lock
-uint32_t *client_semaphore_lock = NULL;
+uint32_t *client_semaphore_lock = NULL;
/* Handle for heap that RM packets will be allocated from */
HeapBufMP_Handle rmPktHeapHandle = NULL;
Rm_ServiceHandle *rmServerServiceHandle = NULL;
Rm_ServiceHandle *rmClientServiceHandle = NULL;
-MessageQ_Handle serverFromClientMsgQ, clientFromServerMsgQ;
-MessageQ_QueueId serverToClientQId, clientToServerQId;
-Rm_TransportHandle serverClientHandle, clientServerHandle;
+MessageQ_Handle serverFromClientMsgQ, clientFromServerMsgQ;
+MessageQ_QueueId serverToClientQId, clientToServerQId;
+Rm_TransportHandle serverClientHandle, clientServerHandle;
/* Transport map stores the RM transport handle to IPC MessageQ queue mapping */
Transport_MapEntry rmTransportMap[MAX_MAPPING_ENTRIES];
-/* Static allocation response queue */
-Rm_ServiceRespInfo staticResponseQueue[MAX_STATIC_ALLOCATION_RESPS];
-/* Static allocation response queue index */
-uint32_t numStaticResponses;
-
-/* RM response info queue used to store service responses received via the callback function */
-Rm_ServiceRespInfo responseInfoQueue[MAX_QUEUED_SERVICE_RESPONSES];
-
-/* RM resource names (must match resource node names in GRL and policies */
-char resourceNameMemRegion[RM_NAME_MAX_CHARS] = "memory-regions";
-char resourceNameAccumCh[RM_NAME_MAX_CHARS] = "accumulator-ch";
-char resourceNameGpQ[RM_NAME_MAX_CHARS] = "gp-queue";
-char resourceNameAifQ[RM_NAME_MAX_CHARS] = "aif-queue";
-char resourceNameQosCluster[RM_NAME_MAX_CHARS] = "qos-cluster";
-char resourceNameAifRxCh[RM_NAME_MAX_CHARS] = "aif-rx-ch";
-char resourceNameInfraQ[RM_NAME_MAX_CHARS] = "infra-queue";
-char resourceNameLowPrioQ[RM_NAME_MAX_CHARS] = "low-prio-queue";
-char resourceNamePassQ[RM_NAME_MAX_CHARS] = "pass-queue";
-
-/* Test RM NameServer name */
-char nameServerNameFavQ[RM_NAME_MAX_CHARS] = "My_Favorite_Queue";
-
/* RM resource names (must match resource node names in GRL and policies */
-char res_name_link_ram[RM_NAME_MAX_CHARS] = "link-ram";
+char res_name_link_ram[RM_NAME_MAX_CHARS] = "link-ram";
/* Used to track allocations in each task */
#define REQUEST_ITERATIONS 16000
#define RESOURCE_PRINT_DIVISOR 1000
-uint32_t allocs[REQUEST_ITERATIONS];
+uint32_t allocs[REQUEST_ITERATIONS];
/**********************************************************************
*************************** Test Functions ***************************
void rmReceiveTskClient(UArg arg0, UArg arg1)
{
while(1) {
- transportReceive(SERVER_TO_CLIENT_MAP_ENTRY);
+ transportReceive(SERVER_TO_CLIENT_MAP_ENTRY);
/* Sleep for 1ms so that the main test tasks can run */
Task_sleep(1);
}
if (response.serviceState == RM_SERVICE_APPROVED) {
allocs[response.resourceBase]++;
if (arg0==2)
- Task_sleep(1);
+ Task_sleep(1);
if ((i % RESOURCE_PRINT_DIVISOR) == 0) {
- System_printf("Client Task %d : Requested %d resources...\n", (uint32_t)arg0, RESOURCE_PRINT_DIVISOR);
+ System_printf("Client Task %d : Requested %d resources...\n", (uint32_t)arg0, RESOURCE_PRINT_DIVISOR);
}
}
else {
- System_printf("Error Client Task %d : Allocate request was not approved for resource %d\n",
- (uint32_t)arg0, request.resourceBase);
- testErrors++;
+ System_printf("Error Client Task %d : Allocate request was not approved for resource %d\n",
+ (uint32_t)arg0, request.resourceBase);
+ testErrors++;
goto error_exit;
}
}
}
error_exit:
- taskCompleteCount++;
- System_printf("Client Task %d : Exiting...\n", (uint32_t)arg0);
+ taskCompleteCount++;
+ System_printf("Client Task %d : Exiting...\n", (uint32_t)arg0);
return;
}
/* Initialize the RM instances - RM must be initialized before anything else in the system
* Core 0: 1 RM Instance - RM Server
*/
- /* Create the Server instance */
+ /* Create the Server instance */
memset(&rmInitCfg, 0, sizeof(rmInitCfg));
- rmInitCfg.instName = rmServerName;
- rmInitCfg.instType = Rm_instType_SERVER;
- rmInitCfg.instCfg.serverCfg.globalResourceList = (void *)rmGRL;
- rmInitCfg.instCfg.serverCfg.globalPolicy = (void *)rmGlobalPolicy;
- rmServerHandle = Rm_init(&rmInitCfg, &result);
- ERROR_CHECK(RM_OK, result, rmServerName, "Initialization failed");
-
- /* Open Server service handle */
- rmServerServiceHandle = Rm_serviceOpenHandle(rmServerHandle, &result);
- ERROR_CHECK(RM_OK, result, rmServerName, "Service handle open failed");
-
- ///rmStartupTskServer(NULL, 0);
- /* Create the heap that will be used to allocate RM messages. This
- * heap is a multi-processor heap. It will be shared amongst
- * all RM instances. */
- HeapBufMP_Params_init(&heapBufParams);
- heapBufParams.regionId = 0;
- heapBufParams.name = RM_PKT_HEAP_NAME;
- heapBufParams.numBlocks = 64;
- heapBufParams.blockSize = sizeof(Rm_Packet);
- rmPktHeapHandle = HeapBufMP_create(&heapBufParams);
- if (rmPktHeapHandle == NULL) {
- System_printf("Error Core %d : Failed to create RM packet heap\n", coreNum);
- testErrors++;
- }
- System_printf("Core %d : RM packet heap created\n", coreNum);
-
- /* Create the heap that will be used to allocate messageQ messages. */
- HeapBufMP_Params_init(&heapBufParams);
- heapBufParams.regionId = 0;
- heapBufParams.name = MSGQ_HEAP_NAME;
- heapBufParams.numBlocks = 64;
- heapBufParams.blockSize = sizeof(MsgQ_RmPacket);
- msgQHeapHandle = HeapBufMP_create(&heapBufParams);
- if (msgQHeapHandle == NULL) {
- System_printf("Error Core %d : Failed to create HeapBufMP MessageQ heap\n", coreNum);
- testErrors++;
- }
- System_printf("Core %d : IPC MessageQ message heap created\n", coreNum);
+ rmInitCfg.instName = rmServerName;
+ rmInitCfg.instType = Rm_instType_SERVER;
+ rmInitCfg.instCfg.serverCfg.globalResourceList = (void *)rmGRL;
+ rmInitCfg.instCfg.serverCfg.globalPolicy = (void *)rmGlobalPolicy;
+ rmServerHandle = Rm_init(&rmInitCfg, &result);
+ ERROR_CHECK(RM_OK, result, rmServerName, "Initialization failed");
+
+ /* Open Server service handle */
+ rmServerServiceHandle = Rm_serviceOpenHandle(rmServerHandle, &result);
+ ERROR_CHECK(RM_OK, result, rmServerName, "Service handle open failed");
+
+ /* Create the heap that will be used to allocate RM messages. This
+ * heap is a multi-processor heap. It will be shared amongst
+ * all RM instances. */
+ HeapBufMP_Params_init(&heapBufParams);
+ heapBufParams.regionId = 0;
+ heapBufParams.name = RM_PKT_HEAP_NAME;
+ heapBufParams.numBlocks = 64;
+ heapBufParams.blockSize = sizeof(Rm_Packet);
+ rmPktHeapHandle = HeapBufMP_create(&heapBufParams);
+ if (rmPktHeapHandle == NULL) {
+ System_printf("Error Core %d : Failed to create RM packet heap\n", coreNum);
+ testErrors++;
+ }
+ System_printf("Core %d : RM packet heap created\n", coreNum);
+
+ /* Create the heap that will be used to allocate messageQ messages. */
+ HeapBufMP_Params_init(&heapBufParams);
+ heapBufParams.regionId = 0;
+ heapBufParams.name = MSGQ_HEAP_NAME;
+ heapBufParams.numBlocks = 64;
+ heapBufParams.blockSize = sizeof(MsgQ_RmPacket);
+ msgQHeapHandle = HeapBufMP_create(&heapBufParams);
+ if (msgQHeapHandle == NULL) {
+ System_printf("Error Core %d : Failed to create HeapBufMP MessageQ heap\n", coreNum);
+ testErrors++;
+ }
+ System_printf("Core %d : IPC MessageQ message heap created\n", coreNum);
/* Register the MessageQ heap with MessageQ */
MessageQ_registerHeap(msgQHeapHandle, MSGQ_HEAP_ID);
* RM Server <---> RM Client
* 1 queue on RM Server
* 1 queue on RM Client */
- serverFromClientMsgQ = MessageQ_create(serverFromClientQueueName, NULL);
- if (serverFromClientMsgQ == NULL) {
- System_printf("Error Core %d : Failed to create Server's receive Q for Client\n", coreNum);
- testErrors++;
- }
- System_printf("Core %d : Created Server receive Q for Client\n", coreNum);
+ serverFromClientMsgQ = MessageQ_create(serverFromClientQueueName, NULL);
+ if (serverFromClientMsgQ == NULL) {
+ System_printf("Error Core %d : Failed to create Server's receive Q for Client\n", coreNum);
+ testErrors++;
+ }
+ System_printf("Core %d : Created Server receive Q for Client\n", coreNum);
}
void clientInit(void)
Rm_TransportCfg rmTransportCfg;
// Client Instance Setup
- /* Initialize the client semaphore lock */
+ /* Initialize the client semaphore lock */
Semaphore_Params_init(&semParams);
client_semaphore_lock = (uint32_t *)Semaphore_create(1, &semParams, NULL);
if (client_semaphore_lock==NULL) {
- System_printf("Error : Failed to init client semaphore lock with error code: \n", client_semaphore_lock);
- testErrors++;
+ System_printf("Error : Failed to init client semaphore lock with error code: \n", client_semaphore_lock);
+ testErrors++;
return;
}
- /* Create the RM Client instance */
+ /* Create the RM Client instance */
memset(&rmInitCfg, 0, sizeof(rmInitCfg));
- rmInitCfg.instName = rmClientName;
- rmInitCfg.instType = Rm_instType_CLIENT;
+ rmInitCfg.instName = rmClientName;
+ rmInitCfg.instType = Rm_instType_CLIENT;
rmInitCfg.mtSemObj = (uint32_t *)client_semaphore_lock;
- rmClientHandle = Rm_init(&rmInitCfg, &result);
- ERROR_CHECK(RM_OK, result, rmClientName, "Initialization failed");
-
- /* Open Client service handle */
- rmClientServiceHandle = Rm_serviceOpenHandle(rmClientHandle, &result);
- ERROR_CHECK(RM_OK, result, rmClientName, "Service handle open failed");
-
- /* Open the heaps created by the other processor. Loop until opened. */
- do {
- status = HeapBufMP_open(RM_PKT_HEAP_NAME, &rmPktHeapHandle);
- /*
- * Sleep for 1 clock tick to avoid inundating remote processor
- * with interrupts if open failed
- */
- if (status < 0) {
- Task_sleep(1);
- }
- } while (status < 0);
- System_printf("Core %d : RM packet heap opened\n", coreNum);
-
- do {
- status = HeapBufMP_open(MSGQ_HEAP_NAME, &msgQHeapHandle);
- /*
- * Sleep for 1 clock tick to avoid inundating remote processor
- * with interrupts if open failed
- */
- if (status < 0) {
- Task_sleep(1);
- }
- } while (status < 0);
- System_printf("Core %d : IPC MessageQ message heap opened\n", coreNum);
+ rmClientHandle = Rm_init(&rmInitCfg, &result);
+ ERROR_CHECK(RM_OK, result, rmClientName, "Initialization failed");
+
+ /* Open Client service handle */
+ rmClientServiceHandle = Rm_serviceOpenHandle(rmClientHandle, &result);
+ ERROR_CHECK(RM_OK, result, rmClientName, "Service handle open failed");
+
+ /* Open the heaps created by the other processor. Loop until opened. */
+ do {
+ status = HeapBufMP_open(RM_PKT_HEAP_NAME, &rmPktHeapHandle);
+ /*
+ * Sleep for 1 clock tick to avoid inundating remote processor
+ * with interrupts if open failed
+ */
+ if (status < 0) {
+ Task_sleep(1);
+ }
+ } while (status < 0);
+ System_printf("Core %d : RM packet heap opened\n", coreNum);
+
+ do {
+ status = HeapBufMP_open(MSGQ_HEAP_NAME, &msgQHeapHandle);
+ /*
+ * Sleep for 1 clock tick to avoid inundating remote processor
+ * with interrupts if open failed
+ */
+ if (status < 0) {
+ Task_sleep(1);
+ }
+ } while (status < 0);
+ System_printf("Core %d : IPC MessageQ message heap opened\n", coreNum);
/* Register the MessageQ heap with MessageQ */
MessageQ_registerHeap(msgQHeapHandle, MSGQ_HEAP_ID);
* RM Server <---> RM Client
* 1 queue on RM Server
* 1 queue on RM Client */
- clientFromServerMsgQ = MessageQ_create(clientFromServerQueueName, NULL);
- if (clientFromServerMsgQ == NULL) {
- System_printf("Error Core %d : Failed to create client's receive Q for Server\n", coreNum);
- testErrors++;
- }
- System_printf("Core %d : Created client receive Q for Server\n", coreNum);
+ clientFromServerMsgQ = MessageQ_create(clientFromServerQueueName, NULL);
+ if (clientFromServerMsgQ == NULL) {
+ System_printf("Error Core %d : Failed to create client's receive Q for Server\n", coreNum);
+ testErrors++;
+ }
+ System_printf("Core %d : Created client receive Q for Server\n", coreNum);
/* Open the remote message queues. Also register the RM transports with each RM instance */
- /* Open the Server messageQ from the Client Delegate */
- do {
- status = MessageQ_open(serverFromClientQueueName, &clientToServerQId);
- /*
- * Sleep for 1 clock tick to avoid inundating remote processor
- * with interrupts if open failed
- */
- if (status < 0) {
- Task_sleep(1);
- }
- } while (status < 0);
- System_printf("Core %d : RM Server MessageQ opened from RM Client\n", coreNum);
-
- /* Register the Server with the RM Client Instance */
- rmTransportCfg.rmHandle = rmClientHandle;
- rmTransportCfg.appTransportHandle = (Rm_AppTransportHandle) clientToServerQId;
- rmTransportCfg.remoteInstType = Rm_instType_SERVER;
- rmTransportCfg.transportCallouts.rmAllocPkt = transportAlloc;
- rmTransportCfg.transportCallouts.rmSendPkt = transportSend;
- clientServerHandle = Rm_transportRegister(&rmTransportCfg, &result);
-
- /* Store the mapping information in the transport map */
- rmTransportMap[SERVER_TO_CLIENT_MAP_ENTRY].transportHandle = clientServerHandle;
- rmTransportMap[SERVER_TO_CLIENT_MAP_ENTRY].receiveMsgQ = clientFromServerMsgQ;
- System_printf("Core %d : Registered RM Client <=> RM Server transport with RM Client instance\n", coreNum);
+ /* Open the Server messageQ from the Client Delegate */
+ do {
+ status = MessageQ_open(serverFromClientQueueName, &clientToServerQId);
+ /*
+ * Sleep for 1 clock tick to avoid inundating remote processor
+ * with interrupts if open failed
+ */
+ if (status < 0) {
+ Task_sleep(1);
+ }
+ } while (status < 0);
+ System_printf("Core %d : RM Server MessageQ opened from RM Client\n", coreNum);
+
+ /* Register the Server with the RM Client Instance */
+ rmTransportCfg.rmHandle = rmClientHandle;
+ rmTransportCfg.appTransportHandle = (Rm_AppTransportHandle) clientToServerQId;
+ rmTransportCfg.remoteInstType = Rm_instType_SERVER;
+ rmTransportCfg.transportCallouts.rmAllocPkt = transportAlloc;
+ rmTransportCfg.transportCallouts.rmSendPkt = transportSend;
+ clientServerHandle = Rm_transportRegister(&rmTransportCfg, &result);
+
+ /* Store the mapping information in the transport map */
+ rmTransportMap[SERVER_TO_CLIENT_MAP_ENTRY].transportHandle = clientServerHandle;
+ rmTransportMap[SERVER_TO_CLIENT_MAP_ENTRY].receiveMsgQ = clientFromServerMsgQ;
+ System_printf("Core %d : Registered RM Client <=> RM Server transport with RM Client instance\n", coreNum);
}
void rmCleanup(void)
}
/* Cleanup all service ports, transport handles, RM instances, and IPC constructs */
- result = Rm_transportUnregister(rmTransportMap[CLIENT_TO_SERVER_MAP_ENTRY].transportHandle);
- ERROR_CHECK(RM_OK, result, rmServerName, "Unregister of Server transport failed");
- result = Rm_serviceCloseHandle(rmServerServiceHandle);
- ERROR_CHECK(RM_OK, result, rmServerName, "Service handle close failed");
- result = Rm_delete(rmServerHandle, RM_TEST_TRUE);
- ERROR_CHECK(RM_OK, result, rmServerName, "Instance delete failed");
-
- result = Rm_transportUnregister(rmTransportMap[SERVER_TO_CLIENT_MAP_ENTRY].transportHandle);
- ERROR_CHECK(RM_OK, result, rmClientName, "Unregister of Client transport failed");
- result = Rm_serviceCloseHandle(rmClientServiceHandle);
- ERROR_CHECK(RM_OK, result, rmClientName, "Service handle close failed");
- result = Rm_delete(rmClientHandle, RM_TEST_TRUE);
- ERROR_CHECK(RM_OK, result, rmClientName, "Instance delete failed");
-
- // delete the client_semaphore_lock
- if (client_semaphore_lock)
- {
- Semaphore_delete((Semaphore_Handle *)client_semaphore_lock);
- }
-
- System_printf ("Core %d : ---------------------------------------------------------\n", coreNum);
- System_printf ("Core %d : ------------------ Memory Leak Check --------------------\n", coreNum);
- System_printf ("Core %d : - : malloc count | free count -\n", coreNum);
- System_printf ("Core %d : - Example Completion : %6d | %6d -\n", coreNum,
+ result = Rm_transportUnregister(rmTransportMap[CLIENT_TO_SERVER_MAP_ENTRY].transportHandle);
+ ERROR_CHECK(RM_OK, result, rmServerName, "Unregister of Server transport failed");
+ result = Rm_serviceCloseHandle(rmServerServiceHandle);
+ ERROR_CHECK(RM_OK, result, rmServerName, "Service handle close failed");
+ result = Rm_delete(rmServerHandle, RM_TEST_TRUE);
+ ERROR_CHECK(RM_OK, result, rmServerName, "Instance delete failed");
+
+ result = Rm_transportUnregister(rmTransportMap[SERVER_TO_CLIENT_MAP_ENTRY].transportHandle);
+ ERROR_CHECK(RM_OK, result, rmClientName, "Unregister of Client transport failed");
+ result = Rm_serviceCloseHandle(rmClientServiceHandle);
+ ERROR_CHECK(RM_OK, result, rmClientName, "Service handle close failed");
+ result = Rm_delete(rmClientHandle, RM_TEST_TRUE);
+ ERROR_CHECK(RM_OK, result, rmClientName, "Instance delete failed");
+
+ // delete the client_semaphore_lock
+ if (client_semaphore_lock)
+ {
+ Semaphore_delete((Semaphore_Handle *)client_semaphore_lock);
+ }
+
+ System_printf("Core %d : ---------------------------------------------------------\n", coreNum);
+ System_printf("Core %d : ------------------ Memory Leak Check --------------------\n", coreNum);
+ System_printf("Core %d : - : malloc count | free count -\n", coreNum);
+ System_printf("Core %d : - Example Completion : %6d | %6d -\n", coreNum,
rmMallocCounter, rmFreeCounter);
finalMallocFree = rmMallocCounter - rmFreeCounter;
if (finalMallocFree > 0) {
- System_printf ("Core %d : - FAILED - %6d unfreed mallocs -\n",
+ System_printf("Core %d : - FAILED - %6d unfreed mallocs -\n",
coreNum, finalMallocFree);
testErrors++;
}
else if (finalMallocFree < 0) {
- System_printf ("Core %d : - FAILED - %6d more frees than mallocs -\n",
+ System_printf("Core %d : - FAILED - %6d more frees than mallocs -\n",
coreNum, -finalMallocFree);
testErrors++;
}
else {
- System_printf ("Core %d : - PASSED -\n",
+ System_printf("Core %d : - PASSED -\n",
coreNum);
}
- System_printf ("Core %d : ---------------------------------------------------------\n", coreNum);
- System_printf ("\n");
+ System_printf("Core %d : ---------------------------------------------------------\n", coreNum);
+ System_printf("\n");
- System_printf ("Core %d : ---------------------------------------------------------\n", coreNum);
- System_printf ("Core %d : ------------------ Example Completion -------------------\n", coreNum);
+ System_printf("Core %d : ---------------------------------------------------------\n", coreNum);
+ System_printf("Core %d : ------------------ Example Completion -------------------\n", coreNum);
if (testErrors) {
- System_printf ("Core %d : - Test Errors: %-32d -\n", coreNum, testErrors);
+ System_printf("Core %d : - Test Errors: %-32d -\n", coreNum, testErrors);
}
- System_printf ("Core %d : ---------------------------------------------------------\n", coreNum);
- System_printf ("\n");
+ System_printf("Core %d : ---------------------------------------------------------\n", coreNum);
+ System_printf("\n");
BIOS_exit(0);
}
int32_t result = 0;
Task_Params taskParams;
- System_printf ("*********************************************************\n");
- System_printf ("***************** RM Startup Task ***********************\n");
- System_printf ("*********************************************************\n");
+ System_printf("*********************************************************\n");
+ System_printf("***************** RM Startup Task ***********************\n");
+ System_printf("*********************************************************\n");
- System_printf ("RM Version : 0x%08x\nVersion String: %s\n", Rm_getVersion(), Rm_getVersionStr());
+ System_printf("RM Version : 0x%08x\nVersion String: %s\n", Rm_getVersion(), Rm_getVersionStr());
// Server Instance Setup
serverInit();
clientInit();
/* Open the remote message queues. Also register the RM transports with each RM instance */
- /* Open the Client Delegate messageQ from the Server */
- do {
- status = MessageQ_open(clientFromServerQueueName, &serverToClientQId);
- /*
- * Sleep for 1 clock tick to avoid inundating remote processor
- * with interrupts if open failed
- */
- if (status < 0) {
- Task_sleep(1);
- }
- } while (status < 0);
- System_printf("Core %d : RM Client MessageQ opened from RM Server\n", coreNum);
-
- /* Register the Client with the RM Server Instance */
- rmTransportCfg.rmHandle = rmServerHandle;
- rmTransportCfg.appTransportHandle = (Rm_AppTransportHandle) serverToClientQId;
- rmTransportCfg.remoteInstType = Rm_instType_CLIENT;
- rmTransportCfg.transportCallouts.rmAllocPkt = transportAlloc;
- rmTransportCfg.transportCallouts.rmSendPkt = transportSend;
- serverClientHandle = Rm_transportRegister(&rmTransportCfg, &result);
-
- /* Store the mapping information in the transport map */
- rmTransportMap[CLIENT_TO_SERVER_MAP_ENTRY].transportHandle = serverClientHandle;
- rmTransportMap[CLIENT_TO_SERVER_MAP_ENTRY].receiveMsgQ = serverFromClientMsgQ;
- System_printf("Core %d : Registered RM Server <=> RM CLient transport with RM Server instance\n", coreNum);
-
- /* Create the RM server receive task */
- System_printf("Core %d : Creating RM receive task...\n", coreNum);
- Task_Params_init (&taskParams);
- taskParams.priority = 4;
- rmReceiveTskHandleServer = Task_create (rmReceiveTskServer, &taskParams, NULL);
+ /* Open the Client Delegate messageQ from the Server */
+ do {
+ status = MessageQ_open(clientFromServerQueueName, &serverToClientQId);
+ /*
+ * Sleep for 1 clock tick to avoid inundating remote processor
+ * with interrupts if open failed
+ */
+ if (status < 0) {
+ Task_sleep(1);
+ }
+ } while (status < 0);
+ System_printf("Core %d : RM Client MessageQ opened from RM Server\n", coreNum);
+
+ /* Register the Client with the RM Server Instance */
+ rmTransportCfg.rmHandle = rmServerHandle;
+ rmTransportCfg.appTransportHandle = (Rm_AppTransportHandle) serverToClientQId;
+ rmTransportCfg.remoteInstType = Rm_instType_CLIENT;
+ rmTransportCfg.transportCallouts.rmAllocPkt = transportAlloc;
+ rmTransportCfg.transportCallouts.rmSendPkt = transportSend;
+ serverClientHandle = Rm_transportRegister(&rmTransportCfg, &result);
+
+ /* Store the mapping information in the transport map */
+ rmTransportMap[CLIENT_TO_SERVER_MAP_ENTRY].transportHandle = serverClientHandle;
+ rmTransportMap[CLIENT_TO_SERVER_MAP_ENTRY].receiveMsgQ = serverFromClientMsgQ;
+ System_printf("Core %d : Registered RM Server <=> RM CLient transport with RM Server instance\n", coreNum);
+
+ /* Create the RM server receive task */
+ System_printf("Core %d : Creating RM receive task...\n", coreNum);
+ Task_Params_init (&taskParams);
+ taskParams.priority = 4;
+ rmReceiveTskHandleServer = Task_create (rmReceiveTskServer, &taskParams, NULL);
/* Create the RM client receive task. Assign higher priority than the test tasks so that
* when they spin waiting for messages from other RM instances the receive task is
taskParams.priority = 4;
rmReceiveTskHandleClient = Task_create (rmReceiveTskClient, &taskParams, NULL);
- /* Create the RM client test task 1 */
- System_printf("Core %d : Creating RM client test task 1...\n", coreNum);
- Task_Params_init (&taskParams);
+ /* Create the RM client test task 1 */
+ System_printf("Core %d : Creating RM client test task 1...\n", coreNum);
+ Task_Params_init (&taskParams);
taskParams.priority = 1;
taskParams.arg0 = 1;
rmClientTskHandle1 = Task_create (rmClientTsk, &taskParams, NULL);
- /* Create the RM client test task 2 */
- System_printf("Core %d : Creating RM client test task 2...\n", coreNum);
- Task_Params_init (&taskParams);
+ /* Create the RM client test task 2 */
+ System_printf("Core %d : Creating RM client test task 2...\n", coreNum);
+ Task_Params_init (&taskParams);
taskParams.priority = 2;
taskParams.arg0 = 2;
rmClientTskHandle2 = Task_create (rmClientTsk, &taskParams, NULL);
- // wait for all the tasks to complete
- while (taskCompleteCount!=2)
- {
- Task_sleep(100);
- }
+ // wait for all the tasks to complete
+ while (taskCompleteCount!=2)
+ {
+ Task_sleep(100);
+ }
- // resource allocation checking
+ // resource allocation checking
if (!testErrors) {
- System_printf("Tasks complete - Checking for allocation errors\n");
+ System_printf("Tasks complete - Checking for allocation errors\n");
for (i = 0; i < REQUEST_ITERATIONS; i++) {
if (allocs[i] != 1) {
- System_printf ("FAILED : Resource %d not allocated exactly once\n", i);
+ System_printf ("FAILED : Resource %d not allocated exactly once\n", i);
testErrors++;
}
}
if (!testErrors) {
- System_printf("PASSED : All Resources allocated once\n");
+ System_printf("PASSED : All Resources allocated once\n");
}
}
// clean up
rmCleanup();
-
}
int main(Int argc, Char* argv[])
{
- Task_Params taskParams;
- int status, i;
+ Task_Params taskParams;
+ int status, i;
- System_printf ("*********************************************************\n");
- System_printf ("********************** RM Testing ***********************\n");
- System_printf ("*********************************************************\n");
+ System_printf("*********************************************************\n");
+ System_printf("********************** RM Testing ***********************\n");
+ System_printf("*********************************************************\n");
- System_printf ("RM Version : 0x%08x\nVersion String: %s\n", Rm_getVersion(), Rm_getVersionStr());
+ System_printf("RM Version : 0x%08x\nVersion String: %s\n", Rm_getVersion(), Rm_getVersionStr());
coreNum = CSL_chipReadReg(CSL_CHIP_DNUM);
testErrors = 0;