Subversion Repositories shark

Rev

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

Rev Author Line No. Line
2 pj 1
/*
2
 * Project: S.Ha.R.K.
3
 *
4
 * Coordinators:
5
 *   Giorgio Buttazzo    <giorgio@sssup.it>
6
 *   Paolo Gai           <pj@gandalf.sssup.it>
7
 *
8
 * Authors     :
9
 *   Paolo Gai           <pj@gandalf.sssup.it>
10
 *   Massimiliano Giorgi <massy@gandalf.sssup.it>
11
 *   Luca Abeni          <luca@gandalf.sssup.it>
12
 *   (see the web pages for full authors list)
13
 *
14
 * ReTiS Lab (Scuola Superiore S.Anna - Pisa - Italy)
15
 *
16
 * http://www.sssup.it
17
 * http://retis.sssup.it
18
 * http://shark.sssup.it
19
 */
20
 
21
 
22
/**
23
 ------------
24
 CVS :        $Id: ssutils.h,v 1.1.1.1 2002-03-29 14:12:51 pj Exp $
25
 
26
 File:        $File$
27
 Revision:    $Revision: 1.1.1.1 $
28
 Last update: $Date: 2002-03-29 14:12:51 $
29
 ------------
30
 
31
 This file contains utility functions used into
32
 aperiodic server SS (Sporadic Server)
33
 
34
 Title:
35
   SS (Sporadic Server) utilities
36
 
37
**/
38
 
39
/*
40
 * Copyright (C) 2000 Paolo Gai
41
 *
42
 * This program is free software; you can redistribute it and/or modify
43
 * it under the terms of the GNU General Public License as published by
44
 * the Free Software Foundation; either version 2 of the License, or
45
 * (at your option) any later version.
46
 *
47
 * This program is distributed in the hope that it will be useful,
48
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
49
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
50
 * GNU General Public License for more details.
51
 *
52
 * You should have received a copy of the GNU General Public License
53
 * along with this program; if not, write to the Free Software
54
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
55
 *
56
 */
57
 
58
 
59
#ifndef __SSUTILS_H__
60
#define __SSUTILS_H__
61
 
62
#include <kernel/config.h>
63
#include <sys/types.h>
64
#include <kernel/types.h>
65
 
66
/* Max size of replenish queue */
67
#define SS_MAX_REPLENISH MAX_EVENT
68
 
69
/*+ Used to store replenishment events +*/
70
/* Now we use static allocated array. In this way, no more then
71
   SS_MAX_REPLENISH replenishments can be posted.
72
typedef struct {
73
        struct timespec rtime;
74
        int ramount;
75
        replenishq *next;
76
} replenishq;
77
*/
78
 
79
/*+ SS local memory allocator.
80
    Can be used for performance optimization. +*/
81
void *ss_alloc(DWORD b);
82
 
83
/*+ Insert an element at tail of replenish queue
84
        LEVEL l                 module level
85
        int   amount            element to insert
86
 
87
        RETURNS:
88
 
89
          NIL   no more space for insertion +*/
90
int ssq_inslast(LEVEL l, int amount);
91
 
92
/*+ Get first element from replenish queue
93
        LEVEL l         module level
94
 
95
        RETURS: extracted element +*/
96
int ssq_getfirst(LEVEL l);
97
 
98
/*+ Enquire for empty queue
99
        LEVEL l         module level
100
 
101
        RETURS:
102
 
103
          1     queue is empty +*/
104
int ssq_isempty(LEVEL l);
105
 
106
#endif