gem5  v22.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 "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 GEM5_DEPRECATED_NAMESPACE(IntelMP, intelmp);
88 namespace intelmp
89 {
90 
91 class FloatingPointer : public SimObject
92 {
93  protected:
94  typedef X86IntelMPFloatingPointerParams Params;
95 
96  uint32_t tableAddr;
97  uint8_t specRev;
98  uint8_t defaultConfig;
100 
101  static const char signature[];
102 
103  public:
104 
105  Addr writeOut(PortProxy& proxy, Addr addr);
106 
108  {
109  return tableAddr;
110  }
111 
113  {
114  tableAddr = addr;
115  }
116 
117  FloatingPointer(const Params &p);
118 };
119 
121 {
122  protected:
123  typedef X86IntelMPBaseConfigEntryParams Params;
124 
125  uint8_t type;
126 
127  public:
128 
129  virtual Addr writeOut(PortProxy& proxy, Addr addr, uint8_t &checkSum);
130 
131  BaseConfigEntry(const Params &p, uint8_t _type);
132 };
133 
134 class ExtConfigEntry : public SimObject
135 {
136  protected:
137  typedef X86IntelMPExtConfigEntryParams Params;
138 
139  uint8_t type;
140  uint8_t length;
141 
142  public:
143 
144  virtual Addr writeOut(PortProxy& proxy, Addr addr, uint8_t &checkSum);
145 
146  ExtConfigEntry(const Params &p, uint8_t _type, uint8_t _length);
147 };
148 
149 class ConfigTable : public SimObject
150 {
151  protected:
152  typedef X86IntelMPConfigTableParams Params;
153 
154  static const char signature[];
155 
156  uint8_t specRev;
157  std::string oemID;
158  std::string productID;
159  uint32_t oemTableAddr;
160  uint16_t oemTableSize;
161  uint32_t localApic;
162 
165 
166  public:
167  Addr writeOut(PortProxy& proxy, Addr addr);
168 
169  ConfigTable(const Params &p);
170 };
171 
173 {
174  protected:
175  typedef X86IntelMPProcessorParams Params;
176 
177  uint8_t localApicID;
179  uint8_t cpuFlags;
180  uint32_t cpuSignature;
181  uint32_t featureFlags;
182 
183  public:
184  Addr writeOut(PortProxy& proxy, Addr addr, uint8_t &checkSum);
185 
186  Processor(const Params &p);
187 };
188 
189 class Bus : public BaseConfigEntry
190 {
191  protected:
192  typedef X86IntelMPBusParams Params;
193 
194  uint8_t busID;
195  std::string busType;
196 
197  public:
198  Addr writeOut(PortProxy& proxy, Addr addr, uint8_t &checkSum);
199 
200  Bus(const Params &p);
201 };
202 
203 class IOAPIC : public BaseConfigEntry
204 {
205  protected:
206  typedef X86IntelMPIOAPICParams Params;
207 
208  uint8_t id;
209  uint8_t version;
210  uint8_t flags;
211  uint32_t address;
212 
213  public:
214  Addr writeOut(PortProxy& proxy, Addr addr, uint8_t &checkSum);
215 
216  IOAPIC(const Params &p);
217 };
218 
220 {
221  protected:
222  uint8_t interruptType;
223 
224  uint16_t flags;
225 
226  uint8_t sourceBusID;
227  uint8_t sourceBusIRQ;
228 
229  uint8_t destApicID;
230  uint8_t destApicIntIn;
231 
232  public:
233  Addr writeOut(PortProxy& proxy, Addr addr, uint8_t &checkSum);
234 
235  IntAssignment(const X86IntelMPBaseConfigEntryParams &p,
236  enums::X86IntelMPInterruptType _interruptType,
237  enums::X86IntelMPPolarity polarity,
238  enums::X86IntelMPTriggerMode trigger,
239  uint8_t _type,
240  uint8_t _sourceBusID, uint8_t _sourceBusIRQ,
241  uint8_t _destApicID, uint8_t _destApicIntIn) :
242  BaseConfigEntry(p, _type),
243  interruptType(_interruptType), flags(0),
244  sourceBusID(_sourceBusID), sourceBusIRQ(_sourceBusIRQ),
245  destApicID(_destApicID), destApicIntIn(_destApicIntIn)
246  {
247  replaceBits(flags, 1, 0, polarity);
248  replaceBits(flags, 3, 2, trigger);
249  }
250 };
251 
253 {
254  protected:
255  typedef X86IntelMPIOIntAssignmentParams Params;
256 
257  public:
258  IOIntAssignment(const Params &p);
259 };
260 
262 {
263  protected:
264  typedef X86IntelMPLocalIntAssignmentParams Params;
265 
266  public:
267  LocalIntAssignment(const Params &p);
268 };
269 
271 {
272  protected:
273  typedef X86IntelMPAddrSpaceMappingParams Params;
274 
275  uint8_t busID;
276  uint8_t addrType;
277  uint64_t addr;
278  uint64_t addrLength;
279 
280  public:
281  Addr writeOut(PortProxy& proxy, Addr addr, uint8_t &checkSum);
282 
283  AddrSpaceMapping(const Params &p);
284 };
285 
287 {
288  protected:
289  typedef X86IntelMPBusHierarchyParams Params;
290 
291  uint8_t busID;
292  uint8_t info;
293  uint8_t parentBus;
294 
295  public:
296  Addr writeOut(PortProxy& proxy, Addr addr, uint8_t &checkSum);
297 
298  BusHierarchy(const Params &p);
299 };
300 
302 {
303  protected:
304  typedef X86IntelMPCompatAddrSpaceModParams Params;
305 
306  uint8_t busID;
307  uint8_t mod;
308  uint32_t rangeList;
309 
310  public:
311  Addr writeOut(PortProxy& proxy, Addr addr, uint8_t &checkSum);
312 
313  CompatAddrSpaceMod(const Params &p);
314 };
315 
316 } // namespace intelmp
317 } // namespace X86ISA
318 } // namespace gem5
319 
320 #endif
This object is a proxy for a port or other object which implements the functional response protocol,...
Definition: port_proxy.hh:87
Abstract superclass for simulation objects.
Definition: sim_object.hh:148
Addr writeOut(PortProxy &proxy, Addr addr, uint8_t &checkSum)
Definition: intelmp.cc:341
X86IntelMPAddrSpaceMappingParams Params
Definition: intelmp.hh:273
virtual Addr writeOut(PortProxy &proxy, Addr addr, uint8_t &checkSum)
Definition: intelmp.cc:154
BaseConfigEntry(const Params &p, uint8_t _type)
Definition: intelmp.cc:162
X86IntelMPBaseConfigEntryParams Params
Definition: intelmp.hh:123
Addr writeOut(PortProxy &proxy, Addr addr, uint8_t &checkSum)
Definition: intelmp.cc:359
X86IntelMPBusHierarchyParams Params
Definition: intelmp.hh:289
X86IntelMPBusParams Params
Definition: intelmp.hh:192
Addr writeOut(PortProxy &proxy, Addr addr, uint8_t &checkSum)
Definition: intelmp.cc:282
Bus(const Params &p)
Definition: intelmp.cc:291
X86IntelMPCompatAddrSpaceModParams Params
Definition: intelmp.hh:304
Addr writeOut(PortProxy &proxy, Addr addr, uint8_t &checkSum)
Definition: intelmp.cc:382
std::vector< ExtConfigEntry * > extEntries
Definition: intelmp.hh:164
std::vector< BaseConfigEntry * > baseEntries
Definition: intelmp.hh:163
X86IntelMPConfigTableParams Params
Definition: intelmp.hh:152
static const char signature[]
Definition: intelmp.hh:154
Addr writeOut(PortProxy &proxy, Addr addr)
Definition: intelmp.cc:186
virtual Addr writeOut(PortProxy &proxy, Addr addr, uint8_t &checkSum)
Definition: intelmp.cc:168
ExtConfigEntry(const Params &p, uint8_t _type, uint8_t _length)
Definition: intelmp.cc:178
X86IntelMPExtConfigEntryParams Params
Definition: intelmp.hh:137
Addr writeOut(PortProxy &proxy, Addr addr)
Definition: intelmp.cc:109
X86IntelMPFloatingPointerParams Params
Definition: intelmp.hh:94
IOAPIC(const Params &p)
Definition: intelmp.cc:307
Addr writeOut(PortProxy &proxy, Addr addr, uint8_t &checkSum)
Definition: intelmp.cc:296
X86IntelMPIOAPICParams Params
Definition: intelmp.hh:206
X86IntelMPIOIntAssignmentParams Params
Definition: intelmp.hh:255
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:235
Addr writeOut(PortProxy &proxy, Addr addr, uint8_t &checkSum)
Definition: intelmp.cc:315
X86IntelMPLocalIntAssignmentParams Params
Definition: intelmp.hh:264
X86IntelMPProcessorParams Params
Definition: intelmp.hh:175
Processor(const Params &p)
Definition: intelmp.cc:267
Addr writeOut(PortProxy &proxy, Addr addr, uint8_t &checkSum)
Definition: intelmp.cc:251
STL vector class.
Definition: stl.hh:37
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:197
GEM5_DEPRECATED_NAMESPACE(IntelMP, intelmp)
Bitfield< 63 > val
Definition: misc.hh:776
Bitfield< 3 > addr
Definition: types.hh:84
Bitfield< 0 > p
Definition: pagetable.hh:151
Bitfield< 21 > trigger
Definition: intmessage.hh:52
Reference material can be found at the JEDEC website: UFS standard http://www.jedec....
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Definition: types.hh:147
uint8_t writeOutField(PortProxy &proxy, Addr addr, T val)
Definition: intelmp.cc:72
uint8_t writeOutString(PortProxy &proxy, Addr addr, std::string str, int length)
Definition: intelmp.cc:86

Generated on Wed Dec 21 2022 10:22:28 for gem5 by doxygen 1.9.1