summaryrefslogtreecommitdiffstats
path: root/testsuites/sptests
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2016-05-17 15:43:31 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2016-05-20 07:49:41 +0200
commitdab902d5b2688fe958118299f7d44d1adbf13878 (patch)
treefa54fcf607d93dd03017f9d0eb1f82ca0f55aca4 /testsuites/sptests
parentscore: Avoid Giant _Objects_Extend_information() (diff)
downloadrtems-dab902d5b2688fe958118299f7d44d1adbf13878.tar.bz2
testsuites: Avoid Giant lock
Replace _Thread_Disable_dispatch() with _Thread_Dispatch_disable(). Replace _Thread_Enable_dispatch() with _Thread_Dispatch_enable(). This is a preparation to remove the Giant lock. Update #2555.
Diffstat (limited to 'testsuites/sptests')
-rw-r--r--testsuites/sptests/sp37/init.c9
-rw-r--r--testsuites/sptests/sp75/init.c9
-rw-r--r--testsuites/sptests/spfatal01/testcase.h2
-rw-r--r--testsuites/sptests/spfatal03/testcase.h6
-rw-r--r--testsuites/sptests/spintrcritical20/init.c5
-rw-r--r--testsuites/sptests/spthreadlife01/init.c9
-rw-r--r--testsuites/sptests/spthreadq01/init.c4
7 files changed, 22 insertions, 22 deletions
diff --git a/testsuites/sptests/sp37/init.c b/testsuites/sptests/sp37/init.c
index cec6d06824..68b28a6703 100644
--- a/testsuites/sptests/sp37/init.c
+++ b/testsuites/sptests/sp37/init.c
@@ -402,8 +402,9 @@ rtems_timer_service_routine test_unblock_task(
void *arg
)
{
- bool in_isr;
- rtems_status_code status;
+ bool in_isr;
+ rtems_status_code status;
+ Per_CPU_Control *cpu_self;
in_isr = rtems_interrupt_is_in_progress();
status = rtems_task_is_suspended( blocked_task_id );
@@ -420,9 +421,9 @@ rtems_timer_service_routine test_unblock_task(
}
blocked_task_status = 2;
- _Thread_Disable_dispatch();
+ cpu_self = _Thread_Dispatch_disable();
status = rtems_task_resume( blocked_task_id );
- _Thread_Unnest_dispatch();
+ _Thread_Dispatch_enable( cpu_self );
directive_failed( status, "rtems_task_resume" );
}
diff --git a/testsuites/sptests/sp75/init.c b/testsuites/sptests/sp75/init.c
index 2822586774..e699e766c6 100644
--- a/testsuites/sptests/sp75/init.c
+++ b/testsuites/sptests/sp75/init.c
@@ -23,8 +23,9 @@ rtems_task Init(
rtems_task_argument argument
)
{
- rtems_status_code sc;
- rtems_id mutex;
+ rtems_status_code sc;
+ rtems_id mutex;
+ Per_CPU_Control *cpu_self;
TEST_BEGIN();
@@ -43,9 +44,9 @@ rtems_task Init(
* directive_failed() checks for dispatching being enabled.
*/
puts( "rtems_semaphore_obtain - with dispatching disabled" );
- _Thread_Disable_dispatch();
+ cpu_self = _Thread_Dispatch_disable();
sc = rtems_semaphore_obtain(mutex, RTEMS_NO_WAIT, RTEMS_NO_TIMEOUT);
- _Thread_Enable_dispatch();
+ _Thread_Dispatch_enable(cpu_self);
directive_failed(sc, "rtems_semaphore_obtain");
TEST_END();
diff --git a/testsuites/sptests/spfatal01/testcase.h b/testsuites/sptests/spfatal01/testcase.h
index 2bde3fa938..9ac322a890 100644
--- a/testsuites/sptests/spfatal01/testcase.h
+++ b/testsuites/sptests/spfatal01/testcase.h
@@ -33,7 +33,7 @@ void force_error()
/*
* Case 2: Null entry
* Case 3: semaphore_create
- * _Thread_Disable_dispatch
+ * _Thread_Dispatch_disable
* semaphore_obtain
*/
diff --git a/testsuites/sptests/spfatal03/testcase.h b/testsuites/sptests/spfatal03/testcase.h
index b9f1c22ae0..86b300344e 100644
--- a/testsuites/sptests/spfatal03/testcase.h
+++ b/testsuites/sptests/spfatal03/testcase.h
@@ -36,12 +36,10 @@ void force_error(void)
printk("Create semaphore S0\n");
printk("Obtain semaphore in dispatching critical section\n");
- _Thread_Disable_dispatch();
+ _Thread_Dispatch_disable();
status = rtems_semaphore_obtain( mutex, RTEMS_DEFAULT_OPTIONS, 0 );
/* !!! SHOULD NOT RETURN FROM THE ABOVE CALL */
- _Thread_Enable_dispatch();
- printk("ERROR -- Obtain semaphore should not have returned\n");
-
+ rtems_test_assert( 0 );
/* we will not run this far */
}
diff --git a/testsuites/sptests/spintrcritical20/init.c b/testsuites/sptests/spintrcritical20/init.c
index 85c1645b5c..9c9b5f0903 100644
--- a/testsuites/sptests/spintrcritical20/init.c
+++ b/testsuites/sptests/spintrcritical20/init.c
@@ -71,8 +71,9 @@ static bool test_body(void *arg)
{
test_context *ctx = arg;
int busy;
+ Per_CPU_Control *cpu_self;
- _Thread_Disable_dispatch();
+ cpu_self = _Thread_Dispatch_disable();
rtems_test_assert(
ctx->semaphore_task_tcb->Wait.return_code
@@ -105,7 +106,7 @@ static bool test_body(void *arg)
break;
}
- _Thread_Enable_dispatch();
+ _Thread_Dispatch_enable(cpu_self);
return ctx->thread_queue_was_null
&& ctx->status_was_successful
diff --git a/testsuites/sptests/spthreadlife01/init.c b/testsuites/sptests/spthreadlife01/init.c
index 7724635cd9..8bf26b9b72 100644
--- a/testsuites/sptests/spthreadlife01/init.c
+++ b/testsuites/sptests/spthreadlife01/init.c
@@ -232,6 +232,7 @@ static void worker_task(rtems_task_argument arg)
test_state state = ctx->current;
rtems_status_code sc;
Thread_Life_state previous_thread_life_state;
+ Per_CPU_Control *cpu_self;
switch (state) {
case SET_PRIO:
@@ -272,22 +273,22 @@ static void worker_task(rtems_task_argument arg)
assert_priority(PRIO_HIGH);
break;
case SET_PROTECTION:
- _Thread_Disable_dispatch();
+ cpu_self = _Thread_Dispatch_disable();
previous_thread_life_state =
_Thread_Set_life_protection(THREAD_LIFE_PROTECTED);
rtems_test_assert(
(previous_thread_life_state & THREAD_LIFE_PROTECTED) == 0
);
- _Thread_Enable_dispatch();
+ _Thread_Dispatch_enable(cpu_self);
break;
case CLEAR_PROTECTION:
- _Thread_Disable_dispatch();
+ cpu_self = _Thread_Dispatch_disable();
previous_thread_life_state = _Thread_Set_life_protection(0);
rtems_test_assert(
(previous_thread_life_state & THREAD_LIFE_PROTECTED) != 0
);
ctx->current = DELETE_4;
- _Thread_Enable_dispatch();
+ _Thread_Dispatch_enable(cpu_self);
break;
case DELETE_SELF:
ctx->current = DELETE_7;
diff --git a/testsuites/sptests/spthreadq01/init.c b/testsuites/sptests/spthreadq01/init.c
index cb8d495e79..85df6bd15c 100644
--- a/testsuites/sptests/spthreadq01/init.c
+++ b/testsuites/sptests/spthreadq01/init.c
@@ -353,9 +353,7 @@ static rtems_task Init(
TEST_BEGIN();
puts( "Init - _Thread_queue_Extract - thread not blocked on a thread queue" );
- _Thread_Disable_dispatch();
- _Thread_queue_Extract( _Thread_Executing );
- _Thread_Enable_dispatch();
+ _Thread_queue_Extract( _Thread_Get_executing() );
/* is there more to check? */
test_context_init(ctx);