2005-04-17 06:20:36 +08:00
|
|
|
#ifndef __ASM_MACH_APICDEF_H
|
|
|
|
#define __ASM_MACH_APICDEF_H
|
|
|
|
|
2007-10-18 00:04:33 +08:00
|
|
|
#include <asm/apic.h>
|
|
|
|
|
2005-04-17 06:20:36 +08:00
|
|
|
#define APIC_ID_MASK (0xF<<24)
|
|
|
|
|
|
|
|
static inline unsigned get_apic_id(unsigned long x)
|
|
|
|
{
|
2007-10-18 00:04:33 +08: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-17 06:20:36 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
#define GET_APIC_ID(x) get_apic_id(x)
|
|
|
|
|
|
|
|
#endif
|