static int nmi_start(void);
static void nmi_stop(void);
- static void nmi_cpu_stop(void *dummy);
- static void nmi_cpu_start(void *dummy);
+ static void nmi_cpu_start(void *dummy);
+ static void nmi_cpu_stop(void *dummy);
+static void nmi_cpu_save_mpx_registers(struct op_msrs *msrs);
+static void nmi_cpu_restore_mpx_registers(struct op_msrs *msrs);
/* 0 == registered but off, 1 == registered and on */
static int nmi_enabled = 0;
return -ENODEV;
}
- init_sysfs();
+ #ifdef CONFIG_SMP
+ register_cpu_notifier(&oprofile_cpu_nb);
+ #endif
- using_nmi = 1;
+ /* default values, can be overwritten by model */
+ __raw_get_cpu_var(switch_index) = 0;
ops->create_files = nmi_create_files;
ops->setup = nmi_setup;
ops->shutdown = nmi_shutdown;
void op_nmi_exit(void)
{
- if (using_nmi)
+ if (using_nmi) {
exit_sysfs();
+ #ifdef CONFIG_SMP
+ unregister_cpu_notifier(&oprofile_cpu_nb);
+ #endif
+ if (model->exit)
+ model->exit();
+ }
}