Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1Lf2Rr-0004ho-Kn for mharc-grub-devel@gnu.org; Wed, 04 Mar 2009 20:32:31 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Lf2Rp-0004hH-NU for grub-devel@gnu.org; Wed, 04 Mar 2009 20:32:29 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Lf2Rp-0004h3-6G for grub-devel@gnu.org; Wed, 04 Mar 2009 20:32:29 -0500 Received: from [199.232.76.173] (port=33234 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Lf2Ro-0004h0-Vx for grub-devel@gnu.org; Wed, 04 Mar 2009 20:32:29 -0500 Received: from mx20.gnu.org ([199.232.41.8]:35424) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Lf2Ro-0006nF-Kh for grub-devel@gnu.org; Wed, 04 Mar 2009 20:32:28 -0500 Received: from [74.93.104.97] (helo=sunset.davemloft.net) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Lf2Rn-0007Ds-TC for grub-devel@gnu.org; Wed, 04 Mar 2009 20:32:28 -0500 Received: from localhost (localhost [127.0.0.1]) by sunset.davemloft.net (Postfix) with ESMTP id A8479C8D983 for ; Wed, 4 Mar 2009 17:32:12 -0800 (PST) Date: Wed, 04 Mar 2009 17:32:12 -0800 (PST) Message-Id: <20090304.173212.109357658.davem@davemloft.net> To: grub-devel@gnu.org From: David Miller X-Mailer: Mew version 6.1 on Emacs 22.1 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-detected-kernel: by mx20.gnu.org: Linux 2.6 (newer, 3) X-Greylist: delayed 83820 seconds by postgrey-1.27 at nadesico; Wed, 04 Mar 2009 20:32:26 EST X-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) Subject: [PATCH 1/10]: Fix sparc64 setjmp 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: Thu, 05 Mar 2009 01:32:29 -0000 2009-03-03 David S. Miller * normal/sparc64/setjmp.S: Fix setjmp implementation. * include/grub/sparc64/setjmp.h: Update grub_jmp_buf[]. --- include/grub/sparc64/setjmp.h | 7 ++++--- normal/sparc64/setjmp.S | 20 ++++++++++++++------ 2 files changed, 18 insertions(+), 9 deletions(-) diff --git a/include/grub/sparc64/setjmp.h b/include/grub/sparc64/setjmp.h index 12d8e01..c8abb12 100644 --- a/include/grub/sparc64/setjmp.h +++ b/include/grub/sparc64/setjmp.h @@ -1,6 +1,6 @@ /* * GRUB -- GRand Unified Bootloader - * Copyright (C) 2002,2004,2006,2007 Free Software Foundation, Inc. + * Copyright (C) 2002,2004,2006,2007,2009 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 @@ -19,8 +19,9 @@ #ifndef GRUB_SETJMP_CPU_HEADER #define GRUB_SETJMP_CPU_HEADER 1 -/* FIXME (sparc64). */ -typedef unsigned long grub_jmp_buf[20]; +#include + +typedef grub_uint64_t grub_jmp_buf[3]; int grub_setjmp (grub_jmp_buf env); void grub_longjmp (grub_jmp_buf env, int val) __attribute__ ((noreturn)); diff --git a/normal/sparc64/setjmp.S b/normal/sparc64/setjmp.S index b1a9b6e..827299c 100644 --- a/normal/sparc64/setjmp.S +++ b/normal/sparc64/setjmp.S @@ -1,6 +1,6 @@ /* * GRUB -- GRand Unified Bootloader - * Copyright (C) 2005,2007 Free Software Foundation, Inc. + * Copyright (C) 2005,2007,2009 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 @@ -26,13 +26,21 @@ * int grub_setjmp (grub_jmp_buf env) */ FUNCTION(grub_setjmp) - ret - nop + stx %o7, [%o0 + 0x00] + stx %sp, [%o0 + 0x08] + retl + stx %fp, [%o0 + 0x10] /* * int grub_longjmp (grub_jmp_buf env, int val) */ FUNCTION(grub_longjmp) - ret - nop - + ldx [%o0 + 0x10], %g1 + movrz %o1, 1, %o1 + ta 0x3 + ldx [%o0 + 0x00], %o7 + ldx [%o0 + 0x08], %fp + sub %fp, 192, %sp + stx %g1, [%sp + 2047 + (14 * 8)] + retl + restore %o1, 0, %o0 -- 1.6.2