aboutsummaryrefslogtreecommitdiff
path: root/hw/char/sifive_uart.c
diff options
context:
space:
mode:
Diffstat (limited to 'hw/char/sifive_uart.c')
-rw-r--r--hw/char/sifive_uart.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/hw/char/sifive_uart.c b/hw/char/sifive_uart.c
index b45e6c0..9bc697a 100644
--- a/hw/char/sifive_uart.c
+++ b/hw/char/sifive_uart.c
@@ -128,8 +128,10 @@ static void sifive_uart_write_tx_fifo(SiFiveUARTState *s, const uint8_t *buf,
s->txfifo |= SIFIVE_UART_TXFIFO_FULL;
}
- timer_mod(s->fifo_trigger_handle, current_time +
- TX_INTERRUPT_TRIGGER_DELAY_NS);
+ if (!timer_pending(s->fifo_trigger_handle)) {
+ timer_mod(s->fifo_trigger_handle, current_time +
+ TX_INTERRUPT_TRIGGER_DELAY_NS);
+ }
}
static uint64_t
@@ -334,7 +336,7 @@ static const VMStateDescription vmstate_sifive_uart = {
};
-static void sifive_uart_class_init(ObjectClass *oc, void *data)
+static void sifive_uart_class_init(ObjectClass *oc, const void *data)
{
DeviceClass *dc = DEVICE_CLASS(oc);
ResettableClass *rc = RESETTABLE_CLASS(oc);