qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 15/21] qom: add Device class


From: Anthony Liguori
Subject: Re: [Qemu-devel] [PATCH 15/21] qom: add Device class
Date: Wed, 27 Jul 2011 11:07:12 -0500
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.17) Gecko/20110516 Lightning/1.0b2 Thunderbird/3.1.10

On 07/27/2011 10:10 AM, Peter Maydell wrote:
On 25 July 2011 02:44, Anthony Liguori<address@hidden>  wrote:
Device is meant to replace DeviceState as the root class for the device model.
This is included here merely as a RFC.  Device adds a couple of useful features.

1) Default hard reset.  Device will literally call finalize on the object and
   then reinitialize it in place.  This means that most devices don't have to
   worry about implementing reset logic.

I like having a reset implemented as "just reinstantiate everything", but
this only really covers one of the different reset flavours ("simulation
reset", ie "give me a system in the same state as if I'd just started
qemu from scratch"). I think devices are still going to need to implement
"simulated reset", which is what they do when the core causes a simulated
reset signal to go active (and which ought really to be implemented by
having an incoming gpio signal 'reset').

reset is implemented as an edge of the realized property which is basically a pin.

I view realized as the Vcc pin. In fact, I named it as such originally but thought that was too obscure :-)

realize() is when Vcc goes high, unrealize/reset is when Vcc goes low. In terms of the very base Device class, there really is only one Vcc pin. For other types of devices, there might be multiple types of pins that have reset semantics.

The two are not always identical,
and you don't necessarily want to reset the whole of the model at once...
(And then some devices have another level of 'soft reset' which you get
by writing to one of its registers.)

...all of which isn't particularly relevant to the object/device model,
but I just wanted to say "reset isn't quite that simple" :-)

Am very well aware, and tried to accommodate this. It's not modelled as a Pin because a Pin is a Device and it turns out that the notion of realized is also useful for non-Device objects.

Regards,

Anthony Liguori

-- PMM





reply via email to

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