diff options
author | kaashoek <kaashoek> | 2006-06-21 01:53:07 +0000 |
---|---|---|
committer | kaashoek <kaashoek> | 2006-06-21 01:53:07 +0000 |
commit | 7baa34a421e4c970ee90c2537ceacd7230f2474e (patch) | |
tree | 5cc26d0b33d22588eea93abe9ad5cfea24cecede /string.c | |
parent | ae6e8aa730fa410118c0532938d4a9e62b08bbe8 (diff) | |
download | xv6-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.c | 15 |
1 files changed, 15 insertions, 0 deletions
@@ -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; +} |