コード例 #1
0
int create_mmc_fdisk(int argc, char *argv[])
{
	int		rv;
	int		total_block_count;
#if defined(CONFIG_MMC_64BIT_BUS) || defined(CONFIG_CPU_EXYNOS5410_EVT2)
	ALLOC_CACHE_ALIGN_BUFFER(unsigned char, mbr, 512);
#else
	unsigned char	mbr[512];
#endif

	memset(mbr, 0x00, 512);

	total_block_count = get_mmc_block_count(argv[2]);
	if (total_block_count < 0)
		return -1;

	make_mmc_partition(total_block_count, mbr, (argc==6?1:0), argv);

	rv = put_mmc_mbr(mbr, argv[2]);
	if (rv != 0)
		return -1;

	printf("fdisk is completed\n");

	argv[1][1] = 'p';
	print_mmc_part_info(argc, argv);
	return 0;
}
コード例 #2
0
ファイル: cmd_mmc_fdisk.c プロジェクト: exynos4-sdk/uboot
int create_mmc_fdisk(int argc, char *argv[])
{
	int		rv;
	int		total_block_count;
	unsigned char	mbr[512];

	memset(mbr, 0x00, 512);
	
	total_block_count = get_mmc_block_count(argv[2]);
	if (total_block_count < 0)
		return -1;
	
	make_mmc_partition(total_block_count, mbr, (argc==6?1:0), argv);

	rv = put_mmc_mbr(mbr, argv[2]);
	if (rv != 0)
		return -1;
		
	printf("fdisk is completed\n");

	argv[1][1] = 'p';
	print_mmc_part_info(argc, argv);
	return 0;
}