gem5  v20.1.0.0
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 "enums/X86IntelMPAddressType.hh"
46 #include "enums/X86IntelMPInterruptType.hh"
47 #include "enums/X86IntelMPPolarity.hh"
48 #include "enums/X86IntelMPRangeList.hh"
49 #include "enums/X86IntelMPTriggerMode.hh"
50 #include "sim/sim_object.hh"
51 
52 class PortProxy;
53 
54 // Config entry types
55 struct X86IntelMPBaseConfigEntryParams;
56 struct X86IntelMPExtConfigEntryParams;
57 
58 // General table structures
59 struct X86IntelMPConfigTableParams;
60 struct X86IntelMPFloatingPointerParams;
61 
62 // Base entry types
63 struct X86IntelMPBusParams;
64 struct X86IntelMPIOAPICParams;
65 struct X86IntelMPIOIntAssignmentParams;
66 struct X86IntelMPLocalIntAssignmentParams;
67 struct X86IntelMPProcessorParams;
68 
69 // Extended entry types
70 struct X86IntelMPAddrSpaceMappingParams;
71 struct X86IntelMPBusHierarchyParams;
72 struct X86IntelMPCompatAddrSpaceModParams;
73 
74 template<class T>
75 uint8_t writeOutField(PortProxy& proxy, Addr addr, T val);
76 
77 uint8_t writeOutString(PortProxy& proxy, Addr addr, std::string str,
78  int length);
79 
80 namespace X86ISA
81 {
82 
83 namespace IntelMP
84 {
85 
86 class FloatingPointer : public SimObject
87 {
88  protected:
89  typedef X86IntelMPFloatingPointerParams Params;
90 
91  uint32_t tableAddr;
92  uint8_t specRev;
93  uint8_t defaultConfig;
95 
96  static const char signature[];
97 
98  public:
99 
100  Addr writeOut(PortProxy& proxy, Addr addr);
101 
103  {
104  return tableAddr;
105  }
106 
108  {
109  tableAddr = addr;
110  }
111 
113 };
114 
116 {
117  protected:
118  typedef X86IntelMPBaseConfigEntryParams Params;
119 
120  uint8_t type;
121 
122  public:
123 
124  virtual Addr writeOut(PortProxy& proxy, Addr addr, uint8_t &checkSum);
125 
126  BaseConfigEntry(Params * p, uint8_t _type);
127 };
128 
129 class ExtConfigEntry : public SimObject
130 {
131  protected:
132  typedef X86IntelMPExtConfigEntryParams Params;
133 
134  uint8_t type;
135  uint8_t length;
136 
137  public:
138 
139  virtual Addr writeOut(PortProxy& proxy, Addr addr, uint8_t &checkSum);
140 
141  ExtConfigEntry(Params * p, uint8_t _type, uint8_t _length);
142 };
143 
144 class ConfigTable : public SimObject
145 {
146  protected:
147  typedef X86IntelMPConfigTableParams Params;
148 
149  static const char signature[];
150 
151  uint8_t specRev;
152  std::string oemID;
153  std::string productID;
154  uint32_t oemTableAddr;
155  uint16_t oemTableSize;
156  uint32_t localApic;
157 
160 
161  public:
162  Addr writeOut(PortProxy& proxy, Addr addr);
163 
164  ConfigTable(Params * p);
165 };
166 
168 {
169  protected:
170  typedef X86IntelMPProcessorParams Params;
171 
172  uint8_t localApicID;
174  uint8_t cpuFlags;
175  uint32_t cpuSignature;
176  uint32_t featureFlags;
177 
178  public:
179  Addr writeOut(PortProxy& proxy, Addr addr, uint8_t &checkSum);
180 
181  Processor(Params * p);
182 };
183 
184 class Bus : public BaseConfigEntry
185 {
186  protected:
187  typedef X86IntelMPBusParams Params;
188 
189  uint8_t busID;
190  std::string busType;
191 
192  public:
193  Addr writeOut(PortProxy& proxy, Addr addr, uint8_t &checkSum);
194 
195  Bus(Params * p);
196 };
197 
198 class IOAPIC : public BaseConfigEntry
199 {
200  protected:
201  typedef X86IntelMPIOAPICParams Params;
202 
203  uint8_t id;
204  uint8_t version;
205  uint8_t flags;
206  uint32_t address;
207 
208  public:
209  Addr writeOut(PortProxy& proxy, Addr addr, uint8_t &checkSum);
210 
211  IOAPIC(Params * p);
212 };
213 
215 {
216  protected:
217  uint8_t interruptType;
218 
219  uint16_t flags;
220 
221  uint8_t sourceBusID;
222  uint8_t sourceBusIRQ;
223 
224  uint8_t destApicID;
225  uint8_t destApicIntIn;
226 
227  public:
228  Addr writeOut(PortProxy& proxy, Addr addr, uint8_t &checkSum);
229 
230  IntAssignment(X86IntelMPBaseConfigEntryParams * p,
231  Enums::X86IntelMPInterruptType _interruptType,
232  Enums::X86IntelMPPolarity polarity,
233  Enums::X86IntelMPTriggerMode trigger,
234  uint8_t _type,
235  uint8_t _sourceBusID, uint8_t _sourceBusIRQ,
236  uint8_t _destApicID, uint8_t _destApicIntIn) :
237  BaseConfigEntry(p, _type),
238  interruptType(_interruptType), flags(0),
239  sourceBusID(_sourceBusID), sourceBusIRQ(_sourceBusIRQ),
240  destApicID(_destApicID), destApicIntIn(_destApicIntIn)
241  {
242  replaceBits(flags, 1, 0, polarity);
243  replaceBits(flags, 3, 2, trigger);
244  }
245 };
246 
248 {
249  protected:
250  typedef X86IntelMPIOIntAssignmentParams Params;
251 
252  public:
254 };
255 
257 {
258  protected:
259  typedef X86IntelMPLocalIntAssignmentParams Params;
260 
261  public:
263 };
264 
266 {
267  protected:
268  typedef X86IntelMPAddrSpaceMappingParams Params;
269 
270  uint8_t busID;
271  uint8_t addrType;
272  uint64_t addr;
273  uint64_t addrLength;
274 
275  public:
276  Addr writeOut(PortProxy& proxy, Addr addr, uint8_t &checkSum);
277 
279 };
280 
282 {
283  protected:
284  typedef X86IntelMPBusHierarchyParams Params;
285 
286  uint8_t busID;
287  uint8_t info;
288  uint8_t parentBus;
289 
290  public:
291  Addr writeOut(PortProxy& proxy, Addr addr, uint8_t &checkSum);
292 
293  BusHierarchy(Params * p);
294 };
295 
297 {
298  protected:
299  typedef X86IntelMPCompatAddrSpaceModParams Params;
300 
301  uint8_t busID;
302  uint8_t mod;
303  uint32_t rangeList;
304 
305  public:
306  Addr writeOut(PortProxy& proxy, Addr addr, uint8_t &checkSum);
307 
309 };
310 
311 } //IntelMP
312 
313 } //X86ISA
314 
315 #endif
X86ISA::IntelMP::Bus::busID
uint8_t busID
Definition: intelmp.hh:189
X86ISA::IntelMP::FloatingPointer::writeOut
Addr writeOut(PortProxy &proxy, Addr addr)
Definition: intelmp.cc:109
X86ISA::IntelMP::IOAPIC::version
uint8_t version
Definition: intelmp.hh:204
X86ISA::IntelMP::FloatingPointer
Definition: intelmp.hh:86
X86ISA::IntelMP::LocalIntAssignment::Params
X86IntelMPLocalIntAssignmentParams Params
Definition: intelmp.hh:259
X86ISA::IntelMP::AddrSpaceMapping::busID
uint8_t busID
Definition: intelmp.hh:270
X86ISA::IntelMP::IOAPIC::Params
X86IntelMPIOAPICParams Params
Definition: intelmp.hh:201
X86ISA::IntelMP::Processor::localApicID
uint8_t localApicID
Definition: intelmp.hh:172
X86ISA::IntelMP::CompatAddrSpaceMod::busID
uint8_t busID
Definition: intelmp.hh:301
X86ISA::IntelMP::BaseConfigEntry
Definition: intelmp.hh:115
length
uint8_t length
Definition: inet.hh:422
replaceBits
void replaceBits(T &val, int first, int last, B bit_val)
A convenience function to replace bits first to last of val with bit_val in place.
Definition: bitfield.hh:179
X86ISA::IntelMP::Processor::cpuFlags
uint8_t cpuFlags
Definition: intelmp.hh:174
X86ISA::IntelMP::LocalIntAssignment::LocalIntAssignment
LocalIntAssignment(Params *p)
Definition: intelmp.cc:369
X86ISA::IntelMP::BusHierarchy::writeOut
Addr writeOut(PortProxy &proxy, Addr addr, uint8_t &checkSum)
Definition: intelmp.cc:406
X86ISA::IntelMP::ConfigTable::signature
static const char signature[]
Definition: intelmp.hh:149
X86ISA::IntelMP::BaseConfigEntry::Params
X86IntelMPBaseConfigEntryParams Params
Definition: intelmp.hh:118
X86ISA::IntelMP::AddrSpaceMapping::addrType
uint8_t addrType
Definition: intelmp.hh:271
X86ISA::IntelMP::Processor
Definition: intelmp.hh:167
X86ISA::IntelMP::ConfigTable::oemTableSize
uint16_t oemTableSize
Definition: intelmp.hh:155
X86ISA::IntelMP::IntAssignment::destApicIntIn
uint8_t destApicIntIn
Definition: intelmp.hh:225
X86ISA::IntelMP::ConfigTable::oemTableAddr
uint32_t oemTableAddr
Definition: intelmp.hh:154
X86ISA::IntelMP::ExtConfigEntry::type
uint8_t type
Definition: intelmp.hh:134
X86ISA::IntelMP::FloatingPointer::setTableAddr
void setTableAddr(Addr addr)
Definition: intelmp.hh:107
X86ISA::IntelMP::ConfigTable::localApic
uint32_t localApic
Definition: intelmp.hh:156
X86ISA::IntelMP::AddrSpaceMapping::Params
X86IntelMPAddrSpaceMappingParams Params
Definition: intelmp.hh:268
X86ISA::IntelMP::ConfigTable::ConfigTable
ConfigTable(Params *p)
Definition: intelmp.cc:248
X86ISA::IntelMP::ExtConfigEntry::ExtConfigEntry
ExtConfigEntry(Params *p, uint8_t _type, uint8_t _length)
Definition: intelmp.cc:183
X86ISA::IntelMP::ExtConfigEntry::length
uint8_t length
Definition: intelmp.hh:135
X86ISA::IntelMP::Processor::cpuSignature
uint32_t cpuSignature
Definition: intelmp.hh:175
X86ISA::IntelMP::AddrSpaceMapping::addrLength
uint64_t addrLength
Definition: intelmp.hh:273
X86ISA::IntelMP::IOIntAssignment::IOIntAssignment
IOIntAssignment(Params *p)
Definition: intelmp.cc:357
X86ISA::IntelMP::IOIntAssignment::Params
X86IntelMPIOIntAssignmentParams Params
Definition: intelmp.hh:250
X86ISA::IntelMP::CompatAddrSpaceMod
Definition: intelmp.hh:296
X86ISA::IntelMP::Bus::Bus
Bus(Params *p)
Definition: intelmp.cc:308
std::vector
STL vector class.
Definition: stl.hh:37
X86ISA::IntelMP::BusHierarchy::busID
uint8_t busID
Definition: intelmp.hh:286
X86ISA::IntelMP::AddrSpaceMapping
Definition: intelmp.hh:265
X86ISA::IntelMP::FloatingPointer::tableAddr
uint32_t tableAddr
Definition: intelmp.hh:91
X86ISA::IntelMP::ConfigTable::writeOut
Addr writeOut(PortProxy &proxy, Addr addr)
Definition: intelmp.cc:191
X86ISA::IntelMP::Processor::featureFlags
uint32_t featureFlags
Definition: intelmp.hh:176
X86ISA::IntelMP::IOIntAssignment
Definition: intelmp.hh:247
X86ISA::IntelMP::CompatAddrSpaceMod::rangeList
uint32_t rangeList
Definition: intelmp.hh:303
X86ISA::IntelMP::IOAPIC::IOAPIC
IOAPIC(Params *p)
Definition: intelmp.cc:330
X86ISA::IntelMP::LocalIntAssignment
Definition: intelmp.hh:256
X86ISA::IntelMP::ConfigTable::baseEntries
std::vector< BaseConfigEntry * > baseEntries
Definition: intelmp.hh:158
X86ISA::IntelMP::IntAssignment::writeOut
Addr writeOut(PortProxy &proxy, Addr addr, uint8_t &checkSum)
Definition: intelmp.cc:344
X86ISA::IntelMP::IntAssignment::sourceBusID
uint8_t sourceBusID
Definition: intelmp.hh:221
X86ISA::IntelMP::BaseConfigEntry::writeOut
virtual Addr writeOut(PortProxy &proxy, Addr addr, uint8_t &checkSum)
Definition: intelmp.cc:160
X86ISA::IntelMP::FloatingPointer::specRev
uint8_t specRev
Definition: intelmp.hh:92
X86ISA::IntelMP::IntAssignment::sourceBusIRQ
uint8_t sourceBusIRQ
Definition: intelmp.hh:222
X86ISA::IntelMP::ConfigTable::Params
X86IntelMPConfigTableParams Params
Definition: intelmp.hh:147
X86ISA::IntelMP::ConfigTable
Definition: intelmp.hh:144
X86ISA::IntelMP::CompatAddrSpaceMod::writeOut
Addr writeOut(PortProxy &proxy, Addr addr, uint8_t &checkSum)
Definition: intelmp.cc:435
bitfield.hh
X86ISA::IntelMP::FloatingPointer::imcrPresent
bool imcrPresent
Definition: intelmp.hh:94
writeOutField
uint8_t writeOutField(PortProxy &proxy, Addr addr, T val)
Definition: intelmp.cc:72
sim_object.hh
X86ISA::IntelMP::BusHierarchy
Definition: intelmp.hh:281
X86ISA::IntelMP::AddrSpaceMapping::AddrSpaceMapping
AddrSpaceMapping(Params *p)
Definition: intelmp.cc:393
X86ISA::IntelMP::ExtConfigEntry::writeOut
virtual Addr writeOut(PortProxy &proxy, Addr addr, uint8_t &checkSum)
Definition: intelmp.cc:173
X86ISA::IntelMP::ConfigTable::specRev
uint8_t specRev
Definition: intelmp.hh:151
X86ISA::IntelMP::ConfigTable::oemID
std::string oemID
Definition: intelmp.hh:152
X86ISA::IntelMP::IOAPIC
Definition: intelmp.hh:198
X86ISA::IntelMP::BusHierarchy::Params
X86IntelMPBusHierarchyParams Params
Definition: intelmp.hh:284
X86ISA::IntelMP::IntAssignment::flags
uint16_t flags
Definition: intelmp.hh:219
X86ISA::IntelMP::FloatingPointer::getTableAddr
Addr getTableAddr()
Definition: intelmp.hh:102
X86ISA::IntelMP::Processor::localApicVersion
uint8_t localApicVersion
Definition: intelmp.hh:173
X86ISA::IntelMP::BusHierarchy::info
uint8_t info
Definition: intelmp.hh:287
X86ISA::IntelMP::IntAssignment::IntAssignment
IntAssignment(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:230
X86ISA::val
Bitfield< 63 > val
Definition: misc.hh:769
X86ISA::IntelMP::Bus::Params
X86IntelMPBusParams Params
Definition: intelmp.hh:187
X86ISA::IntelMP::ExtConfigEntry::Params
X86IntelMPExtConfigEntryParams Params
Definition: intelmp.hh:132
X86ISA
This is exposed globally, independent of the ISA.
Definition: acpi.hh:55
Addr
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Definition: types.hh:142
X86ISA::IntelMP::Bus
Definition: intelmp.hh:184
X86ISA::IntelMP::Processor::Params
X86IntelMPProcessorParams Params
Definition: intelmp.hh:170
X86ISA::IntelMP::IOAPIC::id
uint8_t id
Definition: intelmp.hh:203
X86ISA::IntelMP::ExtConfigEntry
Definition: intelmp.hh:129
X86ISA::IntelMP::AddrSpaceMapping::writeOut
Addr writeOut(PortProxy &proxy, Addr addr, uint8_t &checkSum)
Definition: intelmp.cc:382
X86ISA::IntelMP::Processor::Processor
Processor(Params *p)
Definition: intelmp.cc:278
X86ISA::addr
Bitfield< 3 > addr
Definition: types.hh:79
X86ISA::IntelMP::IntAssignment::destApicID
uint8_t destApicID
Definition: intelmp.hh:224
X86ISA::IntelMP::Processor::writeOut
Addr writeOut(PortProxy &proxy, Addr addr, uint8_t &checkSum)
Definition: intelmp.cc:262
PortProxy
This object is a proxy for a port or other object which implements the functional response protocol,...
Definition: port_proxy.hh:80
X86ISA::p
Bitfield< 0 > p
Definition: pagetable.hh:151
X86ISA::IntelMP::IOAPIC::writeOut
Addr writeOut(PortProxy &proxy, Addr addr, uint8_t &checkSum)
Definition: intelmp.cc:319
addr
ip6_addr_t addr
Definition: inet.hh:423
X86ISA::IntelMP::ConfigTable::extEntries
std::vector< ExtConfigEntry * > extEntries
Definition: intelmp.hh:159
X86ISA::IntelMP::BaseConfigEntry::BaseConfigEntry
BaseConfigEntry(Params *p, uint8_t _type)
Definition: intelmp.cc:168
X86ISA::IntelMP::IntAssignment::interruptType
uint8_t interruptType
Definition: intelmp.hh:217
X86ISA::IntelMP::BusHierarchy::parentBus
uint8_t parentBus
Definition: intelmp.hh:288
X86ISA::IntelMP::Bus::writeOut
Addr writeOut(PortProxy &proxy, Addr addr, uint8_t &checkSum)
Definition: intelmp.cc:299
X86ISA::IntelMP::IOAPIC::flags
uint8_t flags
Definition: intelmp.hh:205
X86ISA::IntelMP::CompatAddrSpaceMod::mod
uint8_t mod
Definition: intelmp.hh:302
X86ISA::IntelMP::FloatingPointer::Params
X86IntelMPFloatingPointerParams Params
Definition: intelmp.hh:89
X86ISA::IntelMP::IOAPIC::address
uint32_t address
Definition: intelmp.hh:206
X86ISA::trigger
Bitfield< 21 > trigger
Definition: intmessage.hh:48
X86ISA::IntelMP::AddrSpaceMapping::addr
uint64_t addr
Definition: intelmp.hh:272
X86ISA::IntelMP::IntAssignment
Definition: intelmp.hh:214
X86ISA::IntelMP::FloatingPointer::signature
static const char signature[]
Definition: intelmp.hh:96
X86ISA::IntelMP::CompatAddrSpaceMod::Params
X86IntelMPCompatAddrSpaceModParams Params
Definition: intelmp.hh:299
X86ISA::IntelMP::FloatingPointer::defaultConfig
uint8_t defaultConfig
Definition: intelmp.hh:93
X86ISA::IntelMP::BusHierarchy::BusHierarchy
BusHierarchy(Params *p)
Definition: intelmp.cc:420
X86ISA::IntelMP::ConfigTable::productID
std::string productID
Definition: intelmp.hh:153
writeOutString
uint8_t writeOutString(PortProxy &proxy, Addr addr, std::string str, int length)
X86ISA::IntelMP::CompatAddrSpaceMod::CompatAddrSpaceMod
CompatAddrSpaceMod(Params *p)
Definition: intelmp.cc:445
X86ISA::IntelMP::Bus::busType
std::string busType
Definition: intelmp.hh:190
X86ISA::IntelMP::FloatingPointer::FloatingPointer
FloatingPointer(Params *p)
Definition: intelmp.cc:148
X86ISA::IntelMP::BaseConfigEntry::type
uint8_t type
Definition: intelmp.hh:120
SimObject
Abstract superclass for simulation objects.
Definition: sim_object.hh:92

Generated on Wed Sep 30 2020 14:02:07 for gem5 by doxygen 1.8.17