system.hh revision 10299
15132Sgblack@eecs.umich.edu/* 25132Sgblack@eecs.umich.edu * Copyright (c) 2007 The Hewlett-Packard Development Company 35132Sgblack@eecs.umich.edu * All rights reserved. 45132Sgblack@eecs.umich.edu * 57087Snate@binkert.org * The license below extends only to copyright in the software and shall 67087Snate@binkert.org * not be construed as granting a license to any other intellectual 77087Snate@binkert.org * property including but not limited to intellectual property relating 87087Snate@binkert.org * to a hardware implementation of the functionality of the software 97087Snate@binkert.org * licensed hereunder. You may use the software subject to the license 107087Snate@binkert.org * terms below provided that you ensure that this notice is replicated 117087Snate@binkert.org * unmodified and in its entirety in all distributions of the software, 127087Snate@binkert.org * modified or unmodified, in source code or in binary form. 135132Sgblack@eecs.umich.edu * 147087Snate@binkert.org * Redistribution and use in source and binary forms, with or without 157087Snate@binkert.org * modification, are permitted provided that the following conditions are 167087Snate@binkert.org * met: redistributions of source code must retain the above copyright 177087Snate@binkert.org * notice, this list of conditions and the following disclaimer; 187087Snate@binkert.org * redistributions in binary form must reproduce the above copyright 197087Snate@binkert.org * notice, this list of conditions and the following disclaimer in the 207087Snate@binkert.org * documentation and/or other materials provided with the distribution; 217087Snate@binkert.org * neither the name of the copyright holders nor the names of its 225132Sgblack@eecs.umich.edu * contributors may be used to endorse or promote products derived from 237087Snate@binkert.org * this software without specific prior written permission. 245132Sgblack@eecs.umich.edu * 255132Sgblack@eecs.umich.edu * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 265132Sgblack@eecs.umich.edu * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 275132Sgblack@eecs.umich.edu * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 285132Sgblack@eecs.umich.edu * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 295132Sgblack@eecs.umich.edu * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 305132Sgblack@eecs.umich.edu * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 315132Sgblack@eecs.umich.edu * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 325132Sgblack@eecs.umich.edu * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 335132Sgblack@eecs.umich.edu * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 345132Sgblack@eecs.umich.edu * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 355132Sgblack@eecs.umich.edu * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 365132Sgblack@eecs.umich.edu * 375132Sgblack@eecs.umich.edu * Authors: Gabe Black 385132Sgblack@eecs.umich.edu */ 395132Sgblack@eecs.umich.edu 405132Sgblack@eecs.umich.edu#ifndef __ARCH_X86_SYSTEM_HH__ 415132Sgblack@eecs.umich.edu#define __ARCH_X86_SYSTEM_HH__ 425132Sgblack@eecs.umich.edu 435132Sgblack@eecs.umich.edu#include <string> 445132Sgblack@eecs.umich.edu#include <vector> 455132Sgblack@eecs.umich.edu 465132Sgblack@eecs.umich.edu#include "base/loader/symtab.hh" 475132Sgblack@eecs.umich.edu#include "cpu/pc_event.hh" 485132Sgblack@eecs.umich.edu#include "kern/system_events.hh" 495132Sgblack@eecs.umich.edu#include "params/X86System.hh" 505132Sgblack@eecs.umich.edu#include "sim/sim_object.hh" 515132Sgblack@eecs.umich.edu#include "sim/system.hh" 525132Sgblack@eecs.umich.edu 535334Sgblack@eecs.umich.edunamespace X86ISA 545334Sgblack@eecs.umich.edu{ 555334Sgblack@eecs.umich.edu namespace SMBios 565334Sgblack@eecs.umich.edu { 575334Sgblack@eecs.umich.edu class SMBiosTable; 585334Sgblack@eecs.umich.edu } 595625Sgblack@eecs.umich.edu namespace IntelMP 605625Sgblack@eecs.umich.edu { 615625Sgblack@eecs.umich.edu class FloatingPointer; 625625Sgblack@eecs.umich.edu class ConfigTable; 635625Sgblack@eecs.umich.edu } 6410299Salexandru.dutu@amd.com 6510299Salexandru.dutu@amd.com /* memory mappings for KVMCpu in SE mode */ 6610299Salexandru.dutu@amd.com const uint64_t syscallCodeVirtAddr = 0xffff800000000000; 6710299Salexandru.dutu@amd.com const uint64_t syscallCodePhysAddr = 0x60000; 6810299Salexandru.dutu@amd.com const uint64_t GDTVirtAddr = 0xffff800000001000; 6910299Salexandru.dutu@amd.com const uint64_t GDTPhysAddr = 0x61000; 7010299Salexandru.dutu@amd.com const uint64_t IDTVirtAddr = 0xffff800000002000; 7110299Salexandru.dutu@amd.com const uint64_t IDTPhysAddr = 0x62000; 7210299Salexandru.dutu@amd.com const uint64_t TSSVirtAddr = 0xffff800000003000; 7310299Salexandru.dutu@amd.com const uint64_t TSSPhysAddr = 0x63000; 7410299Salexandru.dutu@amd.com const uint64_t ISTVirtAddr = 0xffff800000004000; 7510299Salexandru.dutu@amd.com const uint64_t ISTPhysAddr = 0x64000; 7610299Salexandru.dutu@amd.com 7710299Salexandru.dutu@amd.com const uint64_t pageTablePhysAddr = 0x70000; 785334Sgblack@eecs.umich.edu} 795334Sgblack@eecs.umich.edu 805132Sgblack@eecs.umich.educlass X86System : public System 815132Sgblack@eecs.umich.edu{ 825132Sgblack@eecs.umich.edu public: 835132Sgblack@eecs.umich.edu typedef X86SystemParams Params; 845132Sgblack@eecs.umich.edu X86System(Params *p); 855132Sgblack@eecs.umich.edu ~X86System(); 865132Sgblack@eecs.umich.edu 875132Sgblack@eecs.umich.edu/** 885132Sgblack@eecs.umich.edu * Serialization stuff 895132Sgblack@eecs.umich.edu */ 905132Sgblack@eecs.umich.edu public: 915299Sgblack@eecs.umich.edu 927532Ssteve.reinhardt@amd.com void initState(); 935132Sgblack@eecs.umich.edu 945132Sgblack@eecs.umich.edu protected: 955334Sgblack@eecs.umich.edu 965334Sgblack@eecs.umich.edu X86ISA::SMBios::SMBiosTable * smbiosTable; 975625Sgblack@eecs.umich.edu X86ISA::IntelMP::FloatingPointer * mpFloatingPointer; 985625Sgblack@eecs.umich.edu X86ISA::IntelMP::ConfigTable * mpConfigTable; 995627Sgblack@eecs.umich.edu X86ISA::ACPI::RSDP * rsdp; 1005334Sgblack@eecs.umich.edu 1015615Sgblack@eecs.umich.edu void writeOutSMBiosTable(Addr header, 1025615Sgblack@eecs.umich.edu Addr &headerSize, Addr &tableSize, Addr table = 0); 1035334Sgblack@eecs.umich.edu 1045625Sgblack@eecs.umich.edu void writeOutMPTable(Addr fp, 1055625Sgblack@eecs.umich.edu Addr &fpSize, Addr &tableSize, Addr table = 0); 1065625Sgblack@eecs.umich.edu 1075132Sgblack@eecs.umich.edu const Params *params() const { return (const Params *)_params; } 1085132Sgblack@eecs.umich.edu 1095132Sgblack@eecs.umich.edu virtual Addr fixFuncEventAddr(Addr addr) 1105132Sgblack@eecs.umich.edu { 1115132Sgblack@eecs.umich.edu //XXX This may eventually have to do something useful. 1125132Sgblack@eecs.umich.edu return addr; 1135132Sgblack@eecs.umich.edu } 1145132Sgblack@eecs.umich.edu}; 1155132Sgblack@eecs.umich.edu 1165132Sgblack@eecs.umich.edu#endif 1175132Sgblack@eecs.umich.edu 118