]> rtime.felk.cvut.cz Git - frescor/frsh-include.git/blobdiff - frsh_shared_objects.h
Correcting a double definition of FRSH_MUTEXT_T_OPAQUE
[frescor/frsh-include.git] / frsh_shared_objects.h
index 6a84c768ba5c6fbae42a9089e307d01f51e03ac7..c2120749dfa468d8c3dcfe45d66eca32feace671 100644 (file)
  * kind of object (protected or unprotected) specified by obj_kind
  *
  * @param[in] obj_label  Label defined by the application.  Char * for
- *                       a string of SHAREDOBJ_LABEL_MAXLENGTH
+ *                       a string of FRSH_MAX_SIZE_SHARED_OBJ_LABEL
  *                       characters (+ null terminating \0).
  *
  * @param[in] obj_kind  Whether it is protected or unprotected.
@@ -228,8 +228,8 @@ int frsh_sharedobj_init
  * obj_handle. Otherwise, an error code is returned.
  *
  * @param[in] obj_label  Defined by the application at object creation
- *                    time. Char * for a string of SHAREDOBJ_LABEL_MAXLENGTH
- *                       characters (+ null terminating \0).
+ *                time. Char * for a string of FRSH_MAX_SIZE_SHARED_OBJ_LABEL
+ *                characters (+ null terminating \0).
  *
  * @param[out] obj_handle Placeholder for the object handle.
  *
@@ -356,11 +356,10 @@ int frsh_sharedobj_remove
  *
  * @param[in] obj_handle  Shared object previously initialised.
  *
- * @param[in] wcet Execution time of the critical section.  Note that
- *                 normal budgets associated with contracts must NOT
- *                 include this time.
+ * @param[in] wcet Execution time of the critical section.  This
+ *                 budget is consumed in parallel with the vres budget.
  *
- * @param[out] cset Critical section memory placeholder.
+ * @param[out] csect Critical section memory placeholder.
  *
  * @return 0 if no error \n
  *   FRSH_ERR_BAD_ARGUMENT : if obj_handle is NULL \b or \n
@@ -387,7 +386,7 @@ int frsh_csect_init
  * shared object stored in the critical section referenced by csect
  *
  * @return 0 if no error \n
- *   FRSH_ERR_BAD_ARGUMENT : if cset or obj_handle are NULL or cset
+ *   FRSH_ERR_BAD_ARGUMENT : if csect or obj_handle are NULL or csect
  *      is not correct \n
  *   FRSH_ERR_NOT_SCHEDULED_CALLING_THREAD : if the calling thread is not
  *      scheduled under the FRSH \n
@@ -398,7 +397,7 @@ int frsh_csect_init
  * 
  **/
 int frsh_csect_get_sharedobj_handle
