system.hh revision 5714
12400SN/A/* 28706Sandreas.hansson@arm.com * Copyright (c) 2002-2005 The Regents of The University of Michigan 38706Sandreas.hansson@arm.com * All rights reserved. 48706Sandreas.hansson@arm.com * 58706Sandreas.hansson@arm.com * Redistribution and use in source and binary forms, with or without 68706Sandreas.hansson@arm.com * modification, are permitted provided that the following conditions are 78706Sandreas.hansson@arm.com * met: redistributions of source code must retain the above copyright 88706Sandreas.hansson@arm.com * notice, this list of conditions and the following disclaimer; 98706Sandreas.hansson@arm.com * redistributions in binary form must reproduce the above copyright 108706Sandreas.hansson@arm.com * notice, this list of conditions and the following disclaimer in the 118706Sandreas.hansson@arm.com * documentation and/or other materials provided with the distribution; 128706Sandreas.hansson@arm.com * neither the name of the copyright holders nor the names of its 138706Sandreas.hansson@arm.com * contributors may be used to endorse or promote products derived from 142400SN/A * this software without specific prior written permission. 152400SN/A * 162400SN/A * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 172400SN/A * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 182400SN/A * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 192400SN/A * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 202400SN/A * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 212400SN/A * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 222400SN/A * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 232400SN/A * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 242400SN/A * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 252400SN/A * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 262400SN/A * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 272400SN/A * 282400SN/A * Authors: Ali Saidi 292400SN/A */ 302400SN/A 312400SN/A#ifndef __ARCH_SPARC_SYSTEM_HH__ 322400SN/A#define __ARCH_SPARC_SYSTEM_HH__ 332400SN/A 342400SN/A#include <string> 352400SN/A#include <vector> 362400SN/A 372400SN/A#include "base/loader/symtab.hh" 382400SN/A#include "cpu/pc_event.hh" 392665SN/A#include "kern/system_events.hh" 402665SN/A#include "params/SparcSystem.hh" 412665SN/A#include "sim/sim_object.hh" 428706Sandreas.hansson@arm.com#include "sim/system.hh" 432400SN/A 442400SN/Aclass SparcSystem : public System 458706Sandreas.hansson@arm.com{ 468706Sandreas.hansson@arm.com public: 472400SN/A typedef SparcSystemParams Params; 488706Sandreas.hansson@arm.com SparcSystem(Params *p); 498706Sandreas.hansson@arm.com ~SparcSystem(); 508852Sandreas.hansson@arm.com 518852Sandreas.hansson@arm.com/** 522519SN/A * Serialization stuff 538706Sandreas.hansson@arm.com */ 548706Sandreas.hansson@arm.com public: 558706Sandreas.hansson@arm.com virtual void serialize(std::ostream &os); 568706Sandreas.hansson@arm.com virtual void unserialize(Checkpoint *cp, const std::string §ion); 578706Sandreas.hansson@arm.com 588706Sandreas.hansson@arm.com /** reset binary symbol table */ 598706Sandreas.hansson@arm.com SymbolTable *resetSymtab; 608706Sandreas.hansson@arm.com 618706Sandreas.hansson@arm.com /** hypervison binary symbol table */ 628706Sandreas.hansson@arm.com SymbolTable *hypervisorSymtab; 638706Sandreas.hansson@arm.com 648706Sandreas.hansson@arm.com /** openboot symbol table */ 658706Sandreas.hansson@arm.com SymbolTable *openbootSymtab; 668706Sandreas.hansson@arm.com 678706Sandreas.hansson@arm.com /** nvram symbol table? */ 688706Sandreas.hansson@arm.com SymbolTable *nvramSymtab; 692400SN/A 704434SN/A /** hypervisor desc symbol table? */ 714434SN/A SymbolTable *hypervisorDescSymtab; 724434SN/A 734434SN/A /** partition desc symbol table? */ 744434SN/A SymbolTable *partitionDescSymtab; 754434SN/A 764434SN/A /** Object pointer for the reset binary */ 772400SN/A ObjectFile *reset; 7810298Salexandru.dutu@amd.com 794434SN/A /** Object pointer for the hypervisor code */ 804434SN/A ObjectFile *hypervisor; 812400SN/A 822400SN/A /** Object pointer for the openboot code */ 838922Swilliam.wang@arm.com ObjectFile *openboot; 848706Sandreas.hansson@arm.com 852400SN/A /** Object pointer for the nvram image */ 868861Sandreas.hansson@arm.com ObjectFile *nvram; 8710564Sandreas.hansson@arm.com 888861Sandreas.hansson@arm.com /** Object pointer for the hypervisor description image */ 898861Sandreas.hansson@arm.com ObjectFile *hypervisor_desc; 908861Sandreas.hansson@arm.com 912445SN/A /** Object pointer for the partition description image */ 928861Sandreas.hansson@arm.com ObjectFile *partition_desc; 9310564Sandreas.hansson@arm.com 948861Sandreas.hansson@arm.com /** System Tick for syncronized tick across all cpus. */ 952640SN/A Tick sysTick; 968861Sandreas.hansson@arm.com 978861Sandreas.hansson@arm.com /** functional port to ROM */ 982400SN/A FunctionalPort funcRomPort; 992400SN/A 1008706Sandreas.hansson@arm.com /** functional port to nvram */ 101 FunctionalPort funcNvramPort; 102 103 /** functional port to hypervisor description */ 104 FunctionalPort funcHypDescPort; 105 106 /** functional port to partition description */ 107 FunctionalPort funcPartDescPort; 108 109 protected: 110 const Params *params() const { return (const Params *)_params; } 111 112 /** Add a function-based event to reset binary. */ 113 template <class T> 114 T *addResetFuncEvent(const char *lbl) 115 { 116 return addFuncEvent<T>(resetSymtab, lbl); 117 } 118 119 /** Add a function-based event to the hypervisor. */ 120 template <class T> 121 T *addHypervisorFuncEvent(const char *lbl) 122 { 123 return addFuncEvent<T>(hypervisorSymtab, lbl); 124 } 125 126 /** Add a function-based event to the openboot. */ 127 template <class T> 128 T *addOpenbootFuncEvent(const char *lbl) 129 { 130 return addFuncEvent<T>(openbootSymtab, lbl); 131 } 132 133 virtual Addr fixFuncEventAddr(Addr addr) 134 { 135 //XXX This may eventually have to do something useful. 136 return addr; 137 } 138}; 139 140#endif 141 142