2005-04-16 16:20:36 -06:00
|
|
|
#ifndef __ASM_MACH_APICDEF_H
|
|
|
|
#define __ASM_MACH_APICDEF_H
|
|
|
|
|
2007-10-17 10:04:33 -06:00
|
|
|
#include <asm/apic.h>
|
|
|
|
|
2008-03-19 11:25:53 -06:00
|
|
|
#ifdef CONFIG_X86_64
|
|
|
|
#define APIC_ID_MASK (0xFFu<<24)
|
2008-03-21 16:14:07 -06:00
|
|
|
#define GET_APIC_ID(x) (((x)>>24)&0xFFu)
|
2008-03-19 11:25:53 -06:00
|
|
|
#define SET_APIC_ID(x) (((x)<<24))
|
|
|
|
#else
|
2005-04-16 16:20:36 -06:00
|
|
|
#define APIC_ID_MASK (0xF<<24)
|
|
|
|
static inline unsigned get_apic_id(unsigned long x)
|
2008-03-21 16:14:07 -06:00
|
|
|
{
|
2007-10-17 10:04:33 -06:00
|
|
|
unsigned int ver = GET_APIC_VERSION(apic_read(APIC_LVR));
|
|
|
|
if (APIC_XAPIC(ver))
|
|
|
|
return (((x)>>24)&0xFF);
|
|
|
|
else
|
|
|
|
return (((x)>>24)&0xF);
|
2005-04-16 16:20:36 -06:00
|
|
|
}
|
|
|
|
|
|
|
|
#define GET_APIC_ID(x) get_apic_id(x)
|
2008-03-21 16:14:07 -06:00
|
|
|
#endif
|
2005-04-16 16:20:36 -06:00
|
|
|
|
|
|
|
#endif
|