boot: Use void* instead of u32 to store pointers
Needed to support 64-bit build.
Signed-off-by: Helge Deller <deller@gmx.de>
diff --git a/src/boot.c b/src/boot.c
index 6f79648..22d4b6f 100644
--- a/src/boot.c
+++ b/src/boot.c
@@ -507,7 +507,7 @@
struct bootentry_s {
int type;
union {
- u32 data;
+ void *data;
struct segoff_s vector;
struct drive_s *drive;
};
@@ -526,7 +526,7 @@
#define IPL_TYPE_HALT 0xf0
static void
-bootentry_add(int type, int prio, u32 data, const char *desc)
+bootentry_add(int type, int prio, void *data, const char *desc)
{
if (! CONFIG_BOOT)
return;
@@ -539,7 +539,7 @@
be->priority = prio;
be->data = data;
be->description = desc ?: "?";
- dprintf(3, "Registering bootable: %s (type:%d prio:%d data:%x)\n"
+ dprintf(3, "Registering bootable: %s (type:%d prio:%d data:%p)\n"
, be->description, type, prio, data);
// Add entry in sorted order.
@@ -573,7 +573,7 @@
boot_add_bev(u16 seg, u16 bev, u16 desc, int prio)
{
bootentry_add(IPL_TYPE_BEV, defPrio(prio, DefaultBEVPrio)
- , SEGOFF(seg, bev).segoff
+ , (void *)SEGOFF(seg, bev).segoff
, desc ? MAKE_FLATPTR(seg, desc) : "Unknown");
DefaultBEVPrio = DEFAULT_PRIO;
}
@@ -583,7 +583,7 @@
boot_add_bcv(u16 seg, u16 ip, u16 desc, int prio)
{
bootentry_add(IPL_TYPE_BCV, defPrio(prio, DefaultHDPrio)
- , SEGOFF(seg, ip).segoff
+ , (void *)SEGOFF(seg, ip).segoff
, desc ? MAKE_FLATPTR(seg, desc) : "Legacy option rom");
}
@@ -591,14 +591,14 @@
boot_add_floppy(struct drive_s *drive, const char *desc, int prio)
{
bootentry_add(IPL_TYPE_FLOPPY, defPrio(prio, DefaultFloppyPrio)
- , (u32)drive, desc);
+ , drive, desc);
}
void
boot_add_hd(struct drive_s *drive, const char *desc, int prio)
{
bootentry_add(IPL_TYPE_HARDDISK, defPrio(prio, DefaultHDPrio)
- , (u32)drive, desc);
+ , drive, desc);
}
void
@@ -615,14 +615,14 @@
}
}
bootentry_add(IPL_TYPE_CDROM, defPrio(prio, DefaultCDPrio)
- , (u32)drive, desc);
+ , drive, desc);
}
// Add a CBFS payload entry
void
boot_add_cbfs(void *data, const char *desc, int prio)
{
- bootentry_add(IPL_TYPE_CBFS, defPrio(prio, DEFAULT_PRIO), (u32)data, desc);
+ bootentry_add(IPL_TYPE_CBFS, defPrio(prio, DEFAULT_PRIO), data, desc);
}
@@ -869,7 +869,7 @@
static int HaveHDBoot, HaveFDBoot;
static void
-add_bev(int type, u32 vector)
+add_bev(int type, void *vector)
{
if (type == IPL_TYPE_HARDDISK && HaveHDBoot++)
return;
@@ -879,7 +879,7 @@
return;
struct bev_s *bev = &BEV[BEVCount++];
bev->type = type;
- bev->vector = vector;
+ bev->vector = (uintptr_t) vector;
}
// Prepare for boot - show menu and run bcvs.