summaryrefslogtreecommitdiffstats
path: root/sys/contrib/dev/acpica/utclib.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/contrib/dev/acpica/utclib.c')
-rw-r--r--sys/contrib/dev/acpica/utclib.c32
1 files changed, 31 insertions, 1 deletions
diff --git a/sys/contrib/dev/acpica/utclib.c b/sys/contrib/dev/acpica/utclib.c
index 338a08b..5be62a5 100644
--- a/sys/contrib/dev/acpica/utclib.c
+++ b/sys/contrib/dev/acpica/utclib.c
@@ -1,7 +1,7 @@
/******************************************************************************
*
* Module Name: cmclib - Local implementation of C library functions
- * $Revision: 52 $
+ * $Revision: 53 $
*
*****************************************************************************/
@@ -278,6 +278,36 @@ AcpiUtStrcmp (
/*******************************************************************************
*
+ * FUNCTION: memcmp
+ *
+ * PARAMETERS: Buffer1 - First Buffer
+ * Buffer2 - Second Buffer
+ * Count - Maximum # of bytes to compare
+ *
+ * RETURN: Index where Buffers mismatched, or 0 if Buffers matched
+ *
+ * DESCRIPTION: Compare two Buffers, with a maximum length
+ *
+ ******************************************************************************/
+
+int
+AcpiUtMemcmp (
+ const char *Buffer1,
+ const char *Buffer2,
+ ACPI_SIZE Count)
+{
+
+ for ( ; Count-- && (*Buffer1 == *Buffer2); Buffer1++, Buffer2++)
+ {
+ }
+
+ return ((Count == ACPI_SIZE_MAX) ? 0 : ((unsigned char) *Buffer1 -
+ (unsigned char) *Buffer2));
+}
+
+
+/*******************************************************************************
+ *
* FUNCTION: strncmp
*
* PARAMETERS: String1 - First string
OpenPOWER on IntegriCloud