summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJennifer Averett <Jennifer.Averett@OARcorp.com>2011-04-21 19:05:34 +0000
committerJennifer Averett <Jennifer.Averett@OARcorp.com>2011-04-21 19:05:34 +0000
commit1c95d94af6431f9d1f94ea9589deded2438f2ae9 (patch)
tree4c27cb7291edd32d4116c5b33a9ae35d34efc591
parentd7c388321ad2f250cb35f01dc4c8dda7489c3416 (diff)
downloadrtems-1c95d94af6431f9d1f94ea9589deded2438f2ae9.tar.bz2
2011-04-21 Jennifer Averett <Jennifer.Averett@OARcorp.com
PR 1777/cpukit * support/include/tmacros.h, tmtests/tm26/task1.c, tmtests/tm27/task1.c: Consolidated access to _Thread_Dispatch_disable_level.
-rw-r--r--testsuites/ChangeLog7
-rw-r--r--testsuites/support/include/tmacros.h7
-rw-r--r--testsuites/tmtests/tm26/task1.c3
-rw-r--r--testsuites/tmtests/tm27/task1.c10
4 files changed, 18 insertions, 9 deletions
diff --git a/testsuites/ChangeLog b/testsuites/ChangeLog
index 917714a88d..95374a2f7d 100644
--- a/testsuites/ChangeLog
+++ b/testsuites/ChangeLog
@@ -1,3 +1,10 @@
+2011-04-21 Jennifer Averett <Jennifer.Averett@OARcorp.com
+
+ PR 1777/cpukit
+ * support/include/tmacros.h, tmtests/tm26/task1.c,
+ tmtests/tm27/task1.c: Consolidated access to
+ _Thread_Dispatch_disable_level.
+
2011-04-20 Joel Sherrill <joel.sherrill@oarcorp.com>
* configure.ac: Add fstests.
diff --git a/testsuites/support/include/tmacros.h b/testsuites/support/include/tmacros.h
index 010296b7cf..260bf685fb 100644
--- a/testsuites/support/include/tmacros.h
+++ b/testsuites/support/include/tmacros.h
@@ -25,6 +25,7 @@
#include <string.h>
#include <rtems/error.h>
#include <rtems/score/thread.h> /* _Thread_Dispatch_disable_level */
+#include <rtems/score/thread.inl> /* _Thread_Dispatch_disable_level */
#ifdef __cplusplus
extern "C" {
@@ -48,13 +49,13 @@ extern "C" {
#define check_dispatch_disable_level( _expect ) \
do { \
if ( (_expect) != -1 \
- && ((_Thread_Dispatch_disable_level == 0 && (_expect) != 0) \
- || (_Thread_Dispatch_disable_level != 0 && (_expect) == 0)) \
+ && ((_Thread_Dispatch_in_critical_section() == false && (_expect) != 0) \
+ || (_Thread_Dispatch_in_critical_section() && (_expect) == 0)) \
) { \
printk( \
"\n_Thread_Dispatch_disable_level is (%" PRId32 \
") not %d detected at %s:%d\n", \
- _Thread_Dispatch_disable_level, (_expect), __FILE__, __LINE__ ); \
+ _Thread_Dispatch_get_disable_level(), (_expect), __FILE__, __LINE__ ); \
FLUSH_OUTPUT(); \
rtems_test_exit( 1 ); \
} \
diff --git a/testsuites/tmtests/tm26/task1.c b/testsuites/tmtests/tm26/task1.c
index 06ce7b503f..53746f3cf1 100644
--- a/testsuites/tmtests/tm26/task1.c
+++ b/testsuites/tmtests/tm26/task1.c
@@ -453,7 +453,8 @@ void complete_test( void )
_Thread_Heir = _Thread_Executing;
_Thread_Dispatch_necessary = false;
- _Thread_Dispatch_disable_level = 0;
+
+ _Thread_Dispatch_set_disable_level( 0 );
/*
* Now dump all the times
diff --git a/testsuites/tmtests/tm27/task1.c b/testsuites/tmtests/tm27/task1.c
index f75e0f0d31..39342d49b8 100644
--- a/testsuites/tmtests/tm27/task1.c
+++ b/testsuites/tmtests/tm27/task1.c
@@ -111,7 +111,7 @@ rtems_task Task_1(
Interrupt_nest = 0;
- _Thread_Dispatch_disable_level = 0;
+ _Thread_Dispatch_set_disable_level( 0 );
Interrupt_occurred = 0;
@@ -144,7 +144,7 @@ rtems_task Task_1(
* No preempt .. nested
*/
- _Thread_Dispatch_disable_level = 1;
+ _Thread_Dispatch_set_disable_level( 1 );
Interrupt_nest = 1;
@@ -158,7 +158,7 @@ rtems_task Task_1(
#endif
Interrupt_return_time = benchmark_timer_read();
- _Thread_Dispatch_disable_level = 0;
+ _Thread_Dispatch_set_disable_level( 0 );
put_time(
"interrupt entry overhead: returns to nested interrupt",
@@ -180,7 +180,7 @@ rtems_task Task_1(
* Does a preempt .. not nested
*/
- _Thread_Dispatch_disable_level = 0;
+ _Thread_Dispatch_set_disable_level( 0 );
ready_queues = (Chain_Control *) _Scheduler.information;
_Thread_Executing =
@@ -241,7 +241,7 @@ rtems_task Task_2(
* Switch back to the other task to exit the test.
*/
- _Thread_Dispatch_disable_level = 0;
+ _Thread_Dispatch_set_disable_level( 0 );
ready_queues = (Chain_Control *) _Scheduler.information;
_Thread_Executing =