Lines Matching refs:gpt_head
199 ALLOC_CACHE_ALIGN_BUFFER_PAD(gpt_header, gpt_head, 1, dev_desc->rawblksz); in get_disk_guid()
205 gpt_head, &gpt_pte) != 1) { in get_disk_guid()
208 gpt_head, &gpt_pte) != 1) { in get_disk_guid()
218 guid_bin = gpt_head->disk_guid.b; in get_disk_guid()
226 ALLOC_CACHE_ALIGN_BUFFER_PAD(gpt_header, gpt_head, 1, dev_desc->rawblksz); in part_print_efi()
235 gpt_head, &gpt_pte) != 1) { in part_print_efi()
238 gpt_head, &gpt_pte) != 1) { in part_print_efi()
256 for (i = 0; i < le32_to_cpu(gpt_head->num_partition_entries); i++) { in part_print_efi()
287 static gpt_header *gpt_head = NULL; in part_get_info_efi() local
298 if (!gpt_head) in part_get_info_efi()
299 gpt_head = memalign(ARCH_DMA_MINALIGN, dev_desc->rawblksz); in part_get_info_efi()
305 if (gpt_head && (gpt_head->last_usable_lba + b_gpt_nsec) != dev_desc->rawlba) { in part_get_info_efi()
308 free(gpt_head); in part_get_info_efi()
309 gpt_head = memalign(ARCH_DMA_MINALIGN, dev_desc->rawblksz); in part_get_info_efi()
324 gpt_head, &gpt_pte) != 1) { in part_get_info_efi()
327 gpt_head, &gpt_pte) != 1) { in part_get_info_efi()
337 if (part > le32_to_cpu(gpt_head->num_partition_entries) || in part_get_info_efi()
378 gpt_header *gpt_head) in gpt_entry_modify() argument
383 for (i = 0; i < gpt_head->num_partition_entries; i++) { in gpt_entry_modify()
398 le32_to_cpu(gpt_head->num_partition_entries) * in gpt_entry_modify()
399 le32_to_cpu(gpt_head->sizeof_partition_entry)); in gpt_entry_modify()
400 gpt_head->partition_entry_array_crc32 = calc_crc32; in gpt_entry_modify()
404 gpt_header *gpt_head, int head_gpt_valid, in part_efi_repair() argument
417 gpt_head->header_crc32 = 0; in part_efi_repair()
418 gpt_head->my_lba = dev_desc->rawlba - 1; in part_efi_repair()
419 gpt_head->alternate_lba = 1; in part_efi_repair()
421 gpt_head->partition_entry_lba = dev_desc->rawlba - 5; in part_efi_repair()
422 gpt_head->last_usable_lba = cpu_to_le64(dev_desc->rawlba - 6); in part_efi_repair()
424 gpt_head->partition_entry_lba = dev_desc->rawlba - 0x21; in part_efi_repair()
425 gpt_head->last_usable_lba = cpu_to_le64(dev_desc->rawlba - 34); in part_efi_repair()
427 gpt_entry_modify(dev_desc, gpt_pte, gpt_head); in part_efi_repair()
428 calc_crc32 = efi_crc32((const unsigned char *)gpt_head, in part_efi_repair()
429 le32_to_cpu(gpt_head->header_size)); in part_efi_repair()
430 gpt_head->header_crc32 = calc_crc32; in part_efi_repair()
432 if (blk_dwrite(dev_desc, blk * sector, sector, gpt_head) != sector) { in part_efi_repair()
436 count = le32_to_cpu(gpt_head->num_partition_entries) * in part_efi_repair()
437 le32_to_cpu(gpt_head->sizeof_partition_entry); in part_efi_repair()
438 blk = le64_to_cpu(gpt_head->partition_entry_lba); in part_efi_repair()
447 gpt_head->header_crc32 = 0; in part_efi_repair()
448 gpt_head->my_lba = 1; in part_efi_repair()
449 gpt_head->alternate_lba = dev_desc->rawlba - 1; in part_efi_repair()
450 gpt_head->partition_entry_lba = 0x2; in part_efi_repair()
452 gpt_head->last_usable_lba = cpu_to_le64(dev_desc->rawlba - 6); in part_efi_repair()
454 gpt_head->last_usable_lba = cpu_to_le64(dev_desc->rawlba - 34); in part_efi_repair()
456 gpt_entry_modify(dev_desc, gpt_pte, gpt_head); in part_efi_repair()
457 calc_crc32 = efi_crc32((const unsigned char *)gpt_head, in part_efi_repair()
458 le32_to_cpu(gpt_head->header_size)); in part_efi_repair()
459 gpt_head->header_crc32 = calc_crc32; in part_efi_repair()
460 if (blk_dwrite(dev_desc, 1 * sector, sector, gpt_head) != sector) { in part_efi_repair()
474 count = le32_to_cpu(gpt_head->num_partition_entries) * in part_efi_repair()
475 le32_to_cpu(gpt_head->sizeof_partition_entry); in part_efi_repair()
476 blk = le64_to_cpu(gpt_head->partition_entry_lba); in part_efi_repair()
912 int gpt_verify_headers(struct blk_desc *dev_desc, gpt_header *gpt_head, in gpt_verify_headers() argument
921 gpt_head, gpt_pte) != 1) { in gpt_verify_headers()
927 gpt_head, gpt_pte) != 1) { in gpt_verify_headers()
938 gpt_header *gpt_head, gpt_entry **gpt_pte) in gpt_verify_partitions() argument
945 ret = gpt_verify_headers(dev_desc, gpt_head, gpt_pte); in gpt_verify_partitions()
952 if (i == gpt_head->num_partition_entries) { in gpt_verify_partitions()