Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 2913
b: refs/heads/master
c: 55c888d
h: refs/heads/master
i:
  2911: 8c395b8
v: v3
  • Loading branch information
Oleg Nesterov authored and Linus Torvalds committed Jun 23, 2005
1 parent c8458ee commit 87f27c5
Show file tree
Hide file tree
Showing 3 changed files with 167 additions and 193 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: bdd646a44672115c986593956aa4ef105485a184
refs/heads/master: 55c888d6d09a0df236adfaf8ccf06ff5d0646775
30 changes: 9 additions & 21 deletions trunk/include/linux/timer.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,45 +6,33 @@
#include <linux/spinlock.h>
#include <linux/stddef.h>

struct tvec_t_base_s;
struct timer_base_s;

struct timer_list {
struct list_head entry;
unsigned long expires;

spinlock_t lock;
unsigned long magic;

void (*function)(unsigned long);
unsigned long data;

struct tvec_t_base_s *base;
struct timer_base_s *base;
};

#define TIMER_MAGIC 0x4b87ad6e

extern struct timer_base_s __init_timer_base;

#define TIMER_INITIALIZER(_function, _expires, _data) { \
.function = (_function), \
.expires = (_expires), \
.data = (_data), \
.base = NULL, \
.base = &__init_timer_base, \
.magic = TIMER_MAGIC, \
.lock = SPIN_LOCK_UNLOCKED, \
}

/***
* init_timer - initialize a timer.
* @timer: the timer to be initialized
*
* init_timer() must be done to a timer prior calling *any* of the
* other timer functions.
*/
static inline void init_timer(struct timer_list * timer)
{
timer->base = NULL;
timer->magic = TIMER_MAGIC;
spin_lock_init(&timer->lock);
}
void fastcall init_timer(struct timer_list * timer);

/***
* timer_pending - is a timer pending?
Expand All @@ -58,7 +46,7 @@ static inline void init_timer(struct timer_list * timer)
*/
static inline int timer_pending(const struct timer_list * timer)
{
return timer->base != NULL;
return timer->entry.next != NULL;
}

extern void add_timer_on(struct timer_list *timer, int cpu);
Expand Down Expand Up @@ -89,12 +77,12 @@ static inline void add_timer(struct timer_list * timer)

#ifdef CONFIG_SMP
extern int del_timer_sync(struct timer_list *timer);
extern int del_singleshot_timer_sync(struct timer_list *timer);
#else
# define del_timer_sync(t) del_timer(t)
# define del_singleshot_timer_sync(t) del_timer(t)
#endif

#define del_singleshot_timer_sync(t) del_timer_sync(t)

extern void init_timers(void);
extern void run_local_timers(void);
extern void it_real_fn(unsigned long);
Expand Down
Loading

0 comments on commit 87f27c5

Please sign in to comment.