Subversion Repositories shark

Rev

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

Rev Author Line No. Line
1063 tullio 1
 
2
/*
3
 * This program is free software; you can redistribute it and/or modify
4
 * it under the terms of the GNU General Public License as published by
5
 * the Free Software Foundation; either version 2 of the License, or
6
 * (at your option) any later version.
7
 *
8
 * This program is distributed in the hope that it will be useful,
9
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
11
 * GNU General Public License for more details.
12
 *
13
 * You should have received a copy of the GNU General Public License
14
 * along with this program; if not, write to the Free Software
15
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
16
 *
17
 */
18
 
985 julio 19
//fsf_implementation_specific.h
20
//===================================================
21
//       FFFFFFIII   RRRRR      SSTTTTTTT
22
//      FF         IIR   RR    SS
23
//     FF           IR        SS
24
//    FFFFFF         RRRR    SSSSST
25
//   FF       FI       RRR  SS
26
//  FF         II     RRR  SS
27
// FF           IIIIIR    RS
28
//
29
// FSF(FIRST Scheduling Framework) 
30
//implementation-defined optional functionality
31
//================================================
32
 
33
#include "fsf_basic_types.h"
34
#include "fsf_core.h"
35
 
36
 
37
#ifndef _FSF_IMPLEMENTATION_SPECIFIC_H_
38
#define _FSF_IMPLEMENTATION_SPECIFIC_H_
39
 
40
#define FSF_IMPLEMENTATION_SPECIFIC_MODULE_SUPPORTED     1
41
 
42
 
43
// The operations defined in this module are of optional use. They
44
// only work in the fixed priority implementation, and they may be
45
// used to enhance the behavior of the applications running under the
46
// fsf scheduler.
47
 
48
//// The definition of this type is in fsf_basic_types.h
49
//
50
//typedef unsigned long      fsf_preemption_level_t;
51
//                           // range 1..2**32-1
52
 
53
 
54
//fsf_set_contract_preemption_level: The operation updates the
55
//specified contract parameters object by setting its preemption level
56
//to the specified input parameter.
57
 
58
int
59
fsf_set_contract_preemption_level
60
  (fsf_contract_parameters_t     *contract,
61
   fsf_preemption_level_t         preemption_level);
62
 
63
 
64
//fsf_get_contract_preemption_level: The operation obtains from the
65
//specified contract parameters object its preemption level and copies
66
//it to the place pointed to by the specified input parameter.
67
 
68
int
69
fsf_get_contract_preemption_level
70
  (const fsf_contract_parameters_t *contract,
71
   fsf_preemption_level_t          *preemption_level);
72
 
73
 
74
//fsf_set_service_thread_preemption_level: this function sets the
75
//preemption level of the service thread to the specified value. The
997 julio 76
//initial preemption level is a configurable parameter. This value
77
//is stored in a temporary variable and it is used the next time the
78
//service thread data is updated with the fsf_set_service_thread_data
79
//function
985 julio 80
 
81
int
82
fsf_set_service_thread_preemption_level
83
  (fsf_preemption_level_t         preemption_level);
84
 
85
//fsf_get_service_thread_preemption_level: this function stores the
86
//current preemption level of the service thread in the variable
87
//pointed to by preemption_level
88
 
89
int
90
fsf_get_service_thread_preemption_level
91
  (fsf_preemption_level_t        *preemption_level);
92
 
93
 
94
//fsf_thread_exit: There is a limitation in the current version of the
95
//MaRTE implementation that causes the information of a terminated
96
//thread to continue to be stored in the fsf scheduler, and the thread
97
//to continue to be counted in the number of threads. The
98
//fsf_thread_exit operation allows the implementation to delete the
99
//thread's information, and then terminate the thread. Therefore, it
100
//is recommended to use this function to terminate a thread under fsf.
101
 
102
//This operation shall terminate the calling thread, make the value
103
//value_ptr available to any successful join with the terminating
104
//thread, and unbind the thread from its associated server. After
105
//cleaning up the thread management data, it is unbound and the
106
//scheduling policy is changed to fixed priority before the posix
107
//pthread_exit() function is called.
108
 
109
void
110
fsf_thread_exit (void *value_ptr);
111
 
112
 
113
//fsf_set_shared_obj_preemption_level: The operation updates the
114
//specified shared object by setting its preemption level
115
//to the specified input parameter. 
116
//OBSERVATION: if this value is changed being any contract that
117
//uses the resource already accepted, the system's behavior and
118
//particularly the acceptance tests correctness are not garantee
119
//and probably wrong.
120
 
121
int
122
fsf_set_shared_obj_preemption_level
123
  (fsf_shared_obj_handle_t  obj_handle,
124
   fsf_preemption_level_t   preemption_level);
125
 
126
 
127
//fsf_get_shared_obj_preemption_level: The operation obtains from the
128
//specified shared object its preemption level and copies
129
//it to the place pointed to by the specified input parameter.
130
 
131
int
132
fsf_get_shared_obj_preemption_level
133
  (fsf_shared_obj_handle_t  obj_handle,
134
   fsf_preemption_level_t  *preemption_level);
135
 
136
 
137
 
138
#endif // _FSF_IMPLEMENTATION_SPECIFIC_H_