XenevaOS
Loading...
Searching...
No Matches
Classes | Macros | Variables
timer.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  timer_list
 

Macros

#define HZ   250 /* ticks per second — tune to your timer IRQ */
 
#define msecs_to_jiffies(ms)   ((ms) * HZ / 1000)
 
#define jiffies_to_msecs(j)   ((j) * 1000 / HZ)
 
#define time_after(a, b)   ((long)((b) - (a)) < 0)
 
#define time_before(a, b)   time_after(b, a)
 
#define time_after_eq(a, b)   ((long)((a) - (b)) >= 0)
 
#define timer_setup(t, fn, flags)
 
#define setup_timer(t, fn, data)
 
#define from_timer(var, callback_timer, timer_fieldname)    container_of(callback_timer, typeof(*var), timer_fieldname)
 

Variables

volatile unsigned long jiffies
 

Macro Definition Documentation

◆ from_timer

#define from_timer (   var,
  callback_timer,
  timer_fieldname 
)     container_of(callback_timer, typeof(*var), timer_fieldname)

◆ HZ

#define HZ   250 /* ticks per second — tune to your timer IRQ */

◆ jiffies_to_msecs

#define jiffies_to_msecs (   j)    ((j) * 1000 / HZ)

◆ msecs_to_jiffies

#define msecs_to_jiffies (   ms)    ((ms) * HZ / 1000)

◆ setup_timer

#define setup_timer (   t,
  fn,
  data 
)
Value:
do { \
(t)->function = (void(*)(struct timer_list*))(fn); \
(t)->data = (void*)(data); \
(t)->pending = 0; \
} while (0)
XETime t
Definition main.cpp:53
Definition timer.h:1
void * data
Definition timer.h:4
int pending
Definition timer.h:5

◆ time_after

#define time_after (   a,
 
)    ((long)((b) - (a)) < 0)

◆ time_after_eq

#define time_after_eq (   a,
 
)    ((long)((a) - (b)) >= 0)

◆ time_before

#define time_before (   a,
 
)    time_after(b, a)

◆ timer_setup

#define timer_setup (   t,
  fn,
  flags 
)
Value:
do { \
(t)->function = (fn); \
(t)->pending = 0; \
(t)->data = NULL; \
(t)->expires = 0; \
} while (0)
#define NULL
Definition actypes.h:561

Variable Documentation

◆ jiffies

volatile unsigned long jiffies
extern