1 #include <linux/module.h>
2 #include <linux/preempt.h>
11 static void __rdmsr_on_cpu(void *info)
13 struct msr_info *rv = info;
15 rdmsr(rv->msr_no, rv->l, rv->h);
18 void rdmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 *l, u32 *h)
21 if (smp_processor_id() == cpu)
22 rdmsr(msr_no, *l, *h);
27 smp_call_function_single(cpu, __rdmsr_on_cpu, &rv, 0, 1);
34 static void __wrmsr_on_cpu(void *info)
36 struct msr_info *rv = info;
38 wrmsr(rv->msr_no, rv->l, rv->h);
41 void wrmsr_on_cpu(unsigned int cpu, u32 msr_no, u32 l, u32 h)
44 if (smp_processor_id() == cpu)
52 smp_call_function_single(cpu, __wrmsr_on_cpu, &rv, 0, 1);
57 EXPORT_SYMBOL(rdmsr_on_cpu);
58 EXPORT_SYMBOL(wrmsr_on_cpu);