From 6f1adaf68285ef70e1c69d57b01c5c7b6d7fb2e6 Mon Sep 17 00:00:00 2001 From: Nick Bofferding Date: Wed, 9 Nov 2011 18:15:33 -0600 Subject: Support host boot mutex attributes - Prevented mutex attributes from being copied in target APIs - Added target APIs to get/tryGet mutex attribute references - Added testcases to verify mutex attributes - Added mutex attribute type to XML definition - Added test mutex attribute to system target XML definition - Modified attribute compiler to support mutex attributes and restrictions - Replaced 100000 cycle loop in synctest.H with nanosleep for 10 CTX switches - Added context switch time macros to time.h - Removed context switch time macros from taskwaittest.H and renamed existing macro calls - Removed context switch time macros from synctest.H and renamed existing macro calls Change-Id: I93fecfa75e00e509fa442e4dd5c9e3fd67866e98 Reviewed-on: http://gfw160.austin.ibm.com:8080/gerrit/491 Tested-by: Jenkins Server Reviewed-by: A. Patrick Williams III --- src/usr/testcore/kernel/taskwaittest.H | 7 ++----- src/usr/testcore/lib/synctest.H | 7 ++----- 2 files changed, 4 insertions(+), 10 deletions(-) (limited to 'src/usr/testcore') diff --git a/src/usr/testcore/kernel/taskwaittest.H b/src/usr/testcore/kernel/taskwaittest.H index 8c59aedc7..0595d2961 100644 --- a/src/usr/testcore/kernel/taskwaittest.H +++ b/src/usr/testcore/kernel/taskwaittest.H @@ -31,9 +31,6 @@ #include #include -#define NS_PER_SEC (1000000ull) -#define TEN_CTX_SWITCHES ((NS_PER_SEC/TimeManager::TIMESLICE_PER_SEC)*10) - class TaskWaitTest : public CxxTest::TestSuite { public: @@ -153,13 +150,13 @@ class TaskWaitTest : public CxxTest::TestSuite static void WaitSomeTime(void* retval) { - nanosleep(0,TEN_CTX_SWITCHES); + nanosleep(0,TEN_CTX_SWITCHES_NS); if (retval) task_end2(retval); } static void WaitSomeLongerTime(void* retval) { - nanosleep(0, 2*TEN_CTX_SWITCHES); + nanosleep(0, 2*TEN_CTX_SWITCHES_NS); if (retval) task_end2(retval); } diff --git a/src/usr/testcore/lib/synctest.H b/src/usr/testcore/lib/synctest.H index e8b0ef1e0..e1de74843 100644 --- a/src/usr/testcore/lib/synctest.H +++ b/src/usr/testcore/lib/synctest.H @@ -35,9 +35,6 @@ #include -#define NS_PER_SEC (1000000ull) -#define TEN_CTX_SWITCHES ((NS_PER_SEC/TimeManager::TIMESLICE_PER_SEC)*10) - class SyncTest: public CxxTest::TestSuite { public: @@ -66,7 +63,7 @@ class SyncTest: public CxxTest::TestSuite mutex_lock(&mutex); task_create(func2, this); task_create(func2, this); - nanosleep(0,TEN_CTX_SWITCHES); + nanosleep(0,TEN_CTX_SWITCHES_NS); mutex_unlock(&mutex); barrier_wait(&barrier); TS_TRACE("ALL THREADS ENDED"); @@ -95,7 +92,7 @@ class SyncTest: public CxxTest::TestSuite barrier_t * barrier = &(my->barrier); mutex_lock(mutex); - for(int i = 0; i < 100000; ++i); + nanosleep(0,TEN_CTX_SWITCHES_NS); TS_TRACE("ME FIRST"); mutex_unlock(mutex); barrier_wait(barrier); -- cgit v1.2.1