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
4610554Salexandru.dutu@amd.com#include "arch/x86/regs/misc.hh"
475132Sgblack@eecs.umich.edu#include "params/X86System.hh"
485132Sgblack@eecs.umich.edu#include "sim/system.hh"
495132Sgblack@eecs.umich.edu
505334Sgblack@eecs.umich.edunamespace X86ISA
515334Sgblack@eecs.umich.edu{
525334Sgblack@eecs.umich.edu    namespace SMBios
535334Sgblack@eecs.umich.edu    {
545334Sgblack@eecs.umich.edu        class SMBiosTable;
555334Sgblack@eecs.umich.edu    }
565625Sgblack@eecs.umich.edu    namespace IntelMP
575625Sgblack@eecs.umich.edu    {
585625Sgblack@eecs.umich.edu        class FloatingPointer;
595625Sgblack@eecs.umich.edu        class ConfigTable;
605625Sgblack@eecs.umich.edu    }
6110299Salexandru.dutu@amd.com
6210554Salexandru.dutu@amd.com    void installSegDesc(ThreadContext *tc, SegmentRegIndex seg,
6310554Salexandru.dutu@amd.com                        SegDescriptor desc, bool longmode);
6410554Salexandru.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 GDTVirtAddr = 0xffff800000001000;
6810299Salexandru.dutu@amd.com    const uint64_t IDTVirtAddr = 0xffff800000002000;
6910299Salexandru.dutu@amd.com    const uint64_t TSSVirtAddr = 0xffff800000003000;
7010299Salexandru.dutu@amd.com    const uint64_t TSSPhysAddr = 0x63000;
7110299Salexandru.dutu@amd.com    const uint64_t ISTVirtAddr = 0xffff800000004000;
7210554Salexandru.dutu@amd.com    const uint64_t PFHandlerVirtAddr = 0xffff800000005000;
7310554Salexandru.dutu@amd.com    const uint64_t MMIORegionVirtAddr = 0xffffc90000000000;
7410554Salexandru.dutu@amd.com    const uint64_t MMIORegionPhysAddr = 0xffff0000;
755334Sgblack@eecs.umich.edu}
765334Sgblack@eecs.umich.edu
775132Sgblack@eecs.umich.educlass X86System : public System
785132Sgblack@eecs.umich.edu{
795132Sgblack@eecs.umich.edu  public:
805132Sgblack@eecs.umich.edu    typedef X86SystemParams Params;
815132Sgblack@eecs.umich.edu    X86System(Params *p);
825132Sgblack@eecs.umich.edu    ~X86System();
835132Sgblack@eecs.umich.edu
845132Sgblack@eecs.umich.edu/**
855132Sgblack@eecs.umich.edu * Serialization stuff
865132Sgblack@eecs.umich.edu */
875132Sgblack@eecs.umich.edu  public:
885299Sgblack@eecs.umich.edu
897532Ssteve.reinhardt@amd.com    void initState();
905132Sgblack@eecs.umich.edu
915132Sgblack@eecs.umich.edu  protected:
925334Sgblack@eecs.umich.edu
935334Sgblack@eecs.umich.edu    X86ISA::SMBios::SMBiosTable * smbiosTable;
945625Sgblack@eecs.umich.edu    X86ISA::IntelMP::FloatingPointer * mpFloatingPointer;
955625Sgblack@eecs.umich.edu    X86ISA::IntelMP::ConfigTable * mpConfigTable;
965627Sgblack@eecs.umich.edu    X86ISA::ACPI::RSDP * rsdp;
975334Sgblack@eecs.umich.edu
985615Sgblack@eecs.umich.edu    void writeOutSMBiosTable(Addr header,
995615Sgblack@eecs.umich.edu            Addr &headerSize, Addr &tableSize, Addr table = 0);
1005334Sgblack@eecs.umich.edu
1015625Sgblack@eecs.umich.edu    void writeOutMPTable(Addr fp,
1025625Sgblack@eecs.umich.edu            Addr &fpSize, Addr &tableSize, Addr table = 0);
1035625Sgblack@eecs.umich.edu
1045132Sgblack@eecs.umich.edu    const Params *params() const { return (const Params *)_params; }
1055132Sgblack@eecs.umich.edu
1065132Sgblack@eecs.umich.edu    virtual Addr fixFuncEventAddr(Addr addr)
1075132Sgblack@eecs.umich.edu    {
10812484Schristian.menard@tu-dresden.de        // XXX This may eventually have to do something useful.
1095132Sgblack@eecs.umich.edu        return addr;
1105132Sgblack@eecs.umich.edu    }
1115132Sgblack@eecs.umich.edu};
1125132Sgblack@eecs.umich.edu
1135132Sgblack@eecs.umich.edu#endif
1145132Sgblack@eecs.umich.edu
115