Build fixes for 32-bit targets.

This commit is contained in:
jmcneill 2019-03-30 12:47:53 +00:00
parent df0834201a
commit 0ef050d6c0
4 changed files with 12 additions and 12 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: efiboot.c,v 1.12 2018/11/01 00:43:38 jmcneill Exp $ */
/* $NetBSD: efiboot.c,v 1.13 2019/03/30 12:47:53 jmcneill Exp $ */
/*-
* Copyright (c) 2018 Jared McNeill <jmcneill@invisible.ca>
@ -65,7 +65,7 @@ efi_main(EFI_HANDLE imageHandle, EFI_SYSTEM_TABLE *systemTable)
status = uefi_call_wrapper(BS->AllocatePages, 4, AllocateAnyPages, EfiLoaderData, sz, &heap_start);
if (EFI_ERROR(status))
return status;
setheap((void *)heap_start, (void *)(heap_start + heap_size));
setheap((void *)(uintptr_t)heap_start, (void *)(uintptr_t)(heap_start + heap_size));
status = uefi_call_wrapper(BS->HandleProtocol, 3, imageHandle, &LoadedImageProtocol, (void **)&efi_li);
if (EFI_ERROR(status))

View File

@ -1,4 +1,4 @@
/* $NetBSD: efienv.c,v 1.2 2018/09/18 19:19:45 jmcneill Exp $ */
/* $NetBSD: efienv.c,v 1.3 2019/03/30 12:47:53 jmcneill Exp $ */
/*-
* Copyright (c) 2018 Jared McNeill <jmcneill@invisible.ca>
@ -47,7 +47,7 @@ efi_env_set(const char *key, char *val)
FreePool(ukey);
if (EFI_ERROR(status))
printf("env: failed to set variable '%s': %#lx\n", key, status);
printf("env: failed to set variable '%s': %#lx\n", key, (u_long)status);
}
char *

View File

@ -1,4 +1,4 @@
/* $NetBSD: efigetsecs.c,v 1.3 2018/09/03 00:04:02 jmcneill Exp $ */
/* $NetBSD: efigetsecs.c,v 1.4 2019/03/30 12:47:53 jmcneill Exp $ */
/*
* Copyright (c) 2015 YASUOKA Masahiko <yasuoka@yasuoka.net>
@ -70,10 +70,10 @@ getsecs(void)
status = uefi_call_wrapper(BS->CreateEvent, 5, EVT_TIMER | EVT_NOTIFY_SIGNAL, TPL_CALLBACK,
getsecs_notify_func, 0, &getsecs_ev);
if (EFI_ERROR(status))
panic("%s: couldn't create event timer: 0x%lx", __func__, status);
panic("%s: couldn't create event timer: 0x%lx", __func__, (u_long)status);
status = uefi_call_wrapper(BS->SetTimer, 3, getsecs_ev, TimerPeriodic, 10000000); /* 1s in "100ns" units */
if (EFI_ERROR(status))
panic("%s: couldn't start event timer: 0x%lx", __func__, status);
panic("%s: couldn't start event timer: 0x%lx", __func__, (u_long)status);
getsecs_val = getsecs_rtc();
}

View File

@ -1,4 +1,4 @@
/* $NetBSD: exec.c,v 1.8 2018/10/28 10:17:47 jmcneill Exp $ */
/* $NetBSD: exec.c,v 1.9 2019/03/30 12:47:53 jmcneill Exp $ */
/*-
* Copyright (c) 2018 Jared McNeill <jmcneill@invisible.ca>
@ -80,13 +80,13 @@ load_file(char *path, EFI_PHYSICAL_ADDRESS *paddr, u_long *psize)
#endif
if (EFI_ERROR(status)) {
printf("Failed to allocate %lu bytes for %s (error %lu)\n",
*psize, path, status);
*psize, path, (u_long)status);
close(fd);
return ENOMEM;
}
printf("boot: loading %s ", path);
len = read(fd, (void *)*paddr, *psize);
len = read(fd, (void *)(uintptr_t)*paddr, *psize);
close(fd);
if (len != *psize) {
@ -139,7 +139,7 @@ exec_netbsd(const char *fname, const char *args)
#endif
if (EFI_ERROR(status)) {
printf("Failed to allocate %lu bytes for kernel image (error %lu)\n",
alloc_size, status);
alloc_size, (u_long)status);
return ENOMEM;
}
@ -158,7 +158,7 @@ exec_netbsd(const char *fname, const char *args)
efi_acpi_create_fdt();
} else
#endif
if (dtb_addr && efi_fdt_set_data((void *)dtb_addr) != 0) {
if (dtb_addr && efi_fdt_set_data((void *)(uintptr_t)dtb_addr) != 0) {
printf("boot: invalid DTB data\n");
goto cleanup;
}