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
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
|
/* IBM_PROLOG_BEGIN_TAG */
/* This is an automatically generated prolog. */
/* */
/* $Source: src/usr/diag/prdf/common/framework/service/xspprdsdbug.C $ */
/* */
/* IBM CONFIDENTIAL */
/* */
/* COPYRIGHT International Business Machines Corp. 2000,2012 */
/* */
/* 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 */
// Module Description **************************************************
//
// Description: definition of iipsdbug.h (SYSTEM_DEBUG_CLASS) for regatta
// PRD wrapper of sysdebug
//
// End Module Description **********************************************
//----------------------------------------------------------------------
// Includes
//----------------------------------------------------------------------
#define xspprdsdbug_C
#ifndef __HOSTBOOT_MODULE
#include <fcntl.h> // for O_RDONLY O_WRONLY etc..
#include <unistd.h> // for ::read() ::write()
#include <utilreg.H>
#endif
#include <string.h> // for memcpy
#include <errlentry.H>
#include <prdfMain.H>
#include <iipstep.h>
#include <iipServiceDataCollector.h>
#include <iipsdbug.h>
#include <iipglobl.h>
#include <prdf_service_codes.H>
#include <prdfBitString.H>
#include <prdfPlatServices.H>
#undef xspprdsdbug_C
namespace PRDF
{
//----------------------------------------------------------------------
// User Types
//----------------------------------------------------------------------
//----------------------------------------------------------------------
// Constants
//----------------------------------------------------------------------
//----------------------------------------------------------------------
// Macros
//----------------------------------------------------------------------
//----------------------------------------------------------------------
// Internal Function Prototypes
//----------------------------------------------------------------------
//----------------------------------------------------------------------
// Global Variables
//----------------------------------------------------------------------
AttnList g_AttnDataList;
bool g_init_done = false;
uint32_t * g_src = NULL;
//---------------------------------------------------------------------
// Member Function Specifications
//---------------------------------------------------------------------
SYSTEM_DEBUG_CLASS::SYSTEM_DEBUG_CLASS(void)
{
}
uint32_t SYSTEM_DEBUG_CLASS::Reinitialize(const AttnList & i_attnList)
{
uint32_t l_rc = 0;
do
{
if ( i_attnList.empty() )
{
PRDF_ERR( "SYSTEM_DEBUG_CLASS::Reinitialize() input AttnList is "
"empty" );
/*@
* @errortype
* @subsys EPUB_FIRMWARE_SP
* @reasoncode PRDF_CODE_FAIL
* @moduleid PRDF_SDBUG_INIT
* @userdata1 0
* @userdata2 0
* @userdata3 0
* @userdata4 0
* @devdesc input AttnList is empty.
* @procedure EPUB_PRC_SP_CODE
*/
PRDF_CREATE_ERRL( g_prd_errlHndl,
ERRL_SEV_DIAGNOSTIC_ERROR1, // error on diagnostic
ERRL_ETYPE_NOT_APPLICABLE,
SRCI_MACH_CHECK,
SRCI_NO_ATTR,
PRDF_SDBUG_INIT, // module id
FSP_DEFAULT_REFCODE,
PRDF_CODE_FAIL, // Reason code
0, // user data word 1
0, // user data word 2
0, // user data word 3
0 ); // user data word 4
PRDF_ADD_PROCEDURE_CALLOUT( g_prd_errlHndl, SRCI_PRIORITY_MED,
EPUB_PRC_SP_CODE );
l_rc = PRD_ATTN_DATA_ACCESS_FAILED;
break;
}
g_AttnDataList = i_attnList;
g_init_done = true;
} while(0);
return l_rc;
}
// --------------------------------------------------------------------
bool SYSTEM_DEBUG_CLASS::IsAttentionActive( TARGETING::TargetHandle_t i_pChipHandle ) const
{
bool rc = false;
for(AttnList::const_iterator i = g_AttnDataList.begin(); i != g_AttnDataList.end(); ++i)
{
if((*i).targetHndl == i_pChipHandle)
{
rc = true;
break;
}
}
return rc;
}
void SYSTEM_DEBUG_CLASS::Clear(void)
{
g_AttnDataList.clear();
}
// -------------------------------------------------------------------
uint8_t SYSTEM_DEBUG_CLASS::GetAttentionType(TARGETING::TargetHandle_t i_pChipHandle) const
{
uint8_t type = INVALID_ATTENTION_TYPE;
for(AttnList::const_iterator i = g_AttnDataList.begin(); i != g_AttnDataList.end(); ++i)
{
if((*i).targetHndl == i_pChipHandle)
{
type = (uint8_t) (*i).attnType;
break;
}
}
return (uint8_t) type;
}
// -------------------------------------------------------------------
void SYSTEM_DEBUG_CLASS::SetPrdSrcPointer()
{
g_src = NULL;
}
void SYSTEM_DEBUG_CLASS::SetPrdSrcPointer(uint32_t* src_ptr)
{
g_src = src_ptr;
}
// -------------------------------------------------------------------
void SYSTEM_DEBUG_CLASS::CalloutThoseAtAttention(STEP_CODE_DATA_STRUCT & serviceData) const
{
ServiceDataCollector * sdc = serviceData.service_data;
CaptureData & capture = sdc->GetCaptureData();
for(AttnList::const_iterator i = g_AttnDataList.begin(); i != g_AttnDataList.end(); ++i)
{
sdc->SetCallout((*i).targetHndl);
AttnData ad(*i);
BitString cbs(sizeof(AttnData)*8,(CPU_WORD *)&ad);
capture.Add(PlatServices::getSystemTarget(),0,cbs);
}
sdc->SetCallout(NextLevelSupport_ENUM);
}
// --------------------------------------------------------------------
// SIMULATION SUPPORT for setting up sysdbug
// --------------------------------------------------------------------
const uint32_t *SYSTEM_DEBUG_CLASS::GetPrdSrcPointer(void) const
{
return g_src;
}
void SYSTEM_DEBUG_CLASS::SetAttentionType(TARGETING::TargetHandle_t i_pTargetHandle,
ATTENTION_VALUE_TYPE i_eAttnType)
{
if(i_eAttnType > INVALID_ATTENTION_TYPE)
{
if(!IsAttentionActive(i_pTargetHandle))
{
AttnData attnData;
attnData.targetHndl = i_pTargetHandle;
attnData.attnType = i_eAttnType;
g_AttnDataList.push_back(attnData);
}
}
}
} // end namespace PRDF
|