qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 02/10] armv7m_nvic: keep a pointer to the CPU


From: Peter Maydell
Subject: Re: [Qemu-devel] [PATCH 02/10] armv7m_nvic: keep a pointer to the CPU
Date: Fri, 27 Jan 2017 13:16:04 +0000

On 27 January 2017 at 12:41, Alex Bennée <address@hidden> wrote:
>> @@ -349,7 +347,6 @@ static void nvic_writel(nvic_state *s, uint32_t offset, 
>> uint32_t value)
>>          }
>>          break;
>>      case 0xd08: /* Vector Table Offset.  */
>> -        cpu = ARM_CPU(qemu_get_cpu(0));
>>          cpu->env.v7m.vecbase = value & 0xffffff80;
>
> Given it is only used once here you could just indirect it:
>
>            s->cpu->env.v7m.vecbase = value & 0xffffff80;

Two reasons not to do that:
(1) it makes this patch easier to review if all it's
doing is deleting lines that set cpu
(2) future patches improving the NVIC support are going
to add more cases that want to use the cpu pointer

thanks
-- PMM



reply via email to

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