Function report |
Source Code:kernel\power\hibernate.c |
Create Date:2022-07-28 09:59:25 |
Last Modify:2020-03-12 14:18:49 | Copyright©Brick |
home page | Tree |
Annotation kernel can get tool activity | Download SCCT | Chinese |
Name:hibernate - Carry out system hibernation, including saving the image.
Proto:int hibernate(void)
Type:int
Parameter:Nothing
697 | nr_calls = 0 |
698 | bool snapshot_test = false |
700 | If Not hibernation_available() Then |
705 | lock_system_sleep() |
712 | pr_info("hibernation entry\n") |
713 | pm_prepare_console() |
714 | error = __pm_notifier_call_chain(Going to hibernate , - 1, & nr_calls) |
715 | If error Then |
720 | ksys_sync_helper() |
726 | lock_device_hotplug() |
728 | error = create_basic_memory_bitmaps() |
733 | If error || freezer_test_done Then Go to Free_bitmaps |
736 | If in_suspend Then |
737 | flags = 0 |
739 | If hibernation_mode == HIBERNATION_PLATFORM Then flags |= Flags that can be passed from the hibernatig hernel to the "boot" kernel in* the image header. |
741 | If nocompress Then flags |= SF_NOCOMPRESS_MODE |
743 | Else flags |= SF_CRC32_MODE |
746 | pm_pr_dbg("Writing image.\n") |
747 | error = swsusp_write(flags) |
748 | swsusp_free() |
749 | If Not error Then |
750 | If hibernation_mode == HIBERNATION_TEST_RESUME Then snapshot_test = true |
755 | in_suspend = 0 |
756 | pm_restore_gfp_mask() |
757 | Else |
758 | pm_pr_dbg("Image restored successfully.\n") |
761 | Free_bitmaps : |
763 | Thaw : |
764 | unlock_device_hotplug() |
765 | If snapshot_test Then |
766 | pm_pr_dbg("Checking hibernation image\n") |
768 | If Not error Then error = load_image_and_restore() |
771 | thaw_processes() |
774 | freezer_test_done = false |
775 | Exit : |
776 | __pm_notifier_call_chain(Hibernation finished , nr_calls, NULL) |
777 | pm_restore_console() |
779 | Unlock : |
780 | unlock_system_sleep() |
781 | pr_info("hibernation exit\n") |
783 | Return error |
Name | Describe |
---|---|
try_to_suspend |
Source code conversion tool public plug-in interface | X |
---|---|
Support c/c++/esqlc/java Oracle/Informix/Mysql Plug-in can realize: logical Report Code generation and batch code conversion |