summaryrefslogtreecommitdiffstats
path: root/cpukit/score/src/threadtickletimeslice.c
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2011-06-17 14:31:46 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2011-06-17 14:31:46 +0000
commit3203e09507da6484f267605793fd770586a63d55 (patch)
tree882a86450acc183b1485995ae7b14e430e27a358 /cpukit/score/src/threadtickletimeslice.c
parent2011-04-10 Kate Feng <feng@bnl.gov> (diff)
downloadrtems-3203e09507da6484f267605793fd770586a63d55.tar.bz2
2011-06-17 Joel Sherrill <joel.sherrill@oarcorp.com>
PR 1819/cpukit * rtems/src/clocktick.c, score/Makefile.am, score/include/rtems/score/scheduler.h, score/include/rtems/score/schedulerpriority.h, score/include/rtems/score/schedulersimple.h, score/include/rtems/score/schedulersimplesmp.h, score/include/rtems/score/thread.h, score/inline/rtems/score/scheduler.inl: Add a scheduler entry point which is invoked at each clock tick. _Thread_Tickle_timeslice() is now a method owned by the Deterministic Priority Scheduler and shared by the Simple Priority Scheduler. The Simple SMP Scheduler has its own variation on this which does timeslicing bookkeeping on all cores. * score/src/schedulerprioritytick.c, score/src/schedulersimplesmptick.c: New files. * score/src/threadtickletimeslice.c: Removed.
Diffstat (limited to 'cpukit/score/src/threadtickletimeslice.c')
-rw-r--r--cpukit/score/src/threadtickletimeslice.c105
1 files changed, 0 insertions, 105 deletions
diff --git a/cpukit/score/src/threadtickletimeslice.c b/cpukit/score/src/threadtickletimeslice.c
deleted file mode 100644
index 4c2772a2aa..0000000000
--- a/cpukit/score/src/threadtickletimeslice.c
+++ /dev/null
@@ -1,105 +0,0 @@
-/*
- * Thread Handler
- *
- *
- * COPYRIGHT (c) 1989-2009.
- * On-Line Applications Research Corporation (OAR).
- *
- * The license and distribution terms for this file may be
- * found in the file LICENSE in this distribution or at
- * http://www.rtems.com/license/LICENSE.
- *
- * $Id$
- */
-
-#if HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <rtems/system.h>
-#include <rtems/score/apiext.h>
-#include <rtems/score/context.h>
-#include <rtems/score/interr.h>
-#include <rtems/score/isr.h>
-#include <rtems/score/object.h>
-#include <rtems/score/priority.h>
-#include <rtems/score/scheduler.h>
-#include <rtems/score/states.h>
-#include <rtems/score/sysstate.h>
-#include <rtems/score/thread.h>
-#include <rtems/score/threadq.h>
-#include <rtems/score/userext.h>
-#include <rtems/score/wkspace.h>
-
-/*PAGE
- *
- * _Thread_Tickle_timeslice
- *
- * This scheduler routine determines if timeslicing is enabled
- * for the currently executing thread and, if so, updates the
- * timeslice count and checks for timeslice expiration.
- *
- * Input parameters: NONE
- *
- * Output parameters: NONE
- */
-
-void _Thread_Tickle_timeslice( void )
-{
- Thread_Control *executing;
-
- executing = _Thread_Executing;
-
- #ifdef __RTEMS_USE_TICKS_FOR_STATISTICS__
- /*
- * Increment the number of ticks this thread has been executing
- */
- executing->cpu_time_used++;
- #endif
-
- /*
- * If the thread is not preemptible or is not ready, then
- * just return.
- */
-
- if ( !executing->is_preemptible )
- return;
-
- if ( !_States_Is_ready( executing->current_state ) )
- return;
-
- /*
- * The cpu budget algorithm determines what happens next.
- */
-
- switch ( executing->budget_algorithm ) {
- case THREAD_CPU_BUDGET_ALGORITHM_NONE:
- break;
-
- case THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE:
- #if defined(RTEMS_SCORE_THREAD_ENABLE_EXHAUST_TIMESLICE)
- case THREAD_CPU_BUDGET_ALGORITHM_EXHAUST_TIMESLICE:
- #endif
- if ( (int)(--executing->cpu_time_budget) <= 0 ) {
-
- /*
- * A yield performs the ready chain mechanics needed when
- * resetting a timeslice. If no other thread's are ready
- * at the priority of the currently executing thread, then the
- * executing thread's timeslice is reset. Otherwise, the
- * currently executing thread is placed at the rear of the
- * FIFO for this priority and a new heir is selected.
- */
- _Scheduler_Yield();
- executing->cpu_time_budget = _Thread_Ticks_per_timeslice;
- }
- break;
-
- #if defined(RTEMS_SCORE_THREAD_ENABLE_SCHEDULER_CALLOUT)
- case THREAD_CPU_BUDGET_ALGORITHM_CALLOUT:
- if ( --executing->cpu_time_budget == 0 )
- (*executing->budget_callout)( executing );
- break;
- #endif
- }
-}