Skip to contentSkip to conversation

sparc32: return destination pointer on return from memcpy

PATCH New Konrad Eisele 1 participant 2 messages Oct 11, 2011 SPARC + UltraSPARC (sparc/sparc64)

lore
Share & tools
lore
#0 lore raw

PATCH 4/5 sparc32: return destination pointer on return from memcpy

Gcc can optimize constant strcpy to a memcpy call. However the return value of strcpy is used in KGDB. Return the standard return value instead of 0

---
 arch/sparc/lib/memcpy.S |    8 ++------
 1 files changed, 2 insertions(+), 6 deletions(-)
arch/sparc/lib/memcpy.S +2 -6
index 34fe657..835014b 100644
@@ -19,12 +19,8 @@ x:
 #undef FASTER_NONALIGNED
 #define FASTER_ALIGNED
 
-/* In kernel these functions don't return a value.
- * One should use macros in asm/string.h for that purpose.
- * We return 0, so that bugs are more apparent.
- */
-#define SETUP_RETL
-#define RETL_INSN	clr	%o0
+#define SETUP_RETL	mov	%o0, %g6
+#define RETL_INSN	mov	%g6, %o0
 
 #else
 
Signature · 1 line
1.6.4.1
#1 lore raw

PATCH 4/5 sparc32: return destination pointer on return from memcpy

Gcc can optimize constant strcpy to a memcpy call. However the return value of strcpy is used in KGDB. Return the standard return value instead of 0

---
 arch/sparc/lib/memcpy.S |    8 ++------
 1 files changed, 2 insertions(+), 6 deletions(-)
arch/sparc/lib/memcpy.S +2 -6
index 34fe657..835014b 100644
@@ -19,12 +19,8 @@ x:
 #undef FASTER_NONALIGNED
 #define FASTER_ALIGNED
 
-/* In kernel these functions don't return a value.
- * One should use macros in asm/string.h for that purpose.
- * We return 0, so that bugs are more apparent.
- */
-#define SETUP_RETL
-#define RETL_INSN	clr	%o0
+#define SETUP_RETL	mov	%o0, %g6
+#define RETL_INSN	mov	%g6, %o0
 
 #else
 
Signature · 1 line
1.6.4.1