system.cc (5612:1bd333953e49) system.cc (5615:1c4b9b1aa500)
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)
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)
77{
78 smbiosTable = new X86ISA::SMBios::SMBiosTable;
79 smbiosTable->smbiosHeader.majorVersion = 2;
80 smbiosTable->smbiosHeader.minorVersion = 5;
81 smbiosTable->smbiosHeader.intermediateHeader.smbiosBCDRevision = 0x25;
82}
76 : System(p), smbiosTable(p->smbios_table)
77{}
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
90 // won't actually set up real mode or legacy protected mode descriptor

--- 140 unchanged lines hidden (view full) ---

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
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;
239 //Write out the SMBios/DMI table
237 //Write out the SMBios/DMI table
240 writeOutSMBiosTable(0xF0000);
238 writeOutSMBiosTable(ebdaPos, headerSize, structSize);
239 ebdaPos += (headerSize + structSize);
241}
242
243void
240}
241
242void
244X86System::writeOutSMBiosTable(Addr header, Addr table)
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
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 }
251 if (!table)
252 table = header + 0x1F;
253 smbiosTable->setTableAddr(table);
258
254
259 smbiosTable->writeOut(physPort, header);
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);
260}
261
262
263X86System::~X86System()
264{
265 delete smbiosTable;
266}
267

--- 18 unchanged lines hidden ---
261}
262
263
264X86System::~X86System()
265{
266 delete smbiosTable;
267}
268

--- 18 unchanged lines hidden ---