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 * --- 59 unchanged lines hidden (view full) --- 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), smbiosTable(p->smbios_table) 77{} |
78 79void 80X86System::startup() 81{ 82 System::startup(); 83 // This is the boot strap processor (BSP). Initialize it to look like 84 // the boot loader has just turned control over to the 64 bit OS. We 85 // won't actually set up real mode or legacy protected mode descriptor --- 140 unchanged lines hidden (view full) --- 226 csAttr.longMode = 1; 227 threadContexts[0]->setMiscReg(MISCREG_CS_ATTR, csAttr); 228 229 threadContexts[0]->setPC(threadContexts[0]->getSystemPtr()->kernelEntry); 230 threadContexts[0]->setNextPC(threadContexts[0]->readPC()); 231 232 // We should now be in long mode. Yay! 233 |
234 Addr ebdaPos = 0xF0000; 235 236 Addr headerSize, structSize; |
237 //Write out the SMBios/DMI table |
238 writeOutSMBiosTable(ebdaPos, headerSize, structSize); 239 ebdaPos += (headerSize + structSize); |
240} 241 242void |
243X86System::writeOutSMBiosTable(Addr header, 244 Addr &headerSize, Addr &structSize, 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 table = header + 0x1F; 253 smbiosTable->setTableAddr(table); |
254 |
255 smbiosTable->writeOut(physPort, header, headerSize, structSize); 256 257 // Do some bounds checking to make sure we at least didn't step on 258 // ourselves. 259 assert(header > table || header + headerSize <= table); 260 assert(table > header || table + structSize <= header); |
261} 262 263 264X86System::~X86System() 265{ 266 delete smbiosTable; 267} 268 --- 18 unchanged lines hidden --- |