svn commit: r258754 - projects/uefi/sys/boot/amd64/efi

Ed Maste emaste at FreeBSD.org
Fri Nov 29 20:28:38 UTC 2013


Author: emaste
Date: Fri Nov 29 20:28:37 2013
New Revision: 258754
URL: http://svnweb.freebsd.org/changeset/base/258754

Log:
  Avoid printf after GetMemoryMap
  
  The printf may invalidate the memory map obtained in bi_load (resulting
  in a new MapKey), which then causes ExitBootServices to fail.
  
  Some more work is still needed to address GetMemoryMap retries for other
  situations that may invalidate the memory map, but this change at least
  allowed me to boot on an Intel DQ77MK system.
  
  Sponsored by:	The FreeBSD Foundation

Modified:
  projects/uefi/sys/boot/amd64/efi/elf64_freebsd.c

Modified: projects/uefi/sys/boot/amd64/efi/elf64_freebsd.c
==============================================================================
--- projects/uefi/sys/boot/amd64/efi/elf64_freebsd.c	Fri Nov 29 20:19:00 2013	(r258753)
+++ projects/uefi/sys/boot/amd64/efi/elf64_freebsd.c	Fri Nov 29 20:28:37 2013	(r258754)
@@ -159,12 +159,12 @@ elf64_exec(struct preloaded_file *fp)
         PT2[i] |= PG_V | PG_RW | PG_PS | PG_U;
     }
 
+    printf("Start @ 0x%lx ...\n", ehdr->e_entry);
+
     err = bi_load(fp->f_args, &modulep, &kernend);
     if (err != 0)
 	return(err);
 
-    printf("Start @ 0x%lx ...\n", ehdr->e_entry);
-
     status = BS->ExitBootServices(IH, x86_efi_mapkey);
     if (EFI_ERROR(status)) {
         printf("%s: ExitBootServices() returned 0x%lx\n", __func__,


More information about the svn-src-projects mailing list