Kexec Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: kexec@lists.infradead.org
Cc: horms@verge.net.au, Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Subject: [PATCH v1 1/4] kexec: i386: Fix 32-bit right shifts on 32-bit architectures
Date: Mon, 14 Oct 2024 18:31:26 +0300	[thread overview]
Message-ID: <20241014153129.295176-1-andriy.shevchenko@linux.intel.com> (raw)

32-bit compilation makes compiler unhappy about too big right shifts.
Use a similar trick to Linux kernel project by replacing foo >> 32 by
(foo >> 16) >> 16.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 kexec/arch/i386/x86-linux-setup.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/kexec/arch/i386/x86-linux-setup.c b/kexec/arch/i386/x86-linux-setup.c
index 73251b93397b..efb6e2cba508 100644
--- a/kexec/arch/i386/x86-linux-setup.c
+++ b/kexec/arch/i386/x86-linux-setup.c
@@ -99,11 +99,11 @@ void setup_linux_bootloader_parameters_high(
 
 	if (real_mode->protocol_version >= 0x020c &&
 	    (initrd_base & 0xffffffffUL) != initrd_base)
-		real_mode->ext_ramdisk_image = initrd_base >> 32;
+		real_mode->ext_ramdisk_image = (initrd_base >> 16) >> 16;
 
 	if (real_mode->protocol_version >= 0x020c &&
 	    (initrd_size & 0xffffffffUL) != initrd_size)
-		real_mode->ext_ramdisk_size = initrd_size >> 32;
+		real_mode->ext_ramdisk_size = (initrd_size >> 16) >> 16;
 
 	/* The location of the command line */
 	/* if (real_mode_base == 0x90000) { */
@@ -117,7 +117,7 @@ void setup_linux_bootloader_parameters_high(
 		real_mode->cmd_line_ptr = cmd_line_ptr & 0xffffffffUL;
 		if ((real_mode->protocol_version >= 0x020c) &&
 		    ((cmd_line_ptr & 0xffffffffUL) != cmd_line_ptr))
-			real_mode->ext_cmd_line_ptr = cmd_line_ptr >> 32;
+			real_mode->ext_cmd_line_ptr = (cmd_line_ptr >> 16) >> 16;
 	}
 
 	/* Fill in the command line */
@@ -172,7 +172,7 @@ static int setup_linux_vesafb(struct x86_linux_param_header *real_mode)
 	real_mode->vesapm_seg     = 0;
 
 	if (fix.smem_start > 0xffffffffUL) {
-		real_mode->ext_lfb_base = fix.smem_start >> 32;
+		real_mode->ext_lfb_base = (fix.smem_start >> 16) >> 16;
 		real_mode->capabilities |= VIDEO_CAPABILITY_64BIT_BASE;
 	}
 
-- 
2.43.0.rc1.1336.g36b5255a03ac


_______________________________________________
kexec mailing list
kexec@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/kexec

             reply	other threads:[~2024-10-14 15:38 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-14 15:31 Andy Shevchenko [this message]
2024-10-14 15:31 ` [PATCH v1 2/4] kexec: i386: Fix format specifiers for various printf() and scanf() Andy Shevchenko
2024-10-14 15:31 ` [PATCH v1 3/4] util_lib/elf_info: Fix format specifiers for fprintf() Andy Shevchenko
2024-10-14 15:31 ` [PATCH v1 4/4] build: Update configure.ac to follow the changes Andy Shevchenko
2024-10-14 16:24 ` [PATCH v1 1/4] kexec: i386: Fix 32-bit right shifts on 32-bit architectures Simon Horman

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=20241014153129.295176-1-andriy.shevchenko@linux.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=horms@verge.net.au \
    --cc=kexec@lists.infradead.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox