qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 2/9] hw/arm_gic: Remove the special casing of NC


From: Andreas Färber
Subject: Re: [Qemu-devel] [PATCH 2/9] hw/arm_gic: Remove the special casing of NCPU for the NVIC
Date: Fri, 18 May 2012 15:01:15 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:12.0) Gecko/20120421 Thunderbird/12.0

Am 02.05.2012 19:12, schrieb Peter Maydell:
> Drop the special casing of NCPU=1 for the NVIC. This slightly
> increases the amount of memory used by its state structure,
> but removes some ifdeffery and means we can safely move the
> GIC state into a common subclass structure.
> 
> Signed-off-by: Peter Maydell <address@hidden>
> ---
>  hw/arm_gic.c     |   23 +++--------------------
>  hw/armv7m_nvic.c |    5 ++---
>  2 files changed, 5 insertions(+), 23 deletions(-)
> 
> diff --git a/hw/arm_gic.c b/hw/arm_gic.c
> index 17b2eba..2d8ceb8 100644
> --- a/hw/arm_gic.c
> +++ b/hw/arm_gic.c
[...]
> @@ -131,11 +123,9 @@ typedef struct gic_state
>  
>  static inline int gic_get_current_cpu(gic_state *s)
>  {
> -#if NCPU > 1
>      if (s->num_cpu > 1) {
>          return cpu_single_env->cpu_index;
>      }
> -#endif
>      return 0;
>  }

Why special-case the num_cpu == 1 case? Is cpu_single_env not available
in all cases?

Otherwise looks good.

/-F

-- 
SUSE LINUX Products GmbH, Maxfeldstr. 5, 90409 Nürnberg, Germany
GF: Jeff Hawn, Jennifer Guild, Felix Imendörffer; HRB 16746 AG Nürnberg



reply via email to

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