summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2015-04-23 13:01:05 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2015-05-19 12:00:42 +0200
commit22788bc2baeb8e13bb0d6b6d05782a6ccfd4cb67 (patch)
treebbb9169de2cf7282bb44cf6374a71b41aec8137c
parentscore: Add _SMP_Assert() (diff)
downloadrtems-22788bc2baeb8e13bb0d6b6d05782a6ccfd4cb67.tar.bz2
score: _Thread_queue_Extract()
Remove thread queue parameter from _Thread_queue_Extract() since the current thread queue is stored in the thread control block.
-rw-r--r--cpukit/rtems/src/msgmp.c2
-rw-r--r--cpukit/rtems/src/partmp.c2
-rw-r--r--cpukit/rtems/src/regionmp.c2
-rw-r--r--cpukit/rtems/src/regionprocessqueue.c2
-rw-r--r--cpukit/rtems/src/semmp.c2
-rw-r--r--cpukit/score/include/rtems/score/threadqimpl.h16
-rw-r--r--cpukit/score/src/corerwlockrelease.c2
-rw-r--r--cpukit/score/src/mpci.c2
-rw-r--r--cpukit/score/src/threadqenqueue.c14
-rw-r--r--cpukit/score/src/threadqextractwithproxy.c7
-rw-r--r--cpukit/score/src/threadqprocesstimeout.c1
-rw-r--r--testsuites/sptests/spthreadq01/init.c29
12 files changed, 23 insertions, 58 deletions
diff --git a/cpukit/rtems/src/msgmp.c b/cpukit/rtems/src/msgmp.c
index 7043138963..ddad64a17a 100644
--- a/cpukit/rtems/src/msgmp.c
+++ b/cpukit/rtems/src/msgmp.c
@@ -291,7 +291,7 @@ void _Message_queue_MP_Process_packet (
the_thread = _Thread_MP_Find_proxy( the_packet->proxy_id );
if (! _Thread_Is_null( the_thread ) )
- _Thread_queue_Extract( the_thread->Wait.queue, the_thread );
+ _Thread_queue_Extract( the_thread );
_MPCI_Return_packet( the_packet_prefix );
break;
diff --git a/cpukit/rtems/src/partmp.c b/cpukit/rtems/src/partmp.c
index 943c24ac6d..f41fd227e9 100644
--- a/cpukit/rtems/src/partmp.c
+++ b/cpukit/rtems/src/partmp.c
@@ -209,7 +209,7 @@ void _Partition_MP_Process_packet (
the_thread = _Thread_MP_Find_proxy( the_packet->proxy_id );
if ( ! _Thread_Is_null( the_thread ) )
- _Thread_queue_Extract( the_thread->Wait.queue, the_thread );
+ _Thread_queue_Extract( the_thread );
_MPCI_Return_packet( the_packet_prefix );
break;
diff --git a/cpukit/rtems/src/regionmp.c b/cpukit/rtems/src/regionmp.c
index 58dfa99dde..8bce822193 100644
--- a/cpukit/rtems/src/regionmp.c
+++ b/cpukit/rtems/src/regionmp.c
@@ -195,7 +195,7 @@ void _Region_MP_Process_packet (
the_thread = _Thread_MP_Find_proxy( the_packet->proxy_id );
if ( ! _Thread_Is_null( the_thread ) )
- _Thread_queue_Extract( the_thread->Wait.queue, the_thread );
+ _Thread_queue_Extract( the_thread );
_MPCI_Return_packet( the_packet_prefix );
break;
diff --git a/cpukit/rtems/src/regionprocessqueue.c b/cpukit/rtems/src/regionprocessqueue.c
index 54081af84d..a06a077e3d 100644
--- a/cpukit/rtems/src/regionprocessqueue.c
+++ b/cpukit/rtems/src/regionprocessqueue.c
@@ -61,7 +61,7 @@ void _Region_Process_queue(
*(void **)the_thread->Wait.return_argument = the_segment;
the_region->number_of_used_blocks += 1;
- _Thread_queue_Extract( &the_region->Wait_queue, the_thread );
+ _Thread_queue_Extract( the_thread );
the_thread->Wait.return_code = RTEMS_SUCCESSFUL;
}
_Thread_Enable_dispatch();
diff --git a/cpukit/rtems/src/semmp.c b/cpukit/rtems/src/semmp.c
index eabd1b7a0b..d94d90870a 100644
--- a/cpukit/rtems/src/semmp.c
+++ b/cpukit/rtems/src/semmp.c
@@ -188,7 +188,7 @@ void _Semaphore_MP_Process_packet (
the_thread = _Thread_MP_Find_proxy( the_packet->proxy_id );
if ( ! _Thread_Is_null( the_thread ) )
- _Thread_queue_Extract( the_thread->Wait.queue, the_thread );
+ _Thread_queue_Extract( the_thread );
_MPCI_Return_packet( the_packet_prefix );
break;
diff --git a/cpukit/score/include/rtems/score/threadqimpl.h b/cpukit/score/include/rtems/score/threadqimpl.h
index 6eac3643f4..6fc38cfa5b 100644
--- a/cpukit/score/include/rtems/score/threadqimpl.h
+++ b/cpukit/score/include/rtems/score/threadqimpl.h
@@ -78,25 +78,20 @@ void _Thread_queue_Enqueue(
/**
* @brief Extracts thread from thread queue.
*
- * This routine removes @a the_thread from @a the_thread_queue
+ * This routine removes @a the_thread its thread queue
* and cancels any timeouts associated with this blocking.
*
- * @param[in] the_thread_queue is the pointer to the ThreadQ header
* @param[in] the_thread is the pointer to a thread control block that
* is to be removed
*/
-void _Thread_queue_Extract(
- Thread_queue_Control *the_thread_queue,
- Thread_Control *the_thread
-);
+void _Thread_queue_Extract( Thread_Control *the_thread );
/**
* @brief Extracts thread from thread queue (w/return code).
*
- * This routine removes @a the_thread from @a the_thread_queue
+ * This routine removes @a the_thread its thread queue
* and cancels any timeouts associated with this blocking.
*
- * @param[in] the_thread_queue is the pointer to the ThreadQ header
* @param[in] the_thread is the pointer to a thread control block that
* is to be removed
* @param[in] return_code specifies the status to be returned.
@@ -105,9 +100,8 @@ void _Thread_queue_Extract(
* + single case
*/
void _Thread_queue_Extract_with_return_code(
- Thread_queue_Control *the_thread_queue,
- Thread_Control *the_thread,
- uint32_t return_code
+ Thread_Control *the_thread,
+ uint32_t return_code
);
/**
diff --git a/cpukit/score/src/corerwlockrelease.c b/cpukit/score/src/corerwlockrelease.c
index efaf67d351..bd39213c87 100644
--- a/cpukit/score/src/corerwlockrelease.c
+++ b/cpukit/score/src/corerwlockrelease.c
@@ -87,7 +87,7 @@ CORE_RWLock_Status _CORE_RWLock_Release(
next->Wait.option == CORE_RWLOCK_THREAD_WAITING_FOR_WRITE )
return CORE_RWLOCK_SUCCESSFUL;
the_rwlock->number_of_readers += 1;
- _Thread_queue_Extract( &the_rwlock->Wait_queue, next );
+ _Thread_queue_Extract( next );
}
}
diff --git a/cpukit/score/src/mpci.c b/cpukit/score/src/mpci.c
index 9b623b253f..424bcb4d33 100644
--- a/cpukit/score/src/mpci.c
+++ b/cpukit/score/src/mpci.c
@@ -262,7 +262,7 @@ Thread_Control *_MPCI_Process_response (
the_thread = NULL; /* IMPOSSIBLE */
break;
case OBJECTS_LOCAL:
- _Thread_queue_Extract( &_MPCI_Remote_blocked_threads, the_thread );
+ _Thread_queue_Extract( the_thread );
the_thread->Wait.return_code = the_packet->return_code;
_Objects_Put_without_thread_dispatch( &the_thread->Object );
break;
diff --git a/cpukit/score/src/threadqenqueue.c b/cpukit/score/src/threadqenqueue.c
index 5c237560f4..0e16f59c46 100644
--- a/cpukit/score/src/threadqenqueue.c
+++ b/cpukit/score/src/threadqenqueue.c
@@ -185,11 +185,11 @@ void _Thread_queue_Enqueue(
}
void _Thread_queue_Extract_with_return_code(
- Thread_queue_Control *the_thread_queue,
- Thread_Control *the_thread,
- uint32_t return_code
+ Thread_Control *the_thread,
+ uint32_t return_code
)
{
+ Thread_queue_Control *the_thread_queue;
ISR_lock_Context lock_context;
_Thread_queue_Acquire( &lock_context );
@@ -199,6 +199,8 @@ void _Thread_queue_Extract_with_return_code(
return;
}
+ the_thread_queue = the_thread->Wait.queue;
+
if ( the_thread_queue->discipline == THREAD_QUEUE_DISCIPLINE_FIFO ) {
_Chain_Extract_unprotected( &the_thread->Object.Node );
} else { /* must be THREAD_QUEUE_DISCIPLINE_PRIORITY */
@@ -220,13 +222,9 @@ void _Thread_queue_Extract_with_return_code(
_Thread_blocking_operation_Finalize( the_thread, &lock_context );
}
-void _Thread_queue_Extract(
- Thread_queue_Control *the_thread_queue,
- Thread_Control *the_thread
-)
+void _Thread_queue_Extract( Thread_Control *the_thread )
{
_Thread_queue_Extract_with_return_code(
- the_thread_queue,
the_thread,
the_thread->Wait.return_code
);
diff --git a/cpukit/score/src/threadqextractwithproxy.c b/cpukit/score/src/threadqextractwithproxy.c
index fb06526e9e..72043a094d 100644
--- a/cpukit/score/src/threadqextractwithproxy.c
+++ b/cpukit/score/src/threadqextractwithproxy.c
@@ -31,8 +31,6 @@ void _Thread_queue_Extract_with_proxy(
Thread_Control *the_thread
)
{
- Thread_queue_Control *the_thread_queue;
-
#if defined(RTEMS_MULTIPROCESSING)
States_Control state;
@@ -50,8 +48,5 @@ void _Thread_queue_Extract_with_proxy(
}
#endif
- the_thread_queue = the_thread->Wait.queue;
- if ( the_thread_queue != NULL ) {
- _Thread_queue_Extract( the_thread_queue, the_thread );
- }
+ _Thread_queue_Extract( the_thread );
}
diff --git a/cpukit/score/src/threadqprocesstimeout.c b/cpukit/score/src/threadqprocesstimeout.c
index 616901900d..dbb8f5ce45 100644
--- a/cpukit/score/src/threadqprocesstimeout.c
+++ b/cpukit/score/src/threadqprocesstimeout.c
@@ -69,7 +69,6 @@ void _Thread_queue_Process_timeout(
* queue initialization.
*/
_Thread_queue_Extract_with_return_code(
- the_thread_queue,
the_thread,
the_thread_queue->timeout_status
);
diff --git a/testsuites/sptests/spthreadq01/init.c b/testsuites/sptests/spthreadq01/init.c
index 240cd1a9e8..5add92bb5d 100644
--- a/testsuites/sptests/spthreadq01/init.c
+++ b/testsuites/sptests/spthreadq01/init.c
@@ -18,38 +18,17 @@
const char rtems_test_name[] = "SPTHREADQ 1";
-/* forward declarations to avoid warnings */
-rtems_task Init(rtems_task_argument argument);
-void threadq_first_empty(
- const char *discipline_string,
- Thread_queue_Disciplines discipline
-);
-
-void threadq_first_empty(
- const char *discipline_string,
- Thread_queue_Disciplines discipline
+static rtems_task Init(
+ rtems_task_argument ignored
)
{
- Thread_queue_Control tq;
-
- printf( "Init - initialize thread queue for %s\n", discipline_string );
- _Thread_queue_Initialize( &tq, discipline, 3 );
+ TEST_BEGIN();
puts( "Init - _Thread_queue_Extract - thread not blocked on a thread queue" );
_Thread_Disable_dispatch();
- _Thread_queue_Extract( &tq, _Thread_Executing );
+ _Thread_queue_Extract( _Thread_Executing );
_Thread_Enable_dispatch();
/* is there more to check? */
-}
-
-rtems_task Init(
- rtems_task_argument ignored
-)
-{
- TEST_BEGIN();
-
- threadq_first_empty( "FIFO", THREAD_QUEUE_DISCIPLINE_FIFO );
- threadq_first_empty( "Priority", THREAD_QUEUE_DISCIPLINE_PRIORITY );
TEST_END();
rtems_test_exit(0);