score: Delete _Thread_Ticks_per_timeslice

Use the Configuration instead.
This commit is contained in:
Sebastian Huber
2014-04-04 13:58:26 +02:00
parent 4744584698
commit e785fbaae5
9 changed files with 18 additions and 16 deletions

View File

@@ -30,6 +30,7 @@
#include <rtems/posix/time.h>
#include <rtems/score/threadimpl.h>
#include <rtems/score/watchdogimpl.h>
#include <rtems/config.h>
int pthread_setschedparam(
pthread_t thread,
@@ -83,7 +84,8 @@ int pthread_setschedparam(
case SCHED_OTHER:
case SCHED_FIFO:
case SCHED_RR:
the_thread->cpu_time_budget = _Thread_Ticks_per_timeslice;
the_thread->cpu_time_budget =
rtems_configuration_get_ticks_per_timeslice();
the_thread->real_priority =
_POSIX_Priority_To_core( api->schedparam.sched_priority );

View File

@@ -24,9 +24,8 @@
#include <sched.h>
#include <errno.h>
#include <rtems/system.h>
#include <rtems/score/threadimpl.h>
#include <rtems/score/timespec.h>
#include <rtems/config.h>
#include <rtems/seterr.h>
int sched_rr_get_interval(
@@ -44,6 +43,10 @@ int sched_rr_get_interval(
if ( !interval )
rtems_set_errno_and_return_minus_one( EINVAL );
_Timespec_From_ticks( _Thread_Ticks_per_timeslice, interval );
_Timespec_From_ticks(
rtems_configuration_get_ticks_per_timeslice(),
interval
);
return 0;
}

View File

@@ -105,7 +105,8 @@ rtems_status_code rtems_task_mode(
if ( mask & RTEMS_TIMESLICE_MASK ) {
if ( _Modes_Is_timeslice(mode_set) ) {
executing->budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE;
executing->cpu_time_budget = _Thread_Ticks_per_timeslice;
executing->cpu_time_budget =
rtems_configuration_get_ticks_per_timeslice();
} else
executing->budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE;
}

View File

@@ -57,11 +57,6 @@ SCORE_EXTERN void *rtems_ada_self;
*/
SCORE_EXTERN Objects_Information _Thread_Internal_information;
/**
* The following is used to manage the length of a timeslice quantum.
*/
SCORE_EXTERN uint32_t _Thread_Ticks_per_timeslice;
/**
* The following points to the thread whose floating point
* context is currently loaded.

View File

@@ -22,6 +22,7 @@
#include <rtems/score/schedulerimpl.h>
#include <rtems/score/threadimpl.h>
#include <rtems/score/smp.h>
#include <rtems/config.h>
static void _Scheduler_default_Tick_for_executing(
Scheduler_Control *scheduler,
@@ -69,7 +70,8 @@ static void _Scheduler_default_Tick_for_executing(
* FIFO for this priority and a new heir is selected.
*/
_Scheduler_Yield( scheduler, executing );
executing->cpu_time_budget = _Thread_Ticks_per_timeslice;
executing->cpu_time_budget =
rtems_configuration_get_ticks_per_timeslice();
}
break;

View File

@@ -50,8 +50,6 @@ void _Thread_Handler_initialization(void)
_Thread_Allocated_fp = NULL;
#endif
_Thread_Ticks_per_timeslice = ticks_per_timeslice;
#if defined(RTEMS_MULTIPROCESSING)
_Thread_MP_Handler_initialization( maximum_proxies );
#endif

View File

@@ -28,6 +28,7 @@
#include <rtems/score/todimpl.h>
#include <rtems/score/userextimpl.h>
#include <rtems/score/wkspace.h>
#include <rtems/config.h>
static Thread_Action *_Thread_Get_post_switch_action(
Thread_Control *executing
@@ -121,7 +122,7 @@ void _Thread_Dispatch( void )
rtems_ada_self = heir->rtems_ada_self;
#endif
if ( heir->budget_algorithm == THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE )
heir->cpu_time_budget = _Thread_Ticks_per_timeslice;
heir->cpu_time_budget = rtems_configuration_get_ticks_per_timeslice();
#if !defined( RTEMS_SMP )
_ISR_Enable( level );

View File

@@ -189,7 +189,8 @@ bool _Thread_Initialize(
break;
#if defined(RTEMS_SCORE_THREAD_ENABLE_EXHAUST_TIMESLICE)
case THREAD_CPU_BUDGET_ALGORITHM_EXHAUST_TIMESLICE:
the_thread->cpu_time_budget = _Thread_Ticks_per_timeslice;
the_thread->cpu_time_budget =
rtems_configuration_get_ticks_per_timeslice();
break;
#endif
#if defined(RTEMS_SCORE_THREAD_ENABLE_SCHEDULER_CALLOUT)

View File

@@ -385,7 +385,6 @@ uninitialized =
/*tasksimpl.h*/ (sizeof _RTEMS_tasks_Information) +
/*thread.h*/ (sizeof _Thread_Dispatch_disable_level) +
(sizeof _Thread_Ticks_per_timeslice) +
(sizeof _Thread_Executing) +
(sizeof _Thread_Heir) +
#if (CPU_HARDWARE_FP == 1) || (CPU_SOFTWARE_FP == 1)