system.hh revision 6221
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 512567SN/A/** 522567SN/A * Serialization stuff 532567SN/A */ 542567SN/A public: 552567SN/A virtual void serialize(std::ostream &os); 562567SN/A virtual void unserialize(Checkpoint *cp, const std::string §ion); 572567SN/A 582567SN/A /** reset binary symbol table */ 592567SN/A SymbolTable *resetSymtab; 602567SN/A 612567SN/A /** hypervison binary symbol table */ 622567SN/A SymbolTable *hypervisorSymtab; 632567SN/A 642567SN/A /** openboot symbol table */ 652567SN/A SymbolTable *openbootSymtab; 662567SN/A 673745Sgblack@eecs.umich.edu /** nvram symbol table? */ 683745Sgblack@eecs.umich.edu SymbolTable *nvramSymtab; 693745Sgblack@eecs.umich.edu 703745Sgblack@eecs.umich.edu /** hypervisor desc symbol table? */ 713745Sgblack@eecs.umich.edu SymbolTable *hypervisorDescSymtab; 723745Sgblack@eecs.umich.edu 733745Sgblack@eecs.umich.edu /** partition desc symbol table? */ 743745Sgblack@eecs.umich.edu SymbolTable *partitionDescSymtab; 753745Sgblack@eecs.umich.edu 762567SN/A /** Object pointer for the reset binary */ 772567SN/A ObjectFile *reset; 782567SN/A 792567SN/A /** Object pointer for the hypervisor code */ 802567SN/A ObjectFile *hypervisor; 812567SN/A 822567SN/A /** Object pointer for the openboot code */ 832567SN/A ObjectFile *openboot; 842567SN/A 853745Sgblack@eecs.umich.edu /** Object pointer for the nvram image */ 863745Sgblack@eecs.umich.edu ObjectFile *nvram; 873745Sgblack@eecs.umich.edu 883745Sgblack@eecs.umich.edu /** Object pointer for the hypervisor description image */ 893745Sgblack@eecs.umich.edu ObjectFile *hypervisor_desc; 903745Sgblack@eecs.umich.edu 913745Sgblack@eecs.umich.edu /** Object pointer for the partition description image */ 923745Sgblack@eecs.umich.edu ObjectFile *partition_desc; 933745Sgblack@eecs.umich.edu 942650Ssaidi@eecs.umich.edu /** System Tick for syncronized tick across all cpus. */ 952650Ssaidi@eecs.umich.edu Tick sysTick; 962650Ssaidi@eecs.umich.edu 973584Ssaidi@eecs.umich.edu /** functional port to ROM */ 983584Ssaidi@eecs.umich.edu FunctionalPort funcRomPort; 993584Ssaidi@eecs.umich.edu 1003745Sgblack@eecs.umich.edu /** functional port to nvram */ 1013745Sgblack@eecs.umich.edu FunctionalPort funcNvramPort; 1023745Sgblack@eecs.umich.edu 1033745Sgblack@eecs.umich.edu /** functional port to hypervisor description */ 1043745Sgblack@eecs.umich.edu FunctionalPort funcHypDescPort; 1053745Sgblack@eecs.umich.edu 1063745Sgblack@eecs.umich.edu /** functional port to partition description */ 1073745Sgblack@eecs.umich.edu FunctionalPort funcPartDescPort; 1083745Sgblack@eecs.umich.edu 1092567SN/A protected: 1102567SN/A const Params *params() const { return (const Params *)_params; } 1112567SN/A 1122567SN/A /** Add a function-based event to reset binary. */ 1132567SN/A template <class T> 1143853Sgblack@eecs.umich.edu T *addResetFuncEvent(const char *lbl) 1152567SN/A { 1162567SN/A return addFuncEvent<T>(resetSymtab, lbl); 1172567SN/A } 1182567SN/A 1192567SN/A /** Add a function-based event to the hypervisor. */ 1202567SN/A template <class T> 1213853Sgblack@eecs.umich.edu T *addHypervisorFuncEvent(const char *lbl) 1222567SN/A { 1232567SN/A return addFuncEvent<T>(hypervisorSymtab, lbl); 1242567SN/A } 1252567SN/A 1262567SN/A /** Add a function-based event to the openboot. */ 1272567SN/A template <class T> 1283853Sgblack@eecs.umich.edu T *addOpenbootFuncEvent(const char *lbl) 1292567SN/A { 1302567SN/A return addFuncEvent<T>(openbootSymtab, lbl); 1312567SN/A } 1322567SN/A 1333553Sgblack@eecs.umich.edu virtual Addr fixFuncEventAddr(Addr addr) 1343553Sgblack@eecs.umich.edu { 1353553Sgblack@eecs.umich.edu //XXX This may eventually have to do something useful. 1363553Sgblack@eecs.umich.edu return addr; 1373553Sgblack@eecs.umich.edu } 1382567SN/A}; 1392567SN/A 1402567SN/A#endif 1412567SN/A 142