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>
This commit is contained in:
Randall Spangler
2014-06-20 13:57:12 -07:00
committed by chrome-internal-fetch
parent dd5883dee6
commit 25c95d0774
2 changed files with 8 additions and 2 deletions

View File

@@ -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;
}

View File

@@ -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