system.hh revision 9847
14202Sbinkertn@umich.edu/* 24202Sbinkertn@umich.edu * Copyright (c) 2010 ARM Limited 34202Sbinkertn@umich.edu * All rights reserved 44202Sbinkertn@umich.edu * 54202Sbinkertn@umich.edu * The license below extends only to copyright in the software and shall 64202Sbinkertn@umich.edu * not be construed as granting a license to any other intellectual 74202Sbinkertn@umich.edu * property including but not limited to intellectual property relating 84202Sbinkertn@umich.edu * to a hardware implementation of the functionality of the software 94202Sbinkertn@umich.edu * licensed hereunder. You may use the software subject to the license 104202Sbinkertn@umich.edu * terms below provided that you ensure that this notice is replicated 114202Sbinkertn@umich.edu * unmodified and in its entirety in all distributions of the software, 124202Sbinkertn@umich.edu * modified or unmodified, in source code or in binary form. 134202Sbinkertn@umich.edu * 144202Sbinkertn@umich.edu * Copyright (c) 2002-2005 The Regents of The University of Michigan 154202Sbinkertn@umich.edu * All rights reserved. 164202Sbinkertn@umich.edu * 174202Sbinkertn@umich.edu * Redistribution and use in source and binary forms, with or without 184202Sbinkertn@umich.edu * modification, are permitted provided that the following conditions are 194202Sbinkertn@umich.edu * met: redistributions of source code must retain the above copyright 204202Sbinkertn@umich.edu * notice, this list of conditions and the following disclaimer; 214202Sbinkertn@umich.edu * redistributions in binary form must reproduce the above copyright 224202Sbinkertn@umich.edu * notice, this list of conditions and the following disclaimer in the 234202Sbinkertn@umich.edu * documentation and/or other materials provided with the distribution; 244202Sbinkertn@umich.edu * neither the name of the copyright holders nor the names of its 254202Sbinkertn@umich.edu * contributors may be used to endorse or promote products derived from 264202Sbinkertn@umich.edu * this software without specific prior written permission. 274202Sbinkertn@umich.edu * 284202Sbinkertn@umich.edu * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 294202Sbinkertn@umich.edu * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 304202Sbinkertn@umich.edu * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 314202Sbinkertn@umich.edu * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 324202Sbinkertn@umich.edu * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 334202Sbinkertn@umich.edu * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 344202Sbinkertn@umich.edu * 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 364486Sbinkertn@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 384202Sbinkertn@umich.edu * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 394202Sbinkertn@umich.edu * 404202Sbinkertn@umich.edu * Authors: Ali Saidi 414486Sbinkertn@umich.edu */ 424202Sbinkertn@umich.edu 434202Sbinkertn@umich.edu#ifndef __ARCH_ARM_SYSTEM_HH__ 445192Ssaidi@eecs.umich.edu#define __ARCH_ARM_SYSTEM_HH__ 455192Ssaidi@eecs.umich.edu 468335Snate@binkert.org#include <string> 475192Ssaidi@eecs.umich.edu#include <vector> 484202Sbinkertn@umich.edu 494202Sbinkertn@umich.edu#include "kern/linux/events.hh" 505529Snate@binkert.org#include "params/ArmSystem.hh" 51#include "sim/sim_object.hh" 52#include "sim/system.hh" 53 54class ArmSystem : public System 55{ 56 protected: 57 /** 58 * PC based event to skip the dprink() call and emulate its 59 * functionality 60 */ 61 Linux::DebugPrintkEvent *debugPrintkEvent; 62 63 /** 64 * Pointer to the bootloader object 65 */ 66 ObjectFile *bootldr; 67 68 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