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 "dev/io_device.hh"
404762Snate@binkert.org#include "params/BadDevice.hh"
412257SN/A
42802SN/A/**
43802SN/A * BadDevice
44802SN/A * This device just panics when accessed. It is supposed to warn
45802SN/A * the user that the kernel they are running has unsupported
46802SN/A * options (i.e. frame buffer)
47802SN/A */
482539SN/Aclass BadDevice : public BasicPioDevice
49802SN/A{
50802SN/A  private:
512539SN/A    std::string devname;
52802SN/A
532539SN/A  public:
544762Snate@binkert.org    typedef BadDeviceParams Params;
554762Snate@binkert.org
564762Snate@binkert.org  protected:
574762Snate@binkert.org    const Params *
584762Snate@binkert.org    params() const
592539SN/A    {
604762Snate@binkert.org        return dynamic_cast<const Params *>(_params);
614762Snate@binkert.org    }
62802SN/A
63802SN/A  public:
64885SN/A     /**
65885SN/A      * Constructor for the Baddev Class.
662539SN/A      * @param p object parameters
67885SN/A      * @param a base address of the write
68885SN/A      */
692539SN/A    BadDevice(Params *p);
70802SN/A
713349Sbinkertn@umich.edu    virtual Tick read(PacketPtr pkt);
723349Sbinkertn@umich.edu    virtual Tick write(PacketPtr pkt);
73802SN/A};
74802SN/A
751310SN/A#endif // __DEV_BADDEV_HH__
76