All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vladimir Serbinenko <phcoder@gmail.com>
To: grub-devel@gnu.org
Cc: Vladimir Serbinenko <phcoder@gmail.com>
Subject: [PATCH v2 4/4] loader/bsd: Add missing zeros
Date: Fri, 17 May 2024 10:45:40 +0300	[thread overview]
Message-ID: <20240517074540.2576-4-phcoder@gmail.com> (raw)
In-Reply-To: <20240517074540.2576-1-phcoder@gmail.com>

kern_end is 64-bit and so we need to add this additional zero.
entry is unused and is explicitly zero in own FreeBSD bootloader

Signed-off-by: Vladimir Serbinenko <phcoder@gmail.com>
---
 grub-core/loader/i386/bsd.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/grub-core/loader/i386/bsd.c b/grub-core/loader/i386/bsd.c
index af2b7cb9a..ee6fafd4d 100644
--- a/grub-core/loader/i386/bsd.c
+++ b/grub-core/loader/i386/bsd.c
@@ -900,7 +900,7 @@ grub_freebsd_boot (void)
 
   err = grub_relocator_alloc_chunk_align (relocator, &ch,
 					  0x10000, 0x90000,
-					  (is_64bit ? 3 : 9) * sizeof (grub_uint32_t)
+					  (is_64bit ? 4 : 9) * sizeof (grub_uint32_t)
 					  + sizeof (bi), 4,
 					  GRUB_RELOCATOR_PREFERENCE_NONE,
 					  0);
@@ -960,9 +960,10 @@ grub_freebsd_boot (void)
       state.rsp = stack_target;
       state.rip = (((grub_uint64_t) entry_hi) << 32) | entry;
 
-      stack[0] = entry;
+      stack[0] = 0;
       stack[1] = bi.tags;
       stack[2] = kern_end;
+      stack[3] = 0;
       return grub_relocator64_boot (relocator, state, 0, 0x40000000);
     }
   else
-- 
2.39.2


_______________________________________________
Grub-devel mailing list
Grub-devel@gnu.org
https://lists.gnu.org/mailman/listinfo/grub-devel

      parent reply	other threads:[~2024-05-17  7:47 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-17  7:45 [PATCH v2 1/4] smbios: Export grub_smbios_get_eps3 function Vladimir Serbinenko
2024-05-17  7:45 ` [PATCH v2 2/4] loader/bsd: Improve loading of *BSD on EFI platforms Vladimir Serbinenko
2024-05-17  7:45 ` [PATCH v2 3/4] Do NULL memory quirk workaround only when explicitly requested Vladimir Serbinenko
2024-05-17  7:45 ` Vladimir Serbinenko [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20240517074540.2576-4-phcoder@gmail.com \
    --to=phcoder@gmail.com \
    --cc=grub-devel@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.