Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/arm/arm Eliminate some duplicated code here (simila...



details:   https://anonhg.NetBSD.org/src/rev/55cd9ce34db2
branches:  trunk
changeset: 517521:55cd9ce34db2
user:      thorpej <thorpej%NetBSD.org@localhost>
date:      Wed Nov 14 00:08:05 2001 +0000

description:
Eliminate some duplicated code here (similar to XScale code):
* sa110_cache_purgeD() is the same as sa110_cache_cleanD() on the
  SA-1 -- make it an alias.
* sa110_cache_syncI() and sa110_cache_purgeID() are identical to
  sa110_cache_cleanD() on the SA-1, with the exception that the
  I-cache must also be flushed.  Save code duplication by moving
  the I-cache flush before the D-cache clean and letting it fall
  through.

diffstat:

 sys/arch/arm/arm/cpufunc_asm_sa1.S |  46 +++++--------------------------------
 1 files changed, 7 insertions(+), 39 deletions(-)

diffs (74 lines):

diff -r cfd231181acc -r 55cd9ce34db2 sys/arch/arm/arm/cpufunc_asm_sa1.S
--- a/sys/arch/arm/arm/cpufunc_asm_sa1.S        Tue Nov 13 20:25:38 2001 +0000
+++ b/sys/arch/arm/arm/cpufunc_asm_sa1.S        Wed Nov 14 00:08:05 2001 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: cpufunc_asm_sa1.S,v 1.3 2001/11/11 01:02:58 thorpej Exp $      */
+/*     $NetBSD: cpufunc_asm_sa1.S,v 1.4 2001/11/14 00:08:05 thorpej Exp $      */
 
 /*
  * Copyright (c) 1997,1998 Mark Brinicombe.
@@ -173,7 +173,11 @@
 #define        SA1_CACHE_CLEAN_EPILOGUE                                        \
        SA1_CACHE_CLEAN_UNBLOCK
 
-ENTRY(sa110_cache_cleanID)
+ENTRY_NP(sa110_cache_syncI)
+ENTRY_NP(sa110_cache_purgeID)
+       mcr     p15, 0, r0, c7, c5, 0   /* flush I cache (D cleaned below) */
+ENTRY_NP(sa110_cache_cleanID)
+ENTRY_NP(sa110_cache_purgeD)
 ENTRY(sa110_cache_cleanD)
        SA1_CACHE_CLEAN_PROLOGUE
 
@@ -186,31 +190,6 @@
        SA1_CACHE_CLEAN_EPILOGUE
        mov     pc, lr
 
-ENTRY(sa110_cache_purgeID)
-       SA1_CACHE_CLEAN_PROLOGUE
-
-1:     ldr     r2, [r0], #32
-       subs    r1, r1, #32
-       bne     1b
-
-       mcr     p15, 0, r0, c7, c10, 4  /* drain write buffer */
-       mcr     p15, 0, r0, c7, c5, 0   /* flush I cache (D flushed above) */
-
-       SA1_CACHE_CLEAN_EPILOGUE
-       mov     pc, lr
-
-ENTRY(sa110_cache_purgeD)
-       SA1_CACHE_CLEAN_PROLOGUE
-
-1:     ldr     r2, [r0], #32
-       subs    r1, r1, #32
-       bne     1b
-
-       mcr     p15, 0, r0, c7, c10, 4  /* drain write buffer */
-
-       SA1_CACHE_CLEAN_EPILOGUE
-       mov     pc, lr
-
 ENTRY(sa110_cache_purgeID_E)
        mcr     p15, 0, r0, c7, c10, 1  /* clean dcache entry */
        mcr     p15, 0, r0, c7, c10, 4  /* drain write buffer */
@@ -227,18 +206,7 @@
 /*
  * Soft functions
  */
-ENTRY(sa110_cache_syncI)
-       SA1_CACHE_CLEAN_PROLOGUE
-
-1:     ldr     r2, [r0], #32
-       subs    r1, r1, #32
-       bne     1b
-
-       mcr     p15, 0, r0, c7, c10, 4  /* drain write buffer */
-       mcr     p15, 0, r0, c7, c5, 0   /* flush I cache */
-
-       SA1_CACHE_CLEAN_EPILOGUE
-       mov     pc, lr
+/* sa110_cache_syncI is identical to sa110_cache_purgeID */
 
 ENTRY(sa110_cache_cleanID_rng)
 ENTRY(sa110_cache_cleanD_rng)



Home | Main Index | Thread Index | Old Index