]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
disk: efi: expose the part_get_gpt_pte() helper function
authorJavier Martinez Canillas <javierm@redhat.com>
Thu, 19 Jun 2025 08:34:00 +0000 (10:34 +0200)
committerIlias Apalodimas <ilias.apalodimas@linaro.org>
Thu, 3 Jul 2025 08:32:49 +0000 (11:32 +0300)
This function will be used by the EFI application disk support code
to provide data required by the EFI_PARTITION_INFORMATION_PROTOCOL.

Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
Signed-off-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
disk/part_efi.c
include/part.h

index d0b1f96adff2094ac164a1118fc27c08294af0f7..fb1ed534f8618c00eea353dfd3ba0d0c45460b29 100644 (file)
@@ -215,7 +215,7 @@ int get_disk_guid(struct blk_desc *desc, char *guid)
        return 0;
 }
 
-static int part_get_gpt_pte(struct blk_desc *desc, int part, gpt_entry *gpt_e)
+int part_get_gpt_pte(struct blk_desc *desc, int part, gpt_entry *gpt_e)
 {
        ALLOC_CACHE_ALIGN_BUFFER_PAD(gpt_header, gpt_head, 1, desc->blksz);
        gpt_entry *gpt_pte = NULL;
index 7075b2cb1164594007bb6a941a9ce76d36c6f84e..b3a3362b2af265d11d10e8fec5043c91943def77 100644 (file)
@@ -647,6 +647,20 @@ int gpt_verify_partitions(struct blk_desc *desc,
  */
 int get_disk_guid(struct blk_desc *desc, char *guid);
 
+/**
+ * part_get_gpt_pte() - Get the GPT partition table entry of a partition
+ *
+ * This function reads the GPT partition table entry (PTE) for a given
+ * block device and partition number.
+ *
+ * @desc:      block device descriptor
+ * @part:      partition number for which to return the PTE
+ * @gpt_e:     GPT partition table entry
+ *
+ * Return:     0 on success, otherwise error
+ */
+int part_get_gpt_pte(struct blk_desc *desc, int part, gpt_entry *gpt_e);
+
 #endif
 
 #if CONFIG_IS_ENABLED(DOS_PARTITION)