Beispiel #1
0
VbError_t VbExDiskGetInfo(VbDiskInfo **info_ptr, uint32_t *count,
			  uint32_t disk_flags)
{
	*count = 0;

	blockdev_type_t bd_type;
	ListNode *devs;

	if (disk_flags & VB_DISK_FLAG_FIXED)
		bd_type = BLOCKDEV_FIXED;
	else
		bd_type = BLOCKDEV_REMOVABLE;

	*count = get_all_bdevs(bd_type, &devs);

	// Only log for fixed disks to avoid spamming timestamps in recovery.
	if (disk_flags & VB_DISK_FLAG_FIXED)
		timestamp_add_now(TS_VB_STORAGE_INIT_DONE);

	// Allocate enough VbDiskInfo structures.
	VbDiskInfo *disk = NULL;
	if (*count)
		disk = xzalloc(sizeof(VbDiskInfo) * *count);

	*info_ptr = disk;

	// Fill them from the BlockDev structures.
	BlockDev *bdev;
	list_for_each(bdev, *devs, list_node)
		setup_vb_disk_info(disk++, bdev);

	return VBERROR_SUCCESS;
}
/**
    @function: srec_ksym_addr_t srecorder_get_all_bdevs(void)
    @brief: 获取变量all_bdevs的地址

    @param: none
    
    @return: 变量all_bdevs的地址

    @note: 
*/
srec_ksym_addr_t srecorder_get_all_bdevs(void)
{
#if !(defined(CONFIG_DEBUG_KERNEL) && defined(CONFIG_KALLSYMS_ALL))
    s_all_bdevs = get_all_bdevs();
#endif
    
    return s_all_bdevs;
}