X-Git-Url: https://scm.lunaixsky.com/lunaix-os.git/blobdiff_plain/cb089e17fcc6bd4823bd919cce2b9e62631cd570..97901724584e74554916b89dfb8e95dc6497e687:/lunaix-os/includes/lunaix/blkpart_gpt.h diff --git a/lunaix-os/includes/lunaix/blkpart_gpt.h b/lunaix-os/includes/lunaix/blkpart_gpt.h new file mode 100644 index 0000000..fdce191 --- /dev/null +++ b/lunaix-os/includes/lunaix/blkpart_gpt.h @@ -0,0 +1,49 @@ +/** + * @file blkpart_gpt.h + * @author Lunaixsky (lunaxisky@qq.com) + * @brief The GUID Partition Table (GPT) + * @version 0.1 + * @date 2022-11-09 + * + * @copyright Copyright (c) 2022 + * + */ +#ifndef __LUNAIX_BLKPART_GPT_H +#define __LUNAIX_BLKPART_GPT_H + +#include +#include + +struct gpt_header +{ + u8_t signature[8]; + u32_t rev; + u32_t hdr_size; + u32_t hdr_cksum; + u32_t reserved1; + u64_t hdr_lba; + u64_t hdr_backup_lba; + u64_t lba_start; + u64_t lba_end; + u8_t guid[16]; + u64_t ents_lba; + u32_t ents_len; + u32_t ent_size; + u32_t ent_cksum; + // reserved start here +} PACKED; + +struct gpt_entry +{ + u8_t pguid[16]; + u8_t uguid[16]; + u64_t start_lba; + u64_t end_lba; + u64_t attr_flags; + char name[72]; +} PACKED; + +int +blkpart_probegpt(struct device* master); + +#endif /* __LUNAIX_BLKPART_GPT_H */