#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#include
#define err(msg) printk(KERN_INFO "%s", msg)
static DEFINE_PER_CPU(int, count);
static int main_init(void)
{
int *p = &get_cpu_var(count);
printk(KERN_INFO "%d\n", *p);
put_cpu_var(count);
get_cpu_var(count)++;
put_cpu_var(count);
p = &get_cpu_var(count);
printk(KERN_INFO "%d\n", *p);
put_cpu_var(count);
return 0;
}
static void main_exit(void)
{
}
module_init(main_init);
module_exit(main_exit);
MODULE_LICENSE("GPL");
阅读(751) | 评论(0) | 转发(0) |