From e39bb43b696a44c83aefbd381b0e70c63dce2732 Mon Sep 17 00:00:00 2001 From: telleriam Date: Thu, 14 Jun 2007 13:00:38 +0000 Subject: [PATCH] Moving fosa_signal_queue_scheduler() from threads_and_signals.h to app_def_sched.h and implement it in the app_def_sched.c file in MaRTE. For MaRTE-OS it is a direct call to fosa_signal_queue(). git-svn-id: http://www.frescor.org/private/svn/frescor/fosa/trunk@481 35b4ef3e-fd22-0410-ab77-dab3279adceb --- include/fosa_app_def_sched.h | 33 ++++++++++++++++++++++ include/fosa_threads_and_signals.h | 31 --------------------- src_marte/fosa_app_def_sched.c | 44 ++++++++++++++++++++++++++++++ 3 files changed, 77 insertions(+), 31 deletions(-) diff --git a/include/fosa_app_def_sched.h b/include/fosa_app_def_sched.h index 893efa3..80f0c5b 100644 --- a/include/fosa_app_def_sched.h +++ b/include/fosa_app_def_sched.h @@ -560,6 +560,39 @@ int fosa_adsactions_add_thread_notification( int fosa_ads_set_handled_signal_set(frsh_signal_t set[], int size); +/** + * fosa_signal_queue_scheduler() + * + * Queue a signal destinated to the scheduler + * + * This is a special case of fosa_signal_queue() in which the + * destinator is the scheduler itself. It is needed by the service + * thread to notify the results to the scheduler. + * + * The problem with this case is that, depending on the implementation, + * this call would be translated to a true signal or to a scheduler + * notification message. + * + * Besides for the scheduler we don't have always a destinator + * thread_id needed in frsh_signal_queue for OSE. + * + * So the fosa implementation will solve this issue internally. + * + * Returns 0 if successful; otherwise it returns an error code: + * FOSA_EINVAL: the signal specified by signal is not + * between FOSA_SIGNAL_MIN and FOSA_SIGNAL_MAX + * + * FOSA_EAGAIN: no resources are available to queue the signal; the + * maximum number of queued signals has been reached, or a + * systemwide resource limit has been exceeded + * + * Alternatively, in case of error the implementation is allowed to + * notify it to the system console and then terminate the FRSH + * implementation and dependant applications + **/ +int fosa_signal_queue_scheduler(frsh_signal_t signal, frsh_signal_info_t info); + + /** * fosa_ads_invoke_withdata() * diff --git a/include/fosa_threads_and_signals.h b/include/fosa_threads_and_signals.h index c97c61b..bc56e03 100644 --- a/include/fosa_threads_and_signals.h +++ b/include/fosa_threads_and_signals.h @@ -377,37 +377,6 @@ int fosa_signal_queue frsh_thread_id_t receiver); -/** - * fosa_signal_queue_scheduler() - * - * Queue a signal destinated to the scheduler - * - * This is a special case of fosa_signal_queue() in which the - * destinator is the scheduler itself. It is needed by the service - * thread to notify the results to the scheduler. - * - * The problem with this case is that, depending on the implementation, - * this call would be translated to a true signal or to a scheduler - * notification message. - * - * Besides for the scheduler we don't have always a destinator - * thread_id needed in frsh_signal_queue for OSE. - * - * So the fosa implementation will solve this issue internally. - * - * Returns 0 if successful; otherwise it returns an error code: - * FOSA_EINVAL: the signal specified by signal is not - * between FOSA_SIGNAL_MIN and FOSA_SIGNAL_MAX - * - * FOSA_EAGAIN: no resources are available to queue the signal; the - * maximum number of queued signals has been reached, or a - * systemwide resource limit has been exceeded - * - * Alternatively, in case of error the implementation is allowed to - * notify it to the system console and then terminate the FRSH - * implementation and dependant applications - **/ -int fosa_signal_queue_scheduler(frsh_signal_t signal, frsh_signal_info_t info); /** diff --git a/src_marte/fosa_app_def_sched.c b/src_marte/fosa_app_def_sched.c index 43ca2eb..920d76a 100644 --- a/src_marte/fosa_app_def_sched.c +++ b/src_marte/fosa_app_def_sched.c @@ -54,6 +54,7 @@ #include "fosa_app_def_sched.h" #include "fosa_configuration_parameters.h" +#include "fosa_threads_and_signals.h" #include "frsh_error.h" #include "frsh_fosa.h" @@ -1039,6 +1040,49 @@ int fosa_ads_set_handled_signal_set(frsh_signal_t set[], int size) } +/** + * fosa_signal_queue_scheduler() + * + * Queue a signal destinated to the scheduler + * + * This is a special case of fosa_signal_queue() in which the + * destinator is the scheduler itself. It is needed by the service + * thread to notify the results to the scheduler. + * + * The problem with this case is that, depending on the implementation, + * this call would be translated to a true signal or to a scheduler + * notification message. + * + * Besides for the scheduler we don't have always a destinator + * thread_id needed in frsh_signal_queue for OSE. + * + * So the fosa implementation will solve this issue internally. + * + * Returns 0 if successful; otherwise it returns an error code: + * FOSA_EINVAL: the signal specified by signal is not + * between FOSA_SIGNAL_MIN and FOSA_SIGNAL_MAX + * + * FOSA_EAGAIN: no resources are available to queue the signal; the + * maximum number of queued signals has been reached, or a + * systemwide resource limit has been exceeded + * + * Alternatively, in case of error the implementation is allowed to + * notify it to the system console and then terminate the FRSH + * implementation and dependant applications + **/ +int fosa_signal_queue_scheduler(frsh_signal_t signal, frsh_signal_info_t info) +{ + /* In MaRTE OS this function is completely equivalent to + fosa_signal_queue, because there is no notion of receiver. + */ + + frsh_thread_id_t receiver = 0; /* Dummy value, not used by MaRTE OS */ + + + return fosa_signal_queue(signal, info, receiver); +} + + /** * fosa_ads_invoke_withdata() * -- 2.39.2