Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 29 Jun 2012 01:55:21 +0000 (UTC)
From:      Rui Paulo <rpaulo@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r237737 - head/sys/powerpc/aim
Message-ID:  <201206290155.q5T1tLBO011836@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: rpaulo
Date: Fri Jun 29 01:55:20 2012
New Revision: 237737
URL: http://svn.freebsd.org/changeset/base/237737

Log:
  The `end' symbol doesn't match the end of the kernel image because it's
  relative to the start address (unless the start address is 0, which is
  not the case).
  This is currently not a problem because all powerpc architectures are
  using loader(8) which passes metadata to the kernel including the
  correct `endkernel' address.  If we don't use loader(8), register 4
  and 5 will have the size of the kernel ELF file, not its end address.
  We fix that simply by adding `kernel_text' to `end' to compute
  `endkernel'.
  
  Discussed with:	nathanw

Modified:
  head/sys/powerpc/aim/locore32.S
  head/sys/powerpc/aim/locore64.S

Modified: head/sys/powerpc/aim/locore32.S
==============================================================================
--- head/sys/powerpc/aim/locore32.S	Thu Jun 28 23:48:40 2012	(r237736)
+++ head/sys/powerpc/aim/locore32.S	Fri Jun 29 01:55:20 2012	(r237737)
@@ -164,13 +164,14 @@ __start:
 	
 	bl	OF_initial_setup
 
+	lis	3,kernel_text@ha
+	addi	3,3,kernel_text@l
+
 	lis	4,end@ha
 	addi	4,4,end@l
+	add	4,4,3
 	mr	5,4
 
-	lis	3,kernel_text@ha
-	addi	3,3,kernel_text@l
-
 	/* Restore the argument pointer and length */
 	mr	6,20
 	mr	7,21

Modified: head/sys/powerpc/aim/locore64.S
==============================================================================
--- head/sys/powerpc/aim/locore64.S	Thu Jun 28 23:48:40 2012	(r237736)
+++ head/sys/powerpc/aim/locore64.S	Fri Jun 29 01:55:20 2012	(r237737)
@@ -164,13 +164,14 @@ ASENTRY_NOPROF(__start)
 	bl	OF_initial_setup
 	nop
 
+	lis	3,kernbase@ha
+	addi	3,3,kernbase@l
+
 	lis	4,end@ha
 	addi	4,4,end@l
+	add	4,4,3
 	mr	5,4
 
-	lis	3,kernbase@ha
-	addi	3,3,kernbase@l
-
 	/* Restore the argument pointer and length */
 	mr	6,20
 	mr	7,21



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