mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-06 01:03:55 -06:00
aio / timers: Switch entire codebase to the new timer API
This is an autogenerated patch using scripts/switch-timer-api. Switch the entire code base to using the new timer API. Note this patch may introduce some line length issues. Signed-off-by: Alex Bligh <alex@alex.org.uk> Signed-off-by: Stefan Hajnoczi <stefanha@redhat.com>
This commit is contained in:
parent
fe10ab540b
commit
bc72ad6754
121 changed files with 678 additions and 678 deletions
|
@ -137,7 +137,7 @@ static void alarm_cb (void *opaque)
|
|||
/* Repeat once a second */
|
||||
next_time = 1;
|
||||
}
|
||||
qemu_mod_timer(NVRAM->alrm_timer, qemu_clock_get_ns(rtc_clock) +
|
||||
timer_mod(NVRAM->alrm_timer, qemu_clock_get_ns(rtc_clock) +
|
||||
next_time * 1000);
|
||||
qemu_set_irq(NVRAM->IRQ, 0);
|
||||
}
|
||||
|
@ -146,10 +146,10 @@ static void set_alarm(M48t59State *NVRAM)
|
|||
{
|
||||
int diff;
|
||||
if (NVRAM->alrm_timer != NULL) {
|
||||
qemu_del_timer(NVRAM->alrm_timer);
|
||||
timer_del(NVRAM->alrm_timer);
|
||||
diff = qemu_timedate_diff(&NVRAM->alarm) - NVRAM->time_offset;
|
||||
if (diff > 0)
|
||||
qemu_mod_timer(NVRAM->alrm_timer, diff * 1000);
|
||||
timer_mod(NVRAM->alrm_timer, diff * 1000);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -188,10 +188,10 @@ static void set_up_watchdog(M48t59State *NVRAM, uint8_t value)
|
|||
|
||||
NVRAM->buffer[0x1FF0] &= ~0x80;
|
||||
if (NVRAM->wd_timer != NULL) {
|
||||
qemu_del_timer(NVRAM->wd_timer);
|
||||
timer_del(NVRAM->wd_timer);
|
||||
if (value != 0) {
|
||||
interval = (1 << (2 * (value & 0x03))) * ((value >> 2) & 0x1F);
|
||||
qemu_mod_timer(NVRAM->wd_timer, ((uint64_t)time(NULL) * 1000) +
|
||||
timer_mod(NVRAM->wd_timer, ((uint64_t)time(NULL) * 1000) +
|
||||
((interval * 1000) >> 4));
|
||||
}
|
||||
}
|
||||
|
@ -609,10 +609,10 @@ static void m48t59_reset_common(M48t59State *NVRAM)
|
|||
NVRAM->addr = 0;
|
||||
NVRAM->lock = 0;
|
||||
if (NVRAM->alrm_timer != NULL)
|
||||
qemu_del_timer(NVRAM->alrm_timer);
|
||||
timer_del(NVRAM->alrm_timer);
|
||||
|
||||
if (NVRAM->wd_timer != NULL)
|
||||
qemu_del_timer(NVRAM->wd_timer);
|
||||
timer_del(NVRAM->wd_timer);
|
||||
}
|
||||
|
||||
static void m48t59_reset_isa(DeviceState *d)
|
||||
|
@ -701,7 +701,7 @@ static void m48t59_realize_common(M48t59State *s, Error **errp)
|
|||
s->buffer = g_malloc0(s->size);
|
||||
if (s->model == 59) {
|
||||
s->alrm_timer = timer_new_ns(rtc_clock, &alarm_cb, s);
|
||||
s->wd_timer = qemu_new_timer_ns(vm_clock, &watchdog_cb, s);
|
||||
s->wd_timer = timer_new_ns(QEMU_CLOCK_VIRTUAL, &watchdog_cb, s);
|
||||
}
|
||||
qemu_get_timedate(&s->alarm, 0);
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue