summaryrefslogtreecommitdiff
path: root/futility/cmd_load_fmap.c
diff options
context:
space:
mode:
authorBill Richardson <wfrichar@chromium.org>2014-09-23 12:49:26 -0700
committerchrome-internal-fetch <chrome-internal-fetch@google.com>2014-09-25 20:26:53 +0000
commite192e7f6cea5f2c4556b729bf57ef1f552e0242a (patch)
tree1cfcde6d0b2a6a5490f4953080849f3ec9e3ab21 /futility/cmd_load_fmap.c
parentc6fa98d2ed1816d88e8517cd988de186fd6477b8 (diff)
downloadvboot-e192e7f6cea5f2c4556b729bf57ef1f552e0242a.tar.gz
futility: clean up a few shared functions
Move the Debug() function into a common place instead of several copies in different files, rename shared functions to start with "futil_" BUG=none BRANCH=ToT TEST=make runtests Signed-off-by: Bill Richardson <wfrichar@chromium.org> Change-Id: I6b844553dff95c24894dae611102716a8da5312d Reviewed-on: https://chromium-review.googlesource.com/219645 Reviewed-by: Randall Spangler <rspangler@chromium.org>
Diffstat (limited to 'futility/cmd_load_fmap.c')
-rw-r--r--futility/cmd_load_fmap.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/futility/cmd_load_fmap.c b/futility/cmd_load_fmap.c
index f7b978aa..7922ad62 100644
--- a/futility/cmd_load_fmap.c
+++ b/futility/cmd_load_fmap.c
@@ -92,7 +92,6 @@ static int do_load_fmap(int argc, char *argv[])
{
char *infile = 0;
char *outfile = 0;
- void *mmap_ptr = 0;
uint8_t *buf;
uint32_t len;
FmapHeader *fmap;
@@ -140,7 +139,7 @@ static int do_load_fmap(int argc, char *argv[])
/* okay, let's do it ... */
if (outfile)
- copy_file_or_die(infile, outfile);
+ futil_copy_file_or_die(infile, outfile);
else
outfile = infile;
@@ -151,10 +150,9 @@ static int do_load_fmap(int argc, char *argv[])
return 1;
}
- errorcnt |= map_it(fd, 1, &mmap_ptr, &len);
+ errorcnt |= futil_map_file(fd, MAP_RW, &buf, &len);
if (errorcnt)
goto done_file;
- buf = (uint8_t *)mmap_ptr;
fmap = fmap_find(buf, len);
if (!fmap) {
@@ -187,7 +185,7 @@ static int do_load_fmap(int argc, char *argv[])
}
done_map:
- errorcnt |= unmap_it(fd, 1, mmap_ptr, len);
+ errorcnt |= futil_unmap_file(fd, 1, buf, len);
done_file: