]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
2009-08-24 Vladimir Serbinenko <phcoder@gmail.com>
authorphcoder <phcoder@localhost>
Mon, 24 Aug 2009 12:59:48 +0000 (12:59 +0000)
committerphcoder <phcoder@localhost>
Mon, 24 Aug 2009 12:59:48 +0000 (12:59 +0000)
Support for 64-bit NetBSD.

* loader/i386/bsd.c (grub_bsd_load_elf): Apply correct mask to entry
point when booting non-FreeBSD.

ChangeLog
loader/i386/bsd.c

index 9ec86ede8ba24fc453d37f03b862f48c6c14d881..59b50f04a0292d91eff4d734b56f2c352df2dc9a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2009-08-24  Vladimir Serbinenko  <phcoder@gmail.com>
+
+       Support for 64-bit NetBSD.
+
+       * loader/i386/bsd.c (grub_bsd_load_elf): Apply correct mask to entry
+       point when booting non-FreeBSD.
+
 2009-08-24  Vladimir Serbinenko  <phcoder@gmail.com>
 
        Support --no-smp and --no-acpi for NetBSD.
index 10b92e3c6093d1466349d3917ac8e513335b0321..26f98b3a97585d60c77152841ef82c3848e05292 100644 (file)
@@ -778,8 +778,18 @@ grub_bsd_load_elf (grub_elf_t elf)
   else if (grub_elf_is_elf64 (elf))
     {
       is_64bit = 1;
-      entry = elf->ehdr.ehdr64.e_entry & 0xffffffff;
-      entry_hi = (elf->ehdr.ehdr64.e_entry >> 32) & 0xffffffff;
+
+      /* FreeBSD has 64-bit entry point.  */
+      if (kernel_type == KERNEL_TYPE_FREEBSD)
+       {
+         entry = elf->ehdr.ehdr64.e_entry & 0xffffffff;
+         entry_hi = (elf->ehdr.ehdr64.e_entry >> 32) & 0xffffffff;
+       }
+      else
+       {
+         entry = elf->ehdr.ehdr64.e_entry & 0x0fffffff;
+         entry_hi = 0;
+       }
       return grub_elf64_load (elf, grub_bsd_elf64_hook, 0, 0);
     }
   else