12567SN/A/*
22567SN/A * Copyright (c) 2002-2005 The Regents of The University of Michigan
32567SN/A * All rights reserved.
42567SN/A *
52567SN/A * Redistribution and use in source and binary forms, with or without
62567SN/A * modification, are permitted provided that the following conditions are
72567SN/A * met: redistributions of source code must retain the above copyright
82567SN/A * notice, this list of conditions and the following disclaimer;
92567SN/A * redistributions in binary form must reproduce the above copyright
102567SN/A * notice, this list of conditions and the following disclaimer in the
112567SN/A * documentation and/or other materials provided with the distribution;
122567SN/A * neither the name of the copyright holders nor the names of its
132567SN/A * contributors may be used to endorse or promote products derived from
142567SN/A * this software without specific prior written permission.
152567SN/A *
162567SN/A * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
172567SN/A * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
182567SN/A * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
192567SN/A * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
202567SN/A * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
212567SN/A * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
222567SN/A * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
232567SN/A * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
242567SN/A * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
252567SN/A * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
262567SN/A * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
272665Ssaidi@eecs.umich.edu *
282665Ssaidi@eecs.umich.edu * Authors: Ali Saidi
292567SN/A */
302567SN/A
312567SN/A#ifndef __ARCH_SPARC_SYSTEM_HH__
322567SN/A#define __ARCH_SPARC_SYSTEM_HH__
332567SN/A
342567SN/A#include <string>
352567SN/A#include <vector>
362567SN/A
372567SN/A#include "base/loader/symtab.hh"
382567SN/A#include "cpu/pc_event.hh"
392567SN/A#include "kern/system_events.hh"
404762Snate@binkert.org#include "params/SparcSystem.hh"
412567SN/A#include "sim/sim_object.hh"
422567SN/A#include "sim/system.hh"
432567SN/A
442567SN/Aclass SparcSystem : public System
452567SN/A{
462567SN/A  public:
474762Snate@binkert.org    typedef SparcSystemParams Params;
482567SN/A    SparcSystem(Params *p);
492650Ssaidi@eecs.umich.edu    ~SparcSystem();
502567SN/A
5111341Sandreas.hansson@arm.com    void initState() override;
528706Sandreas.hansson@arm.com
532567SN/A/**
542567SN/A * Serialization stuff
552567SN/A */
562567SN/A  public:
5711168Sandreas.hansson@arm.com    void serializeSymtab(CheckpointOut &cp) const override;
5811168Sandreas.hansson@arm.com    void unserializeSymtab(CheckpointIn &cp) override;
592567SN/A
602567SN/A    /** reset binary symbol table */
612567SN/A    SymbolTable *resetSymtab;
622567SN/A
632567SN/A    /** hypervison binary symbol table */
642567SN/A    SymbolTable *hypervisorSymtab;
652567SN/A
662567SN/A    /** openboot symbol table */
672567SN/A    SymbolTable *openbootSymtab;
682567SN/A
693745Sgblack@eecs.umich.edu    /** nvram symbol table? */
703745Sgblack@eecs.umich.edu    SymbolTable *nvramSymtab;
713745Sgblack@eecs.umich.edu
723745Sgblack@eecs.umich.edu    /** hypervisor desc symbol table? */
733745Sgblack@eecs.umich.edu    SymbolTable *hypervisorDescSymtab;
743745Sgblack@eecs.umich.edu
753745Sgblack@eecs.umich.edu    /** partition desc symbol table? */
763745Sgblack@eecs.umich.edu    SymbolTable *partitionDescSymtab;
773745Sgblack@eecs.umich.edu
782567SN/A    /** Object pointer for the reset binary */
792567SN/A    ObjectFile *reset;
802567SN/A
812567SN/A    /** Object pointer for the hypervisor code */
822567SN/A    ObjectFile *hypervisor;
832567SN/A
842567SN/A    /** Object pointer for the openboot code */
852567SN/A    ObjectFile *openboot;
862567SN/A
873745Sgblack@eecs.umich.edu    /** Object pointer for the nvram image */
883745Sgblack@eecs.umich.edu    ObjectFile *nvram;
893745Sgblack@eecs.umich.edu
903745Sgblack@eecs.umich.edu    /** Object pointer for the hypervisor description image */
913745Sgblack@eecs.umich.edu    ObjectFile *hypervisor_desc;
923745Sgblack@eecs.umich.edu
933745Sgblack@eecs.umich.edu    /** Object pointer for the partition description image */
943745Sgblack@eecs.umich.edu    ObjectFile *partition_desc;
953745Sgblack@eecs.umich.edu
962650Ssaidi@eecs.umich.edu    /** System Tick for syncronized tick across all cpus. */
972650Ssaidi@eecs.umich.edu    Tick sysTick;
982650Ssaidi@eecs.umich.edu
992567SN/A  protected:
1002567SN/A    const Params *params() const { return (const Params *)_params; }
1012567SN/A
1022567SN/A    /** Add a function-based event to reset binary. */
1032567SN/A    template <class T>
1047741Sgblack@eecs.umich.edu    T *
1057741Sgblack@eecs.umich.edu    addResetFuncEvent(const char *lbl)
1062567SN/A    {
1072567SN/A        return addFuncEvent<T>(resetSymtab, lbl);
1082567SN/A    }
1092567SN/A
1102567SN/A    /** Add a function-based event to the hypervisor. */
1112567SN/A    template <class T>
1127741Sgblack@eecs.umich.edu    T *
1137741Sgblack@eecs.umich.edu    addHypervisorFuncEvent(const char *lbl)
1142567SN/A    {
1152567SN/A        return addFuncEvent<T>(hypervisorSymtab, lbl);
1162567SN/A    }
1172567SN/A
1182567SN/A    /** Add a function-based event to the openboot. */
1192567SN/A    template <class T>
1207741Sgblack@eecs.umich.edu    T *
1217741Sgblack@eecs.umich.edu    addOpenbootFuncEvent(const char *lbl)
1222567SN/A    {
1232567SN/A        return addFuncEvent<T>(openbootSymtab, lbl);
1242567SN/A    }
1252567SN/A
12611347Sandreas.hansson@arm.com    Addr
12711347Sandreas.hansson@arm.com    fixFuncEventAddr(Addr addr) override
1283553Sgblack@eecs.umich.edu    {
1293553Sgblack@eecs.umich.edu        //XXX This may eventually have to do something useful.
1303553Sgblack@eecs.umich.edu        return addr;
1313553Sgblack@eecs.umich.edu    }
1322567SN/A};
1332567SN/A
1342567SN/A#endif
1352567SN/A
136