Lines Matching refs:gpt

19  *   AGPT, allow override with 'gpt' kernel command line option.
42 * - Changed gpt structure names and members to be simpler and more Linux-like.
64 * - Added kernel command line option 'gpt' to override valid PMBR test.
93 /* This allows a kernel command line option 'gpt' to override
104 __setup("gpt", force_gpt_fn);
267 * @gpt: GPT header
270 * Allocates space for PTEs based on information found in @gpt.
274 gpt_header *gpt)
279 if (!gpt)
282 count = (size_t)le32_to_cpu(gpt->num_partition_entries) *
283 le32_to_cpu(gpt->sizeof_partition_entry);
290 if (read_lba(state, le64_to_cpu(gpt->partition_entry_lba),
306 * Note: remember to free gpt when finished with it.
311 gpt_header *gpt;
314 gpt = kmalloc(ssz, GFP_KERNEL);
315 if (!gpt)
318 if (read_lba(state, lba, (u8 *) gpt, ssz) < ssz) {
319 kfree(gpt);
320 gpt=NULL;
324 return gpt;
331 * @gpt: GPT header ptr, filled on return.
338 gpt_header **gpt, gpt_entry **ptes)
345 if (!(*gpt = alloc_read_gpt_header(state, lba)))
349 if (le64_to_cpu((*gpt)->signature) != GPT_HEADER_SIGNATURE) {
352 (unsigned long long)le64_to_cpu((*gpt)->signature),
358 if (le32_to_cpu((*gpt)->header_size) >
361 le32_to_cpu((*gpt)->header_size),
367 if (le32_to_cpu((*gpt)->header_size) < sizeof(gpt_header)) {
369 le32_to_cpu((*gpt)->header_size),
375 origcrc = le32_to_cpu((*gpt)->header_crc32);
376 (*gpt)->header_crc32 = 0;
377 crc = efi_crc32((const unsigned char *) (*gpt), le32_to_cpu((*gpt)->header_size));
384 (*gpt)->header_crc32 = cpu_to_le32(origcrc);
388 if (le64_to_cpu((*gpt)->my_lba) != lba) {
390 (unsigned long long)le64_to_cpu((*gpt)->my_lba),
399 if (le64_to_cpu((*gpt)->first_usable_lba) > lastlba) {
401 (unsigned long long)le64_to_cpu((*gpt)->first_usable_lba),
405 if (le64_to_cpu((*gpt)->last_usable_lba) > lastlba) {
407 (unsigned long long)le64_to_cpu((*gpt)->last_usable_lba),
411 if (le64_to_cpu((*gpt)->last_usable_lba) < le64_to_cpu((*gpt)->first_usable_lba)) {
413 (unsigned long long)le64_to_cpu((*gpt)->last_usable_lba),
414 (unsigned long long)le64_to_cpu((*gpt)->first_usable_lba));
418 if (le32_to_cpu((*gpt)->sizeof_partition_entry) != sizeof(gpt_entry)) {
424 pt_size = (u64)le32_to_cpu((*gpt)->num_partition_entries) *
425 le32_to_cpu((*gpt)->sizeof_partition_entry);
432 if (!(*ptes = alloc_read_gpt_entries(state, *gpt)))
438 if (crc != le32_to_cpu((*gpt)->partition_entry_array_crc32)) {
450 kfree(*gpt);
451 *gpt = NULL;
570 * @gpt: GPT header ptr, filled on return.
576 * 'gpt' kernel command line option) and finding either the Primary
579 * is not checked unless the 'gpt' kernel command line option is passed.
583 static int find_valid_gpt(struct parsed_partitions *state, gpt_header **gpt,
632 *gpt = pgpt;
641 *gpt = agpt;
654 *gpt = NULL;
705 gpt_header *gpt = NULL;
710 if (!find_valid_gpt(state, &gpt, &ptes) || !gpt || !ptes) {
711 kfree(gpt);
718 for (i = 0; i < le32_to_cpu(gpt->num_partition_entries) && i < state->limit-1; i++) {
744 kfree(gpt);