system.hh revision 9847
12086SN/A/* 22086SN/A * Copyright (c) 2010 ARM Limited 35268Sksewell@umich.edu * All rights reserved 42086SN/A * 52086SN/A * The license below extends only to copyright in the software and shall 62086SN/A * not be construed as granting a license to any other intellectual 72086SN/A * property including but not limited to intellectual property relating 82086SN/A * to a hardware implementation of the functionality of the software 92086SN/A * licensed hereunder. You may use the software subject to the license 102086SN/A * terms below provided that you ensure that this notice is replicated 112086SN/A * unmodified and in its entirety in all distributions of the software, 122086SN/A * modified or unmodified, in source code or in binary form. 132086SN/A * 142086SN/A * Copyright (c) 2002-2005 The Regents of The University of Michigan 152086SN/A * All rights reserved. 162086SN/A * 172086SN/A * Redistribution and use in source and binary forms, with or without 182086SN/A * modification, are permitted provided that the following conditions are 192086SN/A * met: redistributions of source code must retain the above copyright 202086SN/A * notice, this list of conditions and the following disclaimer; 212086SN/A * redistributions in binary form must reproduce the above copyright 222086SN/A * notice, this list of conditions and the following disclaimer in the 232086SN/A * documentation and/or other materials provided with the distribution; 242086SN/A * neither the name of the copyright holders nor the names of its 252086SN/A * contributors may be used to endorse or promote products derived from 262086SN/A * this software without specific prior written permission. 272086SN/A * 282665Ssaidi@eecs.umich.edu * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 292665Ssaidi@eecs.umich.edu * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 302665Ssaidi@eecs.umich.edu * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 312686Sksewell@umich.edu * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 322086SN/A * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 334202Sbinkertn@umich.edu * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 342086SN/A * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 354202Sbinkertn@umich.edu * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 368758Sgblack@eecs.umich.edu * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 374202Sbinkertn@umich.edu * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 388745Sgblack@eecs.umich.edu * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 396313Sgblack@eecs.umich.edu * 408758Sgblack@eecs.umich.edu * Authors: Ali Saidi 418758Sgblack@eecs.umich.edu */ 424997Sgblack@eecs.umich.edu 434202Sbinkertn@umich.edu#ifndef __ARCH_ARM_SYSTEM_HH__ 448758Sgblack@eecs.umich.edu#define __ARCH_ARM_SYSTEM_HH__ 454997Sgblack@eecs.umich.edu 468745Sgblack@eecs.umich.edu#include <string> 478745Sgblack@eecs.umich.edu#include <vector> 484997Sgblack@eecs.umich.edu 495192Ssaidi@eecs.umich.edu#include "kern/linux/events.hh" 504202Sbinkertn@umich.edu#include "params/ArmSystem.hh" 517799Sgblack@eecs.umich.edu#include "sim/sim_object.hh" 525222Sksewell@umich.edu#include "sim/system.hh" 535222Sksewell@umich.edu 545222Sksewell@umich.educlass ArmSystem : public System 555222Sksewell@umich.edu{ 565222Sksewell@umich.edu protected: 575222Sksewell@umich.edu /** 584202Sbinkertn@umich.edu * PC based event to skip the dprink() call and emulate its 594202Sbinkertn@umich.edu * functionality 604202Sbinkertn@umich.edu */ 614202Sbinkertn@umich.edu Linux::DebugPrintkEvent *debugPrintkEvent; 622086SN/A 634202Sbinkertn@umich.edu /** 644202Sbinkertn@umich.edu * Pointer to the bootloader object 654202Sbinkertn@umich.edu */ 664202Sbinkertn@umich.edu ObjectFile *bootldr; 674202Sbinkertn@umich.edu 684202Sbinkertn@umich.edu public: 69 typedef ArmSystemParams Params; 70 const Params * 71 params() const 72 { 73 return dynamic_cast<const Params *>(_params); 74 } 75 76 ArmSystem(Params *p); 77 ~ArmSystem(); 78 79 /** 80 * Initialise the system 81 */ 82 virtual void initState(); 83 84 /** Check if an address should be uncacheable until all caches are enabled. 85 * This exits because coherence on some addresses at boot is maintained via 86 * sw coherence until the caches are enbaled. Since we don't support sw 87 * coherence operations in gem5, this is a method that allows a system 88 * type to designate certain addresses that should remain uncachebale 89 * for a while. 90 */ 91 virtual bool adderBootUncacheable(Addr a) { return false; } 92 93 virtual Addr fixFuncEventAddr(Addr addr) 94 { 95 // Remove the low bit that thumb symbols have set 96 // but that aren't actually odd aligned 97 if (addr & 0x1) 98 return addr & ~1; 99 return addr; 100 } 101 102 /** true if this a multiprocessor system */ 103 bool multiProc; 104}; 105 106#endif 107 108