i8237.hh revision 9808
17489Ssteve.reinhardt@amd.com/*
27489Ssteve.reinhardt@amd.com * Copyright (c) 2008 The Regents of The University of Michigan
37489Ssteve.reinhardt@amd.com * All rights reserved.
47489Ssteve.reinhardt@amd.com *
57489Ssteve.reinhardt@amd.com * Redistribution and use in source and binary forms, with or without
67489Ssteve.reinhardt@amd.com * modification, are permitted provided that the following conditions are
77489Ssteve.reinhardt@amd.com * met: redistributions of source code must retain the above copyright
87489Ssteve.reinhardt@amd.com * notice, this list of conditions and the following disclaimer;
97489Ssteve.reinhardt@amd.com * redistributions in binary form must reproduce the above copyright
107489Ssteve.reinhardt@amd.com * notice, this list of conditions and the following disclaimer in the
117489Ssteve.reinhardt@amd.com * documentation and/or other materials provided with the distribution;
127489Ssteve.reinhardt@amd.com * neither the name of the copyright holders nor the names of its
137489Ssteve.reinhardt@amd.com * contributors may be used to endorse or promote products derived from
147489Ssteve.reinhardt@amd.com * this software without specific prior written permission.
157489Ssteve.reinhardt@amd.com *
167489Ssteve.reinhardt@amd.com * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
177489Ssteve.reinhardt@amd.com * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
187489Ssteve.reinhardt@amd.com * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
197489Ssteve.reinhardt@amd.com * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
207489Ssteve.reinhardt@amd.com * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
217489Ssteve.reinhardt@amd.com * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
227489Ssteve.reinhardt@amd.com * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
237489Ssteve.reinhardt@amd.com * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
247489Ssteve.reinhardt@amd.com * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
257489Ssteve.reinhardt@amd.com * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
267489Ssteve.reinhardt@amd.com * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
277489Ssteve.reinhardt@amd.com *
287489Ssteve.reinhardt@amd.com * Authors: Gabe Black
297489Ssteve.reinhardt@amd.com */
307489Ssteve.reinhardt@amd.com
317489Ssteve.reinhardt@amd.com#ifndef __DEV_X86_I8237_HH__
327489Ssteve.reinhardt@amd.com#define __DEV_X86_I8237_HH__
337489Ssteve.reinhardt@amd.com
347489Ssteve.reinhardt@amd.com#include "dev/io_device.hh"
357489Ssteve.reinhardt@amd.com#include "params/I8237.hh"
367489Ssteve.reinhardt@amd.com
377489Ssteve.reinhardt@amd.comnamespace X86ISA
387489Ssteve.reinhardt@amd.com{
397489Ssteve.reinhardt@amd.com
407489Ssteve.reinhardt@amd.comclass I8237 : public BasicPioDevice
417489Ssteve.reinhardt@amd.com{
427489Ssteve.reinhardt@amd.com  protected:
437489Ssteve.reinhardt@amd.com    Tick latency;
447489Ssteve.reinhardt@amd.com    uint8_t maskReg;
457489Ssteve.reinhardt@amd.com
467489Ssteve.reinhardt@amd.com  public:
477489Ssteve.reinhardt@amd.com    typedef I8237Params Params;
487489Ssteve.reinhardt@amd.com
497489Ssteve.reinhardt@amd.com    const Params *
507489Ssteve.reinhardt@amd.com    params() const
517489Ssteve.reinhardt@amd.com    {
527489Ssteve.reinhardt@amd.com        return dynamic_cast<const Params *>(_params);
537489Ssteve.reinhardt@amd.com    }
547489Ssteve.reinhardt@amd.com
557489Ssteve.reinhardt@amd.com    I8237(Params *p) : BasicPioDevice(p, 16), latency(p->pio_latency), maskReg(0)
567489Ssteve.reinhardt@amd.com    {
577489Ssteve.reinhardt@amd.com    }
587489Ssteve.reinhardt@amd.com    Tick read(PacketPtr pkt);
597489Ssteve.reinhardt@amd.com
607489Ssteve.reinhardt@amd.com    Tick write(PacketPtr pkt);
617489Ssteve.reinhardt@amd.com
627489Ssteve.reinhardt@amd.com    virtual void serialize(std::ostream &os);
637489Ssteve.reinhardt@amd.com    virtual void unserialize(Checkpoint *cp, const std::string &section);
647489Ssteve.reinhardt@amd.com};
657489Ssteve.reinhardt@amd.com
667489Ssteve.reinhardt@amd.com} // namespace X86ISA
677489Ssteve.reinhardt@amd.com
687489Ssteve.reinhardt@amd.com#endif //__DEV_X86_I8237_HH__
697489Ssteve.reinhardt@amd.com