内核reboot流程
2021/5/16 18:29:53
本文主要是介绍内核reboot流程,对大家解决编程问题具有一定的参考价值,需要的程序猿们随着小编来一起学习吧!
内核reboot流程
kernel/reboot.c
void kernel_restart(char *cmd) { kernel_restart_prepare(cmd); migrate_to_reboot_cpu(); syscore_shutdown(); if (!cmd) pr_emerg("Restarting system\n"); else pr_emerg("Restarting system with command '%s'\n", cmd); kmsg_dump(KMSG_DUMP_RESTART); machine_restart(cmd); }
->reboot命令
->glibc给所有任务发送kill
->内核态kernel_restart()
->kernel_restart_prepare()
->device_shutdown()
-> dev->driver->shutdown() 调用驱动注册的.shutdown钩子
->migrate_to_reboot_cpu() 关闭cpu hotplug
->syscore_shutdown() 里面ops->shutdown,内核相关子系统(比如clk,irq,pm)注册的shutdown
->machine_restart
->local_irq_disable(); smp_send_stop(); /* Disable interrupts first */
-> 根据 arm_pm_restart是否初始化决定走arm_pm_restart(reboot_mode, cmd),如果是这种case,一般会写pm register将whole cpu reset;或 do_kernel_restart(cmd);
->do_kernel_restart() 执行注册的restart_handler_list
->BIOS->ATF->芯片复位
from: https://zhuanlan.zhihu.com/p/353452093
这篇关于内核reboot流程的文章就介绍到这儿,希望我们推荐的文章对大家有所帮助,也希望大家多多支持为之网!
- 2024-09-21订单系统资料入门教程:轻松管理你的订单
- 2024-09-21Java部署资料:新手入门教程
- 2024-09-21Java部署资料:新手入门教程
- 2024-09-21Java订单系统资料:新手入门教程与实战指南
- 2024-09-21Java管理系统资料入门教程
- 2024-09-21从零开始学习Java监控系统资料
- 2024-09-21Java就业项目资料:新手入门的必备教程
- 2024-09-21Java全端资料:初学者指南
- 2024-09-21Java全栈资料入门教程及资源汇总
- 2024-09-21Java日志系统资料入门教程