From: Ian Campbell <ian.campbell@citrix.com>
To: Julien Grall <julien.grall@citrix.com>,
Dave Scott <Dave.Scott@eu.citrix.com>,
Euan Harris <euan.harris@citrix.com>,
Rob Hoes <Rob.Hoes@citrix.com>
Cc: xen-devel@lists.xenproject.org, stefano.stabellini@citrix.com,
Ian Jackson <ian.jackson@eu.citrix.com>,
Wei Liu <wei.liu2@citrix.com>
Subject: Re: [PATCH v5 2/3] arm: Allow the user to specify the GIC version
Date: Wed, 8 Jul 2015 12:37:56 +0100 [thread overview]
Message-ID: <1436355476.23508.14.camel@citrix.com> (raw)
In-Reply-To: <1436350663.25646.286.camel@citrix.com>
On Wed, 2015-07-08 at 11:17 +0100, Ian Campbell wrote:
> On Tue, 2015-07-07 at 17:22 +0100, Julien Grall wrote:
> > diff --git a/tools/libxl/libxl_types.idl b/tools/libxl/libxl_types.idl
> > index e1632fa..11f6461 100644
> > --- a/tools/libxl/libxl_types.idl
> > +++ b/tools/libxl/libxl_types.idl
> > @@ -369,6 +369,12 @@ libxl_vnode_info = Struct("vnode_info", [
> > ("vcpus", libxl_bitmap), # vcpus in this node
> > ])
> >
> > +libxl_gic_version = Enumeration("gic_version", [
> > + (0, "DEFAULT"),
> > + (0x20, "v2"),
> > + (0x30, "v3")
> > + ], init_val = "LIBXL_GIC_VERSION_DEFAULT")
> > +
> > libxl_domain_build_info = Struct("domain_build_info",[
> > ("max_vcpus", integer),
> > ("avail_vcpus", libxl_bitmap),
> > @@ -480,6 +486,11 @@ libxl_domain_build_info = Struct("domain_build_info",[
> > ])),
> > ("invalid", None),
> > ], keyvar_init_val = "LIBXL_DOMAIN_TYPE_INVALID")),
> > +
> > +
> > + ("arch_arm", Struct(None, [("gic_version", libxl_gic_version),
> > + ])),
> > +
> > ], dir=DIR_IN
>
> This results in the following when building the ocaml bindings:
>
> Traceback (most recent call last):
> File "genwrap.py", line 529, in <module>
> ml.write(gen_ocaml_ml(ty, False))
> File "genwrap.py", line 217, in gen_ocaml_ml
> s += gen_struct(ty)
> File "genwrap.py", line 119, in gen_struct
> x = ocaml_instance_of_field(f)
> File "genwrap.py", line 112, in ocaml_instance_of_field
> return "%s : %s" % (munge_name(name), ocaml_type_of(f.type))
> File "genwrap.py", line 90, in ocaml_type_of
> return ty.rawname.capitalize() + ".t"
> AttributeError: 'NoneType' object has no attribute 'capitalize'
> make[7]: *** No rule to make target '_libxl_types.ml.in', needed by 'xenlight.ml'. Stop.
>
> I'll take a look.
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?
If there is a better/more usual way to do this would you mind supplying
me with the ocaml I should be aiming for please?
Ian.
--- tools/ocaml/libs/xl/_libxl_BACKUP_types.ml.in 2015-07-08 11:22:35.000000000 +0100
+++ tools/ocaml/libs/xl/_libxl_types.ml.in 2015-07-08 12:25:56.000000000 +0100
@@ -508,6 +508,17 @@ module Vnode_info = struct
external default : ctx -> unit -> t = "stub_libxl_vnode_info_init"
end
+(* libxl_gic_version implementation *)
+type gic_version =
+ | GIC_VERSION_DEFAULT
+ | GIC_VERSION_V2
+ | GIC_VERSION_V3
+
+let string_of_gic_version = function
+ | GIC_VERSION_DEFAULT -> "DEFAULT"
+ | GIC_VERSION_V2 -> "V2"
+ | GIC_VERSION_V3 -> "V3"
+
(* libxl_domain_build_info implementation *)
module Domain_build_info = struct
@@ -566,6 +577,10 @@ module Domain_build_info = struct
type type__union = Hvm of type_hvm | Pv of type_pv | Invalid
+ type arch_arm__anon = {
+ gic_version : gic_version;
+ }
+
type t =
{
max_vcpus : int;
@@ -607,6 +622,7 @@ module Domain_build_info = struct
ramdisk : string option;
device_tree : string option;
xl_type : type__union;
+ arch_arm : arch_arm__anon;
}
external default : ctx -> ?xl_type:domain_type -> unit -> t = "stub_libxl_domain_build_info_init"
end
next prev parent reply other threads:[~2015-07-08 11:38 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 [this message]
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
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=1436355476.23508.14.camel@citrix.com \
--to=ian.campbell@citrix.com \
--cc=Dave.Scott@eu.citrix.com \
--cc=Rob.Hoes@citrix.com \
--cc=euan.harris@citrix.com \
--cc=ian.jackson@eu.citrix.com \
--cc=julien.grall@citrix.com \
--cc=stefano.stabellini@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.