/* SPDX-License-Identifier: GPL-2.0-only */ #ifndef _GPT_H_ #define _GPT_H_ #include #include #include struct gpt_header { char signature[8]; u32 revision; u32 header_size; u32 header_crc32; u32 reserved; u64 this_lba; u64 alt_lba; u64 first_lba; u64 last_lba; char diskguid[16]; u64 pentry_lba; u32 n_pentries; u32 pentry_size; u32 pentry_crc32; } PACKED; struct gpt_partition { char ptypeguid[16]; char partguid[16]; u64 lba_start; u64 lba_end; u64 attributes; char partname[72]; } PACKED; int gpt_parse_partitions(struct block_device *bdev, struct gpt_partition **out); bool block_has_gpt_header(struct block_device *bdev); #endif /* _GPT_H_ */