baddev.hh revision 9235:5aa4896ed55a
172SN/A/* 211274Sshingarov@labware.com * Copyright (c) 2004-2005 The Regents of The University of Michigan 310597Sgabeblack@google.com * All rights reserved. 41762SN/A * 572SN/A * Redistribution and use in source and binary forms, with or without 672SN/A * modification, are permitted provided that the following conditions are 772SN/A * met: redistributions of source code must retain the above copyright 872SN/A * notice, this list of conditions and the following disclaimer; 972SN/A * redistributions in binary form must reproduce the above copyright 1072SN/A * notice, this list of conditions and the following disclaimer in the 1172SN/A * documentation and/or other materials provided with the distribution; 1272SN/A * neither the name of the copyright holders nor the names of its 1372SN/A * contributors may be used to endorse or promote products derived from 1472SN/A * this software without specific prior written permission. 1572SN/A * 1672SN/A * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 1772SN/A * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 1872SN/A * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 1972SN/A * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 2072SN/A * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 2172SN/A * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 2272SN/A * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 2372SN/A * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 2472SN/A * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 2572SN/A * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 2672SN/A * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 2772SN/A * 2872SN/A * Authors: Ali Saidi 292665Ssaidi@eecs.umich.edu */ 302665Ssaidi@eecs.umich.edu 3111274Sshingarov@labware.com/** @file 3272SN/A * This devices just panics when touched. For example if you have a 3372SN/A * kernel that touches the frame buffer which isn't allowed. 342SN/A */ 358332Snate@binkert.org 368332Snate@binkert.org#ifndef __DEV_BADDEV_HH__ 372SN/A#define __DEV_BADDEV_HH__ 382SN/A 392SN/A#include "dev/io_device.hh" 402SN/A#include "params/BadDevice.hh" 412SN/A 422SN/A/** 432SN/A * BadDevice 445543Ssaidi@eecs.umich.edu * This device just panics when accessed. It is supposed to warn 455543Ssaidi@eecs.umich.edu * the user that the kernel they are running has unsupported 462SN/A * options (i.e. frame buffer) 472SN/A */ 482SN/Aclass BadDevice : public BasicPioDevice 492SN/A{ 502SN/A private: 512SN/A std::string devname; 522SN/A 532SN/A public: 542SN/A typedef BadDeviceParams Params; 552SN/A 562SN/A protected: 575543Ssaidi@eecs.umich.edu const Params * 585543Ssaidi@eecs.umich.edu params() const 592SN/A { 602SN/A return dynamic_cast<const Params *>(_params); 612SN/A } 622SN/A 632SN/A public: 642SN/A /** 652SN/A * Constructor for the Baddev Class. 662SN/A * @param p object parameters 672SN/A * @param a base address of the write 682SN/A */ 692SN/A BadDevice(Params *p); 702SN/A 712SN/A virtual Tick read(PacketPtr pkt); 722SN/A virtual Tick write(PacketPtr pkt); 732SN/A}; 742SN/A 755543Ssaidi@eecs.umich.edu#endif // __DEV_BADDEV_HH__ 762SN/A