1/* 2 * Copyright (c) 2007 The Hewlett-Packard Development Company 3 * All rights reserved. 4 * 5 * Redistribution and use of this software in source and binary forms, 6 * with or without modification, are permitted provided that the 7 * following conditions are met: 8 * --- 43 unchanged lines hidden (view full) --- 52 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 53 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 54 * 55 * Authors: Gabe Black 56 */ 57 58#include "arch/x86/miscregs.hh" 59#include "arch/x86/system.hh" |
60#include "arch/x86/smbios.hh" |
61#include "arch/vtophys.hh" 62#include "base/remote_gdb.hh" 63#include "base/loader/object_file.hh" 64#include "base/loader/symtab.hh" 65#include "base/trace.hh" 66#include "cpu/thread_context.hh" 67#include "mem/physical.hh" 68#include "params/X86System.hh" 69#include "sim/byteswap.hh" 70 71 72using namespace LittleEndianGuest; 73using namespace X86ISA; 74 75X86System::X86System(Params *p) 76 : System(p) 77{ |
78 smbiosTable = new X86ISA::SMBios::SMBiosTable; 79 smbiosTable->smbiosHeader.majorVersion = 2; 80 smbiosTable->smbiosHeader.minorVersion = 5; 81 smbiosTable->smbiosHeader.intermediateHeader.smbiosBCDRevision = 0x25; |
82} 83 84void 85X86System::startup() 86{ 87 System::startup(); 88 // This is the boot strap processor (BSP). Initialize it to look like 89 // the boot loader has just turned control over to the 64 bit OS. We --- 140 unchanged lines hidden (view full) --- 230 csAttr.defaultSize = 0; 231 csAttr.longMode = 1; 232 threadContexts[0]->setMiscReg(MISCREG_CS_ATTR, csAttr); 233 234 threadContexts[0]->setPC(threadContexts[0]->getSystemPtr()->kernelEntry); 235 threadContexts[0]->setNextPC(threadContexts[0]->readPC()); 236 237 // We should now be in long mode. Yay! |
238 239 //Write out the SMBios/DMI table 240 writeOutSMBiosTable(0xF0000); |
241} 242 |
243void 244X86System::writeOutSMBiosTable(Addr header, Addr table) 245{ 246 // Get a port to write the table and header to memory. 247 FunctionalPort * physPort = threadContexts[0]->getPhysPort(); 248 249 // If the table location isn't specified, just put it after the header. 250 // The header size as of the 2.5 SMBios specification is 0x1F bytes 251 if (!table) { 252 if (!smbiosTable->smbiosHeader.intermediateHeader.tableAddr) 253 smbiosTable->smbiosHeader. 254 intermediateHeader.tableAddr = header + 0x1F; 255 } else { 256 smbiosTable->smbiosHeader.intermediateHeader.tableAddr = table; 257 } 258 259 smbiosTable->writeOut(physPort, header); 260} 261 262 |
263X86System::~X86System() 264{ |
265 delete smbiosTable; |
266} 267 268void 269X86System::serialize(std::ostream &os) 270{ 271 System::serialize(os); 272} 273 --- 12 unchanged lines hidden --- |