]> rtime.felk.cvut.cz Git - frescor/frsh-include.git/blob - frsh_ss.h
git-svn-id: http://www.frescor.org/private/svn/frescor/frsh/trunk/include@252 35b4ef3...
[frescor/frsh-include.git] / frsh_ss.h
1 //  ----------------------------------------------------------------------
2 //   Copyright (C) 2005   Universidad de Cantabria, SPAIN
3 //
4 //   FRSH/MaRTE OS web page: http://marte.unican.es/frsh
5 //   Contact Addresses: Julio Luis Medina Pasaje        medinajl@unican.es
6 //                      Michael González Harbour             mgh@unican.es
7 //
8 //  FRSH/MaRTE OS is free software; you can  redistribute it and/or  modify
9 //  it under the terms of  the GNU General Public License  as published by
10 //  the Free Software Foundation;  either  version 2, or (at  your option)
11 //  any later version.
12 //
13 //  FRSH/MaRTE OS  is distributed  in the  hope that it will be useful, but
14 //  WITHOUT  ANY  WARRANTY;     without  even the   implied   warranty  of
15 //  MERCHANTABILITY  or  FITNESS FOR A  PARTICULAR PURPOSE.    See the GNU
16 //  General Public License for more details.
17 //
18 //  You should have received  a  copy of  the  GNU General Public  License
19 //  distributed with MaRTE  OS;  see file COPYING.   If not,  write to the
20 //  Free Software  Foundation,  59 Temple Place  -  Suite 330,  Boston, MA
21 //  02111-1307, USA.
22 //
23 //  As a  special exception, if you  link this  unit  with other  files to
24 //  produce an   executable,   this unit  does  not  by  itself cause  the
25 //  resulting executable to be covered by the  GNU General Public License.
26 //  This exception does  not however invalidate  any other reasons why the
27 //  executable file might be covered by the GNU Public License.
28 //
29 // -----------------------------------------------------------------------
30 // prototypes for functions used in frsh_scheduler.c
31 // which implement the sporadic server functionality
32 // file: frsh_ss.h
33 // by: Julio Medina
34 // on: december 2003
35 //3 roundrobin background scheduling: jan 2005
36
37 #ifndef _FRSH_SS_H_
38 #define _FRSH_SS_H_
39
40 #include "frsh_types.h"
41
42 //3 Round robin background functions
43
44 int
45 frsh_to_background(frsh_sched_data_t         *frsh,
46                   int                       thread_index,
47                   posix_appsched_actions_t *actions,
48                   frsh_server_id_t           is_a_fresh_thread,
49                   frsh_server_id_t           is_a_generic_bind);
50
51 int 
52 frsh_to_foreground(frsh_sched_data_t         *frsh,
53                   frsh_server_data_t        *server,
54                   frsh_thread_data_t        *the_thread);
55
56 int
57 frsh_rr_schedule_next(frsh_sched_data_t         *frsh,
58                      posix_appsched_actions_t *actions);
59
60
61
62 //launch a new job in a server that is waiting in a synchronization object,
63 //it is called in response to the frsh_signal_synchobject function and also
64 //in response to the frsh_destroy_synchobject function, when the synch_object
65 //to destroy has servers waiting.
66 int
67 frsh_signal_server(frsh_sched_data_t *frsh,
68                   int               server_index);
69
70 // This function performs an activation of the sporadic server
71 int
72 frsh_ss_activation ( frsh_sched_data_t         *frsh,
73                     frsh_server_data_t        *server,
74                     struct timespec           now,
75                     posix_appsched_actions_t *actions);
76
77 //Assign reply data 
78 int
79 frsh_reply_data(frsh_server_data_t  *server,
80                frsh_out_msg_t      *reply);
81                
82 // This function is called when a new job is to be activated
83 int
84 frsh_new_job ( frsh_sched_data_t         *frsh,
85               frsh_server_data_t        *server,
86               struct timespec           now,
87               posix_appsched_actions_t *actions,
88               frsh_out_msg_t            *reply);
89
90 //annotate a replenishment operation in the list
91 int
92 frsh_schedule_replenishment(frsh_server_data_t *server, int kind);
93
94 //do replenish the sporadic server 
95 int
96 frsh_ss_replenish (frsh_sched_data_t      *frsh,
97                frsh_server_data_t        *server,
98                struct timespec           now,
99                posix_appsched_actions_t *actions,
100                frsh_out_msg_t            *reply);
101
102 #endif // _FRSH_SS_H_