qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v3 8/8] cpu-exec: Purge all uses of ENV_GET_CPU(


From: Andreas Färber
Subject: Re: [Qemu-devel] [PATCH v3 8/8] cpu-exec: Purge all uses of ENV_GET_CPU()
Date: Thu, 25 Jun 2015 18:15:50 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0

Am 24.06.2015 um 19:32 schrieb Andreas Färber:
> Am 24.06.2015 um 04:10 schrieb Peter Crosthwaite:
>> On Thu, Jun 18, 2015 at 10:24 AM, Peter Crosthwaite
>> <address@hidden> wrote:
>>> diff --git a/bsd-user/main.c b/bsd-user/main.c
>>> index 45a1436..7196285 100644
>>> --- a/bsd-user/main.c
>>> +++ b/bsd-user/main.c
>>> @@ -166,6 +166,7 @@ static void set_idt(int n, unsigned int dpl)
>>>
>>>  void cpu_loop(CPUX86State *env)
>>>  {
>>> +    CPUState *cs = CPU(x86_env_get_cpu(env));
> 
> An (unwritten?) convention has been to avoid double-casts by having an
> explicit X86CPU *cpu variable.

diff --git a/bsd-user/main.c b/bsd-user/main.c
index 7196285..f46728b 100644
--- a/bsd-user/main.c
+++ b/bsd-user/main.c
@@ -166,7 +166,8 @@ static void set_idt(int n, unsigned int dpl)

 void cpu_loop(CPUX86State *env)
 {
-    CPUState *cs = CPU(x86_env_get_cpu(env));
+    X86CPU *cpu = x86_env_get_cpu(env);
+    CPUState *cs = CPU(cpu);
     int trapnr;
     abi_ulong pc;
     //target_siginfo_t info;

And another nit while touching that line:

diff --git a/linux-user/main.c b/linux-user/main.c
index 8c4634a..6f07644 100644
--- a/linux-user/main.c
+++ b/linux-user/main.c
@@ -2655,7 +2655,7 @@ void cpu_loop(CPUOpenRISCState *env)

     for (;;) {
         cpu_exec_start(cs);
-        trapnr = cpu_exec(cs);
+        trapnr = cpu_openrisc_exec(cs);
         cpu_exec_end(cs);
         gdbsig = 0;


uc32 is dancing out of line, too, but I actually like its naming better
and renaming would be a separate patch either way.

Regards,
Andreas

-- 
SUSE Linux GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Felix Imendörffer, Jane Smithard, Dilip Upmanyu, Graham Norton; HRB
21284 (AG Nürnberg)



reply via email to

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