aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorSiddha, Suresh B <suresh.b.siddha@intel.com>2007-10-17 12:04:33 -0400
committerThomas Gleixner <tglx@inhelltoy.tec.linutronix.de>2007-10-17 14:15:24 -0400
commit58d5fa7a6a6fc4754d295d0999b284edd67c8620 (patch)
tree19d1ff3dbb73503d3ed45a2c43cb9167e822ec68 /include
parent801916c1b369b637ce799e6c71a94963ff63df79 (diff)
i386: fix 4 bit apicid assumption of mach-default
Fix get_apic_id() in mach-default, so that it uses 8 bits incase of xAPIC case and 4 bits for legacy APIC case. This fixes the i386 kernel assumption that apic id is less than 16 for xAPIC platforms with 8 cpus or less and makes the kernel boot on such platforms. [ tglx: arch/x86 adaptation ] Signed-off-by: Suresh Siddha <suresh.b.siddha@intel.com> Signed-off-by: Andi Kleen <ak@suse.de> Cc: Andi Kleen <ak@suse.de> Cc: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'include')
-rw-r--r--include/asm-x86/mach-default/mach_apicdef.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/include/asm-x86/mach-default/mach_apicdef.h b/include/asm-x86/mach-default/mach_apicdef.h
index 7bcb350c3ee8..ae9841319094 100644
--- a/include/asm-x86/mach-default/mach_apicdef.h
+++ b/include/asm-x86/mach-default/mach_apicdef.h
@@ -1,11 +1,17 @@
1#ifndef __ASM_MACH_APICDEF_H 1#ifndef __ASM_MACH_APICDEF_H
2#define __ASM_MACH_APICDEF_H 2#define __ASM_MACH_APICDEF_H
3 3
4#include <asm/apic.h>
5
4#define APIC_ID_MASK (0xF<<24) 6#define APIC_ID_MASK (0xF<<24)
5 7
6static inline unsigned get_apic_id(unsigned long x) 8static inline unsigned get_apic_id(unsigned long x)
7{ 9{
8 return (((x)>>24)&0xF); 10 unsigned int ver = GET_APIC_VERSION(apic_read(APIC_LVR));
11 if (APIC_XAPIC(ver))
12 return (((x)>>24)&0xFF);
13 else
14 return (((x)>>24)&0xF);
9} 15}
10 16
11#define GET_APIC_ID(x) get_apic_id(x) 17#define GET_APIC_ID(x) get_apic_id(x)