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
|
/* IBM_PROLOG_BEGIN_TAG */
/* This is an automatically generated prolog. */
/* */
/* $Source: src/usr/isteps/istep18/TodSvcUtil.H $ */
/* */
/* 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 TodSvcUtil.H
*
* @brief This file declares the various utility methods
*
* HWP_IGNORE_VERSION_CHECK
*
*/
#ifndef TODSVCUTIL_H
#define TODSVCUTIL_H
#include <errl/errlentry.H>
#include <ecmddatabuffer/ecmdDataBufferBase.H>
namespace TOD
{
/**
* @brief Method to create an errlHndl_t object for
* TOD_INVALID_CONFIG error
*
* @par Detailed Description:
* This will be logged if during the course of TOD operation an
* anomaly was found with the topology configuration or
* its related data.
*
* @param[in] i_config
* The problematic configuration Primary/Secondary
*
* @param[out] io_errHdl
* On input this parameter will be either NULL or pointing to
* an existing error handle.
* On output this parameter will either have a newly created handle
* assigned to it ( If input parameter was NULL ) or a new SRC will be
* appened to existing error handle ( If the input was not NULL )
* @return NA
*/
void logInvalidTodConfig(const uint32_t i_config,
errlHndl_t& io_errHdl);
/**
* @brief Method to create an errlHndl_t object for
* TOD_UNSUPPORTED_ORDINALID
*
* @par Detailed Description:
* The ordinal Id's of TOD procs should fall within the range of 0
* <= Ordinal Id < getMaxProcsOnSystem.
* getMaxProcsOnSystem defines static count of the array of
* hwsvTodChipData structures that will be written in the file
* shared between HWSV and HDAT.
* Each hwsvTodChipData structure contains TOD chip register data
* for a specific chip.
* This error will be logged if at any point of time because of
* changes in system configuration the no. of proc chips becomes
* equal to or more than getMaxProcsOnSystem, and corresponding
* support still does not exist in TOD code and HDAT
*
* @param[in] i_ordId
* The ordinal Id that was found to be unsupported
*
* @param[out] io_errHdl
* On input this parameter will be either NULL or pointing to
* an existing error handle.
* On output this parameter will either have a newly created handle
* assigned to it ( If input parameter was NULL ) or a new SRC will be
* appened to existing error handle ( If the input was not NULL )
* @return NA
*
*/
void logUnsupportedOrdinalId(const uint32_t i_ordId,
errlHndl_t& io_errHdl);
/**
*
* @brief This method finds out the maximum number of proc chips that are
* possible on fully configured system of this type
*
* @return Count of procs
* The method should succeed always
*/
uint32_t getMaxProcsOnSystem();
/**
*
* @brief This method finds out the maximum number of cores that is
* possible per proc for fully configured system of this type
*
* @return Count of cores
* The method should succeed always
*/
uint32_t getMaxPossibleCoresPerProc();
/**
* @brief This method read the scom register
*
* @param[in] i_target : target object
* @param[in] i_address : SCOM register address
*
* @param[out] o_data : content of the register if no error
*
* @return errlHndl_t : NULL if ok. Otherwise, there is an error
*/
errlHndl_t todGetScom(const TARGETING::Target * i_target,
const uint64_t i_address,
ecmdDataBufferBase & o_data);
/**
*
* @brief This method will get the list of functional node target
* pointers for the supplied target that can be a node or system
* type.
*
* @par Detailed Description:
* If the input target is a system level target then target
* pointers for all the functional nodes in system will be
* collected.
* If the target sent is of node type then the method will simply
* push back the target that has been passed as argument, provided
* it is functional
*
* @param[in] i_pInputTarget
* Target sent as input to this method
*
* @param[out] o_functionalNodeTargetList
* List of functional node targets collected by the method
* @return Error log handle to carry back status of request
* @retval !NULL Indicates an error in collecting the node target.This
* can happen if input target is neither of system/node
* type. In error case o_functionalNodeTargetList will be empty.
* @retval NULL Indicates that there was no error in getting the targets.
*/
errlHndl_t getFuncNodeTargetsOnSystem(const TARGETING::Target * i_target,
TARGETING::TargetHandleList& o_functionalNodeTargetList);
} //End of namespace TOD
#endif
|