Zane Shelley | fd3f9cc | 2019-07-29 15:02:24 -0500 | [diff] [blame] | 1 | /* IBM_PROLOG_BEGIN_TAG */ |
| 2 | /* This is an automatically generated prolog. */ |
| 3 | /* */ |
| 4 | /* $Source: src/usr/diag/prdf/common/framework/register/iipMopRegisterAccess.h $ */ |
| 5 | /* */ |
| 6 | /* OpenPOWER HostBoot Project */ |
| 7 | /* */ |
| 8 | /* Contributors Listed Below - COPYRIGHT 2012,2017 */ |
| 9 | /* [+] International Business Machines Corp. */ |
| 10 | /* */ |
| 11 | /* */ |
| 12 | /* Licensed under the Apache License, Version 2.0 (the "License"); */ |
| 13 | /* you may not use this file except in compliance with the License. */ |
| 14 | /* You may obtain a copy of the License at */ |
| 15 | /* */ |
| 16 | /* http://www.apache.org/licenses/LICENSE-2.0 */ |
| 17 | /* */ |
| 18 | /* Unless required by applicable law or agreed to in writing, software */ |
| 19 | /* distributed under the License is distributed on an "AS IS" BASIS, */ |
| 20 | /* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or */ |
| 21 | /* implied. See the License for the specific language governing */ |
| 22 | /* permissions and limitations under the License. */ |
| 23 | /* */ |
| 24 | /* IBM_PROLOG_END_TAG */ |
| 25 | |
| 26 | #ifndef iipMopRegisterAccess_h |
| 27 | #define iipMopRegisterAccess_h |
| 28 | |
| 29 | // Class Specification ************************************************* |
| 30 | // |
| 31 | // Class name: MopRegisterAccess |
| 32 | // Parent class: None. |
| 33 | // |
| 34 | // Summary: This class provides access to hardware register via |
| 35 | // a MOP routine. A single pure virtual function Access() |
| 36 | // is declared for this purpose. |
| 37 | // |
| 38 | // Cardinality: 0 |
| 39 | // |
| 40 | // Performance/Implementation: |
| 41 | // Space Complexity: Constant |
| 42 | // Time Complexity: All member functions constant unless otherwise |
| 43 | // stated. |
| 44 | // |
| 45 | // Usage Examples: |
| 46 | // |
| 47 | // |
| 48 | // void foo(MopRegisterAccess & mra) |
| 49 | // { |
| 50 | // BitStringBuffer bitString(80); // 80 bits |
| 51 | // |
| 52 | // mra.Access(bitString, READ); |
| 53 | // ... |
| 54 | // |
| 55 | // } |
| 56 | // |
| 57 | // |
| 58 | // End Class Specification ********************************************* |
| 59 | |
| 60 | // Includes |
| 61 | #if !defined(IIPCONST_H) |
| 62 | #include <iipconst.h> |
| 63 | #endif |
| 64 | #include <prdfPlatServices.H> |
| 65 | |
| 66 | namespace PRDF |
| 67 | { |
| 68 | // Forward References |
| 69 | class BitString; |
| 70 | |
| 71 | class MopRegisterAccess |
| 72 | { |
| 73 | public: |
| 74 | |
| 75 | enum Operation |
| 76 | { |
| 77 | READ = 0, |
| 78 | WRITE = 1 |
| 79 | }; |
| 80 | |
| 81 | // MopRegisterAccess(void); |
| 82 | // Function Specification ******************************************** |
| 83 | // |
| 84 | // Purpose: Initialization |
| 85 | // Parameters: None. |
| 86 | // Returns: No value returned. |
| 87 | // Requirements: None. |
| 88 | // Promises: All data members are initialized. |
| 89 | // Exceptions: None. |
| 90 | // Concurrency: N/A |
| 91 | // Notes: This constructor is not declared. This compiler generated |
| 92 | // default definition is sufficient. |
| 93 | // |
| 94 | // End Function Specification ////////////////////////////////////// |
| 95 | |
| 96 | // MopRegisterAccess(const MopRegisterAccess & scr); |
| 97 | // Function Specification ******************************************** |
| 98 | // |
| 99 | // Purpose: Copy |
| 100 | // Parameters: scr: Reference to instance to copy |
| 101 | // Returns: No value returned. |
| 102 | // Requirements: None. |
| 103 | // Promises: All data members will be copied (Deep copy). |
| 104 | // Exceptions: None. |
| 105 | // Concurrency: N/A. |
| 106 | // Notes: This constructor is not declared. This compiler generated |
| 107 | // default definition is sufficient. |
| 108 | // |
| 109 | // End Function Specification **************************************** |
| 110 | |
| 111 | virtual ~MopRegisterAccess() {} |
| 112 | |
| 113 | // Function Specification ******************************************** |
| 114 | // |
| 115 | // Purpose: Destruction |
| 116 | // Parameters: None. |
| 117 | // Returns: No value returned |
| 118 | // Requirements: None. |
| 119 | // Promises: None. |
| 120 | // Exceptions: None. |
| 121 | // Concurrency: N/A |
| 122 | // |
| 123 | // End Function Specification **************************************** |
| 124 | |
| 125 | // MopRegisterAccess & operator=(const MopRegisterAccess & scr); |
| 126 | // Function Specification ******************************************** |
| 127 | // |
| 128 | // Purpose: Assigment |
| 129 | // Parameters: d: Reference to instance to assign from |
| 130 | // Returns: Reference to this instance |
| 131 | // Requirements: None. |
| 132 | // Promises: All data members are assigned to |
| 133 | // Exceptions: None. |
| 134 | // Concurrency: N/A. |
| 135 | // Notes: This assingment operator is not declared. The compiler |
| 136 | // generated default definition is sufficient. |
| 137 | // |
| 138 | // End Function Specification **************************************** |
| 139 | |
| 140 | virtual uint32_t Access(BitString & bs, |
| 141 | uint64_t registerId, |
| 142 | Operation operation) const = 0; |
| 143 | // Function Specification ******************************************** |
| 144 | // |
| 145 | // Purpose: This function reads or writes the hardware according |
| 146 | // to the specified operation. |
| 147 | // Parameters: bs: Bit string to retrieve(for write) or store data |
| 148 | // (from read) |
| 149 | // registerId: SCR Address or scan offset |
| 150 | // operation: Indicates either read or write operation |
| 151 | // Returns: Hardware OPs return code |
| 152 | // Requirements: bs.Length() == long enough |
| 153 | // Promises: For read operation, bs is modified to reflect hardware |
| 154 | // register state |
| 155 | // Exceptions: None. |
| 156 | // Concurrency: Nonreentrant. |
| 157 | // Note: The first bs.Length() bits from the Hardware OPs read |
| 158 | // are set/reset in bs (from left to right) |
| 159 | // For a write, the first bs.Length() bits are written |
| 160 | // to the hardware register with right padded 0's if |
| 161 | // needed |
| 162 | // |
| 163 | // End Function Specification **************************************** |
| 164 | //Get Ids and count |
| 165 | virtual const TARGETING::TargetHandle_t * GetChipIds(int & count) const = 0; |
| 166 | // Function Specification ******************************************** |
| 167 | // |
| 168 | // Purpose: Access Chip Ids and # of chips to access |
| 169 | // Parameters: count: Var to return chip count of valid IDs |
| 170 | // Returns: ptr to Chip ids |
| 171 | // Requirements: None |
| 172 | // Promises: None |
| 173 | // Exceptions: None. |
| 174 | // Concurrency: Reentrant. |
| 175 | // |
| 176 | // End Function Specification **************************************** |
| 177 | |
| 178 | private: |
| 179 | |
| 180 | }; |
| 181 | |
| 182 | } // end namespace PRDF |
| 183 | |
| 184 | #endif |