From 82af686f8456f594ae17409f1e1e70fc55485cd8 Mon Sep 17 00:00:00 2001 From: Marty Gloff Date: Tue, 8 Nov 2016 14:29:38 -0600 Subject: Bootloader - Error handling - Add terminate function As a first step to providing Bootloader error handling add support for a terminate function. Change-Id: Id4f8f130376d1396cd4feb796d1a3a908558225b RTC:135746 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/32390 Tested-by: Jenkins Server Tested-by: Jenkins OP Build CI Tested-by: FSP CI Jenkins Reviewed-by: Christian R. Geddes Reviewed-by: Corey V. Swenson Reviewed-by: Daniel M. Crowell --- src/kernel/terminate.C | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) (limited to 'src/kernel') diff --git a/src/kernel/terminate.C b/src/kernel/terminate.C index e657feb83..dd908b4e7 100644 --- a/src/kernel/terminate.C +++ b/src/kernel/terminate.C @@ -5,7 +5,9 @@ /* */ /* OpenPOWER HostBoot Project */ /* */ -/* COPYRIGHT International Business Machines Corp. 2012,2014 */ +/* Contributors Listed Below - COPYRIGHT 2012,2016 */ +/* [+] International Business Machines Corp. */ +/* */ /* */ /* Licensed under the Apache License, Version 2.0 (the "License"); */ /* you may not use this file except in compliance with the License. */ @@ -24,12 +26,14 @@ #include #include #include +#ifndef bl_terminate_C #include #include #include #include #include +#endif // bl_terminate_C extern "C" void p8_force_attn() NO_RETURN; @@ -37,11 +41,15 @@ extern "C" void p8_force_attn() NO_RETURN; /* Instance of the TI Data Area */ HB_TI_DataArea kernel_TIDataArea; -/* Instance of the HB desriptor struct */ +/* Instance of the HB descriptor struct */ HB_Descriptor kernel_hbDescriptor = { &kernel_TIDataArea, +#ifndef bl_terminate_C &KernelIpc::ipc_data_area, +#else + NULL, +#endif // bl_terminate_C 0 }; @@ -72,7 +80,18 @@ void termWriteSRC(uint16_t i_source, uint16_t i_reasoncode,uint64_t i_failAddr) kernel_TIDataArea.src.reasoncode = i_reasoncode; kernel_TIDataArea.src.moduleID = 0; kernel_TIDataArea.src.iType = TI_WITH_SRC; + kernel_TIDataArea.src.iSource = i_source; // Update User Data with address of fail location kernel_TIDataArea.src.word6 = i_failAddr; } + +void termModifySRC(uint8_t i_moduleID, uint32_t i_word7, uint32_t i_word8) +{ + // Update module ID + kernel_TIDataArea.src.moduleID = i_moduleID; + + // Update User Data with anything supplied for word7 or word8 + kernel_TIDataArea.src.word7 = i_word7; + kernel_TIDataArea.src.word8 = i_word8; +} -- cgit v1.2.3