Index: boot/generic/src/memstr.c
===================================================================
--- boot/generic/src/memstr.c	(revision 5c4356b5f3f4cd3beea6f5bb4dc3ed4422fe8dd5)
+++ boot/generic/src/memstr.c	(revision 5d9fce40864ed86f410d7d8389986e88a96f0f79)
@@ -30,11 +30,11 @@
 #include <typedefs.h>
 
-/** Copy block of memory.
+/** Move memory block without overlapping.
  *
- * Copy cnt bytes from src address to dst address.The source and destination
- * memory areas cannot overlap.
+ * Copy cnt bytes from src address to dst address. The source
+ * and destination memory areas cannot overlap.
  *
+ * @param dst Destination address to copy to.
  * @param src Source address to copy from.
- * @param dst Destination address to copy to.
  * @param cnt Number of bytes to copy.
  *
@@ -44,5 +44,11 @@
 void *memcpy(void *dst, const void *src, size_t cnt)
 {
-	return __builtin_memcpy(dst, src, cnt);
+	uint8_t *dp = (uint8_t *) dst;
+	const uint8_t *sp = (uint8_t *) src;
+	
+	while (cnt-- != 0)
+		*dp++ = *sp++;
+	
+	return dst;
 }
 
@@ -60,5 +66,10 @@
 void *memset(void *dst, int val, size_t cnt)
 {
-	return __builtin_memset(dst, val, cnt);
+	uint8_t *dp = (uint8_t *) dst;
+	
+	while (cnt-- != 0)
+		*dp++ = val;
+	
+	return dst;
 }
 