-    (const frsh_csect_t *cset,
+    (const frsh_csect_t *csect,
      frsh_sharedobj_handle_t * obj_handle);
 
 /**
@@ -408,7 +407,7 @@ int frsh_csect_get_sharedobj_handle
  * of the operation stored in the critical section referenced by csect.
  *
  * @return 0 if no error \n
- *   FRSH_ERR_BAD_ARGUMENT : if cset or wcet are NULL or cset
+ *   FRSH_ERR_BAD_ARGUMENT : if csect or wcet are NULL or csect
  *      is not correct \n
  *   FRSH_ERR_NOT_SCHEDULED_CALLING_THREAD : if the calling thread is not
  *      scheduled under FRSH \n
@@ -419,7 +418,7 @@ int frsh_csect_get_sharedobj_handle
  * 
  **/
 int frsh_csect_get_wcet
-    (const frsh_csect_t *cset,
+    (const frsh_csect_t *csect,
      struct timespec *wcet);
 
 
@@ -432,7 +431,7 @@ int frsh_csect_get_wcet
  * The function returns an error if the shared_object is unprotected.
  *
  * @return 0 if no error \n
- *   FRSH_ERR_BAD_ARGUMENT : if cset or op are NULL or if csect points
+ *   FRSH_ERR_BAD_ARGUMENT : if csect or op are NULL or if csect points
  *      to a wrong critical section or if the shared_object is of type
  *      unprotected. 
  *   FRSH_ERR_NOT_SCHEDULED_CALLING_THREAD : if the calling thread is not
@@ -444,7 +443,7 @@ int frsh_csect_get_wcet
  * 
  **/
 int frsh_csect_register_read_op
-    (frsh_csect_t *cset,
+    (frsh_csect_t *csect,
      frsh_csect_op_t op);
 
 /**
@@ -458,9 +457,9 @@ int frsh_csect_register_read_op
  * The function returns an error if the shared_object is unprotected.
  *
  * @return 0 if no error \n
- *   FRSH_ERR_BAD_ARGUMENT : if op, cset or areas are NULL or cset points 
- *      to a wrong critical section or if the shared_object of csect
- *      is of type unprotected.
+ *   FRSH_ERR_BAD_ARGUMENT : if op, csect or areas are NULL or csect points 
+ *      to a wrong critical section, or areas has a wrong size, or if the 
+ *      shared_object of csect is of type unprotected.
  *   FRSH_ERR_NOT_SCHEDULED_CALLING_THREAD : if the calling thread is not
  *      scheduled under the FRSH \n
  *   FRSH_ERR_INVALID_SCHEDULER_REPLY : the scheduler is wrong or not
@@ -470,7 +469,7 @@ int frsh_csect_register_read_op
  * 
  **/
 int frsh_csect_register_write_op
-    (frsh_csect_t *cset,
+    (frsh_csect_t *csect,
      frsh_csect_op_t op,
      const frsh_memory_areas_t *areas);
 
@@ -481,7 +480,7 @@ int frsh_csect_register_write_op
  * Returns the type of operation (read/write/unchecked) of the critical section.
 
  * @return 0 if no error \n
- *   FRSH_ERR_BAD_ARGUMENT : if cset or op_kind are NULL or cset
+ *   FRSH_ERR_BAD_ARGUMENT : if csect or op_kind are NULL or csect
  *      is not correct \n
  *   FRSH_ERR_NOT_SCHEDULED_CALLING_THREAD : if the calling thread is not
  *      scheduled under FRSH \n
@@ -492,7 +491,7 @@ int frsh_csect_register_write_op
  * 
  **/
 int frsh_csect_get_op_kind
-    (const frsh_csect_t *cset,
+    (const frsh_csect_t *csect,
      frsh_csect_op_kind_t *op_kind);
 
 
@@ -500,12 +499,12 @@ int frsh_csect_get_op_kind
  * frsh_csect_get_read_op()
  *
  * Get into the variable pointed to by op the operation pointer stored
- * in the critical section referenced by cset.
+ * in the critical section referenced by csect.
  *
  * If the csect is of type write or unchecked it returns an error.
  *
  * @return 0 if no error \n
- *   FRSH_ERR_BAD_ARGUMENT : if cset is NULL or points to a wrong 
+ *   FRSH_ERR_BAD_ARGUMENT : if csect is NULL or points to a wrong 
  *      critical section, or to a critical section that is not of the
  *      FRSH_CSOK_READ kind \n
  *   FRSH_ERR_NOT_SCHEDULED_CALLING_THREAD : if the calling thread is not
@@ -517,7 +516,7 @@ int frsh_csect_get_op_kind
  * 
  **/
 int frsh_csect_get_read_op
-    (const frsh_csect_t *cset,
+    (const frsh_csect_t *csect,
      frsh_csect_op_t *op);
 
 
@@ -525,12 +524,12 @@ int frsh_csect_get_read_op
 /**
  * frsh_csect_get_write_op()
  *
- * Get the oparation pointer and the memory areas stored in the csect.
+ * Get the operation pointer and the memory areas stored in the csect.
  *
  * If the csect is of type read or unchecked.
  *
  * @return 0 if no error \n
- *   FRSH_ERR_BAD_ARGUMENT : if cset is NULL or points to a wrong 
+ *   FRSH_ERR_BAD_ARGUMENT : if csect is NULL or points to a wrong 
  *      critical section, or to a critical section that is not of the
  *      FRSH_CSOK_WRITE kind \n
  *   FRSH_ERR_NOT_SCHEDULED_CALLING_THREAD : if the calling thread is not
@@ -542,7 +541,7 @@ int frsh_csect_get_read_op
  * 
  **/
 int frsh_csect_get_write_op
-    (const frsh_csect_t *cset,
+    (const frsh_csect_t *csect,
      frsh_csect_op_t *op,
      frsh_memory_areas_t *areas);
 
@@ -552,22 +551,21 @@ int frsh_csect_get_write_op
  *
  * Invoke the registered operation in the critical section, with the pointers
  * to the input and output parameters specified by input_arg and
- * output arg, setting a budget for the operation and executing the
- * registered operation.
+ * output arg.
  *
  * If the section is of type FRSH_CSOK_UNCHECKED, the function returns
  * an error.
  *
- * For read operations, the mutex is locked, the budget is set equal
+ * For read operations, the mutex is locked, the csect budget is set equal
  * to the wcet, the registered read operation is invoked, and then the
  * mutex is unlocked; if the csect budget expires, the operation is
  * interrupted, the mutex is unlocked, and the function returns with
  * an error code.
  *
  * For write operations, the mutex is locked, the registered memory
- * areas are backed up, a budget is set equal to the wcet, the
+ * areas are backed up, the csect budget is set equal to the wcet, the
  * registered write operation is called, and the mutex is unlocked. If
- * the budget expires, the operation is interrupted, the backed-up
+ * the csect budget expires, the operation is interrupted, the backed-up
  * memory areas are recovered, the mutex is unlocked, and the function
  * returns with an error code. The blocking time suffered by higher
  * priority tasks is at most the wcet of the operation plus the backup
@@ -577,9 +575,9 @@ int frsh_csect_get_write_op
  * returns an error.
  *
  * @return 0 if no error \n
- *   FRSH_ERR_BAD_ARGUMENT : if cset is NULL or points to a wrong 
+ *   FRSH_ERR_BAD_ARGUMENT : if csect is NULL or points to a wrong 
  *      critical section, or to a critical section that is unprotected \n
- *   FRSH_ERR_BUDGET_EXPIRED : the budget expired and the protected 
+ *   FRSH_ERR_BUDGET_EXPIRED : the csect budget expired and the protected 
  *      operation was interrupted \n
  *   FRSH_ERR_NOT_SCHEDULED_CALLING_THREAD : if the calling thread is not
  *      scheduled under FRSH \n
@@ -590,7 +588,7 @@ int frsh_csect_get_write_op
  * 
  **/
 int frsh_csect_invoke
-    (const frsh_csect_t *cset,
+    (const frsh_csect_t *csect,
      const void * input_arg, 
      void * output_arg);
 
@@ -600,14 +598,14 @@ int frsh_csect_invoke
  * Get in the variable pointed to by blocking the maximum blocking
  * time of the operation of the referenced protected critical section.
  *
- * For read operations, the maximum blocking time is the wcet.
+ * For read or unchecked operations, the maximum blocking time is the wcet.
  *
  * For write operations, the maximum blocking time suffered by higher
  * priority tasks is the wcet of the operation plus the backup time
  * plus the recovery time.
  *
  * @return 0 if no error \n
- *   FRSH_ERR_BAD_ARGUMENT : if cset or blocking are NULL or if csect
+ *   FRSH_ERR_BAD_ARGUMENT : if csect or blocking are NULL or if csect
  *      points to a wrong critical section, or to a critical section
  *      that is unprotected \n
  *   FRSH_ERR_NOT_SCHEDULED_CALLING_THREAD : if the calling thread is not
@@ -619,7 +617,7 @@ int frsh_csect_invoke
  * 
  **/
 int frsh_csect_get_blocking_time
-    (const frsh_csect_t *cset,
+    (const frsh_csect_t *csect,
      struct timespec *blocking);