summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorHeinrich Schuchardt <xypron.glpk@gmx.de>2020-06-28 17:30:29 +0300
committerHeinrich Schuchardt <xypron.glpk@gmx.de>2020-07-12 00:14:17 +0300
commitb0dd8cb4076ea178df93ad56be6636dcdb444c33 (patch)
treeb2cfe6dbd438e1384c07acc7363169a8a0150a38 /lib
parent724d28171e5bd239866cdf885a7b70c059ddd563 (diff)
downloadu-boot-b0dd8cb4076ea178df93ad56be6636dcdb444c33.tar.xz
efi_loader: new function efi_memcpy_runtime()
Provide a memcpy() function that we can use at UEFI runtime. Signed-off-by: Heinrich Schuchardt <xypron.glpk@gmx.de>
Diffstat (limited to 'lib')
-rw-r--r--lib/efi_loader/efi_runtime.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/lib/efi_loader/efi_runtime.c b/lib/efi_loader/efi_runtime.c
index a4aa1d8b6c..5b6506fbdc 100644
--- a/lib/efi_loader/efi_runtime.c
+++ b/lib/efi_loader/efi_runtime.c
@@ -138,6 +138,25 @@ efi_status_t efi_init_runtime_supported(void)
}
/**
+ * efi_memcpy_runtime() - copy memory area
+ *
+ * At runtime memcpy() is not available.
+ *
+ * @dest: destination buffer
+ * @src: source buffer
+ * @n: number of bytes to copy
+ * Return: pointer to destination buffer
+ */
+void __efi_runtime efi_memcpy_runtime(void *dest, const void *src, size_t n)
+{
+ u8 *d = dest;
+ const u8 *s = src;
+
+ for (; n; --n)
+ *d++ = *s++;
+}
+
+/**
* efi_update_table_header_crc32() - Update crc32 in table header
*
* @table: EFI table