// -----------------------------------------------------------------------
-// Copyright (C) 2006 - 2007 FRESCOR consortium partners:
+// Copyright (C) 2006 - 2008 FRESCOR consortium partners:
//
// Universidad de Cantabria, SPAIN
// University of York, UK
// FSF API web pages: http://marte.unican.es/fsf/docs
// http://shark.sssup.it/contrib/first/docs/
//
-// This file is part of FRSH API
+// This file is part of FRSH (FRescor ScHeduler)
//
-// FRSH API is free software; you can redistribute it and/or modify
-// it under the terms of the GNU General Public License as published by
-// the Free Software Foundation; either version 2, or (at your option)
-// any later version.
+// FRSH is free software; you can redistribute it and/or modify it
+// under terms of the GNU General Public License as published by the
+// Free Software Foundation; either version 2, or (at your option) any
+// later version. FRSH is distributed in the hope that it will be
+// useful, but WITHOUT ANY WARRANTY; without even the implied warranty
+// of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+// General Public License for more details. You should have received a
+// copy of the GNU General Public License along with FRSH; see file
+// COPYING. If not, write to the Free Software Foundation, 675 Mass Ave,
+// Cambridge, MA 02139, USA.
//
-// FRSH API is distributed in the hope that it will be useful, but
-// WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-// General Public License for more details.
-//
-// You should have received a copy of the GNU General Public License
-// distributed with FRSH API; see file COPYING. If not, write to the
-// Free Software Foundation, 59 Temple Place - Suite 330, Boston, MA
-// 02111-1307, USA.
-//
-// As a special exception, if you include this header file into source
-// files to be compiled, this header file does not by itself cause
-// the resulting executable to be covered by the GNU General Public
-// License. This exception does not however invalidate any other
-// reasons why the executable file might be covered by the GNU General
-// Public License.
+// As a special exception, including FRSH header files in a file,
+// instantiating FRSH generics or templates, or linking other files
+// with FRSH objects to produce an executable application, does not
+// by itself cause the resulting executable application to be covered
+// by the GNU General Public License. This exception does not
+// however invalidate any other reasons why the executable file might be
+// covered by the GNU Public License.
// -----------------------------------------------------------------------
//==============================================
*
* @return 0 if no error \n
* FRSH_ERR_BAD_ARGUMENT : if any of the pointers is NULL
- * or if only one of the timespec values is 0, and also if the
+ * or if only one of the time values is 0, and also if the
* workload or the contract type values are unknown in the
* enumerations.
**/
int frsh_contract_set_basic_params
(frsh_contract_t *contract,
- const struct timespec *budget_min,
- const struct timespec *period_max,
+ const frsh_rel_time_t *budget_min,
+ const frsh_rel_time_t *period_max,
const frsh_workload_t workload,
const frsh_contract_type_t contract_type);
**/
int frsh_contract_get_basic_params
(const frsh_contract_t *contract,
- struct timespec *budget_min,
- struct timespec *period_max,
+ frsh_rel_time_t *budget_min,
+ frsh_rel_time_t *period_max,
frsh_workload_t *workload,
frsh_contract_type_t *contract_type);
int frsh_contract_set_timing_reqs
(frsh_contract_t *contract,
const bool d_equals_t,
- const struct timespec *deadline,
+ const frsh_rel_time_t *deadline,
const frsh_signal_t budget_overrun_signal,
const frsh_signal_info_t budget_overrun_siginfo,
const frsh_signal_t deadline_miss_signal,
int frsh_contract_get_timing_reqs
(const frsh_contract_t *contract,
bool *d_equals_t,
- struct timespec *deadline,
+ frsh_rel_time_t *deadline,
frsh_signal_t *budget_overrun_signal,
frsh_signal_info_t *budget_overrun_siginfo,
frsh_signal_t *deadline_miss_signal,
**/
int frsh_synchobj_wait
(const frsh_synchobj_handle_t synch_handle,
- struct timespec *next_budget,
- struct timespec *next_period,
+ frsh_rel_time_t *next_budget,
+ frsh_rel_time_t *next_period,
bool *was_deadline_missed,
bool *was_budget_overran);
**/
int frsh_synchobj_wait_with_timeout
(const frsh_synchobj_handle_t synch_handle,
- const struct timespec *abs_timeout,
+ const frsh_abs_time_t *abs_timeout,
bool *timed_out,
- struct timespec *next_budget,
- struct timespec *next_period,
+ frsh_rel_time_t *next_budget,
+ frsh_rel_time_t *next_period,
bool *was_deadline_missed,
bool *was_budget_overran);
* @sa frsh_synchobj_wait, frsh_synchobj_wait_with_timeout
**/
int frsh_timed_wait
- (const struct timespec *abs_time,
- struct timespec *next_budget,
- struct timespec *next_period,
+ (const frsh_abs_time_t *abs_time,
+ frsh_rel_time_t *next_budget,
+ frsh_rel_time_t *next_period,
bool *was_deadline_missed,
bool *was_budget_overran);
int frsh_thread_get_vres_id(const frsh_thread_id_t thread,
frsh_vres_id_t *vres_id);
+/**
+ * frsh_vres_get_priority()
+ *
+ * This operation stores the priority currently associated
+ * with the specified vres in the variable pointed to by
+ * priority. It returns an error if the vres_id is not recognised.
+ *
+ * @return 0 if no error \n
+ * FRSH_ERR_BAD_ARGUMENT : if the contract argument is NULL or the value
+ * of the vres argument is not in range \n
+ * FRSH_ERR_NOT_SCHEDULED_CALLING_THREAD : if the calling thread is not
+ * scheduled under FRSH \n
+ * FRSH_ERR_INVALID_SCHEDULER_REPLY : the scheduler is wrong or not
+ * running \n
+ * FRSH_ERR_NOT_CONTRACTED_VRES: if the vres of the calling thread
+ * has been cancelled or it is not valid
+ *
+ **/
+int frsh_vres_get_priority
+ (frsh_vres_id_t vres_id,
+ int *priority);
+
/**
* frsh_vres_get_contract()
*
**/
int frsh_vres_get_usage
(const frsh_vres_id_t vres,
- struct timespec *spent);
+ frsh_rel_time_t *spent);
+
+
+/**
+ * frsh_vres_get_job_usage()
+ *
+ * Get the execution time of the current job of the specified virtual
+ * resource for a bounded or synchronized workload.
+ **/
+int frsh_vres_get_job_usage
+ (const frsh_vres_id_t vres,
+ frsh_rel_time_t *spent);
+
/**
* frsh_vres_get_remaining_budget()
**/
int frsh_vres_get_remaining_budget
(const frsh_vres_id_t vres,
- struct timespec *budget);
+ frsh_rel_time_t *budget);
/**
**/
int frsh_vres_get_budget_and_period
(const frsh_vres_id_t vres,
- struct timespec *budget,
- struct timespec *period);
+ frsh_rel_time_t *budget,
+ frsh_rel_time_t *period);
/*@}*/
* has been cancelled or it is not valid
*
**/
-int frsh_service_thread_set_data (const struct timespec *budget,
- const struct timespec *period,
+int frsh_service_thread_set_data (const frsh_rel_time_t *budget,
+ const frsh_rel_time_t *period,
bool *accepted);
/**
*
**/
int frsh_service_thread_get_data
- (struct timespec *budget,
- struct timespec *period);
+ (frsh_rel_time_t *budget,
+ frsh_rel_time_t *period);
/*@}*/