source: rtems/cpukit/score/src/schedulerdefaulttick.c @ e6b31b27

4.11
Last change on this file since e6b31b27 was e6b31b27, checked in by Joel Sherrill <joel.sherrill@…>, on May 27, 2015 at 3:13:58 PM

Remove use ticks for statistics configure option.

This was obsolete and broken based upon recent time keeping changes.

Thie build option was previously enabled by adding
USE_TICKS_FOR_STATISTICS=1 to the configure command line.

This propagated into the code as preprocessor conditionals
using the RTEMS_USE_TICKS_FOR_STATISTICS conditional.

  • Property mode set to 100644
File size: 2.0 KB
Line 
1/**
2 * @file
3 *
4 * @brief Default Scheduler At Tick Handler
5 *
6 * @ingroup ScoreScheduler
7 */
8
9/*
10 *  COPYRIGHT (c) 1989-2009.
11 *  On-Line Applications Research Corporation (OAR).
12 *
13 *  The license and distribution terms for this file may be
14 *  found in the file LICENSE in this distribution or at
15 *  http://www.rtems.org/license/LICENSE.
16 */
17
18#if HAVE_CONFIG_H
19#include "config.h"
20#endif
21
22#include <rtems/score/schedulerimpl.h>
23#include <rtems/score/threadimpl.h>
24#include <rtems/score/smp.h>
25#include <rtems/config.h>
26
27void _Scheduler_default_Tick(
28  const Scheduler_Control *scheduler,
29  Thread_Control          *executing
30)
31{
32  (void) scheduler;
33
34  /*
35   *  If the thread is not preemptible or is not ready, then
36   *  just return.
37   */
38
39  if ( !executing->is_preemptible )
40    return;
41
42  if ( !_States_Is_ready( executing->current_state ) )
43    return;
44
45  /*
46   *  The cpu budget algorithm determines what happens next.
47   */
48
49  switch ( executing->budget_algorithm ) {
50    case THREAD_CPU_BUDGET_ALGORITHM_NONE:
51      break;
52
53    case THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE:
54    #if defined(RTEMS_SCORE_THREAD_ENABLE_EXHAUST_TIMESLICE)
55      case THREAD_CPU_BUDGET_ALGORITHM_EXHAUST_TIMESLICE:
56    #endif
57      if ( (int)(--executing->cpu_time_budget) <= 0 ) {
58
59        /*
60         *  A yield performs the ready chain mechanics needed when
61         *  resetting a timeslice.  If no other thread's are ready
62         *  at the priority of the currently executing thread, then the
63         *  executing thread's timeslice is reset.  Otherwise, the
64         *  currently executing thread is placed at the rear of the
65         *  FIFO for this priority and a new heir is selected.
66         */
67        _Thread_Yield( executing );
68        executing->cpu_time_budget =
69          rtems_configuration_get_ticks_per_timeslice();
70      }
71      break;
72
73    #if defined(RTEMS_SCORE_THREAD_ENABLE_SCHEDULER_CALLOUT)
74      case THREAD_CPU_BUDGET_ALGORITHM_CALLOUT:
75        if ( --executing->cpu_time_budget == 0 )
76          (*executing->budget_callout)( executing );
77        break;
78    #endif
79  }
80}
Note: See TracBrowser for help on using the repository browser.