OpenCores
URL https://opencores.org/ocsvn/or1k/or1k/trunk

Subversion Repositories or1k

[/] [or1k/] [trunk/] [linux/] [linux-2.4/] [net/] [bridge/] [br_private_timer.h] - Blame information for rev 1774

Go to most recent revision | Details | Compare with Previous | View Log

Line No. Rev Author Line
1 1275 phoenix
/*
2
 *      Linux ethernet bridge
3
 *
4
 *      Authors:
5
 *      Lennert Buytenhek               <buytenh@gnu.org>
6
 *
7
 *      $Id: br_private_timer.h,v 1.1.1.1 2004-04-15 01:16:26 phoenix Exp $
8
 *
9
 *      This program is free software; you can redistribute it and/or
10
 *      modify it under the terms of the GNU General Public License
11
 *      as published by the Free Software Foundation; either version
12
 *      2 of the License, or (at your option) any later version.
13
 */
14
 
15
#ifndef _BR_PRIVATE_TIMER_H
16
#define _BR_PRIVATE_TIMER_H
17
 
18
struct br_timer
19
{
20
        int running;
21
        unsigned long expires;
22
};
23
 
24
extern __inline__ void br_timer_clear(struct br_timer *t)
25
{
26
        t->running = 0;
27
}
28
 
29
extern __inline__ unsigned long br_timer_get_residue(struct br_timer *t)
30
{
31
        if (t->running)
32
                return jiffies - t->expires;
33
 
34
        return 0;
35
}
36
 
37
extern __inline__ void br_timer_set(struct br_timer *t, unsigned long x)
38
{
39
        t->expires = x;
40
        t->running = 1;
41
}
42
 
43
extern __inline__ int br_timer_is_running(struct br_timer *t)
44
{
45
        return t->running;
46
}
47
 
48
extern __inline__ int br_timer_has_expired(struct br_timer *t, unsigned long to)
49
{
50
        return t->running && time_after_eq(jiffies, t->expires + to);
51
}
52
 
53
 
54
#endif

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.