qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 16/20] qidl: Add documentation


From: Peter Maydell
Subject: Re: [Qemu-devel] [PATCH 16/20] qidl: Add documentation
Date: Tue, 14 Aug 2012 23:20:19 +0100

On 14 August 2012 23:15, Michael Roth <address@hidden> wrote:
> On Tue, Aug 14, 2012 at 08:41:56PM +0100, Peter Maydell wrote:
>> On 14 August 2012 17:27, Michael Roth <address@hidden> wrote:
>> > +In our *SerialDevice* example, the *CharDriverState* pointer reflects the 
>> > host
>> > +backend that we use to send serial output to the user.  This is only 
>> > assigned
>> > +during device construction and never changes.  This means we can add an
>> > +**immutable** marker to it:
>> > +
>> > +    QIDL_START(SerialDevice, state)
>> > +    typedef struct SerialDevice {
>> > +        SysBusDevice parent;
>> > +
>> > +        uint8_t thr;            // transmit holding register
>> > +        uint8_t lsr;            // line status register
>> > +        uint8_t ier;            // interrupt enable register
>> > +
>> > +        int int_pending;        // whether we have a pending queued 
>> > interrupt
>> > +        CharDriverState *chr QIDL(immutable);
>> > +    } SerialDevice;
>> > +    QIDL_END(SerialDevice)
>>
>> I think it would be nicer to have a QIDL input format from which the 
>> structure
>> is generated as one of the outputs; that would avoid having to have some of
>> this ugly QIDL() markup.
>
> Some kind of inline/embedded input format, or external (like QAPI
> schemas)?

External, I think. I just kinda feel in the long run it's going to be cleaner
and more flexible to have a defined syntax we generate things from
rather than trying to mark up C.

-- PMM



reply via email to

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