46 #include "params/X86SMBiosBiosInformation.hh"
47 #include "params/X86SMBiosSMBiosStructure.hh"
48 #include "params/X86SMBiosSMBiosTable.hh"
68 typename T::iterator vecIt;
69 for (vecIt = vec.begin(); vecIt != vec.end(); vecIt++) {
70 val |= (1 << (*vecIt));
80 uint8_t
length = getLength();
83 uint16_t handleGuest =
htole(handle);
86 return length + getStringLength();
100 const uint8_t nullTerminator = 0;
104 if (strings.size() == 0 && stringFields) {
108 for (it = strings.begin(); it != strings.end(); it++) {
110 offset += it->length() + 1;
122 for (it = strings.begin(); it != strings.end(); it++) {
123 size += it->length() + 1;
135 if (newString.length() == 0)
137 strings.push_back(newString);
138 return strings.size();
144 assert(
n > 0 &&
n <= strings.size());
145 return strings[
n - 1];
151 assert(
n > 0 &&
n <= strings.size());
152 strings[
n - 1] = newString;
157 startingAddrSegment(
p->starting_addr_segment),
158 romSize(
p->rom_size),
159 majorVer(
p->major), minorVer(
p->minor),
160 embContFirmwareMajor(
p->emb_cont_firmware_major),
161 embContFirmwareMinor(
p->emb_cont_firmware_minor)
180 uint16_t startingAddrSegmentGuest =
htole(startingAddrSegment);
186 uint64_t characteristicsGuest =
htole(characteristics);
189 uint16_t characteristicExtBytesGuest =
190 htole(characteristicExtBytes);
191 proxy.
writeBlob(
addr + 0x12, &characteristicExtBytesGuest, 2);
198 writeOutStrings(proxy,
addr + getLength());
208 assert(
p->major_version <= 9);
209 assert(
p->minor_version <= 9);
211 (
p->major_version << 4) |
p->minor_version;
223 uint8_t mainChecksum = 0;
225 proxy.
writeBlob(
addr, (uint8_t *)smbiosHeader.anchorString, 4);
226 for (
int i = 0;
i < 4;
i++)
227 mainChecksum += smbiosHeader.anchorString[
i];
231 proxy.
writeBlob(
addr + 0x5, &smbiosHeader.entryPointLength, 1);
232 mainChecksum += smbiosHeader.entryPointLength;
234 mainChecksum += smbiosHeader.majorVersion;
236 mainChecksum += smbiosHeader.minorVersion;
238 proxy.
writeBlob(
addr + 0xA, &smbiosHeader.entryPointRevision, 1);
239 mainChecksum += smbiosHeader.entryPointRevision;
241 for (
int i = 0;
i < 5;
i++)
242 mainChecksum += smbiosHeader.formattedArea[
i];
247 uint8_t intChecksum = 0;
250 smbiosHeader.intermediateHeader.anchorString, 5);
251 for (
int i = 0;
i < 5;
i++)
252 intChecksum += smbiosHeader.intermediateHeader.anchorString[
i];
257 uint32_t tableAddrGuest =
258 htole(smbiosHeader.intermediateHeader.tableAddr);
260 for (
int i = 0;
i < 4;
i++) {
261 intChecksum += tableAddrGuest;
262 tableAddrGuest >>= 8;
265 uint16_t numStructs =
letoh(structures.size());
267 for (
int i = 0;
i < 2;
i++) {
268 intChecksum += numStructs;
273 &smbiosHeader.intermediateHeader.smbiosBCDRevision, 1);
274 intChecksum += smbiosHeader.intermediateHeader.smbiosBCDRevision;
280 Addr base = smbiosHeader.intermediateHeader.tableAddr;
282 uint16_t maxSize = 0;
284 for (it = structures.begin(); it != structures.end(); it++) {
285 uint16_t size = (*it)->writeOut(proxy,
base +
offset);
297 maxSize =
htole(maxSize);
299 for (
int i = 0;
i < 2;
i++) {
300 mainChecksum += maxSize;
305 mainChecksum = -mainChecksum;
312 uint16_t tableSize =
offset;
313 tableSize =
htole(tableSize);
315 for (
int i = 0;
i < 2;
i++) {
316 intChecksum += tableSize;
320 intChecksum = -intChecksum;
325 X86SMBiosBiosInformationParams::create()
331 X86SMBiosSMBiosTableParams::create()