summaryrefslogtreecommitdiffstats
path: root/src/usr/hwas/hwasPlatCallout.C
blob: 10d84e87720eb540d0b8f676caffe8b8d5c14888 (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
/* 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>

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):
        {
            // check to see if this target is the master processor
            TARGETING::Target *l_masterProc;
            TARGETING::targetService().masterProcChipTargetHandle(
                        l_masterProc);
            if (i_pTarget == l_masterProc)
            {
                // if so, we can't run anymore, so we will
                //  call HWAS to deconfigure, forcing the issue now.
                // TODO: RTC: 45781
                HWAS_ERR("callout - DELAYED_DECONFIG on MasterProc");
                errl = HWAS::theDeconfigGard().deconfigureTarget(*i_pTarget,
                        i_errl->plid());
                break;
            }
            // else
            // 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
    return errl;
}

} // namespace HWAS
OpenPOWER on IntegriCloud