47 #include "params/X86IntelMPBaseConfigEntry.hh" 48 #include "params/X86IntelMPExtConfigEntry.hh" 51 #include "params/X86IntelMPConfigTable.hh" 52 #include "params/X86IntelMPFloatingPointer.hh" 55 #include "params/X86IntelMPBus.hh" 56 #include "params/X86IntelMPIOAPIC.hh" 57 #include "params/X86IntelMPIOIntAssignment.hh" 58 #include "params/X86IntelMPLocalIntAssignment.hh" 59 #include "params/X86IntelMPProcessor.hh" 62 #include "params/X86IntelMPAddrSpaceMapping.hh" 63 #include "params/X86IntelMPBusHierarchy.hh" 64 #include "params/X86IntelMPCompatAddrSpaceMod.hh" 74 uint64_t guestVal =
htole(val);
75 proxy.
writeBlob(addr, &guestVal,
sizeof(T));
88 char cleanedString[length + 1];
91 if (str.length() >
length) {
92 memcpy(cleanedString, str.c_str(),
length);
93 warn(
"Intel MP configuration table string \"%s\" " 94 "will be truncated to \"%s\".\n", str, (
char *)&cleanedString);
96 memcpy(cleanedString, str.c_str(), str.length());
97 memset(cleanedString + str.length(), 0, length - str.length());
99 proxy.
writeBlob(addr, &cleanedString, length);
101 uint8_t checkSum = 0;
103 checkSum += cleanedString[
i];
113 if (!tableAddr && !defaultConfig)
114 fatal(
"Either an MP configuration table or a default configuration " 116 if (tableAddr && defaultConfig)
117 fatal(
"Both an MP configuration table and a default configuration " 120 uint8_t checkSum = 0;
123 for (
int i = 0;
i < 4;
i++)
124 checkSum += signature[
i];
136 proxy.
writeBlob(addr + 11, &defaultConfig, 1);
137 checkSum += defaultConfig;
139 uint32_t features2_5 = imcrPresent ? (1 << 7) : 0;
142 checkSum = -checkSum;
143 proxy.
writeBlob(addr + 10, &checkSum, 1);
149 SimObject(p), tableAddr(0), specRev(p->spec_rev),
150 defaultConfig(p->default_config), imcrPresent(p->imcr_present)
154 X86IntelMPFloatingPointerParams::create()
184 uint8_t _type, uint8_t _length) :
193 uint8_t checkSum = 0;
196 for (
int i = 0;
i < 4;
i++)
197 checkSum += signature[
i];
211 checkSum +=
writeOutField(proxy, addr + 34, (uint16_t)baseEntries.size());
214 uint8_t reserved = 0;
215 proxy.
writeBlob(addr + 43, &reserved, 1);
216 checkSum += reserved;
220 for (baseEnt = baseEntries.begin();
221 baseEnt != baseEntries.end(); baseEnt++) {
222 offset += (*baseEnt)->writeOut(proxy, addr + offset, checkSum);
229 uint16_t extOffset = 0;
230 uint8_t extCheckSum = 0;
231 for (extEnt = extEntries.begin();
232 extEnt != extEntries.end(); extEnt++) {
233 extOffset += (*extEnt)->writeOut(proxy,
234 addr + offset + extOffset, extCheckSum);
238 extCheckSum = -extCheckSum;
242 checkSum = -checkSum;
245 return offset + extOffset;
249 specRev(p->spec_rev), oemID(p->oem_id), productID(p->product_id),
250 oemTableAddr(p->oem_table_addr), oemTableSize(p->oem_table_size),
251 localApic(p->local_apic),
252 baseEntries(p->base_entries), extEntries(p->ext_entries)
256 X86IntelMPConfigTableParams::create()
267 checkSum +=
writeOutField(proxy, addr + 2, localApicVersion);
272 uint32_t reserved = 0;
273 proxy.
writeBlob(addr + 12, &reserved, 4);
274 proxy.
writeBlob(addr + 16, &reserved, 4);
279 localApicID(p->local_apic_id), localApicVersion(p->local_apic_version),
280 cpuFlags(0), cpuSignature(0), featureFlags(p->feature_flags)
293 X86IntelMPProcessorParams::create()
309 busID(p->bus_id), busType(p->bus_type)
313 X86IntelMPBusParams::create()
331 id(p->
id), version(p->version), flags(0), address(p->address)
338 X86IntelMPIOAPICParams::create()
359 p->source_bus_id, p->source_bus_irq,
360 p->dest_io_apic_id, p->dest_io_apic_intin)
364 X86IntelMPIOIntAssignmentParams::create()
371 p->source_bus_id, p->source_bus_irq,
372 p->dest_local_apic_id, p->dest_local_apic_intin)
376 X86IntelMPLocalIntAssignmentParams::create()
395 busID(p->bus_id), addrType(p->address_type),
400 X86IntelMPAddrSpaceMappingParams::create()
414 uint32_t reserved = 0;
422 busID(p->bus_id), info(0), parentBus(p->parent_bus)
424 if (p->subtractive_decode)
429 X86IntelMPBusHierarchyParams::create()
447 busID(p->bus_id),
mod(0), rangeList(p->range_list)
454 X86IntelMPCompatAddrSpaceModParams::create()
Addr writeOut(PortProxy &proxy, Addr addr, uint8_t &checkSum)
X86IntelMPBaseConfigEntryParams Params
#define fatal(...)
This implements a cprintf based fatal() function.
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)
Overload hash function for BasicBlockRange type.
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 writeBlob(Addr addr, const void *p, int size) const
Same as tryWriteBlob, but insists on success.
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 port or other object which implements the functional response protocol...
IOIntAssignment(Params *p)
static const char signature[]
Abstract superclass for simulation objects.
Addr writeOut(PortProxy &proxy, Addr addr, uint8_t &checkSum)