summaryrefslogtreecommitdiffstats
path: root/cpukit
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2009-06-01 21:44:01 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2009-06-01 21:44:01 +0000
commit931dd976bc501c0af8e4a7f8c40242185e7ff970 (patch)
treea742a5e88027361d5e7a7c752ff21c4da6eb8c6c /cpukit
parent2009-06-01 Joel Sherrill <joel.sherrill@OARcorp.com> (diff)
downloadrtems-931dd976bc501c0af8e4a7f8c40242185e7ff970.tar.bz2
2009-06-01 Joel Sherrill <joel.sherrill@OARcorp.com>
* score/include/rtems/score/thread.h, score/src/threadinitialize.c, score/src/threadreset.c, score/src/threadresume.c, score/src/threadsuspend.c: Nesting count on thread suspension is only supported from ITRON API so disable if ITRON is disabled.
Diffstat (limited to 'cpukit')
-rw-r--r--cpukit/ChangeLog7
-rw-r--r--cpukit/score/include/rtems/score/thread.h6
-rw-r--r--cpukit/score/src/threadinitialize.c4
-rw-r--r--cpukit/score/src/threadreset.c4
-rw-r--r--cpukit/score/src/threadresume.c20
-rw-r--r--cpukit/score/src/threadsuspend.c4
6 files changed, 32 insertions, 13 deletions
diff --git a/cpukit/ChangeLog b/cpukit/ChangeLog
index 111569923d..d84372d7a2 100644
--- a/cpukit/ChangeLog
+++ b/cpukit/ChangeLog
@@ -1,5 +1,12 @@
2009-06-01 Joel Sherrill <joel.sherrill@OARcorp.com>
+ * score/include/rtems/score/thread.h, score/src/threadinitialize.c,
+ score/src/threadreset.c, score/src/threadresume.c,
+ score/src/threadsuspend.c: Nesting count on thread suspension is only
+ supported from ITRON API so disable if ITRON is disabled.
+
+2009-06-01 Joel Sherrill <joel.sherrill@OARcorp.com>
+
* score/include/rtems/score/thread.h, score/src/threadhandler.c: Merge
conditional code from main and init/fini C++ constructors so the body
of this method reads better. Mark thread prototypes which are not
diff --git a/cpukit/score/include/rtems/score/thread.h b/cpukit/score/include/rtems/score/thread.h
index bd63e7a4ae..58c2e2e8ff 100644
--- a/cpukit/score/include/rtems/score/thread.h
+++ b/cpukit/score/include/rtems/score/thread.h
@@ -347,14 +347,18 @@ struct Thread_Control_struct {
MP_packet_Prefix *receive_packet;
#endif
#ifdef __RTEMS_STRICT_ORDER_MUTEX__
- /**This field is the head of queue of priority inheritance mutex holed by the thread*/
+ /** This field is the head of queue of priority inheritance mutex
+ * held by the thread.
+ */
Chain_Control lock_mutex;
#endif
/*================= end of common block =================*/
/** This field is the number of nested suspend calls. */
uint32_t suspend_count;
+#if defined(RTEMS_MULTIPROCESSING)
/** This field is true if the thread is offered globally */
bool is_global;
+#endif
/** This field is is true if the post task context switch should be
* executed for this thread at the next context switch.
*/
diff --git a/cpukit/score/src/threadinitialize.c b/cpukit/score/src/threadinitialize.c
index 3bad6c92bc..2af727af7c 100644
--- a/cpukit/score/src/threadinitialize.c
+++ b/cpukit/score/src/threadinitialize.c
@@ -196,7 +196,9 @@ bool _Thread_Initialize(
the_thread->current_state = STATES_DORMANT;
the_thread->Wait.queue = NULL;
the_thread->resource_count = 0;
- the_thread->suspend_count = 0;
+ #if defined(RTEMS_ITRON_API)
+ the_thread->suspend_count = 0;
+ #endif
the_thread->real_priority = priority;
the_thread->Start.initial_priority = priority;
_Thread_Set_priority( the_thread, priority );
diff --git a/cpukit/score/src/threadreset.c b/cpukit/score/src/threadreset.c
index b1e15ef3c2..847a4d1be2 100644
--- a/cpukit/score/src/threadreset.c
+++ b/cpukit/score/src/threadreset.c
@@ -47,7 +47,9 @@ void _Thread_Reset(
)
{
the_thread->resource_count = 0;
- the_thread->suspend_count = 0;
+ #if defined(RTEMS_ITRON_API)
+ the_thread->suspend_count = 0;
+ #endif
the_thread->is_preemptible = the_thread->Start.is_preemptible;
the_thread->budget_algorithm = the_thread->Start.budget_algorithm;
the_thread->budget_callout = the_thread->Start.budget_callout;
diff --git a/cpukit/score/src/threadresume.c b/cpukit/score/src/threadresume.c
index 7ca7ee092f..cea8849537 100644
--- a/cpukit/score/src/threadresume.c
+++ b/cpukit/score/src/threadresume.c
@@ -62,15 +62,17 @@ void _Thread_Resume(
_ISR_Disable( level );
- if ( force == true )
- the_thread->suspend_count = 0;
- else
- the_thread->suspend_count--;
-
- if ( the_thread->suspend_count > 0 ) {
- _ISR_Enable( level );
- return;
- }
+ #if defined(RTEMS_ITRON_API)
+ if ( force == true )
+ the_thread->suspend_count = 0;
+ else
+ the_thread->suspend_count--;
+
+ if ( the_thread->suspend_count > 0 ) {
+ _ISR_Enable( level );
+ return;
+ }
+ #endif
current_state = the_thread->current_state;
if ( current_state & STATES_SUSPENDED ) {
diff --git a/cpukit/score/src/threadsuspend.c b/cpukit/score/src/threadsuspend.c
index 1e2ec87e07..3005cf7801 100644
--- a/cpukit/score/src/threadsuspend.c
+++ b/cpukit/score/src/threadsuspend.c
@@ -56,7 +56,9 @@ void _Thread_Suspend(
ready = the_thread->ready;
_ISR_Disable( level );
- the_thread->suspend_count++;
+ #if defined(RTEMS_ITRON_API)
+ the_thread->suspend_count++;
+ #endif
if ( !_States_Is_ready( the_thread->current_state ) ) {
the_thread->current_state =
_States_Set( STATES_SUSPENDED, the_thread->current_state );