Subversion Repositories shark

Rev

Rev 985 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
985 julio 1
//fsf_implementation_specific.h
2
//===================================================
3
//       FFFFFFIII   RRRRR      SSTTTTTTT
4
//      FF         IIR   RR    SS
5
//     FF           IR        SS
6
//    FFFFFF         RRRR    SSSSST
7
//   FF       FI       RRR  SS
8
//  FF         II     RRR  SS
9
// FF           IIIIIR    RS
10
//
11
// FSF(FIRST Scheduling Framework) 
12
//implementation-defined optional functionality
13
//================================================
14
 
15
#include "fsf_basic_types.h"
16
#include "fsf_core.h"
17
 
18
 
19
#ifndef _FSF_IMPLEMENTATION_SPECIFIC_H_
20
#define _FSF_IMPLEMENTATION_SPECIFIC_H_
21
 
22
#define FSF_IMPLEMENTATION_SPECIFIC_MODULE_SUPPORTED     1
23
 
24
 
25
// The operations defined in this module are of optional use. They
26
// only work in the fixed priority implementation, and they may be
27
// used to enhance the behavior of the applications running under the
28
// fsf scheduler.
29
 
30
//// The definition of this type is in fsf_basic_types.h
31
//
32
//typedef unsigned long      fsf_preemption_level_t;
33
//                           // range 1..2**32-1
34
 
35
 
36
//fsf_set_contract_preemption_level: The operation updates the
37
//specified contract parameters object by setting its preemption level
38
//to the specified input parameter.
39
 
40
int
41
fsf_set_contract_preemption_level
42
  (fsf_contract_parameters_t     *contract,
43
   fsf_preemption_level_t         preemption_level);
44
 
45
 
46
//fsf_get_contract_preemption_level: The operation obtains from the
47
//specified contract parameters object its preemption level and copies
48
//it to the place pointed to by the specified input parameter.
49
 
50
int
51
fsf_get_contract_preemption_level
52
  (const fsf_contract_parameters_t *contract,
53
   fsf_preemption_level_t          *preemption_level);
54
 
55
 
56
//fsf_set_service_thread_preemption_level: this function sets the
57
//preemption level of the service thread to the specified value. The
997 julio 58
//initial preemption level is a configurable parameter. This value
59
//is stored in a temporary variable and it is used the next time the
60
//service thread data is updated with the fsf_set_service_thread_data
61
//function
985 julio 62
 
63
int
64
fsf_set_service_thread_preemption_level
65
  (fsf_preemption_level_t         preemption_level);
66
 
67
//fsf_get_service_thread_preemption_level: this function stores the
68
//current preemption level of the service thread in the variable
69
//pointed to by preemption_level
70
 
71
int
72
fsf_get_service_thread_preemption_level
73
  (fsf_preemption_level_t        *preemption_level);
74
 
75
 
76
//fsf_thread_exit: There is a limitation in the current version of the
77
//MaRTE implementation that causes the information of a terminated
78
//thread to continue to be stored in the fsf scheduler, and the thread
79
//to continue to be counted in the number of threads. The
80
//fsf_thread_exit operation allows the implementation to delete the
81
//thread's information, and then terminate the thread. Therefore, it
82
//is recommended to use this function to terminate a thread under fsf.
83
 
84
//This operation shall terminate the calling thread, make the value
85
//value_ptr available to any successful join with the terminating
86
//thread, and unbind the thread from its associated server. After
87
//cleaning up the thread management data, it is unbound and the
88
//scheduling policy is changed to fixed priority before the posix
89
//pthread_exit() function is called.
90
 
91
void
92
fsf_thread_exit (void *value_ptr);
93
 
94
 
95
//fsf_set_shared_obj_preemption_level: The operation updates the
96
//specified shared object by setting its preemption level
97
//to the specified input parameter. 
98
//OBSERVATION: if this value is changed being any contract that
99
//uses the resource already accepted, the system's behavior and
100
//particularly the acceptance tests correctness are not garantee
101
//and probably wrong.
102
 
103
int
104
fsf_set_shared_obj_preemption_level
105
  (fsf_shared_obj_handle_t  obj_handle,
106
   fsf_preemption_level_t   preemption_level);
107
 
108
 
109
//fsf_get_shared_obj_preemption_level: The operation obtains from the
110
//specified shared object its preemption level and copies
111
//it to the place pointed to by the specified input parameter.
112
 
113
int
114
fsf_get_shared_obj_preemption_level
115
  (fsf_shared_obj_handle_t  obj_handle,
116
   fsf_preemption_level_t  *preemption_level);
117
 
118
 
119
 
120
#endif // _FSF_IMPLEMENTATION_SPECIFIC_H_