summaryrefslogtreecommitdiffstats
path: root/sys/ia64
diff options
context:
space:
mode:
authorobrien <obrien@FreeBSD.org>2008-09-23 14:45:10 +0000
committerobrien <obrien@FreeBSD.org>2008-09-23 14:45:10 +0000
commitd31fa364752ed3b16d83a9cfa2866990824b3eb5 (patch)
tree4bf6265433e1ef6e4e0356df3e2303dc0c576080 /sys/ia64
parent219d6d162647c587a33965a8d84283e18c02887a (diff)
downloadFreeBSD-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/ia64')
-rw-r--r--sys/ia64/ia64/efi.c2
-rw-r--r--sys/ia64/ia64/sal.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/sys/ia64/ia64/efi.c b/sys/ia64/ia64/efi.c
index a10c208..161572d 100644
--- a/sys/ia64/ia64/efi.c
+++ b/sys/ia64/ia64/efi.c
@@ -106,7 +106,7 @@ efi_get_table(struct uuid *uuid)
count = efi_systbl->st_entries;
ct = efi_cfgtbl;
while (count--) {
- if (!memcmp(&ct->ct_uuid, uuid, sizeof(*uuid)))
+ if (!bcmp(&ct->ct_uuid, uuid, sizeof(*uuid)))
return ((void *)IA64_PHYS_TO_RR7(ct->ct_data));
ct++;
}
diff --git a/sys/ia64/ia64/sal.c b/sys/ia64/ia64/sal.c
index 251c1ee..6a55f39 100644
--- a/sys/ia64/ia64/sal.c
+++ b/sys/ia64/ia64/sal.c
@@ -96,7 +96,7 @@ ia64_sal_init(void)
if (sal_systbl == NULL)
return;
- if (memcmp(sal_systbl->sal_signature, SAL_SIGNATURE, 4)) {
+ if (bcmp(sal_systbl->sal_signature, SAL_SIGNATURE, 4)) {
printf("Bad signature for SAL System Table\n");
return;
}
OpenPOWER on IntegriCloud