94,96c94,95
< #include "arch/x86/isa_traits.hh"
< #include "mem/port.hh"
< #include "sim/byteswap.hh"
---
> #include "enums/Characteristic.hh"
> #include "enums/ExtCharacteristic.hh"
97a97
> #include "sim/sim_object.hh"
98a99,103
> class FunctionalPort;
> class X86SMBiosBiosInformationParams;
> class X86SMBiosSMBiosStructureParams;
> class X86SMBiosSMBiosTableParams;
>
105c110
< class SMBiosStructure
---
> class SMBiosStructure : public SimObject
106a112,114
> protected:
> typedef X86SMBiosSMBiosStructureParams Params;
>
129,132c137
< virtual uint16_t
< writeOut(FunctionalPort * port, Addr addr)
< {
< port->writeBlob(addr, (uint8_t *)(&type), 1);
---
> virtual uint16_t writeOut(FunctionalPort * port, Addr addr);
134,135c139,140
< uint8_t length = getLength();
< port->writeBlob(addr + 1, (uint8_t *)(&length), 1);
---
> protected:
> bool stringFields;
137,138c142
< uint16_t handleGuest = X86ISA::htog(handle);
< port->writeBlob(addr + 2, (uint8_t *)(&handleGuest), 2);
---
> SMBiosStructure(Params * p, uint8_t _type);
140,143d143
< return length + getStringLength();
< }
<
< protected:
146,149c146
< void writeOutStrings(FunctionalPort * port, Addr addr)
< {
< std::vector<std::string>::iterator it;
< Addr offset = 0;
---
> void writeOutStrings(FunctionalPort * port, Addr addr);
151,155c148
< for (it = strings.begin(); it != strings.end(); it++) {
< port->writeBlob(addr + offset,
< (uint8_t *)it->c_str(), it->length() + 1);
< offset += it->length() + 1;
< }
---
> int getStringLength();
157,172d149
< const uint8_t nullTerminator = 0;
< port->writeBlob(addr + offset, (uint8_t *)(&nullTerminator), 1);
< }
<
< int getStringLength()
< {
< int size = 0;
< std::vector<std::string>::iterator it;
<
< for (it = strings.begin(); it != strings.end(); it++) {
< size += it->length() + 1;
< }
<
< return size + 1;
< }
<
175,191c152,154
< int addString(std::string & newString)
< {
< strings.push_back(newString);
< return strings.size();
< }
<
< std::string readString(int n)
< {
< assert(n > 0 && n <= strings.size());
< return strings[n - 1];
< }
<
< void setString(int n, std::string & newString)
< {
< assert(n > 0 && n <= strings.size());
< strings[n - 1] = newString;
< }
---
> int addString(std::string & newString);
> std::string readString(int n);
> void setString(int n, std::string & newString);
195a159,163
> protected:
> const static uint8_t Type = 0;
>
> typedef X86SMBiosBiosInformationParams Params;
>
214c182
< uint8_t major;
---
> uint8_t majorVer;
216c184
< uint8_t minor;
---
> uint8_t minorVer;
221a190,191
> BiosInformation(Params * p);
>
226c196
< class SMBiosTable
---
> class SMBiosTable : public SimObject
228c198,200
< public:
---
> protected:
> typedef X86SMBiosSMBiosTableParams Params;
>
284c256
< void writeOut(FunctionalPort * port, Addr addr);
---
> std::vector<SMBiosStructure *> structures;
286c258,272
< std::vector<SMBiosStructure> structures;
---
> public:
> SMBiosTable(Params * p);
>
> Addr getTableAddr()
> {
> return smbiosHeader.intermediateHeader.tableAddr;
> }
>
> void setTableAddr(Addr addr)
> {
> smbiosHeader.intermediateHeader.tableAddr = addr;
> }
>
> void writeOut(FunctionalPort * port, Addr addr,
> Addr &headerSize, Addr &structSize);