diff --git a/arch/sparc/kernel/ttable.S b/arch/sparc/kernel/ttable.S
index c77453faa6129980889b118b04d952b89cd833b8..04a319a89987110bb5d1f72fc0943f89f8001dad 100644
--- a/arch/sparc/kernel/ttable.S
+++ b/arch/sparc/kernel/ttable.S
@@ -149,9 +149,6 @@ fpe_trap_handler:
 hw_div0_trap_handler:
 	.global __interrupt_entry
 __interrupt_entry:
-	.global memset
-memset:
-	ta 1
 	.global nmi_entry
 nmi_entry:
 	.global reg_access_trap_handler
diff --git a/include/kernel/string.h b/include/kernel/string.h
index 7993a091292ff10e7eeba3179260c5e6e845cafb..9b4859cf9a003cebca070e7fe556fda6198128b1 100644
--- a/include/kernel/string.h
+++ b/include/kernel/string.h
@@ -24,6 +24,7 @@ char *strstr(const char *haystack, const char *needle);
 size_t strlen(const char *s);
 int memcmp(const void *s1, const void *s2, size_t n);
 
+void *memset(void *s, int c, size_t n);
 void *memcpy(void *dest, const void *src, size_t n);
 char *strcpy(char *dest, const char *src);
 void bzero(void *s, size_t n);
diff --git a/lib/string.c b/lib/string.c
index 246be440eeeadb298eeccc57ddc7d2ea115fd3ba..9ab889e121b5c3fc9108c88f02c0a72fa6fd0019 100644
--- a/lib/string.c
+++ b/lib/string.c
@@ -527,3 +527,25 @@ int atoi(const char *nptr)
 	return res;
 }
 EXPORT_SYMBOL(atoi);
+
+
+/**
+ * @brief fills a memory area with  with the constant byte c
+ *
+ * @param s a pointer to the memory area
+ * @param c the byte to set
+ * @param n the number of bytes to fill
+ *
+ * @returns a pointer to the memory area s
+ */
+
+void *memset(void *s, int c, size_t n)
+{
+	char *p = s;
+
+	while (n--)
+		*p++ = c;
+
+	return s;
+}
+EXPORT_SYMBOL(memset);