diff options
author | Jesper Nilsson <jesper.nilsson@axis.com> | 2007-11-14 20:01:23 -0500 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-11-14 21:45:47 -0500 |
commit | d8e5219f9f5ca7518eb820db9f3d287a1d46fcf5 (patch) | |
tree | af996eb526010d0f5106df12de646cc1dd64b29e /include/asm-cris | |
parent | 3244c77bd3460e9701ffeecc2452d7f2ee17106c (diff) |
CRISv10 improve and bugfix fasttimer
Improve and bugfix CRIS v10 fast timers.
- irq_handler_t now only takes two arguments.
- Keep interrupts disabled as long as we have a reference to the
fasttimer list and only enable them while doing the callback.
del_fast_timer may be called from other interrupt context.
- Fix bug where debug code could return without calling local_irq_restore.
- Use jiffies instead of usec (change from struct timeval to fasttime_t).
- Don't initialize static variables to zero.
- Remove obsolete #ifndef DECLARE_WAITQUEUE code.
- fast_timer_init should be __initcall.
- Change status/debug variables to unsigned.
- Remove CVS log and CVS id.
Signed-off-by: Jesper Nilsson <jesper.nilsson@axis.com>
Cc: Mikael Starvik <mikael.starvik@axis.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'include/asm-cris')
-rw-r--r-- | include/asm-cris/fasttimer.h | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/include/asm-cris/fasttimer.h b/include/asm-cris/fasttimer.h index a3a77132ce32..8f8a8d6c9653 100644 --- a/include/asm-cris/fasttimer.h +++ b/include/asm-cris/fasttimer.h | |||
@@ -1,9 +1,8 @@ | |||
1 | /* $Id: fasttimer.h,v 1.3 2004/05/14 10:19:19 starvik Exp $ | 1 | /* |
2 | * linux/include/asm-cris/fasttimer.h | 2 | * linux/include/asm-cris/fasttimer.h |
3 | * | 3 | * |
4 | * Fast timers for ETRAX100LX | 4 | * Fast timers for ETRAX100LX |
5 | * This may be useful in other OS than Linux so use 2 space indentation... | 5 | * Copyright (C) 2000-2007 Axis Communications AB |
6 | * Copyright (C) 2000, 2002 Axis Communications AB | ||
7 | */ | 6 | */ |
8 | #include <linux/time.h> /* struct timeval */ | 7 | #include <linux/time.h> /* struct timeval */ |
9 | #include <linux/timex.h> | 8 | #include <linux/timex.h> |
@@ -12,11 +11,16 @@ | |||
12 | 11 | ||
13 | typedef void fast_timer_function_type(unsigned long); | 12 | typedef void fast_timer_function_type(unsigned long); |
14 | 13 | ||
14 | struct fasttime_t { | ||
15 | unsigned long tv_jiff; /* jiffies */ | ||
16 | unsigned long tv_usec; /* microseconds */ | ||
17 | }; | ||
18 | |||
15 | struct fast_timer{ /* Close to timer_list */ | 19 | struct fast_timer{ /* Close to timer_list */ |
16 | struct fast_timer *next; | 20 | struct fast_timer *next; |
17 | struct fast_timer *prev; | 21 | struct fast_timer *prev; |
18 | struct timeval tv_set; | 22 | struct fasttime_t tv_set; |
19 | struct timeval tv_expires; | 23 | struct fasttime_t tv_expires; |
20 | unsigned long delay_us; | 24 | unsigned long delay_us; |
21 | fast_timer_function_type *function; | 25 | fast_timer_function_type *function; |
22 | unsigned long data; | 26 | unsigned long data; |
@@ -38,6 +42,6 @@ int del_fast_timer(struct fast_timer * t); | |||
38 | void schedule_usleep(unsigned long us); | 42 | void schedule_usleep(unsigned long us); |
39 | 43 | ||
40 | 44 | ||
41 | void fast_timer_init(void); | 45 | int fast_timer_init(void); |
42 | 46 | ||
43 | #endif | 47 | #endif |