From f67e22759eb019e8996f859410397475a1d9ef13 Mon Sep 17 00:00:00 2001 From: iripoll Date: Thu, 14 Jun 2007 09:21:08 +0000 Subject: [PATCH] git-svn-id: http://www.frescor.org/private/svn/frescor/fosa/trunk@472 35b4ef3e-fd22-0410-ab77-dab3279adceb --- src_rtlinux/fosa_app_def_sched.c | 30 +++++++++++++++++++++--------- 1 file changed, 21 insertions(+), 9 deletions(-) diff --git a/src_rtlinux/fosa_app_def_sched.c b/src_rtlinux/fosa_app_def_sched.c index 01c2d38..8dcd5d0 100644 --- a/src_rtlinux/fosa_app_def_sched.c +++ b/src_rtlinux/fosa_app_def_sched.c @@ -189,8 +189,8 @@ int fosa_adsactions_add_reject(fosa_ads_actions_t *sched_actions, int fosa_adsactions_add_activate(fosa_ads_actions_t *sched_actions, frsh_thread_id_t thread, fosa_ads_urgency_t urgency){ - RTL_PRIO(&thread)=set_urgency(urgency, (&thread)); - return posix_appsched_actions_addactivate(sched_actions, thread); + RTL_PRIO(thread)=set_urgency(thread, urgency); + return posix_appsched_actions_addactivate(sched_actions, thread); } int fosa_adsactions_add_suspend(fosa_ads_actions_t *sched_actions, @@ -198,19 +198,24 @@ int fosa_adsactions_add_suspend(fosa_ads_actions_t *sched_actions, return posix_appsched_actions_addsuspend (sched_actions, thread); } - +extern timer_t fosa_timeout_timer; // defined in rtl_fosa.c int fosa_adsactions_add_timeout(fosa_ads_actions_t *sched_actions, fosa_clock_id_t clock_id, const struct timespec *at_time){ struct sigevent signal; + struct itimerspec at_itimer= (struct itimerspec) + {.it_interval=(struct timespec){0,0}, + .it_value=*at_time}; + if (fosa_timeout_timer) return EINVAL; signal.sigev_signo=0; signal.sigev_notify=SIGEV_NONE; - timer_create(clock_id, signal, &fosa_timeout_timer); - timer_settime(fosa_timeout_timer, int flags, at_time, 0); + timer_create(clock_id, &signal, &fosa_timeout_timer); + timer_settime(fosa_timeout_timer, 0, &at_itimer, 0); + return 0; } @@ -219,6 +224,10 @@ int fosa_adsactions_add_thread_notification(fosa_ads_actions_t *sched_actions, fosa_clock_id_t clock_id, const struct timespec *at_time){ struct sigevent signal; + struct itimerspec at_itimer= (struct itimerspec) + {.it_interval=(struct timespec){0,0}, + .it_value=*at_time}; + if (fosa_timeout_timer) return EINVAL; @@ -226,20 +235,23 @@ int fosa_adsactions_add_thread_notification(fosa_ads_actions_t *sched_actions, signal.sigev_signo=(int)thread; signal.sigev_notify=SIGEV_NONE; - timer_create(clock_id, signal, &fosa_timeout_timer); - timer_settime(fosa_timeout_timer, int flags, at_time, 0); + timer_create(clock_id, &signal, &fosa_timeout_timer); + timer_settime(fosa_timeout_timer, 0, &at_itimer, 0); + return 0; } +extern rtl_sigset_t fosa_scheduler_signal_bitmap; // as declared in rtl_fosa.c int fosa_ads_set_handled_signal_set(frsh_signal_t set[], int size){ int x; rtl_sigemptyset(&fosa_scheduler_signal_bitmap); for (x=0; x