登录/注册
下载豆瓣客户端
豆瓣
6.0
全新发布
×
豆瓣
扫码直接下载
iPhone
·
Android
豆瓣
读书
电影
音乐
同城
小组
阅读
FM
时间
豆品
豆瓣读书
搜索:
购书单
电子图书
2023年度榜单
2023年度报告
《LINUX设备驱动程序(第二版)》的原文摘录
按热度排序
按页码排序
GFP_ATOMIC Used to allocate memory from interrupt handlers and other code outside of a process context. Never sleeps. GFP_KERNEL Normal allocation of kernel memory. May sleep. (
查看原文
)
jeff
1赞
2015-05-24 11:18:57
—— 引自第214页
struct gendisk is a dynamically allocated structure that requires special kernel manipulation to be initialized; drivers cannot allocate the structure on their own. Instead, you must call: (
查看原文
)
Anana
2015-09-21 18:42:59
—— 引自第468页
The minors argument should be the number of minor numbers this disk uses; note that you cannot change the minors field later and expect things to work properly. When a disk is no longer needed, it should be freed with: (
查看原文
)
Anana
2015-09-21 18:42:59
—— 引自第468页
A gendisk is a reference-counted structure (it contains a kobject). There are get_disk and put_disk functions available to manipulate the reference count, but drivers should never need to do that. Normally, the call to del_gendisk removes the final reference to a gendisk, but there are no guarantees of that. Thus, it is possible that the structure could continue to exist (and your methods could be called) after a call to del_gendisk. If you delete the structure when there are no users (that is, after the final release or in your module cleanup function), however, you can be sure that you will not hear from it again. Allocating a gendisk structure does not make the disk available to the system. To do that, you must initialize the structure and call add_disk: (
查看原文
)
Anana
2015-09-21 18:42:59
—— 引自第468页
>
我来写笔记
>
LINUX设备驱动程序(第二版)
作者:
(美)鲁比足等
原作名:
Linux Device Drivers
isbn:
7508312945
书名:
LINUX设备驱动程序(第二版)
页数:
565
译者:
魏永明
定价:
69.00元
出版社:
中国电力出版社
装帧:
平装
出版年:
2004-09-01