summaryrefslogtreecommitdiffstats
path: root/src/usr/hwas/hwasPlatCallout.C
blob: 3cae206a4b503404466ca0dedc80b37d08e0298a (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
/* IBM_PROLOG_BEGIN_TAG                                                   */
/* This is an automatically generated prolog.                             */
/*                                                                        */
/* $Source: src/usr/hwas/hwasPlatCallout.C $                              */
/*                                                                        */
/* IBM CONFIDENTIAL                                                       */
/*                                                                        */
/* COPYRIGHT International Business Machines Corp. 2013                   */
/*                                                                        */
/* p1                                                                     */
/*                                                                        */
/* Object Code Only (OCO) source materials                                */
/* Licensed Internal Code Source Materials                                */
/* IBM HostBoot Licensed Internal Code                                    */
/*                                                                        */
/* The source code for this program is not published or otherwise         */
/* divested of its trade secrets, irrespective of what has been           */
/* deposited with the U.S. Copyright Office.                              */
/*                                                                        */
/* Origin: 30                                                             */
/*                                                                        */
/* IBM_PROLOG_END_TAG                                                     */
/**
 *  @file hwasPlatCallout.C
 *
 *  @brief Platform Callout specific functions
 */

#include <hwas/common/hwas.H>
#include <hwas/common/hwasCommon.H>
#include <hwas/common/hwasCallout.H>
#include <hwas/common/deconfigGard.H>
#include <initservice/initserviceif.H>

namespace HWAS
{

//******************************************************************************
// platHandleProcedureCallout
//******************************************************************************
errlHndl_t platHandleProcedureCallout(
        errlHndl_t i_errl,
        epubProcedureID i_procedure,
        callOutPriority i_priority)
{
    errlHndl_t errl = NULL;

    // hostboot does not handle or do any action for procedure callouts
    return errl;
}

//******************************************************************************
// platHandleHWCallout
//******************************************************************************
errlHndl_t platHandleHWCallout(
        TARGETING::Target *i_pTarget,
        callOutPriority i_priority,
        DeconfigEnum    i_deconfigState,
        errlHndl_t i_errl,
        GARD_ErrorType  i_gardErrorType)
{
    errlHndl_t errl = NULL;

    HWAS_INF("HW callout; pTarget %p gardErrorType %x deconfigState %x",
            i_pTarget, i_gardErrorType, i_deconfigState);
    switch (i_gardErrorType)
    {
        case (GARD_NULL):
        {   // means no GARD operations
            break;
        }
        default:
        {
            errl = HWAS::theDeconfigGard().createGardRecord(*i_pTarget,
                    i_errl->plid(),
                    i_gardErrorType);
            break;
        }
    } // switch i_gardErrorType

    switch (i_deconfigState)
    {
        case (NO_DECONFIG):
        {
            break;
        }
        case (DECONFIG):
        {
            // call HWAS common function
            errl = HWAS::theDeconfigGard().deconfigureTarget(*i_pTarget,
                        i_errl->plid());
            break;
        }
        case (DELAYED_DECONFIG):
        {
            // do nothing -- the deconfig information was already
            // put on a queue and will be processed separately,
            // when the time is right.
            break;
        }
    } // switch i_deconfigState

    // check to see if this target is the master processor
    //  and if it's been deconfigured.
    TARGETING::Target *l_masterProc;
    TARGETING::targetService().masterProcChipTargetHandle(l_masterProc);
    if (i_pTarget == l_masterProc)
    {
        const TARGETING::HwasState hwasState =
                l_masterProc->getAttr<TARGETING::ATTR_HWAS_STATE>();
        if (!hwasState.functional)
        {
            HWAS_ERR("master proc deconfigured - Shutdown due to plid 0x%X",
                    i_errl->plid());
            INITSERVICE::doShutdown(i_errl->plid());
        }
    }

    return errl;
}

//******************************************************************************
// platHandleBusCallout
//******************************************************************************
errlHndl_t platHandleBusCallout(
        TARGETING::Target *i_pTarget1,
        TARGETING::Target *i_pTarget2,
        busTypeEnum i_busType,
        callOutPriority i_priority,
        errlHndl_t i_errl)
{
    errlHndl_t errl = NULL;

    // hostboot does not handle or do any action for bus callouts
    return errl;
}

} // namespace HWAS
OpenPOWER on IntegriCloud