Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/i386/stand/lib efiboot: Copy bootinfo to safe arena.



details:   https://anonhg.NetBSD.org/src/rev/c045c386fa83
branches:  trunk
changeset: 821626:c045c386fa83
user:      nonaka <nonaka%NetBSD.org@localhost>
date:      Sat Feb 11 10:18:10 2017 +0000

description:
efiboot: Copy bootinfo to safe arena.

diffstat:

 sys/arch/i386/stand/lib/exec.c |  13 ++++++++++++-
 1 files changed, 12 insertions(+), 1 deletions(-)

diffs (34 lines):

diff -r 9c05d6356574 -r c045c386fa83 sys/arch/i386/stand/lib/exec.c
--- a/sys/arch/i386/stand/lib/exec.c    Sat Feb 11 10:15:55 2017 +0000
+++ b/sys/arch/i386/stand/lib/exec.c    Sat Feb 11 10:18:10 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: exec.c,v 1.63 2017/01/24 11:09:14 nonaka Exp $  */
+/*     $NetBSD: exec.c,v 1.64 2017/02/11 10:18:10 nonaka Exp $  */
 
 /*
  * Copyright (c) 2008, 2009 The NetBSD Foundation, Inc.
@@ -389,6 +389,9 @@
        u_long extmem;
        u_long basemem;
        int error;
+#ifdef EFIBOOT
+       int i;
+#endif
 
 #ifdef DEBUG
        printf("exec: file=%s loadaddr=0x%lx\n", file ? file : "NULL",
@@ -449,6 +452,14 @@
        if (callback != NULL)
                (*callback)();
 #ifdef EFIBOOT
+       /* Copy bootinfo to safe arena. */
+       for (i = 0; i < bootinfo->nentries; i++) {
+               struct btinfo_common *bi = (void *)(u_long)bootinfo->entry[i];
+               char *p = alloc(bi->len);
+               memcpy(p, bi, bi->len);
+               bootinfo->entry[i] = vtophys(p);
+       }
+
        /* Copy the kernel to original load address. */
        memmove((void *)marks[MARK_START],
            (void *)(efi_loadaddr + marks[MARK_START]),



Home | Main Index | Thread Index | Old Index