From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:55895) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SbHg3-0004KI-W4 for qemu-devel@nongnu.org; Sun, 03 Jun 2012 16:45:33 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SbHg2-0007k2-BX for qemu-devel@nongnu.org; Sun, 03 Jun 2012 16:45:31 -0400 Received: from mail-bk0-f45.google.com ([209.85.214.45]:44432) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SbHg2-0007jn-1w for qemu-devel@nongnu.org; Sun, 03 Jun 2012 16:45:30 -0400 Received: by bkwj10 with SMTP id j10so3468004bkw.4 for ; Sun, 03 Jun 2012 13:45:25 -0700 (PDT) Message-ID: <4FCBCCB0.8060305@gmail.com> Date: Sun, 03 Jun 2012 22:44:32 +0200 From: Davide Ferraretto MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="------------070802000305040806000109" Subject: [Qemu-devel] tcg_qemu_tb_exec... List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org This is a multi-part message in MIME format. --------------070802000305040806000109 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit I'm in qemu-arm. tcg_qemu_tb_exec function is a macro: #define tcg_qemu_tb_exec(env, tb_ptr) \ ((long REGPARM (*)(void *, void *))code_gen_prologue)(env, tb_ptr) #endif I don't understand what function calls. where is code of code_gen_prologue??? --------------070802000305040806000109 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit I'm in qemu-arm.
tcg_qemu_tb_exec function is a macro:
#define tcg_qemu_tb_exec(env, tb_ptr)                                    \
    ((long REGPARM (*)(void *, void *))code_gen_prologue)(env, tb_ptr)
#endif

I don't understand what function calls. where is code of code_gen_prologue???

--------------070802000305040806000109-- From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([208.118.235.92]:37092) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SbT9O-0002SK-Q4 for qemu-devel@nongnu.org; Mon, 04 Jun 2012 05:00:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SbT9E-0005fW-R5 for qemu-devel@nongnu.org; Mon, 04 Jun 2012 05:00:34 -0400 Received: from csmailer.cs.nctu.edu.tw ([140.113.235.130]:51993) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SbT9E-0005do-68 for qemu-devel@nongnu.org; Mon, 04 Jun 2012 05:00:24 -0400 Date: Mon, 4 Jun 2012 17:00:08 +0800 From: =?utf-8?B?6Zmz6Z+L5Lu7IChXZWktUmVuIENoZW4p?= Message-ID: <20120604090008.GA60544@cs.nctu.edu.tw> References: <4FCBCCB0.8060305@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <4FCBCCB0.8060305@gmail.com> Content-Transfer-Encoding: quoted-printable Subject: Re: [Qemu-devel] tcg_qemu_tb_exec... List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Davide Ferraretto Cc: qemu-devel@nongnu.org On Sun, Jun 03, 2012 at 10:44:32PM +0200, Davide Ferraretto wrote: > I'm in qemu-arm. > tcg_qemu_tb_exec function is a macro: > #define tcg_qemu_tb_exec(env, tb_ptr) = \ > ((long REGPARM (*)(void *, void *))code_gen_prologue)(env, tb_ptr) > #endif QEMU treats execution in code cache as a function call. As you might kn= ow, function has its prologue/epilogue, the "code_gen_prologue" stores the prologue/epilogue code. After executing prologue, it'll jump to the code = cache (tb_ptr), then back to epilogue, finally return to QEMU. Regards, chenwj [1] http://en.wikipedia.org/wiki/Function_prologue --=20 Wei-Ren Chen (=E9=99=B3=E9=9F=8B=E4=BB=BB) Computer Systems Lab, Institute of Information Science, Academia Sinica, Taiwan (R.O.C.) Tel:886-2-2788-3799 #1667 Homepage: http://people.cs.nctu.edu.tw/~chenwj