]>
Commit | Line | Data |
---|---|---|
75d56118 MT |
1 | # HG changeset patch |
2 | # User Jon Ludlam <jonathan.ludlam@eu.citrix.com> | |
3 | # Date 1318261276 -3600 | |
4 | # Node ID 187d59e32a586d65697ed46bef106b52e3fb5ab9 | |
5 | # Parent 51288f69523fcbbefa12cea5a761a6e957410151 | |
6 | tools/ocaml: Fix 2 bit-twiddling bugs and an off-by-one | |
7 | ||
8 | The bit bugs are in ocaml vcpu affinity calls, and the off-by-one | |
9 | error is in the ocaml console ring code | |
10 | ||
11 | Signed-off-by: Zheng Li <zheng.li@eu.citrix.com> | |
12 | Acked-by: Ian Campbell <ian.campbell.com> | |
13 | Committed-by: Ian Jackson <ian.jackson.citrix.com> | |
14 | Acked-by: Jon Ludlam <jonathan.ludlam@eu.citrix.com> | |
15 | ||
16 | diff -r 51288f69523f -r 187d59e32a58 tools/ocaml/libs/xc/xenctrl_stubs.c | |
17 | --- a/tools/ocaml/libs/xc/xenctrl_stubs.c Mon Oct 10 16:41:16 2011 +0100 | |
18 | +++ b/tools/ocaml/libs/xc/xenctrl_stubs.c Mon Oct 10 16:41:16 2011 +0100 | |
19 | @@ -430,7 +430,7 @@ | |
20 | ||
21 | for (i=0; i<len; i++) { | |
22 | if (Bool_val(Field(cpumap, i))) | |
23 | - c_cpumap[i/8] |= i << (i&7); | |
24 | + c_cpumap[i/8] |= 1 << (i&7); | |
25 | } | |
26 | retval = xc_vcpu_setaffinity(_H(xch), _D(domid), | |
27 | Int_val(vcpu), c_cpumap); | |
28 | @@ -466,7 +466,7 @@ | |
29 | ret = caml_alloc(len, 0); | |
30 | ||
31 | for (i=0; i<len; i++) { | |
32 | - if (c_cpumap[i%8] & 1 << (i&7)) | |
33 | + if (c_cpumap[i/8] & 1 << (i&7)) | |
34 | Store_field(ret, i, Val_true); | |
35 | else | |
36 | Store_field(ret, i, Val_false); | |
37 | @@ -523,7 +523,7 @@ | |
38 | ||
39 | CAMLprim value stub_xc_readconsolering(value xch) | |
40 | { | |
41 | - unsigned int size = RING_SIZE; | |
42 | + unsigned int size = RING_SIZE - 1; | |
43 | char *ring_ptr = ring; | |
44 | ||
45 | CAMLparam1(xch); |