From mboxrd@z Thu Jan 1 00:00:00 1970 From: Anil Madhavapeddy Subject: Re: [PATCH] libxl: ocaml: guard x86-specific functions behind an ifdef Date: Thu, 9 Jan 2014 17:04:44 +0000 Message-ID: <20140109170444.GA938@dark.recoil.org> References: <20140109163632.GA27164@dark.recoil.org> <52CED1A2.3000708@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1W1J2E-0008Uc-9P for xen-devel@lists.xenproject.org; Thu, 09 Jan 2014 17:04:46 +0000 Content-Disposition: inline In-Reply-To: <52CED1A2.3000708@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Andrew Cooper Cc: xen-devel@lists.xenproject.org List-Id: xen-devel@lists.xenproject.org On Thu, Jan 09, 2014 at 04:43:14PM +0000, Andrew Cooper wrote: > On 09/01/14 16:36, Anil Madhavapeddy wrote: > > The various cpuid functions are not available on ARM, so this > > makes them raise an OCaml exception. Omitting the functions > > completely them results in a link failure in oxenstored due to > > the missing symbols, so this is preferable to the much bigger > > patch that would result from adding conditional compilation into > > the OCaml interfaces. > > > > Signed-off-by: Anil Madhavapeddy > > > > --- > > tools/ocaml/libs/xc/xenctrl_stubs.c | 12 ++++++++++++ > > 1 file changed, 12 insertions(+) > > > > diff --git a/tools/ocaml/libs/xc/xenctrl_stubs.c b/tools/ocaml/libs/xc/xenctrl_stubs.c > > index f5cf0ed..76864cc 100644 > > --- a/tools/ocaml/libs/xc/xenctrl_stubs.c > > +++ b/tools/ocaml/libs/xc/xenctrl_stubs.c > > @@ -714,6 +714,7 @@ CAMLprim value stub_xc_domain_cpuid_set(value xch, value domid, > > { > > CAMLparam4(xch, domid, input, config); > > CAMLlocal2(array, tmp); > > +#if defined(__i386__) || defined(__x86_64__) > > int r; > > unsigned int c_input[2]; > > char *c_config[4], *out_config[4]; > > @@ -742,17 +743,24 @@ CAMLprim value stub_xc_domain_cpuid_set(value xch, value domid, > > c_input, (const char **)c_config, out_config); > > if (r < 0) > > failwith_xc(_H(xch)); > > +#else > > + failwith_xc(_H(xch)); > > You probably want to set xc's last error so failwith_xc() gives an > exception with a relevant error message. Yeah; I'm just stumbling through getting my Cubieboard2 dom0 to boot a VM at the moment, so I'll test out oxenstored when the compile finishes and resubmit the patch. -- Anil Madhavapeddy http://anil.recoil.org