isa_fake.hh revision 2630
112027Sjungma@eit.uni-kl.de/* 212027Sjungma@eit.uni-kl.de * Copyright (c) 2004-2005 The Regents of The University of Michigan 312027Sjungma@eit.uni-kl.de * All rights reserved. 412027Sjungma@eit.uni-kl.de * 512027Sjungma@eit.uni-kl.de * Redistribution and use in source and binary forms, with or without 612027Sjungma@eit.uni-kl.de * modification, are permitted provided that the following conditions are 712027Sjungma@eit.uni-kl.de * met: redistributions of source code must retain the above copyright 812027Sjungma@eit.uni-kl.de * notice, this list of conditions and the following disclaimer; 912027Sjungma@eit.uni-kl.de * redistributions in binary form must reproduce the above copyright 1012027Sjungma@eit.uni-kl.de * notice, this list of conditions and the following disclaimer in the 1112027Sjungma@eit.uni-kl.de * documentation and/or other materials provided with the distribution; 1212027Sjungma@eit.uni-kl.de * neither the name of the copyright holders nor the names of its 1312027Sjungma@eit.uni-kl.de * contributors may be used to endorse or promote products derived from 1412027Sjungma@eit.uni-kl.de * this software without specific prior written permission. 1512027Sjungma@eit.uni-kl.de * 1612027Sjungma@eit.uni-kl.de * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 1712027Sjungma@eit.uni-kl.de * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 1812027Sjungma@eit.uni-kl.de * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 1912027Sjungma@eit.uni-kl.de * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 2012027Sjungma@eit.uni-kl.de * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 2112027Sjungma@eit.uni-kl.de * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 2212027Sjungma@eit.uni-kl.de * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 2312027Sjungma@eit.uni-kl.de * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 2412027Sjungma@eit.uni-kl.de * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 2512027Sjungma@eit.uni-kl.de * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 2612027Sjungma@eit.uni-kl.de * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 2712027Sjungma@eit.uni-kl.de */ 2812027Sjungma@eit.uni-kl.de 2912027Sjungma@eit.uni-kl.de/** @file 3012027Sjungma@eit.uni-kl.de * Declaration of a fake device. 3112027Sjungma@eit.uni-kl.de */ 3212027Sjungma@eit.uni-kl.de 3312027Sjungma@eit.uni-kl.de#ifndef __ISA_FAKE_HH__ 3412027Sjungma@eit.uni-kl.de#define __ISA_FAKE_HH__ 3512027Sjungma@eit.uni-kl.de 3612027Sjungma@eit.uni-kl.de#include "dev/tsunami.hh" 3712027Sjungma@eit.uni-kl.de#include "base/range.hh" 3812027Sjungma@eit.uni-kl.de#include "dev/io_device.hh" 3912027Sjungma@eit.uni-kl.de 4012027Sjungma@eit.uni-kl.de/** 4112027Sjungma@eit.uni-kl.de * IsaFake is a device that returns -1 on all reads and 4212027Sjungma@eit.uni-kl.de * accepts all writes. It is meant to be placed at an address range 4312027Sjungma@eit.uni-kl.de * so that an mcheck doesn't occur when an os probes a piece of hw 4412027Sjungma@eit.uni-kl.de * that doesn't exist (e.g. UARTs1-3). 4512027Sjungma@eit.uni-kl.de */ 4612027Sjungma@eit.uni-kl.declass IsaFake : public BasicPioDevice 4712027Sjungma@eit.uni-kl.de{ 4812027Sjungma@eit.uni-kl.de public: 4912027Sjungma@eit.uni-kl.de struct Params : public BasicPioDevice::Params 5012027Sjungma@eit.uni-kl.de { 5112027Sjungma@eit.uni-kl.de Addr pio_size; 5212027Sjungma@eit.uni-kl.de }; 5312027Sjungma@eit.uni-kl.de protected: 5412027Sjungma@eit.uni-kl.de const Params *params() const { return (const Params*)_params; } 5512027Sjungma@eit.uni-kl.de 5612027Sjungma@eit.uni-kl.de public: 5712027Sjungma@eit.uni-kl.de /** 5812027Sjungma@eit.uni-kl.de * The constructor for Tsunmami Fake just registers itself with the MMU. 5912027Sjungma@eit.uni-kl.de * @param p params structure 6012027Sjungma@eit.uni-kl.de */ 6112027Sjungma@eit.uni-kl.de IsaFake(Params *p); 6212027Sjungma@eit.uni-kl.de 6312027Sjungma@eit.uni-kl.de /** 6412027Sjungma@eit.uni-kl.de * This read always returns -1. 6512027Sjungma@eit.uni-kl.de * @param req The memory request. 6612027Sjungma@eit.uni-kl.de * @param data Where to put the data. 6712027Sjungma@eit.uni-kl.de */ 6812027Sjungma@eit.uni-kl.de virtual Tick read(Packet *pkt); 6912027Sjungma@eit.uni-kl.de 7012027Sjungma@eit.uni-kl.de /** 7112027Sjungma@eit.uni-kl.de * All writes are simply ignored. 7212027Sjungma@eit.uni-kl.de * @param req The memory request. 7312027Sjungma@eit.uni-kl.de * @param data the data to not write. 7412027Sjungma@eit.uni-kl.de */ 7512027Sjungma@eit.uni-kl.de virtual Tick write(Packet *pkt); 7612027Sjungma@eit.uni-kl.de}; 7712027Sjungma@eit.uni-kl.de 7812027Sjungma@eit.uni-kl.de#endif // __TSUNAMI_FAKE_HH__ 7912027Sjungma@eit.uni-kl.de