[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 1/2] monitor: Split mon_get_cpu fn to remove ENV
From: |
Peter Crosthwaite |
Subject: |
Re: [Qemu-devel] [PATCH 1/2] monitor: Split mon_get_cpu fn to remove ENV_GET_CPU |
Date: |
Sun, 24 May 2015 13:30:56 -0700 |
On Mon, May 18, 2015 at 9:52 AM, Andreas Färber <address@hidden> wrote:
> Am 18.05.2015 um 18:44 schrieb Peter Crosthwaite:
>> On Mon, May 18, 2015 at 9:13 AM, Richard Henderson <address@hidden> wrote:
>>> On 05/17/2015 12:51 PM, Peter Crosthwaite wrote:
>>>> @@ -1208,7 +1203,6 @@ static void monitor_printc(Monitor *mon, int c)
>>>> static void memory_dump(Monitor *mon, int count, int format, int wsize,
>>>> hwaddr addr, int is_physical)
>>>> {
>>>> - CPUArchState *env;
>>>> int l, line_size, i, max_digits, len;
>>>> uint8_t buf[16];
>>>> uint64_t v;
>>>> @@ -1216,8 +1210,8 @@ static void memory_dump(Monitor *mon, int count, int
>>>> format, int wsize,
>>>> if (format == 'i') {
>>>> int flags;
>>>> flags = 0;
>>>> - env = mon_get_cpu();
>>>> #ifdef TARGET_I386
>>>> + CPUArchState *env = mon_get_env();
>>>> if (wsize == 2) {
>>>
>>> C99 declaration after statement. I forget if we care or not?
>
> We care, but we haven't strictly enforced it everywhere.
>
>> Generally we do, but I have seen incidences of the notable exception
>> of conditionally compiled code. Otherwise would need two complicated
>> sets of #ifdef.
>>
>> Unfortunately we can't just unconditionally define it anymore, as the
>> hunk below removes the only unconditional usage throwing an "unused"
>> werror.
>>
>>> Anyway, fixable by changing the line above to
>>>
>>> int flags = 0;
>>>
>>
>> I'll just make this change.
>
> If this is supposed to go through qom-cpu, I could do that change
> myself. The alternative would've been #if defined(TARGET_foo) ||
> defined(TARGET_bar) ... #endif for the declaration.
>
> I was rather wondering whether mon_get_env() should be ameliorated to
> mon_get_cpu_env() for clarity? env is just short for environment.
>
> Otherwise modulo the above nit,
>
Change made, s/mon_get_env/mon_get_cpu_env
> Reviewed-by: Andreas Färber <address@hidden>
>
Thanks,
Regards,
Peter
> Regards,
> Andreas
>
>>> Otherwise,
>>>
>>> Reviewed-by: Richard Henderson <address@hidden>
>>
>> Thanks.
>>
>> Regards,
>> Peter
>
> --
> SUSE Linux GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
> GF: Felix Imendörffer, Jane Smithard, Dilip Upmanyu, Graham Norton; HRB
> 21284 (AG Nürnberg)
>
[Qemu-devel] [PATCH 2/2] disas: Remove uses of CPU env, Peter Crosthwaite, 2015/05/17