Go to most recent revision | Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
961 | 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 2005-02-25 10:55:09 pj Exp $ |
||
25 | |||
26 | File: $File$ |
||
27 | Revision: $Revision: 1.1 $ |
||
28 | Last update: $Date: 2005-02-25 10:55:09 $ |
||
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 | #include "ll/sys/cdefs.h" |
||
66 | |||
67 | __BEGIN_DECLS |
||
68 | |||
69 | /* Max size of replenish queue */ |
||
70 | #define SS_MAX_REPLENISH MAX_EVENT |
||
71 | |||
72 | /*+ Used to store replenishment events +*/ |
||
73 | /* Now we use static allocated array. In this way, no more then |
||
74 | SS_MAX_REPLENISH replenishments can be posted. |
||
75 | typedef struct { |
||
76 | struct timespec rtime; |
||
77 | int ramount; |
||
78 | replenishq *next; |
||
79 | } replenishq; |
||
80 | */ |
||
81 | |||
82 | /*+ SS local memory allocator. |
||
83 | Can be used for performance optimization. +*/ |
||
84 | void *ss_alloc(DWORD b); |
||
85 | |||
86 | /*+ Insert an element at tail of replenish queue |
||
87 | LEVEL l module level |
||
88 | int amount element to insert |
||
89 | |||
90 | RETURNS: |
||
91 | |||
92 | NIL no more space for insertion +*/ |
||
93 | int ssq_inslast(LEVEL l, int amount); |
||
94 | |||
95 | /*+ Get first element from replenish queue |
||
96 | LEVEL l module level |
||
97 | |||
98 | RETURS: extracted element +*/ |
||
99 | int ssq_getfirst(LEVEL l); |
||
100 | |||
101 | /*+ Enquire for empty queue |
||
102 | LEVEL l module level |
||
103 | |||
104 | RETURS: |
||
105 | |||
106 | 1 queue is empty +*/ |
||
107 | int ssq_isempty(LEVEL l); |
||
108 | |||
109 | __END_DECLS |
||
110 | #endif |