函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:block\partitions\efi.c Create Date:2022-07-27 19:06:47
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称:s_pmbr_valid(): test Protective MBR for validity*@mbr: pointer to a legacy mbr structure*@total_sectors: amount of sectors in the device* Description: Checks for a valid protective or hybrid* master boot record (MBR)

函数原型:static int is_pmbr_valid(legacy_mbr *mbr, sector_t total_sectors)

返回类型:int

参数:

类型参数名称
legacy_mbr *mbr
sector_ttotal_sectors
176  sz等于0
177  part等于0, ret等于0
179  如果非mbrle16_to_cpu(signature)不等于MSDOS_MBR_SIGNATURE则转到:done
182 i小于4循环
183  ret等于pmbr_part_valid( & partition_record[i])
184  如果ret恒等于GPT_MBR_PROTECTIVE
185  part等于i
191  转到:check_hybrid
195  如果ret不等于GPT_MBR_PROTECTIVE则转到:done
197  check_hybrid :
198 i小于4循环如果 EFI and legacy non-EFI OS types 不等于EFI_PMBR_OSTYPE_EFI_GPT EFI and legacy non-EFI OS types 不等于0x00则
202  ret等于GPT_MBR_HYBRID
216  如果ret恒等于GPT_MBR_PROTECTIVE
217  sz等于le32_to_cpu( used by EFI - size of pt in LBA )
218  如果sz不等于total_sectors减1且sz不等于0xFFFFFFFF则pr_debug("GPT: mbr size in lba (%u) different than whole disk (%u).\n", sz, min_t - return minimum of two values, using the specified type*@type: data type to use*@x: first value*@y: second value(uint32_t, total_sectors - 1, 0xFFFFFFFF))
223  done :
224  返回:ret
调用者
名称描述
find_valid_gptd_valid_gpt() - Search disk for valid GPT headers and PTEs*@state: disk parsed partitions*@gpt: GPT header ptr, filled on return.*@ptes: PTEs ptr, filled on return.* Description: Returns 1 if valid, 0 on error.