From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1HNsQW-00083J-EM for mharc-grub-devel@gnu.org; Sun, 04 Mar 2007 10:15:08 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1HNsQT-000803-PD for grub-devel@gnu.org; Sun, 04 Mar 2007 10:15:05 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1HNsQS-0007xl-8T for grub-devel@gnu.org; Sun, 04 Mar 2007 10:15:05 -0500 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1HNsQR-0007xS-VH for grub-devel@gnu.org; Sun, 04 Mar 2007 10:15:04 -0500 Received: from nf-out-0910.google.com ([64.233.182.189]) by monty-python.gnu.org with esmtp (Exim 4.52) id 1HNsQQ-0003aw-H7 for grub-devel@gnu.org; Sun, 04 Mar 2007 10:15:03 -0500 Received: by nf-out-0910.google.com with SMTP id n15so1766080nfc for ; Sun, 04 Mar 2007 07:15:01 -0800 (PST) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:from:to:subject:date:user-agent:mime-version:content-type:content-transfer-encoding:message-id; b=mm/g5u4Vo6flK86iuUBe5Alni+ZAUtC+YxW2TXqEpWy6+4XxVpvrZA2XU3PARsK1HeZFngZGpj6PAIFB0prcLWCXD5Zexbel6RBYR0EYX0Yq1o1vHWb5xZTX/MiIo7kzwUXsW0zuQo8fhMrgkGmLmAakjIj9oYqHQDQFyhFtt2Q= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:from:to:subject:date:user-agent:mime-version:content-type:content-transfer-encoding:message-id; b=uYWucOORyHVJWz9nv/V6uHKaqHk3U7DjcNVIYyi/AFOmizhdDl8dtEWtEuhNyIroaDSPEWb8wdiXU/o8RTb0fIDg8CAFsC/JUWn6JhAGcj0uTFrIeby97Ey2BZpsrIJJ9EQRrLTTQwYqj5ZlG4KQPnhEIqs2u6N3tjKz5Y36rkI= Received: by 10.82.172.15 with SMTP id u15mr3672565bue.1173021300774; Sun, 04 Mar 2007 07:15:00 -0800 (PST) Received: from x2 ( [90.7.46.253]) by mx.google.com with ESMTP id p20sm19605037nfc.2007.03.04.07.14.57; Sun, 04 Mar 2007 07:14:58 -0800 (PST) From: Vincent Pelletier To: The development of GRUB 2 Date: Sun, 4 Mar 2007 16:14:48 +0100 User-Agent: KMail/1.9.5 MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart2640584.K8zDI2MB4C"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <200703041614.56304.plr.vincent@gmail.com> X-detected-kernel: Linux 2.4-2.6 (Google crawlbot) Subject: [PATCH] Fix build of sparc64 port & implement setjmp/longjmp X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 04 Mar 2007 15:15:06 -0000 --nextPart2640584.K8zDI2MB4C Content-Type: multipart/mixed; boundary="Boundary-01=_oJu6Fotd14U/kgm" Content-Transfer-Encoding: 7bit Content-Disposition: inline --Boundary-01=_oJu6Fotd14U/kgm Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Hi. Here is a (mostly) maintainance patch for sparc64 port. It only fixes the build and implements setjmp/longjmp so that one can jump = to=20 rescue mode. It also builds the linux loader module, but the boot is known to fail on my= =20 box (some disk access error at OF level when reading the linux kernel image= ). I prefer to post the patch for validation before commiting, it's been too l= ong=20 I haven't post to go on my own :) . (changelog is in the diff :p ). =2D-=20 Vincent Pelletier --Boundary-01=_oJu6Fotd14U/kgm Content-Type: text/x-diff; charset="us-ascii"; name="general_sparc64.diff" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="general_sparc64.diff" ? include/grub/sparc64/ieee1275/loader.h Index: ChangeLog =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /sources/grub/grub2/ChangeLog,v retrieving revision 1.341 diff -u -p -r1.341 ChangeLog =2D-- ChangeLog 21 Feb 2007 23:25:09 -0000 1.341 +++ ChangeLog 4 Mar 2007 12:32:07 -0000 @@ -1,3 +1,70 @@ +2007-03-01 Vincent Pelletier + + * THANKS: Update my mail address. + * conf/sparc64-ieee1275.rmk: Include conf/common.mk. + (COMMON_ASFLAGS): Build sparc64 binary. + (COMMON_LDFLAGS): Updated to gcc-style flags. + (grub_mkimage_SOURCES): Commented out. + (pkgdata_MODULES): Removed fat.mod, ufs.mod, ext2.mod, minix.mod, + hfs.mod, jfs.mod, hello.mod, font.mod, ls.mod, boot.mod, cmp.mod, + cat.mod, terminal.mod, fshelp.mod, amiga.mod, apple.mod, pc.mod, + loopback.mod, help.mod, sun.mod, configfile.mod, search.mod, + gzio.mod, xfs.mod, affs.mod, sfs.mod, acorn.mod. Added _linux.mod + and linux.mod. + (kernel_elf_LDFLAGS): Prepend common flags. Updated to gcc-style + flags. + (_linux_mod_SOURCES, _linux_mod_CFLAGS, _linux_mod_LDFLAGS) + (linux_mod_SOURCES, linux_mod_CFLAGS, linux_mod_LDFLAGS): Uncomment. + (grub_script.tab.c, grub_script.tab.h, grub_modules_init.lst) + (fshelp_mod_SOURCES, fshelp_mod_CFLAGS, fshelp_mod_LDFLAGS) + (fat_mod_SOURCES, fat_mod_CFLAGS, fat_mod_LDFLAGS) + (ext2_mod_SOURCES, ext2_mod_CFLAGS, ext2_mod_LDFLAGS) + (ufs_mod_SOURCES, ufs_mod_CFLAGS, ufs_mod_LDFLAGS) + (minix_mod_SOURCES, minix_mod_CFLAGS, minix_mod_LDFLAGS) + (hfs_mod_SOURCES, hfs_mod_CFLAGS, hfs_mod_LDFLAGS, jfs_mod_SOURCES) + (jfs_mod_CFLAGS, jfs_mod_LDFLAGS, iso9660_mod_SOURCES) + (iso9660_mod_CFLAGS, iso9660_mod_LDFLAGS, xfs_mod_SOURCES) + (xfs_mod_CFLAGS, xfs_mod_LDFLAGS, affs_mod_SOURCES) + (affs_mod_CFLAGS, affs_mod_LDFLAGS, sfs_mod_SOURCES) + (sfs_mod_CFLAGS, sfs_mod_LDFLAGS, hello_mod_SOURCES) + (hello_mod_CFLAGS, hello_mod_LDFLAGS, boot_mod_SOURCES) + (boot_mod_CFLAGS, boot_mod_LDFLAGS, terminal_mod_SOURCES) + (terminal_mod_CFLAGS, terminal_mod_LDFLAGS, ls_mod_SOURCES) + (ls_mod_CFLAGS, ls_mod_LDFLAGS, cmp_mod_SOURCES, cmp_mod_CFLAGS) + (cmp_mod_LDFLAGS, cat_mod_SOURCES, cat_mod_CFLAGS, cat_mod_LDFLAGS) + (help_mod_SOURCES, help_mod_CFLAGS, help_mod_LDFLAGS) + (font_mod_SOURCES, font_mod_CFLAGS, font_mod_LDFLAGS) + (terminfo_mod_SOURCES, terminfo_mod_CFLAGS, terminfo_mod_LDFLAGS) + (amiga_mod_SOURCES, amiga_mod_CFLAGS, amiga_mod_LDFLAGS) + (apple_mod_SOURCES, apple_mod_CFLAGS, apple_mod_LDFLAG) + (pc_mod_SOURCES, pc_mod_CFLAGS, pc_mod_LDFLAGS, sun_mod_SOURCES) + (sun_mod_CFLAGS, sun_mod_LDFLAGS, acorn_mod_SOURCES, acorn_mod_CFLAGS) + (loopback_mod_SOURCES, loopback_mod_CFLAGS, loopback_mod_LDFLAGS) + (default_mod_SOURCES, default_mod_CFLAGS, default_mod_LDFLAGS) + (timeout_mod_SOURCES, timeout_mod_CFLAGS, timeout_mod_LDFLAGS) + (configfile_mod_SOURCES, configfile_mod_CFLAGS) + (configfile_mod_LDFLAGS, search_mod_SOURCES, search_mod_CFLAGS) + (search_mod_LDFLAGS, gzio_mod_SOURCES, gzio_mod_CFLAGS) + (gzio_mod_LDFLAGS, test_mod_SOURCES, test_mod_CFLAGS) + (test_mod_LDFLAGS): Removed. + * conf/sparc64-ieee1275.mk: Regenerate. + * include/grub/elf.h (ELF64_R_TYPE_DATA, ELF64_R_TYPE_ID) + (ELF64_R_TYPE_INFO): New macros. + * include/grub/sparc64/setjmp.h: Include grub/types.h. + (grub_jmp_buf): Update definition. + * kern/sparc64/dl.c (grub_arch_dl_relocate_symbols): Use + ELF64_R_TYPE_ID macro. Explicited bitmasks and casts. Fixed + R_SPARC_WDISP30 relocation checks and updated its error message. + Added support for R_SPARC_13 and R_SPARC_OLO10 relocations. + * kern/sparc64/ieee1275/init.c (grub_claim_heap): New function. + (grub_machine_fini): Call `grub_ieee1275_exit'. + * kern/sparc64/ieee1275/openfw.c (grub_devalias_iterate): Update call + to `grub_ieee1275_next_property'. Remove uneeded variable. + (grub_available_iterate): New function. + * normal/main.c: Explicit grub_exit_env alignment. + * normal/sparc64/setjmp.S (grub_setjmp, grub_longjmp): Implement. + * include/grub/sparc64/ieee1275/loader.h: New file. + 2007-02-21 Hollis Blanchard =20 * kern/powerpc/ieee1275/init.c (HEAP_SIZE): Removed. Index: THANKS =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /sources/grub/grub2/THANKS,v retrieving revision 1.18 diff -u -p -r1.18 THANKS =2D-- THANKS 25 Nov 2006 03:21:29 -0000 1.18 +++ THANKS 4 Mar 2007 12:32:07 -0000 @@ -26,7 +26,7 @@ Tristan Gingold Vesa Jaaskelainen Vincent Guffens =2DVincent Pelletier +Vincent Pelletier Vladimir Serbinenko =20 Also, we thank the projects GNU Automake and LZO. Some code Index: conf/sparc64-ieee1275.rmk =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /sources/grub/grub2/conf/sparc64-ieee1275.rmk,v retrieving revision 1.16 diff -u -p -r1.16 sparc64-ieee1275.rmk =2D-- conf/sparc64-ieee1275.rmk 13 Dec 2006 22:30:19 -0000 1.16 +++ conf/sparc64-ieee1275.rmk 4 Mar 2007 12:32:07 -0000 @@ -1,9 +1,9 @@ =20 # -*- makefile -*- =20 =2DCOMMON_ASFLAGS =3D -nostdinc +COMMON_ASFLAGS =3D -nostdinc -m64 -mno-app-regs COMMON_CFLAGS =3D -ggdb -ffreestanding -m64 -mno-app-regs =2DCOMMON_LDFLAGS =3D -melf64_sparc -nostdlib +COMMON_LDFLAGS =3D -melf64_sparc -nostdlib -mno-relax -m64 =20 # Images. =20 @@ -18,10 +18,6 @@ kernel_elf_HEADERS =3D arg.h boot.h cache. kernel_elf_symlist.c: $(addprefix include/grub/,$(kernel_elf_HEADERS)) con= fig.h gensymlist.sh /bin/sh gensymlist.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1) =20 =2D# For the parser. =2Dgrub_script.tab.c grub_script.tab.h: normal/parser.y =2D $(YACC) -d -p grub_script_yy -b grub_script $(srcdir)/normal/parser.y =2D kernel_syms.lst: $(addprefix include/grub/,$(kernel_elf_HEADERS)) config.h= genkernsyms.sh /bin/sh genkernsyms.sh $(filter %.h,$^) > $@ || (rm -f $@; exit 1) =20 @@ -35,8 +31,8 @@ pkgdata_PROGRAMS =3D kernel.elf #endif =20 # For grub-mkimage. =2Dgrub_mkimage_SOURCES =3D util/sparc64/ieee1275/grub-mkimage.c util/misc.= c \ =2D util/resolve.c=20 +#grub_mkimage_SOURCES =3D util/sparc64/ieee1275/grub-mkimage.c util/misc.c= \ +# util/resolve.c=20 =20 # For grub-emu #grub_emu_SOURCES =3D commands/boot.c commands/cat.c commands/cmp.c \ @@ -74,81 +70,25 @@ kernel_elf_SOURCES =3D kern/sparc64/ieee12 kernel_elf_HEADERS =3D grub/sparc64/ieee1275/ieee1275.h kernel_elf_CFLAGS =3D $(COMMON_CFLAGS) kernel_elf_ASFLAGS =3D $(COMMON_ASFLAGS) =2Dkernel_elf_LDFLAGS =3D -mno-app-regs -nostdlib -Wl,-N,-Ttext,0x200000,-B= static,-melf64_sparc +kernel_elf_LDFLAGS =3D $(COMMON_LDFLAGS) -mno-app-regs -Wl,-N,-Ttext,0x200= 000,-Bstatic -m64 =20 # Modules. =2D#_linux.mod linux.mod =2Dpkgdata_MODULES =3D fat.mod ufs.mod ext2.mod minix.mod \ =2D hfs.mod jfs.mod normal.mod hello.mod font.mod ls.mod \ =2D boot.mod cmp.mod cat.mod terminal.mod fshelp.mod amiga.mod apple.mod \ =2D pc.mod suspend.mod loopback.mod help.mod reboot.mod halt.mod sun.mod \ =2D configfile.mod search.mod gzio.mod xfs.mod \ =2D affs.mod sfs.mod acorn.mod =2D =2D# For fshelp.mod. =2Dfshelp_mod_SOURCES =3D fs/fshelp.c =2Dfshelp_mod_CFLAGS =3D $(COMMON_CFLAGS) =2Dfshelp_mod_LDFLAGS =3D $(COMMON_LDFLAGS) =2D =2D# For fat.mod. =2Dfat_mod_SOURCES =3D fs/fat.c =2Dfat_mod_CFLAGS =3D $(COMMON_CFLAGS) =2Dfat_mod_LDFLAGS =3D $(COMMON_LDFLAGS) =2D =2D# For ext2.mod. =2Dext2_mod_SOURCES =3D fs/ext2.c =2Dext2_mod_CFLAGS =3D $(COMMON_CFLAGS) =2Dext2_mod_LDFLAGS =3D $(COMMON_LDFLAGS) =2D =2D# For ufs.mod. =2Dufs_mod_SOURCES =3D fs/ufs.c =2Dufs_mod_CFLAGS =3D $(COMMON_CFLAGS) =2Dufs_mod_LDFLAGS =3D $(COMMON_LDFLAGS) =2D =2D# For minix.mod. =2Dminix_mod_SOURCES =3D fs/minix.c =2Dminix_mod_CFLAGS =3D $(COMMON_CFLAGS) =2Dminix_mod_LDFLAGS =3D $(COMMON_LDFLAGS) =2D =2D# For hfs.mod. =2Dhfs_mod_SOURCES =3D fs/hfs.c =2Dhfs_mod_CFLAGS =3D $(COMMON_CFLAGS) =2Dhfs_mod_LDFLAGS =3D $(COMMON_LDFLAGS) =2D =2D# For jfs.mod. =2Djfs_mod_SOURCES =3D fs/jfs.c =2Djfs_mod_CFLAGS =3D $(COMMON_CFLAGS) =2Djfs_mod_LDFLAGS =3D $(COMMON_LDFLAGS) =2D =2D# For iso9660.mod. =2Diso9660_mod_SOURCES =3D fs/iso9660.c =2Diso9660_mod_CFLAGS =3D $(COMMON_CFLAGS) =2Diso9660_mod_LDFLAGS =3D $(COMMON_LDFLAGS) =2D =2D# For xfs.mod. =2Dxfs_mod_SOURCES =3D fs/xfs.c =2Dxfs_mod_CFLAGS =3D $(COMMON_CFLAGS) =2Dxfs_mod_LDFLAGS =3D $(COMMON_LDFLAGS) =2D =2D# For affs.mod. =2Daffs_mod_SOURCES =3D fs/affs.c =2Daffs_mod_CFLAGS =3D $(COMMON_CFLAGS) =2Daffs_mod_LDFLAGS =3D $(COMMON_LDFLAGS) =2D =2D# For sfs.mod. =2Dsfs_mod_SOURCES =3D fs/sfs.c =2Dsfs_mod_CFLAGS =3D $(COMMON_CFLAGS) =2Dsfs_mod_LDFLAGS =3D $(COMMON_LDFLAGS) +pkgdata_MODULES =3D halt.mod \ + normal.mod \ + reboot.mod \ + suspend.mod \ + _linux.mod \ + linux.mod \ =20 # For _linux.mod. =2D#_linux_mod_SOURCES =3D loader/sparc64/ieee1275/linux.c =2D#_linux_mod_CFLAGS =3D $(COMMON_CFLAGS) =2D#_linux_mod_LDFLAGS =3D $(COMMON_LDFLAGS) +_linux_mod_SOURCES =3D loader/sparc64/ieee1275/linux.c +_linux_mod_CFLAGS =3D $(COMMON_CFLAGS) +_linux_mod_LDFLAGS =3D $(COMMON_LDFLAGS) =20 # For linux.mod. =2D#linux_mod_SOURCES =3D loader/sparc64/ieee1275/linux_normal.c =2D#linux_mod_CFLAGS =3D $(COMMON_CFLAGS) =2D#linux_mod_LDFLAGS =3D $(COMMON_LDFLAGS) +linux_mod_SOURCES =3D loader/sparc64/ieee1275/linux_normal.c +linux_mod_CFLAGS =3D $(COMMON_CFLAGS) +linux_mod_LDFLAGS =3D $(COMMON_LDFLAGS) =20 # For normal.mod. normal_mod_DEPENDENCIES =3D grub_script.tab.c grub_script.tab.h @@ -162,70 +102,6 @@ normal_mod_CFLAGS =3D $(COMMON_CFLAGS) normal_mod_ASFLAGS =3D $(COMMON_ASFLAGS) normal_mod_LDFLAGS =3D $(COMMON_LDFLAGS) =20 =2D# For hello.mod. =2Dhello_mod_SOURCES =3D hello/hello.c =2Dhello_mod_CFLAGS =3D $(COMMON_CFLAGS) =2Dhello_mod_LDFLAGS =3D $(COMMON_LDFLAGS) =2D =2D# For boot.mod. =2Dboot_mod_SOURCES =3D commands/boot.c =2Dboot_mod_CFLAGS =3D $(COMMON_CFLAGS) =2Dboot_mod_LDFLAGS =3D $(COMMON_LDFLAGS) =2D =2D# For terminal.mod. =2Dterminal_mod_SOURCES =3D commands/terminal.c =2Dterminal_mod_CFLAGS =3D $(COMMON_CFLAGS) =2Dterminal_mod_LDFLAGS =3D $(COMMON_LDFLAGS) =2D =2D# For ls.mod. =2Dls_mod_SOURCES =3D commands/ls.c =2Dls_mod_CFLAGS =3D $(COMMON_CFLAGS) =2Dls_mod_LDFLAGS =3D $(COMMON_LDFLAGS) =2D =2D# For cmp.mod. =2Dcmp_mod_SOURCES =3D commands/cmp.c =2Dcmp_mod_CFLAGS =3D $(COMMON_CFLAGS) =2Dcmp_mod_LDFLAGS =3D $(COMMON_LDFLAGS) =2D =2D# For cat.mod. =2Dcat_mod_SOURCES =3D commands/cat.c =2Dcat_mod_CFLAGS =3D $(COMMON_CFLAGS) =2Dcat_mod_LDFLAGS =3D $(COMMON_LDFLAGS) =2D =2D# For font.mod. =2Dfont_mod_SOURCES =3D font/manager.c =2Dfont_mod_CFLAGS =3D $(COMMON_CFLAGS) =2Dfont_mod_LDFLAGS =3D $(COMMON_LDFLAGS) =2D =2D# For amiga.mod =2Damiga_mod_SOURCES =3D partmap/amiga.c =2Damiga_mod_CFLAGS =3D $(COMMON_CFLAGS) =2Damiga_mod_LDFLAGS =3D $(COMMON_LDFLAGS) =2D =2D# For apple.mod =2Dapple_mod_SOURCES =3D partmap/apple.c =2Dapple_mod_CFLAGS =3D $(COMMON_CFLAGS) =2Dapple_mod_LDFLAGS =3D $(COMMON_LDFLAGS) =2D =2D# For pc.mod =2Dpc_mod_SOURCES =3D partmap/pc.c =2Dpc_mod_CFLAGS =3D $(COMMON_CFLAGS) =2Dpc_mod_LDFLAGS =3D $(COMMON_LDFLAGS) =2D =2D# For sun.mod =2Dsun_mod_SOURCES =3D partmap/sun.c =2Dsun_mod_CFLAGS =3D $(COMMON_CFLAGS) =2Dsun_mod_LDFLAGS =3D $(COMMON_LDFLAGS) =2D =2D# For acorn.mod =2Dacorn_mod_SOURCES =3D partmap/acorn.c =2Dacorn_mod_CFLAGS =3D $(COMMON_CFLAGS) =2D =2D# For loopback.mod =2Dloopback_mod_SOURCES =3D disk/loopback.c =2Dloopback_mod_CFLAGS =3D $(COMMON_CFLAGS) =2Dloopback_mod_LDFLAGS =3D $(COMMON_LDFLAGS) =2D # For suspend.mod suspend_mod_SOURCES =3D commands/ieee1275/suspend.c suspend_mod_CFLAGS =3D $(COMMON_CFLAGS) @@ -241,37 +117,4 @@ halt_mod_SOURCES =3D commands/ieee1275/hal halt_mod_CFLAGS =3D $(COMMON_CFLAGS) halt_mod_LDFLAGS =3D $(COMMON_LDFLAGS) =20 =2D# For help.mod. =2Dhelp_mod_SOURCES =3D commands/help.c =2Dhelp_mod_CFLAGS =3D $(COMMON_CFLAGS) =2Dhelp_mod_LDFLAGS =3D $(COMMON_LDFLAGS) =2D =2D# For default.mod =2Ddefault_mod_SOURCES =3D commands/default.c =2Ddefault_mod_CFLAGS =3D $(COMMON_CFLAGS) =2Ddefault_mod_LDFLAGS =3D $(COMMON_LDFLAGS) =2D =2D# For timeout.mod =2Dtimeout_mod_SOURCES =3D commands/timeout.c =2Dtimeout_mod_CFLAGS =3D $(COMMON_CFLAGS) =2Dtimeout_mod_LDFLAGS =3D $(COMMON_LDFLAGS) =2D =2D# For configfile.mod =2Dconfigfile_mod_SOURCES =3D commands/configfile.c =2Dconfigfile_mod_CFLAGS =3D $(COMMON_CFLAGS) =2Dconfigfile_mod_LDFLAGS =3D $(COMMON_LDFLAGS) =2D =2D# For search.mod. =2Dsearch_mod_SOURCES =3D commands/search.c =2Dsearch_mod_CFLAGS =3D $(COMMON_CFLAGS) =2Dsearch_mod_LDFLAGS =3D $(COMMON_LDFLAGS) =2D =2D# For gzio.mod. =2Dgzio_mod_SOURCES =3D io/gzio.c =2Dgzio_mod_CFLAGS =3D $(COMMON_CFLAGS) =2Dgzio_mod_LDFLAGS =3D $(COMMON_LDFLAGS) =2D =2D# For test.mod. =2Dtest_mod_SOURCES =3D commands/test.c =2Dtest_mod_CFLAGS =3D $(COMMON_CFLAGS) =2Dtest_mod_LDFLAGS =3D $(COMMON_LDFLAGS) +include $(srcdir)/conf/common.mk Index: include/grub/elf.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /sources/grub/grub2/include/grub/elf.h,v retrieving revision 1.3 diff -u -p -r1.3 elf.h =2D-- include/grub/elf.h 4 Apr 2004 13:46:00 -0000 1.3 +++ include/grub/elf.h 4 Mar 2007 12:32:08 -0000 @@ -514,6 +514,10 @@ typedef struct #define ELF64_R_SYM(i) ((i) >> 32) #define ELF64_R_TYPE(i) ((i) & 0xffffffff) #define ELF64_R_INFO(sym,type) ((((Elf64_Xword) (sym)) << 32) + (type)) +#define ELF64_R_TYPE_DATA(info) (((Elf64_Xword)(info) << 32) >> 40) +#define ELF64_R_TYPE_ID(info) (((Elf64_Xword)(info) << 56) >> 56) +#define ELF64_R_TYPE_INFO(data, type) (((Elf64_Xword)(sym) << 8) + \ + (Elf64_Xword)(type)) =20 /* Program segment header. */ =20 Index: include/grub/sparc64/setjmp.h =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /sources/grub/grub2/include/grub/sparc64/setjmp.h,v retrieving revision 1.2 diff -u -p -r1.2 setjmp.h =2D-- include/grub/sparc64/setjmp.h 4 Aug 2006 19:23:28 -0000 1.2 +++ include/grub/sparc64/setjmp.h 4 Mar 2007 12:32:08 -0000 @@ -20,8 +20,9 @@ #ifndef GRUB_SETJMP_CPU_HEADER #define GRUB_SETJMP_CPU_HEADER 1 =20 =2D/* FIXME (sparc64). */ =2Dtypedef unsigned long grub_jmp_buf[20]; +#include + +typedef grub_uint64_t grub_jmp_buf[10]; =20 int grub_setjmp (grub_jmp_buf env); void grub_longjmp (grub_jmp_buf env, int val) __attribute__ ((noreturn)); Index: kern/sparc64/dl.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /sources/grub/grub2/kern/sparc64/dl.c,v retrieving revision 1.2 diff -u -p -r1.2 dl.c =2D-- kern/sparc64/dl.c 23 Oct 2005 19:28:28 -0000 1.2 +++ kern/sparc64/dl.c 4 Mar 2007 12:32:08 -0000 @@ -96,40 +96,57 @@ grub_arch_dl_relocate_symbols (grub_dl_t + entsize * ELF64_R_SYM (rel->r_info)); =20 value =3D sym->st_value + rel->r_addend; =2D switch (ELF64_R_TYPE (rel->r_info)) + switch (ELF64_R_TYPE_ID (ELF64_R_TYPE (rel->r_info))) { case R_SPARC_32: /* 3 V-word32 */ if (value & 0xFFFFFFFF00000000) return grub_error (GRUB_ERR_BAD_MODULE, "Address out of 32 bits range"); =2D *addr =3D value; + *addr =3D (grub_uint32_t) (value & 0xFFFFFFFF); break; case R_SPARC_WDISP30: /* 7 V-disp30 */ =2D if (((value - (Elf64_Addr) addr) & 0xFFFFFFFF0000000= 0) && =2D ((value - (Elf64_Addr) addr) & 0xFFFFFFFF00000000 =2D !=3D 0xFFFFFFFF00000000)) + if ((value - (Elf64_Addr) addr) & 0x3) return grub_error (GRUB_ERR_BAD_MODULE, =2D "Displacement out of 30 bits ra= nge"); + "30 bits displacement is not 4-bytes alligne= d"); *addr =3D (*addr & 0xC0000000) | (((grub_int32_t) ((value - (Elf64_Addr) addr) >> 2))= & 0x3FFFFFFF); break; case R_SPARC_HI22: /* 9 V-imm22 */ =2D if (((grub_int32_t) value) & 0xFF00000000) + if (value & 0xFFFFFFFF00000000) return grub_error (GRUB_ERR_BAD_MODULE, "High address out of 22 bits rang= e"); =2D *addr =3D (*addr & 0xFFC00000) | ((value >> 10) & 0x= 3FFFFF); + *addr =3D ((*addr) & 0xFFC00000) | + ((((grub_uint32_t) value) >> 10) & 0x3FFFFF); + break; + case R_SPARC_13: /* 11 V-simm13 */ + if (value & 0xFFFFFFFFFFFFE000) + return grub_error(GRUB_ERR_BAD_MODULE, + "Address out of 13 bits range"); + *addr =3D ((*addr) & 0xFFFFE000) | + (((grub_uint32_t) value) & 0x1FFF); break; case R_SPARC_LO10: /* 12 T-simm13 */ =2D *addr =3D (*addr & 0xFFFFFC00) | (value & 0x3FF); + *addr =3D ((*addr) & 0xFFFFFC00) | + (((grub_uint32_t) value) & 0x3FF); break; case R_SPARC_64: /* 32 V-xwords64 */ *(Elf64_Xword *) addr =3D value; break; + case R_SPARC_OLO10: /* 33 V-simm13 */ + { + grub_uint32_t delta =3D ((grub_uint32_t) value & 0x3= =46F) + + ELF64_R_TYPE_DATA (ELF64_R_TYPE (rel->r_inf= o)); + if (delta & 0xFFFFE000) + return grub_error(GRUB_ERR_BAD_MODULE, + "Address out of 13 bits range"); + *addr =3D ((*addr) & 0xFFFFFE000) | delta; + break; + } default: return grub_error (GRUB_ERR_NOT_IMPLEMENTED_YET, "This relocation (%d) is not implemented yet", =2D ELF64_R_TYPE (rel->r_info)); + ELF64_R_TYPE_ID (ELF64_R_TYPE (rel->r_info))); } } } Index: kern/sparc64/ieee1275/init.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /sources/grub/grub2/kern/sparc64/ieee1275/init.c,v retrieving revision 1.2 diff -u -p -r1.2 init.c =2D-- kern/sparc64/ieee1275/init.c 25 Apr 2006 20:08:31 -0000 1.2 +++ kern/sparc64/ieee1275/init.c 4 Mar 2007 12:32:08 -0000 @@ -140,6 +140,34 @@ grub_machine_set_prefix (void) grub_free (prefix); } =20 +/* Claim some available memory in the first /memory node. */ +static void grub_claim_heap (unsigned long heaplimit) +{ + auto int heap_init (grub_uint64_t addr, grub_uint64_t len); + int heap_init (grub_uint64_t addr, grub_uint64_t len) + { + len -=3D 1; /* Required for some firmware. */ + + /* Don't claim anything above `heaplimit'. */ + if (addr + len > heaplimit) + len =3D heaplimit - addr; + + if (len) + { + /* Claim and use it. */ + if (grub_claimmap (addr, len) < 0) + return grub_error (GRUB_ERR_OUT_OF_MEMORY, + "Failed to claim heap at 0x%llx, len 0x%llx\n= ", + addr, len); + grub_mm_init_region ((void *) (grub_addr_t) addr, len); + } + + return 0; + } + + grub_available_iterate (heap_init); +} + void grub_machine_init (void) { @@ -208,7 +236,7 @@ grub_machine_fini (void) void grub_exit (void) { =2D grub_ieee1275_enter (); + grub_ieee1275_exit (); } =20 grub_uint32_t Index: kern/sparc64/ieee1275/openfw.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /sources/grub/grub2/kern/sparc64/ieee1275/openfw.c,v retrieving revision 1.1 diff -u -p -r1.1 openfw.c =2D-- kern/sparc64/ieee1275/openfw.c 21 Aug 2005 18:42:55 -0000 1.1 +++ kern/sparc64/ieee1275/openfw.c 4 Mar 2007 12:32:08 -0000 @@ -91,7 +91,6 @@ grub_devalias_iterate (int (*hook) (stru grub_ieee1275_phandle_t devalias; char aliasname[32]; grub_ssize_t actual; =2D grub_ieee1275_cell_t flags; struct grub_ieee1275_devalias alias; =20 if (grub_ieee1275_finddevice ("/aliases", &devalias)) @@ -99,8 +98,7 @@ grub_devalias_iterate (int (*hook) (stru =20 aliasname[0] =3D '\0'; =20 =2D while (grub_ieee1275_next_property (devalias, aliasname, aliasname, &f= lags) !=3D -1 =2D && ((signed) flags) !=3D -1 ) + while (grub_ieee1275_next_property (devalias, aliasname, aliasname) !=3D= -1) { grub_ieee1275_phandle_t dev; grub_ssize_t pathlen, typelen; @@ -164,6 +162,53 @@ grub_devalias_iterate (int (*hook) (stru return 0; } =20 +grub_err_t grub_available_iterate (int (*hook) (grub_uint64_t, grub_uint64= _t)) +{ + grub_ieee1275_phandle_t root; + grub_ieee1275_phandle_t memory; + grub_uint32_t available[32]; + int address_cells =3D 1; + int size_cells =3D 1; + unsigned int i; + + /* Determine the format of each entry in `available'. */ + grub_ieee1275_finddevice ("/", &root); + grub_ieee1275_get_property (root, "#address-cells", &address_cells, + sizeof address_cells, 0); + grub_ieee1275_get_property (root, "#size-cells", &size_cells, + sizeof size_cells, 0); + + /* Load `/memory/available'. */ + if (grub_ieee1275_finddevice ("/memory", &memory)) + return grub_error (GRUB_ERR_UNKNOWN_DEVICE, + "Couldn't find /memory node"); + if (grub_ieee1275_get_property (memory, "available", available, + sizeof available, 0)) + return grub_error (GRUB_ERR_UNKNOWN_DEVICE, + "Couldn't examine /memory/available propery"); + + /* Decode each entry and call `hook'. */ + i =3D 0; + while (i < sizeof (available)) + { + grub_uint64_t address; + grub_uint64_t size; + + address =3D available[i++]; + if (address_cells =3D=3D 2) + address =3D (address << 32) | available[i++]; + + size =3D available[i++]; + if (size_cells =3D=3D 2) + size =3D (size << 32) | available[i++]; + + if (hook (address, size)) + break; + } + + return grub_errno; +} + /* FIXME (sparc64) */ #if 0 /* Call the "map" method of /chosen/mmu. */ Index: normal/main.c =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /sources/grub/grub2/normal/main.c,v retrieving revision 1.19 diff -u -p -r1.19 main.c =2D-- normal/main.c 12 Dec 2006 00:13:55 -0000 1.19 +++ normal/main.c 4 Mar 2007 12:32:09 -0000 @@ -30,7 +30,7 @@ #include #include =20 =2Dgrub_jmp_buf grub_exit_env; +grub_jmp_buf grub_exit_env __attribute__ ((__aligned__(8))); =20 static grub_fs_module_list_t fs_module_list =3D 0; =20 Index: normal/sparc64/setjmp.S =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D RCS file: /sources/grub/grub2/normal/sparc64/setjmp.S,v retrieving revision 1.1 diff -u -p -r1.1 setjmp.S =2D-- normal/sparc64/setjmp.S 23 Oct 2005 21:38:12 -0000 1.1 +++ normal/sparc64/setjmp.S 4 Mar 2007 12:32:09 -0000 @@ -27,13 +27,56 @@ * int grub_setjmp (grub_jmp_buf env) */ FUNCTION(grub_setjmp) =2D ret =2D nop + save %sp, -192, %sp + /* Save global registers. */ + /* Don't save %g0, it' always 0. */ + stx %g1, [%i0 + 0] +/* stx %g2, [%i0 + 8] + stx %g3, [%i0 + 16]*/ + stx %g4, [%i0 + 24] + stx %g5, [%i0 + 32] + stx %g6, [%i0 + 40] + stx %g7, [%i0 + 48] + /* Save stack pointer. */ + stx %sp, [%i0 + 56] + /* Save frame pointer. */ + stx %fp, [%i0 + 64] + /* Save return address. */ + stx %i7, [%i0 + 72] + /* Return 0. */ + mov 0, %i0 + ret + restore =20 /* * int grub_longjmp (grub_jmp_buf env, int val) */ FUNCTION(grub_longjmp) =2D ret =2D nop + save %sp, -192, %sp + /* Flush all windows to stack to make sure the window ring is empty + and we can safely return. */ + flushw + /* Restore global registers. */ + ldx [%i0 + 0], %g1 +/* ldx [%i0 + 8], %g2 + ldx [%i0 + 16], %g3*/ + ldx [%i0 + 24], %g4 + ldx [%i0 + 32], %g5 + ldx [%i0 + 40], %g6 + ldx [%i0 + 48], %g7 + /* Restore stack pointer. */ + ldx [%i0 + 56], %sp + /* Restore frame pointer. */ + ldx [%i0 + 64], %fp + /* Restore return address. */ + ldx [%i0 + 72], %i7 + /* Return the 2nd parameter value. */ + /* If the value to return is 0, return 1 instead. */ + cmp %i1, %g0 + bne,a,pt %icc, return + mov %i1, %i0 + mov 1, %i0 +return: + ret + restore =20 --Boundary-01=_oJu6Fotd14U/kgm Content-Type: text/x-objchdr; charset="us-ascii"; name="include_grub_sparc64_ieee1275_loader.h" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="include_grub_sparc64_ieee1275_loader.h" /* * GRUB -- GRand Unified Bootloader * Copyright (C) 2004 Free Software Foundation, Inc. * * 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., 675 Mass Ave, Cambridge, MA 02139, USA. */ #ifndef GRUB_LOADER_MACHINE_HEADER #define GRUB_LOADER_MACHINE_HEADER 1 /* The symbol shared between the normal mode and rescue mode loader. */ void grub_rescue_cmd_linux (int argc, char *argv[]); void grub_rescue_cmd_initrd (int argc, char *argv[]); void grub_linux_init (void); void grub_linux_fini (void); void grub_linux_normal_init (void); void grub_linux_normal_fini (void); #endif /* ! GRUB_LOADER_MACHINE_HEADER */ --Boundary-01=_oJu6Fotd14U/kgm-- --nextPart2640584.K8zDI2MB4C Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) iD8DBQBF6uJwFEQoKRQyjtURAt+4AJ9iWXCJSw+cQK+88rGm36rw/vdiFQCdH7gv r7O151fXtsWXyq5vWd9Kh/g= =miTN -----END PGP SIGNATURE----- --nextPart2640584.K8zDI2MB4C--