x86: surround hard_smp_processor_id in APIC_DEFINITION
APIC_DEFINITION is not defined in x86_64, so in practice, we keep our old code here. But as a nice side effect, the code is now equal to smp_32.h. Signed-off-by: Glauber Costa <gcosta@redhat.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
This commit is contained in:
committed by
Ingo Molnar
parent
fe176de0ff
commit
fe874b3edf
@@ -52,12 +52,16 @@ static inline int logical_smp_processor_id(void)
|
|||||||
return GET_APIC_LOGICAL_ID(*(u32 *)(APIC_BASE + APIC_LDR));
|
return GET_APIC_LOGICAL_ID(*(u32 *)(APIC_BASE + APIC_LDR));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# ifdef APIC_DEFINITION
|
||||||
|
extern int hard_smp_processor_id(void);
|
||||||
|
# else
|
||||||
# include <mach_apicdef.h>
|
# include <mach_apicdef.h>
|
||||||
static inline int hard_smp_processor_id(void)
|
static inline int hard_smp_processor_id(void)
|
||||||
{
|
{
|
||||||
/* we don't want to mark this access volatile - bad code generation */
|
/* we don't want to mark this access volatile - bad code generation */
|
||||||
return GET_APIC_ID(*(u32 *)(APIC_BASE + APIC_ID));
|
return GET_APIC_ID(*(u32 *)(APIC_BASE + APIC_ID));
|
||||||
}
|
}
|
||||||
|
# endif /* APIC_DEFINITION */
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user