baddev.hh revision 2665
1802SN/A/* 21762SN/A * Copyright (c) 2004-2005 The Regents of The University of Michigan 3802SN/A * All rights reserved. 4802SN/A * 5802SN/A * Redistribution and use in source and binary forms, with or without 6802SN/A * modification, are permitted provided that the following conditions are 7802SN/A * met: redistributions of source code must retain the above copyright 8802SN/A * notice, this list of conditions and the following disclaimer; 9802SN/A * redistributions in binary form must reproduce the above copyright 10802SN/A * notice, this list of conditions and the following disclaimer in the 11802SN/A * documentation and/or other materials provided with the distribution; 12802SN/A * neither the name of the copyright holders nor the names of its 13802SN/A * contributors may be used to endorse or promote products derived from 14802SN/A * this software without specific prior written permission. 15802SN/A * 16802SN/A * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 17802SN/A * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 18802SN/A * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 19802SN/A * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 20802SN/A * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 21802SN/A * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 22802SN/A * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23802SN/A * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24802SN/A * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25802SN/A * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26802SN/A * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 272665Ssaidi@eecs.umich.edu * 282665Ssaidi@eecs.umich.edu * Authors: Ali Saidi 29802SN/A */ 30802SN/A 311722SN/A/** @file 32802SN/A * This devices just panics when touched. For example if you have a 33802SN/A * kernel that touches the frame buffer which isn't allowed. 34802SN/A */ 35802SN/A 361310SN/A#ifndef __DEV_BADDEV_HH__ 371310SN/A#define __DEV_BADDEV_HH__ 38802SN/A 39909SN/A#include "base/range.hh" 40909SN/A#include "dev/io_device.hh" 41802SN/A 422257SN/A 43802SN/A/** 44802SN/A * BadDevice 45802SN/A * This device just panics when accessed. It is supposed to warn 46802SN/A * the user that the kernel they are running has unsupported 47802SN/A * options (i.e. frame buffer) 48802SN/A */ 492539SN/Aclass BadDevice : public BasicPioDevice 50802SN/A{ 51802SN/A private: 522539SN/A std::string devname; 53802SN/A 542539SN/A public: 552539SN/A struct Params : public BasicPioDevice::Params 562539SN/A { 572539SN/A std::string device_name; 582539SN/A }; 592539SN/A protected: 602539SN/A const Params *params() const { return (const Params *)_params; } 61802SN/A 62802SN/A public: 63885SN/A /** 64885SN/A * Constructor for the Baddev Class. 652539SN/A * @param p object parameters 66885SN/A * @param a base address of the write 67885SN/A */ 682539SN/A BadDevice(Params *p); 69802SN/A 702630SN/A virtual Tick read(Packet *pkt); 712630SN/A virtual Tick write(Packet *pkt); 72802SN/A}; 73802SN/A 741310SN/A#endif // __DEV_BADDEV_HH__ 75