reboot系统调用的时候会调用shutdown函数
来源:互联网 发布:手机不能连接数据网络 编辑:程序博客网 时间:2024/06/05 03:32
在注册platform_driver的时候,其中的shutdown函数是什么时候调用的呢?static struct platform_driver advwdt_driver = {.remove= advwdt_remove,.shutdown= advwdt_shutdown,.driver= {.name= DRV_NAME,},};其调用flow如下:reboot->kernel_restart->kernel_restart_prepare->device_shutdownvoid device_shutdown(void){//从device_shutdown的实现看首先调用bus->shutdown,如果bus没有shutdown,则调用dev->driver->shutdownif (dev->bus && dev->bus->shutdown) {if (initcall_debug)dev_info(dev, "shutdown\n");dev->bus->shutdown(dev);} else if (dev->driver && dev->driver->shutdown) {if (initcall_debug)dev_info(dev, "shutdown\n");dev->driver->shutdown(dev);}}而platform_bus_type 定义如下:struct bus_type platform_bus_type = {.name= "platform",.dev_groups= platform_dev_groups,.match= platform_match,.uevent= platform_uevent,.pm= &platform_dev_pm_ops,};可以看到platform_bus_type 并没有定义shutdown函数,因此在device_shutdown 中最终会调用driver->shutdown本例子中就是调用advwdt_shutdown
阅读全文
0 0
- reboot系统调用的时候会调用shutdown函数
- reboot系统调用
- linux系统调用reboot
- Linux系统下的shutdown和reboot
- 7.2 Shutdown系统调用
- linux驱动代码里面完成shutdown或者reboot的调用方法
- 为什么在实例化子类的对象的时候会调用先调用父类的构造函数
- 调用系统的函数
- 在Unity中添加代码,会自动调用代码中的Reset函数,当修改代码中的变量的时候,会调用OnValidate函数
- 系统调用、函数调用
- 系统调用&函数调用
- socket关闭连接 -- shutdown系统调用
- LinuxTCP shutdown和close系统调用
- Swift 系统学习 11 函数 函数的声明 和调用 下划线 调用的时候 忽略参数名
- 调用函数的时候不能禁用按钮
- 函数调用的时候出现不同的js调用方法
- 常常在拼网页的时候,js调用会失效
- Linux系统调用reboot中魔术参数背后鲜为人知的趣味
- linux_shell
- 火狐浏览器禁用js
- Java多线程系列--“JUC锁”07之 LockSupport
- 鼠标拖拽事件实现
- 分享几个前端工具--制作加载中小图标
- reboot系统调用的时候会调用shutdown函数
- 基于rk3288平台android5.1系统的wifi流程分析 ---- 打开wifi,扫描热点
- druid读取clob字段问题
- java.lang.OutOfMemoryError: PermGen space解决方法
- 将jar包安装到本地仓库
- 下拉菜单
- Redis入门
- 教你搭建vs2013+Qt5的开发环境
- webuploader 多文件上传