Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 30 Dec 2019 23:20:46 +0000 (UTC)
From:      Ian Lepore <ian@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r356211 - in head/sys: arm/arm conf
Message-ID:  <201912302320.xBUNKkxb045185@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: ian
Date: Mon Dec 30 23:20:46 2019
New Revision: 356211
URL: https://svnweb.freebsd.org/changeset/base/356211

Log:
  Set a "kernbase" symbol in 32-bit arm locore.S and use it with ldscript.arm.
  
  This brings arm into line with how every other arch does it.  For some
  reason, only arm lacked a definition of a symbol named kernbase in its
  locore.S file(s) for use in its ldscript.arm file.  Needlessly different
  means harder to maintain.
  
  Using a common symbol name also eases work in progress on a script to help
  generate arm and arm64 kernels packaged in various ways (like with a header
  blob needed for a bootloader prepended to the kernel file).

Modified:
  head/sys/arm/arm/locore-v4.S
  head/sys/arm/arm/locore-v6.S
  head/sys/conf/Makefile.arm

Modified: head/sys/arm/arm/locore-v4.S
==============================================================================
--- head/sys/arm/arm/locore-v4.S	Mon Dec 30 22:39:29 2019	(r356210)
+++ head/sys/arm/arm/locore-v4.S	Mon Dec 30 23:20:46 2019	(r356211)
@@ -62,9 +62,11 @@ __FBSDID("$FreeBSD$");
  */
 	.text
 	.align	2
+
+	.globl kernbase
+	.set kernbase,KERNVIRTADDR
+
 #ifdef PHYSADDR
-.globl kernbase
-.set kernbase,KERNBASE
 .globl physaddr
 .set physaddr,PHYSADDR
 #endif

Modified: head/sys/arm/arm/locore-v6.S
==============================================================================
--- head/sys/arm/arm/locore-v6.S	Mon Dec 30 22:39:29 2019	(r356210)
+++ head/sys/arm/arm/locore-v6.S	Mon Dec 30 23:20:46 2019	(r356211)
@@ -59,6 +59,9 @@ __FBSDID("$FreeBSD$");
 	.text
 	.align	2
 
+	.globl kernbase
+	.set kernbase,KERNVIRTADDR
+
 #if __ARM_ARCH >= 7
 #define	HANDLE_HYP							\
 	/* Leave HYP mode */						;\

Modified: head/sys/conf/Makefile.arm
==============================================================================
--- head/sys/conf/Makefile.arm	Mon Dec 30 22:39:29 2019	(r356210)
+++ head/sys/conf/Makefile.arm	Mon Dec 30 23:20:46 2019	(r356211)
@@ -61,7 +61,7 @@ KERNVIRTADDR= 0xc0000000
 # "ELF for the ARM architecture" for more info on the mapping symbols.
 SYSTEM_LD= \
 	${SYSTEM_LD_BASECMD} \
-	    --defsym='text_start=${KERNVIRTADDR} + SIZEOF_HEADERS' \
+	    --defsym='text_start=kernbase + SIZEOF_HEADERS' \
 	    -o ${.TARGET} ${SYSTEM_OBJS} vers.o; \
 	$(OBJCOPY) \
 	    --wildcard \
@@ -77,7 +77,7 @@ KERNEL_EXTRA_INSTALL+= ${KERNEL_KO}.bin
 ${KERNEL_KO}.bin: ${SYSTEM_DEP} vers.o
 	@echo "linking ${.TARGET}"
 	@${SYSTEM_LD_BASECMD} \
-	    --defsym='text_start=${KERNVIRTADDR}' \
+	    --defsym='text_start=kernbase' \
 	    -o ${.TARGET} ${SYSTEM_OBJS} vers.o
 	${SIZE} ${.TARGET}
 	@${OBJCOPY} \



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201912302320.xBUNKkxb045185>