x86: apic/apic.c declare default_init_apic_ldr() before it get used
PATCH 1/2 x86: apic/apic.c declare default_init_apic_ldr() before it get used
default_init_apic_ldr() is also required for 64 bit so moving it out from CONFIG_X86_32.
--- arch/x86/include/asm/apic.h | 8 ++++---- 1 files changed, 4 insertions(+), 4 deletions(-)
arch/x86/include/asm/apic.h +4 -4
@@ -469,10 +469,6 @@ static inline unsigned int read_apic_id(void)extern void default_setup_apic_routing (void ); -#ifdef CONFIG_X86_32 - -extern struct apic apic_default; -/* * Set up the logical destination ID. *
@@ -482,6 +478,10 @@ extern struct apic apic_default;*/ extern void default_init_apic_ldr (void ); +#ifdef CONFIG_X86_32 + +extern struct apic apic_default; +static inline int default_apic_id_registered (void ) {return physid_isset (read_apic_id (), phys_cpu_present_map);
Signature · 1 line
1.6.0.6
PATCH 2/2 x86: apic/apic.c native_apic_write_dummy() should be static
--- arch/x86/kernel/apic/apic.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
arch/x86/kernel/apic/apic.c +1 -1
@@ -243,7 +243,7 @@ static int modern_apic(void)* bare function to substitute write operation * and it's _that_ fast :) */ -void native_apic_write_dummy (u32 reg,u32 v) +static void native_apic_write_dummy (u32 reg,u32 v) {WARN_ON_ONCE ((cpu_has_apic || !disable_apic)); }
Signature · 1 line
1.6.0.6
Re: [PATCH 2/2] x86: apic/apic.c native_apic_write_dummy() should be static
Quoted 20 lines · Jaswinder Singh Rajput
Signed-off-by Jaswinder Singh Rajput <[email protected]>--- arch/x86/kernel/apic/apic.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)arch/x86/kernel/apic/apic.c +1
-2@@ -243,7 +243,7 @@ static int modern_apic(void)* bare function to substitute write operation * and it's _that_ fast :) */ -void native_apic_write_dummy (u32 reg,u32 v) +static void native_apic_write_dummy (u32 reg,u32 v) {WARN_ON_ONCE ((cpu_has_apic || !disable_apic)); } --
Quoted 1 line
1.6.0.6
Hi Jaswinder,
Check please latest tip numa branch. I thought Yinghai already fixed this nit.
Quoted 3 lines · Jaswinder Singh Rajput
default_init_apic_ldr()is also required for 64 bit so moving it out fromCONFIG_X86_32.
[linux-2.6-tip]$ git grep default_init_apic_ldr arch/x86/ arch/x86/include/asm/apic.h:extern void default_init_apic_ldr(void); arch/x86/kernel/apic/apic.c:void default_init_apic_ldr(void)arch/x86/kernel/apic/probe_32.c: .init_apic_ldr = default_init_apic_ldr,
I have a hard time to see how 64bit requires that function.
Thanks,
tglx
PATCH 1/1 x86: apic/apic.c default_init_apic_ldr() is required only for X86_32
Quoted 5 lines · Thomas Gleixner
Quoted 3 lines · Jaswinder Singh Rajput
default_init_apic_ldr()is also required for 64 bit so moving it out fromCONFIG_X86_32.
Quoted 7 lines
[linux-2.6-tip]$ git grep
default_init_apic_ldrarch/x86/arch/x86/include/asm/apic.h:extern voiddefault_init_apic_ldr(void); arch/x86/kernel/apic/apic.c:voiddefault_init_apic_ldr(void)arch/x86/kernel/apic/probe_32.c: .init_apic_ldr =default_init_apic_ldr,I have a hard time to see how 64bit requires that function.
Here is new patch to make you easy :-)
[PATCH] x86: apic/apic.c default_init_apic_ldr() is required only for X86_32
default_init_apic_ldr() is used only by X86_32.
--- arch/x86/kernel/apic/apic.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-)
arch/x86/kernel/apic/apic.c +1 -1
@@ -1941,6 +1941,7 @@ int hard_smp_processor_id(void)return read_apic_id (); } +#ifdef CONFIG_X86_32 void default_init_apic_ldr (void ) {unsigned long val;
@@ -1951,7 +1952,6 @@ void default_init_apic_ldr(void)apic_write (APIC_LDR , val); } -#ifdef CONFIG_X86_32 int default_apicid_to_node (int logical_apicid) {#ifdef CONFIG_SMP
Signature · 1 line
1.6.0.6
Re: [PATCH -tip] x86: apic/apic.c default_init_apic_ldr() is required only for X86_32
Quoted 11 lines · Jaswinder Singh Rajput
Quoted 10 lines · Thomas Gleixner
Quoted 3 lines · Jaswinder Singh Rajput
default_init_apic_ldr()is also required for 64 bit so moving it out fromCONFIG_X86_32.[linux-2.6-tip]$ git grep
default_init_apic_ldrarch/x86/arch/x86/include/asm/apic.h:extern voiddefault_init_apic_ldr(void); arch/x86/kernel/apic/apic.c:voiddefault_init_apic_ldr(void)arch/x86/kernel/apic/probe_32.c: .init_apic_ldr =default_init_apic_ldr,
Quoted 9 lines
Quoted 2 lines
I have a hard time to see how 64bit requires that function.
Here is new patch to make you easy :-)
[PATCH] x86:
apic/apic.cdefault_init_apic_ldr()is required only forX86_32
default_init_apic_ldr()is used only byX86_32.
I think it will be better to use this:
[PATCH-tip] x86: apic/apic.c move default_init_apic_ldr() and default_apicid_to_node() to probe_32.c
default_init_apic_ldr() and default_apicid_to_node() is used only by probe_32.c so move them to probe_32.c and make them static.
--- arch/x86/include/asm/apic.h | 11 ----------- arch/x86/kernel/apic/apic.c | 21 --------------------- arch/x86/kernel/apic/probe_32.c | 27 +++++++++++++++++++++++++++ 3 files changed, 27 insertions(+), 32 deletions(-)
arch/x86/include/asm/apic.h +0 -11
@@ -473,15 +473,6 @@ extern void default_setup_apic_routing(void);extern struct apic apic_default; -/* -* Set up the logical destination ID. -* -* Intel recommends to set DFR, LDR and TPR before enabling -* an APIC. See e.g. "AP-388 82489DX User's Manual" (Intel -* document number 292116). So here it goes... -*/ -extern void default_init_apic_ldr (void ); -static inline int default_apic_id_registered (void ) {return physid_isset (read_apic_id (), phys_cpu_present_map);
@@ -492,8 +483,6 @@ static inline int default_phys_pkg_id(int cpuid_apic, int index_msb)return cpuid_apic >> index_msb; } -extern int default_apicid_to_node (int logical_apicid); -#endif static inline unsigned int
arch/x86/kernel/apic/apic.c +0 -21
@@ -1941,27 +1941,6 @@ int hard_smp_processor_id(void)return read_apic_id (); } -void default_init_apic_ldr (void ) -{ -unsigned long val; - -apic_write (APIC_DFR ,APIC_DFR_VALUE ); - val =apic_read (APIC_LDR ) & ~APIC_LDR_MASK ; - val |=SET_APIC_LOGICAL_ID (1UL <<smp_processor_id ()); -apic_write (APIC_LDR , val); -} - -#ifdef CONFIG_X86_32 -int default_apicid_to_node (int logical_apicid) -{ -#ifdef CONFIG_SMP -return apicid_2_node[hard_smp_processor_id ()]; -#else -return 0 ; -#endif -} -#endif -/* * Power management */
arch/x86/kernel/apic/probe_32.c +27 -0
@@ -93,6 +93,33 @@ static int probe_default(void)return 1 ; } +/* +* Set up the logical destination ID. +* +* Intel recommends to set DFR, LDR and TPR before enabling +* an APIC. See e.g. "AP-388 82489DX User's Manual" (Intel +* document number 292116). So here it goes... +*/ + +static void default_init_apic_ldr (void ) +{ +unsigned long val; + +apic_write (APIC_DFR ,APIC_DFR_VALUE ); + val =apic_read (APIC_LDR ) & ~APIC_LDR_MASK ; + val |=SET_APIC_LOGICAL_ID (1UL <<smp_processor_id ()); +apic_write (APIC_LDR , val); +} + +static int default_apicid_to_node (int logical_apicid) +{ +#ifdef CONFIG_SMP +return apicid_2_node[hard_smp_processor_id ()]; +#else +return 0 ; +#endif +} +struct apic apic_default = { .name ="default" ,
Signature · 1 line
1.6.0.6