qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: VMState in QEMU


From: Peter Maydell
Subject: Re: VMState in QEMU
Date: Mon, 20 Jul 2020 14:40:55 +0100

On Mon, 20 Jul 2020 at 11:59, Pratik Parvati <pratikp@vayavyalabs.com> wrote:
> Is it mandatory to define the state of each device? Like, for example, I am 
> referring hw/arm/versatilepb.c; I see the VMState is defined for sic 
> (secondary interrupt controller) Whereas VMState is not defined for PL011 
> UART device.

The PL011 does have VMState: it is in hw/char/pl011.c,
struct "vmstate_pl011". Generally the vmstate struct for
each device is in the source file where that device
is implemented. The SIC device is implemented in
the same versatilepb.c source file that the board model
is implemented in because it happens to be a simple
device used only by that one board, and so the SIC device's
vmstate is also in that source file. (The other reason
that the SIC device is in the versatile board's source
file is because it's quite old code -- these days we'd probably
put it in its own source file in hw/intc, but the coding style
back when that file was written over a decade ago was
different and devices often got put in the same
source file as the board model.)

thanks
-- PMM



reply via email to

[Prev in Thread] Current Thread [Next in Thread]