summaryrefslogtreecommitdiffstats
path: root/src/usr/diag/prdf/test/prdfsimMfgSync.C
blob: 9a5a98ff0472f0bf98337a290ced2d173d86eadf (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
/* IBM_PROLOG_BEGIN_TAG                                                   */
/* This is an automatically generated prolog.                             */
/*                                                                        */
/* $Source: src/usr/diag/prdf/test/prdfsimMfgSync.C $                     */
/*                                                                        */
/* OpenPOWER HostBoot Project                                             */
/*                                                                        */
/* Contributors Listed Below - COPYRIGHT 2014,2015                        */
/* [+] 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                                                     */

#include <prdfsimMfgSync.H>
#include <prdfsimFspSyncSvc.H>
#include <prdfMfgThresholdMgr.H>
#include <prdfEnums.H>

namespace PRDF
{

SimMfgSync& getSimMfgSync()
{
    return PRDF_GET_SINGLETON(theSimMfgSync);
}

SimMfgSync::SimMfgSync(): MfgSync()
{
    #define FUNC "[SimMfgSync::SimMfgSync]"
    PRDF_TRAC( FUNC );
    iv_mailBoxStatus = false;
    #undef FUNC
}

SimMfgSync::~SimMfgSync()
{
    #define FUNC "[SimMfgSync::~SimMfgSync]"
    PRDF_TRAC( FUNC );
    #undef FUNC
}

errlHndl_t SimMfgSync::syncMfgTraceToFsp(ErrorSignature *i_esig,
                                         const PfaData  &i_pfaData)
{
    #define PRDF_FUNC "[SimMfgSync::syncMfgTraceToFsp]"
    PRDF_ENTER( PRDF_FUNC );

    errlHndl_t l_err = NULL;

    do
    {
        l_err = MfgSync::syncMfgTraceToFsp(i_esig, i_pfaData);

        if(NULL != l_err)
        {
            PRDF_TRAC( PRDF_FUNC " syncMfgTraceToFsp failed" );
        }

    } while(0);


    PRDF_EXIT( PRDF_FUNC );

    return l_err;
    #undef PRDF_FUNC
}

errlHndl_t SimMfgSync::sendMboxMsg( msg_t * i_msg, bool i_expectResponse )
{
    #define FUNC "[SimMfgSync::sendMboxMsg]"
    PRDF_ENTER( FUNC );
    errlHndl_t l_errl = NULL;

    // send a sync message
    PRDF_TRAC(FUNC " sending sync mbox msg" );
    PRDF_TRAC( "type:  0x%04x", i_msg->type );
    PRDF_TRAC( "data0: 0x%016llx", i_msg->data[0] );
    PRDF_TRAC( "data1: 0x%016llx", i_msg->data[1] );
    PRDF_TRAC( "extra_data: %p", i_msg->extra_data );

    // call sim SyncService to handle the request
    getSyncSvc().processRequestMsg(i_msg);

    PRDF_EXIT( FUNC );

    return l_errl;

    #undef FUNC
}

void SimMfgSync::setMailBoxStatus(bool i_status)
{
     iv_mailBoxStatus = i_status;
}

bool SimMfgSync::isMailboxEnabled()
{
    return iv_mailBoxStatus;
}

} // end namespace PRDF

OpenPOWER on IntegriCloud