diff options
author | Vojtech Pavlik <vojtech@suse.cz> | 2006-09-26 04:52:28 -0400 |
---|---|---|
committer | Andi Kleen <andi@basil.nowhere.org> | 2006-09-26 04:52:28 -0400 |
commit | c08c820508233b424deab3302bc404bbecc6493a (patch) | |
tree | d6ed79fb2d03513f6c71fc7e47705c4a19512f53 /include/asm-x86_64/smp.h | |
parent | a670fad0adb1cc6202a607d250f10bd380593905 (diff) |
[PATCH] Add the vgetcpu vsyscall
This patch adds a vgetcpu vsyscall, which depending on the CPU RDTSCP
capability uses either the RDTSCP or CPUID to obtain a CPU and node
numbers and pass them to the program.
AK: Lots of changes over Vojtech's original code:
Better prototype for vgetcpu()
It's better to pass the cpu / node numbers as separate arguments
to avoid mistakes when going from SMP to NUMA.
Also add a fast time stamp based cache using a user supplied
argument to speed things more up.
Use fast method from Chuck Ebbert to retrieve node/cpu from
GDT limit instead of CPUID
Made sure RDTSCP init is always executed after node is known.
Drop printk
Signed-off-by: Vojtech Pavlik <vojtech@suse.cz>
Signed-off-by: Andi Kleen <ak@suse.de>
Diffstat (limited to 'include/asm-x86_64/smp.h')
-rw-r--r-- | include/asm-x86_64/smp.h | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/include/asm-x86_64/smp.h b/include/asm-x86_64/smp.h index 6805e1feb300..d61547fd833b 100644 --- a/include/asm-x86_64/smp.h +++ b/include/asm-x86_64/smp.h | |||
@@ -133,13 +133,19 @@ static __inline int logical_smp_processor_id(void) | |||
133 | /* we don't want to mark this access volatile - bad code generation */ | 133 | /* we don't want to mark this access volatile - bad code generation */ |
134 | return GET_APIC_LOGICAL_ID(*(unsigned long *)(APIC_BASE+APIC_LDR)); | 134 | return GET_APIC_LOGICAL_ID(*(unsigned long *)(APIC_BASE+APIC_LDR)); |
135 | } | 135 | } |
136 | #endif | ||
137 | 136 | ||
138 | #ifdef CONFIG_SMP | 137 | #ifdef CONFIG_SMP |
139 | #define cpu_physical_id(cpu) x86_cpu_to_apicid[cpu] | 138 | #define cpu_physical_id(cpu) x86_cpu_to_apicid[cpu] |
140 | #else | 139 | #else |
141 | #define cpu_physical_id(cpu) boot_cpu_id | 140 | #define cpu_physical_id(cpu) boot_cpu_id |
142 | #endif | 141 | static inline int smp_call_function_single(int cpuid, void (*func) (void *info), |
143 | 142 | void *info, int retry, int wait) | |
143 | { | ||
144 | /* Disable interrupts here? */ | ||
145 | func(info); | ||
146 | return 0; | ||
147 | } | ||
148 | #endif /* !CONFIG_SMP */ | ||
149 | #endif /* !__ASSEMBLY */ | ||
144 | #endif | 150 | #endif |
145 | 151 | ||