summaryrefslogtreecommitdiffstats
path: root/src/usr/diag/attn/attnbits.H
blob: a9989b1af29f2d67860b6c26ce67692790cebb44 (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
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
/* IBM_PROLOG_BEGIN_TAG                                                   */
/* This is an automatically generated prolog.                             */
/*                                                                        */
/* $Source: src/usr/diag/attn/attnbits.H $                                */
/*                                                                        */
/* IBM CONFIDENTIAL                                                       */
/*                                                                        */
/* COPYRIGHT International Business Machines Corp. 2012,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                                                     */
#ifndef ATTN_ATTNBITS_H
#define ATTN_ATTNBITS_H

/**
 * @file attnbits.H
 *
 * @brief Utility functions and types provided by the attnbits module.
 */

namespace ATTN
{
namespace IPOLL
{

/**
 * @brief address IPOLL mask register SCOM address.
 */
extern const uint64_t address;

/**
 * @brief getCheckbits Obtain the associated mask bit(s) in the ipoll
 *                     mask register.
 *
 * @param[in] i_type The attention type for which to obtain the mask bit(s).
 * @param[out] o_bits The mask bits associated with the attention type.
 *
 * @retval[true] Bits found for supplied attention type.
 * @retval[false] No bits found for supplied attention type.
 */
bool getCheckbits(
        uint64_t i_type,
        uint64_t & o_bits);

/**
 * @brief forEach Call a function for each masked attention type
 *                 in the ipoll mask register.
 *
 * @param[in] i_scomData The register content to decode.
 * @param[in] i_data User pointer.
 * @param[in] i_func User function.
 */
void forEach(
        uint64_t i_scomData,
        void * i_data,
        void (*i_func)(uint64_t, void *));
}

namespace GFIR
{

/**
 * @brief getAddress Get the GFir address for the given attention type.
 *
 * @param[in] i_type The type for which to obtain the address.
 * @param[out] o_address The address associated with the attention type.
 *
 * @retval[false] No address found for the supplied attention type.
 * @retval[true] Address found for the supplied attention type.
 */
bool getAddress(
        uint64_t i_type,
        uint64_t & o_address);

/**
 * @brief getCheckbits Obtain the associated bits for the given
 *                               attention type.
 *
 * @param[in] i_type The attention type for which to obtain the bits.
 * @param[out] o_bits The bits associated with the attention type.
 *
 * @retval[false] No bits found for the supplied attention type.
 * @retval[true] Bits found for the supplied attention type.
 */
bool getCheckbits(
        uint64_t i_type,
        uint64_t & o_bits);
}

namespace MCI
{

/**
 * @brief address MCI FIR register SCOM address.
 */
extern const uint64_t address;

/**
 * @brief getCheckbits Obtain the associated mask bit(s) in the MCI Fir.
 *
 * @param[in] i_type The attention type for which to obtain the mask bit(s).
 * @param[out] o_bits The mask bits associated with the attention type.
 *
 * @retval[true] Bits found for supplied attention type.
 * @retval[false] No bits found for supplied attention type.
 */
bool getCheckbits(
        uint64_t i_type,
        uint64_t & o_bits);

/**
 * @brief forEach Call a function for each membuf attention
 *          type reported by the MCI FIR.
 *
 * @param[in] i_scomData The register content to decode.
 * @param[in] i_data User pointer.
 * @param[in] i_func User function.
 */
void forEach(
        uint64_t i_scomData,
        void * i_data,
        void (*i_func)(uint64_t, void *));
}

namespace GP1
{

/**
 * @brief address GP1 nest register SCOM address.
 */
extern const uint64_t address;

/**
 * @brief forEach Call a function for each MCS position reporting
 *                  an attention.
 *
 * @param[in] i_scomData The register content to decode.
 * @param[in] i_data User pointer.
 * @param[in] i_func User function.
 */
void forEach(
        uint64_t i_scomData,
        void * i_data,
        void (*i_func)(uint64_t, void *));

/**
 * @brief getCheckbits Obtain the associated mask bit(s) in the GP1 nest
 *        register.
 *
 * @param[in] i_pos The MCS position for which to obtain the mask bit(s).
 * @param[out] o_bits The mask bits associated with the MCS position.
 *
 * @retval[true] Bits found for supplied MCS position.
 * @retval[false] No bits found for supplied MCS position.
 */
bool getCheckbits(
        uint64_t i_pos,
        uint64_t & o_bits);
}

/**
 * @brief Interrupt config related constants
 */
enum
{
    INTR_TYPE_LCL_ERR_STATUS_AND_REG = 0x01020002,
    INTR_TYPE_MASK_OR_REG      = 0x0102000d,
    INTR_TYPE_MASK_AND_REG     = 0x0102000e,
    INTR_TYPE_CONFIG_AND_REG   = 0x01020011,
    GP2_REG                    = 0x02000002,
    IPOLL_STATUS_REG           = 0x01020014,
};
}
#endif
OpenPOWER on IntegriCloud