return 0;
}
+
+
+void __exit
+oprofile_arch_exit(void)
+{
+}
arch/i386/$(mcore-y)/
drivers-$(CONFIG_MATH_EMULATION) += arch/i386/math-emu/
drivers-$(CONFIG_PCI) += arch/i386/pci/
-# FIXME: is drivers- right ?
+# must be linked after kernel/
drivers-$(CONFIG_OPROFILE) += arch/i386/oprofile/
CFLAGS += $(mflags-y)
*/
extern int nmi_init(struct oprofile_operations ** ops);
+extern void nmi_exit(void);
extern void timer_init(struct oprofile_operations ** ops);
int __init oprofile_arch_init(struct oprofile_operations ** ops)
timer_init(ops);
return 0;
}
+
+
+void __exit oprofile_arch_exit(void)
+{
+#ifdef CONFIG_X86_LOCAL_APIC
+ nmi_exit();
+#endif
+}
};
-static int __init init_nmi_driverfs(void)
+static int __init init_driverfs(void)
{
driver_register(&nmi_driver);
return device_register(&device_nmi);
}
-late_initcall(init_nmi_driverfs);
+static void __exit exit_driverfs(void)
+{
+ device_unregister(&device_nmi);
+ driver_unregister(&nmi_driver);
+}
+#else
+#define init_driverfs() do { } while (0)
+#define exit_driverfs() do { } while (0)
#endif /* CONFIG_PM */
#endif /* !CONFIG_X86_64 */
+
+/* in order to get driverfs right */
+static int using_nmi;
+
int __init nmi_init(struct oprofile_operations ** ops)
{
__u8 vendor = current_cpu_data.x86_vendor;
return 0;
}
+ init_driverfs();
+ using_nmi = 1;
*ops = &nmi_ops;
printk(KERN_INFO "oprofile: using NMI interrupt.\n");
return 1;
}
+
+
+void __exit nmi_exit(void)
+{
+ if (using_nmi)
+ exit_driverfs();
+}
timer_init(ops);
return 0;
}
+
+
+void __exit oprofile_arch_exit()
+{
+}
timer_init(ops);
return 0;
}
+
+
+void __exit oprofile_arch_exit(void)
+{
+}
timer_init(ops);
return 0;
}
+
+
+void __exit oprofile_arch_exit(void)
+{
+}
static void __exit oprofile_exit(void)
{
oprofilefs_unregister();
+ oprofile_arch_exit();
}
*/
int oprofile_arch_init(struct oprofile_operations ** ops);
+/**
+ * One-time exit/cleanup for the arch.
+ */
+void oprofile_arch_exit(void);
+
/**
* Add a sample. This may be called from any context. Pass
* smp_processor_id() as cpu.