svn commit: r237737 - head/sys/powerpc/aim

Rui Paulo rpaulo at FreeBSD.org
Fri Jun 29 01:55:21 UTC 2012


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 at ha
+	addi	3,3,kernel_text at l
+
 	lis	4,end at ha
 	addi	4,4,end at l
+	add	4,4,3
 	mr	5,4
 
-	lis	3,kernel_text at ha
-	addi	3,3,kernel_text at 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 at ha
+	addi	3,3,kernbase at l
+
 	lis	4,end at ha
 	addi	4,4,end at l
+	add	4,4,3
 	mr	5,4
 
-	lis	3,kernbase at ha
-	addi	3,3,kernbase at l
-
 	/* Restore the argument pointer and length */
 	mr	6,20
 	mr	7,21


More information about the svn-src-all mailing list