source: rtems/cpukit/score/src/schedulersmpstartidle.c @ 15dbc710

5
Last change on this file since 15dbc710 was 15dbc710, checked in by Sebastian Huber <sebastian.huber@…>, on 06/29/17 at 07:44:16

score: Add red-black tree node to Scheduler_Node

In SMP configurations, add a red-black tree node to Scheduler_Node to
enable an EDF scheduler implementation.

Update #3056.

  • Property mode set to 100644
File size: 970 bytes
Line 
1/*
2 * Copyright (c) 2013, 2016 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
15void _Scheduler_SMP_Start_idle(
16  const Scheduler_Control *scheduler,
17  Thread_Control          *idle,
18  Per_CPU_Control         *cpu
19)
20{
21  Scheduler_Context     *context;
22  Scheduler_SMP_Context *self;
23  Scheduler_SMP_Node    *node;
24
25  context = _Scheduler_Get_context( scheduler );
26  self = _Scheduler_SMP_Get_self( context );
27  node = _Scheduler_SMP_Thread_get_node( idle );
28
29  _Scheduler_Thread_change_state( idle, THREAD_SCHEDULER_SCHEDULED );
30  node->state = SCHEDULER_SMP_NODE_SCHEDULED;
31
32  _Thread_Set_CPU( idle, cpu );
33  _Chain_Append_unprotected( &self->Scheduled, &node->Base.Node.Chain );
34  _Scheduler_SMP_Release_idle_thread( &self->Base, idle );
35}
Note: See TracBrowser for help on using the repository browser.