grub-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH 2/10]: Fix sparc64 cache flush


From: David Miller
Subject: [PATCH 2/10]: Fix sparc64 cache flush
Date: Wed, 04 Mar 2009 17:32:14 -0800 (PST)

2009-03-03 David S. Miller <address@hidden>

        * 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





reply via email to

[Prev in Thread] Current Thread [Next in Thread]