baddev.hh revision 2539
12139SN/A/*
22139SN/A * Copyright (c) 2004-2005 The Regents of The University of Michigan
32139SN/A * All rights reserved.
42139SN/A *
52139SN/A * Redistribution and use in source and binary forms, with or without
62139SN/A * modification, are permitted provided that the following conditions are
72139SN/A * met: redistributions of source code must retain the above copyright
82139SN/A * notice, this list of conditions and the following disclaimer;
92139SN/A * redistributions in binary form must reproduce the above copyright
102139SN/A * notice, this list of conditions and the following disclaimer in the
112139SN/A * documentation and/or other materials provided with the distribution;
122139SN/A * neither the name of the copyright holders nor the names of its
132139SN/A * contributors may be used to endorse or promote products derived from
142139SN/A * this software without specific prior written permission.
152139SN/A *
162139SN/A * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
172139SN/A * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
182139SN/A * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
192139SN/A * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
202139SN/A * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
212139SN/A * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
222139SN/A * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
232139SN/A * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
242139SN/A * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
252139SN/A * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
262139SN/A * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
272139SN/A */
282665Ssaidi@eecs.umich.edu
292665Ssaidi@eecs.umich.edu/** @file
302139SN/A * This devices just panics when touched. For example if you have a
314202Sbinkertn@umich.edu * kernel that touches the frame buffer which isn't allowed.
322139SN/A */
334202Sbinkertn@umich.edu
342152SN/A#ifndef __DEV_BADDEV_HH__
352152SN/A#define __DEV_BADDEV_HH__
362139SN/A
372139SN/A#include "base/range.hh"
382139SN/A#include "dev/io_device.hh"
392139SN/A
402139SN/A
412152SN/A/**
422152SN/A * BadDevice
432139SN/A * This device just panics when accessed. It is supposed to warn
442139SN/A * the user that the kernel they are running has unsupported
452139SN/A * options (i.e. frame buffer)
464781Snate@binkert.org */
474781Snate@binkert.orgclass BadDevice : public BasicPioDevice
487799Sgblack@eecs.umich.edu{
494781Snate@binkert.org  private:
504781Snate@binkert.org    std::string devname;
513170Sstever@eecs.umich.edu
525664Sgblack@eecs.umich.edu  public:
533806Ssaidi@eecs.umich.edu    struct Params : public BasicPioDevice::Params
546179Sksewell@umich.edu    {
554781Snate@binkert.org        std::string device_name;
564781Snate@binkert.org    };
576329Sgblack@eecs.umich.edu  protected:
584781Snate@binkert.org    const Params *params() const { return (const Params *)_params; }
594781Snate@binkert.org
604781Snate@binkert.org  public:
614781Snate@binkert.org     /**
624781Snate@binkert.org      * Constructor for the Baddev Class.
634781Snate@binkert.org      * @param p object parameters
642139SN/A      * @param a base address of the write
652139SN/A      */
663546Sgblack@eecs.umich.edu    BadDevice(Params *p);
674202Sbinkertn@umich.edu
682152SN/A    virtual Tick read(Packet &pkt);
692152SN/A    virtual Tick write(Packet &pkt);
702152SN/A};
712152SN/A
722152SN/A#endif // __DEV_BADDEV_HH__
732152SN/A