summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source/components/utilities/utclib.c55
-rw-r--r--source/include/acclib.h6
2 files changed, 61 insertions, 0 deletions
diff --git a/source/components/utilities/utclib.c b/source/components/utilities/utclib.c
index 7e61b980a..0bc9215fd 100644
--- a/source/components/utilities/utclib.c
+++ b/source/components/utilities/utclib.c
@@ -201,6 +201,61 @@ memcmp (
/*******************************************************************************
*
+ * FUNCTION: memmove
+ *
+ * PARAMETERS: Dest - Target of the copy
+ * Src - Source buffer to copy
+ * Count - Number of bytes to copy
+ *
+ * RETURN: Dest
+ *
+ * DESCRIPTION: Copy arbitrary bytes of memory with respect to the overlapping
+ *
+ ******************************************************************************/
+
+void *
+memmove (
+ void *Dest,
+ const void *Src,
+ ACPI_SIZE Count)
+{
+ char *New = (char *) Dest;
+ char *Old = (char *) Src;
+
+
+ if (Old > New)
+ {
+ /* Copy from the beginning */
+
+ while (Count)
+ {
+ *New = *Old;
+ New++;
+ Old++;
+ Count--;
+ }
+ }
+ else if (Old < New)
+ {
+ /* Copy from the end */
+
+ New = New + Count - 1;
+ Old = Old + Count - 1;
+ while (Count)
+ {
+ *New = *Old;
+ New--;
+ Old--;
+ Count--;
+ }
+ }
+
+ return (Dest);
+}
+
+
+/*******************************************************************************
+ *
* FUNCTION: memcpy
*
* PARAMETERS: Dest - Target of the copy
diff --git a/source/include/acclib.h b/source/include/acclib.h
index 67c05bf36..9f5853596 100644
--- a/source/include/acclib.h
+++ b/source/include/acclib.h
@@ -237,6 +237,12 @@ memcpy (
ACPI_SIZE Count);
void *
+memmove (
+ void *Dest,
+ const void *Src,
+ ACPI_SIZE Count);
+
+void *
memset (
void *Dest,
int Value,