123456789101112131415161718192021222324252627282930313233 |
- #include <linux/module.h> // included for all kernel modules
- #include <linux/kernel.h> // included for KERN_INFO
- #include <linux/init.h> // included for __init and __exit macros
- #include <linux/interrupt.h>
- #include <linux/irq.h>
- #include "cppro.h"
- MODULE_LICENSE("GPL");
- MODULE_AUTHOR("Joseph D. Anderson");
- MODULE_DESCRIPTION("CP Protection Device");
- MODULE_VERSION("0.01");
- static int __init cppro_init(void)
- {
- printk(KERN_INFO "[cppro]installed\n");
- //request_irq(7, (irq_handler_t)cppro_ISR, IRQF_TRIGGER_RISING, "power failure", NULL);
- //#define IRQF_TRIGGER_NONE 0x00000000
- //#define IRQF_TRIGGER_RISING 0x00000001
- //#define IRQF_TRIGGER_FALLING 0x00000002
- //#define IRQF_TRIGGER_HIGH 0x00000004
- //#define IRQF_TRIGGER_LOW 0x00000008
- return 0; // Non-zero return means that the module couldn't be loaded.
- }
- static void __exit cppro_cleanup(void)
- {
- printk(KERN_INFO "[cppro]uninstalled\n");
- }
- module_init(cppro_init);
- module_exit(cppro_cleanup);
|