summaryrefslogtreecommitdiffstats
path: root/cpukit/score/src/mpci.c
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2013-08-22 15:20:06 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2013-08-23 12:54:03 +0200
commit07332ae4db821ad8a11b1eda6fbb5b453ef069ef (patch)
tree7397f3276cc6fb06170919854c91852bc0fb75b1 /cpukit/score/src/mpci.c
parentFilesystem: Remove superfluous free() (diff)
downloadrtems-07332ae4db821ad8a11b1eda6fbb5b453ef069ef.tar.bz2
score: _Thread_queue_Enqueue_with_handler()
Add thread parameter to _Thread_queue_Enqueue_with_handler() to avoid access to global _Thread_Executing.
Diffstat (limited to 'cpukit/score/src/mpci.c')
-rw-r--r--cpukit/score/src/mpci.c22
1 files changed, 14 insertions, 8 deletions
diff --git a/cpukit/score/src/mpci.c b/cpukit/score/src/mpci.c
index c8cf6bd70b..bc289943f3 100644
--- a/cpukit/score/src/mpci.c
+++ b/cpukit/score/src/mpci.c
@@ -190,14 +190,16 @@ uint32_t _MPCI_Send_request_packet (
States_Control extra_state
)
{
- the_packet->source_tid = _Thread_Executing->Object.id;
- the_packet->source_priority = _Thread_Executing->current_priority;
+ Thread_Control *executing = _Thread_Executing;
+
+ the_packet->source_tid = executing->Object.id;
+ the_packet->source_priority = executing->current_priority;
the_packet->to_convert =
( the_packet->to_convert - sizeof(MP_packet_Prefix) ) / sizeof(uint32_t);
- _Thread_Executing->Wait.id = the_packet->id;
+ executing->Wait.id = the_packet->id;
- _Thread_Executing->Wait.queue = &_MPCI_Remote_blocked_threads;
+ executing->Wait.queue = &_MPCI_Remote_blocked_threads;
_Thread_Disable_dispatch();
@@ -212,14 +214,18 @@ uint32_t _MPCI_Send_request_packet (
if (the_packet->timeout == MPCI_DEFAULT_TIMEOUT)
the_packet->timeout = _MPCI_table->default_timeout;
- _Thread_queue_Enqueue( &_MPCI_Remote_blocked_threads, the_packet->timeout );
+ _Thread_queue_Enqueue(
+ &_MPCI_Remote_blocked_threads,
+ executing,
+ the_packet->timeout
+ );
- _Thread_Executing->current_state =
- _States_Set( extra_state, _Thread_Executing->current_state );
+ executing->current_state =
+ _States_Set( extra_state, executing->current_state );
_Thread_Enable_dispatch();
- return _Thread_Executing->Wait.return_code;
+ return executing->Wait.return_code;
}
void _MPCI_Send_response_packet (