summaryrefslogtreecommitdiff
path: root/string.c
diff options
context:
space:
mode:
authorkaashoek <kaashoek>2006-06-22 01:28:57 +0000
committerkaashoek <kaashoek>2006-06-22 01:28:57 +0000
commit21a88fd487177841c882d9017bd9f4476801c6f6 (patch)
treebfa061e00662efde2186d6c0498fc78f889356ce /string.c
parent7baa34a421e4c970ee90c2537ceacd7230f2474e (diff)
downloadxv6-labs-21a88fd487177841c882d9017bd9f4476801c6f6.tar.gz
xv6-labs-21a88fd487177841c882d9017bd9f4476801c6f6.tar.bz2
xv6-labs-21a88fd487177841c882d9017bd9f4476801c6f6.zip
checkpoint. booting second processor. stack is messed up, but thanks to cliff
and plan 9 code, at least boots and gets into C code.
Diffstat (limited to 'string.c')
-rw-r--r--string.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/string.c b/string.c
index 40019d5..54f4ba8 100644
--- a/string.c
+++ b/string.c
@@ -38,3 +38,23 @@ memcmp(const void *v1, const void *v2, unsigned n)
return 0;
}
+
+void *
+memmove(void *dst, const void *src, unsigned n)
+{
+ const char *s;
+ char *d;
+
+ s = src;
+ d = dst;
+ if (s < d && s + n > d) {
+ s += n;
+ d += n;
+ while (n-- > 0)
+ *--d = *--s;
+ } else
+ while (n-- > 0)
+ *d++ = *s++;
+
+ return dst;
+}