android_kernel_xiaomi_sdm845/include/asm-x86/mach-default/mach_apicdef.h
Suresh Siddha 0c81c746f9 x64, x2apic/intr-remap: introduce read_apic_id() to genapic routines
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>
2008-07-12 08:44:57 +02:00

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