gem5 v24.0.0.0
Loading...
Searching...
No Matches
smbios.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 * Copyright (c) 2008 The Regents of The University of Michigan
15 * All rights reserved.
16 *
17 * Redistribution and use in source and binary forms, with or without
18 * modification, are permitted provided that the following conditions are
19 * met: redistributions of source code must retain the above copyright
20 * notice, this list of conditions and the following disclaimer;
21 * redistributions in binary form must reproduce the above copyright
22 * notice, this list of conditions and the following disclaimer in the
23 * documentation and/or other materials provided with the distribution;
24 * neither the name of the copyright holders nor the names of its
25 * contributors may be used to endorse or promote products derived from
26 * this software without specific prior written permission.
27 *
28 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
29 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
30 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
31 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
32 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
33 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
34 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
35 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
36 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
37 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
38 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
39 */
40
41#ifndef __ARCH_X86_BIOS_SMBIOS_HH__
42#define __ARCH_X86_BIOS_SMBIOS_HH__
43
44#include <string>
45#include <vector>
46
47#include "base/compiler.hh"
48#include "base/types.hh"
49#include "enums/Characteristic.hh"
50#include "enums/ExtCharacteristic.hh"
51#include "sim/sim_object.hh"
52
53namespace gem5
54{
55
56class PortProxy;
57struct X86SMBiosBiosInformationParams;
58struct X86SMBiosSMBiosStructureParams;
59struct X86SMBiosSMBiosTableParams;
60
61namespace X86ISA
62{
63
64namespace smbios
65{
66
68{
69 protected:
70 typedef X86SMBiosSMBiosStructureParams Params;
71
72 public:
73
74 virtual
77
78 // Offset 00h, 1 byte
79 uint8_t type;
80
81 // Offset 01h, 1 byte
82 //Length: computed when written to memory.
83
84 // Offset 02h, 2 bytes
85 uint16_t handle;
86
87 virtual uint8_t
89 {
90 // This is the size of a structure with nothing but the header
91 return 4;
92 }
93
94 virtual uint16_t writeOut(PortProxy& proxy, Addr addr);
95
96 protected:
98
99 SMBiosStructure(const Params &p, uint8_t _type);
100
102
103 void writeOutStrings(PortProxy& proxy, Addr addr);
104
105 int getStringLength();
106
107 public:
108
109 int addString(const std::string &new_string);
110 std::string readString(int n);
111 void setString(int n, const std::string &new_string);
112};
113
115{
116 protected:
117 const static uint8_t Type = 0;
118
119 typedef X86SMBiosBiosInformationParams Params;
120
121 public:
122 // Offset 04h, 1 byte
123 uint8_t vendor;
124 // Offset 05h, 1 byte
125 uint8_t version;
126 // Offset 06h, 2 bytes
128 // Offset 08h, 1 byte
129 uint8_t releaseDate;
130 // Offset 09h, 1 byte
131 uint8_t romSize;
132 // Offset 0Ah, 8 bytes
133 //See tables in 3.3.1 in the SMBios 2.5 spec from the DMTF for
134 //bit definitions.
136 // Offset 12h, 2 bytes
138 // Offset 14h, 1 byte
139 uint8_t majorVer;
140 // Offset 15h, 1 byte
141 uint8_t minorVer;
142 // Offset 16h, 1 byte
144 // Offset 17h, 1 byte
146
147 BiosInformation(const Params &p);
148
149 uint8_t getLength() { return 0x18; }
150 uint16_t writeOut(PortProxy& proxy, Addr addr);
151};
152
153class SMBiosTable : public SimObject
154{
155 protected:
156 typedef X86SMBiosSMBiosTableParams Params;
157
159 {
161 {}
162
163 // Offset 00h, 4 bytes
164 static const char anchorString[];
165
166 // Offset 04h, 1 byte
167 //Checksum: computed when written to memory.
168
169 // Offset 05h, 1 byte
170 static const uint8_t entryPointLength;
171
172 // Offset 06h, 1 byte
174
175 // Offset 07h, 1 byte
177
178 // Offset 08h, 2 bytes
179 //Maximum structure size: computed when written to memory.
180
181 // Offset 0Ah, 1 byte
182 static const uint8_t entryPointRevision;
183
184 // Offset 0Bh, 5 bytes
185 static const uint8_t formattedArea[5];
186
187 // Offset 10h, 15 bytes
189 {
192 // Offset 10h, 5 bytes
193 static const char anchorString[];
194
195 // Offset 15h, 1 byte
196 //Checksum: computed when written to memory.
197
198 // Offset 16h, 2 bytes
199 //Length of the structure table in bytes: computed when
200 //written to memory.
201
202 // Offset 18h, 4 bytes
203 uint32_t tableAddr;
204
205 // Offset 1Ch, 2 bytes
206 //Number of structures: computed when written to memory
207
208 // Offset 1Eh, 1 byte
212
214
215 public:
216 SMBiosTable(const Params &p);
217
222
227
228 void writeOut(PortProxy& proxy, Addr addr,
229 Addr &headerSize, Addr &structSize);
230};
231
232} // namespace smbios
233} // namespace X86ISA
234} // namespace gem5
235
236#endif
Defines global host-dependent types: Counter, Tick, and (indirectly) {int,uint}{8,...
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.
X86SMBiosBiosInformationParams Params
Definition smbios.hh:119
uint16_t writeOut(PortProxy &proxy, Addr addr)
Definition smbios.cc:175
SMBiosStructure(const Params &p, uint8_t _type)
Definition smbios.cc:89
int addString(const std::string &new_string)
Definition smbios.cc:131
std::vector< std::string > strings
Definition smbios.hh:101
X86SMBiosSMBiosStructureParams Params
Definition smbios.hh:70
void setString(int n, const std::string &new_string)
Definition smbios.cc:150
void writeOutStrings(PortProxy &proxy, Addr addr)
Definition smbios.cc:95
virtual uint16_t writeOut(PortProxy &proxy, Addr addr)
Definition smbios.cc:76
void writeOut(PortProxy &proxy, Addr addr, Addr &headerSize, Addr &structSize)
Definition smbios.cc:217
struct gem5::X86ISA::smbios::SMBiosTable::SMBiosHeader smbiosHeader
std::vector< SMBiosStructure * > structures
Definition smbios.hh:213
X86SMBiosSMBiosTableParams Params
Definition smbios.hh:156
STL vector class.
Definition stl.hh:37
Bitfield< 31 > n
Bitfield< 3 > addr
Definition types.hh:84
Bitfield< 0 > p
Definition pagetable.hh:151
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
Definition binary32.hh:36
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Definition types.hh:147
struct gem5::X86ISA::smbios::SMBiosTable::SMBiosHeader::IntermediateHeader intermediateHeader

Generated on Tue Jun 18 2024 16:24:00 for gem5 by doxygen 1.11.0