vbos/kernel/block/gpt.h
Michael Shaw 25c0b538d2 block: add gpt partitioning
Signed-off-by: Michael Shaw <m@michaelsshaw.com>
2026-07-15 00:07:28 -04:00

40 lines
723 B
C

/* SPDX-License-Identifier: GPL-2.0-only */
#ifndef _GPT_H_
#define _GPT_H_
#include <kernel/common.h>
#include <kernel/block.h>
#include <lib/list.h>
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_ */