Module Name: src Committed By: jmcneill Date: Sat Mar 30 12:47:53 UTC 2019
Modified Files: src/sys/stand/efiboot: efiboot.c efienv.c efigetsecs.c exec.c Log Message: Build fixes for 32-bit targets. To generate a diff of this commit: cvs rdiff -u -r1.12 -r1.13 src/sys/stand/efiboot/efiboot.c cvs rdiff -u -r1.2 -r1.3 src/sys/stand/efiboot/efienv.c cvs rdiff -u -r1.3 -r1.4 src/sys/stand/efiboot/efigetsecs.c cvs rdiff -u -r1.8 -r1.9 src/sys/stand/efiboot/exec.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/stand/efiboot/efiboot.c diff -u src/sys/stand/efiboot/efiboot.c:1.12 src/sys/stand/efiboot/efiboot.c:1.13 --- src/sys/stand/efiboot/efiboot.c:1.12 Thu Nov 1 00:43:38 2018 +++ src/sys/stand/efiboot/efiboot.c Sat Mar 30 12:47:53 2019 @@ -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 <jmcne...@invisible.ca> @@ -65,7 +65,7 @@ efi_main(EFI_HANDLE imageHandle, EFI_SYS 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)) Index: src/sys/stand/efiboot/efienv.c diff -u src/sys/stand/efiboot/efienv.c:1.2 src/sys/stand/efiboot/efienv.c:1.3 --- src/sys/stand/efiboot/efienv.c:1.2 Tue Sep 18 19:19:45 2018 +++ src/sys/stand/efiboot/efienv.c Sat Mar 30 12:47:53 2019 @@ -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 <jmcne...@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 * Index: src/sys/stand/efiboot/efigetsecs.c diff -u src/sys/stand/efiboot/efigetsecs.c:1.3 src/sys/stand/efiboot/efigetsecs.c:1.4 --- src/sys/stand/efiboot/efigetsecs.c:1.3 Mon Sep 3 00:04:02 2018 +++ src/sys/stand/efiboot/efigetsecs.c Sat Mar 30 12:47:53 2019 @@ -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 <yasu...@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(); } Index: src/sys/stand/efiboot/exec.c diff -u src/sys/stand/efiboot/exec.c:1.8 src/sys/stand/efiboot/exec.c:1.9 --- src/sys/stand/efiboot/exec.c:1.8 Sun Oct 28 10:17:47 2018 +++ src/sys/stand/efiboot/exec.c Sat Mar 30 12:47:53 2019 @@ -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 <jmcne...@invisible.ca> @@ -80,13 +80,13 @@ load_file(char *path, EFI_PHYSICAL_ADDRE #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 cha #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 cha 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; }