summaryrefslogtreecommitdiffstats
path: root/src/usr/testcore
diff options
context:
space:
mode:
authorNick Bofferding <bofferdn@us.ibm.com>2011-11-09 18:15:33 -0600
committerA. Patrick Williams III <iawillia@us.ibm.com>2011-11-16 10:07:41 -0600
commit6f1adaf68285ef70e1c69d57b01c5c7b6d7fb2e6 (patch)
tree9538afbe255b4f4d1e9bf9cd878ad4e89f43844c /src/usr/testcore
parent4d9344f1025ee77e24e88249dd3e32f3d4c9a3ba (diff)
downloadtalos-hostboot-6f1adaf68285ef70e1c69d57b01c5c7b6d7fb2e6.tar.gz
talos-hostboot-6f1adaf68285ef70e1c69d57b01c5c7b6d7fb2e6.zip
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 <iawillia@us.ibm.com>
Diffstat (limited to 'src/usr/testcore')
-rw-r--r--src/usr/testcore/kernel/taskwaittest.H7
-rw-r--r--src/usr/testcore/lib/synctest.H7
2 files changed, 4 insertions, 10 deletions
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 <kernel/console.H>
#include <kernel/timemgr.H>
-#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 <kernel/timemgr.H>
-#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);
OpenPOWER on IntegriCloud