Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:kernel\power\snapshot.c Create Date:2022-07-28 10:00:37
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:memory_bm_find_bit - Find the bit for a given PFN in a memory bitmap

Proto:static int memory_bm_find_bit(struct memory_bitmap *bm, unsigned long pfn, void **addr, unsigned int *bit_nr)

Type:int

Parameter:

TypeParameterName
struct memory_bitmap *bm
unsigned longpfn
void **addr
unsigned int *bit_nr
714  zone = zone
716  If pfn >= Zone start page frame && pfn < Zone end page frame + 1 Then Go to zone_found
719  zone = NULL
723  If pfn >= Zone start page frame && pfn < Zone end page frame + 1 Then
724  zone = curr
725  Break
729  If Not zone Then Return -EFAULT
732  zone_found :
743  node = node
744  If zone == zone && ( pfn - Zone start page frame & ~BM_BLOCK_MASK) == node_pfn Then Go to node_found
748  node = Radix Tree Root
749  block_nr = pfn - Zone start page frame >> BM_BLOCK_SHIFT
751  When i > 0 cycle
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 = pfn - Zone start page frame & ~BM_BLOCK_MASK
767  addr = data
768  bit_nr = pfn - Zone start page frame & BM_BLOCK_MASK
770  Return 0
Caller
NameDescribe
memory_bm_set_bit
mem_bm_set_bit_check
memory_bm_clear_bit
memory_bm_test_bit
memory_bm_pfn_present