]> www.infradead.org Git - users/sagi/libnvme.git/commitdiff
types: Add boot partition information definitions
authorTokunori Ikegami <ikegami.t@gmail.com>
Sun, 17 Mar 2024 11:54:43 +0000 (20:54 +0900)
committerDaniel Wagner <wagi@monom.org>
Mon, 18 Mar 2024 17:27:20 +0000 (18:27 +0100)
The changes for boot partition log print function.

Signed-off-by: Tokunori Ikegami <ikegami.t@gmail.com>
src/nvme/types.h

index bbf74e8834f666f301bc59c28ca41ebce7625bce..e336b46a5062a9e3591f221fc4c3ed3499ec3c01 100644 (file)
@@ -3830,6 +3830,27 @@ struct nvme_boot_partition {
        __u8    boot_partition_data[];
 };
 
+/**
+ * enum nvme_boot_partition_info - This field indicates the boot partition information
+ * @NVME_BOOT_PARTITION_INFO_BPSZ_SHIFT:       Shift amount to get the boot partition size from
+ *                                             the &struct nvme_boot_partition.bpinfo field.
+ * @NVME_BOOT_PARTITION_INFO_ABPID_SHIFT:      Shift amount to get the active boot partition ID
+ *                                             from the &struct nvme_boot_partition.bpinfo field.
+ * @NVME_BOOT_PARTITION_INFO_BPSZ_MASK:                Mask to get the boot partition size from the
+ *                                             &struct nvme_boot_partition.bpinfo field.
+ * @NVME_BOOT_PARTITION_INFO_ABPID_MASK:       Mask to get the active boot partition ID from the
+ *                                             &struct nvme_boot_partition.bpinfo field.
+ */
+enum nvme_boot_partition_info {
+       NVME_BOOT_PARTITION_INFO_BPSZ_SHIFT     = 0,
+       NVME_BOOT_PARTITION_INFO_ABPID_SHIFT    = 31,
+       NVME_BOOT_PARTITION_INFO_BPSZ_MASK      = 0x7fff,
+       NVME_BOOT_PARTITION_INFO_ABPID_MASK     = 0x1,
+};
+
+#define NVME_BOOT_PARTITION_INFO_BPSZ(bpinfo)  NVME_GET(bpinfo, BOOT_PARTITION_INFO_BPSZ)
+#define NVME_BOOT_PARTITION_INFO_ABPID(bpinfo) NVME_GET(bpinfo, BOOT_PARTITION_INFO_ABPID)
+
 /**
  * struct nvme_eom_lane_desc - EOM Lane Descriptor
  * @rsvd0:     Reserved