From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ian Campbell Subject: [PATCH 2 of 2] tools: ocaml: xl: propagate simplfied libxl interface to PCI BDFs to bindings Date: Thu, 31 Mar 2011 12:01:45 +0100 Message-ID: <7b5c5a365f2a0a57e834.1301569305@localhost.localdomain> References: Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com Cc: Ian Campbell List-Id: xen-devel@lists.xenproject.org # HG changeset patch # User Ian Campbell # Date 1301569049 -3600 # Node ID 7b5c5a365f2a0a57e83479f69e5b56beb07752c1 # Parent cb7f41afe07f8734a515dd30454e6701df755ec1 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 diff -r cb7f41afe07f -r 7b5c5a365f2a tools/ocaml/libs/xl/xl.ml --- a/tools/ocaml/libs/xl/xl.ml Thu Mar 31 11:57:10 2011 +0100 +++ b/tools/ocaml/libs/xl/xl.ml Thu Mar 31 11:57:29 2011 +0100 @@ -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 cb7f41afe07f -r 7b5c5a365f2a tools/ocaml/libs/xl/xl.mli --- a/tools/ocaml/libs/xl/xl.mli Thu Mar 31 11:57:10 2011 +0100 +++ b/tools/ocaml/libs/xl/xl.mli Thu Mar 31 11:57:29 2011 +0100 @@ -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 cb7f41afe07f -r 7b5c5a365f2a tools/ocaml/libs/xl/xl_stubs.c --- a/tools/ocaml/libs/xl/xl_stubs.c Thu Mar 31 11:57:10 2011 +0100 +++ b/tools/ocaml/libs/xl/xl_stubs.c Thu Mar 31 11:57:29 2011 +0100 @@ -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); }