Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/sparc64 Move LP64 and ILP32 conversion macros COMBI...



details:   https://anonhg.NetBSD.org/src/rev/dea2d3870c84
branches:  trunk
changeset: 341075:dea2d3870c84
user:      nakayama <nakayama%NetBSD.org@localhost>
date:      Sat Oct 17 19:29:48 2015 +0000

description:
Move LP64 and ILP32 conversion macros COMBINE, SPLIT from locore.h
to asm.h, and provide SPLIT_RETL for the case SPLIT and then retl
immediately.

diffstat:

 sys/arch/sparc64/include/asm.h    |  24 +++++++++++++++++++++++-
 sys/arch/sparc64/include/locore.h |  20 +-------------------
 sys/arch/sparc64/sparc64/copy.S   |   4 ++--
 3 files changed, 26 insertions(+), 22 deletions(-)

diffs (87 lines):

diff -r 27d73e95916d -r dea2d3870c84 sys/arch/sparc64/include/asm.h
--- a/sys/arch/sparc64/include/asm.h    Sat Oct 17 19:20:51 2015 +0000
+++ b/sys/arch/sparc64/include/asm.h    Sat Oct 17 19:29:48 2015 +0000
@@ -1,4 +1,4 @@
-/*       $NetBSD: asm.h,v 1.21 2013/04/28 23:42:23 nakayama Exp $        */
+/*       $NetBSD: asm.h,v 1.22 2015/10/17 19:29:48 nakayama Exp $        */
 
 #include <sparc/asm.h>
 
@@ -66,3 +66,25 @@
 /* use as needed to align things on longword boundaries */
 #define        _ALIGN  .align 8
 #define ICACHE_ALIGN   .align  32
+
+/*
+ * Combine 2 regs -- used to convert 64-bit ILP32
+ * values to LP64.
+ */
+#define        COMBINE(r1, r2, d)      \
+       clruw   r2;             \
+       sllx    r1, 32, d;      \
+       or      d, r2, d
+
+/*
+ * Split 64-bit value in 1 reg into high and low halves.
+ * Used for ILP32 return values.
+ */
+#define        SPLIT(s, r0, r1)        \
+       srl     s, 0, r1;       \
+       srlx    s, 32, r0
+
+#define        SPLIT_RETL(s, r0, r1)   \
+       srl     s, 0, r1;       \
+       retl;                   \
+        srlx   s, 32, r0
diff -r 27d73e95916d -r dea2d3870c84 sys/arch/sparc64/include/locore.h
--- a/sys/arch/sparc64/include/locore.h Sat Oct 17 19:20:51 2015 +0000
+++ b/sys/arch/sparc64/include/locore.h Sat Oct 17 19:29:48 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: locore.h,v 1.8 2015/08/23 10:59:15 joerg Exp $ */
+/*     $NetBSD: locore.h,v 1.9 2015/10/17 19:29:48 nakayama Exp $      */
 
 /*
  * Copyright (c) 1996-2002 Eduardo Horvath
@@ -66,24 +66,6 @@
 
 
 /*
- * Combine 2 regs -- used to convert 64-bit ILP32
- * values to LP64.
- */
-#define        COMBINE(r1, r2, d)      \
-       clruw   r2;             \
-       sllx    r1, 32, d;      \
-       or      d, r2, d
-
-/*
- * Split 64-bit value in 1 reg into high and low halves.
- * Used for ILP32 return values.
- */
-#define        SPLIT(r0, r1)           \
-       srl     r0, 0, r1;      \
-       srlx    r0, 32, r0
-
-
-/*
  * A handy macro for maintaining instrumentation counters.
  * Note that this clobbers %o0, %o1 and %o2.  Normal usage is
  * something like:
diff -r 27d73e95916d -r dea2d3870c84 sys/arch/sparc64/sparc64/copy.S
--- a/sys/arch/sparc64/sparc64/copy.S   Sat Oct 17 19:20:51 2015 +0000
+++ b/sys/arch/sparc64/sparc64/copy.S   Sat Oct 17 19:29:48 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: copy.S,v 1.4 2010/07/10 10:12:07 nakayama Exp $        */
+/*     $NetBSD: copy.S,v 1.5 2015/10/17 19:29:48 nakayama Exp $        */
 
 /*
  * Copyright (c) 2006-2010 Matthew R. Green
@@ -883,7 +883,7 @@
        ldxa    [%o0] %asi, %o0         !       value = *(long *)addr;
 1:     
 #ifndef _LP64
-       SPLIT(%o0, %o1)
+       SPLIT(%o0, %o0, %o1)
 #endif
        membar  #Sync
 #ifndef _LP64



Home | Main Index | Thread Index | Old Index