函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

函数名称:memory_bm_find_bit - Find the bit for a given PFN in a memory bitmap

函数原型:static int memory_bm_find_bit(struct memory_bitmap *bm, unsigned long pfn, void **addr, unsigned int *bit_nr)

返回类型:int

参数:

类型参数名称
struct memory_bitmap *bm
unsigned longpfn
void **addr
unsigned int *bit_nr
714  zone等于zone
716  如果pfn大于等于Zone start page frame pfn小于Zone end page frame + 1 则转到:zone_found
719  zone = NULL
723  如果pfn大于等于Zone start page frame pfn小于Zone end page frame + 1
724  zone等于curr
725  退出
729  如果非zone则返回:负EFAULT
732  zone_found :
743  node等于node
744  如果zone恒等于zonepfnZone start page frame 按位与BM_BLOCK_MASK的反的值恒等于node_pfn则转到:node_found
748  node等于Radix Tree Root
749  block_nr等于pfnZone start page frame 右移BM_BLOCK_SHIFT
751 i大于0循环
754  index等于block_nr右移i减1的差乘BM_RTREE_LEVEL_SHIFT
755  index与等于BM_RTREE_LEVEL_MASK
756  BUG_ON(data[index] == 0)
757  node等于data[index]
760  node_found :
762  zone等于zone
763  node等于node
764  node_pfn等于pfnZone start page frame 按位与BM_BLOCK_MASK的反
767  addr等于data
768  bit_nr等于pfnZone start page frame 按位与BM_BLOCK_MASK
770  返回:0
调用者
名称描述
memory_bm_set_bit
mem_bm_set_bit_check
memory_bm_clear_bit
memory_bm_test_bit
memory_bm_pfn_present