Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/stand/efiboot Build fixes for 32-bit targets.



details:   https://anonhg.NetBSD.org/src/rev/9a38c5e9369d
branches:  trunk
changeset: 997879:9a38c5e9369d
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Sat Mar 30 12:47:53 2019 +0000

description:
Build fixes for 32-bit targets.

diffstat:

 sys/stand/efiboot/efiboot.c    |   4 ++--
 sys/stand/efiboot/efienv.c     |   4 ++--
 sys/stand/efiboot/efigetsecs.c |   6 +++---
 sys/stand/efiboot/exec.c       |  10 +++++-----
 4 files changed, 12 insertions(+), 12 deletions(-)

diffs (101 lines):

diff -r fae49898ed0a -r 9a38c5e9369d sys/stand/efiboot/efiboot.c
--- a/sys/stand/efiboot/efiboot.c       Sat Mar 30 12:46:16 2019 +0000
+++ b/sys/stand/efiboot/efiboot.c       Sat Mar 30 12:47:53 2019 +0000
@@ -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@localhost>
@@ -65,7 +65,7 @@
        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))
diff -r fae49898ed0a -r 9a38c5e9369d sys/stand/efiboot/efienv.c
--- a/sys/stand/efiboot/efienv.c        Sat Mar 30 12:46:16 2019 +0000
+++ b/sys/stand/efiboot/efienv.c        Sat Mar 30 12:47:53 2019 +0000
@@ -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@localhost>
@@ -47,7 +47,7 @@
        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 *
diff -r fae49898ed0a -r 9a38c5e9369d sys/stand/efiboot/efigetsecs.c
--- a/sys/stand/efiboot/efigetsecs.c    Sat Mar 30 12:46:16 2019 +0000
+++ b/sys/stand/efiboot/efigetsecs.c    Sat Mar 30 12:47:53 2019 +0000
@@ -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@localhost>
@@ -70,10 +70,10 @@
                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();
        }
 
diff -r fae49898ed0a -r 9a38c5e9369d sys/stand/efiboot/exec.c
--- a/sys/stand/efiboot/exec.c  Sat Mar 30 12:46:16 2019 +0000
+++ b/sys/stand/efiboot/exec.c  Sat Mar 30 12:47:53 2019 +0000
@@ -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@localhost>
@@ -80,13 +80,13 @@
 #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 @@
 #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 @@
                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;
        }



Home | Main Index | Thread Index | Old Index