函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\power\swap.c Create Date:2022-07-27 11:02:57
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:load_image - load the image using the swap map handle*@handle and the snapshot handle @snapshot* (assume there are @nr_pages pages to load)

函数原型:static int load_image(struct swap_map_handle *handle, struct snapshot_handle *snapshot, unsigned int nr_to_read)

返回类型:int

参数:

类型参数名称
struct swap_map_handle *handle
struct snapshot_handle *snapshot
unsigned intnr_to_read
1054  ret等于0
1061  hib_init_batch( & hb)
1063  When reading an {un,}compressed image, we may restore pages in place,* in which case some architectures need these pages cleaning before they* can be executed. We don't know which pages these may be, so clean the lot. = true
1064  打印信息("Loading image data pages (%u pages)...\n", nr_to_read)
1065  m等于nr_to_read除10
1066  如果非mm等于1
1068  nr_pages等于0
1069  start等于ktime_get()
1070  循环
1071  ret等于snapshot_write_next - Get the address to store the next image page.*@handle: Snapshot handle structure to guide the writing.* On the first call, @handle should point to a zeroed snapshot_handle* structure
1072  如果ret小于等于0则退出
1074  ret等于swap_read_page(handle, This macro returns the address from/to which the caller of* snapshot_read_next()/snapshot_write_next() is allowed to* read/write data after the function returns( * snapshot), & hb)
1075  如果ret退出
1077  如果Set to one to notify the caller of* snapshot_write_next() that it may* need to call wait_on_bio_chain()ret等于hib_wait_io( & hb)
1079  如果ret退出
1081  如果非nr_pagesm的模则打印信息("Image loading progress: %3d%%\n", nr_pages / m * 10)
1084  nr_pages自加
1086  err2等于hib_wait_io( & hb)
1087  stop等于ktime_get()
1088  如果非retret等于err2
1090  如果非ret
1091  打印信息("Image loading done\n")
1092  snapshot_write_finalize - Complete the loading of a hibernation image.* Must be called after the last call to snapshot_write_next() in case the last* page in the image happens to be a highmem page and its contents should be* stored in highmem
1093  如果非snapshot_image_loaded(snapshot)则ret等于负ENODATA
1096  swsusp_show_speed - Print time elapsed between two events during hibernation.*@start: Starting event.*@stop: Final event.*@nr_pages: Number of memory pages processed between @start and @stop.*@msg: Additional diagnostic message to print.
1097  返回:ret
调用者
名称描述
swsusp_readswsusp_read - read the hibernation image.*@flags_p: flags passed by the "frozen" kernel in the image header should* be written into this memory location