On 30 April 2012 15:33, Mark Cave-Ayland <mark.cave-ayl...@ilande.co.uk> wrote:
> On 30/04/12 15:03, Peter Maydell wrote:
> Right I think I'm starting to understand this now - in which case it becomes
> a matter of just copying a handful of lines within sun4m which is more
> bearable.
> In your view, would a suitable fix be to change dma_memory_read,
> dma_memory_write, dma_opaque, it_shift and dma_enabled to be qdev properties
> and modify esp_init() to return the qdev reference so they can be set by the
> caller?

They should be some kind of qdev property, probably. Since you can't
change a property after the qdev_init there's not much point changing
esp_init to return the DeviceState*, though.

(Disclaimer: I'm not sure what the best QOM/qdev practice is for "here
is a set of function pointers". In my ideal world this would be done
by setting a single strongly typed qdev property which encapsulates
the idea of "here is a connection into which you can plug something
that satisfies this dma read/write API".)

-- PMM

Reply via email to