system.hh revision 8852
12567SN/A/*
210037SARM gem5 Developers * Copyright (c) 2010 ARM Limited
37650SAli.Saidi@ARM.com * All rights reserved
47650SAli.Saidi@ARM.com *
57650SAli.Saidi@ARM.com * The license below extends only to copyright in the software and shall
67650SAli.Saidi@ARM.com * not be construed as granting a license to any other intellectual
77650SAli.Saidi@ARM.com * property including but not limited to intellectual property relating
87650SAli.Saidi@ARM.com * to a hardware implementation of the functionality of the software
97650SAli.Saidi@ARM.com * licensed hereunder.  You may use the software subject to the license
107650SAli.Saidi@ARM.com * terms below provided that you ensure that this notice is replicated
117650SAli.Saidi@ARM.com * unmodified and in its entirety in all distributions of the software,
127650SAli.Saidi@ARM.com * modified or unmodified, in source code or in binary form.
137650SAli.Saidi@ARM.com *
142567SN/A * Copyright (c) 2002-2005 The Regents of The University of Michigan
152567SN/A * All rights reserved.
162567SN/A *
172567SN/A * Redistribution and use in source and binary forms, with or without
182567SN/A * modification, are permitted provided that the following conditions are
192567SN/A * met: redistributions of source code must retain the above copyright
202567SN/A * notice, this list of conditions and the following disclaimer;
212567SN/A * redistributions in binary form must reproduce the above copyright
222567SN/A * notice, this list of conditions and the following disclaimer in the
232567SN/A * documentation and/or other materials provided with the distribution;
242567SN/A * neither the name of the copyright holders nor the names of its
252567SN/A * contributors may be used to endorse or promote products derived from
262567SN/A * this software without specific prior written permission.
272567SN/A *
282567SN/A * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
292567SN/A * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
302567SN/A * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
312567SN/A * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
322567SN/A * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
332567SN/A * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
342567SN/A * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
352567SN/A * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
362567SN/A * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
372567SN/A * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
382567SN/A * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
392665SN/A *
402665SN/A * Authors: Ali Saidi
412567SN/A */
422567SN/A
436757SAli.Saidi@ARM.com#ifndef __ARCH_ARM_SYSTEM_HH__
446757SAli.Saidi@ARM.com#define __ARCH_ARM_SYSTEM_HH__
452567SN/A
462567SN/A#include <string>
472567SN/A#include <vector>
482567SN/A
4910037SARM gem5 Developers#include "kern/linux/events.hh"
508229Snate@binkert.org#include "params/ArmSystem.hh"
516757SAli.Saidi@ARM.com#include "sim/sim_object.hh"
522567SN/A#include "sim/system.hh"
532567SN/A
542567SN/Aclass ArmSystem : public System
5510037SARM gem5 Developers{
5610037SARM gem5 Developers  protected:
576757SAli.Saidi@ARM.com    /**
582567SN/A     * PC based event to skip the dprink() call and emulate its
598285SPrakash.Ramrakhyani@arm.com     * functionality
607650SAli.Saidi@ARM.com     */
617650SAli.Saidi@ARM.com    Linux::DebugPrintkEvent *debugPrintkEvent;
627650SAli.Saidi@ARM.com
637650SAli.Saidi@ARM.com    /**
647650SAli.Saidi@ARM.com     * Pointer to the bootloader object
657650SAli.Saidi@ARM.com     */
668286SAli.Saidi@ARM.com    ObjectFile *bootldr;
678286SAli.Saidi@ARM.com
688286SAli.Saidi@ARM.com  public:
698286SAli.Saidi@ARM.com    typedef ArmSystemParams Params;
708286SAli.Saidi@ARM.com    const Params *
7110037SARM gem5 Developers    params() const
7210037SARM gem5 Developers    {
7310037SARM gem5 Developers        return dynamic_cast<const Params *>(_params);
7410037SARM gem5 Developers    }
7510037SARM gem5 Developers
7610037SARM gem5 Developers    ArmSystem(Params *p);
7710037SARM gem5 Developers    ~ArmSystem();
7810037SARM gem5 Developers
7910037SARM gem5 Developers    /**
8010037SARM gem5 Developers     * Initialise the system
8110037SARM gem5 Developers     */
8210037SARM gem5 Developers    virtual void initState();
8310037SARM gem5 Developers
8410037SARM gem5 Developers    /** Check if an address should be uncacheable until all caches are enabled.
8510037SARM gem5 Developers     * This exits because coherence on some addresses at boot is maintained via
8610037SARM gem5 Developers     * sw coherence until the caches are enbaled. Since we don't support sw
8710037SARM gem5 Developers     * coherence operations in gem5, this is a method that allows a system
8810037SARM gem5 Developers     * type to designate certain addresses that should remain uncachebale
8910037SARM gem5 Developers     * for a while.
9010037SARM gem5 Developers     */
9110037SARM gem5 Developers    virtual bool adderBootUncacheable(Addr a) { return false; }
9210037SARM gem5 Developers
9310037SARM gem5 Developers    virtual Addr fixFuncEventAddr(Addr addr)
9410037SARM gem5 Developers    {
9510037SARM gem5 Developers        // Remove the low bit that thumb symbols have set
9610037SARM gem5 Developers        // but that aren't actually odd aligned
9710037SARM gem5 Developers        if (addr & 0x1)
9810037SARM gem5 Developers            return addr & ~1;
9910037SARM gem5 Developers        return addr;
10010037SARM gem5 Developers    }
10110037SARM gem5 Developers};
10210037SARM gem5 Developers
10310037SARM gem5 Developers#endif
10410037SARM gem5 Developers
10510037SARM gem5 Developers