qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] Memory API: handling unassigned physical memory


From: Anthony Liguori
Subject: Re: [Qemu-devel] Memory API: handling unassigned physical memory
Date: Tue, 01 May 2012 09:06:54 -0500
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:11.0) Gecko/20120329 Thunderbird/11.0.1

On 05/01/2012 09:00 AM, Peter Maydell wrote:
On 1 May 2012 14:50, Anthony Liguori<address@hidden>  wrote:
On 05/01/2012 03:49 PM, Peter Maydell wrote:
When QOM supports (1) exporting gpio signals and

This is trivial.  It'll come in as soon as 1.2 opens up.

You need to get it through code review first...

Obviously.


(just as a random example, this commit:
https://github.com/aliguori/qemu/commit/46483049813fca2c23fb7cd04eeab89905500c4c
is going down the wrong path because it's incorrectly introducing
knowledge of device internals to the utility i8259_init()
function.)

Eh?

Do you mean:

-    qdev_connect_gpio_out(&dev->qdev, 0, irq_set[2]);
+    pin_connect_qemu_irq(&s->int_out[0], irq_set[2]);

There are three ways to do this:

1) pin_connect_qemu_irq(i8259_get_int_out(s), irq_set[2]);

2) pin_connect_qemu_irq(&s->int_out[0], irq_set[2]);

3) pin_connect_qemu_irq(PIN(object_get_child(s, "int_out[0]")), irq_set[2]);

Having converted a lot of devices by hand, I prefer (2). I'd like to move to a model of:

typedef struct PICDevice
{
    DeviceState parent;

    Pin int_out[0];
    MemoryRegion io;

    /*< private >*/
    PICState *priv;
} PICDevice;

This let's us use (2), while still embedding devices and keeping the gory state details private to the implementation.

Regards,

Anthony Liguori


-- PMM




reply via email to

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