[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] porting xen-detect ASM code into a shared library


  • To: Guillaume Rousse <Guillaume.Rousse@xxxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxx>
  • From: Keir Fraser <keir.fraser@xxxxxxxxxxxxx>
  • Date: Thu, 10 Jul 2008 10:28:50 +0100
  • Cc:
  • Delivery-date: Thu, 10 Jul 2008 02:29:16 -0700
  • List-id: Xen developer discussion <xen-devel.lists.xensource.com>
  • Thread-index: Acjib1xtmrKtXE5iEd2MOAAX8io7RQ==
  • Thread-topic: [Xen-devel] porting xen-detect ASM code into a shared library



On 10/7/08 10:21, "Guillaume Rousse" <Guillaume.Rousse@xxxxxxxx> wrote:

> I'm trying to port xen-detect.c ASM code into cfengine, which is
> currently build as a shared library. However, I'm facing a compilation
> error:
> misc.c: In function 'Xen_cpuid':
> misc.c:1376: error: can't find a register in class 'BREG' while
> reloading 'asm'
> misc.c:1376: error: 'asm' operand has impossible constraints
> 
>  From 

See tools/libxc/xc_cpuid_x86.c for an example of how to work around this.
Essentially you turn the "=b" constraint into "=r". You then push/pop ebx
(to save/restore it) and you 'mov %%ebx,%1' to save away ebx's value before
restoring its original value.

 -- Keir



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.