Skip to content

Commit

Permalink
p9_xip_section_append: small RAS related improvement
Browse files Browse the repository at this point in the history
check all parameters instead of bailing out on first invalid
parameter; and always print all of them on error

also cleaning up handling of fapi return code

Change-Id: I900dc2f52384a2b1bab19dd6add9b626a6a2427b
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/40696
Reviewed-by: Richard J. Knight <rjknight@us.ibm.com>
Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com>
Tested-by: Hostboot CI <hostboot-ci+hostboot@us.ibm.com>
Reviewed-by: Claus M. Olsen <cmolsen@us.ibm.com>
Reviewed-by: Martin Peschke <mpeschke@de.ibm.com>
Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/40699
Reviewed-by: Hostboot Team <hostboot@us.ibm.com>
Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com>
Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com>
Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
  • Loading branch information
Martin Peschke authored and dcrowell77 committed May 23, 2017
1 parent 3736d09 commit 193c6d7
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 51 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -39,37 +39,27 @@ fapi2::ReturnCode p9_xip_section_append(

FAPI_DBG(">>p9_xip_section_append");

fapi2::current_err = fapi2::FAPI2_RC_INVALID_PARAMETER;
fapi2::current_err = fapi2::FAPI2_RC_SUCCESS;

FAPI_ASSERT((i_section != NULL),
fapi2::XIP_SECTION_APPEND_SANITY_SECTION().
set_SECTION(i_section),
"Section pointer not valid (0x%x)", i_section);
FAPI_ASSERT((i_section_size > 0),
fapi2::XIP_SECTION_APPEND_SANITY_SECTION_SIZE().
set_SECTION_SIZE(i_section_size),
"Section size not valid (%d)", i_section_size);
FAPI_ASSERT((i_section_id < P9_XIP_SECTIONS),
fapi2::XIP_SECTION_APPEND_SANITY_SECTION_ID().
set_SECTION_ID(i_section_id),
"Section ID not valid (%d)", i_section_id);
FAPI_ASSERT((i_image != NULL),
fapi2::XIP_SECTION_APPEND_SANITY_IMAGE().
set_IMAGE(i_image),
"Image pointer not valid (0x%x)", i_image);
FAPI_ASSERT((io_image_size > 0),
fapi2::XIP_SECTION_APPEND_SANITY_IMAGE_SIZE().
FAPI_ASSERT((i_section != NULL) &&
(i_section_size > 0) &&
(i_section_id < P9_XIP_SECTIONS) &&
(i_image != NULL) &&
(io_image_size > 0),
fapi2::XIP_SECTION_APPEND_INVALID_PARAMETERS().
set_SECTION(i_section).
set_SECTION_SIZE(i_section_size).
set_SECTION_ID(i_section_id).
set_IMAGE(i_image).
set_IMAGE_SIZE(io_image_size),
"Size of available image space not valid (%d)", io_image_size);
"at least one input parameter not valid")

FAPI_DBG("i_section 0x%x", i_section);
FAPI_DBG("i_section_size %d", i_section_size);
FAPI_DBG("i_section_id %d", i_section_id);
FAPI_DBG("i_image 0x%x", i_image);
FAPI_DBG("io_image_size %d", io_image_size);

fapi2::current_err = fapi2::FAPI2_RC_PLAT_ERR_SEE_DATA;

rc = p9_xip_append(i_image, i_section_id, i_section, i_section_size,
io_image_size, &unused_param, 0);
FAPI_ASSERT((rc == 0),
Expand All @@ -93,8 +83,6 @@ fapi2::ReturnCode p9_xip_section_append(
set_IMAGE_SIZE(io_image_size),
"Failed to determine new image size (rc=%d)", rc);

fapi2::current_err = fapi2::FAPI2_RC_SUCCESS;

fapi_try_exit:
FAPI_DBG("<<p9_xip_section_append");
return fapi2::current_err;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<!-- -->
<!-- OpenPOWER HostBoot Project -->
<!-- -->
<!-- Contributors Listed Below - COPYRIGHT 2016 -->
<!-- Contributors Listed Below - COPYRIGHT 2016,2017 -->
<!-- [+] International Business Machines Corp. -->
<!-- -->
<!-- -->
Expand All @@ -24,38 +24,14 @@
<!-- IBM_PROLOG_END_TAG -->
<hwpErrors>
<hwpError>
<rc>RC_XIP_SECTION_APPEND_SANITY_SECTION</rc>
<rc>RC_XIP_SECTION_APPEND_INVALID_PARAMETERS</rc>
<description>
Error calling p9_xip_section_append when checking i_section
Error calling p9_xip_section_append when checking input parameters
</description>
<ffdc>SECTION</ffdc>
</hwpError>
<hwpError>
<rc>RC_XIP_SECTION_APPEND_SANITY_SECTION_SIZE</rc>
<description>
Error calling p9_xip_section_append when checking i_section_size
</description>
<ffdc>SECTION_SIZE</ffdc>
</hwpError>
<hwpError>
<rc>RC_XIP_SECTION_APPEND_SANITY_SECTION_ID</rc>
<description>
Error calling p9_xip_section_append when checking i_section_id
</description>
<ffdc>SECTION_ID</ffdc>
</hwpError>
<hwpError>
<rc>RC_XIP_SECTION_APPEND_SANITY_IMAGE</rc>
<description>
Error calling p9_xip_section_append when checking i_image
</description>
<ffdc>IMAGE</ffdc>
</hwpError>
<hwpError>
<rc>RC_XIP_SECTION_APPEND_SANITY_IMAGE_SIZE</rc>
<description>
Error calling p9_xip_section_append when checking io_image_size
</description>
<ffdc>IMAGE_SIZE</ffdc>
</hwpError>
<hwpError>
Expand Down

0 comments on commit 193c6d7

Please sign in to comment.