kexec: i386: Fix 32-bit right shifts on 32-bit architectures
Subsystems (2)
PATCH 1/4 kexec: i386: Fix 32-bit right shifts on 32-bit architectures
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.
--- kexec/arch/i386/x86-linux-setup.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
kexec/arch/i386/x86-linux-setup.c +4 -4
@@ -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 ; }
Signature · 7 lines
2.43.0.rc1.1336.g36b5255a03ac _______________________________________________ kexec mailing list [email protected] http://lists.infradead.org/mailman/listinfo/kexec
PATCH 2/4 kexec: i386: Fix format specifiers for various printf() and scanf()
Compiler is not happy when wrong specifier is being used. Fix them all.
--- kexec/arch/i386/crashdump-x86.c | 2 +- kexec/arch/i386/kexec-x86-common.c | 2 +- kexec/arch/i386/x86-linux-setup.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-)
kexec/arch/i386/crashdump-x86.c +1 -1
@@ -784,7 +784,7 @@ static void cmdline_add_efi(char *cmdline)if (!acpi_rsdp)return ; -sprintf (acpi_rsdp_buf," acpi_rsdp=0x%lx" , acpi_rsdp); +sprintf (acpi_rsdp_buf," acpi_rsdp=0x%llx" , acpi_rsdp);if (strlen (cmdline) +strlen (acpi_rsdp_buf) > (COMMAND_LINE_SIZE -1 ))die ("Command line overflow\n" );
kexec/arch/i386/kexec-x86-common.c +1 -1
@@ -422,7 +422,7 @@ static uint64_t efi_get_acpi_rsdp(void) {/* ACPI20= always goes before ACPI= */ if ((strstr (line,"ACPI20=" )) || (strstr (line,"ACPI=" ))) { s =strchr (line,'=' ) +1 ; -sscanf (s,"0x%lx" , &acpi_rsdp); +sscanf (s,"0x%llx" , &acpi_rsdp);break ; } }
kexec/arch/i386/x86-linux-setup.c +1 -1
@@ -760,7 +760,7 @@ static void add_e820_map_from_mr(struct x86_linux_param_header *real_mode, e820[i].type =E820_RESERVED ;break ; } -dbgprintf ("%016lx-%016lx (%d)\n" , +dbgprintf ("%016llx-%016llx (%d)\n" , e820[i].addr, e820[i].addr + e820[i].size -1 , e820[i].type);
Signature · 7 lines
2.43.0.rc1.1336.g36b5255a03ac _______________________________________________ kexec mailing list [email protected] http://lists.infradead.org/mailman/listinfo/kexec
PATCH 3/4 util_lib/elf_info: Fix format specifiers for fprintf()
In reply to Andy ShevchenkoCompiler is not happy when wrong specifier is being used. Fix them all.
--- util_lib/elf_info.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
util_lib/elf_info.c +2 -2
@@ -890,7 +890,7 @@ static void dump_dmesg_structured(int fd, void (*handler)(char*, unsigned int))handler (out_buf, len);fprintf (stderr,"Cycle when parsing dmesg detected.\n" );fprintf (stderr,"The prink log_buf is most likely corrupted.\n" ); -fprintf (stderr,"log_buf = 0x%lx, idx = 0x%x\n" , +fprintf (stderr,"log_buf = 0x%llx, idx = 0x%x\n" , log_buf, current_idx);exit (68 ); }
@@ -904,7 +904,7 @@ static void dump_dmesg_structured(int fd, void (*handler)(char*, unsigned int))handler (out_buf, len);fprintf (stderr,"Index outside log_buf detected.\n" );fprintf (stderr,"The prink log_buf is most likely corrupted.\n" ); -fprintf (stderr,"log_buf = 0x%lx, idx = 0x%x\n" , +fprintf (stderr,"log_buf = 0x%llx, idx = 0x%x\n" , log_buf, current_idx);exit (69 ); }
Signature · 7 lines
2.43.0.rc1.1336.g36b5255a03ac _______________________________________________ kexec mailing list [email protected] http://lists.infradead.org/mailman/listinfo/kexec
PATCH 4/4 build: Update configure.ac to follow the changes
In reply to Andy ShevchenkoRunning bootstrap on Debian spills a few problems in configure.ac. Update it accordingly.
--- configure.ac | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-)
configure.ac +9 -8
@@ -4,7 +4,7 @@ dnl dnl dnl ---Required -AC_INIT(kexec-tools, 2.0.29.git) +AC_INIT([kexec-tools],[2.0.29.git]) AC_CONFIG_AUX_DIR(./config) AC_CONFIG_HEADERS([include/config.h]) AC_LANG(C)
@@ -92,25 +92,25 @@ if test "x$TARGET_CFLAGS" = "x" ; then TARGET_CFLAGS='-O2 -Wall' fi -AC_ARG_WITH([objdir], AC_HELP_STRING([--with-objdir=<dir>],[select directory for object files]), +AC_ARG_WITH([objdir], AS_HELP_STRING([--with-objdir=<dir>],[select directory for object files]), [ OBJDIR="$withval" ], [ OBJDIR="$OBJDIR" ]) AC_ARG_WITH([gamecube], - AC_HELP_STRING([--with-gamecube],[enable gamecube support]), + AS_HELP_STRING([--with-gamecube],[enable gamecube support]), AC_DEFINE(WITH_GAMECUBE, 1, [Define to include gamecube support])) -AC_ARG_WITH([zlib], AC_HELP_STRING([--without-zlib],[disable zlib support]), +AC_ARG_WITH([zlib], AS_HELP_STRING([--without-zlib],[disable zlib support]), [ with_zlib="$withval"], [ with_zlib=yes ] ) -AC_ARG_WITH([lzma], AC_HELP_STRING([--without-lzma],[disable lzma support]), +AC_ARG_WITH([lzma], AS_HELP_STRING([--without-lzma],[disable lzma support]), [ with_lzma="$withval"], [ with_lzma=yes ] ) -AC_ARG_WITH([xen], AC_HELP_STRING([--without-xen], +AC_ARG_WITH([xen], AS_HELP_STRING([--without-xen], [disable extended xen support]), [ with_xen="$withval"], [ with_xen=yes ] ) AC_ARG_WITH([booke], - AC_HELP_STRING([--with-booke],[build for booke]), + AS_HELP_STRING([--with-booke],[build for booke]), AC_DEFINE(CONFIG_BOOKE,1, [Define to build for BookE]))
@@ -245,4 +245,5 @@ AC_SUBST([OBJDIR]) AC_SUBST([INSTALL]) dnl ---Output -AC_OUTPUT([Makefile]) +AC_CONFIG_FILES([Makefile]) +AC_OUTPUT
Signature · 7 lines
2.43.0.rc1.1336.g36b5255a03ac _______________________________________________ kexec mailing list [email protected] http://lists.infradead.org/mailman/listinfo/kexec
Quoted 5 lines · Andy Shevchenko
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 <[email protected]>
Thanks Andy,
Series applied.
_______________________________________________
kexec mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/kexec