Subversion Repositories shark

Rev

Rev 2 | 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
 CVS :        $Id: timer.h,v 1.1.1.1 2002-03-29 14:12:49 pj Exp $
24
 
25
 File:        $File$
26
 Revision:    $Revision: 1.1.1.1 $
27
 Last update: $Date: 2002-03-29 14:12:49 $
28
 ------------
29
**/
30
 
31
/*
32
 * Copyright (C) 2000 Paolo Gai, Luca Abeni
33
 *
34
 * This program is free software; you can redistribute it and/or modify
35
 * it under the terms of the GNU General Public License as published by
36
 * the Free Software Foundation; either version 2 of the License, or
37
 * (at your option) any later version.
38
 *
39
 * This program is distributed in the hope that it will be useful,
40
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
41
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
42
 * GNU General Public License for more details.
43
 *
44
 * You should have received a copy of the GNU General Public License
45
 * along with this program; if not, write to the Free Software
46
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
47
 *
48
 */
49
#ifndef __TIMER__
50
#define __TIMER__
51
 
52
#include <kernel/kern.h>
53
#include <linux/compatib.h>
54
 
55
/*
56
 * This is completely separate from the above, and is the
57
 * "new and improved" way of handling timers more dynamically.
58
 * Hopefully efficient and general enough for most things.
59
 *
60
 * The "hardcoded" timers above are still useful for well-
61
 * defined problems, but the timer-list is probably better
62
 * when you need multiple outstanding timers or similar.
63
 *
64
 * The "data" field is in case you want to use the same
65
 * timeout function for several timeouts. You can use this
66
 * to distinguish between the different invocations.
67
 */
68
struct timer_list {
69
        struct timer_list *next;
70
        struct timer_list *prev;
71
        unsigned long expires;
72
        unsigned long data;
73
        void (*function)(unsigned long);
74
        PID pid;
75
        char Signat;
76
};
77
 
78
extern inline void init_timer(struct timer_list * timer)
79
{
80
        timer->next = NULL;
81
        timer->prev = NULL;
82
}
83
 
84
int add_timer(struct timer_list *timer);
85
void del_timer(struct timer_list *timer);
86
 
87
#endif