system.hh revision 9294
12929Sktlim@umich.edu/* 22929Sktlim@umich.edu * Copyright (c) 2010 ARM Limited 32932Sktlim@umich.edu * All rights reserved 42929Sktlim@umich.edu * 52929Sktlim@umich.edu * The license below extends only to copyright in the software and shall 62929Sktlim@umich.edu * not be construed as granting a license to any other intellectual 72929Sktlim@umich.edu * property including but not limited to intellectual property relating 82929Sktlim@umich.edu * to a hardware implementation of the functionality of the software 92929Sktlim@umich.edu * licensed hereunder. You may use the software subject to the license 102929Sktlim@umich.edu * terms below provided that you ensure that this notice is replicated 112929Sktlim@umich.edu * unmodified and in its entirety in all distributions of the software, 122929Sktlim@umich.edu * modified or unmodified, in source code or in binary form. 132929Sktlim@umich.edu * 142929Sktlim@umich.edu * Copyright (c) 2002-2005 The Regents of The University of Michigan 152929Sktlim@umich.edu * All rights reserved. 162929Sktlim@umich.edu * 172929Sktlim@umich.edu * Redistribution and use in source and binary forms, with or without 182929Sktlim@umich.edu * modification, are permitted provided that the following conditions are 192929Sktlim@umich.edu * met: redistributions of source code must retain the above copyright 202929Sktlim@umich.edu * notice, this list of conditions and the following disclaimer; 212929Sktlim@umich.edu * redistributions in binary form must reproduce the above copyright 222929Sktlim@umich.edu * notice, this list of conditions and the following disclaimer in the 232929Sktlim@umich.edu * documentation and/or other materials provided with the distribution; 242929Sktlim@umich.edu * neither the name of the copyright holders nor the names of its 252929Sktlim@umich.edu * contributors may be used to endorse or promote products derived from 262929Sktlim@umich.edu * this software without specific prior written permission. 272929Sktlim@umich.edu * 282932Sktlim@umich.edu * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 292932Sktlim@umich.edu * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 302932Sktlim@umich.edu * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 312929Sktlim@umich.edu * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 326007Ssteve.reinhardt@amd.com * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 332929Sktlim@umich.edu * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 342929Sktlim@umich.edu * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 352929Sktlim@umich.edu * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 362929Sktlim@umich.edu * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 372929Sktlim@umich.edu * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 382929Sktlim@umich.edu * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 392929Sktlim@umich.edu * 402929Sktlim@umich.edu * Authors: Ali Saidi 412929Sktlim@umich.edu */ 422929Sktlim@umich.edu 432929Sktlim@umich.edu#ifndef __ARCH_ARM_SYSTEM_HH__ 442929Sktlim@umich.edu#define __ARCH_ARM_SYSTEM_HH__ 452929Sktlim@umich.edu 462929Sktlim@umich.edu#include <string> 476007Ssteve.reinhardt@amd.com#include <vector> 486007Ssteve.reinhardt@amd.com 496007Ssteve.reinhardt@amd.com#include "kern/linux/events.hh" 506007Ssteve.reinhardt@amd.com#include "params/ArmSystem.hh" 516007Ssteve.reinhardt@amd.com#include "sim/sim_object.hh" 526007Ssteve.reinhardt@amd.com#include "sim/system.hh" 536007Ssteve.reinhardt@amd.com 546007Ssteve.reinhardt@amd.comclass ArmSystem : public System 556007Ssteve.reinhardt@amd.com{ 566007Ssteve.reinhardt@amd.com protected: 576007Ssteve.reinhardt@amd.com /** 586007Ssteve.reinhardt@amd.com * PC based event to skip the dprink() call and emulate its 596007Ssteve.reinhardt@amd.com * functionality 606007Ssteve.reinhardt@amd.com */ 616007Ssteve.reinhardt@amd.com Linux::DebugPrintkEvent *debugPrintkEvent; 626007Ssteve.reinhardt@amd.com 636007Ssteve.reinhardt@amd.com /** 646007Ssteve.reinhardt@amd.com * Pointer to the bootloader object 656007Ssteve.reinhardt@amd.com */ 666007Ssteve.reinhardt@amd.com ObjectFile *bootldr; 676007Ssteve.reinhardt@amd.com 686007Ssteve.reinhardt@amd.com public: 696007Ssteve.reinhardt@amd.com typedef ArmSystemParams Params; 706007Ssteve.reinhardt@amd.com const Params * 716007Ssteve.reinhardt@amd.com params() const 726007Ssteve.reinhardt@amd.com { 736007Ssteve.reinhardt@amd.com return dynamic_cast<const Params *>(_params); 746007Ssteve.reinhardt@amd.com } 756007Ssteve.reinhardt@amd.com 762929Sktlim@umich.edu ArmSystem(Params *p); 772929Sktlim@umich.edu ~ArmSystem(); 782929Sktlim@umich.edu 796007Ssteve.reinhardt@amd.com /** 806007Ssteve.reinhardt@amd.com * Initialise the system 816007Ssteve.reinhardt@amd.com */ 826007Ssteve.reinhardt@amd.com virtual void initState(); 836007Ssteve.reinhardt@amd.com 846007Ssteve.reinhardt@amd.com /** Check if an address should be uncacheable until all caches are enabled. 852929Sktlim@umich.edu * This exits because coherence on some addresses at boot is maintained via 862929Sktlim@umich.edu * sw coherence until the caches are enbaled. Since we don't support sw 872929Sktlim@umich.edu * coherence operations in gem5, this is a method that allows a system 882929Sktlim@umich.edu * type to designate certain addresses that should remain uncachebale 892929Sktlim@umich.edu * for a while. 906011Ssteve.reinhardt@amd.com */ 916007Ssteve.reinhardt@amd.com virtual bool adderBootUncacheable(Addr a) { return false; } 926007Ssteve.reinhardt@amd.com 936007Ssteve.reinhardt@amd.com virtual Addr fixFuncEventAddr(Addr addr) 946007Ssteve.reinhardt@amd.com { 956007Ssteve.reinhardt@amd.com // Remove the low bit that thumb symbols have set 966007Ssteve.reinhardt@amd.com // but that aren't actually odd aligned 976007Ssteve.reinhardt@amd.com if (addr & 0x1) 986007Ssteve.reinhardt@amd.com return addr & ~1; 996007Ssteve.reinhardt@amd.com return addr; 1006007Ssteve.reinhardt@amd.com } 1016007Ssteve.reinhardt@amd.com 1026007Ssteve.reinhardt@amd.com /** true if this a multiprocessor system */ 1036007Ssteve.reinhardt@amd.com bool multiProc; 1046007Ssteve.reinhardt@amd.com}; 1056011Ssteve.reinhardt@amd.com 1066007Ssteve.reinhardt@amd.com#endif 1076007Ssteve.reinhardt@amd.com 1086007Ssteve.reinhardt@amd.com