From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from list by lists.gnu.org with archive (Exim 4.71) id 1UPXvz-0003WU-ED for mharc-grub-devel@gnu.org; Tue, 09 Apr 2013 08:45:59 -0400 Received: from eggs.gnu.org ([208.118.235.92]:54236) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UPXvr-0003V0-DJ for grub-devel@gnu.org; Tue, 09 Apr 2013 08:45:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1UPXvm-0002Dd-U0 for grub-devel@gnu.org; Tue, 09 Apr 2013 08:45:51 -0400 Received: from mail-ee0-f51.google.com ([74.125.83.51]:36687) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1UPXvm-0002DQ-FM for grub-devel@gnu.org; Tue, 09 Apr 2013 08:45:46 -0400 Received: by mail-ee0-f51.google.com with SMTP id c4so2811758eek.38 for ; Tue, 09 Apr 2013 05:45:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:message-id:date:from:user-agent:mime-version:to:subject :references:in-reply-to:x-enigmail-version:content-type; bh=Lkm6mpsRNsVeLM7lK71nX2/XbRYNWqWDQ89FMXZbMRQ=; b=Rs017IlHytkA72Ryo1f18vM8ER0A4F6l+qHs9H+16Fdcr32nrvi1kKowEi4/lrk1G+ dyDGpcAkLSBu8YE2ppm2WUuryK0cVpL4//9bXxWhOYDWaveoLYyt8EPiBS/pHcCtTMx1 uzF5QgnDFch1DtOt6DRJYOf68PVSl3dchZgCdnpxDeoaG2N3OkRAXQW4wm6pTnPYWEFf CRSLvFjkMBDTHpwBh8C+MOjbr0FUA0ElmK6y20uH4lneyEf599jC3lzgRQdoPfAugVcx RQELqdx9hbseVL+odXofrHsL7lHTrbQe0jiI8YTZnpok3OQpOh/5cImhnsTDimXFZlGC /v3A== X-Received: by 10.15.27.195 with SMTP id p43mr24858551eeu.8.1365511545659; Tue, 09 Apr 2013 05:45:45 -0700 (PDT) Received: from debian.x201.phnet (245-188.1-85.cust.bluewin.ch. [85.1.188.245]) by mx.google.com with ESMTPS id s47sm37807978eeg.8.2013.04.09.05.45.44 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 09 Apr 2013 05:45:44 -0700 (PDT) Message-ID: <51640D70.7040801@gmail.com> Date: Tue, 09 Apr 2013 14:45:36 +0200 From: =?UTF-8?B?VmxhZGltaXIgJ8+GLWNvZGVyL3BoY29kZXInIFNlcmJpbmVua28=?= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.12) Gecko/20130116 Icedove/10.0.12 MIME-Version: 1.0 To: Leif Lindholm , The development of GRUB 2 Subject: Re: [PATCH 4/7] Support for ARM/U-Boot platforms References: <51635D98.7020901@gmail.com> <20130409113927.GX23069@rocoto.smurfnet.nu> In-Reply-To: <20130409113927.GX23069@rocoto.smurfnet.nu> X-Enigmail-Version: 1.4.1 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="------------enig7C66FAB66DC290FF90E9702D" X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 74.125.83.51 X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: The development of GNU GRUB List-Id: The development of GNU GRUB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Apr 2013 12:45:55 -0000 This is an OpenPGP/MIME signed message (RFC 2440 and 3156) --------------enig7C66FAB66DC290FF90E9702D Content-Type: multipart/mixed; boundary="------------020407060305070103040606" This is a multi-part message in MIME format. --------------020407060305070103040606 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Here is what I have in my local tree (full patch). Contains also an initial attempt at i386-uboot but given sorry state of uboot on i386, I'll probably abandon it instead of finishing --------------020407060305070103040606 Content-Type: text/x-diff; name="q.diff" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="q.diff" =3D=3D=3D modified file 'Makefile.util.def' --- Makefile.util.def 2013-04-07 00:41:07 +0000 +++ Makefile.util.def 2013-04-09 12:14:38 +0000 @@ -150,7 +150,7 @@ common =3D util/resolve.c; common =3D grub-core/kern/emu/argp_common.c; =20 - arm =3D grub-core/kern/arm/dl.c; + common =3D grub-core/kern/arm/dl.c; =20 extra_dist =3D util/grub-mkimagexx.c; =20 @@ -472,7 +472,6 @@ enable =3D mips_loongson; enable =3D ia64_efi; enable =3D powerpc_ieee1275; - enable =3D arm_uboot; }; =20 script =3D { =3D=3D=3D modified file 'conf/Makefile.common' --- conf/Makefile.common 2013-04-07 00:41:07 +0000 +++ conf/Makefile.common 2013-04-07 16:08:07 +0000 @@ -40,8 +40,7 @@ if COND_arm # Image entry point always in ARM (A32) state - ensure proper functional= ity if # the rest is built for the Thumb (T32) state. - CFLAGS_PLATFORM +=3D -mthumb-interwork -mno-unaligned-access -mlong-ca= lls - CCASFLAGS_PLATFORM =3D -Wa,-mimplicit-it=3Dthumb + CFLAGS_PLATFORM +=3D -mthumb-interwork -march=3Darmv6 -mlong-calls LDFLAGS_PLATFORM =3D -Wl,--wrap=3D__clear_cache endif =20 =3D=3D=3D modified file 'configure.ac' --- configure.ac 2013-04-07 00:41:07 +0000 +++ configure.ac 2013-04-08 21:48:08 +0000 @@ -141,6 +141,7 @@ i386-linuxbios) platform=3Dcoreboot ;; i386-ieee1275) ;; i386-qemu) ;; + i386-uboot) ;; powerpc-ieee1275) ;; sparc64-ieee1275) ;; ia64-efi) ;; @@ -717,7 +718,7 @@ fi =20 # Check for libgcc symbols -AC_CHECK_FUNCS(__bswapsi2 __bswapdi2 __ashldi3 __ashrdi3 __lshrdi3 __ucm= pdi2 _restgpr_14_x __udivsi3 __umoddi3 __udivdi3 __divsi3 __modsi3 __umod= si3 __moddi3 __divdi3 __ctzdi2 __ctzsi2) +AC_CHECK_FUNCS(__bswapsi2 __bswapdi2 __ashldi3 __ashrdi3 __lshrdi3 __ucm= pdi2 _restgpr_14_x __udivsi3 __umoddi3 __udivdi3 __divsi3 __modsi3 __umod= si3 __moddi3 __divdi3 __ctzdi2 __ctzsi2 __aeabi_ulcmp) =20 if test "x$TARGET_APPLE_CC" =3D x1 ; then CFLAGS=3D"$TARGET_CFLAGS -nostdlib" @@ -1149,6 +1150,7 @@ AM_CONDITIONAL([COND_i386_ieee1275], [test x$target_cpu =3D xi386 -a x$p= latform =3D xieee1275]) AM_CONDITIONAL([COND_i386_coreboot], [test x$target_cpu =3D xi386 -a x$p= latform =3D xcoreboot]) AM_CONDITIONAL([COND_i386_multiboot], [test x$target_cpu =3D xi386 -a x$= platform =3D xmultiboot]) +AM_CONDITIONAL([COND_i386_uboot], [test x$target_cpu =3D xi386 -a x$plat= form =3D xuboot]) AM_CONDITIONAL([COND_x86_64_efi], [test x$target_cpu =3D xx86_64 -a x$pl= atform =3D xefi]) AM_CONDITIONAL([COND_mips_loongson], [test x$target_cpu =3D xmipsel -a x= $platform =3D xloongson]) AM_CONDITIONAL([COND_mips_qemu_mips], [test "(" x$target_cpu =3D xmips -= o x$target_cpu =3D xmipsel ")" -a x$platform =3D xqemu_mips]) =3D=3D=3D modified file 'gentpl.py' --- gentpl.py 2013-04-07 00:41:07 +0000 +++ gentpl.py 2013-04-08 23:20:22 +0000 @@ -20,7 +20,8 @@ # =20 GRUB_PLATFORMS =3D [ "emu", "i386_pc", "i386_efi", "i386_qemu", "i386_co= reboot", - "i386_multiboot", "i386_ieee1275", "x86_64_efi", + "i386_multiboot", "i386_ieee1275", "i386_uboot", + "x86_64_efi", "mips_loongson", "sparc64_ieee1275", "powerpc_ieee1275", "mips_arc", "ia64_efi", "mips_qemu_mips", "arm_uboot", "arm_efi" ] @@ -30,7 +31,7 @@ GROUPS["common"] =3D GRUB_PLATFORMS[:] =20 # Groups based on CPU -GROUPS["i386"] =3D [ "i386_pc", "i386_efi", "i386_qemu", "i386_coreb= oot", "i386_multiboot", "i386_ieee1275" ] +GROUPS["i386"] =3D [ "i386_pc", "i386_efi", "i386_qemu", "i386_coreb= oot", "i386_multiboot", "i386_ieee1275", "i386_uboot" ] GROUPS["x86_64"] =3D [ "x86_64_efi" ] GROUPS["x86"] =3D GROUPS["i386"] + GROUPS["x86_64"] GROUPS["mips"] =3D [ "mips_loongson", "mips_qemu_mips", "mips_arc" ]= @@ -41,7 +42,7 @@ # Groups based on firmware GROUPS["efi"] =3D [ "i386_efi", "x86_64_efi", "ia64_efi", "arm_efi" ] GROUPS["ieee1275"] =3D [ "i386_ieee1275", "sparc64_ieee1275", "powerpc= _ieee1275" ] -GROUPS["uboot"] =3D [ "arm_uboot" ] +GROUPS["uboot"] =3D [ "arm_uboot", "i386_uboot" ] =20 # emu is a special case so many core functionality isn't needed on this = platform GROUPS["noemu"] =3D GRUB_PLATFORMS[:]; GROUPS["noemu"].remove("emu") @@ -64,7 +65,7 @@ for i in GROUPS["terminfoinkernel"]: GROUPS["terminfomodule"].remove(i) =20 # Flattened Device Trees (FDT) -GROUPS["fdt"] =3D [ "arm_uboot", "arm_efi" ] +GROUPS["fdt"] =3D [ "arm_uboot", "arm_efi", "i386_uboot" ] =20 # Miscelaneous groups schedulded to disappear in future GROUPS["i386_coreboot_multiboot_qemu"] =3D ["i386_coreboot", "i386_multi= boot", "i386_qemu"] =3D=3D=3D modified file 'grub-core/Makefile.am' --- grub-core/Makefile.am 2013-04-07 00:41:07 +0000 +++ grub-core/Makefile.am 2013-04-08 23:41:09 +0000 @@ -132,6 +132,15 @@ KERNEL_HEADER_FILES +=3D $(top_srcdir)/include/grub/i386/tsc.h endif =20 +if COND_i386_uboot +KERNEL_HEADER_FILES +=3D $(top_srcdir)/include/grub/uboot/uboot.h +KERNEL_HEADER_FILES +=3D $(top_srcdir)/include/grub/uboot/disk.h +KERNEL_HEADER_FILES +=3D $(top_srcdir)/include/grub/terminfo.h +KERNEL_HEADER_FILES +=3D $(top_srcdir)/include/grub/extcmd.h +KERNEL_HEADER_FILES +=3D $(top_srcdir)/include/grub/lib/arg.h +KERNEL_HEADER_FILES +=3D $(top_srcdir)/include/grub/i386/tsc.h +endif + if COND_x86_64_efi KERNEL_HEADER_FILES +=3D $(top_srcdir)/include/grub/efi/efi.h KERNEL_HEADER_FILES +=3D $(top_srcdir)/include/grub/efi/disk.h =3D=3D=3D modified file 'grub-core/Makefile.core.def' --- grub-core/Makefile.core.def 2013-04-07 00:41:07 +0000 +++ grub-core/Makefile.core.def 2013-04-09 00:05:56 +0000 @@ -79,6 +79,7 @@ i386_ieee1275_startup =3D kern/i386/ieee1275/startup.S; i386_coreboot_startup =3D kern/i386/coreboot/startup.S; i386_multiboot_startup =3D kern/i386/coreboot/startup.S; + i386_uboot_startup =3D kern/i386/uboot/startup.S; mips_startup =3D kern/mips/startup.S; sparc64_ieee1275_startup =3D kern/sparc64/ieee1275/crt0.S; powerpc_ieee1275_startup =3D kern/powerpc/ieee1275/startup.S; @@ -492,6 +493,7 @@ enable =3D i386_ieee1275; enable =3D i386_coreboot; enable =3D i386_multiboot; + enable =3D i386_uboot; }; =20 module =3D { @@ -569,11 +571,13 @@ i386_pc =3D commands/i386/pc/acpi.c; i386_coreboot =3D commands/i386/pc/acpi.c; i386_multiboot =3D commands/i386/pc/acpi.c; + i386_uboot =3D commands/i386/pc/acpi.c; =20 enable =3D efi; enable =3D i386_pc; enable =3D i386_coreboot; enable =3D i386_multiboot; + enable =3D i386_uboot; }; =20 module =3D { @@ -1057,6 +1061,8 @@ i386_multiboot =3D efiemu/i386/pc/cfgtables.c; i386_ieee1275 =3D efiemu/i386/nocfgtables.c; i386_qemu =3D efiemu/i386/nocfgtables.c; + i386_uboot =3D efiemu/i386/pc/cfgtables.c; + common =3D efiemu/mm.c; common =3D efiemu/loadcore_common.c; common =3D efiemu/symbols.c; @@ -1077,6 +1083,7 @@ enable =3D i386_ieee1275; enable =3D i386_multiboot; enable =3D i386_qemu; + enable =3D i386_uboot; }; =20 module =3D { @@ -1656,6 +1663,7 @@ =20 enable =3D terminfomodule; enable =3D ieee1275; + enable =3D i386_uboot; }; =20 module =3D { =3D=3D=3D modified file 'grub-core/disk/uboot/ubootdisk.c' --- grub-core/disk/uboot/ubootdisk.c 2013-04-07 00:41:07 +0000 +++ grub-core/disk/uboot/ubootdisk.c 2013-04-08 08:34:08 +0000 @@ -246,7 +246,7 @@ grub_dprintf ("ubootdisk", "(%s) blocksize=3D%d, log_sector_size=3D%d\= n", disk->name, d->block_size, disk->log_sector_size); =20 - disk->total_sectors =3D GRUB_DISK_SIZE_UNKNOWN; + disk->total_sectors =3D devinfo->di_stor.block_count; disk->data =3D d; =20 return GRUB_ERR_NONE; =3D=3D=3D modified file 'grub-core/kern/arm/dl.c' --- grub-core/kern/arm/dl.c 2013-04-07 00:41:07 +0000 +++ grub-core/kern/arm/dl.c 2013-04-09 11:44:28 +0000 @@ -23,17 +23,11 @@ #include #include #include +#include =20 #ifdef GRUB_UTIL # include #else -# if !defined(__thumb2__) -# error "Relocations not implemented for A32 ("ARM") instruction set ye= t!" -# endif - -grub_err_t reloc_jump24 (grub_uint32_t *addr, Elf32_Addr sym_addr); -grub_err_t reloc_thm_call (grub_uint16_t *addr, Elf32_Addr sym_addr); -grub_err_t reloc_thm_jump19 (grub_uint16_t *addr, Elf32_Addr sym_addr); =20 #ifdef DL_DEBUG static const char *symstrtab; @@ -104,7 +98,7 @@ * B.W, BL and BLX */ grub_err_t -reloc_thm_call (grub_uint16_t *target, Elf32_Addr sym_addr) +grub_arm_reloc_thm_call (grub_uint16_t *target, Elf32_Addr sym_addr) { grub_int32_t offset, offset_low, offset_high; grub_uint32_t sign, j1, j2, is_blx; @@ -122,14 +116,8 @@ =20 /* If BLX, target symbol must be ARM (target address LSB =3D=3D 0) */ if (is_blx && (sym_addr & 1)) - { -#ifndef GRUB_UTIL - return grub_error - (GRUB_ERR_BUG, N_("Relocation targeting wrong execution state")); -#else - grub_util_error ("Relocation targeting wrong execution state"); -#endif - } + return grub_error (GRUB_ERR_BUG, + N_("Relocation targeting wrong execution state")); =20 offset_low =3D -16777216; offset_high =3D is_blx ? 16777212 : 16777214; @@ -159,18 +147,12 @@ #endif =20 if ((offset < offset_low) || (offset > offset_high)) - { -#ifdef GRUB_UTIL - grub_util_error ("Relocation out of range"); -#else - return grub_error - (GRUB_ERR_OUT_OF_RANGE, N_("THM_CALL Relocation out of range.")); -#endif - } + return grub_error (GRUB_ERR_OUT_OF_RANGE, + N_("THM_CALL Relocation out of range.")); =20 #ifdef GRUB_UTIL - grub_util_info (" relative destination =3D 0x%08x", - (unsigned int)target + offset); + grub_util_info (" relative destination =3D 0x%08lx", + (unsigned long)target + offset); #endif =20 /* Reassemble instruction word */ @@ -200,7 +182,7 @@ * Relocate conditional Thumb (T32) B.W */ grub_err_t -reloc_thm_jump19 (grub_uint16_t *addr, Elf32_Addr sym_addr) +grub_arm_reloc_thm_jump19 (grub_uint16_t *addr, Elf32_Addr sym_addr) { grub_int32_t offset; grub_uint32_t insword, insmask; @@ -260,7 +242,7 @@ * Relocate ARM (A32) B */ grub_err_t -reloc_jump24 (grub_uint32_t *addr, Elf32_Addr sym_addr) +grub_arm_reloc_jump24 (grub_uint32_t *addr, Elf32_Addr sym_addr) { grub_uint32_t insword; grub_int32_t offset; @@ -358,9 +340,10 @@ return retval; } break; + case R_ARM_CALL: case R_ARM_JUMP24: { - retval =3D reloc_jump24 (target, sym_addr); + retval =3D grub_arm_reloc_jump24 (target, sym_addr); if (retval !=3D GRUB_ERR_NONE) return retval; } @@ -369,7 +352,7 @@ case R_ARM_THM_JUMP24: { /* Thumb instructions can be 16-bit aligned */ - retval =3D reloc_thm_call ((grub_uint16_t *) target, sym_addr); + retval =3D grub_arm_reloc_thm_call ((grub_uint16_t *) target, sym_a= ddr); if (retval !=3D GRUB_ERR_NONE) return retval; } @@ -377,7 +360,7 @@ case R_ARM_THM_JUMP19: { /* Thumb instructions can be 16-bit aligned */ - retval =3D reloc_thm_jump19 ((grub_uint16_t *) target, sym_addr); + retval =3D grub_arm_reloc_thm_jump19 ((grub_uint16_t *) target, sym= _addr); if (retval !=3D GRUB_ERR_NONE) return retval; } =3D=3D=3D modified file 'grub-core/kern/arm/uboot/startup.S' --- grub-core/kern/arm/uboot/startup.S 2013-04-07 00:41:07 +0000 +++ grub-core/kern/arm/uboot/startup.S 2013-04-09 12:36:48 +0000 @@ -65,20 +65,29 @@ ldr sp, =3Dentry_state push {r4-r12,lr} @ store U-Boot context (sp in r12) =20 - @ Put kernel parameters aside until we can store them (further down) - mov r4, r1 @ machine type - mov r5, r2 @ boot data + ldr r12, =3DEXT_C(uboot_machine_type) + str r1, [r12] + ldr r12, =3DEXT_C(uboot_boot_data) + str r2, [r12] + =20 @ Modules have been stored as a blob in BSS, @ they need to be manually relocated to _end or @ (__bss_start + grub_total_module_size), whichever greater. - bl uboot_get_real_bss_start @ r0 =3D src + ldr r0, =3DEXT_C(__bss_start) @ src + add r0, r0, #(GRUB_KERNEL_MACHINE_MOD_ALIGN - 1) + mvn r1, #(GRUB_KERNEL_MACHINE_MOD_ALIGN - 1) + and r0, r0, r1 + ldr r1, =3DEXT_C(_end) @ dst =3D End of BSS ldr r2, grub_total_module_size @ blob size add r3, r0, r2 @ blob end cmp r1, r3 @ _end < blob end? movlt r1, r3 @ dst =3D blob end + blob size -=09 + + ldr r12, =3DEXT_C(grub_modbase) + str r1, [r12] + 1: ldr r3, [r0], #4 @ r3 =3D *src++=20 str r3, [r1], #4 @ *dst++ =3D r3=20 subs r2, #4 @ remaining -=3D 4 @@ -91,35 +100,16 @@ =20 @ Since we _are_ the C run-time, we need to manually zero the BSS @ region before continuing - bl uboot_get_real_bss_start @ zero from here + ldr r0, =3DEXT_C(__bss_start) @ zero from here ldr r1, =3DEXT_C(_end) @ to here mov r2, #0 1: str r2, [r0], #4 cmp r0, r1 bne 1b - - @ Global variables now accessible - store kernel parameters in memory - ldr r12, =3DEXT_C(uboot_machine_type) - str r4, [r12] - ldr r12, =3DEXT_C(uboot_boot_data) - str r5, [r12] =09 b EXT_C(grub_main) =20 /* - * __bss_start does not actually point to the start of the runtime - * BSS, but rather to the next byte following the preceding data. - */ -FUNCTION (uboot_get_real_bss_start) - ldr r0, =3DEXT_C(__bss_start) @ src - tst r0, #(GRUB_KERNEL_MACHINE_MOD_ALIGN - 1) - beq 1f - mvn r1, #(GRUB_KERNEL_MACHINE_MOD_ALIGN - 1) - and r0, r0, r1 - add r0, r0, #(GRUB_KERNEL_MACHINE_MOD_ALIGN) -1: bx lr - - /* * uboot_syscall(): * This function is effectively a veneer, so it cannot * modify the stack or corrupt any registers other than =3D=3D=3D modified file 'grub-core/kern/dl.c' --- grub-core/kern/dl.c 2013-03-19 19:25:09 +0000 +++ grub-core/kern/dl.c 2013-04-07 16:08:07 +0000 @@ -588,7 +588,7 @@ { grub_dprintf ("modules", "flushing 0x%lx bytes at %p\n", (unsigned long) mod->sz, mod->base); - grub_arch_sync_caches (mod->base, mod->sz); + // grub_arch_sync_caches (mod->base, mod->sz); } =20 /* Load a module from core memory. */ =3D=3D=3D added directory 'grub-core/kern/i386/uboot' =3D=3D=3D added file 'grub-core/kern/i386/uboot/startup.S' --- grub-core/kern/i386/uboot/startup.S 1970-01-01 00:00:00 +0000 +++ grub-core/kern/i386/uboot/startup.S 2013-04-08 23:47:50 +0000 @@ -0,0 +1,61 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 1999,2000,2001,2002,2003,2005,2006,2007,2008 Free Soft= ware Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by= + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#include +/* For stack parameters. */ +#include +#include +#include + +/* + * Note: GRUB is compiled with the options -mrtd and -mregparm=3D3. + * So the first three arguments are passed in %eax, %edx, and %ecx= , + * respectively, and if a function has a fixed number of arguments= + * and the number if greater than three, the function must return + * with "ret $N" where N is ((the number of arguments) - 3) * 4. + */ + + .file "startup.S" + .text + .globl start, _start +start: +_start: + + /* clean out the bss */ + movl $BSS_START_SYMBOL, %edi + + /* compute the bss length */ + movl $END_SYMBOL, %ecx + subl %edi, %ecx + =09 + /* clean out */ + xorl %eax, %eax + cld + rep + stosb + + /* + * Call the start of main body of C code. + */ + call EXT_C(grub_main) + + /* This should never happen. */ + cli +1:=09 + hlt + jmp 1b =3D=3D=3D modified file 'grub-core/kern/uboot/init.c' --- grub-core/kern/uboot/init.c 2013-04-07 00:41:07 +0000 +++ grub-core/kern/uboot/init.c 2013-04-09 12:23:57 +0000 @@ -35,10 +35,10 @@ extern grub_size_t grub_total_module_size; extern int (*uboot_syscall_ptr) (int, int *, ...); =20 -grub_addr_t grub_modbase; - -grub_uint32_t uboot_machine_type; -grub_addr_t uboot_boot_data; +/* Set to anything other than zero so it lands in .data and not .bss. *= / +grub_addr_t grub_modbase =3D 0x55aa55aa; +grub_uint32_t uboot_machine_type =3D 0x55aa55aa; +grub_addr_t uboot_boot_data =3D 0x55aa55aa; =20 static unsigned long timer_start; =20 @@ -69,7 +69,6 @@ void grub_machine_init (void) { - grub_addr_t end, real_bss_start; int ver; =20 /* First of all - establish connection with U-Boot */ @@ -85,26 +84,14 @@ uboot_puts ("invalid U-Boot API version\n"); } =20 - /* - * Modules were relocated to _end, or __bss_start + grub_total_module_= size, - * whichever greater. (And __bss_start may not point to actual BSS sta= rt...) - */ - real_bss_start =3D uboot_get_real_bss_start (); - end =3D real_bss_start + grub_total_module_size; - if (end < (grub_addr_t) _end) - end =3D (grub_addr_t) _end; - grub_modbase =3D end; - /* Initialize the console so that GRUB can display messages. */ grub_console_init_early (); =20 /* Enumerate memory and initialize the memory management system. */ grub_uboot_mm_init (); =20 - grub_dprintf ("init", "__bss_start: 0x%08x, real_bss_start: 0x%08x\n",= - (grub_addr_t) __bss_start, real_bss_start); - grub_dprintf ("init", "end: 0x%08x, _end: 0x%08x\n", - (grub_addr_t) end, (grub_addr_t) _end); + grub_dprintf ("init", "__bss_start: %p\n", __bss_start); + grub_dprintf ("init", "_end: %p\n", _end); grub_dprintf ("init", "grub_modbase: %p\n", (void *) grub_modbase); grub_dprintf ("init", "grub_modules_get_end(): %p\n", (void *) grub_modules_get_end ()); =3D=3D=3D modified file 'grub-core/lib/uboot/datetime.c' --- grub-core/lib/uboot/datetime.c 2013-04-07 00:41:07 +0000 +++ grub-core/lib/uboot/datetime.c 2013-04-08 23:31:38 +0000 @@ -25,6 +25,7 @@ GRUB_MOD_LICENSE ("GPLv3+"); =20 /* No simple platform-independent RTC access exists in U-Boot. */ +#ifndef __i386__ =20 grub_err_t grub_get_datetime (struct grub_datetime *datetime __attribute__ ((unused= ))) @@ -39,3 +40,5 @@ return grub_error (GRUB_ERR_INVALID_COMMAND, "can\'t set datetime using U-Boot"); } + +#endif =3D=3D=3D modified file 'grub-core/lib/uboot/reboot.c' --- grub-core/lib/uboot/reboot.c 2013-04-07 00:41:07 +0000 +++ grub-core/lib/uboot/reboot.c 2013-04-08 23:32:06 +0000 @@ -20,6 +20,8 @@ #include #include =20 +#ifndef __i386__ + void grub_reboot (void) { @@ -28,3 +30,5 @@ uboot_reset (); while (1); } + +#endif =3D=3D=3D added file 'include/grub/arm/reloc.h' --- include/grub/arm/reloc.h 1970-01-01 00:00:00 +0000 +++ include/grub/arm/reloc.h 2013-04-09 11:38:30 +0000 @@ -0,0 +1,26 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2013 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by= + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#ifndef GRUB_ARM_RELOC_H +#define GRUB_ARM_RELOC_H 1 + +grub_err_t grub_arm_reloc_jump24 (grub_uint32_t *addr, Elf32_Addr sym_ad= dr); +grub_err_t grub_arm_reloc_thm_call (grub_uint16_t *addr, Elf32_Addr sym_= addr); +grub_err_t grub_arm_reloc_thm_jump19 (grub_uint16_t *addr, Elf32_Addr sy= m_addr); + +#endif =3D=3D=3D added directory 'include/grub/i386/uboot' =3D=3D=3D added file 'include/grub/i386/uboot/kernel.h' --- include/grub/i386/uboot/kernel.h 1970-01-01 00:00:00 +0000 +++ include/grub/i386/uboot/kernel.h 2013-04-08 23:34:00 +0000 @@ -0,0 +1,32 @@ +/* + * GRUB -- GRand Unified Bootloader + * Copyright (C) 2013 Free Software Foundation, Inc. + * + * GRUB is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by= + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * GRUB is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with GRUB. If not, see . + */ + +#ifndef GRUB_KERNEL_MACHINE_HEADER +#define GRUB_KERNEL_MACHINE_HEADER 1 + +#ifndef ASM_FILE + +#include +#include + +#endif /* ! ASM_FILE */ + +#define GRUB_KERNEL_MACHINE_STACK_SIZE 0x40000 +#define GRUB_KERNEL_MACHINE_HEAP_SIZE (grub_size_t) (2 * 1024 * 1024) + +#endif /* ! GRUB_KERNEL_MACHINE_HEADER */ =3D=3D=3D added file 'include/grub/i386/uboot/memory.h' --- include/grub/i386/uboot/memory.h 1970-01-01 00:00:00 +0000 +++ include/grub/i386/uboot/memory.h 2013-04-08 23:33:14 +0000 @@ -0,0 +1,1 @@ +#include =3D=3D=3D added file 'include/grub/i386/uboot/serial.h' --- include/grub/i386/uboot/serial.h 1970-01-01 00:00:00 +0000 +++ include/grub/i386/uboot/serial.h 2013-04-08 23:52:51 +0000 @@ -0,0 +1,1 @@ +#include =3D=3D=3D modified file 'include/grub/libgcc.h' --- include/grub/libgcc.h 2013-04-07 00:41:07 +0000 +++ include/grub/libgcc.h 2013-04-07 16:08:07 +0000 @@ -122,4 +122,5 @@ void EXPORT_FUNC (__aeabi_uidiv) (void); void EXPORT_FUNC (__aeabi_uidivmod) (void); void EXPORT_FUNC (__wrap___clear_cache) (void *, void *); +void EXPORT_FUNC (__aeabi_ulcmp) (void); #endif =3D=3D=3D modified file 'include/grub/uboot/api_public.h' --- include/grub/uboot/api_public.h 2013-04-07 00:41:07 +0000 +++ include/grub/uboot/api_public.h 2013-04-07 16:08:07 +0000 @@ -61,9 +61,6 @@ =20 typedef int (*scp_t) (int, int *, ...); =20 -typedef grub_uint16_t uint16_t; -typedef grub_uint32_t uint32_t; - #define API_SIG_VERSION 1 #define API_SIG_MAGIC "UBootAPI" #define API_SIG_MAGLEN 8 @@ -71,8 +68,8 @@ struct api_signature { char magic[API_SIG_MAGLEN]; /* magic string */ - uint16_t version; /* API version */ - uint32_t checksum; /* checksum of this sig struct */ + grub_uint16_t version; /* API version */ + grub_uint32_t checksum; /* checksum of this sig struct */ scp_t syscall; /* entry point to the API */ }; =20 =3D=3D=3D added file 'include/grub/uboot/image.h' --- include/grub/uboot/image.h 1970-01-01 00:00:00 +0000 +++ include/grub/uboot/image.h 2013-04-08 09:20:19 +0000 @@ -0,0 +1,175 @@ +/* + * (C) Copyright 2008 Semihalf + * + * (C) Copyright 2000-2005 + * Wolfgang Denk, DENX Software Engineering, wd@denx.de. + * + * See file CREDITS for list of people who contributed to this + * project. + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License as + * published by the Free Software Foundation; either version 2 of + * the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, + * MA 02111-1307 USA + * + ******************************************************************** + * NOTE: This header file defines an interface to U-Boot. Including + * this (unmodified) header file in another file is considered normal + * use of U-Boot, and does *not* fall under the heading of "derived + * work". + ******************************************************************** + */ + +#ifndef __GRUB_UBOOT_IMAGE_H__ +#define __GRUB_UBOOT_IMAGE_H__ + +/* + * Operating System Codes + */ +#define GRUB_UBOOT_IH_OS_INVALID 0 /* Invalid OS */ +#define GRUB_UBOOT_IH_OS_OPENBSD 1 /* OpenBSD */ +#define GRUB_UBOOT_IH_OS_NETBSD 2 /* NetBSD */ +#define GRUB_UBOOT_IH_OS_FREEBSD 3 /* FreeBSD */ +#define GRUB_UBOOT_IH_OS_4_4BSD 4 /* 4.4BSD */ +#define GRUB_UBOOT_IH_OS_LINUX 5 /* Linux */ +#define GRUB_UBOOT_IH_OS_SVR4 6 /* SVR4 */ +#define GRUB_UBOOT_IH_OS_ESIX 7 /* Esix */ +#define GRUB_UBOOT_IH_OS_SOLARIS 8 /* Solaris */ +#define GRUB_UBOOT_IH_OS_IRIX 9 /* Irix */ +#define GRUB_UBOOT_IH_OS_SCO 10 /* SCO */ +#define GRUB_UBOOT_IH_OS_DELL 11 /* Dell */ +#define GRUB_UBOOT_IH_OS_NCR 12 /* NCR */ +#define GRUB_UBOOT_IH_OS_LYNXOS 13 /* LynxOS */ +#define GRUB_UBOOT_IH_OS_VXWORKS 14 /* VxWorks */ +#define GRUB_UBOOT_IH_OS_PSOS 15 /* pSOS */ +#define GRUB_UBOOT_IH_OS_QNX 16 /* QNX */ +#define GRUB_UBOOT_IH_OS_U_BOOT 17 /* Firmware */ +#define GRUB_UBOOT_IH_OS_RTEMS 18 /* RTEMS */ +#define GRUB_UBOOT_IH_OS_ARTOS 19 /* ARTOS */ +#define GRUB_UBOOT_IH_OS_UNITY 20 /* Unity OS */ +#define GRUB_UBOOT_IH_OS_INTEGRITY 21 /* INTEGRITY */ +#define GRUB_UBOOT_IH_OS_OSE 22 /* OSE */ + +/* + * CPU Architecture Codes (supported by Linux) + */ +#define GRUB_UBOOT_IH_ARCH_INVALID 0 /* Invalid CPU */ +#define GRUB_UBOOT_IH_ARCH_ALPHA 1 /* Alpha */ +#define GRUB_UBOOT_IH_ARCH_ARM 2 /* ARM */ +#define GRUB_UBOOT_IH_ARCH_I386 3 /* Intel x86 */ +#define GRUB_UBOOT_IH_ARCH_IA64 4 /* IA64 */ +#define GRUB_UBOOT_IH_ARCH_MIPS 5 /* MIPS */ +#define GRUB_UBOOT_IH_ARCH_MIPS64 6 /* MIPS 64 Bit */ +#define GRUB_UBOOT_IH_ARCH_PPC 7 /* PowerPC */ +#define GRUB_UBOOT_IH_ARCH_S390 8 /* IBM S390 */ +#define GRUB_UBOOT_IH_ARCH_SH 9 /* SuperH */ +#define GRUB_UBOOT_IH_ARCH_SPARC 10 /* Sparc */ +#define GRUB_UBOOT_IH_ARCH_SPARC64 11 /* Sparc 64 Bit */ +#define GRUB_UBOOT_IH_ARCH_M68K 12 /* M68K */ +#define GRUB_UBOOT_IH_ARCH_MICROBLAZE 14 /* MicroBlaze */ +#define GRUB_UBOOT_IH_ARCH_NIOS2 15 /* Nios-II */ +#define GRUB_UBOOT_IH_ARCH_BLACKFIN 16 /* Blackfin */ +#define GRUB_UBOOT_IH_ARCH_AVR32 17 /* AVR32 */ +#define GRUB_UBOOT_IH_ARCH_ST200 18 /* STMicroelectronics ST200 = */ +#define GRUB_UBOOT_IH_ARCH_SANDBOX 19 /* Sandbox architecture (test onl= y) */ +#define GRUB_UBOOT_IH_ARCH_NDS32 20 /* ANDES Technology - NDS32 = */ +#define GRUB_UBOOT_IH_ARCH_OPENRISC 21 /* OpenRISC 1000 */ + +/* + * Image Types + * + * "Standalone Programs" are directly runnable in the environment + * provided by U-Boot; it is expected that (if they behave + * well) you can continue to work in U-Boot after return from + * the Standalone Program. + * "OS Kernel Images" are usually images of some Embedded OS which + * will take over control completely. Usually these programs + * will install their own set of exception handlers, device + * drivers, set up the MMU, etc. - this means, that you cannot + * expect to re-enter U-Boot except by resetting the CPU. + * "RAMDisk Images" are more or less just data blocks, and their + * parameters (address, size) are passed to an OS kernel that is + * being started. + * "Multi-File Images" contain several images, typically an OS + * (Linux) kernel image and one or more data images like + * RAMDisks. This construct is useful for instance when you want + * to boot over the network using BOOTP etc., where the boot + * server provides just a single image file, but you want to get + * for instance an OS kernel and a RAMDisk image. + * + * "Multi-File Images" start with a list of image sizes, each + * image size (in bytes) specified by an "uint32_t" in network + * byte order. This list is terminated by an "(uint32_t)0". + * Immediately after the terminating 0 follow the images, one by + * one, all aligned on "uint32_t" boundaries (size rounded up to + * a multiple of 4 bytes - except for the last file). + * + * "Firmware Images" are binary images containing firmware (like + * U-Boot or FPGA images) which usually will be programmed to + * flash memory. + * + * "Script files" are command sequences that will be executed by + * U-Boot's command interpreter; this feature is especially + * useful when you configure U-Boot to use a real shell (hush) + * as command interpreter (=3D> Shell Scripts). + */ + +#define GRUB_UBOOT_IH_TYPE_INVALID 0 /* Invalid Image */ +#define GRUB_UBOOT_IH_TYPE_STANDALONE 1 /* Standalone Program */ +#define GRUB_UBOOT_IH_TYPE_KERNEL 2 /* OS Kernel Image */ +#define GRUB_UBOOT_IH_TYPE_RAMDISK 3 /* RAMDisk Image */ +#define GRUB_UBOOT_IH_TYPE_MULTI 4 /* Multi-File Image */ +#define GRUB_UBOOT_IH_TYPE_FIRMWARE 5 /* Firmware Image */ +#define GRUB_UBOOT_IH_TYPE_SCRIPT 6 /* Script file */ +#define GRUB_UBOOT_IH_TYPE_FILESYSTEM 7 /* Filesystem Image (any type) *= / +#define GRUB_UBOOT_IH_TYPE_FLATDT 8 /* Binary Flat Device Tree Blob */ +#define GRUB_UBOOT_IH_TYPE_KWBIMAGE 9 /* Kirkwood Boot Image */ +#define GRUB_UBOOT_IH_TYPE_IMXIMAGE 10 /* Freescale IMXBoot Image */ +#define GRUB_UBOOT_IH_TYPE_UBLIMAGE 11 /* Davinci UBL Image */ +#define GRUB_UBOOT_IH_TYPE_OMAPIMAGE 12 /* TI OMAP Config Header Image *= / +#define GRUB_UBOOT_IH_TYPE_AISIMAGE 13 /* TI Davinci AIS Image */ +#define GRUB_UBOOT_IH_TYPE_KERNEL_NOLOAD 14 /* OS Kernel Image, can run = from any load address */ +#define GRUB_UBOOT_IH_TYPE_PBLIMAGE 15 /* Freescale PBL Boot Image */ + +/* + * Compression Types + */ +#define GRUB_UBOOT_IH_COMP_NONE 0 /* No Compression Used */ +#define GRUB_UBOOT_IH_COMP_GZIP 1 /* gzip Compression Used */ +#define GRUB_UBOOT_IH_COMP_BZIP2 2 /* bzip2 Compression Used */ +#define GRUB_UBOOT_IH_COMP_LZMA 3 /* lzma Compression Used */ +#define GRUB_UBOOT_IH_COMP_LZO 4 /* lzo Compression Used */ + +#define GRUB_UBOOT_IH_MAGIC 0x27051956 /* Image Magic Number */ +#define GRUB_UBOOT_IH_NMLEN 32 /* Image Name Length */ + +/* + * Legacy format image header, + * all data in network byte order (aka natural aka bigendian). + */ +struct grub_uboot_image_header { + grub_uint32_t ih_magic; /* Image Header Magic Number */ + grub_uint32_t ih_hcrc; /* Image Header CRC Checksum */ + grub_uint32_t ih_time; /* Image Creation Timestamp */ + grub_uint32_t ih_size; /* Image Data Size */ + grub_uint32_t ih_load; /* Data Load Address */ + grub_uint32_t ih_ep; /* Entry Point Address */ + grub_uint32_t ih_dcrc; /* Image Data CRC Checksum */ + grub_uint8_t ih_os; /* Operating System */ + grub_uint8_t ih_arch; /* CPU architecture */ + grub_uint8_t ih_type; /* Image Type */ + grub_uint8_t ih_comp; /* Compression Type */ + grub_uint8_t ih_name[GRUB_UBOOT_IH_NMLEN]; /* Image Name */ +}; + +#endif /* __IMAGE_H__ */ =3D=3D=3D modified file 'util/grub-install.in' --- util/grub-install.in 2013-04-07 00:41:07 +0000 +++ util/grub-install.in 2013-04-08 10:42:46 +0000 @@ -833,14 +833,6 @@ -L "$bootloader_id" -l "\\EFI\\$efi_distributor\\$efi_file" fi fi -elif [ x"${grub_modinfo_target_cpu}-${grub_modinfo_platform}" =3D xarm-u= boot ]; then - grub_imgname=3D"${grubdir}/${grub_modinfo_target_cpu}-$grub_modinfo_= platform/core.${imgext}" - raw_imgname=3D"${uboot_imgname}.raw" - mv "$grub_imgname" "$raw_imgname" - mkimage -T kernel -A ARM -O Linux -a 0x08000000 -e 0x08000000 -C non= e -d "$raw_imgname" "$grub_imgname" - if [ $? -eq 0 ]; then - rm -f "$raw_imgname" - fi else gettext "WARNING: no platform-specific install was performed" 1>&2 echo 1>&2 =3D=3D=3D modified file 'util/grub-mkimage.c' --- util/grub-mkimage.c 2013-04-07 00:41:07 +0000 +++ util/grub-mkimage.c 2013-04-09 11:45:10 +0000 @@ -40,6 +40,8 @@ #include #include #include +#include +#include =20 #define _GNU_SOURCE 1 #include @@ -1499,6 +1501,42 @@ core_size =3D rom_size; } break; + + case IMAGE_UBOOT: + { + struct grub_uboot_image_header *hdr; + GRUB_PROPERLY_ALIGNED_ARRAY (crc32_context, GRUB_MD_CRC32->context= size); + + hdr =3D xmalloc (core_size + sizeof (struct grub_uboot_image_heade= r)); + memcpy (hdr + 1, core_img, core_size); + + memset (hdr, 0, sizeof (*hdr)); + hdr->ih_magic =3D grub_cpu_to_be32_compile_time (GRUB_UBOOT_IH_MAG= IC); + hdr->ih_time =3D grub_cpu_to_be32 (time (0)); + hdr->ih_size =3D grub_cpu_to_be32 (core_size); + hdr->ih_load =3D grub_cpu_to_be32 (image_target->link_addr); + hdr->ih_ep =3D grub_cpu_to_be32 (image_target->link_addr); + hdr->ih_os =3D GRUB_UBOOT_IH_OS_LINUX; + hdr->ih_arch =3D GRUB_UBOOT_IH_ARCH_ARM; + hdr->ih_type =3D GRUB_UBOOT_IH_TYPE_KERNEL; + hdr->ih_comp =3D GRUB_UBOOT_IH_COMP_NONE; + + GRUB_MD_CRC32->init(crc32_context); + GRUB_MD_CRC32->write(crc32_context, hdr + 1, core_size); + GRUB_MD_CRC32->final(crc32_context); + hdr->ih_dcrc =3D grub_get_unaligned32 (GRUB_MD_CRC32->read (crc32_= context)); + + GRUB_MD_CRC32->init(crc32_context); + GRUB_MD_CRC32->write(crc32_context, hdr, sizeof (*hdr)); + GRUB_MD_CRC32->final(crc32_context); + hdr->ih_hcrc =3D grub_get_unaligned32 (GRUB_MD_CRC32->read (crc32_= context)); + + free (core_img); + core_img =3D (char *) hdr; + core_size +=3D sizeof (struct grub_uboot_image_header); + } + break; + case IMAGE_MIPS_ARC: { char *ecoff_img; @@ -1725,9 +1763,6 @@ core_size =3D program_size + header_size + footer_size; } break; - case IMAGE_UBOOT: - /* Raw image, header added by grub-install */ - break; } =20 grub_util_write_image (core_img, core_size, out, outname); =3D=3D=3D modified file 'util/grub-mkimagexx.c' --- util/grub-mkimagexx.c 2013-04-07 00:41:07 +0000 +++ util/grub-mkimagexx.c 2013-04-09 12:21:25 +0000 @@ -60,9 +60,6 @@ =20 static Elf_Addr SUFFIX (entry_point); =20 -grub_err_t reloc_thm_call (grub_uint16_t *addr, Elf32_Addr sym_addr); -grub_err_t reloc_thm_jump19 (grub_uint16_t *addr, Elf32_Addr sym_addr); - /* Relocate symbols; note that this function overwrites the symbol table= =2E Return the address of a start symbol. */ static Elf_Addr @@ -553,19 +550,27 @@ case R_ARM_THM_CALL: case R_ARM_THM_JUMP24: { - grub_util_info (" THM_JUMP24:\ttarget=3D0x%08x\toffset=3D(0x%0= 8x)", (unsigned int) target, sym_addr); + grub_err_t err; + grub_util_info (" THM_JUMP24:\ttarget=3D0x%08lx\toffset=3D(0x%= 08x)", (unsigned long) target, sym_addr); sym_addr -=3D offset; /* Thumb instructions can be 16-bit aligned */ - reloc_thm_call ((grub_uint16_t *) target, sym_addr); + err =3D grub_arm_reloc_thm_call ((grub_uint16_t *) target, + sym_addr); + if (err) + grub_util_error ("%s", grub_errmsg); } break; case R_ARM_THM_JUMP19: { + grub_err_t err; grub_util_info (" THM_JUMP19:\toffset=3D%d\t(0x%08x)", sym_addr, sym_addr); sym_addr -=3D offset; /* Thumb instructions can be 16-bit aligned */ - reloc_thm_jump19 ((grub_uint16_t *) target, sym_addr); + err =3D grub_arm_reloc_thm_jump19 ((grub_uint16_t *) target, + sym_addr); + if (err) + grub_util_error ("%s", grub_errmsg); } break; default: --------------020407060305070103040606-- --------------enig7C66FAB66DC290FF90E9702D Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.12 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/ iF4EAREKAAYFAlFkDXcACgkQNak7dOguQgnRqgEApxRAqqLAOHGRZYDuyeKpAUDN axxjpr2rmnK4zRuekOMA/3RNy7cp/+dgZFOQ8SYGkoyYfg8WFerb9So406sze2tp =pCza -----END PGP SIGNATURE----- --------------enig7C66FAB66DC290FF90E9702D--