#include #include #include #include #include #include #include MODULE_LICENSE("GPL"); MODULE_AUTHOR("Chris Vanhoof"); void halt_this_cpu(void *unused); spinlock_t my_spinlock; static void halt(void) { printk(KERN_CRIT "obtaining spinlock...\n"); spin_lock_irq(&my_spinlock); printk(KERN_CRIT "sleeping on spinlock...\n"); mdelay(100000); spin_unlock_irq(&my_spinlock); } void halt_this_cpu(void *unused) { halt(); } static int __init init_haltme() { spin_lock_init(&my_spinlock); printk(KERN_CRIT "calling halt()\n"); halt(); return 0; } static void __exit cleanup_haltme() { return; } module_init(init_haltme); module_exit(cleanup_haltme);