mach_apicdef.h 548 字节
Newer Older
L
Linus Torvalds 已提交
1 2 3
#ifndef __ASM_MACH_APICDEF_H
#define __ASM_MACH_APICDEF_H

4 5
#include <asm/apic.h>

6 7
#ifdef CONFIG_X86_64
#define	APIC_ID_MASK		(0xFFu<<24)
8
#define GET_APIC_ID(x)          (x)
9
#define	SET_APIC_ID(x)		(((x)<<24))
10
#define GET_XAPIC_ID(x)		(((x) >> 24) & 0xFFu)
11
#else
L
Linus Torvalds 已提交
12 13
#define		APIC_ID_MASK		(0xF<<24)
static inline unsigned get_apic_id(unsigned long x) 
Y
Yinghai Lu 已提交
14
{
15 16 17 18 19
	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 已提交
20 21 22
} 

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

#endif