diff options
author | Ian Campbell <ian.campbell@citrix.com> | 2011-03-31 18:12:07 +0100 |
---|---|---|
committer | Ian Campbell <ian.campbell@citrix.com> | 2011-03-31 18:12:07 +0100 |
commit | d561caafdc88b8e6d069cbc1c2728d513c59ebed (patch) | |
tree | 2e418c2941b39a2c0b9b9f25db83ba698bccf214 /tools | |
parent | d1611204f32a705ca82611ddcb8d6549b244b313 (diff) | |
download | xen-d561caafdc88b8e6d069cbc1c2728d513c59ebed.tar.gz xen-d561caafdc88b8e6d069cbc1c2728d513c59ebed.tar.bz2 xen-d561caafdc88b8e6d069cbc1c2728d513c59ebed.zip |
tools: ocaml: xl: propagate simplfied libxl interface to PCI BDFs to bindings.
22166:251694a87f1d changed the libxl interface to remove the need for
users to understand BDF encoding but did not propagate the change to
the ocaml bindings. Do that now.
Signed-off-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
Diffstat (limited to 'tools')
-rw-r--r-- | tools/ocaml/libs/xl/xl.ml | 4 | ||||
-rw-r--r-- | tools/ocaml/libs/xl/xl.mli | 4 | ||||
-rw-r--r-- | tools/ocaml/libs/xl/xl_stubs.c | 28 |
3 files changed, 13 insertions, 23 deletions
diff --git a/tools/ocaml/libs/xl/xl.ml b/tools/ocaml/libs/xl/xl.ml index 0e47a85927..c856eef88b 100644 --- a/tools/ocaml/libs/xl/xl.ml +++ b/tools/ocaml/libs/xl/xl.ml @@ -145,7 +145,9 @@ type vfb_info = type pci_info = { - v : int; (* domain * bus * dev * func multiplexed *) + func : int; + dev : int; + bus : int; domain : int; vdevfn : int; msitranslate : bool; diff --git a/tools/ocaml/libs/xl/xl.mli b/tools/ocaml/libs/xl/xl.mli index 649429638b..fcf4b2e0a9 100644 --- a/tools/ocaml/libs/xl/xl.mli +++ b/tools/ocaml/libs/xl/xl.mli @@ -145,7 +145,9 @@ type vfb_info = type pci_info = { - v : int; (* domain * bus * dev * func multiplexed *) + func : int; + dev : int; + bus : int; domain : int; vdevfn : int; msitranslate : bool; diff --git a/tools/ocaml/libs/xl/xl_stubs.c b/tools/ocaml/libs/xl/xl_stubs.c index 6c442ad818..ab08962bf2 100644 --- a/tools/ocaml/libs/xl/xl_stubs.c +++ b/tools/ocaml/libs/xl/xl_stubs.c @@ -272,30 +272,16 @@ static int device_vfb_val(caml_gc *gc, libxl_device_vfb *c_val, value v) static int device_pci_val(caml_gc *gc, libxl_device_pci *c_val, value v) { - union { - unsigned int value; - struct { - unsigned int reserved1:2; - unsigned int reg:6; - unsigned int func:3; - unsigned int dev:5; - unsigned int bus:8; - unsigned int reserved2:7; - unsigned int enable:1; - }fields; - }u; CAMLparam1(v); - /* FIXME: propagate API change to ocaml */ - u.value = Int_val(Field(v, 0)); - c_val->func = u.fields.func; - c_val->dev = u.fields.dev; - c_val->bus = u.fields.bus; + c_val->func = Int_val(Field(v, 0)); + c_val->dev = Int_val(Field(v, 1)); + c_val->bus = Int_val(Field(v, 2)); - c_val->domain = Int_val(Field(v, 1)); - c_val->vdevfn = Int_val(Field(v, 2)); - c_val->msitranslate = Bool_val(Field(v, 3)); - c_val->power_mgmt = Bool_val(Field(v, 4)); + c_val->domain = Int_val(Field(v, 3)); + c_val->vdevfn = Int_val(Field(v, 4)); + c_val->msitranslate = Bool_val(Field(v, 5)); + c_val->power_mgmt = Bool_val(Field(v, 6)); CAMLreturn(0); } |