mach_apicdef.h 619 字节
Newer Older
H
H. Peter Anvin 已提交
1 2
#ifndef _ASM_X86_MACH_DEFAULT__MACH_APICDEF_H
#define _ASM_X86_MACH_DEFAULT__MACH_APICDEF_H
L
Linus Torvalds 已提交
3

4 5
#include <asm/apic.h>

6
#ifdef CONFIG_X86_64
Y
Yinghai Lu 已提交
7 8 9
#define	APIC_ID_MASK		(genapic->apic_id_mask)
#define GET_APIC_ID(x)		(genapic->get_apic_id(x))
#define	SET_APIC_ID(x)		(genapic->set_apic_id(x))
10
#else
L
Linus Torvalds 已提交
11 12
#define		APIC_ID_MASK		(0xF<<24)
static inline unsigned get_apic_id(unsigned long x) 
Y
Yinghai Lu 已提交
13
{
14 15 16 17 18
	unsigned int ver = GET_APIC_VERSION(apic_read(APIC_LVR));
	if (APIC_XAPIC(ver))
		return (((x)>>24)&0xFF);
	else
		return (((x)>>24)&0xF);
L
Linus Torvalds 已提交
19 20 21
} 

#define		GET_APIC_ID(x)	get_apic_id(x)
Y
Yinghai Lu 已提交
22
#endif
L
Linus Torvalds 已提交
23

H
H. Peter Anvin 已提交
24
#endif /* _ASM_X86_MACH_DEFAULT__MACH_APICDEF_H */