Source-Changes-HG archive

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

[src/trunk]: src/sys/arch -DKERNEL_BASE_VOFFSET= has annoyed me for the last ...



details:   https://anonhg.NetBSD.org/src/rev/e1f2ea2fa847
branches:  trunk
changeset: 953798:e1f2ea2fa847
user:      skrll <skrll%NetBSD.org@localhost>
date:      Sun Mar 21 09:00:55 2021 +0000

description:
-DKERNEL_BASE_VOFFSET= has annoyed me for the last time...

Introduce KERNEL_VOFFSET_RUNTIME which prevents the addition of
-DKERNEL_BASE_VOFFSET= to the command line and use it on the
__HAVE_GENERIC_START kernels which do runtime calculation of the
offset.

diffstat:

 sys/arch/arm/arm32/arm32_kvminit.c       |  10 ++++++++--
 sys/arch/evbarm/conf/Makefile.evbarm.inc |   8 +++++++-
 sys/arch/evbarm/conf/std.generic         |   6 +++++-
 sys/arch/evbarm/conf/std.rpi             |   6 +++++-
 4 files changed, 25 insertions(+), 5 deletions(-)

diffs (97 lines):

diff -r 56dc774aaf1d -r e1f2ea2fa847 sys/arch/arm/arm32/arm32_kvminit.c
--- a/sys/arch/arm/arm32/arm32_kvminit.c        Sun Mar 21 08:55:59 2021 +0000
+++ b/sys/arch/arm/arm32/arm32_kvminit.c        Sun Mar 21 09:00:55 2021 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: arm32_kvminit.c,v 1.67 2020/12/12 09:27:31 skrll Exp $ */
+/*     $NetBSD: arm32_kvminit.c,v 1.68 2021/03/21 09:00:55 skrll Exp $ */
 
 /*
  * Copyright (c) 2002, 2003, 2005  Genetec Corporation.  All rights reserved.
@@ -127,7 +127,7 @@
 #include "opt_multiprocessor.h"
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: arm32_kvminit.c,v 1.67 2020/12/12 09:27:31 skrll Exp $");
+__KERNEL_RCSID(0, "$NetBSD: arm32_kvminit.c,v 1.68 2021/03/21 09:00:55 skrll Exp $");
 
 #include <sys/param.h>
 
@@ -165,6 +165,12 @@
 #define VPRINTF(...)   __nothing
 #endif
 
+#if defined(__HAVE_GENERIC_START)
+#if defined(KERNEL_BASE_VOFFSET)
+#error KERNEL_BASE_VOFFSET should not be defined with __HAVE_GENERIC_START
+#endif
+#endif
+
 struct bootmem_info bootmem_info;
 
 extern void *msgbufaddr;
diff -r 56dc774aaf1d -r e1f2ea2fa847 sys/arch/evbarm/conf/Makefile.evbarm.inc
--- a/sys/arch/evbarm/conf/Makefile.evbarm.inc  Sun Mar 21 08:55:59 2021 +0000
+++ b/sys/arch/evbarm/conf/Makefile.evbarm.inc  Sun Mar 21 09:00:55 2021 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: Makefile.evbarm.inc,v 1.34 2015/08/25 02:38:15 uebayasi Exp $
+#      $NetBSD: Makefile.evbarm.inc,v 1.35 2021/03/21 09:00:55 skrll Exp $
 
 #
 # If this is a install kernel and the ramdisk image exists in the object
@@ -20,6 +20,11 @@
 .include "${BOARDMKFRAG}"
 .endif
 
+#
+# All boards should use a runtime calculation of kern_vtopdiff, but
+# support the leagacy compile time method.
+#
+.if !defined(KERNEL_VOFFSET_RUNTIME)
 .if defined(KERNEL_BASE_PHYS) && defined(KERNEL_BASE_VIRT)
 . if ${KERNEL_BASE_PHYS} == ${KERNEL_BASE_VIRT}
 CPPFLAGS+=-DKERNEL_BASES_EQUAL -DKERNEL_BASE_VOFFSET=0
@@ -27,6 +32,7 @@
 CPPFLAGS+=-DKERNEL_BASE_VOFFSET="(${KERNEL_BASE_VIRT}-${KERNEL_BASE_PHYS})"
 . endif
 .endif
+.endif
 
 EXTRA_CLEAN+=  ${KERNELS:=.map}
 
diff -r 56dc774aaf1d -r e1f2ea2fa847 sys/arch/evbarm/conf/std.generic
--- a/sys/arch/evbarm/conf/std.generic  Sun Mar 21 08:55:59 2021 +0000
+++ b/sys/arch/evbarm/conf/std.generic  Sun Mar 21 09:00:55 2021 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: std.generic,v 1.8 2020/08/14 16:18:37 skrll Exp $
+#      $NetBSD: std.generic,v 1.9 2021/03/21 09:00:55 skrll Exp $
 #
 #      generic NetBSD/evbarm with FDT support
 
@@ -34,6 +34,10 @@
 
 makeoptions    BOARDMKFRAG="${THISARM}/conf/mk.generic"
 
+# Prevent the addition of a command line -DKERNEL_BASE_VOFFSET= as it
+# is done at runtime.
+makeoptions    KERNEL_VOFFSET_RUNTIME=1
+
 # The physical address is chosen by u-boot and determined by armv6_start.S.
 # The 64 byte offset is due to u-boot header.
 makeoptions    KERNEL_BASE_PHYS="0x00000040"
diff -r 56dc774aaf1d -r e1f2ea2fa847 sys/arch/evbarm/conf/std.rpi
--- a/sys/arch/evbarm/conf/std.rpi      Sun Mar 21 08:55:59 2021 +0000
+++ b/sys/arch/evbarm/conf/std.rpi      Sun Mar 21 09:00:55 2021 +0000
@@ -1,4 +1,4 @@
-#      $NetBSD: std.rpi,v 1.24 2018/10/18 09:01:54 skrll Exp $
+#      $NetBSD: std.rpi,v 1.25 2021/03/21 09:00:55 skrll Exp $
 #
 # standard NetBSD/evbarm for Raspberry Pi options
 
@@ -26,3 +26,7 @@
 
 makeoptions    BOARDMKFRAG="${THISARM}/conf/mk.rpi"
 makeoptions    LOADADDRESS="0x80008000"
+
+# Prevent the addition of a command line -DKERNEL_BASE_VOFFSET= as it
+# is done at runtime.
+makeoptions    KERNEL_VOFFSET_RUNTIME=1



Home | Main Index | Thread Index | Old Index