From: Ian Campbell <ian.campbell@citrix.com>
To: xen-devel@lists.xensource.com
Cc: Ian Campbell <ian.campbell@citrix.com>
Subject: [PATCH 2 of 2] tools: ocaml: xl: propagate simplfied libxl interface to PCI BDFs to bindings
Date: Thu, 24 Mar 2011 11:49:22 +0000 [thread overview]
Message-ID: <b92430e690860cfac8f2.1300967362@localhost.localdomain> (raw)
In-Reply-To: <patchbomb.1300967360@localhost.localdomain>
# HG changeset patch
# User Ian Campbell <ian.campbell@citrix.com>
# Date 1300967090 0
# Node ID b92430e690860cfac8f243ee9cff47351ad6fbbb
# Parent 3462e0f1f0c1efe035f4d1d24d3659431a6c62c0
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>
diff -r 3462e0f1f0c1 -r b92430e69086 tools/ocaml/libs/xl/xl.ml
--- a/tools/ocaml/libs/xl/xl.ml Thu Mar 24 11:44:50 2011 +0000
+++ b/tools/ocaml/libs/xl/xl.ml Thu Mar 24 11:44:50 2011 +0000
@@ -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 -r 3462e0f1f0c1 -r b92430e69086 tools/ocaml/libs/xl/xl.mli
--- a/tools/ocaml/libs/xl/xl.mli Thu Mar 24 11:44:50 2011 +0000
+++ b/tools/ocaml/libs/xl/xl.mli Thu Mar 24 11:44:50 2011 +0000
@@ -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 -r 3462e0f1f0c1 -r b92430e69086 tools/ocaml/libs/xl/xl_stubs.c
--- a/tools/ocaml/libs/xl/xl_stubs.c Thu Mar 24 11:44:50 2011 +0000
+++ b/tools/ocaml/libs/xl/xl_stubs.c Thu Mar 24 11:44:50 2011 +0000
@@ -272,30 +272,16 @@ static int device_vfb_val(caml_gc *gc, l
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);
}
next prev parent reply other threads:[~2011-03-24 11:49 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-03-24 11:49 [PATCH 0 of 2] libxl: PCI passthrough interface changes Ian Campbell
2011-03-24 11:49 ` [PATCH 1 of 2] libxl: remove "reg" and "enable" fields from PCI device Ian Campbell
2011-03-24 11:49 ` Ian Campbell [this message]
-- strict thread matches above, loose matches on Subject: below --
2011-03-31 11:01 [PATCH 0 of 2] tools: libxl: fixup PCI BDF interface (REPOST) Ian Campbell
2011-03-31 11:01 ` [PATCH 2 of 2] tools: ocaml: xl: propagate simplfied libxl interface to PCI BDFs to bindings Ian Campbell
2011-03-21 16:13 [PATCH 0 of 2] tools: libxl: fixup PCI BDF interface Ian Campbell
2011-03-21 16:13 ` [PATCH 2 of 2] tools: ocaml: xl: propagate simplfied libxl interface to PCI BDFs to bindings 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=b92430e690860cfac8f2.1300967362@localhost.localdomain \
--to=ian.campbell@citrix.com \
--cc=xen-devel@lists.xensource.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).