From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Kt14M-0002Hz-Qi for qemu-devel@nongnu.org; Thu, 23 Oct 2008 10:21:46 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Kt14L-0002Gz-5i for qemu-devel@nongnu.org; Thu, 23 Oct 2008 10:21:46 -0400 Received: from [199.232.76.173] (port=48465 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Kt14L-0002Go-2P for qemu-devel@nongnu.org; Thu, 23 Oct 2008 10:21:45 -0400 Received: from mx2.redhat.com ([66.187.237.31]:51173) by monty-python.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Kt14K-00023C-3G for qemu-devel@nongnu.org; Thu, 23 Oct 2008 10:21:44 -0400 Date: Thu, 23 Oct 2008 12:23:04 -0200 From: Glauber Costa Message-ID: <20081023142304.GF18872@poweredge.glommer> References: <1224771556-11146-1-git-send-email-glommer@redhat.com> <1224771556-11146-6-git-send-email-glommer@redhat.com> <490082C1.7040502@us.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <490082C1.7040502@us.ibm.com> Subject: [Qemu-devel] Re: [PATCH 05/32] use more meaningful values for kqemu_cpu_exec Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Anthony Liguori Cc: jan.kiszka@siemens.com, jes@sgi.com, qemu-devel@nongnu.org, avi@qumranet.com, dmitry.baryshkov@siemens.com On Thu, Oct 23, 2008 at 08:57:21AM -0500, Anthony Liguori wrote: > Glauber Costa wrote: >> define constants that actually mean something instead of 1, 2, etc >> >> Signed-off-by: Glauber Costa >> --- >> cpu-exec.c | 4 ++-- >> exec-all.h | 4 ++++ >> kqemu.c | 12 ++++++------ >> 3 files changed, 12 insertions(+), 8 deletions(-) >> >> diff --git a/cpu-exec.c b/cpu-exec.c >> index f06df26..88b7d6f 100644 >> --- a/cpu-exec.c >> +++ b/cpu-exec.c >> @@ -339,10 +339,10 @@ int cpu_exec(CPUState *env1) >> env->eflags = env->eflags | cc_table[CC_OP].compute_all() | (DF & DF_MASK); >> ret = kqemu_cpu_exec(env); >> env->eflags &= ~(DF_MASK | CC_O | CC_S | CC_Z | CC_A | CC_P | CC_C); >> - if (ret == 1) { >> + if (ret == EXEC_EXIT_INTR) { >> /* exception */ >> longjmp(env->jmp_env, 1); >> - } else if (ret == 2) { >> + } else if (ret == EXEC_EXIT_SOFTMMU) { >> /* softmmu execution needed */ >> } else { >> if (env->interrupt_request != 0) { >> diff --git a/exec-all.h b/exec-all.h >> index e3da98a..c10248b 100644 >> --- a/exec-all.h >> +++ b/exec-all.h >> @@ -356,6 +356,10 @@ static inline int can_do_io(CPUState *env) >> } >> #endif >> >> +#define EXEC_EXIT_DONE 0 >> +#define EXEC_EXIT_INTR 1 >> +#define EXEC_EXIT_SOFTMMU 2 >> + >> > > How about ACCEL_EXIT_? These codes are accelerator specific after all. I believe ACCEL_EXIT is confusing. ACCEL_EXEC_EXIT would be better, since it makes it clear that it is used in exec context. However, if we're droping the cpu_exec patch, we can drop this one too. > > Regards, > > Anthony Liguori >