Rev 891 | Rev 997 | 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 |
||
58 | //initial preemption level is a configurable parameter |
||
59 | |||
60 | int |
||
61 | fsf_set_service_thread_preemption_level |
||
62 | (fsf_preemption_level_t preemption_level); |
||
63 | |||
64 | //fsf_get_service_thread_preemption_level: this function stores the |
||
65 | //current preemption level of the service thread in the variable |
||
66 | //pointed to by preemption_level |
||
67 | |||
68 | int |
||
69 | fsf_get_service_thread_preemption_level |
||
70 | (fsf_preemption_level_t *preemption_level); |
||
71 | |||
72 | |||
73 | //fsf_thread_exit: There is a limitation in the current version of the |
||
74 | //MaRTE implementation that causes the information of a terminated |
||
75 | //thread to continue to be stored in the fsf scheduler, and the thread |
||
76 | //to continue to be counted in the number of threads. The |
||
77 | //fsf_thread_exit operation allows the implementation to delete the |
||
78 | //thread's information, and then terminate the thread. Therefore, it |
||
79 | //is recommended to use this function to terminate a thread under fsf. |
||
80 | |||
81 | //This operation shall terminate the calling thread, make the value |
||
82 | //value_ptr available to any successful join with the terminating |
||
83 | //thread, and unbind the thread from its associated server. After |
||
84 | //cleaning up the thread management data, it is unbound and the |
||
85 | //scheduling policy is changed to fixed priority before the posix |
||
86 | //pthread_exit() function is called. |
||
87 | |||
88 | void |
||
89 | fsf_thread_exit (void *value_ptr); |
||
90 | |||
91 | |||
92 | //fsf_set_shared_obj_preemption_level: The operation updates the |
||
93 | //specified shared object by setting its preemption level |
||
94 | //to the specified input parameter. |
||
95 | //OBSERVATION: if this value is changed being any contract that |
||
96 | //uses the resource already accepted, the system's behavior and |
||
97 | //particularly the acceptance tests correctness are not garantee |
||
98 | //and probably wrong. |
||
99 | |||
100 | int |
||
101 | fsf_set_shared_obj_preemption_level |
||
102 | (fsf_shared_obj_handle_t obj_handle, |
||
103 | fsf_preemption_level_t preemption_level); |
||
104 | |||
105 | |||
106 | //fsf_get_shared_obj_preemption_level: The operation obtains from the |
||
107 | //specified shared object its preemption level and copies |
||
108 | //it to the place pointed to by the specified input parameter. |
||
109 | |||
110 | int |
||
111 | fsf_get_shared_obj_preemption_level |
||
112 | (fsf_shared_obj_handle_t obj_handle, |
||
113 | fsf_preemption_level_t *preemption_level); |
||
114 | |||
115 | |||
116 | |||
117 | #endif // _FSF_IMPLEMENTATION_SPECIFIC_H_ |