qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* hw/clock: What clock rate for virt machines?
@ 2020-09-02 16:35 Philippe Mathieu-Daudé
  2020-09-02 16:49 ` Peter Maydell
  0 siblings, 1 reply; 8+ messages in thread
From: Philippe Mathieu-Daudé @ 2020-09-02 16:35 UTC (permalink / raw)
  To: Damien Hedde, Peter Maydell, Alistair Francis
  Cc: Paolo Bonzini, qemu-devel, Michael S. Tsirkin

Hi,

Peter said "'clock' is basically meaningless for virt machines",

I understand and agree. But how to make that explicit/obvious in
the code, when a device expects a clock frequency/period?

Should we use 0/UINT_MAX for this case? Use an explicit definition?

  #define CLOCK_MEANINGLESS_FREQUENCY_HZ UINT_MAX

Or maybe simpler:

  #define CLOCK_MEANINGLESS_VALUE 0

But the special 0 value could be used to describe a stopped clock.

See for example hw/riscv/virt.c, it uses the following (confusing
to me) in virt_machine_init():

   serial_mm_init(system_memory, memmap[VIRT_UART0].base,
       0, qdev_get_gpio_in(DEVICE(mmio_plic), UART0_IRQ), 399193,
       serial_hd(0), DEVICE_LITTLE_ENDIAN);

Thanks,

Phil.


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2020-09-05  1:48 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-09-02 16:35 hw/clock: What clock rate for virt machines? Philippe Mathieu-Daudé
2020-09-02 16:49 ` Peter Maydell
2020-09-02 17:03   ` Philippe Mathieu-Daudé
2020-09-02 17:09     ` Philippe Mathieu-Daudé
2020-09-02 18:18     ` Peter Maydell
2020-09-02 19:40       ` Philippe Mathieu-Daudé
2020-09-04 17:52         ` Alistair Francis
2020-09-05  1:47           ` Palmer Dabbelt

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).