summaryrefslogtreecommitdiff
path: root/string.c
diff options
context:
space:
mode:
authorkaashoek <kaashoek>2006-06-21 01:53:07 +0000
committerkaashoek <kaashoek>2006-06-21 01:53:07 +0000
commit7baa34a421e4c970ee90c2537ceacd7230f2474e (patch)
tree5cc26d0b33d22588eea93abe9ad5cfea24cecede /string.c
parentae6e8aa730fa410118c0532938d4a9e62b08bbe8 (diff)
downloadxv6-labs-7baa34a421e4c970ee90c2537ceacd7230f2474e.tar.gz
xv6-labs-7baa34a421e4c970ee90c2537ceacd7230f2474e.tar.bz2
xv6-labs-7baa34a421e4c970ee90c2537ceacd7230f2474e.zip
start on MP; detect MP configuration
Diffstat (limited to 'string.c')
-rw-r--r--string.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/string.c b/string.c
index f27b025..40019d5 100644
--- a/string.c
+++ b/string.c
@@ -23,3 +23,18 @@ memset(void *dst, int c, unsigned n)
return dst;
}
+
+int
+memcmp(const void *v1, const void *v2, unsigned n)
+{
+ const uint8_t *s1 = (const uint8_t *) v1;
+ const uint8_t *s2 = (const uint8_t *) v2;
+
+ while (n-- > 0) {
+ if (*s1 != *s2)
+ return (int) *s1 - (int) *s2;
+ s1++, s2++;
+ }
+
+ return 0;
+}