summaryrefslogtreecommitdiff
path: root/firmware/common/string.c
diff options
context:
space:
mode:
Diffstat (limited to 'firmware/common/string.c')
-rw-r--r--firmware/common/string.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/firmware/common/string.c b/firmware/common/string.c
new file mode 100644
index 0000000..373aa92
--- /dev/null
+++ b/firmware/common/string.c
@@ -0,0 +1,19 @@
+/* For archs that lack assembly optimized versions of those */
+
+#include "string.h"
+
+_PTR _EXFUN(memset,(_PTR, int, size_t));
+
+_PTR memset(_PTR data, int val, size_t count)
+{
+ for (int i=0; i < count; i++)
+ ((char*)data)[i] = val;
+ return data;
+}
+
+_PTR memcpy(_PTR dst, const _PTR src, size_t count)
+{
+ for (int i=0; i < count; i++)
+ ((char*)dst)[i] = ((char*)src)[i];
+ return dst;
+}