intdev.cc revision 9807
15633Sgblack@eecs.umich.edu/* 28855Sandreas.hansson@arm.com * Copyright (c) 2012 ARM Limited 38855Sandreas.hansson@arm.com * All rights reserved 48855Sandreas.hansson@arm.com * 58855Sandreas.hansson@arm.com * The license below extends only to copyright in the software and shall 68855Sandreas.hansson@arm.com * not be construed as granting a license to any other intellectual 78855Sandreas.hansson@arm.com * property including but not limited to intellectual property relating 88855Sandreas.hansson@arm.com * to a hardware implementation of the functionality of the software 98855Sandreas.hansson@arm.com * licensed hereunder. You may use the software subject to the license 108855Sandreas.hansson@arm.com * terms below provided that you ensure that this notice is replicated 118855Sandreas.hansson@arm.com * unmodified and in its entirety in all distributions of the software, 128855Sandreas.hansson@arm.com * modified or unmodified, in source code or in binary form. 138855Sandreas.hansson@arm.com * 145633Sgblack@eecs.umich.edu * Copyright (c) 2008 The Regents of The University of Michigan 155633Sgblack@eecs.umich.edu * All rights reserved. 165633Sgblack@eecs.umich.edu * 175633Sgblack@eecs.umich.edu * Redistribution and use in source and binary forms, with or without 185633Sgblack@eecs.umich.edu * modification, are permitted provided that the following conditions are 195633Sgblack@eecs.umich.edu * met: redistributions of source code must retain the above copyright 205633Sgblack@eecs.umich.edu * notice, this list of conditions and the following disclaimer; 215633Sgblack@eecs.umich.edu * redistributions in binary form must reproduce the above copyright 225633Sgblack@eecs.umich.edu * notice, this list of conditions and the following disclaimer in the 235633Sgblack@eecs.umich.edu * documentation and/or other materials provided with the distribution; 245633Sgblack@eecs.umich.edu * neither the name of the copyright holders nor the names of its 255633Sgblack@eecs.umich.edu * contributors may be used to endorse or promote products derived from 265633Sgblack@eecs.umich.edu * this software without specific prior written permission. 275633Sgblack@eecs.umich.edu * 285633Sgblack@eecs.umich.edu * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 295633Sgblack@eecs.umich.edu * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 305633Sgblack@eecs.umich.edu * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 315633Sgblack@eecs.umich.edu * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 325633Sgblack@eecs.umich.edu * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 335633Sgblack@eecs.umich.edu * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 345633Sgblack@eecs.umich.edu * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 355633Sgblack@eecs.umich.edu * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 365633Sgblack@eecs.umich.edu * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 375633Sgblack@eecs.umich.edu * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 385633Sgblack@eecs.umich.edu * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 395633Sgblack@eecs.umich.edu * 405633Sgblack@eecs.umich.edu * Authors: Gabe Black 415633Sgblack@eecs.umich.edu */ 425633Sgblack@eecs.umich.edu 435633Sgblack@eecs.umich.edu#include "dev/x86/intdev.hh" 445633Sgblack@eecs.umich.edu 456045Sgblack@eecs.umich.eduvoid 469807Sstever@gmail.comX86ISA::IntDevice::IntMasterPort::sendMessage(ApicList apics, 478922Swilliam.wang@arm.com TriggerIntMessage message, 488922Swilliam.wang@arm.com bool timing) 496045Sgblack@eecs.umich.edu{ 506138Sgblack@eecs.umich.edu ApicList::iterator apicIt; 516138Sgblack@eecs.umich.edu for (apicIt = apics.begin(); apicIt != apics.end(); apicIt++) { 526138Sgblack@eecs.umich.edu PacketPtr pkt = buildIntRequest(*apicIt, message); 537899Shestness@cs.utexas.edu if (timing) { 549163Sandreas.hansson@arm.com schedTimingReq(pkt, curTick() + latency); 557899Shestness@cs.utexas.edu // The target handles cleaning up the packet in timing mode. 567899Shestness@cs.utexas.edu } else { 578855Sandreas.hansson@arm.com // ignore the latency involved in the atomic transaction 588855Sandreas.hansson@arm.com sendAtomic(pkt); 598855Sandreas.hansson@arm.com assert(pkt->isResponse()); 608855Sandreas.hansson@arm.com // also ignore the latency in handling the response 618855Sandreas.hansson@arm.com recvResponse(pkt); 627899Shestness@cs.utexas.edu delete pkt->req; 637899Shestness@cs.utexas.edu delete pkt; 647899Shestness@cs.utexas.edu } 656045Sgblack@eecs.umich.edu } 666045Sgblack@eecs.umich.edu} 676045Sgblack@eecs.umich.edu 687913SBrad.Beckmann@amd.comvoid 699807Sstever@gmail.comX86ISA::IntDevice::init() 707913SBrad.Beckmann@amd.com{ 718922Swilliam.wang@arm.com if (!intMasterPort.isConnected()) { 727913SBrad.Beckmann@amd.com panic("Int port not connected to anything!"); 737913SBrad.Beckmann@amd.com } 747913SBrad.Beckmann@amd.com} 757913SBrad.Beckmann@amd.com 765827Sgblack@eecs.umich.eduX86ISA::IntSourcePin * 775827Sgblack@eecs.umich.eduX86IntSourcePinParams::create() 785633Sgblack@eecs.umich.edu{ 795827Sgblack@eecs.umich.edu return new X86ISA::IntSourcePin(this); 805633Sgblack@eecs.umich.edu} 815827Sgblack@eecs.umich.edu 825827Sgblack@eecs.umich.eduX86ISA::IntSinkPin * 835827Sgblack@eecs.umich.eduX86IntSinkPinParams::create() 845827Sgblack@eecs.umich.edu{ 855827Sgblack@eecs.umich.edu return new X86ISA::IntSinkPin(this); 865827Sgblack@eecs.umich.edu} 875827Sgblack@eecs.umich.edu 885827Sgblack@eecs.umich.eduX86ISA::IntLine * 895827Sgblack@eecs.umich.eduX86IntLineParams::create() 905827Sgblack@eecs.umich.edu{ 915827Sgblack@eecs.umich.edu return new X86ISA::IntLine(this); 925827Sgblack@eecs.umich.edu} 93