Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1Lf2Rs-0004ib-SX for mharc-grub-devel@gnu.org; Wed, 04 Mar 2009 20:32:32 -0500 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1Lf2Rr-0004hg-Bh for grub-devel@gnu.org; Wed, 04 Mar 2009 20:32:31 -0500 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1Lf2Rq-0004hP-0V for grub-devel@gnu.org; Wed, 04 Mar 2009 20:32:30 -0500 Received: from [199.232.76.173] (port=33235 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1Lf2Rp-0004hM-R5 for grub-devel@gnu.org; Wed, 04 Mar 2009 20:32:29 -0500 Received: from mx20.gnu.org ([199.232.41.8]:35425) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1Lf2Rp-0006nn-FW for grub-devel@gnu.org; Wed, 04 Mar 2009 20:32:29 -0500 Received: from [74.93.104.97] (helo=sunset.davemloft.net) by mx20.gnu.org with esmtp (Exim 4.60) (envelope-from ) id 1Lf2Ro-0007E0-Rl for grub-devel@gnu.org; Wed, 04 Mar 2009 20:32:29 -0500 Received: from localhost (localhost [127.0.0.1]) by sunset.davemloft.net (Postfix) with ESMTP id C6DA7C8D985 for ; Wed, 4 Mar 2009 17:32:14 -0800 (PST) Date: Wed, 04 Mar 2009 17:32:14 -0800 (PST) Message-Id: <20090304.173214.91397178.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-detected-operating-system: by monty-python.gnu.org: GNU/Linux 2.6, seldom 2.4 (older, 4) Subject: [PATCH 2/10]: Fix sparc64 cache flush 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:31 -0000 2009-03-03 David S. Miller * kern/sparc64/cache.S: Fix grub_arch_sync_caches implementation. --- kern/sparc64/cache.S | 24 ++++++++++-------------- 1 files changed, 10 insertions(+), 14 deletions(-) diff --git a/kern/sparc64/cache.S b/kern/sparc64/cache.S index 2ebb693..dac3f93 100644 --- a/kern/sparc64/cache.S +++ b/kern/sparc64/cache.S @@ -1,7 +1,7 @@ /* cache.S - Flush the processor cache for a specific region. */ /* * 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 @@ -27,17 +27,13 @@ * void grub_arch_sync_caches (void *address, grub_size_t len) */ FUNCTION(grub_arch_sync_caches) - save %o6, -0xC, %o6 ! Get a new register window, - ! reserve space on stack for - ! %i0, %i1, %i2 - brz,pn %i0, return ! Return if address == 0. - nop - brz,pn %i1, return ! Return if len == 0. - clr %i2 ! index = 0. -loop: flush %i0 + %i2 ! Flush address + index. - cmp %i1, %i2 ! Compare len & index . - bpos,a,pt %xcc, loop ! If len > index, loop. - add %i2, 8, %i2 ! Go to next doubleword. -return: ret ! Restore caller's register - restore ! window and return. + brz,pn %o1, 2f + andn %o0, 7, %o0 + add %o1, 7, %o1 + andn %o1, 7, %o1 +1: subcc %o1, 8, %o1 + bne,pt %icc, 1b + flush %o0 + %o1 +2: retl + nop -- 1.6.2