• 内核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
    ");
            else
                    pr_emerg("Restarting system with command '%s'
    ", 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

  • 相关阅读:
    html5——渐变
    html5——背景
    html5——边框
    html5——私有前缀
    html5——盒子模式
    html5——文本阴影
    html5——颜色
    html5——css选择器
    html5——DOM扩展
    html5——多媒体(一)
  • 原文地址:https://www.cnblogs.com/aspirs/p/14774235.html
Copyright © 2020-2023  润新知