Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <linux/module.h> /* Needed by all modules */
- #include <linux/kernel.h> /* Needed for KERN_INFO */
- #include <linux/init.h> /* Needed for the macros */
- int new_wbinvd(void){
- asm volatile ("wbinvd" : : : "memory");
- return 0;
- }
- int new_invd(void){
- asm volatile ("invd" : : : "memory");
- return 0;
- }
- static int __init hello_start(void)
- {
- printk(KERN_INFO "Loading hello module...\n");
- //check if invd instruction executes
- printk(KERN_INFO "running wbinvd\n", new_wbinvd());
- printk(KERN_INFO "running invd\n", new_invd());
- return 0;
- }
- static void __exit hello_end(void)
- {
- printk(KERN_INFO "Goodbye\n");
- }
- module_init(hello_start);
- module_exit(hello_end);
Advertisement
Add Comment
Please, Sign In to add comment