system.hh revision 7693
17934SN/A/* 27934SN/A * Copyright (c) 2010 ARM Limited 311754Sandreas.hansson@arm.com * All rights reserved 411754Sandreas.hansson@arm.com * 511754Sandreas.hansson@arm.com * The license below extends only to copyright in the software and shall 67934SN/A * not be construed as granting a license to any other intellectual 711754Sandreas.hansson@arm.com * property including but not limited to intellectual property relating 811754Sandreas.hansson@arm.com * to a hardware implementation of the functionality of the software 911754Sandreas.hansson@arm.com * licensed hereunder. You may use the software subject to the license 1011754Sandreas.hansson@arm.com * terms below provided that you ensure that this notice is replicated 1111754Sandreas.hansson@arm.com * unmodified and in its entirety in all distributions of the software, 1211754Sandreas.hansson@arm.com * modified or unmodified, in source code or in binary form. 1311754Sandreas.hansson@arm.com * 1410036SAli.Saidi@ARM.com * Copyright (c) 2002-2005 The Regents of The University of Michigan 1510036SAli.Saidi@ARM.com * All rights reserved. 1611754Sandreas.hansson@arm.com * 1710513SAli.Saidi@ARM.com * Redistribution and use in source and binary forms, with or without 1810513SAli.Saidi@ARM.com * modification, are permitted provided that the following conditions are 1910892Sandreas.hansson@arm.com * met: redistributions of source code must retain the above copyright 2011754Sandreas.hansson@arm.com * notice, this list of conditions and the following disclaimer; 2110535Sandreas.hansson@arm.com * redistributions in binary form must reproduce the above copyright 2211754Sandreas.hansson@arm.com * notice, this list of conditions and the following disclaimer in the 2310892Sandreas.hansson@arm.com * documentation and/or other materials provided with the distribution; 2410892Sandreas.hansson@arm.com * neither the name of the copyright holders nor the names of its 2511606Sandreas.sandberg@arm.com * contributors may be used to endorse or promote products derived from 2610535Sandreas.hansson@arm.com * this software without specific prior written permission. 2711606Sandreas.sandberg@arm.com * 2810513SAli.Saidi@ARM.com * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 2910513SAli.Saidi@ARM.com * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 3010892Sandreas.hansson@arm.com * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 3111754Sandreas.hansson@arm.com * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 3210535Sandreas.hansson@arm.com * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 3311754Sandreas.hansson@arm.com * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 3411606Sandreas.sandberg@arm.com * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 3510535Sandreas.hansson@arm.com * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 3611606Sandreas.sandberg@arm.com * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 3710513SAli.Saidi@ARM.com * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 3810513SAli.Saidi@ARM.com * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 3911336Sandreas.hansson@arm.com * 4011754Sandreas.hansson@arm.com * Authors: Ali Saidi 4110535Sandreas.hansson@arm.com */ 4211754Sandreas.hansson@arm.com 4311336Sandreas.hansson@arm.com#ifndef __ARCH_ARM_SYSTEM_HH__ 4411336Sandreas.hansson@arm.com#define __ARCH_ARM_SYSTEM_HH__ 4511754Sandreas.hansson@arm.com 4610535Sandreas.hansson@arm.com#include <string> 4711754Sandreas.hansson@arm.com#include <vector> 4811754Sandreas.hansson@arm.com 4910513SAli.Saidi@ARM.com#include "params/ArmSystem.hh" 5010513SAli.Saidi@ARM.com#include "sim/sim_object.hh" 5111336Sandreas.hansson@arm.com#include "sim/system.hh" 5211754Sandreas.hansson@arm.com#include "kern/linux/events.hh" 5310585Sandreas.hansson@arm.com 5411754Sandreas.hansson@arm.comclass ArmSystem : public System 5511754Sandreas.hansson@arm.com{ 5610517SAli.Saidi@ARM.com private: 5710517SAli.Saidi@ARM.com /** 5810517SAli.Saidi@ARM.com * PC based event to skip the dprink() call and emulate its 5910517SAli.Saidi@ARM.com * functionality 6010517SAli.Saidi@ARM.com */ 6110517SAli.Saidi@ARM.com Linux::DebugPrintkEvent *debugPrintkEvent; 6210517SAli.Saidi@ARM.com 6310517SAli.Saidi@ARM.com public: 6410517SAli.Saidi@ARM.com typedef ArmSystemParams Params; 6510517SAli.Saidi@ARM.com ArmSystem(Params *p); 6610517SAli.Saidi@ARM.com ~ArmSystem(); 6710517SAli.Saidi@ARM.com 6811754Sandreas.hansson@arm.com virtual Addr fixFuncEventAddr(Addr addr) 6911754Sandreas.hansson@arm.com { 7011754Sandreas.hansson@arm.com // Remove the low bit that thumb symbols have set 7110535Sandreas.hansson@arm.com // but that aren't actually odd aligned 7210535Sandreas.hansson@arm.com if (addr & 0x1) 7310535Sandreas.hansson@arm.com return (addr & ~1) | PcTBit; 7410535Sandreas.hansson@arm.com return addr; 7510535Sandreas.hansson@arm.com } 7610535Sandreas.hansson@arm.com}; 7710535Sandreas.hansson@arm.com 7811754Sandreas.hansson@arm.com#endif 7910628Sandreas.hansson@arm.com 8010628Sandreas.hansson@arm.com