Subversion Repositories shark

Rev

Rev 1618 | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
629 giacomo 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 2004-05-11 14:32:02 giacomo Exp $
24
 
25
 File:        $File$
26
 Revision:    $Revision: 1.1 $
27
 Last update: $Date: 2004-05-11 14:32:02 $
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 <time.h>
54
#include <linux/compatib.h>
1621 fabio 55
#include <arch/sys/cdefs.h>
629 giacomo 56
 
57
__BEGIN_DECLS
58
 
59
/*
60
 * This is completely separate from the above, and is the
61
 * "new and improved" way of handling timers more dynamically.
62
 * Hopefully efficient and general enough for most things.
63
 *
64
 * The "hardcoded" timers above are still useful for well-
65
 * defined problems, but the timer-list is probably better
66
 * when you need multiple outstanding timers or similar.
67
 *
68
 * The "data" field is in case you want to use the same
69
 * timeout function for several timeouts. You can use this
70
 * to distinguish between the different invocations.
71
 */
72
/*struct timer_list {
73
        struct timer_list *next;
74
        struct timer_list *prev;
75
        unsigned long expires;
76
        unsigned long data;
77
        void (*function)(unsigned long);
78
        PID pid;
79
        char Signat;
80
        time_t sharktimer;
81
        int event_timer;
82
 
83
}; Changeed by Nino*/
84
struct list_head {
85
        struct list_head *next, *prev;
86
};
87
 
88
struct timer_list {
89
        struct list_head entry;
90
        unsigned long expires;
91
 
92
        spinlock_t lock;
93
        unsigned long magic;
94
 
95
        void (*function)(unsigned long);
96
        unsigned long data;
97
 
98
        struct tvec_t_base_s *base;
99
 
100
        /* Added by Nino */
101
        int event_timer;
102
};
103
 
104
/*extern inline void init_timer(struct timer_list * timer)
105
{
106
        timer->next = NULL;
107
        timer->prev = NULL;
108
}
109
*/
110
void init_timer(struct timer_list * timer);
111
void mod_timer(struct timer_list *timer, unsigned long expires);
112
int add_timer(struct timer_list *timer);
113
void del_timer(struct timer_list *timer);
114
__END_DECLS
115
#endif