sparc: restore %asi in memcpy_large as mandated by the ABI.
Commit Message
The SPARC ABI (SCD 2.4.1, page 3P-10) mandates that the %asi register,
if modified, should be restored to its default value
ASI_PRIMARY_NOFAULT, 0x82) before claling anohter function or
returning. This patch fixes sysdeps/sparc/sparc64/memcpy.S.
Tested in sparcv9-*-* and sparc64-*-* targets in both multi- and not
multi-arch configurations.
---
ChangeLog | 6 ++++++
sysdeps/sparc/sparc64/memcpy.S | 4 +++-
2 files changed, 9 insertions(+), 1 deletion(-)
@@ -1,3 +1,9 @@
+2016-02-15 Jose E. Marchesi <jose.marchesi@oracle.com>
+
+ * sysdeps/sparc/sparc64/memcpy.S: Restore the %asi register to
+ ASI_PRIMARY_NOFAULT before returning, as mandated by the SPARC
+ ABI.
+
2016-02-14 Carlos O'Donelll <carlos@redhat.com>
* manual/install.texi: Latest tested is GCC 5.3, texinfo 6.0, gawk
@@ -351,6 +351,7 @@ ENTRY(__memcpy_large)
stb %g5, [%o0 - 1] /* Store Group */
207: membar #StoreLoad | #StoreStore /* LSU Group */
wr %g0, FPRS_FEF, %fprs
+ wr %g0, ASI_PNF, %asi /* LSU Group */
retl
mov %g4, %o0
@@ -370,7 +371,8 @@ ENTRY(__memcpy_large)
stb %g5, [%o0 - 2] /* Store */
bne,pt %xcc, 2b /* CTI */
stb %o5, [%o0 - 1] /* Store */
-209: retl
+209: wr %g0, ASI_PNF, %asi /* LSU Group */
+ retl
mov %g4, %o0
END(__memcpy_large)