@@ -232,7 +232,7 @@ static void stm32_uart_tx_complete(Stm32Uart *s)
232
232
/* Start transmitting a character. */
233
233
static void stm32_uart_start_tx (Stm32Uart * s , uint32_t value )
234
234
{
235
- uint64_t curr_time = qemu_get_clock_ns ( vm_clock );
235
+ uint64_t curr_time = qemu_clock_get_ns ( QEMU_CLOCK_VIRTUAL );
236
236
uint8_t ch = value ; //This will truncate the ninth bit
237
237
238
238
/* Reset the Transmission Complete flag to indicate a transmit is in
@@ -252,7 +252,7 @@ static void stm32_uart_start_tx(Stm32Uart *s, uint32_t value)
252
252
stm32_uart_tx_complete (s );
253
253
#else
254
254
/* Otherwise, start the transmit delay timer. */
255
- qemu_mod_timer (s -> tx_timer , curr_time + s -> ns_per_char );
255
+ timer_mod (s -> tx_timer , curr_time + s -> ns_per_char );
256
256
#endif
257
257
}
258
258
@@ -406,7 +406,7 @@ static void stm32_uart_event(void *opaque, int event)
406
406
static void stm32_uart_receive (void * opaque , const uint8_t * buf , int size )
407
407
{
408
408
Stm32Uart * s = (Stm32Uart * )opaque ;
409
- uint64_t curr_time = qemu_get_clock_ns ( vm_clock );
409
+ uint64_t curr_time = qemu_clock_get_ns ( QEMU_CLOCK_VIRTUAL );
410
410
411
411
assert (size > 0 );
412
412
@@ -434,7 +434,7 @@ static void stm32_uart_receive(void *opaque, const uint8_t *buf, int size)
434
434
#else
435
435
/* Indicate the module is receiving and start the delay. */
436
436
s -> receiving = true;
437
- qemu_mod_timer (s -> rx_timer , curr_time + s -> ns_per_char );
437
+ timer_mod (s -> rx_timer , curr_time + s -> ns_per_char );
438
438
#endif
439
439
}
440
440
@@ -751,9 +751,11 @@ static int stm32_uart_init(SysBusDevice *dev)
751
751
sysbus_init_irq (dev , & s -> irq );
752
752
753
753
s -> rx_timer =
754
- qemu_new_timer_ns (vm_clock ,(QEMUTimerCB * )stm32_uart_rx_timer_expire , s );
754
+ timer_new_ns (QEMU_CLOCK_VIRTUAL ,
755
+ (QEMUTimerCB * )stm32_uart_rx_timer_expire , s );
755
756
s -> tx_timer =
756
- qemu_new_timer_ns (vm_clock ,(QEMUTimerCB * )stm32_uart_tx_timer_expire , s );
757
+ timer_new_ns (QEMU_CLOCK_VIRTUAL ,
758
+ (QEMUTimerCB * )stm32_uart_tx_timer_expire , s );
757
759
758
760
/* Register handlers to handle updates to the USART's peripheral clock. */
759
761
clk_irq =
0 commit comments