source: rtems/cpukit/score/src/schedulercbs.c @ 25f5730f

4.11
Last change on this file since 25f5730f was beab7329, checked in by Sebastian Huber <sebastian.huber@…>, on May 13, 2014 at 2:03:05 PM

score: Introduce scheduler nodes

Rename scheduler per-thread information into scheduler nodes using
Scheduler_Node as the base type. Use inheritance for specialized
schedulers.

Move the scheduler specific states from the thread control block into
the scheduler node structure.

Validate the SMP scheduler node state transitions in case RTEMS_DEBUG is
defined.

  • Property mode set to 100644
File size: 1.4 KB
Line 
1/**
2 * @file
3 *
4 * @brief CBS Scheduler Budget Handler
5 * @ingroup ScoreScheduler
6 */
7
8/*
9 *  Copyright (C) 2011 Petr Benes.
10 *  Copyright (C) 2011 On-Line Applications Research Corporation (OAR).
11 *
12 *  The license and distribution terms for this file may be
13 *  found in the file LICENSE in this distribution or at
14 *  http://www.rtems.org/license/LICENSE.
15 */
16
17#if HAVE_CONFIG_H
18#include "config.h"
19#endif
20
21#include <rtems/score/schedulercbsimpl.h>
22#include <rtems/score/threadimpl.h>
23#include <rtems/score/wkspace.h>
24
25void _Scheduler_CBS_Budget_callout(
26  Thread_Control *the_thread
27)
28{
29  Priority_Control          new_priority;
30  Scheduler_CBS_Node       *node;
31  Scheduler_CBS_Server_id   server_id;
32
33  /* Put violating task to background until the end of period. */
34  new_priority = the_thread->Start.initial_priority;
35  if ( the_thread->real_priority != new_priority )
36    the_thread->real_priority = new_priority;
37  if ( the_thread->current_priority != new_priority )
38    _Thread_Change_priority(the_thread, new_priority, true);
39
40  /* Invoke callback function if any. */
41  node = _Scheduler_CBS_Node_get( the_thread );
42  if ( node->cbs_server->cbs_budget_overrun ) {
43    _Scheduler_CBS_Get_server_id(
44        node->cbs_server->task_id,
45        &server_id
46    );
47    node->cbs_server->cbs_budget_overrun( server_id );
48  }
49}
50
51int _Scheduler_CBS_Initialize(void)
52{
53  return SCHEDULER_CBS_OK;
54}
Note: See TracBrowser for help on using the repository browser.