diff options
author | obrien <obrien@FreeBSD.org> | 2008-09-23 14:45:10 +0000 |
---|---|---|
committer | obrien <obrien@FreeBSD.org> | 2008-09-23 14:45:10 +0000 |
commit | d31fa364752ed3b16d83a9cfa2866990824b3eb5 (patch) | |
tree | 4bf6265433e1ef6e4e0356df3e2303dc0c576080 /sys/mips | |
parent | 219d6d162647c587a33965a8d84283e18c02887a (diff) | |
download | FreeBSD-src-d31fa364752ed3b16d83a9cfa2866990824b3eb5.zip FreeBSD-src-d31fa364752ed3b16d83a9cfa2866990824b3eb5.tar.gz |
The kernel implemented 'memcmp' is an alias for 'bcmp'. However, memcmp
and bcmp are not the same thing. 'man bcmp' states that the return is
"non-zero" if the two byte strings are not identical. Where as,
'man memcmp' states that the return is the "difference between the
first two differing bytes (treated as unsigned char values" if the
two byte strings are not identical.
So provide a proper memcmp(9), but it is a C implementation not a tuned
assembly implementation. Therefore bcmp(9) should be preferred over memcmp(9).
Diffstat (limited to 'sys/mips')
-rw-r--r-- | sys/mips/mips/support.S | 2 |
1 files changed, 0 insertions, 2 deletions
diff --git a/sys/mips/mips/support.S b/sys/mips/mips/support.S index 269042c..d821361 100644 --- a/sys/mips/mips/support.S +++ b/sys/mips/mips/support.S @@ -870,10 +870,8 @@ END(bzero) /* * bcmp(s1, s2, n) - * memcmp(s1, s2, n) */ LEAF(bcmp) -ALEAF(memcmp) .set noreorder blt a2, 16, smallcmp # is it worth any trouble? xor v0, a0, a1 # compare low two bits of addresses |