]> rtime.felk.cvut.cz Git - frescor/fna.git/blobdiff - src_frescan/frescan_bwres_analysis.h
changes to use the FRSH FSA module to do the analysis and spare capacity. TODO: finis...
[frescor/fna.git] / src_frescan / frescan_bwres_analysis.h
index 9058f56e6d16772b9f96f1db86149e914a4bad8f..e932601bdfc665cb7812f1e3235b07b22ffe708c 100644 (file)
@@ -3,73 +3,72 @@
  *
  * @brief FRESCAN bandwith reservation layer: sched analysis
  *
- * This module contains the scheduling analysis data and functions for the
- * admission tests and spare capacity distribution of the negotiation layer.
- * It provides an easy API easy to understand and in the implementation part
- * it makes call to the general sched analysis module of FRSH which is shared
- * with the CPU contracts layer in FRSH.
- *
- * EXAMPLE of utilization:
- *
- * INITIALIZATION
- * --------------
- * params.min_prio = 0;
- * params.max_prio = 16;
- * params.overhead = ...;
- * frescan_sa_init(&scenario, &params);
- *
- * NEGOTIATE
- * ---------
- * fadt_freelist_alloc(&freelist_contracts, &id);
- * frescan_sa_add_contract(&scenario, &contracts[id], id);
- * frescan_sa_sched_test(&scenario, &success);
- *
- * if (!success) {
- *      frescan_sa_remove_contract(&scenario, id);
- * } else {
- *      frescan_sa_spare_capacity(&scenario);
- *      vres_id = to_vres(resource_type, resource_id, id);
- *      create vres runtime structures;
- *
- *      for vres_id in active_vres_id {
- *                frescan_sa_get_final_values(&scenario,
- *                                            to_index(vres_id),
- *                                            &final_values);
- *                update vres runtime structures if necessary;
- *      }
- * }
- *
- * RENEGOTIATE
- * -----------
- * copy old_contract
- * frescan_sa_update_contract(&scenario, to_index(vres_id), &contract);
- * frescan_sa_sched_test(&scenario, &success);
- *
- * if (!success) {
- *         frescan_sa_update_contract(&sa_data,
- *                                    to_index(vres_id),
- *                                    &old_contract);
- * } else {
- *      frescan_sa_spare_capacity(&scenario);
- *      for vres_id in active_vres_id {
- *              frescan_sa_get_final_values(&scenario,
- *                                          to_index(vres_id),
- *                                          &final_values);
- *              update vres runtime structures if necessary;
- *      }
- * }
- *
- * CANCEL
- * ------
- * frescan_sa_remove_contract(&scenario, to_index(vres_id));
- * frescan_sa_spare_capacity(&scenario);
- *
- * @version 0.01
- *
- * @date 15-Apr-2008
+ * @version 0.02
+ *
+ * @date 3-Jul-2008
  *
  * @author Daniel Sangorrin <daniel.sangorrin@unican.es>
  *
+ * @comments
+ *
+ * This module contains the scheduling analysis functions for the
+ * admission tests and spare capacity distribution of the bandwith
+ * reservation (bwres) layer.
+ *
+ * The module "frescan_bwres_mode_change" must be used to apply finally this
+ * new parameters to the sporadic servers following an appropriate mode
+ * change protocol.
+ *
+ * @license
+ *
+ * -----------------------------------------------------------------------
+ *  Copyright (C) 2006 - 2008 FRESCOR consortium partners:
+ *
+ *    Universidad de Cantabria,              SPAIN
+ *    University of York,                    UK
+ *    Scuola Superiore Sant'Anna,            ITALY
+ *    Kaiserslautern University,             GERMANY
+ *    Univ. Politécnica  Valencia,           SPAIN
+ *    Czech Technical University in Prague,  CZECH REPUBLIC
+ *    ENEA                                   SWEDEN
+ *    Thales Communication S.A.              FRANCE
+ *    Visual Tools S.A.                      SPAIN
+ *    Rapita Systems Ltd                     UK
+ *    Evidence                               ITALY
+ *
+ *    See http://www.frescor.org for a link to partners' websites
+ *
+ *           FRESCOR project (FP6/2005/IST/5-034026) is funded
+ *        in part by the European Union Sixth Framework Programme
+ *        The European Union is not liable of any use that may be
+ *        made of this code.
+ *
+ *  This file is part of FRESCAN
+ *
+ *  FRESCAN 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.
+ *
+ *  FRESCAN  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  FRESCAN;  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, including FRESCAN header files in a file,
+ * instantiating FRESCAN generics or templates, or linking other files
+ * with FRESCAN 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.
+ * -----------------------------------------------------------------------
+ *
  */
 
 #ifndef _FRESCAN_BWRES_ANALYSIS_H_
