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);
265 * @gpt: GPT header
268 * Allocates space for PTEs based on information found in @gpt.
272 gpt_header *gpt)
277 if (!gpt)
280 count = (size_t)le32_to_cpu(gpt->num_partition_entries) *
281 le32_to_cpu(gpt->sizeof_partition_entry);
288 if (read_lba(state, le64_to_cpu(gpt->partition_entry_lba),
304 * Note: remember to free gpt when finished with it.
309 gpt_header *gpt;
312 gpt = kmalloc(ssz, GFP_KERNEL);
313 if (!gpt)
316 if (read_lba(state, lba, (u8 *) gpt, ssz) < ssz) {
317 kfree(gpt);
318 gpt=NULL;
322 return gpt;
329 * @gpt: GPT header ptr, filled on return.
336 gpt_header **gpt, gpt_entry **ptes)
343 if (!(*gpt = alloc_read_gpt_header(state, lba)))
347 if (le64_to_cpu((*gpt)->signature) != GPT_HEADER_SIGNATURE) {
350 (unsigned long long)le64_to_cpu((*gpt)->signature),
356 if (le32_to_cpu((*gpt)->header_size) >
359 le32_to_cpu((*gpt)->header_size),
365 if (le32_to_cpu((*gpt)->header_size) < sizeof(gpt_header)) {
367 le32_to_cpu((*gpt)->header_size),
373 origcrc = le32_to_cpu((*gpt)->header_crc32);
374 (*gpt)->header_crc32 = 0;
375 crc = efi_crc32((const unsigned char *) (*gpt), le32_to_cpu((*gpt)->header_size));
382 (*gpt)->header_crc32 = cpu_to_le32(origcrc);
386 if (le64_to_cpu((*gpt)->my_lba) != lba) {
388 (unsigned long long)le64_to_cpu((*gpt)->my_lba),
397 if (le64_to_cpu((*gpt)->first_usable_lba) > lastlba) {
399 (unsigned long long)le64_to_cpu((*gpt)->first_usable_lba),
403 if (le64_to_cpu((*gpt)->last_usable_lba) > lastlba) {
405 (unsigned long long)le64_to_cpu((*gpt)->last_usable_lba),
409 if (le64_to_cpu((*gpt)->last_usable_lba) < le64_to_cpu((*gpt)->first_usable_lba)) {
411 (unsigned long long)le64_to_cpu((*gpt)->last_usable_lba),
412 (unsigned long long)le64_to_cpu((*gpt)->first_usable_lba));
416 if (le32_to_cpu((*gpt)->sizeof_partition_entry) != sizeof(gpt_entry)) {
422 pt_size = (u64)le32_to_cpu((*gpt)->num_partition_entries) *
423 le32_to_cpu((*gpt)->sizeof_partition_entry);
430 if (!(*ptes = alloc_read_gpt_entries(state, *gpt)))
436 if (crc != le32_to_cpu((*gpt)->partition_entry_array_crc32)) {
448 kfree(*gpt);
449 *gpt = NULL;
568 * @gpt: GPT header ptr, filled on return.
574 * 'gpt' kernel command line option) and finding either the Primary
577 * is not checked unless the 'gpt' kernel command line option is passed.
581 static int find_valid_gpt(struct parsed_partitions *state, gpt_header **gpt,
642 *gpt = pgpt;
651 *gpt = agpt;
664 *gpt = NULL;
715 gpt_header *gpt = NULL;
720 if (!find_valid_gpt(state, &gpt, &ptes) || !gpt || !ptes) {
721 kfree(gpt);
728 for (i = 0; i < le32_to_cpu(gpt->num_partition_entries) && i < state->limit-1; i++) {
754 kfree(gpt);