diff options
author | Andrew Cooper <andrew.cooper3@citrix.com> | 2013-01-11 12:22:29 +0000 |
---|---|---|
committer | Andrew Cooper <andrew.cooper3@citrix.com> | 2013-01-11 12:22:29 +0000 |
commit | 28ae1705384b6134c05ddcdb0f7572a92a3ea368 (patch) | |
tree | 28fdda2f6658160ec5aec1c531aab97de40961b8 /tools/ocaml | |
parent | f80b09c08b2a97dfcd51cc6dc809519f74ab90cc (diff) | |
download | xen-28ae1705384b6134c05ddcdb0f7572a92a3ea368.tar.gz xen-28ae1705384b6134c05ddcdb0f7572a92a3ea368.tar.bz2 xen-28ae1705384b6134c05ddcdb0f7572a92a3ea368.zip |
tools/ocaml: libxc bindings: Fix SBDF encoding
Changeset 23861:ec7c81fbe0de alters the SBDF encoding expected by the
DOMCTL_{de,}assign_device hypercalls.
While it updates libxl, libxc and the python bindings, the ocaml
bindings got missed. As a result, any attempt to use PCI Passthrough
with Xen-4.2 and later will fail.
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Acked-by: Ian Campbell <ian.campbell@citrix.com>
Committed-by: Ian Campbell <ian.campbell@citrix.com>
Diffstat (limited to 'tools/ocaml')
-rw-r--r-- | tools/ocaml/libs/xc/xenctrl_stubs.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/tools/ocaml/libs/xc/xenctrl_stubs.c b/tools/ocaml/libs/xc/xenctrl_stubs.c index 1c14ed64bf..0e26ae9de7 100644 --- a/tools/ocaml/libs/xc/xenctrl_stubs.c +++ b/tools/ocaml/libs/xc/xenctrl_stubs.c @@ -1085,11 +1085,10 @@ CAMLprim value stub_xc_domain_irq_permission(value xch, value domid, static uint32_t pci_dev_to_bdf(int domain, int bus, int slot, int func) { - uint32_t bdf = 0; - bdf |= (bus & 0xff) << 16; - bdf |= (slot & 0x1f) << 11; - bdf |= (func & 0x7) << 8; - return bdf; + return ((uint32_t)domain & 0xffff) << 16 | + ((uint32_t)bus & 0xff) << 8 | + ((uint32_t)slot & 0x1f) << 3 | + ((uint32_t)func & 0x7); } CAMLprim value stub_xc_domain_test_assign_device(value xch, value domid, value desc) |