@@ -92,15 +91,15 @@ extern int frescan_sa_init(frescan_sa_scenario_t *scenario,
  * frescan_sa_add_contract() - add a contract to the scenario
  *
  * @scenario: the scenario (in out)
- * @contract: the new contract (in)
  * @ss: the preallocated ss identificator (in)
  * @node: the node this contract belongs to (in)
+ * @contract: the new contract (in)
  */
 
-extern int frescan_sa_add_contract(frescan_sa_scenario_t    *scenario,
-                                   const frescan_contract_t *contract,
-                                   frescan_ss_t             ss,
-                                   frescan_node_t           node);
+extern int frescan_sa_add_contract(frescan_sa_scenario_t *scenario,
+                                   frescan_ss_t          ss,
+                                   frescan_node_t        node,
+                                   const frsh_contract_t *contract);
 
 /**
  * frescan_sa_update_contract() - update a contract in the scenario
@@ -109,14 +108,15 @@ extern int frescan_sa_add_contract(frescan_sa_scenario_t    *scenario,
  * @ss: the ss identificator (in)
  * @node: the node this contract belongs to (in)
  * @contract: the values to update the contract (in)
- * @old_contract: the values of the previous contract. Can be NULL (out)
+ * @old_contract: the values of the previous contract. if NULL
+ *                no contract is returned (out)
  */
 
-extern int frescan_sa_update_contract(frescan_sa_scenario_t   *scenario,
-                                      frescan_ss_t             ss,
-                                      frescan_node_t           node,
-                                      const frescan_contract_t *contract,
-                                      frescan_contract_t       *old_contract);
+extern int frescan_sa_update_contract(frescan_sa_scenario_t  *scenario,
+                                      frescan_ss_t           ss,
+                                      frescan_node_t         node,
+                                      const frsh_contract_t  *contract,
+                                      frsh_contract_t        *old_contract);
 
 /**
  * frescan_sa_remove_contract() - remove a contract from the scenario
@@ -134,32 +134,18 @@ extern int frescan_sa_remove_contract(frescan_sa_scenario_t *scenario,
  * frescan_sa_sched_test() - perform a scheduling test on the scenario
  *
  * @scenario: the scenario (in out)
- * @success: if the scenario is schedulable or not (out)
+ * @is_schedulable: if the scenario is schedulable or not (out)
  */
 
 extern int frescan_sa_sched_test(frescan_sa_scenario_t *scenario,
-                                 bool *success);
+                                 bool *is_schedulable);
 
 /**
- * frescan_sa_spare_capacity() - distribute the remaining spare capacity
+ * frescan_sa_spare_capacity() - distribute the spare capacity
  *
  * @scenario: the scenario (in out)
  */
 
 extern int frescan_sa_spare_capacity(frescan_sa_scenario_t *scenario);
 
-/**
- * frescan_sa_get_final_values() - get the final values
- *
- * @scenario: the scenario (in)
- * @ss: the ss from which we want the final values (in)
- * @node: the node this contract belongs to (in)
- * @final_values: the final values (out)
- */
-
-extern int frescan_sa_get_final_values(const frescan_sa_scenario_t *scenario,
-                                       frescan_ss_t              ss,
-                                       frescan_node_t            node,
-                                       frescan_sa_final_values_t *final_values);
-
 #endif // _FRESCAN_BWRES_ANALYSIS_H_