summaryrefslogtreecommitdiffstats
path: root/c/src/exec/rtems
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>1996-06-06 14:55:08 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>1996-06-06 14:55:08 +0000
commitebd40c063834a7eabd6006b86b163b21083dc6df (patch)
treef2a926919f1b2b2e6db3490be9a511cb3fe6275f /c/src/exec/rtems
parentAdded Sporadic Server support to posix threads which required changes (diff)
downloadrtems-ebd40c063834a7eabd6006b86b163b21083dc6df.tar.bz2
Added Sporadic Server support to posix threads which required changes
in the core to support multiple algorithms to handle cpu time budgetting which resulted in a change to the calling sequence of _Thread_Initialize.
Diffstat (limited to 'c/src/exec/rtems')
-rw-r--r--c/src/exec/rtems/src/tasks.c20
1 files changed, 16 insertions, 4 deletions
diff --git a/c/src/exec/rtems/src/tasks.c b/c/src/exec/rtems/src/tasks.c
index aec54fc7f4..403a26e0d4 100644
--- a/c/src/exec/rtems/src/tasks.c
+++ b/c/src/exec/rtems/src/tasks.c
@@ -354,7 +354,10 @@ rtems_status_code rtems_task_create(
is_fp,
core_priority,
_Modes_Is_preempt(initial_modes) ? TRUE : FALSE,
- _Modes_Is_timeslice(initial_modes) ? TRUE : FALSE,
+ _Modes_Is_timeslice(initial_modes) ?
+ THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE :
+ THREAD_CPU_BUDGET_ALGORITHM_NONE,
+ NULL, /* no budget algorithm callout */
_Modes_Get_interrupt_level(initial_modes),
&name
);
@@ -777,7 +780,12 @@ rtems_status_code rtems_task_mode(
asr = &api->Signal;
old_mode = (executing->is_preemptible) ? RTEMS_PREEMPT : RTEMS_NO_PREEMPT;
- old_mode |= (executing->is_timeslice) ? RTEMS_TIMESLICE : RTEMS_NO_TIMESLICE;
+
+ if ( executing->budget_algorithm == THREAD_CPU_BUDGET_ALGORITHM_NONE )
+ old_mode |= RTEMS_NO_TIMESLICE;
+ else
+ old_mode |= RTEMS_TIMESLICE;
+
old_mode |= (asr->is_enabled) ? RTEMS_ASR : RTEMS_NO_ASR;
old_mode |= _ISR_Get_level();
@@ -790,8 +798,12 @@ rtems_status_code rtems_task_mode(
if ( mask & RTEMS_PREEMPT_MASK )
executing->is_preemptible = _Modes_Is_preempt(mode_set) ? TRUE : FALSE;
- if ( mask & RTEMS_TIMESLICE_MASK )
- executing->is_timeslice = _Modes_Is_timeslice(mode_set) ? TRUE : FALSE;
+ if ( mask & RTEMS_TIMESLICE_MASK ) {
+ if ( _Modes_Is_timeslice(mode_set) )
+ executing->budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_RESET_TIMESLICE;
+ else
+ executing->budget_algorithm = THREAD_CPU_BUDGET_ALGORITHM_NONE;
+ }
/*
* Set the new interrupt level