system.hh revision 8286
12207SN/A/*
25254Sksewell@umich.edu * Copyright (c) 2010 ARM Limited
35254Sksewell@umich.edu * All rights reserved
42207SN/A *
55254Sksewell@umich.edu * The license below extends only to copyright in the software and shall
65254Sksewell@umich.edu * not be construed as granting a license to any other intellectual
75254Sksewell@umich.edu * property including but not limited to intellectual property relating
85254Sksewell@umich.edu * to a hardware implementation of the functionality of the software
95254Sksewell@umich.edu * licensed hereunder.  You may use the software subject to the license
105254Sksewell@umich.edu * terms below provided that you ensure that this notice is replicated
115254Sksewell@umich.edu * unmodified and in its entirety in all distributions of the software,
125254Sksewell@umich.edu * modified or unmodified, in source code or in binary form.
135254Sksewell@umich.edu *
145254Sksewell@umich.edu * Copyright (c) 2002-2005 The Regents of The University of Michigan
152207SN/A * All rights reserved.
165254Sksewell@umich.edu *
175254Sksewell@umich.edu * Redistribution and use in source and binary forms, with or without
185254Sksewell@umich.edu * modification, are permitted provided that the following conditions are
195254Sksewell@umich.edu * met: redistributions of source code must retain the above copyright
205254Sksewell@umich.edu * notice, this list of conditions and the following disclaimer;
215254Sksewell@umich.edu * redistributions in binary form must reproduce the above copyright
225254Sksewell@umich.edu * notice, this list of conditions and the following disclaimer in the
235254Sksewell@umich.edu * documentation and/or other materials provided with the distribution;
245254Sksewell@umich.edu * neither the name of the copyright holders nor the names of its
255254Sksewell@umich.edu * contributors may be used to endorse or promote products derived from
265254Sksewell@umich.edu * this software without specific prior written permission.
272665Ssaidi@eecs.umich.edu *
285254Sksewell@umich.edu * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
295254Sksewell@umich.edu * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
305254Sksewell@umich.edu * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
312207SN/A * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
322207SN/A * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
3311793Sbrandon.potter@amd.com * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
3411793Sbrandon.potter@amd.com * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
352474SN/A * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
368229Snate@binkert.org * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
372454SN/A * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
382454SN/A * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
392680Sktlim@umich.edu *
408232Snate@binkert.org * Authors: Ali Saidi
416650Sksewell@umich.edu */
4211854Sbrandon.potter@amd.com
436650Sksewell@umich.edu#ifndef __ARCH_ARM_SYSTEM_HH__
446650Sksewell@umich.edu#define __ARCH_ARM_SYSTEM_HH__
4511800Sbrandon.potter@amd.com
462474SN/A#include <string>
472207SN/A#include <vector>
482447SN/A
492474SN/A#include "kern/linux/events.hh"
502447SN/A#include "params/ArmSystem.hh"
5111851Sbrandon.potter@amd.com#include "sim/sim_object.hh"
5211851Sbrandon.potter@amd.com#include "sim/system.hh"
532474SN/A
542686Sksewell@umich.educlass ArmSystem : public System
552686Sksewell@umich.edu{
5611886Sbrandon.potter@amd.com  protected:
572474SN/A    /**
582474SN/A     * PC based event to skip the dprink() call and emulate its
5911886Sbrandon.potter@amd.com     * functionality
602474SN/A     */
612686Sksewell@umich.edu    Linux::DebugPrintkEvent *debugPrintkEvent;
6211886Sbrandon.potter@amd.com
6311886Sbrandon.potter@amd.com    /**
6411886Sbrandon.potter@amd.com     * Pointer to the bootloader object
652686Sksewell@umich.edu     */
666811SMatt DeVuyst    ObjectFile *bootldr;
6711886Sbrandon.potter@amd.com
682474SN/A  public:
692474SN/A    typedef ArmSystemParams Params;
702474SN/A    const Params *
7111851Sbrandon.potter@amd.com    params() const
722474SN/A    {
7311851Sbrandon.potter@amd.com        return dynamic_cast<const Params *>(_params);
746650Sksewell@umich.edu    }
7510318Sandreas.hansson@arm.com
762474SN/A    ArmSystem(Params *p);
775958Sgblack@eecs.umich.edu    ~ArmSystem();
786811SMatt DeVuyst
796650Sksewell@umich.edu    void initState();
8011851Sbrandon.potter@amd.com
816650Sksewell@umich.edu    virtual Addr fixFuncEventAddr(Addr addr)
826811SMatt DeVuyst    {
836811SMatt DeVuyst        // Remove the low bit that thumb symbols have set
8411389Sbrandon.potter@amd.com        // but that aren't actually odd aligned
8511389Sbrandon.potter@amd.com        if (addr & 0x1)
8611389Sbrandon.potter@amd.com            return addr & ~1;
876650Sksewell@umich.edu        return addr;
886650Sksewell@umich.edu    }
896650Sksewell@umich.edu};
906811SMatt DeVuyst
916811SMatt DeVuyst#endif
926811SMatt DeVuyst
936811SMatt DeVuyst