[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 16/20] qidl: Add documentation
From: |
Blue Swirl |
Subject: |
Re: [Qemu-devel] [PATCH 16/20] qidl: Add documentation |
Date: |
Sat, 18 Aug 2012 14:19:00 +0000 |
On Tue, Aug 14, 2012 at 10:20 PM, Peter Maydell
<address@hidden> wrote:
> 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.
Inline syntax could be reused for other markup, like sparse or clang.
>
> -- PMM
- [Qemu-devel] [PATCH 15/20] qdev: move Property-related declarations to qdev-properties.h, (continued)
- [Qemu-devel] [PATCH 15/20] qdev: move Property-related declarations to qdev-properties.h, Michael Roth, 2012/08/14
- [Qemu-devel] [PATCH 14/20] module additions for schema registration, Michael Roth, 2012/08/14
- [Qemu-devel] [PATCH 17/20] qidl: parser, initial import from qc.git, Michael Roth, 2012/08/14
- [Qemu-devel] [PATCH 19/20] qidl: qidl.h, definitions for qidl annotations, Michael Roth, 2012/08/14
- [Qemu-devel] [PATCH 18/20] qidl: codegen, initial commit, Michael Roth, 2012/08/14
- [Qemu-devel] [PATCH 16/20] qidl: Add documentation, Michael Roth, 2012/08/14
[Qemu-devel] [PATCH 20/20] qidl: unit tests, Michael Roth, 2012/08/14