#include <linux/kernel.h>
#include <linux/module.h>
#include <linux/init.h>
#include <linux/interrup.h>
#include <mach/irqs.h>
irqreturn_t wdt_handler(int irq, void *dev_id) {
printk("watch-dog interrupt\n");
return IRQ_HANDLED;
}
int hello_init(void) {
printk("hello module loaded\n");
if (request_irq(36, wdt_handler, IRQF_DISABLED, "WatchDog", NULL) < 0) {
printk("request_irq failed\n");
}
return 0;
}
void hello_exit(void) {
printk("hello module unloaded\n");
free_irq(36, NULL);
return;
}
module_init(hello_init);
module_exit(hello_exit);
MODULE_LICENSE("GPL");