speaker.hh revision 5826
1451SN/A/* 21762SN/A * Copyright (c) 2008 The Regents of The University of Michigan 3451SN/A * All rights reserved. 4451SN/A * 5451SN/A * Redistribution and use in source and binary forms, with or without 6451SN/A * modification, are permitted provided that the following conditions are 7451SN/A * met: redistributions of source code must retain the above copyright 8451SN/A * notice, this list of conditions and the following disclaimer; 9451SN/A * redistributions in binary form must reproduce the above copyright 10451SN/A * notice, this list of conditions and the following disclaimer in the 11451SN/A * documentation and/or other materials provided with the distribution; 12451SN/A * neither the name of the copyright holders nor the names of its 13451SN/A * contributors may be used to endorse or promote products derived from 14451SN/A * this software without specific prior written permission. 15451SN/A * 16451SN/A * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 17451SN/A * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 18451SN/A * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 19451SN/A * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 20451SN/A * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 21451SN/A * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 22451SN/A * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23451SN/A * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24451SN/A * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25451SN/A * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 26451SN/A * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 272665Ssaidi@eecs.umich.edu * 282665Ssaidi@eecs.umich.edu * Authors: Gabe Black 292665Ssaidi@eecs.umich.edu */ 302665Ssaidi@eecs.umich.edu 312665Ssaidi@eecs.umich.edu#ifndef __DEV_X86_SPEAKER_HH__ 32451SN/A#define __DEV_X86_SPEAKER_HH__ 33451SN/A 34885SN/A#include "base/bitunion.hh" 35885SN/A#include "params/PcSpeaker.hh" 361040SN/A 371040SN/Anamespace X86ISA 381040SN/A{ 391040SN/A 401040SN/Aclass I8254; 41885SN/A 42885SN/Aclass Speaker : public BasicPioDevice 432212SN/A{ 4411793Sbrandon.potter@amd.com protected: 458229Snate@binkert.org Tick latency; 462158SN/A 479329Sdam.sunwoo@arm.com BitUnion8(SpeakerControl) 488229Snate@binkert.org Bitfield<0> gate; 491180SN/A Bitfield<1> speaker; 508229Snate@binkert.org Bitfield<5> timer; 512680Sktlim@umich.edu EndBitUnion(SpeakerControl) 528232Snate@binkert.org 538229Snate@binkert.org SpeakerControl controlVal; 541885SN/A 552521SN/A I8254 * timer; 562521SN/A 574826Ssaidi@eecs.umich.edu public: 582036SN/A typedef PcSpeakerParams Params; 59451SN/A 60451SN/A const Params * 612212SN/A params() const 622212SN/A { 63451SN/A return dynamic_cast<const Params *>(_params); 642212SN/A } 652158SN/A 66451SN/A Speaker(Params *p) : BasicPioDevice(p), 678706Sandreas.hansson@arm.com latency(p->pio_latency), controlVal(0), timer(p->i8254) 688706Sandreas.hansson@arm.com { 698706Sandreas.hansson@arm.com pioSize = 1; 708706Sandreas.hansson@arm.com } 718706Sandreas.hansson@arm.com 728706Sandreas.hansson@arm.com Tick read(PacketPtr pkt); 738706Sandreas.hansson@arm.com 748706Sandreas.hansson@arm.com Tick write(PacketPtr pkt); 758706Sandreas.hansson@arm.com}; 768706Sandreas.hansson@arm.com 778706Sandreas.hansson@arm.com}; // namespace X86ISA 78451SN/A 791855SN/A#endif //__DEV_X86_SPEAKER_HH__ 801855SN/A