Re: [PATCH 5/8] x86: apic - unify hard_smp_processor_id

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Cyrill Gorcunov
Date: Saturday, August 23, 2008 - 12:45 pm

[Yinghai Lu - Sat, Aug 23, 2008 at 12:13:21PM -0700]
| On Sat, Aug 23, 2008 at 6:01 AM, Cyrill Gorcunov <gorcunov@gmail.com> wrote:
| > Move hard_smp_processor_id to apic_32.c.
| > There is no need to keep it in header - we are linked to
| > apic_xx.c code anyway.
| >
| > Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
| > ---
| >  arch/x86/kernel/apic_32.c |    5 +++++
| >  include/asm-x86/smp.h     |   10 ----------
| >  2 files changed, 5 insertions(+), 10 deletions(-)
| >
| > diff --git a/arch/x86/kernel/apic_32.c b/arch/x86/kernel/apic_32.c
| > index ad295cf..c71a77c 100644
| > --- a/arch/x86/kernel/apic_32.c
| > +++ b/arch/x86/kernel/apic_32.c
| > @@ -1569,6 +1569,11 @@ void __cpuinit generic_processor_info(int apicid, int version)
| >        cpu_set(cpu, cpu_present_map);
| >  }
| >
| > +int hard_smp_processor_id(void)
| > +{
| > +       return read_apic_id();
| > +}
| > +
| >  /*
| >  * Power management
| >  */
| > diff --git a/include/asm-x86/smp.h b/include/asm-x86/smp.h
| > index 29324c1..914a73d 100644
| > --- a/include/asm-x86/smp.h
| > +++ b/include/asm-x86/smp.h
| > @@ -185,17 +185,7 @@ static inline unsigned int read_apic_id(void)
| >  }
| >  #endif
| >
| > -
| > -# if defined(APIC_DEFINITION) || defined(CONFIG_X86_64)
| >  extern int hard_smp_processor_id(void);
| > -# else
| > -#include <mach_apicdef.h>
| > -static inline int hard_smp_processor_id(void)
| > -{
| > -       /* we don't want to mark this access volatile - bad code generation */
| > -       return read_apic_id();
| > -}
| > -# endif /* APIC_DEFINITION */
| >
| >  #else /* CONFIG_X86_LOCAL_APIC */
| >
| > --
| > 1.6.0.6.gc667
| >
| >
| 
| this one seems have some problem with 32bit with genericarch
| 
| because we have
| 
| int hard_smp_processor_id(void)
| {
|         return genapic->get_apic_id(*(unsigned long *)(APIC_BASE+APIC_ID));
| }
| 
| arch/x86/mach-generic/probe.c
| 
| updated 64 bit to have MACRO.
| 
| YH
| 

thanks Yinghai, but isn't it called _after_ x86 apic chip
initialized?

		- Cyrill -
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 0/8] tip/x86/apic - merging snippet, Cyrill Gorcunov, (Sat Aug 23, 6:01 am)
[PATCH 3/8] x86: apic - unify setup_apicpmtimer, Cyrill Gorcunov, (Sat Aug 23, 6:01 am)
[PATCH 5/8] x86: apic - unify hard_smp_processor_id, Cyrill Gorcunov, (Sat Aug 23, 6:01 am)
[PATCH 6/8] x86: apic - unify setup_local_APIC, Cyrill Gorcunov, (Sat Aug 23, 6:01 am)
[PATCH 7/8] x86: apic_32.c should use __cpuinit section, Cyrill Gorcunov, (Sat Aug 23, 6:01 am)
[PATCH 8/8] x86: apic - unify smp_apic_timer_interrupt, Cyrill Gorcunov, (Sat Aug 23, 6:01 am)
Re: [PATCH 5/8] x86: apic - unify hard_smp_processor_id, Cyrill Gorcunov, (Sat Aug 23, 12:45 pm)
Re: [PATCH 5/8] x86: apic - unify hard_smp_processor_id, Cyrill Gorcunov, (Sat Aug 23, 1:18 pm)