intdev.cc revision 8855:74490e94da0c
111661Stushar@ece.gatech.edu/* 211661Stushar@ece.gatech.edu * Copyright (c) 2012 ARM Limited 311661Stushar@ece.gatech.edu * All rights reserved 411661Stushar@ece.gatech.edu * 511661Stushar@ece.gatech.edu * The license below extends only to copyright in the software and shall 611661Stushar@ece.gatech.edu * not be construed as granting a license to any other intellectual 711661Stushar@ece.gatech.edu * property including but not limited to intellectual property relating 811661Stushar@ece.gatech.edu * to a hardware implementation of the functionality of the software 911661Stushar@ece.gatech.edu * licensed hereunder. You may use the software subject to the license 1011661Stushar@ece.gatech.edu * terms below provided that you ensure that this notice is replicated 1111661Stushar@ece.gatech.edu * unmodified and in its entirety in all distributions of the software, 1211661Stushar@ece.gatech.edu * modified or unmodified, in source code or in binary form. 1311661Stushar@ece.gatech.edu * 1411661Stushar@ece.gatech.edu * Copyright (c) 2008 The Regents of The University of Michigan 1511661Stushar@ece.gatech.edu * All rights reserved. 1611661Stushar@ece.gatech.edu * 1711661Stushar@ece.gatech.edu * Redistribution and use in source and binary forms, with or without 1811661Stushar@ece.gatech.edu * modification, are permitted provided that the following conditions are 1911661Stushar@ece.gatech.edu * met: redistributions of source code must retain the above copyright 2011661Stushar@ece.gatech.edu * notice, this list of conditions and the following disclaimer; 2111661Stushar@ece.gatech.edu * redistributions in binary form must reproduce the above copyright 2211661Stushar@ece.gatech.edu * notice, this list of conditions and the following disclaimer in the 2311661Stushar@ece.gatech.edu * documentation and/or other materials provided with the distribution; 2411661Stushar@ece.gatech.edu * neither the name of the copyright holders nor the names of its 2511661Stushar@ece.gatech.edu * contributors may be used to endorse or promote products derived from 2611661Stushar@ece.gatech.edu * this software without specific prior written permission. 2711661Stushar@ece.gatech.edu * 2811661Stushar@ece.gatech.edu * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 2911661Stushar@ece.gatech.edu * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 3011661Stushar@ece.gatech.edu * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 3111661Stushar@ece.gatech.edu * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 3211661Stushar@ece.gatech.edu * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 3311661Stushar@ece.gatech.edu * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 3411682Sandreas.hansson@arm.com * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 3511670Sandreas.hansson@arm.com * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 3611661Stushar@ece.gatech.edu * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 3711682Sandreas.hansson@arm.com * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 3811670Sandreas.hansson@arm.com * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 3911661Stushar@ece.gatech.edu * 4011661Stushar@ece.gatech.edu * Authors: Gabe Black 4111661Stushar@ece.gatech.edu */ 4211661Stushar@ece.gatech.edu 4311661Stushar@ece.gatech.edu#include "dev/x86/intdev.hh" 4411661Stushar@ece.gatech.edu 4511661Stushar@ece.gatech.eduvoid 4611661Stushar@ece.gatech.eduX86ISA::IntDev::IntPort::sendMessage(ApicList apics, TriggerIntMessage message, 4711661Stushar@ece.gatech.edu bool timing) 4811661Stushar@ece.gatech.edu{ 4911661Stushar@ece.gatech.edu ApicList::iterator apicIt; 5011661Stushar@ece.gatech.edu for (apicIt = apics.begin(); apicIt != apics.end(); apicIt++) { 5111661Stushar@ece.gatech.edu PacketPtr pkt = buildIntRequest(*apicIt, message); 5211661Stushar@ece.gatech.edu if (timing) { 5311661Stushar@ece.gatech.edu schedSendTiming(pkt, curTick() + latency); 5411661Stushar@ece.gatech.edu // The target handles cleaning up the packet in timing mode. 5511661Stushar@ece.gatech.edu } else { 5611661Stushar@ece.gatech.edu // ignore the latency involved in the atomic transaction 5711661Stushar@ece.gatech.edu sendAtomic(pkt); 5811661Stushar@ece.gatech.edu assert(pkt->isResponse()); 5911661Stushar@ece.gatech.edu // also ignore the latency in handling the response 6011661Stushar@ece.gatech.edu recvResponse(pkt); 6111661Stushar@ece.gatech.edu delete pkt->req; 6211661Stushar@ece.gatech.edu delete pkt; 6311661Stushar@ece.gatech.edu } 6411661Stushar@ece.gatech.edu } 6511661Stushar@ece.gatech.edu} 6611661Stushar@ece.gatech.edu 6711661Stushar@ece.gatech.eduvoid 6811661Stushar@ece.gatech.eduX86ISA::IntDev::init() 6911661Stushar@ece.gatech.edu{ 7011661Stushar@ece.gatech.edu if (!intPort.isConnected()) { 7111661Stushar@ece.gatech.edu panic("Int port not connected to anything!"); 7211661Stushar@ece.gatech.edu } 7311661Stushar@ece.gatech.edu intPort.sendRangeChange(); 7411661Stushar@ece.gatech.edu} 7511661Stushar@ece.gatech.edu 7611661Stushar@ece.gatech.eduX86ISA::IntSourcePin * 7711661Stushar@ece.gatech.eduX86IntSourcePinParams::create() 7811661Stushar@ece.gatech.edu{ 7911661Stushar@ece.gatech.edu return new X86ISA::IntSourcePin(this); 8011661Stushar@ece.gatech.edu} 8111661Stushar@ece.gatech.edu 8211661Stushar@ece.gatech.eduX86ISA::IntSinkPin * 8311661Stushar@ece.gatech.eduX86IntSinkPinParams::create() 8411661Stushar@ece.gatech.edu{ 8511661Stushar@ece.gatech.edu return new X86ISA::IntSinkPin(this); 8611661Stushar@ece.gatech.edu} 8711661Stushar@ece.gatech.edu 8811661Stushar@ece.gatech.eduX86ISA::IntLine * 8911661Stushar@ece.gatech.eduX86IntLineParams::create() 9011661Stushar@ece.gatech.edu{ 9111661Stushar@ece.gatech.edu return new X86ISA::IntLine(this); 9211661Stushar@ece.gatech.edu} 9311661Stushar@ece.gatech.edu