diff options
author | Randall Spangler <rspangler@chromium.org> | 2016-10-13 16:16:41 -0700 |
---|---|---|
committer | chrome-bot <chrome-bot@chromium.org> | 2016-10-23 13:33:38 -0700 |
commit | 664096bd1a7247b751bf4e564738d53a1e2795c2 (patch) | |
tree | 86d7135e77b942c7121885489c72c067005288a0 /futility | |
parent | 08d56aa7a7df69e80aa0a1fd6e847aa1adde5f9c (diff) | |
download | vboot-664096bd1a7247b751bf4e564738d53a1e2795c2.tar.gz |
vboot: use standard memcmp, memcpy, memset
Originally, we didn't trust the firmware to provide these functions from
a standard library. Now, with coreboot, we do.
BUG=chromium:611535
BRANCH=none
TEST=make runtests; emerge-kevin coreboot depthcharge
Change-Id: I4e624c40085f2b665275a38624340b2f6aabcf11
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/399120
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
Diffstat (limited to 'futility')
-rw-r--r-- | futility/cmd_sign.c | 2 | ||||
-rw-r--r-- | futility/vb1_helper.c | 16 |
2 files changed, 9 insertions, 9 deletions
diff --git a/futility/cmd_sign.c b/futility/cmd_sign.c index cd46c8ba..661eb3da 100644 --- a/futility/cmd_sign.c +++ b/futility/cmd_sign.c @@ -241,7 +241,7 @@ int ft_sign_kern_preamble(const char *name, uint8_t *buf, uint32_t len, /* If we're modifying an existing file, it's mmap'ed so that * all our modifications to the buffer will get flushed to * disk when we close it. */ - Memcpy(kpart_data, vblock_data, vblock_size); + memcpy(kpart_data, vblock_data, vblock_size); } free(vblock_data); diff --git a/futility/vb1_helper.c b/futility/vb1_helper.c index 8e3cb2e5..fdd3ece0 100644 --- a/futility/vb1_helper.c +++ b/futility/vb1_helper.c @@ -188,7 +188,7 @@ static int PickApartVmlinuz(uint8_t *kernel_buf, /* Copy the original zeropage data from kernel_buf into * g_param_data, then tweak a few fields for our purposes */ params = (struct linux_kernel_params *)(g_param_data); - Memcpy(&(params->setup_sects), &(lh->setup_sects), + memcpy(&(params->setup_sects), &(lh->setup_sects), offsetof(struct linux_kernel_params, e820_entries) - offsetof(struct linux_kernel_params, setup_sects)); params->boot_flag = 0; @@ -220,7 +220,7 @@ static int PickApartVmlinuz(uint8_t *kernel_buf, /* Keep just the 32-bit kernel. */ if (kernel32_size) { g_kernel_size = kernel32_size; - Memcpy(g_kernel_data, kernel_buf + kernel32_start, + memcpy(g_kernel_data, kernel_buf + kernel32_start, g_kernel_size); } @@ -296,8 +296,8 @@ int UpdateKernelBlobConfig(uint8_t *kblob_data, uint32_t kblob_size, return -1; } - Memset(g_config_data, 0, g_config_size); - Memcpy(g_config_data, config_data, config_size); + memset(g_config_data, 0, g_config_size); + memcpy(g_config_data, config_data, config_size); return 0; } @@ -670,7 +670,7 @@ uint8_t *CreateKernelBlob(uint8_t *vmlinuz_buf, uint32_t vmlinuz_size, /* Allocate space for the blob. */ g_kernel_blob_data = malloc(g_kernel_blob_size); - Memset(g_kernel_blob_data, 0, g_kernel_blob_size); + memset(g_kernel_blob_data, 0, g_kernel_blob_size); /* Assign the sub-pointers */ g_kernel_data = g_kernel_blob_data + now; @@ -718,10 +718,10 @@ uint8_t *CreateKernelBlob(uint8_t *vmlinuz_buf, uint32_t vmlinuz_size, } /* Copy the other bits too */ - Memcpy(g_config_data, config_data, config_size); - Memcpy(g_bootloader_data, bootloader_data, bootloader_size); + memcpy(g_config_data, config_data, config_size); + memcpy(g_bootloader_data, bootloader_data, bootloader_size); if (g_vmlinuz_header_size) { - Memcpy(g_vmlinuz_header_data, + memcpy(g_vmlinuz_header_data, vmlinuz_buf, g_vmlinuz_header_size); } |