summaryrefslogtreecommitdiffstats
path: root/src/usr/sbeio/sbe_fifo_buffer.C
diff options
context:
space:
mode:
authorMarty Gloff <mgloff@us.ibm.com>2017-08-07 09:26:09 -0500
committerDaniel M. Crowell <dcrowell@us.ibm.com>2017-08-27 12:36:09 -0400
commit6442a89776eb751ed923c157c7b04e2b6941adb1 (patch)
tree812f17223aa58a1d9d18b206a1a86b486f915fe8 /src/usr/sbeio/sbe_fifo_buffer.C
parente103f5b112f2b705db2c1691842dfd3dedecd06a (diff)
downloadtalos-hostboot-6442a89776eb751ed923c157c7b04e2b6941adb1.tar.gz
talos-hostboot-6442a89776eb751ed923c157c7b04e2b6941adb1.zip
Implement getSbeFfdc FIFO request
Add support for sending getSbeFfdc FIFO requests to SBE and add a test case for the getSbeFfdc request. Change-Id: I19dbbd92cb2d25679218528d199cfbd09fd9f995 RTC: 178022 Reviewed-on: http://ralgit01.raleigh.ibm.com/gerrit1/44288 Tested-by: Jenkins Server <pfd-jenkins+hostboot@us.ibm.com> Tested-by: Jenkins OP Build CI <op-jenkins+hostboot@us.ibm.com> Reviewed-by: Nicholas E. Bofferding <bofferdn@us.ibm.com> Tested-by: FSP CI Jenkins <fsp-CI-jenkins+hostboot@us.ibm.com> Reviewed-by: Christian R. Geddes <crgeddes@us.ibm.com> Tested-by: Jenkins OP HW <op-hw-jenkins+hostboot@us.ibm.com> Reviewed-by: Daniel M. Crowell <dcrowell@us.ibm.com>
Diffstat (limited to 'src/usr/sbeio/sbe_fifo_buffer.C')
-rw-r--r--src/usr/sbeio/sbe_fifo_buffer.C37
1 files changed, 27 insertions, 10 deletions
diff --git a/src/usr/sbeio/sbe_fifo_buffer.C b/src/usr/sbeio/sbe_fifo_buffer.C
index c6a9914a1..77ede07c0 100644
--- a/src/usr/sbeio/sbe_fifo_buffer.C
+++ b/src/usr/sbeio/sbe_fifo_buffer.C
@@ -51,12 +51,14 @@ const char* SbeFifoRespBuffer::cv_stateStrings[] = {
//-------------------------------------------------------------------------
SbeFifoRespBuffer::SbeFifoRespBuffer(uint32_t* i_fifoBuffer,
- size_t bufferWordSize):
+ size_t bufferWordSize,
+ bool i_getSbeFfdcFmt):
iv_callerBufferPtr(i_fifoBuffer),
iv_callerWordSize(
std::min(bufferWordSize,
MSG_BUFFER_SIZE)
- )
+ ),
+ iv_getSbeFfdcFmt(i_getSbeFfdcFmt)
{
do
{
@@ -127,8 +129,9 @@ void SbeFifoRespBuffer::completeMessage()
if(iv_index < (STATUS_WORD_SIZE + 2))
{
SBE_TRACF(ERR_MRK"SbeFifoRespBuffer::completeMessage: "
- "Complete call caused short read."
- );
+ "Complete call caused short read. (%d < %d)",
+ iv_index,
+ STATUS_WORD_SIZE + 2);
iv_state = MSG_SHORT_READ;
break;
}
@@ -143,8 +146,10 @@ void SbeFifoRespBuffer::completeMessage()
{
//offset is to large - would go before the buffer.
SBE_TRACF(ERR_MRK"SbeFifoRespBuffer::completeMessage: "
- "The offset to the StatusHeader is too large."
- );
+ "The offset to the StatusHeader is too large. "
+ "(%d > %d)",
+ iv_localMsgBuffer[iv_offsetIndex] - 1,
+ iv_offsetIndex);
iv_state = MSG_INVALID_OFFSET;
break;
}
@@ -153,8 +158,10 @@ void SbeFifoRespBuffer::completeMessage()
{
//Minimum offset (no ffdc) is StatusHeader size + 1
SBE_TRACF(ERR_MRK"SbeFifoRespBuffer::completeMessage: "
- "The offset to the StatusHeader is too small."
- );
+ "The offset to the StatusHeader is too small. "
+ "(%d < %d)",
+ iv_localMsgBuffer[iv_offsetIndex],
+ STATUS_WORD_SIZE + 1);
iv_state = MSG_INVALID_OFFSET;
break;
}
@@ -163,11 +170,21 @@ void SbeFifoRespBuffer::completeMessage()
iv_statusIndex = iv_offsetIndex -
(iv_localMsgBuffer[iv_offsetIndex] - 1);
- //Determine if there is FFDC data in the buffer. We do this by
+ //Determine if there is FFDC data in the buffer. We check if the
+ //buffer contains a get SBE FFDC response. If so, the FFDC is at the
+ //start of the buffer in the return data. Otherwise, we do this by
//checking that the index after the status header is less than the
//offset index. If the offset index immediately follows the status
//header then there is no FFDC in the header.
- if((iv_statusIndex + STATUS_WORD_SIZE) < iv_offsetIndex)
+ if(iv_getSbeFfdcFmt)
+ {
+ iv_ffdcIndex = 0;
+ iv_ffdcSize = iv_statusIndex;
+ assert( iv_localMsgBuffer[iv_offsetIndex] ==
+ (STATUS_WORD_SIZE + 1),
+ "Offset to status header is not 3");
+ }
+ else if((iv_statusIndex + STATUS_WORD_SIZE) < iv_offsetIndex)
{
iv_ffdcIndex = iv_statusIndex + STATUS_WORD_SIZE;
iv_ffdcSize = (iv_offsetIndex - iv_ffdcIndex);
OpenPOWER on IntegriCloud