0c81c746f9
Move the read_apic_id() to genapic routines. Signed-off-by: Suresh Siddha <suresh.b.siddha@intel.com> Cc: akpm@linux-foundation.org Cc: arjan@linux.intel.com Cc: andi@firstfloor.org Cc: ebiederm@xmission.com Cc: jbarnes@virtuousgeek.org Cc: steiner@sgi.com Signed-off-by: Ingo Molnar <mingo@elte.hu>
26 lines
548 B
C
26 lines
548 B
C
#ifndef __ASM_MACH_APICDEF_H
|
|
#define __ASM_MACH_APICDEF_H
|
|
|
|
#include <asm/apic.h>
|
|
|
|
#ifdef CONFIG_X86_64
|
|
#define APIC_ID_MASK (0xFFu<<24)
|
|
#define GET_APIC_ID(x) (x)
|
|
#define SET_APIC_ID(x) (((x)<<24))
|
|
#define GET_XAPIC_ID(x) (((x) >> 24) & 0xFFu)
|
|
#else
|
|
#define APIC_ID_MASK (0xF<<24)
|
|
static inline unsigned get_apic_id(unsigned long x)
|
|
{
|
|
unsigned int ver = GET_APIC_VERSION(apic_read(APIC_LVR));
|
|
if (APIC_XAPIC(ver))
|
|
return (((x)>>24)&0xFF);
|
|
else
|
|
return (((x)>>24)&0xF);
|
|
}
|
|
|
|
#define GET_APIC_ID(x) get_apic_id(x)
|
|
#endif
|
|
|
|
#endif
|