gem5  [DEVELOP-FOR-23.0]
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
intelmp.hh
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2008 The Hewlett-Packard Development Company
3  * All rights reserved.
4  *
5  * The license below extends only to copyright in the software and shall
6  * not be construed as granting a license to any other intellectual
7  * property including but not limited to intellectual property relating
8  * to a hardware implementation of the functionality of the software
9  * licensed hereunder. You may use the software subject to the license
10  * terms below provided that you ensure that this notice is replicated
11  * unmodified and in its entirety in all distributions of the software,
12  * modified or unmodified, in source code or in binary form.
13  *
14  * Redistribution and use in source and binary forms, with or without
15  * modification, are permitted provided that the following conditions are
16  * met: redistributions of source code must retain the above copyright
17  * notice, this list of conditions and the following disclaimer;
18  * redistributions in binary form must reproduce the above copyright
19  * notice, this list of conditions and the following disclaimer in the
20  * documentation and/or other materials provided with the distribution;
21  * neither the name of the copyright holders nor the names of its
22  * contributors may be used to endorse or promote products derived from
23  * this software without specific prior written permission.
24  *
25  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
26  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
27  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
28  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
29  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
30  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
31  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
32  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
33  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
34  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
35  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36  */
37 
38 #ifndef __ARCH_X86_BIOS_INTELMP_HH__
39 #define __ARCH_X86_BIOS_INTELMP_HH__
40 
41 #include <string>
42 #include <vector>
43 
44 #include "base/bitfield.hh"
45 #include "base/compiler.hh"
46 #include "enums/X86IntelMPAddressType.hh"
47 #include "enums/X86IntelMPInterruptType.hh"
48 #include "enums/X86IntelMPPolarity.hh"
49 #include "enums/X86IntelMPRangeList.hh"
50 #include "enums/X86IntelMPTriggerMode.hh"
51 #include "sim/sim_object.hh"
52 
53 namespace gem5
54 {
55 
56 class PortProxy;
57 
58 // Config entry types
59 struct X86IntelMPBaseConfigEntryParams;
60 struct X86IntelMPExtConfigEntryParams;
61 
62 // General table structures
63 struct X86IntelMPConfigTableParams;
64 struct X86IntelMPFloatingPointerParams;
65 
66 // Base entry types
67 struct X86IntelMPBusParams;
68 struct X86IntelMPIOAPICParams;
69 struct X86IntelMPIOIntAssignmentParams;
70 struct X86IntelMPLocalIntAssignmentParams;
71 struct X86IntelMPProcessorParams;
72 
73 // Extended entry types
74 struct X86IntelMPAddrSpaceMappingParams;
75 struct X86IntelMPBusHierarchyParams;
76 struct X86IntelMPCompatAddrSpaceModParams;
77 
78 template<class T>
79 uint8_t writeOutField(PortProxy& proxy, Addr addr, T val);
80 
81 uint8_t writeOutString(PortProxy& proxy, Addr addr, std::string str,
82  int length);
83 
84 namespace X86ISA
85 {
86 
87 namespace intelmp
88 {
89 
90 class FloatingPointer : public SimObject
91 {
92  protected:
93  typedef X86IntelMPFloatingPointerParams Params;
94 
95  uint32_t tableAddr;
96  uint8_t specRev;
97  uint8_t defaultConfig;
99 
100  static const char signature[];
101 
102  public:
103 
104  Addr writeOut(PortProxy& proxy, Addr addr);
105 
107  {
108  return tableAddr;
109  }
110 
112  {
113  tableAddr = addr;
114  }
115 
116  FloatingPointer(const Params &p);
117 };
118 
120 {
121  protected:
122  typedef X86IntelMPBaseConfigEntryParams Params;
123 
124  uint8_t type;
125 
126  public:
127 
128  virtual Addr writeOut(PortProxy& proxy, Addr addr, uint8_t &checkSum);
129 
130  BaseConfigEntry(const Params &p, uint8_t _type);
131 };
132 
133 class ExtConfigEntry : public SimObject
134 {
135  protected:
136  typedef X86IntelMPExtConfigEntryParams Params;
137 
138  uint8_t type;
139  uint8_t length;
140 
141  public:
142 
143  virtual Addr writeOut(PortProxy& proxy, Addr addr, uint8_t &checkSum);
144 
145  ExtConfigEntry(const Params &p, uint8_t _type, uint8_t _length);
146 };
147 
148 class ConfigTable : public SimObject
149 {
150  protected:
151  typedef X86IntelMPConfigTableParams Params;
152 
153  static const char signature[];
154 
155  uint8_t specRev;
156  std::string oemID;
157  std::string productID;
158  uint32_t oemTableAddr;
159  uint16_t oemTableSize;
160  uint32_t localApic;
161 
164 
165  public:
166  Addr writeOut(PortProxy& proxy, Addr addr);
167 
168  ConfigTable(const Params &p);
169 };
170 
172 {
173  protected:
174  typedef X86IntelMPProcessorParams Params;
175 
176  uint8_t localApicID;
178  uint8_t cpuFlags;
179  uint32_t cpuSignature;
180  uint32_t featureFlags;
181 
182  public:
183  Addr writeOut(PortProxy& proxy, Addr addr, uint8_t &checkSum);
184 
185  Processor(const Params &p);
186 };
187 
188 class Bus : public BaseConfigEntry
189 {
190  protected:
191  typedef X86IntelMPBusParams Params;
192 
193  uint8_t busID;
194  std::string busType;
195 
196  public:
197  Addr writeOut(PortProxy& proxy, Addr addr, uint8_t &checkSum);
198 
199  Bus(const Params &p);
200 };
201 
202 class IOAPIC : public BaseConfigEntry
203 {
204  protected:
205  typedef X86IntelMPIOAPICParams Params;
206 
207  uint8_t id;
208  uint8_t version;
209  uint8_t flags;
210  uint32_t address;
211 
212  public:
213  Addr writeOut(PortProxy& proxy, Addr addr, uint8_t &checkSum);
214 
215  IOAPIC(const Params &p);
216 };
217 
219 {
220  protected:
221  uint8_t interruptType;
222 
223  uint16_t flags;
224 
225  uint8_t sourceBusID;
226  uint8_t sourceBusIRQ;
227 
228  uint8_t destApicID;
229  uint8_t destApicIntIn;
230 
231  public:
232  Addr writeOut(PortProxy& proxy, Addr addr, uint8_t &checkSum);
233 
234  IntAssignment(const X86IntelMPBaseConfigEntryParams &p,
235  enums::X86IntelMPInterruptType _interruptType,
236  enums::X86IntelMPPolarity polarity,
237  enums::X86IntelMPTriggerMode trigger,
238  uint8_t _type,
239  uint8_t _sourceBusID, uint8_t _sourceBusIRQ,
240  uint8_t _destApicID, uint8_t _destApicIntIn) :
241  BaseConfigEntry(p, _type),
242  interruptType(_interruptType), flags(0),
243  sourceBusID(_sourceBusID), sourceBusIRQ(_sourceBusIRQ),
244  destApicID(_destApicID), destApicIntIn(_destApicIntIn)
245  {
246  replaceBits(flags, 1, 0, polarity);
247  replaceBits(flags, 3, 2, trigger);
248  }
249 };
250 
252 {
253  protected:
254  typedef X86IntelMPIOIntAssignmentParams Params;
255 
256  public:
257  IOIntAssignment(const Params &p);
258 };
259 
261 {
262  protected:
263  typedef X86IntelMPLocalIntAssignmentParams Params;
264 
265  public:
266  LocalIntAssignment(const Params &p);
267 };
268 
270 {
271  protected:
272  typedef X86IntelMPAddrSpaceMappingParams Params;
273 
274  uint8_t busID;
275  uint8_t addrType;
276  uint64_t addr;
277  uint64_t addrLength;
278 
279  public:
280  Addr writeOut(PortProxy& proxy, Addr addr, uint8_t &checkSum);
281 
282  AddrSpaceMapping(const Params &p);
283 };
284 
286 {
287  protected:
288  typedef X86IntelMPBusHierarchyParams Params;
289 
290  uint8_t busID;
291  uint8_t info;
292  uint8_t parentBus;
293 
294  public:
295  Addr writeOut(PortProxy& proxy, Addr addr, uint8_t &checkSum);
296 
297  BusHierarchy(const Params &p);
298 };
299 
301 {
302  protected:
303  typedef X86IntelMPCompatAddrSpaceModParams Params;
304 
305  uint8_t busID;
306  uint8_t mod;
307  uint32_t rangeList;
308 
309  public:
310  Addr writeOut(PortProxy& proxy, Addr addr, uint8_t &checkSum);
311 
312  CompatAddrSpaceMod(const Params &p);
313 };
314 
315 } // namespace intelmp
316 } // namespace X86ISA
317 } // namespace gem5
318 
319 #endif
gem5::X86ISA::intelmp::FloatingPointer
Definition: intelmp.hh:90
gem5::X86ISA::intelmp::AddrSpaceMapping
Definition: intelmp.hh:269
gem5::X86ISA::intelmp::IntAssignment::sourceBusIRQ
uint8_t sourceBusIRQ
Definition: intelmp.hh:226
gem5::X86ISA::intelmp::ConfigTable::specRev
uint8_t specRev
Definition: intelmp.hh:155
gem5::X86ISA::intelmp::ConfigTable::oemTableSize
uint16_t oemTableSize
Definition: intelmp.hh:159
gem5::X86ISA::intelmp::BusHierarchy::Params
X86IntelMPBusHierarchyParams Params
Definition: intelmp.hh:288
gem5::X86ISA::intelmp::AddrSpaceMapping::writeOut
Addr writeOut(PortProxy &proxy, Addr addr, uint8_t &checkSum)
Definition: intelmp.cc:341
gem5::X86ISA::intelmp::Bus::busID
uint8_t busID
Definition: intelmp.hh:193
gem5::X86ISA::intelmp::Processor::cpuSignature
uint32_t cpuSignature
Definition: intelmp.hh:179
gem5::X86ISA::intelmp::ConfigTable::localApic
uint32_t localApic
Definition: intelmp.hh:160
gem5::X86ISA::intelmp::CompatAddrSpaceMod::writeOut
Addr writeOut(PortProxy &proxy, Addr addr, uint8_t &checkSum)
Definition: intelmp.cc:382
gem5::X86ISA::intelmp::IOAPIC::IOAPIC
IOAPIC(const Params &p)
Definition: intelmp.cc:307
gem5::X86ISA::intelmp::IOAPIC::writeOut
Addr writeOut(PortProxy &proxy, Addr addr, uint8_t &checkSum)
Definition: intelmp.cc:296
gem5::X86ISA::intelmp::BusHierarchy::info
uint8_t info
Definition: intelmp.hh:291
gem5::X86ISA::intelmp::CompatAddrSpaceMod::CompatAddrSpaceMod
CompatAddrSpaceMod(const Params &p)
Definition: intelmp.cc:392
gem5::X86ISA::intelmp::AddrSpaceMapping::AddrSpaceMapping
AddrSpaceMapping(const Params &p)
Definition: intelmp.cc:352
gem5::X86ISA::intelmp::IOAPIC::flags
uint8_t flags
Definition: intelmp.hh:209
gem5::X86ISA::intelmp::ExtConfigEntry::writeOut
virtual Addr writeOut(PortProxy &proxy, Addr addr, uint8_t &checkSum)
Definition: intelmp.cc:168
gem5::X86ISA::intelmp::IntAssignment::sourceBusID
uint8_t sourceBusID
Definition: intelmp.hh:225
gem5::replaceBits
constexpr void replaceBits(T &val, unsigned first, unsigned last, B bit_val)
A convenience function to replace bits first to last of val with bit_val in place.
Definition: bitfield.hh:213
gem5::X86ISA::intelmp::LocalIntAssignment::Params
X86IntelMPLocalIntAssignmentParams Params
Definition: intelmp.hh:263
gem5::X86ISA::intelmp::IntAssignment::destApicID
uint8_t destApicID
Definition: intelmp.hh:228
gem5::writeOutField
uint8_t writeOutField(PortProxy &proxy, Addr addr, T val)
Definition: intelmp.cc:72
gem5::X86ISA::intelmp::IOIntAssignment::Params
X86IntelMPIOIntAssignmentParams Params
Definition: intelmp.hh:254
gem5::X86ISA::intelmp::FloatingPointer::specRev
uint8_t specRev
Definition: intelmp.hh:96
gem5::X86ISA::intelmp::BusHierarchy
Definition: intelmp.hh:285
gem5::X86ISA::val
Bitfield< 63 > val
Definition: misc.hh:776
gem5::X86ISA::intelmp::BaseConfigEntry
Definition: intelmp.hh:119
gem5::X86ISA::intelmp::AddrSpaceMapping::addrLength
uint64_t addrLength
Definition: intelmp.hh:277
gem5::X86ISA::intelmp::IntAssignment::interruptType
uint8_t interruptType
Definition: intelmp.hh:221
gem5::X86ISA::intelmp::Processor::cpuFlags
uint8_t cpuFlags
Definition: intelmp.hh:178
std::vector
STL vector class.
Definition: stl.hh:37
gem5::X86ISA::intelmp::Processor::featureFlags
uint32_t featureFlags
Definition: intelmp.hh:180
gem5::X86ISA::intelmp::LocalIntAssignment
Definition: intelmp.hh:260
gem5::X86ISA::intelmp::ExtConfigEntry::ExtConfigEntry
ExtConfigEntry(const Params &p, uint8_t _type, uint8_t _length)
Definition: intelmp.cc:178
gem5::X86ISA::intelmp::ConfigTable::writeOut
Addr writeOut(PortProxy &proxy, Addr addr)
Definition: intelmp.cc:186
gem5::X86ISA::intelmp::ConfigTable
Definition: intelmp.hh:148
gem5::X86ISA::intelmp::ExtConfigEntry::length
uint8_t length
Definition: intelmp.hh:139
gem5::X86ISA::intelmp::ConfigTable::oemTableAddr
uint32_t oemTableAddr
Definition: intelmp.hh:158
gem5::X86ISA::intelmp::BaseConfigEntry::Params
X86IntelMPBaseConfigEntryParams Params
Definition: intelmp.hh:122
gem5::X86ISA::intelmp::FloatingPointer::Params
X86IntelMPFloatingPointerParams Params
Definition: intelmp.hh:93
gem5::X86ISA::intelmp::ConfigTable::extEntries
std::vector< ExtConfigEntry * > extEntries
Definition: intelmp.hh:163
gem5::X86ISA::intelmp::Processor::writeOut
Addr writeOut(PortProxy &proxy, Addr addr, uint8_t &checkSum)
Definition: intelmp.cc:251
gem5::X86ISA::intelmp::FloatingPointer::tableAddr
uint32_t tableAddr
Definition: intelmp.hh:95
gem5::X86ISA::intelmp::BusHierarchy::parentBus
uint8_t parentBus
Definition: intelmp.hh:292
gem5::X86ISA::intelmp::IntAssignment::destApicIntIn
uint8_t destApicIntIn
Definition: intelmp.hh:229
gem5::X86ISA::intelmp::FloatingPointer::defaultConfig
uint8_t defaultConfig
Definition: intelmp.hh:97
bitfield.hh
sim_object.hh
gem5::X86ISA::intelmp::ExtConfigEntry::type
uint8_t type
Definition: intelmp.hh:138
gem5::X86ISA::intelmp::BusHierarchy::busID
uint8_t busID
Definition: intelmp.hh:290
gem5::X86ISA::intelmp::ConfigTable::signature
static const char signature[]
Definition: intelmp.hh:153
gem5::X86ISA::intelmp::AddrSpaceMapping::addr
uint64_t addr
Definition: intelmp.hh:276
gem5::X86ISA::intelmp::FloatingPointer::setTableAddr
void setTableAddr(Addr addr)
Definition: intelmp.hh:111
gem5::X86ISA::intelmp::CompatAddrSpaceMod::busID
uint8_t busID
Definition: intelmp.hh:305
gem5::X86ISA::intelmp::Processor::Processor
Processor(const Params &p)
Definition: intelmp.cc:267
gem5::PortProxy
This object is a proxy for a port or other object which implements the functional response protocol,...
Definition: port_proxy.hh:86
gem5::X86ISA::intelmp::ConfigTable::productID
std::string productID
Definition: intelmp.hh:157
gem5::X86ISA::intelmp::BusHierarchy::BusHierarchy
BusHierarchy(const Params &p)
Definition: intelmp.cc:373
gem5::X86ISA::intelmp::FloatingPointer::signature
static const char signature[]
Definition: intelmp.hh:100
gem5::X86ISA::intelmp::BaseConfigEntry::writeOut
virtual Addr writeOut(PortProxy &proxy, Addr addr, uint8_t &checkSum)
Definition: intelmp.cc:154
gem5::X86ISA::intelmp::ExtConfigEntry::Params
X86IntelMPExtConfigEntryParams Params
Definition: intelmp.hh:136
gem5::X86ISA::intelmp::ConfigTable::ConfigTable
ConfigTable(const Params &p)
Definition: intelmp.cc:243
gem5::X86ISA::intelmp::BaseConfigEntry::type
uint8_t type
Definition: intelmp.hh:124
gem5::X86ISA::intelmp::IOIntAssignment::IOIntAssignment
IOIntAssignment(const Params &p)
Definition: intelmp.cc:328
compiler.hh
gem5::X86ISA::intelmp::ExtConfigEntry
Definition: intelmp.hh:133
gem5::SimObject
Abstract superclass for simulation objects.
Definition: sim_object.hh:146
gem5::X86ISA::intelmp::Bus::writeOut
Addr writeOut(PortProxy &proxy, Addr addr, uint8_t &checkSum)
Definition: intelmp.cc:282
gem5::X86ISA::intelmp::ConfigTable::Params
X86IntelMPConfigTableParams Params
Definition: intelmp.hh:151
gem5::X86ISA::intelmp::BaseConfigEntry::BaseConfigEntry
BaseConfigEntry(const Params &p, uint8_t _type)
Definition: intelmp.cc:162
gem5::Addr
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Definition: types.hh:147
gem5::X86ISA::intelmp::Processor::Params
X86IntelMPProcessorParams Params
Definition: intelmp.hh:174
gem5::X86ISA::intelmp::CompatAddrSpaceMod::rangeList
uint32_t rangeList
Definition: intelmp.hh:307
gem5::X86ISA::intelmp::Bus::Bus
Bus(const Params &p)
Definition: intelmp.cc:291
gem5::X86ISA::intelmp::IOAPIC::address
uint32_t address
Definition: intelmp.hh:210
gem5::X86ISA::intelmp::CompatAddrSpaceMod
Definition: intelmp.hh:300
gem5::X86ISA::intelmp::Processor::localApicVersion
uint8_t localApicVersion
Definition: intelmp.hh:177
gem5::X86ISA::intelmp::ConfigTable::oemID
std::string oemID
Definition: intelmp.hh:156
gem5::X86ISA::intelmp::IOAPIC::Params
X86IntelMPIOAPICParams Params
Definition: intelmp.hh:205
gem5::X86ISA::intelmp::AddrSpaceMapping::addrType
uint8_t addrType
Definition: intelmp.hh:275
gem5::X86ISA::intelmp::Processor::localApicID
uint8_t localApicID
Definition: intelmp.hh:176
gem5::X86ISA::intelmp::CompatAddrSpaceMod::Params
X86IntelMPCompatAddrSpaceModParams Params
Definition: intelmp.hh:303
gem5::X86ISA::intelmp::BusHierarchy::writeOut
Addr writeOut(PortProxy &proxy, Addr addr, uint8_t &checkSum)
Definition: intelmp.cc:359
gem5::X86ISA::intelmp::IOIntAssignment
Definition: intelmp.hh:251
gem5::writeOutString
uint8_t writeOutString(PortProxy &proxy, Addr addr, std::string str, int length)
Definition: intelmp.cc:86
gem5::X86ISA::intelmp::LocalIntAssignment::LocalIntAssignment
LocalIntAssignment(const Params &p)
Definition: intelmp.cc:334
gem5::X86ISA::intelmp::IntAssignment
Definition: intelmp.hh:218
gem5::X86ISA::p
Bitfield< 0 > p
Definition: pagetable.hh:151
gem5::X86ISA::intelmp::IOAPIC::id
uint8_t id
Definition: intelmp.hh:207
gem5::X86ISA::intelmp::AddrSpaceMapping::busID
uint8_t busID
Definition: intelmp.hh:274
gem5::X86ISA::intelmp::FloatingPointer::imcrPresent
bool imcrPresent
Definition: intelmp.hh:98
gem5::X86ISA::intelmp::FloatingPointer::getTableAddr
Addr getTableAddr()
Definition: intelmp.hh:106
gem5::X86ISA::intelmp::IntAssignment::IntAssignment
IntAssignment(const X86IntelMPBaseConfigEntryParams &p, enums::X86IntelMPInterruptType _interruptType, enums::X86IntelMPPolarity polarity, enums::X86IntelMPTriggerMode trigger, uint8_t _type, uint8_t _sourceBusID, uint8_t _sourceBusIRQ, uint8_t _destApicID, uint8_t _destApicIntIn)
Definition: intelmp.hh:234
gem5::X86ISA::intelmp::IOAPIC
Definition: intelmp.hh:202
gem5::X86ISA::intelmp::Processor
Definition: intelmp.hh:171
gem5::X86ISA::intelmp::FloatingPointer::FloatingPointer
FloatingPointer(const Params &p)
Definition: intelmp.cc:148
gem5::X86ISA::intelmp::IntAssignment::writeOut
Addr writeOut(PortProxy &proxy, Addr addr, uint8_t &checkSum)
Definition: intelmp.cc:315
gem5::X86ISA::intelmp::Bus::busType
std::string busType
Definition: intelmp.hh:194
gem5::X86ISA::intelmp::Bus
Definition: intelmp.hh:188
gem5::X86ISA::intelmp::ConfigTable::baseEntries
std::vector< BaseConfigEntry * > baseEntries
Definition: intelmp.hh:162
gem5
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
Definition: gpu_translation_state.hh:37
gem5::X86ISA::intelmp::AddrSpaceMapping::Params
X86IntelMPAddrSpaceMappingParams Params
Definition: intelmp.hh:272
gem5::X86ISA::intelmp::IntAssignment::flags
uint16_t flags
Definition: intelmp.hh:223
gem5::X86ISA::intelmp::Bus::Params
X86IntelMPBusParams Params
Definition: intelmp.hh:191
gem5::X86ISA::intelmp::IOAPIC::version
uint8_t version
Definition: intelmp.hh:208
gem5::X86ISA::trigger
Bitfield< 21 > trigger
Definition: intmessage.hh:52
gem5::X86ISA::intelmp::FloatingPointer::writeOut
Addr writeOut(PortProxy &proxy, Addr addr)
Definition: intelmp.cc:109
gem5::X86ISA::addr
Bitfield< 3 > addr
Definition: types.hh:84
gem5::X86ISA::intelmp::CompatAddrSpaceMod::mod
uint8_t mod
Definition: intelmp.hh:306

Generated on Sun Jul 30 2023 01:56:50 for gem5 by doxygen 1.8.17