Moving portions of chain.c32 into libcom32.
Signed-off-by: Shao Miller <shao.miller@yrdsb.edu.on.ca>
+/* A GPT partition */
+struct disk_gpt_part_entry {
+ struct guid type;
+ struct guid uid;
+ uint64_t lba_first;
+ uint64_t lba_last;
+ uint64_t attribs;
+ char name[72];
+} __attribute__ ((packed));
+
extern int disk_int13_retry(const com32sys_t * inreg, com32sys_t * outreg);
extern int disk_get_params(int disk, struct disk_info *const diskinfo);
extern void *disk_read_sectors(const struct disk_info *const diskinfo,
extern int disk_int13_retry(const com32sys_t * inreg, com32sys_t * outreg);
extern int disk_get_params(int disk, struct disk_info *const diskinfo);
extern void *disk_read_sectors(const struct disk_info *const diskinfo,
-/* A GPT partition */
-struct gpt_part {
- struct guid type;
- struct guid uid;
- uint64_t lba_first;
- uint64_t lba_last;
- uint64_t attribs;
- char name[72];
-} __attribute__ ((packed));
-
-static void gpt_part_dump(const struct gpt_part *gpt_part)
+static void gpt_part_dump(const struct disk_gpt_part_entry *gpt_part)
{
#ifdef DEBUG
unsigned int i;
{
#ifdef DEBUG
unsigned int i;
static struct disk_part_iter *next_gpt_part(struct disk_part_iter *part)
{
static struct disk_part_iter *next_gpt_part(struct disk_part_iter *part)
{
- const struct gpt_part *gpt_part = NULL;
+ const struct disk_gpt_part_entry *gpt_part = NULL;
while (++part->private.gpt.index < part->private.gpt.parts) {
gpt_part =
while (++part->private.gpt.index < part->private.gpt.parts) {
gpt_part =
- (const struct gpt_part *)(part->block +
- (part->private.gpt.index *
- part->private.gpt.size));
+ (const struct disk_gpt_part_entry *)(part->block +
+ (part->private.gpt.index *
+ part->private.gpt.size));
if (!gpt_part->lba_first)
continue;
break;
if (!gpt_part->lba_first)
continue;
break;
}
/* Check for a matching partition */
while (boot_part[0]) {
}
/* Check for a matching partition */
while (boot_part[0]) {
- char gpt_label[sizeof(((struct gpt_part *) NULL)->name)];
+ char gpt_label[sizeof(((struct disk_gpt_part_entry *) NULL)->name)];
const char *gpt_label_scanner =
boot_part[0]->private.gpt.part_label;
int j = 0;
const char *gpt_label_scanner =
boot_part[0]->private.gpt.part_label;
int j = 0;
/* Do GPT hand-over, if applicable (as per syslinux/doc/gpt.txt) */
struct disk_dos_part_entry *record;
/* Look at the GPT partition */
/* Do GPT hand-over, if applicable (as per syslinux/doc/gpt.txt) */
struct disk_dos_part_entry *record;
/* Look at the GPT partition */
- const struct gpt_part *gp = (const struct gpt_part *)
+ const struct disk_gpt_part_entry *gp =
+ (const struct disk_gpt_part_entry *)
(cur_part->block +
(cur_part->private.gpt.size * cur_part->private.gpt.index));
/* Note the partition length */
(cur_part->block +
(cur_part->private.gpt.size * cur_part->private.gpt.index));
/* Note the partition length */
dprintf("GPT handover:\n");
disk_dos_part_dump(record);
dprintf("GPT handover:\n");
disk_dos_part_dump(record);
- gpt_part_dump((struct gpt_part *)(plen + 1));
+ gpt_part_dump((struct disk_gpt_part_entry *)(plen + 1));
} else if (cur_part->record) {
/* MBR handover protocol */
static struct disk_dos_part_entry handover_record;
} else if (cur_part->record) {
/* MBR handover protocol */
static struct disk_dos_part_entry handover_record;