49 #include "params/X86IntelMPBaseConfigEntry.hh"
50 #include "params/X86IntelMPExtConfigEntry.hh"
53 #include "params/X86IntelMPConfigTable.hh"
54 #include "params/X86IntelMPFloatingPointer.hh"
57 #include "params/X86IntelMPBus.hh"
58 #include "params/X86IntelMPIOAPIC.hh"
59 #include "params/X86IntelMPIOIntAssignment.hh"
60 #include "params/X86IntelMPLocalIntAssignment.hh"
61 #include "params/X86IntelMPProcessor.hh"
64 #include "params/X86IntelMPAddrSpaceMapping.hh"
65 #include "params/X86IntelMPBusHierarchy.hh"
66 #include "params/X86IntelMPCompatAddrSpaceMod.hh"
77 proxy.
writeBlob(addr, (uint8_t *)(&guestVal),
sizeof(T));
90 char cleanedString[length + 1];
93 if (str.length() >
length) {
94 memcpy(cleanedString, str.c_str(),
length);
95 warn(
"Intel MP configuration table string \"%s\" "
96 "will be truncated to \"%s\".\n", str, (
char *)&cleanedString);
98 memcpy(cleanedString, str.c_str(), str.length());
99 memset(cleanedString + str.length(), 0, length - str.length());
101 proxy.
writeBlob(addr, (uint8_t *)(&cleanedString), length);
103 uint8_t checkSum = 0;
105 checkSum += cleanedString[
i];
115 if (!tableAddr && !defaultConfig)
116 fatal(
"Either an MP configuration table or a default configuration "
118 if (tableAddr && defaultConfig)
119 fatal(
"Both an MP configuration table and a default configuration "
122 uint8_t checkSum = 0;
124 proxy.
writeBlob(addr, (uint8_t *)signature, 4);
125 for (
int i = 0;
i < 4;
i++)
126 checkSum += signature[
i];
138 proxy.
writeBlob(addr + 11, &defaultConfig, 1);
139 checkSum += defaultConfig;
141 uint32_t features2_5 = imcrPresent ? (1 << 7) : 0;
144 checkSum = -checkSum;
145 proxy.
writeBlob(addr + 10, &checkSum, 1);
151 SimObject(p), tableAddr(0), specRev(p->spec_rev),
152 defaultConfig(p->default_config), imcrPresent(p->imcr_present)
156 X86IntelMPFloatingPointerParams::create()
186 uint8_t _type, uint8_t _length) :
195 uint8_t checkSum = 0;
197 proxy.
writeBlob(addr, (uint8_t *)signature, 4);
198 for (
int i = 0;
i < 4;
i++)
199 checkSum += signature[
i];
203 proxy.
writeBlob(addr + 6, (uint8_t *)(&specRev), 1);
213 checkSum +=
writeOutField(proxy, addr + 34, (uint16_t)baseEntries.size());
216 uint8_t reserved = 0;
217 proxy.
writeBlob(addr + 43, &reserved, 1);
218 checkSum += reserved;
222 for (baseEnt = baseEntries.begin();
223 baseEnt != baseEntries.end(); baseEnt++) {
224 offset += (*baseEnt)->writeOut(proxy, addr + offset, checkSum);
231 uint16_t extOffset = 0;
232 uint8_t extCheckSum = 0;
233 for (extEnt = extEntries.begin();
234 extEnt != extEntries.end(); extEnt++) {
235 extOffset += (*extEnt)->writeOut(proxy,
236 addr + offset + extOffset, extCheckSum);
240 extCheckSum = -extCheckSum;
244 checkSum = -checkSum;
247 return offset + extOffset;
251 specRev(p->spec_rev), oemID(p->oem_id), productID(p->product_id),
252 oemTableAddr(p->oem_table_addr), oemTableSize(p->oem_table_size),
253 localApic(p->local_apic),
254 baseEntries(p->base_entries), extEntries(p->ext_entries)
258 X86IntelMPConfigTableParams::create()
269 checkSum +=
writeOutField(proxy, addr + 2, localApicVersion);
274 uint32_t reserved = 0;
275 proxy.
writeBlob(addr + 12, (uint8_t *)(&reserved), 4);
276 proxy.
writeBlob(addr + 16, (uint8_t *)(&reserved), 4);
281 localApicID(p->local_apic_id), localApicVersion(p->local_apic_version),
282 cpuFlags(0), cpuSignature(0), featureFlags(p->feature_flags)
295 X86IntelMPProcessorParams::create()
311 busID(p->bus_id), busType(p->bus_type)
315 X86IntelMPBusParams::create()
333 id(p->
id), version(p->version), flags(0), address(p->address)
340 X86IntelMPIOAPICParams::create()
361 p->source_bus_id, p->source_bus_irq,
362 p->dest_io_apic_id, p->dest_io_apic_intin)
366 X86IntelMPIOIntAssignmentParams::create()
373 p->source_bus_id, p->source_bus_irq,
374 p->dest_local_apic_id, p->dest_local_apic_intin)
378 X86IntelMPLocalIntAssignmentParams::create()
397 busID(p->bus_id), addrType(p->address_type),
402 X86IntelMPAddrSpaceMappingParams::create()
416 uint32_t reserved = 0;
417 proxy.
writeBlob(addr + 5, (uint8_t *)(&reserved), 3);
424 busID(p->bus_id), info(0), parentBus(p->parent_bus)
426 if (p->subtractive_decode)
431 X86IntelMPBusHierarchyParams::create()
449 busID(p->bus_id),
mod(0), rangeList(p->range_list)
456 X86IntelMPCompatAddrSpaceModParams::create()
Addr writeOut(PortProxy &proxy, Addr addr, uint8_t &checkSum)
X86IntelMPBaseConfigEntryParams Params
Addr writeOut(PortProxy &proxy, Addr addr, uint8_t &checkSum)
BaseConfigEntry(Params *p, uint8_t _type)
Addr writeOut(PortProxy &proxy, Addr addr)
Addr writeOut(PortProxy &proxy, Addr addr, uint8_t &checkSum)
LocalIntAssignment(Params *p)
AddrSpaceMapping(Params *p)
Addr writeOut(PortProxy &proxy, Addr addr, uint8_t &checkSum)
uint8_t writeOutString(PortProxy &proxy, Addr addr, string str, int length)
CompatAddrSpaceMod(Params *p)
ExtConfigEntry(Params *p, uint8_t _type, uint8_t _length)
X86IntelMPFloatingPointerParams Params
uint8_t writeOutField(PortProxy &proxy, Addr addr, T val)
PortProxy Object Declaration.
virtual Addr writeOut(PortProxy &proxy, Addr addr, uint8_t &checkSum)
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.
Addr writeOut(PortProxy &proxy, Addr addr)
virtual Addr writeOut(PortProxy &proxy, Addr addr, uint8_t &checkSum)
static const char signature[]
X86IntelMPExtConfigEntryParams Params
Addr writeOut(PortProxy &proxy, Addr addr, uint8_t &checkSum)
Defines global host-dependent types: Counter, Tick, and (indirectly) {int,uint}{8,16,32,64}_t.
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Addr writeOut(PortProxy &proxy, Addr addr, uint8_t &checkSum)
X86IntelMPConfigTableParams Params
FloatingPointer(Params *p)
This object is a proxy for a structural port, to be used for debug accesses.
IOIntAssignment(Params *p)
virtual void writeBlob(Addr addr, const uint8_t *p, int size) const
Write size bytes from p to address.
static const char signature[]
Abstract superclass for simulation objects.
Addr writeOut(PortProxy &proxy, Addr addr, uint8_t &checkSum)