4.115
Last change
on this file since 8f0c7a46 was
8f0c7a46,
checked in by Sebastian Huber <sebastian.huber@…>, on 06/10/14 at 14:13:37
|
score: Decouple thread and scheduler nodes on SMP
Add a chain node to the scheduler node to decouple the thread and
scheduler nodes. It is now possible to enqueue a thread in a thread
wait queue and use its scheduler node at the same for other threads,
e.g. a resouce owner.
|
-
Property mode set to
100644
|
File size:
780 bytes
|
Line | |
---|
1 | /* |
---|
2 | * Copyright (c) 2013-2014 embedded brains GmbH |
---|
3 | * |
---|
4 | * The license and distribution terms for this file may be |
---|
5 | * found in the file LICENSE in this distribution or at |
---|
6 | * http://www.rtems.org/license/LICENSE. |
---|
7 | */ |
---|
8 | |
---|
9 | #if HAVE_CONFIG_H |
---|
10 | #include "config.h" |
---|
11 | #endif |
---|
12 | |
---|
13 | #include <rtems/score/schedulersmpimpl.h> |
---|
14 | |
---|
15 | void _Scheduler_SMP_Start_idle( |
---|
16 | const Scheduler_Control *scheduler, |
---|
17 | Thread_Control *thread, |
---|
18 | Per_CPU_Control *cpu |
---|
19 | ) |
---|
20 | { |
---|
21 | Scheduler_Context *context = _Scheduler_Get_context( scheduler ); |
---|
22 | Scheduler_SMP_Context *self = _Scheduler_SMP_Get_self( context ); |
---|
23 | Scheduler_SMP_Node *node = _Scheduler_SMP_Node_get( thread ); |
---|
24 | |
---|
25 | node->state = SCHEDULER_SMP_NODE_SCHEDULED; |
---|
26 | |
---|
27 | _Thread_Set_CPU( thread, cpu ); |
---|
28 | _Chain_Append_unprotected( &self->Scheduled, &node->Base.Node ); |
---|
29 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.