qemu-devel
[Top][All Lists]
Advanced

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

[Qemu-devel] Re: [PATCH 05/32] use more meaningful values for kqemu_cpu_


From: Glauber Costa
Subject: [Qemu-devel] Re: [PATCH 05/32] use more meaningful values for kqemu_cpu_exec
Date: Thu, 23 Oct 2008 12:23:04 -0200
User-agent: Mutt/1.5.18 (2008-05-17)

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 <address@hidden>
>> ---
>>  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
>




reply via email to

[Prev in Thread] Current Thread [Next in Thread]