summaryrefslogtreecommitdiffstats
path: root/src/usr/diag/prdf/plat/prdfRasServices.C
blob: 6d276bfb6d5e4901462ba5896527e67df2daf160 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
/* IBM_PROLOG_BEGIN_TAG                                                   */
/* This is an automatically generated prolog.                             */
/*                                                                        */
/* $Source: src/usr/diag/prdf/plat/prdfRasServices.C $                    */
/*                                                                        */
/* OpenPOWER HostBoot Project                                             */
/*                                                                        */
/* Contributors Listed Below - COPYRIGHT 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.       */
/* You may obtain a copy of the License at                                */
/*                                                                        */
/*     http://www.apache.org/licenses/LICENSE-2.0                         */
/*                                                                        */
/* Unless required by applicable law or agreed to in writing, software    */
/* distributed under the License is distributed on an "AS IS" BASIS,      */
/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or        */
/* implied. See the License for the specific language governing           */
/* permissions and limitations under the License.                         */
/*                                                                        */
/* IBM_PROLOG_END_TAG                                                     */

/** @file  prdfRasServices.C
 *  @brief Utility code to parse an SDC and produce the appropriate error log.
 */

#include <prdfRasServices.H>
#include <prdfMfgSync.H>
#include <prdfErrlUtil.H>
#include <prdfPlatServices.H>

#include <initservice/initserviceif.H>

using namespace TARGETING;

namespace PRDF
{

using namespace PlatServices;

//------------------------------------------------------------------------------

void ErrDataService::MnfgTrace( ErrorSignature * i_esig,
                                const PfaData & i_pfaData )
{
    #define PRDF_FUNC "[ErrDataService::MnfgTrace] "

    do
    {
        // This is for Hostboot IPL and FSP machines only.
        #ifndef __HOSTBOOT_RUNTIME
        if ( !INITSERVICE::spBaseServicesEnabled() ) break;

        errlHndl_t errl = NULL;
        errl = getMfgSync().syncMfgTraceToFsp(i_esig, i_pfaData);
        if (errl)
        {
            PRDF_ERR(PRDF_FUNC "failed to sync to the FSP");
            PRDF_COMMIT_ERRL(errl, ERRL_ACTION_REPORT);
            break;
        }
        #endif

    } while(0);

    #undef PRDF_FUNC
}

//------------------------------------------------------------------------------

void ErrDataService::updateSrc( uint32_t i_user1, uint32_t i_user2,
                                uint32_t i_user3, uint32_t i_user4,
                                uint16_t i_rc )
{
    // We should always have a valid pointer here. If it is NULL, there
    // is some major issue.
    PRDF_ASSERT ( NULL != iv_errl);

    iv_errl->setReasonCode(i_rc);
    iv_errl->addUserData1( PRDF_GET_UINT64_FROM_UINT32( i_user1, i_user2 ));
    iv_errl->addUserData2( PRDF_GET_UINT64_FROM_UINT32( i_user3, i_user4 ));
}

//------------------------------------------------------------------------------

void ErrDataService::createInitialErrl( ATTENTION_TYPE i_attnType )
{
    // We should always have a NULL pointer here. If it is not NULL, there
    // is some major issue.
    PRDF_ASSERT ( NULL == iv_errl );
    using namespace ERRORLOG;

    iv_errl = new ErrlEntry(
                        ERRL_SEV_RECOVERED,
                        PRDF_RAS_SERVICES,
                        PRDF_CODE_FAIL, //ERRL keys off of ReasonCode to set
                                        //creator id.  ReasonCode will later be
                                        //changed to reflect the actual one
                        PRDF_GET_UINT64_FROM_UINT32( 0, 0 ),
                        PRDF_GET_UINT64_FROM_UINT32( 0, 0 ) );
}

//------------------------------------------------------------------------------


bool ErrDataService::checkForceTerm( const ServiceDataCollector & i_sdc,
                                     TargetHandle_t i_dumpTrgt,
                                     PfaData &io_pfaData )
{
    //Return false from HB
    return false;
}

//------------------------------------------------------------------------------

void ErrDataService::handleUnitCS( const ServiceDataCollector & i_sdc,
                                   TargetHandle_t i_unitCsTarget,
                                   bool & o_initiateHwudump)
{
    // No-op in Hostboot
    o_initiateHwudump = false; // default to not initiate hwudump
}

//------------------------------------------------------------------------------

void ErrDataService::handleChannelFail( TargetHandle_t i_memTarget )
{
    // No-op in Hostboot
}

//------------------------------------------------------------------------------

void ErrDataService::handleCoreUnitCS( TargetHandle_t i_exTarget,
                                       bool & o_initiateHwudump)
{
    // No-op in Hostboot
    o_initiateHwudump = false; // default to not initiate hwudump
}

//------------------------------------------------------------------------------

void ErrDataService::handleNxUnitCS( TargetHandle_t i_nxTarget )
{
    // No-op in Hostboot
}

//------------------------------------------------------------------------------

void ErrDataService::commitErrLog( errlHndl_t & io_errl,
                                   const PfaData & i_pfaData )

{
    errlCommit( io_errl, PRDF_COMP_ID );
    io_errl = NULL;
}

} // end namespace PRDF

OpenPOWER on IntegriCloud