VirtualBox

Ticket #4311: test-cli.c

File test-cli.c, 467 bytes (added by Anders Kaseorg, 15 years ago)

test kernel module

Line 
1#include <linux/module.h>
2
3extern unsigned char code[], end_code[];
4
5int init_module(void)
6{
7 unsigned char *p;
8 printk("Before: ");
9 for (p = code; p != end_code; p++) printk("%02x ", *p);
10 printk("\n");
11 asm("code:\n"
12 "pushf; cli; nop; nop; nop; nop; popf\n"
13 "end_code:\n"
14 : : : "memory");
15 printk("After: ");
16 for (p = code; p != end_code; p++) printk("%02x ", *p);
17 printk("\n");
18 return 0;
19}
20
21void cleanup_module(void)
22{
23}
24
25MODULE_LICENSE("GPL");

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy