summaryrefslogtreecommitdiff
path: root/utility/load_kernel_test.c
diff options
context:
space:
mode:
authorRandall Spangler <rspangler@chromium.org>2011-07-01 16:12:47 -0700
committerRandall Spangler <rspangler@chromium.org>2011-07-08 13:31:36 -0700
commit1b1998dff0002f20b3f27a21e6e79d8951e64684 (patch)
treefec838ef7d0867dc021087308c57b8b9cd1197b1 /utility/load_kernel_test.c
parente49e8af65fce38da7a308305566f8a14f102254a (diff)
downloadvboot-1b1998dff0002f20b3f27a21e6e79d8951e64684.tar.gz
Vboot wrapper initial implementation
Patch 1: Initial change Patch 2: Fix comment in vboot_struct.h Patch 3: Revert files unintentionally reverted Patch 4: (rebase) Patch 5: (rebase) Patch 6: Revert files unintentionally reverted (again) Patch 7: Fix mocked tlcl for ARM build BUG=chromium-os:17010 TEST=make && make runtests; works on H2C; emerge-tegra2_seaboard chromeos-bootimage compiles Change-Id: I6e5ce72d41b9297c07a3f330a881eba68cfabee2 Reviewed-on: http://gerrit.chromium.org/gerrit/3593 Reviewed-by: Randall Spangler <rspangler@chromium.org> Tested-by: Randall Spangler <rspangler@chromium.org>
Diffstat (limited to 'utility/load_kernel_test.c')
-rw-r--r--utility/load_kernel_test.c15
1 files changed, 8 insertions, 7 deletions
diff --git a/utility/load_kernel_test.c b/utility/load_kernel_test.c
index 6b0f9a88..6918e8c0 100644
--- a/utility/load_kernel_test.c
+++ b/utility/load_kernel_test.c
@@ -14,7 +14,6 @@
#include <sys/types.h>
#include <unistd.h>
-#include "boot_device.h"
#include "gbb_header.h"
#include "host_common.h"
#include "load_firmware_fw.h"
@@ -33,7 +32,8 @@ static FILE *image_file = NULL;
/* Boot device stub implementations to read from the image file */
-int BootDeviceReadLBA(uint64_t lba_start, uint64_t lba_count, void *buffer) {
+VbError_t VbExDiskRead(VbExDiskHandle_t handle, uint64_t lba_start,
+ uint64_t lba_count, void *buffer) {
printf("Read(%" PRIu64 ", %" PRIu64 ")\n", lba_start, lba_count);
if (lba_start > lkp.ending_lba ||
@@ -48,11 +48,12 @@ int BootDeviceReadLBA(uint64_t lba_start, uint64_t lba_count, void *buffer) {
fprintf(stderr, "Read error.");
return 1;
}
- return 0;
+ return VBERROR_SUCCESS;
}
-int BootDeviceWriteLBA(uint64_t lba_start, uint64_t lba_count,
- const void *buffer) {
+
+VbError_t VbExDiskWrite(VbExDiskHandle_t handle, uint64_t lba_start,
+ uint64_t lba_count, const void *buffer) {
printf("Write(%" PRIu64 ", %" PRIu64 ")\n", lba_start, lba_count);
if (lba_start > lkp.ending_lba ||
@@ -63,14 +64,14 @@ int BootDeviceWriteLBA(uint64_t lba_start, uint64_t lba_count,
}
/* TODO: enable writes, once we're sure it won't trash our example file */
- return 0;
+ return VBERROR_SUCCESS;
fseek(image_file, lba_start * lkp.bytes_per_lba, SEEK_SET);
if (1 != fwrite(buffer, lba_count * lkp.bytes_per_lba, 1, image_file)) {
fprintf(stderr, "Read error.");
return 1;
}
- return 0;
+ return VBERROR_SUCCESS;
}