speaker.hh revision 5445
15347Ssaidi@eecs.umich.edu/*
23395Shsul@eecs.umich.edu * Copyright (c) 2008 The Regents of The University of Michigan
33395Shsul@eecs.umich.edu * All rights reserved.
43395Shsul@eecs.umich.edu *
53395Shsul@eecs.umich.edu * Redistribution and use in source and binary forms, with or without
63395Shsul@eecs.umich.edu * modification, are permitted provided that the following conditions are
73395Shsul@eecs.umich.edu * met: redistributions of source code must retain the above copyright
83395Shsul@eecs.umich.edu * notice, this list of conditions and the following disclaimer;
93395Shsul@eecs.umich.edu * redistributions in binary form must reproduce the above copyright
103395Shsul@eecs.umich.edu * notice, this list of conditions and the following disclaimer in the
113395Shsul@eecs.umich.edu * documentation and/or other materials provided with the distribution;
123395Shsul@eecs.umich.edu * neither the name of the copyright holders nor the names of its
133395Shsul@eecs.umich.edu * contributors may be used to endorse or promote products derived from
143395Shsul@eecs.umich.edu * this software without specific prior written permission.
153395Shsul@eecs.umich.edu *
163395Shsul@eecs.umich.edu * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
173395Shsul@eecs.umich.edu * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
183395Shsul@eecs.umich.edu * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
193395Shsul@eecs.umich.edu * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
203395Shsul@eecs.umich.edu * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
213395Shsul@eecs.umich.edu * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
223395Shsul@eecs.umich.edu * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
233395Shsul@eecs.umich.edu * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
243395Shsul@eecs.umich.edu * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
253395Shsul@eecs.umich.edu * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
263395Shsul@eecs.umich.edu * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
273395Shsul@eecs.umich.edu *
283395Shsul@eecs.umich.edu * Authors: Gabe Black
293395Shsul@eecs.umich.edu */
303509Shsul@eecs.umich.edu
316654Snate@binkert.org#ifndef __DEV_X86_SOUTH_BRIDGE_SPEAKER_HH__
323395Shsul@eecs.umich.edu#define __DEV_X86_SOUTH_BRIDGE_SPEAKER_HH__
336654Snate@binkert.org
343395Shsul@eecs.umich.edu#include "arch/x86/x86_traits.hh"
356654Snate@binkert.org#include "base/range.hh"
366654Snate@binkert.org#include "dev/x86/south_bridge/sub_device.hh"
376654Snate@binkert.org
383395Shsul@eecs.umich.edunamespace X86ISA
393481Shsul@eecs.umich.edu{
403481Shsul@eecs.umich.edu
413481Shsul@eecs.umich.educlass I8254;
423481Shsul@eecs.umich.edu
435347Ssaidi@eecs.umich.educlass Speaker : public SubDevice
443481Shsul@eecs.umich.edu{
453681Sktlim@umich.edu  protected:
463681Sktlim@umich.edu    BitUnion8(SpeakerControl)
473681Sktlim@umich.edu        Bitfield<0> gate;
485347Ssaidi@eecs.umich.edu        Bitfield<1> speaker;
495869Sksewell@umich.edu        Bitfield<5> timer;
505869Sksewell@umich.edu    EndBitUnion(SpeakerControl)
515869Sksewell@umich.edu
525869Sksewell@umich.edu    SpeakerControl controlVal;
535869Sksewell@umich.edu
543481Shsul@eecs.umich.edu    I8254 * timer;
555347Ssaidi@eecs.umich.edu
563481Shsul@eecs.umich.edu  public:
573481Shsul@eecs.umich.edu
583481Shsul@eecs.umich.edu    Speaker(I8254 * _timer) : timer(_timer)
593481Shsul@eecs.umich.edu    {}
603481Shsul@eecs.umich.edu    Speaker(I8254 * _timer, Tick _latency) :
613481Shsul@eecs.umich.edu        SubDevice(_latency), timer(_timer)
625369Ssaidi@eecs.umich.edu    {}
633481Shsul@eecs.umich.edu    Speaker(I8254 * _timer, Addr start, Addr size, Tick _latency) :
645347Ssaidi@eecs.umich.edu        SubDevice(start, size, _latency), timer(_timer)
653481Shsul@eecs.umich.edu    {}
663481Shsul@eecs.umich.edu
673481Shsul@eecs.umich.edu    Tick read(PacketPtr pkt);
683481Shsul@eecs.umich.edu
693481Shsul@eecs.umich.edu    Tick write(PacketPtr pkt);
703481Shsul@eecs.umich.edu};
713481Shsul@eecs.umich.edu
723395Shsul@eecs.umich.edu}; // namespace X86ISA
733395Shsul@eecs.umich.edu
743395Shsul@eecs.umich.edu#endif //__DEV_X86_SOUTH_BRIDGE_SPEAKER_HH__
754167Sbinkertn@umich.edu