diff options
author | Dan Ehrenberg <dehrenberg@chromium.org> | 2014-11-21 15:44:05 -0800 |
---|---|---|
committer | chrome-internal-fetch <chrome-internal-fetch@google.com> | 2014-12-12 21:37:58 +0000 |
commit | 32a999d2c0e5bf8a1c0f6141d3db77a1dcc6f5af (patch) | |
tree | 8861b996d0698c355c021754a005b24e5e947e4e /firmware/lib/gpt_misc.c | |
parent | b3d38f5c620da89662deb1a08971c5025d6c1132 (diff) | |
download | vboot-32a999d2c0e5bf8a1c0f6141d3db77a1dcc6f5af.tar.gz |
vboot: Move IsEntryUnused to gpt_misc
Over in depthcharge, IsEntryUnused will be useful for presenting the
partition table to the kernel. This patch moves that function to
gpt_misc.[ch] for export to depthcharge.
TEST=Booted a kernel on NAND with all this compiled in
TEST=make runtests passed
BRANCH=none
BUG=none
Signed-off-by: Dan Ehrenberg <dehrenberg@google.com>
Change-Id: I56445d1a420fec4d8385ddffc5469b7d77eab576
Reviewed-on: https://chromium-review.googlesource.com/231455
Reviewed-by: Bill Richardson <wfrichar@chromium.org>
Commit-Queue: Daniel Ehrenberg <dehrenberg@chromium.org>
Tested-by: Daniel Ehrenberg <dehrenberg@chromium.org>
Diffstat (limited to 'firmware/lib/gpt_misc.c')
-rw-r--r-- | firmware/lib/gpt_misc.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/firmware/lib/gpt_misc.c b/firmware/lib/gpt_misc.c index 975e853b..c16d4729 100644 --- a/firmware/lib/gpt_misc.c +++ b/firmware/lib/gpt_misc.c @@ -185,3 +185,8 @@ fail: return ret; } +int IsUnusedEntry(const GptEntry *e) +{ + static Guid zero = {{{0, 0, 0, 0, 0, {0, 0, 0, 0, 0, 0}}}}; + return !Memcmp(&zero, (const uint8_t*)(&e->type), sizeof(zero)); +} |