Revision 0ce1b948
b/qemu-timer.h | ||
---|---|---|
12 | 12 |
|
13 | 13 |
/* timers */ |
14 | 14 |
|
15 |
#define SCALE_MS 1000000 |
|
16 |
#define SCALE_US 1000 |
|
17 |
#define SCALE_NS 1 |
|
18 |
|
|
15 | 19 |
typedef struct QEMUClock QEMUClock; |
16 | 20 |
typedef void QEMUTimerCB(void *opaque); |
17 | 21 |
|
... | ... | |
54 | 58 |
int init_timer_alarm(void); |
55 | 59 |
void quit_timers(void); |
56 | 60 |
|
61 |
static inline QEMUTimer *qemu_new_timer_ns(QEMUClock *clock, QEMUTimerCB *cb, |
|
62 |
void *opaque) |
|
63 |
{ |
|
64 |
assert(clock != rt_clock); |
|
65 |
return qemu_new_timer(clock, cb, opaque); |
|
66 |
} |
|
67 |
|
|
68 |
static inline QEMUTimer *qemu_new_timer_ms(QEMUClock *clock, QEMUTimerCB *cb, |
|
69 |
void *opaque) |
|
70 |
{ |
|
71 |
assert(clock == rt_clock); |
|
72 |
return qemu_new_timer(clock, cb, opaque); |
|
73 |
} |
|
74 |
|
|
75 |
static inline int64_t qemu_get_clock_ms(QEMUClock *clock) |
|
76 |
{ |
|
77 |
return qemu_get_clock_ns(clock) / SCALE_MS; |
|
78 |
} |
|
79 |
|
|
57 | 80 |
static inline int64_t get_ticks_per_sec(void) |
58 | 81 |
{ |
59 | 82 |
return 1000000000LL; |
Also available in: Unified diff