宣告記憶體的使用方法
[php]
/* Buffer to store data */
char *memory_buffer;
int memory_init(void) {
/* Allocating memory for the buffer */
memory_buffer = kmalloc(1, GFP_KERNEL);
if (!memory_buffer)
result = -ENOMEM;
}else{
result = 0;
}
return result;
}
[/php]