amba_fake.hh revision 7584
17584SAli.Saidi@arm.com/* 27584SAli.Saidi@arm.com * Copyright (c) 2010 ARM Limited 37584SAli.Saidi@arm.com * All rights reserved 47584SAli.Saidi@arm.com * 57584SAli.Saidi@arm.com * The license below extends only to copyright in the software and shall 67584SAli.Saidi@arm.com * not be construed as granting a license to any other intellectual 77584SAli.Saidi@arm.com * property including but not limited to intellectual property relating 87584SAli.Saidi@arm.com * to a hardware implementation of the functionality of the software 97584SAli.Saidi@arm.com * licensed hereunder. You may use the software subject to the license 107584SAli.Saidi@arm.com * terms below provided that you ensure that this notice is replicated 117584SAli.Saidi@arm.com * unmodified and in its entirety in all distributions of the software, 127584SAli.Saidi@arm.com * modified or unmodified, in source code or in binary form. 137584SAli.Saidi@arm.com * 147584SAli.Saidi@arm.com * Copyright (c) 2005 The Regents of The University of Michigan 157584SAli.Saidi@arm.com * All rights reserved. 167584SAli.Saidi@arm.com * 177584SAli.Saidi@arm.com * Redistribution and use in source and binary forms, with or without 187584SAli.Saidi@arm.com * modification, are permitted provided that the following conditions are 197584SAli.Saidi@arm.com * met: redistributions of source code must retain the above copyright 207584SAli.Saidi@arm.com * notice, this list of conditions and the following disclaimer; 217584SAli.Saidi@arm.com * redistributions in binary form must reproduce the above copyright 227584SAli.Saidi@arm.com * notice, this list of conditions and the following disclaimer in the 237584SAli.Saidi@arm.com * documentation and/or other materials provided with the distribution; 247584SAli.Saidi@arm.com * neither the name of the copyright holders nor the names of its 257584SAli.Saidi@arm.com * contributors may be used to endorse or promote products derived from 267584SAli.Saidi@arm.com * this software without specific prior written permission. 277584SAli.Saidi@arm.com * 287584SAli.Saidi@arm.com * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 297584SAli.Saidi@arm.com * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 307584SAli.Saidi@arm.com * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 317584SAli.Saidi@arm.com * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 327584SAli.Saidi@arm.com * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 337584SAli.Saidi@arm.com * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 347584SAli.Saidi@arm.com * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 357584SAli.Saidi@arm.com * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 367584SAli.Saidi@arm.com * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 377584SAli.Saidi@arm.com * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 387584SAli.Saidi@arm.com * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 397584SAli.Saidi@arm.com * 407584SAli.Saidi@arm.com * Authors: Ali Saidi 417584SAli.Saidi@arm.com */ 427584SAli.Saidi@arm.com 437584SAli.Saidi@arm.com 447584SAli.Saidi@arm.com/** @file 457584SAli.Saidi@arm.com * This device sits in memory and reponds appropriately so the linux kernel 467584SAli.Saidi@arm.com * ignores the device it is trying to talk to. It is used so the kernel doesn't 477584SAli.Saidi@arm.com * need to be modified and devices that we are not interested in will simply be 487584SAli.Saidi@arm.com * skipped. 497584SAli.Saidi@arm.com */ 507584SAli.Saidi@arm.com 517584SAli.Saidi@arm.com#ifndef __DEV_ARM_AMBA_FAKE_H__ 527584SAli.Saidi@arm.com#define __DEV_ARM_AMBA_FAKE_H__ 537584SAli.Saidi@arm.com 547584SAli.Saidi@arm.com#include "base/range.hh" 557584SAli.Saidi@arm.com#include "dev/arm/amba_device.hh" 567584SAli.Saidi@arm.com#include "params/AmbaFake.hh" 577584SAli.Saidi@arm.com 587584SAli.Saidi@arm.comclass AmbaFake : public AmbaDevice 597584SAli.Saidi@arm.com{ 607584SAli.Saidi@arm.com public: 617584SAli.Saidi@arm.com typedef AmbaFakeParams Params; 627584SAli.Saidi@arm.com const Params * 637584SAli.Saidi@arm.com params() const 647584SAli.Saidi@arm.com { 657584SAli.Saidi@arm.com return dynamic_cast<const Params *>(_params); 667584SAli.Saidi@arm.com } 677584SAli.Saidi@arm.com AmbaFake(const Params *p); 687584SAli.Saidi@arm.com 697584SAli.Saidi@arm.com virtual Tick read(PacketPtr pkt); 707584SAli.Saidi@arm.com virtual Tick write(PacketPtr pkt); 717584SAli.Saidi@arm.com 727584SAli.Saidi@arm.com}; 737584SAli.Saidi@arm.com 747584SAli.Saidi@arm.com#endif //__DEV_ARM_AMBA_FAKE_H__ 75