Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/evbarm/stand/gzboot Allow a configuration to specif...



details:   https://anonhg.NetBSD.org/src/rev/e71493e415e0
branches:  trunk
changeset: 744776:e71493e415e0
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Wed Feb 12 19:55:32 2020 +0000

description:
Allow a configuration to specify an arbitrary address where the
compressed kernel image is located, in the event it can't be appended
to or embedded within the gzboot binary itself.

diffstat:

 sys/arch/evbarm/stand/gzboot/Makefile.gzboot |   5 ++++-
 sys/arch/evbarm/stand/gzboot/gzboot.c        |  13 +++++++++++--
 2 files changed, 15 insertions(+), 3 deletions(-)

diffs (57 lines):

diff -r e1b11bceee0c -r e71493e415e0 sys/arch/evbarm/stand/gzboot/Makefile.gzboot
--- a/sys/arch/evbarm/stand/gzboot/Makefile.gzboot      Wed Feb 12 18:35:01 2020 +0000
+++ b/sys/arch/evbarm/stand/gzboot/Makefile.gzboot      Wed Feb 12 19:55:32 2020 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile.gzboot,v 1.37 2019/10/24 18:46:21 christos Exp $
+#      $NetBSD: Makefile.gzboot,v 1.38 2020/02/12 19:55:32 thorpej Exp $
 
 NOMAN=  # defined
 
@@ -49,6 +49,9 @@
 CPPFLAGS+= -DRELOC=${RELOC}
 CPPFLAGS+= -DMAXIMAGESIZE=${MAXIMAGESIZE}
 CPPFLAGS+= -DLOADADDR=${LOADADDR}
+.if defined(GZSRCADDR)
+CPPFLAGS+= -DGZSRCADDR=${GZSRCADDR}
+.endif
 
 COPTS+=        -ffreestanding
 COPTS+=        -fno-stack-protector
diff -r e1b11bceee0c -r e71493e415e0 sys/arch/evbarm/stand/gzboot/gzboot.c
--- a/sys/arch/evbarm/stand/gzboot/gzboot.c     Wed Feb 12 18:35:01 2020 +0000
+++ b/sys/arch/evbarm/stand/gzboot/gzboot.c     Wed Feb 12 19:55:32 2020 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: gzboot.c,v 1.15 2011/01/22 19:19:17 joerg Exp $        */
+/*     $NetBSD: gzboot.c,v 1.16 2020/02/12 19:55:32 thorpej Exp $      */
 
 /*
  * Copyright (c) 2002 Wasabi Systems, Inc.
@@ -111,6 +111,12 @@
 void   main(void);
 void   gzcopy(void *, const void *, size_t);
 
+#ifdef GZSRCADDR
+#define        compressed_image        (void *)GZSRCADDR
+#else
+#define        compressed_image        md_root_image
+#endif
+
 void
 main(void)
 {
@@ -131,11 +137,14 @@
         * decompressing from an image which was concatenated onto
         * the end of the gzboot binary.
         */
+#ifdef GZSRCADDR
+       printf(">> Image address: %p\n", compressed_image);
+#endif
        if (md_root_size != 0)
                printf(">> Image size: %u\n", md_root_size);
 
        printf("Uncompressing image...");
-       gzcopy((void *) loadaddr, md_root_image, md_root_size);
+       gzcopy((void *) loadaddr, compressed_image, md_root_size);
        printf("done.\n");
 
        printf("Jumping to image @ 0x%x...\n", md_root_loadaddr);



Home | Main Index | Thread Index | Old Index