forked from Imagelibrary/rtems
score: Delete _Thread_Ticks_per_timeslice
Use the Configuration instead.
This commit is contained in:
@@ -30,6 +30,7 @@
|
|||||||
#include <rtems/posix/time.h>
|
#include <rtems/posix/time.h>
|
||||||
#include <rtems/score/threadimpl.h>
|
#include <rtems/score/threadimpl.h>
|
||||||
#include <rtems/score/watchdogimpl.h>
|
#include <rtems/score/watchdogimpl.h>
|
||||||
|
#include <rtems/config.h>
|
||||||
|
|
||||||
int pthread_setschedparam(
|
int pthread_setschedparam(
|
||||||
pthread_t thread,
|
pthread_t thread,
|
||||||
@@ -83,7 +84,8 @@ int pthread_setschedparam(
|
|||||||
case SCHED_OTHER:
|
case SCHED_OTHER:
|
||||||
case SCHED_FIFO:
|
case SCHED_FIFO:
|
||||||
case SCHED_RR:
|
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 =
|
the_thread->real_priority =
|
||||||
_POSIX_Priority_To_core( api->schedparam.sched_priority );
|
_POSIX_Priority_To_core( api->schedparam.sched_priority );
|
||||||
|
|||||||
@@ -24,9 +24,8 @@
|
|||||||
#include <sched.h>
|
#include <sched.h>
|
||||||
#include <errno.h>
|
#include <errno.h>
|
||||||
|
|
||||||
#include <rtems/system.h>
|
|
||||||
#include <rtems/score/threadimpl.h>
|
|
||||||
#include <rtems/score/timespec.h>
|
#include <rtems/score/timespec.h>
|
||||||
|
#include <rtems/config.h>
|
||||||
#include <rtems/seterr.h>
|
#include <rtems/seterr.h>
|
||||||
|
|
||||||
int sched_rr_get_interval(
|
int sched_rr_get_interval(
|
||||||
@@ -44,6 +43,10 @@ int sched_rr_get_interval(
|
|||||||
if ( !interval )
|
if ( !interval )
|
||||||
rtems_set_errno_and_return_minus_one( EINVAL );
|
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;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -105,7 +105,8 @@ rtems_status_code rtems_task_mode(
|
|||||||
if ( mask & RTEMS_TIMESLICE_MASK ) {
|
if ( mask & RTEMS_TIMESLICE_MASK ) {
|
||||||
if ( _Modes_Is_timeslice(mode_set) ) {
|
if ( _Modes_Is_timeslice(mode_set) ) {
|
||||||
executing->budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE;
|
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
|
} else
|
||||||
executing->budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE;
|
executing->budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -57,11 +57,6 @@ SCORE_EXTERN void *rtems_ada_self;
|
|||||||
*/
|
*/
|
||||||
SCORE_EXTERN Objects_Information _Thread_Internal_information;
|
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
|
* The following points to the thread whose floating point
|
||||||
* context is currently loaded.
|
* context is currently loaded.
|
||||||
|
|||||||
@@ -22,6 +22,7 @@
|
|||||||
#include <rtems/score/schedulerimpl.h>
|
#include <rtems/score/schedulerimpl.h>
|
||||||
#include <rtems/score/threadimpl.h>
|
#include <rtems/score/threadimpl.h>
|
||||||
#include <rtems/score/smp.h>
|
#include <rtems/score/smp.h>
|
||||||
|
#include <rtems/config.h>
|
||||||
|
|
||||||
static void _Scheduler_default_Tick_for_executing(
|
static void _Scheduler_default_Tick_for_executing(
|
||||||
Scheduler_Control *scheduler,
|
Scheduler_Control *scheduler,
|
||||||
@@ -69,7 +70,8 @@ static void _Scheduler_default_Tick_for_executing(
|
|||||||
* FIFO for this priority and a new heir is selected.
|
* FIFO for this priority and a new heir is selected.
|
||||||
*/
|
*/
|
||||||
_Scheduler_Yield( scheduler, executing );
|
_Scheduler_Yield( scheduler, executing );
|
||||||
executing->cpu_time_budget = _Thread_Ticks_per_timeslice;
|
executing->cpu_time_budget =
|
||||||
|
rtems_configuration_get_ticks_per_timeslice();
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|||||||
@@ -50,8 +50,6 @@ void _Thread_Handler_initialization(void)
|
|||||||
_Thread_Allocated_fp = NULL;
|
_Thread_Allocated_fp = NULL;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
_Thread_Ticks_per_timeslice = ticks_per_timeslice;
|
|
||||||
|
|
||||||
#if defined(RTEMS_MULTIPROCESSING)
|
#if defined(RTEMS_MULTIPROCESSING)
|
||||||
_Thread_MP_Handler_initialization( maximum_proxies );
|
_Thread_MP_Handler_initialization( maximum_proxies );
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -28,6 +28,7 @@
|
|||||||
#include <rtems/score/todimpl.h>
|
#include <rtems/score/todimpl.h>
|
||||||
#include <rtems/score/userextimpl.h>
|
#include <rtems/score/userextimpl.h>
|
||||||
#include <rtems/score/wkspace.h>
|
#include <rtems/score/wkspace.h>
|
||||||
|
#include <rtems/config.h>
|
||||||
|
|
||||||
static Thread_Action *_Thread_Get_post_switch_action(
|
static Thread_Action *_Thread_Get_post_switch_action(
|
||||||
Thread_Control *executing
|
Thread_Control *executing
|
||||||
@@ -121,7 +122,7 @@ void _Thread_Dispatch( void )
|
|||||||
rtems_ada_self = heir->rtems_ada_self;
|
rtems_ada_self = heir->rtems_ada_self;
|
||||||
#endif
|
#endif
|
||||||
if ( heir->budget_algorithm == THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE )
|
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 )
|
#if !defined( RTEMS_SMP )
|
||||||
_ISR_Enable( level );
|
_ISR_Enable( level );
|
||||||
|
|||||||
@@ -189,7 +189,8 @@ bool _Thread_Initialize(
|
|||||||
break;
|
break;
|
||||||
#if defined(RTEMS_SCORE_THREAD_ENABLE_EXHAUST_TIMESLICE)
|
#if defined(RTEMS_SCORE_THREAD_ENABLE_EXHAUST_TIMESLICE)
|
||||||
case THREAD_CPU_BUDGET_ALGORITHM_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;
|
break;
|
||||||
#endif
|
#endif
|
||||||
#if defined(RTEMS_SCORE_THREAD_ENABLE_SCHEDULER_CALLOUT)
|
#if defined(RTEMS_SCORE_THREAD_ENABLE_SCHEDULER_CALLOUT)
|
||||||
|
|||||||
@@ -385,7 +385,6 @@ uninitialized =
|
|||||||
/*tasksimpl.h*/ (sizeof _RTEMS_tasks_Information) +
|
/*tasksimpl.h*/ (sizeof _RTEMS_tasks_Information) +
|
||||||
|
|
||||||
/*thread.h*/ (sizeof _Thread_Dispatch_disable_level) +
|
/*thread.h*/ (sizeof _Thread_Dispatch_disable_level) +
|
||||||
(sizeof _Thread_Ticks_per_timeslice) +
|
|
||||||
(sizeof _Thread_Executing) +
|
(sizeof _Thread_Executing) +
|
||||||
(sizeof _Thread_Heir) +
|
(sizeof _Thread_Heir) +
|
||||||
#if (CPU_HARDWARE_FP == 1) || (CPU_SOFTWARE_FP == 1)
|
#if (CPU_HARDWARE_FP == 1) || (CPU_SOFTWARE_FP == 1)
|
||||||
|
|||||||
Reference in New Issue
Block a user