Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys Support loading kernels at PAs above 0x3fffffffff on arm64
details: https://anonhg.NetBSD.org/src/rev/804a7ecd9162
branches: trunk
changeset: 366566:804a7ecd9162
user: jmcneill <jmcneill%NetBSD.org@localhost>
date: Sun Sep 02 23:50:23 2018 +0000
description:
Support loading kernels at PAs above 0x3fffffffff on arm64
diffstat:
sys/arch/evbarm/include/loadfile_machdep.h | 3 ++-
sys/stand/efiboot/exec.c | 7 +++++--
2 files changed, 7 insertions(+), 3 deletions(-)
diffs (47 lines):
diff -r bbdfd8fc43f7 -r 804a7ecd9162 sys/arch/evbarm/include/loadfile_machdep.h
--- a/sys/arch/evbarm/include/loadfile_machdep.h Sun Sep 02 19:46:53 2018 +0000
+++ b/sys/arch/evbarm/include/loadfile_machdep.h Sun Sep 02 23:50:23 2018 +0000
@@ -9,7 +9,8 @@
#define COUNT_KERNEL (COUNT_ALL & ~COUNT_TEXTA)
#if defined(__aarch64__)
-#define LOADADDR(a) ((((u_long)(a)) + offset) & 0x3fffffffff)
+extern u_long load_offset;
+#define LOADADDR(a) (((((u_long)(a)) + offset) & 0x3fffffffff) + load_offset)
#else
#define LOADADDR(a) (((u_long)(a)))
#endif
diff -r bbdfd8fc43f7 -r 804a7ecd9162 sys/stand/efiboot/exec.c
--- a/sys/stand/efiboot/exec.c Sun Sep 02 19:46:53 2018 +0000
+++ b/sys/stand/efiboot/exec.c Sun Sep 02 23:50:23 2018 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: exec.c,v 1.2 2018/08/27 09:51:32 jmcneill Exp $ */
+/* $NetBSD: exec.c,v 1.3 2018/09/02 23:50:23 jmcneill Exp $ */
/*-
* Copyright (c) 2018 Jared McNeill <jmcneill%invisible.ca@localhost>
@@ -31,6 +31,8 @@
#include <loadfile.h>
+u_long load_offset = 0;
+
int
exec_netbsd(const char *fname, const char *args)
{
@@ -65,13 +67,14 @@
}
memset(marks, 0, sizeof(marks));
- marks[MARK_START] = (addr + EFIBOOT_ALIGN) & ~(EFIBOOT_ALIGN - 1);
+ load_offset = (addr + EFIBOOT_ALIGN) & ~(EFIBOOT_ALIGN - 1);
fd = loadfile(fname, marks, LOAD_KERNEL);
if (fd < 0) {
printf("boot: %s: %s\n", fname, strerror(errno));
goto cleanup;
}
close(fd);
+ load_offset = 0;
if (efi_fdt_size() > 0) {
efi_fdt_bootargs(args);
Home |
Main Index |
Thread Index |
Old Index