system.hh revision 2902
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" 402567SN/A#include "sim/sim_object.hh" 412567SN/A#include "sim/system.hh" 422567SN/A 432567SN/Aclass SparcSystem : public System 442567SN/A{ 452567SN/A public: 462567SN/A struct Params : public System::Params 472567SN/A { 482567SN/A std::string reset_bin; 492567SN/A std::string hypervison_bin; 502567SN/A std::string openboot_bin; 512567SN/A std::string boot_osflags; 522567SN/A uint64_t system_type; 532567SN/A uint64_t system_rev; 542567SN/A }; 552567SN/A 562567SN/A SparcSystem(Params *p); 572567SN/A 582650Ssaidi@eecs.umich.edu ~SparcSystem(); 592567SN/A 602567SN/A virtual bool breakpoint(); 612567SN/A 622567SN/A/** 632567SN/A * Serialization stuff 642567SN/A */ 652567SN/A public: 662567SN/A virtual void serialize(std::ostream &os); 672567SN/A virtual void unserialize(Checkpoint *cp, const std::string §ion); 682567SN/A 692567SN/A /** reset binary symbol table */ 702567SN/A SymbolTable *resetSymtab; 712567SN/A 722567SN/A /** hypervison binary symbol table */ 732567SN/A SymbolTable *hypervisorSymtab; 742567SN/A 752567SN/A /** openboot symbol table */ 762567SN/A SymbolTable *openbootSymtab; 772567SN/A 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 872650Ssaidi@eecs.umich.edu /** System Tick for syncronized tick across all cpus. */ 882650Ssaidi@eecs.umich.edu Tick sysTick; 892650Ssaidi@eecs.umich.edu 902567SN/A protected: 912567SN/A const Params *params() const { return (const Params *)_params; } 922567SN/A 932567SN/A /** Add a function-based event to reset binary. */ 942567SN/A template <class T> 952567SN/A T *SparcSystem::addResetFuncEvent(const char *lbl) 962567SN/A { 972567SN/A return addFuncEvent<T>(resetSymtab, lbl); 982567SN/A } 992567SN/A 1002567SN/A /** Add a function-based event to the hypervisor. */ 1012567SN/A template <class T> 1022567SN/A T *SparcSystem::addHypervisorFuncEvent(const char *lbl) 1032567SN/A { 1042567SN/A return addFuncEvent<T>(hypervisorSymtab, lbl); 1052567SN/A } 1062567SN/A 1072567SN/A /** Add a function-based event to the openboot. */ 1082567SN/A template <class T> 1092567SN/A T *SparcSystem::addOpenbootFuncEvent(const char *lbl) 1102567SN/A { 1112567SN/A return addFuncEvent<T>(openbootSymtab, lbl); 1122567SN/A } 1132567SN/A 1142567SN/A virtual Addr fixFuncEventAddr(Addr addr); 1152567SN/A 1162567SN/A}; 1172567SN/A 1182567SN/A#endif 1192567SN/A 120