From: Ian Campbell <ian.campbell@citrix.com>
To: Rob Hoes <Rob.Hoes@citrix.com>
Cc: Dave Scott <Dave.Scott@citrix.com>, Wei Liu <wei.liu2@citrix.com>,
Julien Grall <julien.grall@citrix.com>,
Euan Harris <euan.harris@citrix.com>,
Stefano Stabellini <Stefano.Stabellini@citrix.com>,
Ian Jackson <Ian.Jackson@citrix.com>,
"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Subject: Re: [PATCH v5 2/3] arm: Allow the user to specify the GIC version
Date: Wed, 8 Jul 2015 15:42:15 +0100 [thread overview]
Message-ID: <1436366535.23508.60.camel@citrix.com> (raw)
In-Reply-To: <D93D27F5-2A88-48B6-A343-F83A27D0DACB@citrix.com>
On Wed, 2015-07-08 at 15:34 +0100, Rob Hoes wrote:
>
> > On 8 Jul 2015, at 15:19, Ian Campbell <Ian.Campbell@citrix.com> wrote:
> >
> > On Wed, 2015-07-08 at 15:08 +0100, Rob Hoes wrote:
> >>
> >>> On 8 Jul 2015, at 12:37, Ian Campbell <Ian.Campbell@citrix.com> wrote:
> >>> ...
> >>>
> >>> I have a patch to genwrap.py which results in the following diff to the
> >>> generate ml files for the anonymous sub-struct added by the IDL change
> >>> above.
> >>>
> >>> Dave/Euan/Rob, is that idiomatic ocaml or is it possible to have
> >>> anonymous structs in ocaml like it is in C?
> >>
> >> I think that you have done the right thing. I’m not sure if you can
> >> define a nested record type without giving the inner one a name. But
> >> frankly, I don’t think there is much point to that either.
> >
> > Thanks.
> >
> >> In fact, I’d even drop the "__anon” and use the struct name as the
> >> type name directly.
> >
> > I did have that to start with, see below for how the keyed union stuff
> > worked which lead me to suffix it.
>
> It’s just that __anon doesn’t really mean much, because it isn’t
> anonymous in OCaml :) In hindsight, I would have probably dropped the
> __union as well...
Me too, now ;-)
> Anyway, I don’t care too much about these names, because in practice
> you won’t normally use them directly.
Right, thanks.
>
> Rob
>
> >> Or for consistency, use "type_<name>”, which is similar to what
> >> happens in the keyed union case (“type_hvm", “type_pv”).
> >
> > Actually in this case the "type" is the name of the KeyedUnion and the
> > hvm|pv are the potential values of the enum which is the key.
> >
> >> Incidentally, those structs are also defined as "Struct(None, [...”,
> >> but are probably handled specially because the struct appears inside
> >> the union.
> >
> > Correct, they needed different special handling of the struct in order
> > to construct the keyedunion as an ocaml discriminated type thing, which
> > ends up with (for a keyedunion key field "type" of the domain type
> > enum):
> > type type_hvm = { ... }
> > type type_pv = { ... }
> > type type__union = Hvm of type_hvm | Pv of type_pv | Invalid
> >
> > then the field is "xl_type : type__union";
> >
> > (the xl_ prefix is because type, the name of the C field, is an ocaml
> > keyword...)
> >
> > I added the __anon suffix for consistency with the __union suffix here.
> >
> > Ian.
> >
> >
>
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel
next prev parent reply other threads:[~2015-07-08 14:42 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-07 16:22 [PATCH v5 0/3] Add support for GICv2 on GICv3 Julien Grall
2015-07-07 16:22 ` [PATCH v5 1/3] xen/arm: Rename XEN_DOMCTL_CONFIG_GIC_DEFAULT to XEN_DOMCTL_CONFIG_GIC_NATIVE Julien Grall
2015-07-07 16:22 ` [PATCH v5 2/3] arm: Allow the user to specify the GIC version Julien Grall
2015-07-07 16:28 ` Ian Campbell
2015-07-08 10:17 ` Ian Campbell
2015-07-08 11:37 ` Ian Campbell
2015-07-08 14:08 ` Rob Hoes
2015-07-08 14:19 ` Ian Campbell
2015-07-08 14:34 ` Rob Hoes
2015-07-08 14:42 ` Ian Campbell [this message]
2015-07-07 16:22 ` [PATCH v5 3/3] xen/arm: gic-v3: Add support of vGICv2 when available Julien Grall
2015-07-08 12:43 ` [PATCH v5 0/3] Add support for GICv2 on GICv3 Ian Campbell
2015-07-09 11:55 ` Ian Campbell
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1436366535.23508.60.camel@citrix.com \
--to=ian.campbell@citrix.com \
--cc=Dave.Scott@citrix.com \
--cc=Ian.Jackson@citrix.com \
--cc=Rob.Hoes@citrix.com \
--cc=Stefano.Stabellini@citrix.com \
--cc=euan.harris@citrix.com \
--cc=julien.grall@citrix.com \
--cc=wei.liu2@citrix.com \
--cc=xen-devel@lists.xenproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.