All of lore.kernel.org
 help / color / mirror / Atom feed
* [Qemu-devel] What's the meaning and the functionality of the assembly instructions in the beginning of cpu_exec?
@ 2010-05-31  4:22 曹莹
  0 siblings, 0 replies; only message in thread
From: 曹莹 @ 2010-05-31  4:22 UTC (permalink / raw)
  To: qemu-devel

[-- Attachment #1: Type: text/plain, Size: 1244 bytes --]

I’m working with Qemu source study, but now I have some difficulty in these assembly instructions at the beginning of cpu_exec function. My question as follows:

 

After entering function cpu_exec, there are some assembly codes:

 

register host_reg_t reg_AREG0 asm("ebp"); 

volatile host_reg_t saved_AREG0;

       

register host_reg_t reg_AREG1 asm("ebx"); 

volatile host_reg_t saved_AREG1;

       

register host_reg_t reg_AREG2 asm("esi"); 

volatile host_reg_t saved_AREG2;

       

register host_reg_t reg_AREG3 asm("edi");

volatile host_reg_t saved_AREG3;

 

and there is also:

__asm__ __volatile__ ("" : "=r" (reg_AREG0)); 

saved_AREG0 = reg_AREG0;

              

__asm__ __volatile__ ("" : "=r" (reg_AREG1)); 

saved_AREG1 = reg_AREG1;

              

__asm__ __volatile__ ("" : "=r" (reg_AREG2)); 

saved_AREG2 = reg_AREG2;

              

__asm__ __volatile__ ("" : "=r" (reg_AREG3));

saved_AREG3 = reg_AREG3;

 

Where are variables: reg_AREG-, saved_AREG- defined and how they are used in the later codes? I really understand these assembly codes’ functionality. Do they use for Qemu virtual register mapping or translating optimization? Could anyone give me some advise, thank. Thank you very much for your help.

[-- Attachment #2: Type: text/html, Size: 7159 bytes --]

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2010-05-31  4:54 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-05-31  4:22 [Qemu-devel] What's the meaning and the functionality of the assembly instructions in the beginning of cpu_exec? 曹莹

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.