Module Name: src
Committed By: thorpej
Date: Wed Feb 12 19:55:32 UTC 2020
Modified Files:
src/sys/arch/evbarm/stand/gzboot: Makefile.gzboot gzboot.c
Log Message:
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.
To generate a diff of this commit:
cvs rdiff -u -r1.37 -r1.38 src/sys/arch/evbarm/stand/gzboot/Makefile.gzboot
cvs rdiff -u -r1.15 -r1.16 src/sys/arch/evbarm/stand/gzboot/gzboot.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/arch/evbarm/stand/gzboot/Makefile.gzboot
diff -u src/sys/arch/evbarm/stand/gzboot/Makefile.gzboot:1.37 src/sys/arch/evbarm/stand/gzboot/Makefile.gzboot:1.38
--- src/sys/arch/evbarm/stand/gzboot/Makefile.gzboot:1.37 Thu Oct 24 18:46:21 2019
+++ src/sys/arch/evbarm/stand/gzboot/Makefile.gzboot Wed Feb 12 19:55:32 2020
@@ -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+= -DHEAP_VARIABLE
CPPFLAGS+= -DRELOC=${RELOC}
CPPFLAGS+= -DMAXIMAGESIZE=${MAXIMAGESIZE}
CPPFLAGS+= -DLOADADDR=${LOADADDR}
+.if defined(GZSRCADDR)
+CPPFLAGS+= -DGZSRCADDR=${GZSRCADDR}
+.endif
COPTS+= -ffreestanding
COPTS+= -fno-stack-protector
Index: src/sys/arch/evbarm/stand/gzboot/gzboot.c
diff -u src/sys/arch/evbarm/stand/gzboot/gzboot.c:1.15 src/sys/arch/evbarm/stand/gzboot/gzboot.c:1.16
--- src/sys/arch/evbarm/stand/gzboot/gzboot.c:1.15 Sat Jan 22 19:19:17 2011
+++ src/sys/arch/evbarm/stand/gzboot/gzboot.c Wed Feb 12 19:55:32 2020
@@ -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 zmemcpy(unsigned char *, unsigned c
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 @@ main(void)
* 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);