Define them using their native types (pointers).
Also, fix an apparent bug in mptable coreboot processing - it
incorrectly overwrote the pir_loc variable.
u16 type;
u16 flags;
u32 vector;
- u32 description;
+ char *description;
};
struct ipl_s {
u8 checksum;
} PACKED;
+struct pir_header;
+
struct extended_bios_data_area_s {
u8 size;
u8 reserved1[0x21];
// Physical memory available.
u32 ram_size; // Amount of continuous ram under 4Gig
u64 ram_size_over4G; // Amount of continuous ram >4Gig
- u32 pir_loc;
+ struct pir_header *pir_loc;
// ATA Driver data
struct ata_s ata;
printf("%s", drivetypes[type]);
/* print product string if BEV */
- void *far_description = (void*)GET_EBDA(ipl.table[bootdev].description);
+ char *far_description = GET_EBDA(ipl.table[bootdev].description);
if (type == 4 && far_description != 0) {
char description[33];
/* first 32 bytes are significant */
- memcpy_far(MAKE_FARPTR(GET_SEG(SS), &description), far_description, 32);
+ memcpy_far(MAKE_FARPTR(GET_SEG(SS), description), far_description, 32);
/* terminate string */
description[32] = 0;
printf(" [%.s]", description);
}
dprintf(1, "Copying PIR from %p to %x\n", pos, bios_table_cur_addr);
memcpy((void*)bios_table_cur_addr, pos, p->size);
- SET_EBDA(pir_loc, bios_table_cur_addr);
+ SET_EBDA(pir_loc, (void*)bios_table_cur_addr);
bios_table_cur_addr += p->size;
}
}
dprintf(1, "Copying MPTABLE from %p to %x\n", pos, bios_table_cur_addr);
memcpy((void*)bios_table_cur_addr, pos, length);
- SET_EBDA(pir_loc, bios_table_cur_addr);
bios_table_cur_addr += length;
}
u16 desc = pnp->productname;
if (desc)
- ip->description = (u32)MAKE_FARPTR(FARPTR_TO_SEG(rom), desc);
+ ip->description = MAKE_FARPTR(FARPTR_TO_SEG(rom), desc);
ebda->ipl.count++;
}
static void
handle_1ab10e(struct bregs *regs)
{
- struct pir_header *pirtable_far = (struct pir_header*)GET_EBDA(pir_loc);
+ struct pir_header *pirtable_far = GET_EBDA(pir_loc);
if (! pirtable_far) {
set_code_fail(regs, RET_FUNC_NOT_SUPPORTED);
return;
PIR_TABLE.pir.signature = PIR_SIGNATURE;
PIR_TABLE.pir.checksum = -checksum((u8*)&PIR_TABLE, sizeof(PIR_TABLE));
- SET_EBDA(pir_loc, (u32)&PIR_TABLE);
+ SET_EBDA(pir_loc, &PIR_TABLE.pir);
}