system.hh revision 2650:a012c079984a
110478SAndrew.Bardsley@arm.com/*
210478SAndrew.Bardsley@arm.com * Copyright (c) 2002-2005 The Regents of The University of Michigan
310478SAndrew.Bardsley@arm.com * All rights reserved.
410478SAndrew.Bardsley@arm.com *
510478SAndrew.Bardsley@arm.com * Redistribution and use in source and binary forms, with or without
610478SAndrew.Bardsley@arm.com * modification, are permitted provided that the following conditions are
710478SAndrew.Bardsley@arm.com * met: redistributions of source code must retain the above copyright
810478SAndrew.Bardsley@arm.com * notice, this list of conditions and the following disclaimer;
910478SAndrew.Bardsley@arm.com * redistributions in binary form must reproduce the above copyright
1010478SAndrew.Bardsley@arm.com * notice, this list of conditions and the following disclaimer in the
1110478SAndrew.Bardsley@arm.com * documentation and/or other materials provided with the distribution;
1210478SAndrew.Bardsley@arm.com * neither the name of the copyright holders nor the names of its
1310478SAndrew.Bardsley@arm.com * contributors may be used to endorse or promote products derived from
1410478SAndrew.Bardsley@arm.com * this software without specific prior written permission.
1510478SAndrew.Bardsley@arm.com *
1610478SAndrew.Bardsley@arm.com * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
1710478SAndrew.Bardsley@arm.com * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
1810478SAndrew.Bardsley@arm.com * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
1910478SAndrew.Bardsley@arm.com * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
2010478SAndrew.Bardsley@arm.com * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
2110478SAndrew.Bardsley@arm.com * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
2210478SAndrew.Bardsley@arm.com * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
2310478SAndrew.Bardsley@arm.com * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
2410478SAndrew.Bardsley@arm.com * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
2510478SAndrew.Bardsley@arm.com * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
2610478SAndrew.Bardsley@arm.com * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2710478SAndrew.Bardsley@arm.com */
2810478SAndrew.Bardsley@arm.com
2910478SAndrew.Bardsley@arm.com#ifndef __ARCH_SPARC_SYSTEM_HH__
3010478SAndrew.Bardsley@arm.com#define __ARCH_SPARC_SYSTEM_HH__
3110478SAndrew.Bardsley@arm.com
3210478SAndrew.Bardsley@arm.com#include <string>
3310478SAndrew.Bardsley@arm.com#include <vector>
3410478SAndrew.Bardsley@arm.com
3510478SAndrew.Bardsley@arm.com#include "base/loader/symtab.hh"
3610478SAndrew.Bardsley@arm.com#include "cpu/pc_event.hh"
3710478SAndrew.Bardsley@arm.com#include "kern/system_events.hh"
3810478SAndrew.Bardsley@arm.com#include "sim/sim_object.hh"
3911817SChristian.Menard@tu-dresden.de#include "sim/system.hh"
4010478SAndrew.Bardsley@arm.com
4110478SAndrew.Bardsley@arm.comclass SparcSystem : public System
4211793Sbrandon.potter@amd.com{
4311793Sbrandon.potter@amd.com  public:
4410478SAndrew.Bardsley@arm.com    struct Params : public System::Params
4510478SAndrew.Bardsley@arm.com    {
4610478SAndrew.Bardsley@arm.com        std::string reset_bin;
4711800Sbrandon.potter@amd.com        std::string hypervison_bin;
4810478SAndrew.Bardsley@arm.com        std::string openboot_bin;
4911817SChristian.Menard@tu-dresden.de        std::string boot_osflags;
5010478SAndrew.Bardsley@arm.com        uint64_t system_type;
5110478SAndrew.Bardsley@arm.com        uint64_t system_rev;
5210478SAndrew.Bardsley@arm.com    };
5310478SAndrew.Bardsley@arm.com
5410478SAndrew.Bardsley@arm.com    SparcSystem(Params *p);
5510478SAndrew.Bardsley@arm.com
5610478SAndrew.Bardsley@arm.com    ~SparcSystem();
5710478SAndrew.Bardsley@arm.com
5810478SAndrew.Bardsley@arm.com    virtual bool breakpoint();
5911817SChristian.Menard@tu-dresden.de
6012680Sgiacomo.travaglini@arm.com/**
6110478SAndrew.Bardsley@arm.com * Serialization stuff
6210478SAndrew.Bardsley@arm.com */
6313784Sgabeblack@google.com  public:
6413784Sgabeblack@google.com    virtual void serialize(std::ostream &os);
6510478SAndrew.Bardsley@arm.com    virtual void unserialize(Checkpoint *cp, const std::string &section);
6610478SAndrew.Bardsley@arm.com
6710478SAndrew.Bardsley@arm.com    /** reset binary symbol table */
6810478SAndrew.Bardsley@arm.com    SymbolTable *resetSymtab;
6910478SAndrew.Bardsley@arm.com
7010478SAndrew.Bardsley@arm.com    /** hypervison binary symbol table */
7110478SAndrew.Bardsley@arm.com    SymbolTable *hypervisorSymtab;
7210478SAndrew.Bardsley@arm.com
7310478SAndrew.Bardsley@arm.com    /** openboot symbol table */
7410478SAndrew.Bardsley@arm.com    SymbolTable *openbootSymtab;
7510478SAndrew.Bardsley@arm.com
7610478SAndrew.Bardsley@arm.com    /** Object pointer for the reset binary */
7710478SAndrew.Bardsley@arm.com    ObjectFile *reset;
7810478SAndrew.Bardsley@arm.com
7910478SAndrew.Bardsley@arm.com    /** Object pointer for the hypervisor code */
8010478SAndrew.Bardsley@arm.com    ObjectFile *hypervisor;
8110478SAndrew.Bardsley@arm.com
8210478SAndrew.Bardsley@arm.com    /** Object pointer for the openboot code */
8310478SAndrew.Bardsley@arm.com    ObjectFile *openboot;
8410478SAndrew.Bardsley@arm.com
8510478SAndrew.Bardsley@arm.com    /** System Tick for syncronized tick across all cpus. */
8613784Sgabeblack@google.com    Tick sysTick;
8710478SAndrew.Bardsley@arm.com
8810478SAndrew.Bardsley@arm.com  protected:
8910478SAndrew.Bardsley@arm.com    const Params *params() const { return (const Params *)_params; }
9010478SAndrew.Bardsley@arm.com
9110478SAndrew.Bardsley@arm.com    /** Add a function-based event to reset binary. */
9210478SAndrew.Bardsley@arm.com    template <class T>
9310478SAndrew.Bardsley@arm.com    T *SparcSystem::addResetFuncEvent(const char *lbl)
9410478SAndrew.Bardsley@arm.com    {
9510478SAndrew.Bardsley@arm.com        return addFuncEvent<T>(resetSymtab, lbl);
9610478SAndrew.Bardsley@arm.com    }
9710478SAndrew.Bardsley@arm.com
9810478SAndrew.Bardsley@arm.com    /** Add a function-based event to the hypervisor. */
9910478SAndrew.Bardsley@arm.com    template <class T>
10010478SAndrew.Bardsley@arm.com    T *SparcSystem::addHypervisorFuncEvent(const char *lbl)
10110478SAndrew.Bardsley@arm.com    {
10210478SAndrew.Bardsley@arm.com        return addFuncEvent<T>(hypervisorSymtab, lbl);
10310478SAndrew.Bardsley@arm.com    }
10410478SAndrew.Bardsley@arm.com
10510478SAndrew.Bardsley@arm.com    /** Add a function-based event to the openboot. */
10610478SAndrew.Bardsley@arm.com    template <class T>
10710478SAndrew.Bardsley@arm.com    T *SparcSystem::addOpenbootFuncEvent(const char *lbl)
10810478SAndrew.Bardsley@arm.com    {
10910478SAndrew.Bardsley@arm.com        return addFuncEvent<T>(openbootSymtab, lbl);
11010478SAndrew.Bardsley@arm.com    }
11110478SAndrew.Bardsley@arm.com
112    virtual Addr fixFuncEventAddr(Addr addr);
113
114};
115
116#endif
117
118