Received: from eggs.gnu.org ([140.186.70.92]:49742) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RnnIU-0004Gl-Sf for qemu-devel@nongnu.org; Thu, 19 Jan 2012 03:24:39 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RnnIT-0003t9-KF for qemu-devel@nongnu.org; Thu, 19 Jan 2012 03:24:38 -0500 Received: from csmailer.cs.nctu.edu.tw ([140.113.235.130]:43044) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RnnIT-0003sG-2w for qemu-devel@nongnu.org; Thu, 19 Jan 2012 03:24:37 -0500 Received: from csmailer.cs.nctu.edu.tw (localhost [127.0.0.1]) by csmailer.cs.nctu.edu.tw (Postfix) with ESMTP id 2226FC11 for ; Thu, 19 Jan 2012 16:21:34 +0800 (CST) Received: from alumni.cs.nctu.edu.tw (alumni.cs.nctu.edu.tw [140.113.235.116]) by csmailer.cs.nctu.edu.tw (Postfix) with ESMTP id 1D333C10 for ; Thu, 19 Jan 2012 16:21:34 +0800 (CST) Received: (from chenwj@localhost) by alumni.cs.nctu.edu.tw (8.14.4/8.14.4/Submit) id q0J8OUMT066909 for qemu-devel@nongnu.org; Thu, 19 Jan 2012 16:24:30 +0800 (CST) (envelope-from chenwj) Date: Thu, 19 Jan 2012 16:24:30 +0800 From: =?utf-8?B?6Zmz6Z+L5Lu7?= Message-ID: <20120119082429.GA27409@cs.nctu.edu.tw> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] Question about do_interrupt (target-i386/op_helper.c) List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Hi all, I am looking at do_interrupt (target-i386/op_helper.c) and find somethi= ng strange. Code sinpt below, void do_interrupt(CPUState *env1) { CPUState *saved_env; saved_env =3D env; env =3D env1; ... } In i386-linux-user, cpu_exec (cpu-exec.c) calls do_interrupt like this, do_interrupt(env); My questions are: 1) It seems to me the parameter of do_interrupt (envl) = should be the same as env inside do_interrupt (which comes from dyngen-exec.h's = #define). Why we need to assign envl to env here? Is it redundant, or I miss someth= ing? 2) In target-i386/op_helper.c, some functions use the global env, while othe= rs use function parameter env. Is it necessary? Or we can unify how they use env= ? Thanks. Regards, chenwj --=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