Module Name: src Committed By: skrll Date: Sun Mar 21 09:00:55 UTC 2021
Modified Files: src/sys/arch/arm/arm32: arm32_kvminit.c src/sys/arch/evbarm/conf: Makefile.evbarm.inc std.generic std.rpi Log Message: -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. To generate a diff of this commit: cvs rdiff -u -r1.67 -r1.68 src/sys/arch/arm/arm32/arm32_kvminit.c cvs rdiff -u -r1.34 -r1.35 src/sys/arch/evbarm/conf/Makefile.evbarm.inc cvs rdiff -u -r1.8 -r1.9 src/sys/arch/evbarm/conf/std.generic cvs rdiff -u -r1.24 -r1.25 src/sys/arch/evbarm/conf/std.rpi 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/arm/arm32/arm32_kvminit.c diff -u src/sys/arch/arm/arm32/arm32_kvminit.c:1.67 src/sys/arch/arm/arm32/arm32_kvminit.c:1.68 --- src/sys/arch/arm/arm32/arm32_kvminit.c:1.67 Sat Dec 12 09:27:31 2020 +++ src/sys/arch/arm/arm32/arm32_kvminit.c Sun Mar 21 09:00:55 2021 @@ -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 @@ __KERNEL_RCSID(0, "$NetBSD: arm32_kvmini #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; Index: src/sys/arch/evbarm/conf/Makefile.evbarm.inc diff -u src/sys/arch/evbarm/conf/Makefile.evbarm.inc:1.34 src/sys/arch/evbarm/conf/Makefile.evbarm.inc:1.35 --- src/sys/arch/evbarm/conf/Makefile.evbarm.inc:1.34 Tue Aug 25 02:38:15 2015 +++ src/sys/arch/evbarm/conf/Makefile.evbarm.inc Sun Mar 21 09:00:55 2021 @@ -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 @@ SYSTEM_LD_TAIL_EXTRA+=; \ .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_BASES_EQUAL -DKERNEL_ CPPFLAGS+=-DKERNEL_BASE_VOFFSET="(${KERNEL_BASE_VIRT}-${KERNEL_BASE_PHYS})" . endif .endif +.endif EXTRA_CLEAN+= ${KERNELS:=.map} Index: src/sys/arch/evbarm/conf/std.generic diff -u src/sys/arch/evbarm/conf/std.generic:1.8 src/sys/arch/evbarm/conf/std.generic:1.9 --- src/sys/arch/evbarm/conf/std.generic:1.8 Fri Aug 14 16:18:37 2020 +++ src/sys/arch/evbarm/conf/std.generic Sun Mar 21 09:00:55 2021 @@ -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 @@ options __HAVE_PCI_MSI_MSIX 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" Index: src/sys/arch/evbarm/conf/std.rpi diff -u src/sys/arch/evbarm/conf/std.rpi:1.24 src/sys/arch/evbarm/conf/std.rpi:1.25 --- src/sys/arch/evbarm/conf/std.rpi:1.24 Thu Oct 18 09:01:54 2018 +++ src/sys/arch/evbarm/conf/std.rpi Sun Mar 21 09:00:55 2021 @@ -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 @@ options __HAVE_MM_MD_DIRECT_MAPPED_PHYS 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