diff options
author | Bill Schwartz <whs@us.ibm.com> | 2012-10-10 10:36:29 -0500 |
---|---|---|
committer | A. Patrick Williams III <iawillia@us.ibm.com> | 2012-10-12 16:29:17 -0500 |
commit | b201169eeae76a7697f4f207dd583d40a2f07f66 (patch) | |
tree | a05fa3da99dddab0491623aebc1110e73d430bf7 /src/usr/testcore | |
parent | 3536e96bd3a1d490cec900617fab6703fb7798ea (diff) | |
download | talos-hostboot-b201169eeae76a7697f4f207dd583d40a2f07f66.tar.gz talos-hostboot-b201169eeae76a7697f4f207dd583d40a2f07f66.zip |
Memory Leak task_end
Change-Id: Idb7a2d8d72a55f644efd0b2548eca5df5d062e6d
RTC: 47491
Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/2011
Tested-by: Jenkins Server
Reviewed-by: A. Patrick Williams III <iawillia@us.ibm.com>
Diffstat (limited to 'src/usr/testcore')
-rw-r--r-- | src/usr/testcore/kernel/msgtest.H | 50 | ||||
-rw-r--r-- | src/usr/testcore/kernel/taskwaittest.H | 59 | ||||
-rw-r--r-- | src/usr/testcore/kernel/vmmbasetest.H | 60 | ||||
-rw-r--r-- | src/usr/testcore/kernel/vmmpagetest.H | 55 | ||||
-rw-r--r-- | src/usr/testcore/lib/synctest.H | 69 |
5 files changed, 149 insertions, 144 deletions
diff --git a/src/usr/testcore/kernel/msgtest.H b/src/usr/testcore/kernel/msgtest.H index 995baace3..6f3415e6c 100644 --- a/src/usr/testcore/kernel/msgtest.H +++ b/src/usr/testcore/kernel/msgtest.H @@ -1,25 +1,25 @@ -// IBM_PROLOG_BEGIN_TAG -// This is an automatically generated prolog. -// -// $Source: src/usr/testcore/kernel/msgtest.H $ -// -// IBM CONFIDENTIAL -// -// COPYRIGHT International Business Machines Corp. 2012 -// -// p1 -// -// Object Code Only (OCO) source materials -// Licensed Internal Code Source Materials -// IBM HostBoot Licensed Internal Code -// -// The source code for this program is not published or other- -// wise divested of its trade secrets, irrespective of what has -// been deposited with the U.S. Copyright Office. -// -// Origin: 30 -// -// IBM_PROLOG_END +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/usr/testcore/kernel/msgtest.H $ */ +/* */ +/* IBM CONFIDENTIAL */ +/* */ +/* COPYRIGHT International Business Machines Corp. 2012 */ +/* */ +/* p1 */ +/* */ +/* Object Code Only (OCO) source materials */ +/* Licensed Internal Code Source Materials */ +/* IBM HostBoot Licensed Internal Code */ +/* */ +/* The source code for this program is not published or otherwise */ +/* divested of its trade secrets, irrespective of what has been */ +/* deposited with the U.S. Copyright Office. */ +/* */ +/* Origin: 30 */ +/* */ +/* IBM_PROLOG_END_TAG */ /** @file msgtest.H * @brief Testcases for the messaging subsystem of the kernel. @@ -96,7 +96,7 @@ class MessagingTest : public CxxTest::TestSuite enum msg_types { SHUTDOWN, ECHO }; - static void processMsg(void* _msgQ) + static void* processMsg(void* _msgQ) { msg_q_t msgQ = static_cast<msg_q_t>(_msgQ); @@ -106,8 +106,7 @@ class MessagingTest : public CxxTest::TestSuite { case SHUTDOWN: // Shutdown. msg_free(msg); - task_end(); - break; + return NULL; case ECHO: if (msg->data[1]) @@ -120,5 +119,6 @@ class MessagingTest : public CxxTest::TestSuite break; } } + return NULL; } }; diff --git a/src/usr/testcore/kernel/taskwaittest.H b/src/usr/testcore/kernel/taskwaittest.H index 0595d2961..03719008c 100644 --- a/src/usr/testcore/kernel/taskwaittest.H +++ b/src/usr/testcore/kernel/taskwaittest.H @@ -1,25 +1,25 @@ -// IBM_PROLOG_BEGIN_TAG -// This is an automatically generated prolog. -// -// $Source: src/usr/testcore/kernel/tasktest.H $ -// -// IBM CONFIDENTIAL -// -// COPYRIGHT International Business Machines Corp. 2011 -// -// p1 -// -// Object Code Only (OCO) source materials -// Licensed Internal Code Source Materials -// IBM HostBoot Licensed Internal Code -// -// The source code for this program is not published or other- -// wise divested of its trade secrets, irrespective of what has -// been deposited with the U.S. Copyright Office. -// -// Origin: 30 -// -// IBM_PROLOG_END +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/usr/testcore/kernel/taskwaittest.H $ */ +/* */ +/* IBM CONFIDENTIAL */ +/* */ +/* COPYRIGHT International Business Machines Corp. 2011,2012 */ +/* */ +/* p1 */ +/* */ +/* Object Code Only (OCO) source materials */ +/* Licensed Internal Code Source Materials */ +/* IBM HostBoot Licensed Internal Code */ +/* */ +/* The source code for this program is not published or otherwise */ +/* divested of its trade secrets, irrespective of what has been */ +/* deposited with the U.S. Copyright Office. */ +/* */ +/* Origin: 30 */ +/* */ +/* IBM_PROLOG_END_TAG */ /** @file tasktest.H * @brief Test cases for task interfaces. */ @@ -148,27 +148,28 @@ class TaskWaitTest : public CxxTest::TestSuite } } - static void WaitSomeTime(void* retval) + static void* WaitSomeTime(void* retval) { nanosleep(0,TEN_CTX_SWITCHES_NS); - if (retval) task_end2(retval); + return retval; } - static void WaitSomeLongerTime(void* retval) + static void* WaitSomeLongerTime(void* retval) { nanosleep(0, 2*TEN_CTX_SWITCHES_NS); - if (retval) task_end2(retval); + return retval; } - static void TaskWithChild(void* unused) + static void* TaskWithChild(void* unused) { tid_t child = task_create(&WaitSomeTime, NULL); - task_end2(reinterpret_cast<void*>(child)); + return reinterpret_cast<void*>(child); } - static void TaskThatCrashes(void* unused) + static void* TaskThatCrashes(void* unused) { printk("Test case: Expect to see uncaught exception! "); *(int64_t*)(0) = 0xDEADC0DE; + return NULL; } }; diff --git a/src/usr/testcore/kernel/vmmbasetest.H b/src/usr/testcore/kernel/vmmbasetest.H index 2df580e1c..ce5fd990b 100644 --- a/src/usr/testcore/kernel/vmmbasetest.H +++ b/src/usr/testcore/kernel/vmmbasetest.H @@ -1,26 +1,25 @@ -/* IBM_PROLOG_BEGIN_TAG - * This is an automatically generated prolog. - * - * $Source: src/usr/testcore/kernel/vmmbasetest.H $ - * - * IBM CONFIDENTIAL - * - * COPYRIGHT International Business Machines Corp. 2011-2012 - * - * p1 - * - * Object Code Only (OCO) source materials - * Licensed Internal Code Source Materials - * IBM HostBoot Licensed Internal Code - * - * The source code for this program is not published or other- - * wise divested of its trade secrets, irrespective of what has - * been deposited with the U.S. Copyright Office. - * - * Origin: 30 - * - * IBM_PROLOG_END_TAG - */ +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/usr/testcore/kernel/vmmbasetest.H $ */ +/* */ +/* IBM CONFIDENTIAL */ +/* */ +/* COPYRIGHT International Business Machines Corp. 2011,2012 */ +/* */ +/* p1 */ +/* */ +/* Object Code Only (OCO) source materials */ +/* Licensed Internal Code Source Materials */ +/* IBM HostBoot Licensed Internal Code */ +/* */ +/* The source code for this program is not published or otherwise */ +/* divested of its trade secrets, irrespective of what has been */ +/* deposited with the U.S. Copyright Office. */ +/* */ +/* Origin: 30 */ +/* */ +/* IBM_PROLOG_END_TAG */ /** @file vmmbasetest.H * @brief Test cases for permission settings on the base block of the VMM. */ @@ -132,25 +131,25 @@ class VmmBaseTest : public CxxTest::TestSuite private: - static void readFromNULL(void* unused) + static void* readFromNULL(void* unused) { printk("%lx", (*(uint64_t*)NULL)); - task_end(); + return NULL; } - static void writeToNULL(void* unused) + static void* writeToNULL(void* unused) { (*(uint64_t*)NULL) = 0x12345678; - task_end(); + return NULL; } - static void writeToKernelCode(void* unused) + static void* writeToKernelCode(void* unused) { (*(*(uint64_t**)&printk)) = 0x12345678; - task_end(); + return NULL; } - static void msgDaemon(void* unused) + static void* msgDaemon(void* unused) { msg_t* message = NULL; uint64_t ea = 0; @@ -166,6 +165,7 @@ class VmmBaseTest : public CxxTest::TestSuite msg_respond(iv_mq, message); } } + return NULL; } }; diff --git a/src/usr/testcore/kernel/vmmpagetest.H b/src/usr/testcore/kernel/vmmpagetest.H index a6679cc81..51b40731e 100644 --- a/src/usr/testcore/kernel/vmmpagetest.H +++ b/src/usr/testcore/kernel/vmmpagetest.H @@ -1,25 +1,25 @@ -// IBM_PROLOG_BEGIN_TAG -// This is an automatically generated prolog. -// -// $Source: src/usr/testcore/kernel/vmmpagetest.H $ -// -// IBM CONFIDENTIAL -// -// COPYRIGHT International Business Machines Corp. 2011 -// -// p1 -// -// Object Code Only (OCO) source materials -// Licensed Internal Code Source Materials -// IBM HostBoot Licensed Internal Code -// -// The source code for this program is not published or other- -// wise divested of its trade secrets, irrespective of what has -// been deposited with the U.S. Copyright Office. -// -// Origin: 30 -// -// IBM_PROLOG_END +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/usr/testcore/kernel/vmmpagetest.H $ */ +/* */ +/* IBM CONFIDENTIAL */ +/* */ +/* COPYRIGHT International Business Machines Corp. 2011,2012 */ +/* */ +/* p1 */ +/* */ +/* Object Code Only (OCO) source materials */ +/* Licensed Internal Code Source Materials */ +/* IBM HostBoot Licensed Internal Code */ +/* */ +/* The source code for this program is not published or otherwise */ +/* divested of its trade secrets, irrespective of what has been */ +/* deposited with the U.S. Copyright Office. */ +/* */ +/* Origin: 30 */ +/* */ +/* IBM_PROLOG_END_TAG */ #ifndef __VMMPAGETEST_H #define __VMMPAGETEST_H /** @@ -211,7 +211,7 @@ class vmmpagetest: public CxxTest::TestSuite private: - static void testDaemon(void* unused) + static void* testDaemon(void* unused) { msg_t* message = NULL; uint64_t ea = 0; @@ -227,19 +227,20 @@ class vmmpagetest: public CxxTest::TestSuite rc = msg_respond(iv_mq, message); } } + return NULL; } - static void writeAddrWithNoPerm(void* unused) + static void* writeAddrWithNoPerm(void* unused) { (*(volatile uint64_t *)(iv_va+4*PAGESIZE)) = 0x11111111; sync(); - task_end(); + return NULL; } - static void writeAddrWithNoPerm2(void* unused) + static void* writeAddrWithNoPerm2(void* unused) { (*(volatile uint64_t *)(iv_va+4*PAGESIZE+2*PAGESIZE)) = 0x22222222; sync(); - task_end(); + return NULL; } diff --git a/src/usr/testcore/lib/synctest.H b/src/usr/testcore/lib/synctest.H index 3f6f6e248..b7fc669b0 100644 --- a/src/usr/testcore/lib/synctest.H +++ b/src/usr/testcore/lib/synctest.H @@ -1,25 +1,25 @@ -// IBM_PROLOG_BEGIN_TAG -// This is an automatically generated prolog. -// -// $Source: src/usr/testcore/lib/synctest.H $ -// -// IBM CONFIDENTIAL -// -// COPYRIGHT International Business Machines Corp. 2011 -// -// p1 -// -// Object Code Only (OCO) source materials -// Licensed Internal Code Source Materials -// IBM HostBoot Licensed Internal Code -// -// The source code for this program is not published or other- -// wise divested of its trade secrets, irrespective of what has -// been deposited with the U.S. Copyright Office. -// -// Origin: 30 -// -// IBM_PROLOG_END +/* IBM_PROLOG_BEGIN_TAG */ +/* This is an automatically generated prolog. */ +/* */ +/* $Source: src/usr/testcore/lib/synctest.H $ */ +/* */ +/* IBM CONFIDENTIAL */ +/* */ +/* COPYRIGHT International Business Machines Corp. 2011,2012 */ +/* */ +/* p1 */ +/* */ +/* Object Code Only (OCO) source materials */ +/* Licensed Internal Code Source Materials */ +/* IBM HostBoot Licensed Internal Code */ +/* */ +/* The source code for this program is not published or otherwise */ +/* divested of its trade secrets, irrespective of what has been */ +/* deposited with the U.S. Copyright Office. */ +/* */ +/* Origin: 30 */ +/* */ +/* IBM_PROLOG_END_TAG */ #ifndef __SYNCTEST_H #define __SYNCTEST_H /** @@ -163,7 +163,7 @@ class SyncTest: public CxxTest::TestSuite size_t counter; - static void func1(void * i_p) + static void* func1(void * i_p) { SyncTest * my = (SyncTest *) i_p; mutex_t * mutex = &(my->mutex); @@ -174,10 +174,10 @@ class SyncTest: public CxxTest::TestSuite TS_TRACE("ME FIRST"); mutex_unlock(mutex); barrier_wait(barrier); - task_end(); + return NULL; } - static void func2(void * i_p) + static void* func2(void * i_p) { SyncTest * my = (SyncTest *) i_p; mutex_t * mutex = &(my->mutex); @@ -187,25 +187,25 @@ class SyncTest: public CxxTest::TestSuite TS_TRACE("ME NEXT"); mutex_unlock(mutex); barrier_wait(barrier); - task_end(); + return NULL; } - static void func3(void * i_p) + static void* func3(void * i_p) { barrier_t * barrier = (barrier_t *) i_p; barrier_wait(barrier); TS_TRACE("B1"); - task_end(); + return NULL; } - static void func4(void * i_p) + static void* func4(void * i_p) { barrier_t * barrier = (barrier_t *) i_p; barrier_wait(barrier); TS_TRACE("B2"); - task_end(); + return NULL; } - static void watch_counter(void * i_p) + static void* watch_counter(void * i_p) { TASK_INFO * info = (TASK_INFO *) i_p; SyncTest * my = info->testobj; @@ -222,10 +222,11 @@ class SyncTest: public CxxTest::TestSuite } mutex_unlock(&(my->mutex)); barrier_wait(&(my->barrier)); + return NULL; } - static void increment(void * i_p) + static void* increment(void * i_p) { TASK_INFO * info = (TASK_INFO *) i_p; SyncTest * my = info->testobj; @@ -247,9 +248,10 @@ class SyncTest: public CxxTest::TestSuite nanosleep(0,TEN_CTX_SWITCHES_NS); } barrier_wait(&(my->barrier)); + return NULL; } - static void increment1(void * i_p) + static void* increment1(void * i_p) { TASK_INFO * info = (TASK_INFO *) i_p; SyncTest * my = info->testobj; @@ -271,6 +273,7 @@ class SyncTest: public CxxTest::TestSuite nanosleep(0,TEN_CTX_SWITCHES_NS); } barrier_wait(&(my->barrier)); + return NULL; } }; |