| 1 | /* |
|---|
| 2 | * Copyright (C) 2005 Mike Wray <mike.wray@hp.com> |
|---|
| 3 | * |
|---|
| 4 | * This program is free software; you can redistribute it and/or modify |
|---|
| 5 | * it under the terms of the GNU General Public License as published by the |
|---|
| 6 | * Free Software Foundation; either version 2 of the License, or (at your |
|---|
| 7 | * option) any later version. |
|---|
| 8 | * |
|---|
| 9 | * This program is distributed in the hope that it will be useful, but |
|---|
| 10 | * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY |
|---|
| 11 | * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|---|
| 12 | * for more details. |
|---|
| 13 | * |
|---|
| 14 | * You should have received a copy of the GNU General Public License along |
|---|
| 15 | * with this program; if not, write to the Free software Foundation, Inc., |
|---|
| 16 | * 59 Temple Place, suite 330, Boston, MA 02111-1307 USA |
|---|
| 17 | * |
|---|
| 18 | */ |
|---|
| 19 | |
|---|
| 20 | #ifndef _VNET_TIMER_UTIL_H_ |
|---|
| 21 | #define _VNET_TIMER_UTIL_H_ |
|---|
| 22 | |
|---|
| 23 | #ifdef __KERNEL__ |
|---|
| 24 | |
|---|
| 25 | struct timer_list; |
|---|
| 26 | #define timer_cancel del_timer |
|---|
| 27 | |
|---|
| 28 | #else /* __KERNEL__ */ |
|---|
| 29 | |
|---|
| 30 | #include "timer.h" |
|---|
| 31 | #define timer_list Timer |
|---|
| 32 | #define HZ 1000 |
|---|
| 33 | #define jiffies (unsigned long)(time_now() * HZ) |
|---|
| 34 | #define timer_cancel Timer_cancel |
|---|
| 35 | |
|---|
| 36 | #endif /* __KERNEL__ */ |
|---|
| 37 | |
|---|
| 38 | void timer_init(struct timer_list *timer, void (*fn)(unsigned long), void *data); |
|---|
| 39 | void timer_set(struct timer_list *timer, unsigned long ttl); |
|---|
| 40 | |
|---|
| 41 | #endif /*! _VNET_TIMER_UTIL_H_ */ |
|---|