svn commit: r333955 - in head/stand: common ofw/libofw sparc64/loader

Marius Strobl marius at FreeBSD.org
Mon May 21 01:20:20 UTC 2018


Author: marius
Date: Mon May 21 01:20:19 2018
New Revision: 333955
URL: https://svnweb.freebsd.org/changeset/base/333955

Log:
  - Unbreak booting sparc64 kernels after the metadata unification in
    r329190; sparc64 kernels are always 64-bit but with that revision
    in place, the loader was treating them as 32-bit ones.
  - In order to reduce the likelihood of this kind of breakage in the
    future, #ifdef out md_load() on sparc64 and make md_load_dual() -
    which is currently local to metadata.c anyway - static.
  - Make md_getboothowto() - also local to metadata.c - static.
  - Get rid of the unused DTB pointer on sparc64.

Modified:
  head/stand/common/metadata.c
  head/stand/ofw/libofw/libofw.h
  head/stand/sparc64/loader/main.c

Modified: head/stand/common/metadata.c
==============================================================================
--- head/stand/common/metadata.c	Mon May 21 01:16:26 2018	(r333954)
+++ head/stand/common/metadata.c	Mon May 21 01:20:19 2018	(r333955)
@@ -94,7 +94,7 @@ md_bootserial(void)
 }
 #endif
 
-int
+static int
 md_getboothowto(char *kargs)
 {
     char	*cp;
@@ -307,7 +307,7 @@ md_copymodules(vm_offset_t addr, int kern64)
  * - The kernel environment is copied into kernel space.
  * - Module metadata are formatted and placed in kernel space.
  */
-int
+static int
 md_load_dual(char *args, vm_offset_t *modulep, vm_offset_t *dtb, int kern64)
 {
     struct preloaded_file	*kfp;
@@ -460,13 +460,15 @@ md_load_dual(char *args, vm_offset_t *modulep, vm_offs
     return(0);
 }
 
+#if !defined(__sparc64__)
 int
 md_load(char *args, vm_offset_t *modulep, vm_offset_t *dtb)
 {
     return (md_load_dual(args, modulep, dtb, 0));
 }
+#endif
 
-#if defined(__mips__) || defined(__powerpc__)
+#if defined(__mips__) || defined(__powerpc__) || defined(__sparc64__)
 int
 md_load64(char *args, vm_offset_t *modulep, vm_offset_t *dtb)
 {

Modified: head/stand/ofw/libofw/libofw.h
==============================================================================
--- head/stand/ofw/libofw/libofw.h	Mon May 21 01:16:26 2018	(r333954)
+++ head/stand/ofw/libofw/libofw.h	Mon May 21 01:20:19 2018	(r333955)
@@ -62,7 +62,9 @@ struct preloaded_file;
 struct file_format;
 
 /* MD code implementing MI interfaces */
+#if !defined(__sparc64__)
 vm_offset_t md_load(char *args, vm_offset_t *modulep, vm_offset_t *dtb);
+#endif
 vm_offset_t md_load64(char *args, vm_offset_t *modulep, vm_offset_t *dtb);
 
 extern void	reboot(void);

Modified: head/stand/sparc64/loader/main.c
==============================================================================
--- head/stand/sparc64/loader/main.c	Mon May 21 01:16:26 2018	(r333954)
+++ head/stand/sparc64/loader/main.c	Mon May 21 01:20:19 2018	(r333955)
@@ -339,7 +339,7 @@ static int
 __elfN(exec)(struct preloaded_file *fp)
 {
 	struct file_metadata *fmp;
-	vm_offset_t mdp, dtbp;
+	vm_offset_t mdp;
 	Elf_Addr entry;
 	Elf_Ehdr *e;
 	int error;
@@ -348,7 +348,7 @@ __elfN(exec)(struct preloaded_file *fp)
 		return (EFTYPE);
 	e = (Elf_Ehdr *)&fmp->md_data;
 
-	if ((error = md_load(fp->f_args, &mdp, &dtbp)) != 0)
+	if ((error = md_load64(fp->f_args, &mdp, NULL)) != 0)
 		return (error);
 
 	printf("jumping to kernel entry at %#lx.\n", e->e_entry);


More information about the svn-src-head mailing list