Linux-Poweroff【S5】

S5是poweroff

hibernate    (kernel/power/hibernate.c)

    |- hibernation_snapshot
    |    |- create_images
    |        |- disable_nonboot_cpus        (kernel/cpu.c)
    |        |    |- _cpu_down
    |        |    |    |- take_cpu_down
    |        |    |    |    |- __cpu_disable    (arch/x86/include/asm/smp.h)    // Ensure this CPU doesn't handle any more interrupts
    |        |    |    |        |- native_cpu_disable    (arch/x86/kernel/Smpboot.c)
    |        |    |    |- __cpu_die    (arch/x86/include/asm/smp.h)    // This actually kills the CPU
    |        |    |        |- native_cpu_die    (arch/x86/kernel/Smpboot.c)
    |        |    |
    |        |    |- cpumask_set_cpu    (include/linux/cpumask.h)
    |        |    
    |        |- in_suspend = 1;
    |        |
    |        |- save_processor_state        (arch/x86/power/cpu.c)
    |        |    |- __save_processor_state
    |        |
    |        |- swsusp_arch_suspend    (arch/x86/power/hibernate_asm_32.S)
    |        |    |- swsusp_save    (kernel/power/snapshot.c)
    |        |
    |        |- restore_processor_state    (arch/x86/power/cpu.c)
    |        |
    |        |- enable_nonboot_cpus        (kernel/cpu.c)
    |
    |-     if (in_suspend) 
        {
            swsusp_write;
            power_down;
            in_suspend = 0;
        }

猜你喜欢

转载自blog.csdn.net/qq_38712943/article/details/84324458