diff options
author | Randall Spangler <rspangler@chromium.org> | 2014-06-20 13:57:12 -0700 |
---|---|---|
committer | chrome-internal-fetch <chrome-internal-fetch@google.com> | 2014-06-24 20:12:36 +0000 |
commit | 25c95d0774b122c28276251961d7cbe9b6f34d41 (patch) | |
tree | 3b6090a983da037e2b7175ece99279a8e6fab944 | |
parent | dd5883dee60a06995bb167badc2352bf42a8aee5 (diff) | |
download | vboot-25c95d0774b122c28276251961d7cbe9b6f34d41.tar.gz |
vboot2: More specific errors for unimplemented external APIs
When porting vboot2 to a platform, it's common to copy 2stub.c and
then start implementing APIs. Adding explicit errors makes it clearer
when an unimplemented API is called.
BUG=chromium:370082
BRANCH=none
TEST=VBOOT2=1 make runtests
Change-Id: I1f412b7ed4b431dbdbdee5e33b27bf7206186918
Signed-off-by: Randall Spangler <rspangler@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/204960
Reviewed-by: Daisuke Nojiri <dnojiri@chromium.org>
-rw-r--r-- | firmware/2lib/2stub.c | 4 | ||||
-rw-r--r-- | firmware/2lib/include/2return_codes.h | 6 |
2 files changed, 8 insertions, 2 deletions
diff --git a/firmware/2lib/2stub.c b/firmware/2lib/2stub.c index a544a4fb..7c9e5b17 100644 --- a/firmware/2lib/2stub.c +++ b/firmware/2lib/2stub.c @@ -10,7 +10,7 @@ int vb2ex_tpm_clear_owner(struct vb2_context *ctx) { - return VB2_SUCCESS; + return VB2_ERROR_EX_TPM_CLEAR_OWNER_UNIMPLEMENTED; } int vb2ex_read_resource(struct vb2_context *ctx, @@ -19,5 +19,5 @@ int vb2ex_read_resource(struct vb2_context *ctx, void *buf, uint32_t size) { - return VB2_SUCCESS; + return VB2_ERROR_EX_READ_RESOURCE_UNIMPLEMENTED; } diff --git a/firmware/2lib/include/2return_codes.h b/firmware/2lib/include/2return_codes.h index fb00936c..77d0dd89 100644 --- a/firmware/2lib/include/2return_codes.h +++ b/firmware/2lib/include/2return_codes.h @@ -336,6 +336,9 @@ enum vb2_return_code { */ VB2_ERROR_EX = VB2_ERROR_BASE + 0x0a0000, + /* Read resource not implemented */ + VB2_ERROR_EX_READ_RESOURCE_UNIMPLEMENTED, + /* Resource index not found */ VB2_ERROR_EX_READ_RESOURCE_INDEX, @@ -345,6 +348,9 @@ enum vb2_return_code { /* TPM clear owner failed */ VB2_ERROR_EX_TPM_CLEAR_OWNER, + /* TPM clear owner not implemented */ + VB2_ERROR_EX_TPM_CLEAR_OWNER_UNIMPLEMENTED, + /********************************************************************** * Highest non-zero error generated inside vboot library. Note that * error codes passed through vboot when it calls external APIs may |