summaryrefslogtreecommitdiff
path: root/src/arch/x86/system.cc
diff options
context:
space:
mode:
authorGabe Black <gblack@eecs.umich.edu>2008-01-23 15:28:54 -0500
committerGabe Black <gblack@eecs.umich.edu>2008-01-23 15:28:54 -0500
commitca313e23033cd3f2ef827edf9a442ed1ae3d087f (patch)
treeb9afb1ebc98a9fa3eb79f9e789dfbf6694e9769d /src/arch/x86/system.cc
parent423bbe6499ee4a40cec40aa7e68d5af18bef6d59 (diff)
downloadgem5-ca313e23033cd3f2ef827edf9a442ed1ae3d087f.tar.xz
X86: Put an SMBios/DMI table in memory.
This is basically just the header right now, but there's an untested mechanism in place to fill out the table and make sure everything is updated correctly. --HG-- extra : convert_revision : c1610c0dfa211b7e0d091a04133695d84f500a1c
Diffstat (limited to 'src/arch/x86/system.cc')
-rw-r--r--src/arch/x86/system.cc29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/arch/x86/system.cc b/src/arch/x86/system.cc
index e0ef5dec0..947a7793e 100644
--- a/src/arch/x86/system.cc
+++ b/src/arch/x86/system.cc
@@ -57,6 +57,7 @@
#include "arch/x86/miscregs.hh"
#include "arch/x86/system.hh"
+#include "arch/x86/smbios.hh"
#include "arch/vtophys.hh"
#include "base/remote_gdb.hh"
#include "base/loader/object_file.hh"
@@ -74,6 +75,10 @@ using namespace X86ISA;
X86System::X86System(Params *p)
: System(p)
{
+ smbiosTable = new X86ISA::SMBios::SMBiosTable;
+ smbiosTable->smbiosHeader.majorVersion = 2;
+ smbiosTable->smbiosHeader.minorVersion = 5;
+ smbiosTable->smbiosHeader.intermediateHeader.smbiosBCDRevision = 0x25;
}
void
@@ -230,10 +235,34 @@ X86System::startup()
threadContexts[0]->setNextPC(threadContexts[0]->readPC());
// We should now be in long mode. Yay!
+
+ //Write out the SMBios/DMI table
+ writeOutSMBiosTable(0xF0000);
+}
+
+void
+X86System::writeOutSMBiosTable(Addr header, Addr table)
+{
+ // Get a port to write the table and header to memory.
+ FunctionalPort * physPort = threadContexts[0]->getPhysPort();
+
+ // If the table location isn't specified, just put it after the header.
+ // The header size as of the 2.5 SMBios specification is 0x1F bytes
+ if (!table) {
+ if (!smbiosTable->smbiosHeader.intermediateHeader.tableAddr)
+ smbiosTable->smbiosHeader.
+ intermediateHeader.tableAddr = header + 0x1F;
+ } else {
+ smbiosTable->smbiosHeader.intermediateHeader.tableAddr = table;
+ }
+
+ smbiosTable->writeOut(physPort, header);
}
+
X86System::~X86System()
{
+ delete smbiosTable;
}
void