i386: simplify smp_call_function_single() call sequence in cpuid
smp_call_function_single() now knows how to call the function on the current cpu. [ tglx: arch/x86 adaptation ] Cc: H. Peter Anvin <hpa@zytor.com> Signed-off-by: Avi Kivity <avi@qumranet.com> Signed-off-by: Andi Kleen <ak@suse.de> Cc: Andi Kleen <ak@suse.de> 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>
This commit is contained in:
parent
cddf7ff766
commit
4a40cb1ec6
1 changed files with 3 additions and 19 deletions
|
@ -43,8 +43,6 @@
|
||||||
|
|
||||||
static struct class *cpuid_class;
|
static struct class *cpuid_class;
|
||||||
|
|
||||||
#ifdef CONFIG_SMP
|
|
||||||
|
|
||||||
struct cpuid_command {
|
struct cpuid_command {
|
||||||
u32 reg;
|
u32 reg;
|
||||||
u32 *data;
|
u32 *data;
|
||||||
|
@ -62,25 +60,11 @@ static inline void do_cpuid(int cpu, u32 reg, u32 * data)
|
||||||
{
|
{
|
||||||
struct cpuid_command cmd;
|
struct cpuid_command cmd;
|
||||||
|
|
||||||
preempt_disable();
|
cmd.reg = reg;
|
||||||
if (cpu == smp_processor_id()) {
|
cmd.data = data;
|
||||||
cpuid(reg, &data[0], &data[1], &data[2], &data[3]);
|
|
||||||
} else {
|
|
||||||
cmd.reg = reg;
|
|
||||||
cmd.data = data;
|
|
||||||
|
|
||||||
smp_call_function_single(cpu, cpuid_smp_cpuid, &cmd, 1, 1);
|
smp_call_function_single(cpu, cpuid_smp_cpuid, &cmd, 1, 1);
|
||||||
}
|
|
||||||
preempt_enable();
|
|
||||||
}
|
}
|
||||||
#else /* ! CONFIG_SMP */
|
|
||||||
|
|
||||||
static inline void do_cpuid(int cpu, u32 reg, u32 * data)
|
|
||||||
{
|
|
||||||
cpuid(reg, &data[0], &data[1], &data[2], &data[3]);
|
|
||||||
}
|
|
||||||
|
|
||||||
#endif /* ! CONFIG_SMP */
|
|
||||||
|
|
||||||
static loff_t cpuid_seek(struct file *file, loff_t offset, int orig)
|
static loff_t cpuid_seek(struct file *file, loff_t offset, int orig)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Reference in a new issue