summaryrefslogtreecommitdiffstats
path: root/src/usr/diag/prdf/common/framework/config/iipDomain.h
blob: d596222136a8550cc49d1c9eb3bc12df0b7e52c3 (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
/* IBM_PROLOG_BEGIN_TAG                                                   */
/* This is an automatically generated prolog.                             */
/*                                                                        */
/* $Source: src/usr/diag/prdf/common/framework/config/iipDomain.h $       */
/*                                                                        */
/* OpenPOWER HostBoot Project                                             */
/*                                                                        */
/* COPYRIGHT International Business Machines Corp. 1996,2014              */
/*                                                                        */
/* 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                                                     */

#ifndef iipDomain_h
#define iipDomain_h


#include <iipconst.h>    // Include file for DOMAIN_ID's
#include <iipchip.h>     // @jl02
#ifndef IIPSDBUG_H
#include <iipsdbug.h>    // Include file for ATTENTION_TYPE
#endif

namespace PRDF
{

// Forward References
struct STEP_CODE_DATA_STRUCT;

/*!
 Domain class provides error analysis of a specific domain of a hardware system

 Usage Examples:
 @code
   // during PrdInitialize()
   Domain * domain = new DerivedDomain(id,...);
   int32_t rc=domain->Initialize(); // Perform domain dependent hardware init

   // During PRD Analyze: called from System_Class
   if (domain->Query())                // Query for domain at attention
   {
   // Analyze the attention
   int32_t rc=domain->Analyze(service_data,System_attention_type);
   }

   DOMAIN_ID id = domain->GetId();        - Get the current domains id.
 @endcode
 */
class Domain
{
public:

  /**
   Contructor
   @param domain_id   Id of this domain. See iipconst.h
   */
  Domain(DOMAIN_ID domain_id);

  /**
   Destructor
   @note Default does nothing - must be virtual for derived classes
   */
  virtual ~Domain(void);

  /**
   Initialize domain specific hardware as needed
   @return MOPS error code or @c prd_return_code_t
   */
  virtual int32_t Initialize(void);

  /**
   Remove domain specific hardware as needed
   @return MOPS error code or @c prd_return_code_t
   */
  virtual void Remove(TARGETING::TargetHandle_t);

  /**
   Query - if any sub components have attention matching attentionType
   @param attentionType  see iipsdbug.h for values
   @return true|false
   @pre this->Initialize() must be called
   */
  virtual bool Query(ATTENTION_TYPE attentionType) = 0;

  /**
   Analzye this domain
   @param attentionType to analyze
   @return Mops return code | @c prd_return_code_t
   @return serviceData
   @pre this->Query() == true
   @post serviceData valid
   */
  virtual int32_t Analyze(STEP_CODE_DATA_STRUCT & serviceData,
                          ATTENTION_TYPE attentionType) = 0;

  /**
   Access the ID of this domain
   @return @c DOMAIN_ID  See iipconst.h
   */
  DOMAIN_ID GetId(void) const { return(dom_id); }

protected:

  /**
   Prioritize the components of this domain for Analysis
   @param ATTENTION_TYPE [MACHINE_CHECK, RECOVERABLE, SPECIAL]
   @post Domain prepared for Analysis
   @note Default is do nothing
   */
  virtual void Order(ATTENTION_TYPE attentionType) = 0;

private:

  DOMAIN_ID     dom_id;

};

} // end namespace PRDF

#endif
OpenPOWER on IntegriCloud