baddev.hh revision 4762:c94e103c83ad
12SN/A/* 21762SN/A * Copyright (c) 2004-2005 The Regents of The University of Michigan 32SN/A * All rights reserved. 42SN/A * 52SN/A * Redistribution and use in source and binary forms, with or without 62SN/A * modification, are permitted provided that the following conditions are 72SN/A * met: redistributions of source code must retain the above copyright 82SN/A * notice, this list of conditions and the following disclaimer; 92SN/A * redistributions in binary form must reproduce the above copyright 102SN/A * notice, this list of conditions and the following disclaimer in the 112SN/A * documentation and/or other materials provided with the distribution; 122SN/A * neither the name of the copyright holders nor the names of its 132SN/A * contributors may be used to endorse or promote products derived from 142SN/A * this software without specific prior written permission. 152SN/A * 162SN/A * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 172SN/A * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 182SN/A * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 192SN/A * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 202SN/A * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 212SN/A * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 222SN/A * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 232SN/A * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 242SN/A * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 252SN/A * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 262SN/A * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 272665Ssaidi@eecs.umich.edu * 282665Ssaidi@eecs.umich.edu * Authors: Ali Saidi 292665Ssaidi@eecs.umich.edu */ 302SN/A 312SN/A/** @file 328946Sandreas.hansson@arm.com * This devices just panics when touched. For example if you have a 332SN/A * kernel that touches the frame buffer which isn't allowed. 342SN/A */ 358229Snate@binkert.org 362SN/A#ifndef __DEV_BADDEV_HH__ 372SN/A#define __DEV_BADDEV_HH__ 3856SN/A 3956SN/A#include "base/range.hh" 402SN/A#include "dev/io_device.hh" 412SN/A#include "params/BadDevice.hh" 422SN/A 432SN/A/** 442SN/A * BadDevice 452SN/A * This device just panics when accessed. It is supposed to warn 462SN/A * the user that the kernel they are running has unsupported 472SN/A * options (i.e. frame buffer) 48160SN/A */ 49160SN/Aclass BadDevice : public BasicPioDevice 502SN/A{ 512SN/A private: 522SN/A std::string devname; 532SN/A 542SN/A public: 552SN/A typedef BadDeviceParams Params; 562SN/A 572SN/A protected: 582SN/A const Params * 592SN/A params() const 602SN/A { 612SN/A return dynamic_cast<const Params *>(_params); 622SN/A } 632SN/A 642SN/A public: 652SN/A /** 662SN/A * Constructor for the Baddev Class. 672SN/A * @param p object parameters 682SN/A * @param a base address of the write 692SN/A */ 702SN/A BadDevice(Params *p); 712SN/A 722SN/A virtual Tick read(PacketPtr pkt); 732SN/A virtual Tick write(PacketPtr pkt); 742SN/A}; 752SN/A 762SN/A#endif // __DEV_BADDEV_HH__ 772SN/A